tokentracker-cli 0.25.0 → 0.25.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 (45) hide show
  1. package/dashboard/dist/assets/{ActivityHeatmap-CiilYEqW.js → ActivityHeatmap-CB0rCGvm.js} +1 -1
  2. package/dashboard/dist/assets/{Card-BkDHn179.js → Card-BfKA33l_.js} +1 -1
  3. package/dashboard/dist/assets/{DashboardPage-BwTkSsim.js → DashboardPage-u0vbeset.js} +1 -1
  4. package/dashboard/dist/assets/{DevicePage-DX8aCjtt.js → DevicePage-9mF2GYDM.js} +1 -1
  5. package/dashboard/dist/assets/{DialogTitle-DH5VFL8l.js → DialogTitle-BilvePW_.js} +1 -1
  6. package/dashboard/dist/assets/{FadeIn-CcubhRKW.js → FadeIn-DIUOdWDR.js} +1 -1
  7. package/dashboard/dist/assets/HeaderGithubStar-jwgY8DT_.js +1 -0
  8. package/dashboard/dist/assets/{IpCheckPage-BcHkEcE7.js → IpCheckPage-BAJ9oJk5.js} +4 -4
  9. package/dashboard/dist/assets/{LandingPage-Bnqs_k3p.js → LandingPage-Bi7T_UG3.js} +165 -165
  10. package/dashboard/dist/assets/LeaderboardAvatar-DK4zB40R.js +1 -0
  11. package/dashboard/dist/assets/LeaderboardPage-BMLXmGUV.js +6 -0
  12. package/dashboard/dist/assets/LeaderboardProfileModal-DgDySCa4.js +32 -0
  13. package/dashboard/dist/assets/LeaderboardProfilePage-BoI-B3yY.js +1 -0
  14. package/dashboard/dist/assets/LimitsPage-DFntRPF-.js +2 -0
  15. package/dashboard/dist/assets/LocalOnlyNotice-kpOEyGcQ.js +1 -0
  16. package/dashboard/dist/assets/{LoginPage-1M5RskQE.js → LoginPage-J437b8fG.js} +1 -1
  17. package/dashboard/dist/assets/{PopoverPopup-BzS6tVnf.js → PopoverPopup-CETYhElJ.js} +1 -1
  18. package/dashboard/dist/assets/{ProviderIcon-C8nYnvzP.js → ProviderIcon-GLSK86ul.js} +1 -1
  19. package/dashboard/dist/assets/{SettingsPage-DjoUqFA-.js → SettingsPage-Ce-EIZCo.js} +1 -1
  20. package/dashboard/dist/assets/SkillsPage-BCg2tPe8.js +1 -0
  21. package/dashboard/dist/assets/WidgetsPage-B8eoNh1B.js +1 -0
  22. package/dashboard/dist/assets/{WrappedPage-BxuVlF3C.js → WrappedPage-57yACpcn.js} +1 -1
  23. package/dashboard/dist/assets/arrow-up-right-kKTEYa77.js +1 -0
  24. package/dashboard/dist/assets/check-BwEiSCgu.js +1 -0
  25. package/dashboard/dist/assets/{chevron-down-BS2aEE_V.js → chevron-down-CYErdTR9.js} +1 -1
  26. package/dashboard/dist/assets/{download-DtsgF1HV.js → download-CSjtsR81.js} +1 -1
  27. package/dashboard/dist/assets/{info-TG4KyASc.js → info-Y0vVD3FZ.js} +1 -1
  28. package/dashboard/dist/assets/{main-CR7sCH5H.js → main-CrjJx0KR.js} +22 -17
  29. package/dashboard/dist/assets/main-CvieAP2Q.css +1 -0
  30. package/dashboard/dist/assets/{use-limits-display-prefs-DgRoQmhK.js → use-limits-display-prefs-Csc65P9G.js} +1 -1
  31. package/dashboard/dist/assets/{use-native-settings-BVWj6xAN.js → use-native-settings-BeIgnIwx.js} +1 -1
  32. package/dashboard/dist/assets/{use-reduced-motion-BsyM6Mgz.js → use-reduced-motion-DZ7zH0oK.js} +1 -1
  33. package/dashboard/dist/assets/{use-usage-limits-KGue9hvK.js → use-usage-limits-ClpyKC2F.js} +1 -1
  34. package/dashboard/dist/assets/{useCurrency-BLJima5w.js → useCurrency-M999w0v1.js} +1 -1
  35. package/dashboard/dist/index.html +2 -2
  36. package/dashboard/dist/share.html +2 -2
  37. package/package.json +1 -1
  38. package/src/lib/pricing/seed-snapshot.json +1 -1
  39. package/dashboard/dist/assets/LeaderboardPage-DV6K7KSV.js +0 -6
  40. package/dashboard/dist/assets/LeaderboardProfileModal-CnbpLjG_.js +0 -1
  41. package/dashboard/dist/assets/LimitsPage-DO53157-.js +0 -2
  42. package/dashboard/dist/assets/SkillsPage-CvOf-_li.js +0 -1
  43. package/dashboard/dist/assets/WidgetsPage-Cc5PRPDd.js +0 -1
  44. package/dashboard/dist/assets/check-r6BrjxcR.js +0 -1
  45. package/dashboard/dist/assets/main-aCzF4R9D.css +0 -1
@@ -1,15 +1,15 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-BwTkSsim.js","assets/use-usage-limits-KGue9hvK.js","assets/useCurrency-BLJima5w.js","assets/ActivityHeatmap-CiilYEqW.js","assets/info-TG4KyASc.js","assets/DialogTitle-DH5VFL8l.js","assets/PopoverPopup-BzS6tVnf.js","assets/Card-BkDHn179.js","assets/use-reduced-motion-BsyM6Mgz.js","assets/ProviderIcon-C8nYnvzP.js","assets/FadeIn-CcubhRKW.js","assets/LandingPage-Bnqs_k3p.js","assets/LeaderboardPage-DV6K7KSV.js","assets/chevron-down-BS2aEE_V.js","assets/LimitsPage-DO53157-.js","assets/use-limits-display-prefs-DgRoQmhK.js","assets/SettingsPage-DjoUqFA-.js","assets/use-native-settings-BVWj6xAN.js","assets/check-r6BrjxcR.js","assets/download-DtsgF1HV.js","assets/SkillsPage-CvOf-_li.js","assets/WidgetsPage-Cc5PRPDd.js"])))=>i.map(i=>d[i]);
2
- function bS(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const s in a)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(a,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>a[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function L_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function wS(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function a(){var s=!1;try{s=this instanceof a}catch{}return s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var s=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,s.get?s:{enumerable:!0,get:function(){return e[a]}})}),n}var gh={exports:{}},lo={},yh={exports:{}},Ze={};var jy;function xS(){if(jy)return Ze;jy=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.iterator;function k(I){return I===null||typeof I!="object"?null:(I=y&&I[y]||I["@@iterator"],typeof I=="function"?I:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},P=Object.assign,C={};function S(I,q,xe){this.props=I,this.context=q,this.refs=C,this.updater=xe||w}S.prototype.isReactComponent={},S.prototype.setState=function(I,q){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,q,"setState")},S.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function D(){}D.prototype=S.prototype;function L(I,q,xe){this.props=I,this.context=q,this.refs=C,this.updater=xe||w}var R=L.prototype=new D;R.constructor=L,P(R,S.prototype),R.isPureReactComponent=!0;var O=Array.isArray,W=Object.prototype.hasOwnProperty,K={current:null},$={key:!0,ref:!0,__self:!0,__source:!0};function x(I,q,xe){var Re,Pe={},Te=null,Ge=null;if(q!=null)for(Re in q.ref!==void 0&&(Ge=q.ref),q.key!==void 0&&(Te=""+q.key),q)W.call(q,Re)&&!$.hasOwnProperty(Re)&&(Pe[Re]=q[Re]);var Qe=arguments.length-2;if(Qe===1)Pe.children=xe;else if(1<Qe){for(var Ue=Array(Qe),jt=0;jt<Qe;jt++)Ue[jt]=arguments[jt+2];Pe.children=Ue}if(I&&I.defaultProps)for(Re in Qe=I.defaultProps,Qe)Pe[Re]===void 0&&(Pe[Re]=Qe[Re]);return{$$typeof:e,type:I,key:Te,ref:Ge,props:Pe,_owner:K.current}}function Y(I,q){return{$$typeof:e,type:I.type,key:q,ref:I.ref,props:I.props,_owner:I._owner}}function X(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function le(I){var q={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(xe){return q[xe]})}var oe=/\/+/g;function Ae(I,q){return typeof I=="object"&&I!==null&&I.key!=null?le(""+I.key):q.toString(36)}function de(I,q,xe,Re,Pe){var Te=typeof I;(Te==="undefined"||Te==="boolean")&&(I=null);var Ge=!1;if(I===null)Ge=!0;else switch(Te){case"string":case"number":Ge=!0;break;case"object":switch(I.$$typeof){case e:case t:Ge=!0}}if(Ge)return Ge=I,Pe=Pe(Ge),I=Re===""?"."+Ae(Ge,0):Re,O(Pe)?(xe="",I!=null&&(xe=I.replace(oe,"$&/")+"/"),de(Pe,q,xe,"",function(jt){return jt})):Pe!=null&&(X(Pe)&&(Pe=Y(Pe,xe+(!Pe.key||Ge&&Ge.key===Pe.key?"":(""+Pe.key).replace(oe,"$&/")+"/")+I)),q.push(Pe)),1;if(Ge=0,Re=Re===""?".":Re+":",O(I))for(var Qe=0;Qe<I.length;Qe++){Te=I[Qe];var Ue=Re+Ae(Te,Qe);Ge+=de(Te,q,xe,Ue,Pe)}else if(Ue=k(I),typeof Ue=="function")for(I=Ue.call(I),Qe=0;!(Te=I.next()).done;)Te=Te.value,Ue=Re+Ae(Te,Qe++),Ge+=de(Te,q,xe,Ue,Pe);else if(Te==="object")throw q=String(I),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.");return Ge}function fe(I,q,xe){if(I==null)return I;var Re=[],Pe=0;return de(I,Re,"","",function(Te){return q.call(xe,Te,Pe++)}),Re}function ye(I){if(I._status===-1){var q=I._result;q=q(),q.then(function(xe){(I._status===0||I._status===-1)&&(I._status=1,I._result=xe)},function(xe){(I._status===0||I._status===-1)&&(I._status=2,I._result=xe)}),I._status===-1&&(I._status=0,I._result=q)}if(I._status===1)return I._result.default;throw I._result}var Ne={current:null},G={transition:null},Z={ReactCurrentDispatcher:Ne,ReactCurrentBatchConfig:G,ReactCurrentOwner:K};function H(){throw Error("act(...) is not supported in production builds of React.")}return Ze.Children={map:fe,forEach:function(I,q,xe){fe(I,function(){q.apply(this,arguments)},xe)},count:function(I){var q=0;return fe(I,function(){q++}),q},toArray:function(I){return fe(I,function(q){return q})||[]},only:function(I){if(!X(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},Ze.Component=S,Ze.Fragment=n,Ze.Profiler=s,Ze.PureComponent=L,Ze.StrictMode=a,Ze.Suspense=h,Ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z,Ze.act=H,Ze.cloneElement=function(I,q,xe){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var Re=P({},I.props),Pe=I.key,Te=I.ref,Ge=I._owner;if(q!=null){if(q.ref!==void 0&&(Te=q.ref,Ge=K.current),q.key!==void 0&&(Pe=""+q.key),I.type&&I.type.defaultProps)var Qe=I.type.defaultProps;for(Ue in q)W.call(q,Ue)&&!$.hasOwnProperty(Ue)&&(Re[Ue]=q[Ue]===void 0&&Qe!==void 0?Qe[Ue]:q[Ue])}var Ue=arguments.length-2;if(Ue===1)Re.children=xe;else if(1<Ue){Qe=Array(Ue);for(var jt=0;jt<Ue;jt++)Qe[jt]=arguments[jt+2];Re.children=Qe}return{$$typeof:e,type:I.type,key:Pe,ref:Te,props:Re,_owner:Ge}},Ze.createContext=function(I){return I={$$typeof:c,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:o,_context:I},I.Consumer=I},Ze.createElement=x,Ze.createFactory=function(I){var q=x.bind(null,I);return q.type=I,q},Ze.createRef=function(){return{current:null}},Ze.forwardRef=function(I){return{$$typeof:u,render:I}},Ze.isValidElement=X,Ze.lazy=function(I){return{$$typeof:m,_payload:{_status:-1,_result:I},_init:ye}},Ze.memo=function(I,q){return{$$typeof:f,type:I,compare:q===void 0?null:q}},Ze.startTransition=function(I){var q=G.transition;G.transition={};try{I()}finally{G.transition=q}},Ze.unstable_act=H,Ze.useCallback=function(I,q){return Ne.current.useCallback(I,q)},Ze.useContext=function(I){return Ne.current.useContext(I)},Ze.useDebugValue=function(){},Ze.useDeferredValue=function(I){return Ne.current.useDeferredValue(I)},Ze.useEffect=function(I,q){return Ne.current.useEffect(I,q)},Ze.useId=function(){return Ne.current.useId()},Ze.useImperativeHandle=function(I,q,xe){return Ne.current.useImperativeHandle(I,q,xe)},Ze.useInsertionEffect=function(I,q){return Ne.current.useInsertionEffect(I,q)},Ze.useLayoutEffect=function(I,q){return Ne.current.useLayoutEffect(I,q)},Ze.useMemo=function(I,q){return Ne.current.useMemo(I,q)},Ze.useReducer=function(I,q,xe){return Ne.current.useReducer(I,q,xe)},Ze.useRef=function(I){return Ne.current.useRef(I)},Ze.useState=function(I){return Ne.current.useState(I)},Ze.useSyncExternalStore=function(I,q,xe){return Ne.current.useSyncExternalStore(I,q,xe)},Ze.useTransition=function(){return Ne.current.useTransition()},Ze.version="18.3.1",Ze}var Uy;function Qf(){return Uy||(Uy=1,yh.exports=xS()),yh.exports}var By;function PS(){if(By)return lo;By=1;var e=Qf(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function c(u,h,f){var m,y={},k=null,w=null;f!==void 0&&(k=""+f),h.key!==void 0&&(k=""+h.key),h.ref!==void 0&&(w=h.ref);for(m in h)a.call(h,m)&&!o.hasOwnProperty(m)&&(y[m]=h[m]);if(u&&u.defaultProps)for(m in h=u.defaultProps,h)y[m]===void 0&&(y[m]=h[m]);return{$$typeof:t,type:u,key:k,ref:w,props:y,_owner:s.current}}return lo.Fragment=n,lo.jsx=c,lo.jsxs=c,lo}var Fy;function SS(){return Fy||(Fy=1,gh.exports=PS()),gh.exports}var N=SS(),b=Qf();const Ro=L_(b),CS=bS({__proto__:null,default:Ro},[b]);var cc={},vh={exports:{}},yn={},kh={exports:{}},_h={};var Vy;function TS(){return Vy||(Vy=1,(function(e){function t(G,Z){var H=G.length;G.push(Z);e:for(;0<H;){var I=H-1>>>1,q=G[I];if(0<s(q,Z))G[I]=Z,G[H]=q,H=I;else break e}}function n(G){return G.length===0?null:G[0]}function a(G){if(G.length===0)return null;var Z=G[0],H=G.pop();if(H!==Z){G[0]=H;e:for(var I=0,q=G.length,xe=q>>>1;I<xe;){var Re=2*(I+1)-1,Pe=G[Re],Te=Re+1,Ge=G[Te];if(0>s(Pe,H))Te<q&&0>s(Ge,Pe)?(G[I]=Ge,G[Te]=H,I=Te):(G[I]=Pe,G[Re]=H,I=Re);else if(Te<q&&0>s(Ge,H))G[I]=Ge,G[Te]=H,I=Te;else break e}}return Z}function s(G,Z){var H=G.sortIndex-Z.sortIndex;return H!==0?H:G.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var h=[],f=[],m=1,y=null,k=3,w=!1,P=!1,C=!1,S=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function R(G){for(var Z=n(f);Z!==null;){if(Z.callback===null)a(f);else if(Z.startTime<=G)a(f),Z.sortIndex=Z.expirationTime,t(h,Z);else break;Z=n(f)}}function O(G){if(C=!1,R(G),!P)if(n(h)!==null)P=!0,ye(W);else{var Z=n(f);Z!==null&&Ne(O,Z.startTime-G)}}function W(G,Z){P=!1,C&&(C=!1,D(x),x=-1),w=!0;var H=k;try{for(R(Z),y=n(h);y!==null&&(!(y.expirationTime>Z)||G&&!le());){var I=y.callback;if(typeof I=="function"){y.callback=null,k=y.priorityLevel;var q=I(y.expirationTime<=Z);Z=e.unstable_now(),typeof q=="function"?y.callback=q:y===n(h)&&a(h),R(Z)}else a(h);y=n(h)}if(y!==null)var xe=!0;else{var Re=n(f);Re!==null&&Ne(O,Re.startTime-Z),xe=!1}return xe}finally{y=null,k=H,w=!1}}var K=!1,$=null,x=-1,Y=5,X=-1;function le(){return!(e.unstable_now()-X<Y)}function oe(){if($!==null){var G=e.unstable_now();X=G;var Z=!0;try{Z=$(!0,G)}finally{Z?Ae():(K=!1,$=null)}}else K=!1}var Ae;if(typeof L=="function")Ae=function(){L(oe)};else if(typeof MessageChannel<"u"){var de=new MessageChannel,fe=de.port2;de.port1.onmessage=oe,Ae=function(){fe.postMessage(null)}}else Ae=function(){S(oe,0)};function ye(G){$=G,K||(K=!0,Ae())}function Ne(G,Z){x=S(function(){G(e.unstable_now())},Z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_continueExecution=function(){P||w||(P=!0,ye(W))},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Y=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return k},e.unstable_getFirstCallbackNode=function(){return n(h)},e.unstable_next=function(G){switch(k){case 1:case 2:case 3:var Z=3;break;default:Z=k}var H=k;k=Z;try{return G()}finally{k=H}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(G,Z){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var H=k;k=G;try{return Z()}finally{k=H}},e.unstable_scheduleCallback=function(G,Z,H){var I=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?I+H:I):H=I,G){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=H+q,G={id:m++,callback:Z,priorityLevel:G,startTime:H,expirationTime:q,sortIndex:-1},H>I?(G.sortIndex=H,t(f,G),n(h)===null&&G===n(f)&&(C?(D(x),x=-1):C=!0,Ne(O,H-I))):(G.sortIndex=q,t(h,G),P||w||(P=!0,ye(W))),G},e.unstable_shouldYield=le,e.unstable_wrapCallback=function(G){var Z=k;return function(){var H=k;k=Z;try{return G.apply(this,arguments)}finally{k=H}}}})(_h)),_h}var zy;function ES(){return zy||(zy=1,kh.exports=TS()),kh.exports}var $y;function AS(){if($y)return yn;$y=1;var e=Qf(),t=ES();function n(r){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+r,l=1;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l]);return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,s={};function o(r,i){c(r,i),c(r+"Capture",i)}function c(r,i){for(s[r]=i,r=0;r<i.length;r++)a.add(i[r])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},y={};function k(r){return h.call(y,r)?!0:h.call(m,r)?!1:f.test(r)?y[r]=!0:(m[r]=!0,!1)}function w(r,i,l,d){if(l!==null&&l.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return d?!1:l!==null?!l.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function P(r,i,l,d){if(i===null||typeof i>"u"||w(r,i,l,d))return!0;if(d)return!1;if(l!==null)switch(l.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function C(r,i,l,d,p,g,_){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=d,this.attributeNamespace=p,this.mustUseProperty=l,this.propertyName=r,this.type=i,this.sanitizeURL=g,this.removeEmptyString=_}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){S[r]=new C(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var i=r[0];S[i]=new C(i,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){S[r]=new C(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){S[r]=new C(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){S[r]=new C(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){S[r]=new C(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){S[r]=new C(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){S[r]=new C(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){S[r]=new C(r,5,!1,r.toLowerCase(),null,!1,!1)});var D=/[\-:]([a-z])/g;function L(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var i=r.replace(D,L);S[i]=new C(i,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var i=r.replace(D,L);S[i]=new C(i,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var i=r.replace(D,L);S[i]=new C(i,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){S[r]=new C(r,1,!1,r.toLowerCase(),null,!1,!1)}),S.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){S[r]=new C(r,1,!1,r.toLowerCase(),null,!0,!0)});function R(r,i,l,d){var p=S.hasOwnProperty(i)?S[i]:null;(p!==null?p.type!==0:d||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(P(i,l,p,d)&&(l=null),d||p===null?k(i)&&(l===null?r.removeAttribute(i):r.setAttribute(i,""+l)):p.mustUseProperty?r[p.propertyName]=l===null?p.type===3?!1:"":l:(i=p.attributeName,d=p.attributeNamespace,l===null?r.removeAttribute(i):(p=p.type,l=p===3||p===4&&l===!0?"":""+l,d?r.setAttributeNS(d,i,l):r.setAttribute(i,l))))}var O=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,W=Symbol.for("react.element"),K=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),Y=Symbol.for("react.profiler"),X=Symbol.for("react.provider"),le=Symbol.for("react.context"),oe=Symbol.for("react.forward_ref"),Ae=Symbol.for("react.suspense"),de=Symbol.for("react.suspense_list"),fe=Symbol.for("react.memo"),ye=Symbol.for("react.lazy"),Ne=Symbol.for("react.offscreen"),G=Symbol.iterator;function Z(r){return r===null||typeof r!="object"?null:(r=G&&r[G]||r["@@iterator"],typeof r=="function"?r:null)}var H=Object.assign,I;function q(r){if(I===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);I=i&&i[1]||""}return`
3
- `+I+r}var xe=!1;function Re(r,i){if(!r||xe)return"";xe=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(z){var d=z}Reflect.construct(r,[],i)}else{try{i.call()}catch(z){d=z}r.call(i.prototype)}else{try{throw Error()}catch(z){d=z}r()}}catch(z){if(z&&d&&typeof z.stack=="string"){for(var p=z.stack.split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-u0vbeset.js","assets/use-usage-limits-ClpyKC2F.js","assets/useCurrency-M999w0v1.js","assets/ActivityHeatmap-CB0rCGvm.js","assets/info-Y0vVD3FZ.js","assets/DialogTitle-BilvePW_.js","assets/PopoverPopup-CETYhElJ.js","assets/Card-BfKA33l_.js","assets/use-reduced-motion-DZ7zH0oK.js","assets/ProviderIcon-GLSK86ul.js","assets/FadeIn-DIUOdWDR.js","assets/LandingPage-Bi7T_UG3.js","assets/HeaderGithubStar-jwgY8DT_.js","assets/LeaderboardPage-BMLXmGUV.js","assets/LeaderboardAvatar-DK4zB40R.js","assets/chevron-down-CYErdTR9.js","assets/LeaderboardProfilePage-BoI-B3yY.js","assets/LeaderboardProfileModal-DgDySCa4.js","assets/arrow-up-right-kKTEYa77.js","assets/LimitsPage-DFntRPF-.js","assets/use-limits-display-prefs-Csc65P9G.js","assets/LocalOnlyNotice-kpOEyGcQ.js","assets/download-CSjtsR81.js","assets/SettingsPage-Ce-EIZCo.js","assets/use-native-settings-BeIgnIwx.js","assets/check-BwEiSCgu.js","assets/SkillsPage-BCg2tPe8.js","assets/WidgetsPage-B8eoNh1B.js"])))=>i.map(i=>d[i]);
2
+ function xS(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const o in a)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(a,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>a[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function L_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function PS(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function a(){var o=!1;try{o=this instanceof a}catch{}return o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}),n}var gh={exports:{}},cs={},yh={exports:{}},Ze={};var jy;function SS(){if(jy)return Ze;jy=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.iterator;function k(I){return I===null||typeof I!="object"?null:(I=y&&I[y]||I["@@iterator"],typeof I=="function"?I:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,C={};function S(I,q,xe){this.props=I,this.context=q,this.refs=C,this.updater=xe||w}S.prototype.isReactComponent={},S.prototype.setState=function(I,q){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,q,"setState")},S.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function D(){}D.prototype=S.prototype;function L(I,q,xe){this.props=I,this.context=q,this.refs=C,this.updater=xe||w}var R=L.prototype=new D;R.constructor=L,x(R,S.prototype),R.isPureReactComponent=!0;var O=Array.isArray,G=Object.prototype.hasOwnProperty,W={current:null},z={key:!0,ref:!0,__self:!0,__source:!0};function P(I,q,xe){var Re,Pe={},Te=null,Ge=null;if(q!=null)for(Re in q.ref!==void 0&&(Ge=q.ref),q.key!==void 0&&(Te=""+q.key),q)G.call(q,Re)&&!z.hasOwnProperty(Re)&&(Pe[Re]=q[Re]);var Qe=arguments.length-2;if(Qe===1)Pe.children=xe;else if(1<Qe){for(var Ue=Array(Qe),jt=0;jt<Qe;jt++)Ue[jt]=arguments[jt+2];Pe.children=Ue}if(I&&I.defaultProps)for(Re in Qe=I.defaultProps,Qe)Pe[Re]===void 0&&(Pe[Re]=Qe[Re]);return{$$typeof:e,type:I,key:Te,ref:Ge,props:Pe,_owner:W.current}}function Y(I,q){return{$$typeof:e,type:I.type,key:q,ref:I.ref,props:I.props,_owner:I._owner}}function X(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function de(I){var q={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(xe){return q[xe]})}var se=/\/+/g;function Ae(I,q){return typeof I=="object"&&I!==null&&I.key!=null?de(""+I.key):q.toString(36)}function fe(I,q,xe,Re,Pe){var Te=typeof I;(Te==="undefined"||Te==="boolean")&&(I=null);var Ge=!1;if(I===null)Ge=!0;else switch(Te){case"string":case"number":Ge=!0;break;case"object":switch(I.$$typeof){case e:case t:Ge=!0}}if(Ge)return Ge=I,Pe=Pe(Ge),I=Re===""?"."+Ae(Ge,0):Re,O(Pe)?(xe="",I!=null&&(xe=I.replace(se,"$&/")+"/"),fe(Pe,q,xe,"",function(jt){return jt})):Pe!=null&&(X(Pe)&&(Pe=Y(Pe,xe+(!Pe.key||Ge&&Ge.key===Pe.key?"":(""+Pe.key).replace(se,"$&/")+"/")+I)),q.push(Pe)),1;if(Ge=0,Re=Re===""?".":Re+":",O(I))for(var Qe=0;Qe<I.length;Qe++){Te=I[Qe];var Ue=Re+Ae(Te,Qe);Ge+=fe(Te,q,xe,Ue,Pe)}else if(Ue=k(I),typeof Ue=="function")for(I=Ue.call(I),Qe=0;!(Te=I.next()).done;)Te=Te.value,Ue=Re+Ae(Te,Qe++),Ge+=fe(Te,q,xe,Ue,Pe);else if(Te==="object")throw q=String(I),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.");return Ge}function le(I,q,xe){if(I==null)return I;var Re=[],Pe=0;return fe(I,Re,"","",function(Te){return q.call(xe,Te,Pe++)}),Re}function pe(I){if(I._status===-1){var q=I._result;q=q(),q.then(function(xe){(I._status===0||I._status===-1)&&(I._status=1,I._result=xe)},function(xe){(I._status===0||I._status===-1)&&(I._status=2,I._result=xe)}),I._status===-1&&(I._status=0,I._result=q)}if(I._status===1)return I._result.default;throw I._result}var Ne={current:null},K={transition:null},Z={ReactCurrentDispatcher:Ne,ReactCurrentBatchConfig:K,ReactCurrentOwner:W};function H(){throw Error("act(...) is not supported in production builds of React.")}return Ze.Children={map:le,forEach:function(I,q,xe){le(I,function(){q.apply(this,arguments)},xe)},count:function(I){var q=0;return le(I,function(){q++}),q},toArray:function(I){return le(I,function(q){return q})||[]},only:function(I){if(!X(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},Ze.Component=S,Ze.Fragment=n,Ze.Profiler=o,Ze.PureComponent=L,Ze.StrictMode=a,Ze.Suspense=h,Ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z,Ze.act=H,Ze.cloneElement=function(I,q,xe){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var Re=x({},I.props),Pe=I.key,Te=I.ref,Ge=I._owner;if(q!=null){if(q.ref!==void 0&&(Te=q.ref,Ge=W.current),q.key!==void 0&&(Pe=""+q.key),I.type&&I.type.defaultProps)var Qe=I.type.defaultProps;for(Ue in q)G.call(q,Ue)&&!z.hasOwnProperty(Ue)&&(Re[Ue]=q[Ue]===void 0&&Qe!==void 0?Qe[Ue]:q[Ue])}var Ue=arguments.length-2;if(Ue===1)Re.children=xe;else if(1<Ue){Qe=Array(Ue);for(var jt=0;jt<Ue;jt++)Qe[jt]=arguments[jt+2];Re.children=Qe}return{$$typeof:e,type:I.type,key:Pe,ref:Te,props:Re,_owner:Ge}},Ze.createContext=function(I){return I={$$typeof:c,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:s,_context:I},I.Consumer=I},Ze.createElement=P,Ze.createFactory=function(I){var q=P.bind(null,I);return q.type=I,q},Ze.createRef=function(){return{current:null}},Ze.forwardRef=function(I){return{$$typeof:u,render:I}},Ze.isValidElement=X,Ze.lazy=function(I){return{$$typeof:m,_payload:{_status:-1,_result:I},_init:pe}},Ze.memo=function(I,q){return{$$typeof:f,type:I,compare:q===void 0?null:q}},Ze.startTransition=function(I){var q=K.transition;K.transition={};try{I()}finally{K.transition=q}},Ze.unstable_act=H,Ze.useCallback=function(I,q){return Ne.current.useCallback(I,q)},Ze.useContext=function(I){return Ne.current.useContext(I)},Ze.useDebugValue=function(){},Ze.useDeferredValue=function(I){return Ne.current.useDeferredValue(I)},Ze.useEffect=function(I,q){return Ne.current.useEffect(I,q)},Ze.useId=function(){return Ne.current.useId()},Ze.useImperativeHandle=function(I,q,xe){return Ne.current.useImperativeHandle(I,q,xe)},Ze.useInsertionEffect=function(I,q){return Ne.current.useInsertionEffect(I,q)},Ze.useLayoutEffect=function(I,q){return Ne.current.useLayoutEffect(I,q)},Ze.useMemo=function(I,q){return Ne.current.useMemo(I,q)},Ze.useReducer=function(I,q,xe){return Ne.current.useReducer(I,q,xe)},Ze.useRef=function(I){return Ne.current.useRef(I)},Ze.useState=function(I){return Ne.current.useState(I)},Ze.useSyncExternalStore=function(I,q,xe){return Ne.current.useSyncExternalStore(I,q,xe)},Ze.useTransition=function(){return Ne.current.useTransition()},Ze.version="18.3.1",Ze}var Uy;function Qf(){return Uy||(Uy=1,yh.exports=SS()),yh.exports}var By;function CS(){if(By)return cs;By=1;var e=Qf(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function c(u,h,f){var m,y={},k=null,w=null;f!==void 0&&(k=""+f),h.key!==void 0&&(k=""+h.key),h.ref!==void 0&&(w=h.ref);for(m in h)a.call(h,m)&&!s.hasOwnProperty(m)&&(y[m]=h[m]);if(u&&u.defaultProps)for(m in h=u.defaultProps,h)y[m]===void 0&&(y[m]=h[m]);return{$$typeof:t,type:u,key:k,ref:w,props:y,_owner:o.current}}return cs.Fragment=n,cs.jsx=c,cs.jsxs=c,cs}var Fy;function TS(){return Fy||(Fy=1,gh.exports=CS()),gh.exports}var N=TS(),b=Qf();const Rs=L_(b),ES=xS({__proto__:null,default:Rs},[b]);var uc={},vh={exports:{}},yn={},kh={exports:{}},_h={};var Vy;function AS(){return Vy||(Vy=1,(function(e){function t(K,Z){var H=K.length;K.push(Z);e:for(;0<H;){var I=H-1>>>1,q=K[I];if(0<o(q,Z))K[I]=Z,K[H]=q,H=I;else break e}}function n(K){return K.length===0?null:K[0]}function a(K){if(K.length===0)return null;var Z=K[0],H=K.pop();if(H!==Z){K[0]=H;e:for(var I=0,q=K.length,xe=q>>>1;I<xe;){var Re=2*(I+1)-1,Pe=K[Re],Te=Re+1,Ge=K[Te];if(0>o(Pe,H))Te<q&&0>o(Ge,Pe)?(K[I]=Ge,K[Te]=H,I=Te):(K[I]=Pe,K[Re]=H,I=Re);else if(Te<q&&0>o(Ge,H))K[I]=Ge,K[Te]=H,I=Te;else break e}}return Z}function o(K,Z){var H=K.sortIndex-Z.sortIndex;return H!==0?H:K.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var h=[],f=[],m=1,y=null,k=3,w=!1,x=!1,C=!1,S=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function R(K){for(var Z=n(f);Z!==null;){if(Z.callback===null)a(f);else if(Z.startTime<=K)a(f),Z.sortIndex=Z.expirationTime,t(h,Z);else break;Z=n(f)}}function O(K){if(C=!1,R(K),!x)if(n(h)!==null)x=!0,pe(G);else{var Z=n(f);Z!==null&&Ne(O,Z.startTime-K)}}function G(K,Z){x=!1,C&&(C=!1,D(P),P=-1),w=!0;var H=k;try{for(R(Z),y=n(h);y!==null&&(!(y.expirationTime>Z)||K&&!de());){var I=y.callback;if(typeof I=="function"){y.callback=null,k=y.priorityLevel;var q=I(y.expirationTime<=Z);Z=e.unstable_now(),typeof q=="function"?y.callback=q:y===n(h)&&a(h),R(Z)}else a(h);y=n(h)}if(y!==null)var xe=!0;else{var Re=n(f);Re!==null&&Ne(O,Re.startTime-Z),xe=!1}return xe}finally{y=null,k=H,w=!1}}var W=!1,z=null,P=-1,Y=5,X=-1;function de(){return!(e.unstable_now()-X<Y)}function se(){if(z!==null){var K=e.unstable_now();X=K;var Z=!0;try{Z=z(!0,K)}finally{Z?Ae():(W=!1,z=null)}}else W=!1}var Ae;if(typeof L=="function")Ae=function(){L(se)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,le=fe.port2;fe.port1.onmessage=se,Ae=function(){le.postMessage(null)}}else Ae=function(){S(se,0)};function pe(K){z=K,W||(W=!0,Ae())}function Ne(K,Z){P=S(function(){K(e.unstable_now())},Z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(K){K.callback=null},e.unstable_continueExecution=function(){x||w||(x=!0,pe(G))},e.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Y=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return k},e.unstable_getFirstCallbackNode=function(){return n(h)},e.unstable_next=function(K){switch(k){case 1:case 2:case 3:var Z=3;break;default:Z=k}var H=k;k=Z;try{return K()}finally{k=H}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(K,Z){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var H=k;k=K;try{return Z()}finally{k=H}},e.unstable_scheduleCallback=function(K,Z,H){var I=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?I+H:I):H=I,K){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=H+q,K={id:m++,callback:Z,priorityLevel:K,startTime:H,expirationTime:q,sortIndex:-1},H>I?(K.sortIndex=H,t(f,K),n(h)===null&&K===n(f)&&(C?(D(P),P=-1):C=!0,Ne(O,H-I))):(K.sortIndex=q,t(h,K),x||w||(x=!0,pe(G))),K},e.unstable_shouldYield=de,e.unstable_wrapCallback=function(K){var Z=k;return function(){var H=k;k=Z;try{return K.apply(this,arguments)}finally{k=H}}}})(_h)),_h}var zy;function RS(){return zy||(zy=1,kh.exports=AS()),kh.exports}var $y;function LS(){if($y)return yn;$y=1;var e=Qf(),t=RS();function n(r){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+r,l=1;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l]);return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,o={};function s(r,i){c(r,i),c(r+"Capture",i)}function c(r,i){for(o[r]=i,r=0;r<i.length;r++)a.add(i[r])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},y={};function k(r){return h.call(y,r)?!0:h.call(m,r)?!1:f.test(r)?y[r]=!0:(m[r]=!0,!1)}function w(r,i,l,d){if(l!==null&&l.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return d?!1:l!==null?!l.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function x(r,i,l,d){if(i===null||typeof i>"u"||w(r,i,l,d))return!0;if(d)return!1;if(l!==null)switch(l.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function C(r,i,l,d,p,g,_){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=d,this.attributeNamespace=p,this.mustUseProperty=l,this.propertyName=r,this.type=i,this.sanitizeURL=g,this.removeEmptyString=_}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){S[r]=new C(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var i=r[0];S[i]=new C(i,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){S[r]=new C(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){S[r]=new C(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){S[r]=new C(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){S[r]=new C(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){S[r]=new C(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){S[r]=new C(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){S[r]=new C(r,5,!1,r.toLowerCase(),null,!1,!1)});var D=/[\-:]([a-z])/g;function L(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var i=r.replace(D,L);S[i]=new C(i,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var i=r.replace(D,L);S[i]=new C(i,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var i=r.replace(D,L);S[i]=new C(i,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){S[r]=new C(r,1,!1,r.toLowerCase(),null,!1,!1)}),S.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){S[r]=new C(r,1,!1,r.toLowerCase(),null,!0,!0)});function R(r,i,l,d){var p=S.hasOwnProperty(i)?S[i]:null;(p!==null?p.type!==0:d||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(x(i,l,p,d)&&(l=null),d||p===null?k(i)&&(l===null?r.removeAttribute(i):r.setAttribute(i,""+l)):p.mustUseProperty?r[p.propertyName]=l===null?p.type===3?!1:"":l:(i=p.attributeName,d=p.attributeNamespace,l===null?r.removeAttribute(i):(p=p.type,l=p===3||p===4&&l===!0?"":""+l,d?r.setAttributeNS(d,i,l):r.setAttribute(i,l))))}var O=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,G=Symbol.for("react.element"),W=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),Y=Symbol.for("react.profiler"),X=Symbol.for("react.provider"),de=Symbol.for("react.context"),se=Symbol.for("react.forward_ref"),Ae=Symbol.for("react.suspense"),fe=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),pe=Symbol.for("react.lazy"),Ne=Symbol.for("react.offscreen"),K=Symbol.iterator;function Z(r){return r===null||typeof r!="object"?null:(r=K&&r[K]||r["@@iterator"],typeof r=="function"?r:null)}var H=Object.assign,I;function q(r){if(I===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);I=i&&i[1]||""}return`
3
+ `+I+r}var xe=!1;function Re(r,i){if(!r||xe)return"";xe=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch($){var d=$}Reflect.construct(r,[],i)}else{try{i.call()}catch($){d=$}r.call(i.prototype)}else{try{throw Error()}catch($){d=$}r()}}catch($){if($&&d&&typeof $.stack=="string"){for(var p=$.stack.split(`
4
4
  `),g=d.stack.split(`
5
5
  `),_=p.length-1,E=g.length-1;1<=_&&0<=E&&p[_]!==g[E];)E--;for(;1<=_&&0<=E;_--,E--)if(p[_]!==g[E]){if(_!==1||E!==1)do if(_--,E--,0>E||p[_]!==g[E]){var M=`
6
- `+p[_].replace(" at new "," at ");return r.displayName&&M.includes("<anonymous>")&&(M=M.replace("<anonymous>",r.displayName)),M}while(1<=_&&0<=E);break}}}finally{xe=!1,Error.prepareStackTrace=l}return(r=r?r.displayName||r.name:"")?q(r):""}function Pe(r){switch(r.tag){case 5:return q(r.type);case 16:return q("Lazy");case 13:return q("Suspense");case 19:return q("SuspenseList");case 0:case 2:case 15:return r=Re(r.type,!1),r;case 11:return r=Re(r.type.render,!1),r;case 1:return r=Re(r.type,!0),r;default:return""}}function Te(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case $:return"Fragment";case K:return"Portal";case Y:return"Profiler";case x:return"StrictMode";case Ae:return"Suspense";case de:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case le:return(r.displayName||"Context")+".Consumer";case X:return(r._context.displayName||"Context")+".Provider";case oe:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case fe:return i=r.displayName||null,i!==null?i:Te(r.type)||"Memo";case ye:i=r._payload,r=r._init;try{return Te(r(i))}catch{}}return null}function Ge(r){var i=r.type;switch(r.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=i.render,r=r.displayName||r.name||"",i.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Te(i);case 8:return i===x?"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 17:case 2:case 14:case 15:if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function Qe(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Ue(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function jt(r){var i=Ue(r)?"checked":"value",l=Object.getOwnPropertyDescriptor(r.constructor.prototype,i),d=""+r[i];if(!r.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var p=l.get,g=l.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(_){d=""+_,g.call(this,_)}}),Object.defineProperty(r,i,{enumerable:l.enumerable}),{getValue:function(){return d},setValue:function(_){d=""+_},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function $n(r){r._valueTracker||(r._valueTracker=jt(r))}function Cr(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var l=i.getValue(),d="";return r&&(d=Ue(r)?r.checked?"true":"false":r.value),r=d,r!==l?(i.setValue(r),!0):!1}function pt(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function en(r,i){var l=i.checked;return H({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??r._wrapperState.initialChecked})}function ws(r,i){var l=i.defaultValue==null?"":i.defaultValue,d=i.checked!=null?i.checked:i.defaultChecked;l=Qe(i.value!=null?i.value:l),r._wrapperState={initialChecked:d,initialValue:l,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function nl(r,i){i=i.checked,i!=null&&R(r,"checked",i,!1)}function Hn(r,i){nl(r,i);var l=Qe(i.value),d=i.type;if(l!=null)d==="number"?(l===0&&r.value===""||r.value!=l)&&(r.value=""+l):r.value!==""+l&&(r.value=""+l);else if(d==="submit"||d==="reset"){r.removeAttribute("value");return}i.hasOwnProperty("value")?xs(r,i.type,l):i.hasOwnProperty("defaultValue")&&xs(r,i.type,Qe(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(r.defaultChecked=!!i.defaultChecked)}function rl(r,i,l){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var d=i.type;if(!(d!=="submit"&&d!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+r._wrapperState.initialValue,l||i===r.value||(r.value=i),r.defaultValue=i}l=r.name,l!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,l!==""&&(r.name=l)}function xs(r,i,l){(i!=="number"||pt(r.ownerDocument)!==r)&&(l==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+l&&(r.defaultValue=""+l))}var Gr=Array.isArray;function qr(r,i,l,d){if(r=r.options,i){i={};for(var p=0;p<l.length;p++)i["$"+l[p]]=!0;for(l=0;l<r.length;l++)p=i.hasOwnProperty("$"+r[l].value),r[l].selected!==p&&(r[l].selected=p),p&&d&&(r[l].defaultSelected=!0)}else{for(l=""+Qe(l),i=null,p=0;p<r.length;p++){if(r[p].value===l){r[p].selected=!0,d&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function Ps(r,i){if(i.dangerouslySetInnerHTML!=null)throw Error(n(91));return H({},i,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function al(r,i){var l=i.value;if(l==null){if(l=i.children,i=i.defaultValue,l!=null){if(i!=null)throw Error(n(92));if(Gr(l)){if(1<l.length)throw Error(n(93));l=l[0]}i=l}i==null&&(i=""),l=i}r._wrapperState={initialValue:Qe(l)}}function il(r,i){var l=Qe(i.value),d=Qe(i.defaultValue);l!=null&&(l=""+l,l!==r.value&&(r.value=l),i.defaultValue==null&&r.defaultValue!==l&&(r.defaultValue=l)),d!=null&&(r.defaultValue=""+d)}function lr(r){var i=r.textContent;i===r._wrapperState.initialValue&&i!==""&&i!==null&&(r.value=i)}function Yr(r){switch(r){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function yi(r,i){return r==null||r==="http://www.w3.org/1999/xhtml"?Yr(i):r==="http://www.w3.org/2000/svg"&&i==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var Zr,Cn=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(i,l,d,p){MSApp.execUnsafeLocalFunction(function(){return r(i,l,d,p)})}:r})(function(r,i){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=i;else{for(Zr=Zr||document.createElement("div"),Zr.innerHTML="<svg>"+i.valueOf().toString()+"</svg>",i=Zr.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;i.firstChild;)r.appendChild(i.firstChild)}});function tn(r,i){if(i){var l=r.firstChild;if(l&&l===r.lastChild&&l.nodeType===3){l.nodeValue=i;return}}r.textContent=i}var Xr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ou=["Webkit","ms","Moz","O"];Object.keys(Xr).forEach(function(r){Ou.forEach(function(i){i=i+r.charAt(0).toUpperCase()+r.substring(1),Xr[i]=Xr[r]})});function vi(r,i,l){return i==null||typeof i=="boolean"||i===""?"":l||typeof i!="number"||i===0||Xr.hasOwnProperty(r)&&Xr[r]?(""+i).trim():i+"px"}function sl(r,i){r=r.style;for(var l in i)if(i.hasOwnProperty(l)){var d=l.indexOf("--")===0,p=vi(l,i[l],d);l==="float"&&(l="cssFloat"),d?r.setProperty(l,p):r[l]=p}}var Wn=H({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ki(r,i){if(i){if(Wn[r]&&(i.children!=null||i.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(i.dangerouslySetInnerHTML!=null){if(i.children!=null)throw Error(n(60));if(typeof i.dangerouslySetInnerHTML!="object"||!("__html"in i.dangerouslySetInnerHTML))throw Error(n(61))}if(i.style!=null&&typeof i.style!="object")throw Error(n(62))}}function _i(r,i){if(r.indexOf("-")===-1)return typeof i.is=="string";switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var bi=null;function Ss(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var wi=null,Kn=null,Tr=null;function xi(r){if(r=Gs(r)){if(typeof wi!="function")throw Error(n(280));var i=r.stateNode;i&&(i=Pl(i),wi(r.stateNode,r.type,i))}}function ol(r){Kn?Tr?Tr.push(r):Tr=[r]:Kn=r}function Cs(){if(Kn){var r=Kn,i=Tr;if(Tr=Kn=null,xi(r),i)for(r=0;r<i.length;r++)xi(i[r])}}function ll(r,i){return r(i)}function Ts(){}var Qr=!1;function Ua(r,i,l){if(Qr)return r(i,l);Qr=!0;try{return ll(r,i,l)}finally{Qr=!1,(Kn!==null||Tr!==null)&&(Ts(),Cs())}}function Jr(r,i){var l=r.stateNode;if(l===null)return null;var d=Pl(l);if(d===null)return null;l=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(l&&typeof l!="function")throw Error(n(231,i,typeof l));return l}var Es=!1;if(u)try{var Ba={};Object.defineProperty(Ba,"passive",{get:function(){Es=!0}}),window.addEventListener("test",Ba,Ba),window.removeEventListener("test",Ba,Ba)}catch{Es=!1}function A(r,i,l,d,p,g,_,E,M){var z=Array.prototype.slice.call(arguments,3);try{i.apply(l,z)}catch(ee){this.onError(ee)}}var U=!1,V=null,te=!1,ae=null,Ee={onError:function(r){U=!0,V=r}};function pe(r,i,l,d,p,g,_,E,M){U=!1,V=null,A.apply(Ee,arguments)}function De(r,i,l,d,p,g,_,E,M){if(pe.apply(this,arguments),U){if(U){var z=V;U=!1,V=null}else throw Error(n(198));te||(te=!0,ae=z)}}function he(r){var i=r,l=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(l=i.return),r=i.return;while(r)}return i.tag===3?l:null}function Me(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function Ie(r){if(he(r)!==r)throw Error(n(188))}function Le(r){var i=r.alternate;if(!i){if(i=he(r),i===null)throw Error(n(188));return i!==r?null:r}for(var l=r,d=i;;){var p=l.return;if(p===null)break;var g=p.alternate;if(g===null){if(d=p.return,d!==null){l=d;continue}break}if(p.child===g.child){for(g=p.child;g;){if(g===l)return Ie(p),r;if(g===d)return Ie(p),i;g=g.sibling}throw Error(n(188))}if(l.return!==d.return)l=p,d=g;else{for(var _=!1,E=p.child;E;){if(E===l){_=!0,l=p,d=g;break}if(E===d){_=!0,d=p,l=g;break}E=E.sibling}if(!_){for(E=g.child;E;){if(E===l){_=!0,l=g,d=p;break}if(E===d){_=!0,d=g,l=p;break}E=E.sibling}if(!_)throw Error(n(189))}}if(l.alternate!==d)throw Error(n(190))}if(l.tag!==3)throw Error(n(188));return l.stateNode.current===l?r:i}function st(r){return r=Le(r),r!==null?et(r):null}function et(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var i=et(r);if(i!==null)return i;r=r.sibling}return null}var ht=t.unstable_scheduleCallback,St=t.unstable_cancelCallback,$t=t.unstable_shouldYield,lt=t.unstable_requestPaint,rt=t.unstable_now,Er=t.unstable_getCurrentPriorityLevel,Ar=t.unstable_ImmediatePriority,Gn=t.unstable_UserBlockingPriority,nn=t.unstable_NormalPriority,As=t.unstable_LowPriority,ea=t.unstable_IdlePriority,Tn=null,rn=null;function Pi(r){if(rn&&typeof rn.onCommitFiberRoot=="function")try{rn.onCommitFiberRoot(Tn,r,void 0,(r.current.flags&128)===128)}catch{}}var He=Math.clz32?Math.clz32:Rr,Ut=Math.log,ta=Math.LN2;function Rr(r){return r>>>=0,r===0?32:31-(Ut(r)/ta|0)|0}var ut=64,Lr=4194304;function na(r){switch(r&-r){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: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 r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function Si(r,i){var l=r.pendingLanes;if(l===0)return 0;var d=0,p=r.suspendedLanes,g=r.pingedLanes,_=l&268435455;if(_!==0){var E=_&~p;E!==0?d=na(E):(g&=_,g!==0&&(d=na(g)))}else _=l&~p,_!==0?d=na(_):g!==0&&(d=na(g));if(d===0)return 0;if(i!==0&&i!==d&&(i&p)===0&&(p=d&-d,g=i&-i,p>=g||p===16&&(g&4194240)!==0))return i;if((d&4)!==0&&(d|=l&16),i=r.entangledLanes,i!==0)for(r=r.entanglements,i&=d;0<i;)l=31-He(i),p=1<<l,d|=r[l],i&=~p;return d}function Fx(r,i){switch(r){case 1:case 2:case 4:return i+250;case 8:case 16:case 32:case 64: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 i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Vx(r,i){for(var l=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,g=r.pendingLanes;0<g;){var _=31-He(g),E=1<<_,M=p[_];M===-1?((E&l)===0||(E&d)!==0)&&(p[_]=Fx(E,i)):M<=i&&(r.expiredLanes|=E),g&=~E}}function ju(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function pm(){var r=ut;return ut<<=1,(ut&4194240)===0&&(ut=64),r}function Uu(r){for(var i=[],l=0;31>l;l++)i.push(r);return i}function Rs(r,i,l){r.pendingLanes|=i,i!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,i=31-He(i),r[i]=l}function zx(r,i){var l=r.pendingLanes&~i;r.pendingLanes=i,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=i,r.mutableReadLanes&=i,r.entangledLanes&=i,i=r.entanglements;var d=r.eventTimes;for(r=r.expirationTimes;0<l;){var p=31-He(l),g=1<<p;i[p]=0,d[p]=-1,r[p]=-1,l&=~g}}function Bu(r,i){var l=r.entangledLanes|=i;for(r=r.entanglements;l;){var d=31-He(l),p=1<<d;p&i|r[d]&i&&(r[d]|=i),l&=~p}}var ct=0;function mm(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var gm,Fu,ym,vm,km,Vu=!1,cl=[],ra=null,aa=null,ia=null,Ls=new Map,Ds=new Map,sa=[],$x="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function _m(r,i){switch(r){case"focusin":case"focusout":ra=null;break;case"dragenter":case"dragleave":aa=null;break;case"mouseover":case"mouseout":ia=null;break;case"pointerover":case"pointerout":Ls.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ds.delete(i.pointerId)}}function Ms(r,i,l,d,p,g){return r===null||r.nativeEvent!==g?(r={blockedOn:i,domEventName:l,eventSystemFlags:d,nativeEvent:g,targetContainers:[p]},i!==null&&(i=Gs(i),i!==null&&Fu(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function Hx(r,i,l,d,p){switch(i){case"focusin":return ra=Ms(ra,r,i,l,d,p),!0;case"dragenter":return aa=Ms(aa,r,i,l,d,p),!0;case"mouseover":return ia=Ms(ia,r,i,l,d,p),!0;case"pointerover":var g=p.pointerId;return Ls.set(g,Ms(Ls.get(g)||null,r,i,l,d,p)),!0;case"gotpointercapture":return g=p.pointerId,Ds.set(g,Ms(Ds.get(g)||null,r,i,l,d,p)),!0}return!1}function bm(r){var i=Fa(r.target);if(i!==null){var l=he(i);if(l!==null){if(i=l.tag,i===13){if(i=Me(l),i!==null){r.blockedOn=i,km(r.priority,function(){ym(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){r.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}r.blockedOn=null}function ul(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var l=$u(r.domEventName,r.eventSystemFlags,i[0],r.nativeEvent);if(l===null){l=r.nativeEvent;var d=new l.constructor(l.type,l);bi=d,l.target.dispatchEvent(d),bi=null}else return i=Gs(l),i!==null&&Fu(i),r.blockedOn=l,!1;i.shift()}return!0}function wm(r,i,l){ul(r)&&l.delete(i)}function Wx(){Vu=!1,ra!==null&&ul(ra)&&(ra=null),aa!==null&&ul(aa)&&(aa=null),ia!==null&&ul(ia)&&(ia=null),Ls.forEach(wm),Ds.forEach(wm)}function Is(r,i){r.blockedOn===i&&(r.blockedOn=null,Vu||(Vu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Wx)))}function Ns(r){function i(p){return Is(p,r)}if(0<cl.length){Is(cl[0],r);for(var l=1;l<cl.length;l++){var d=cl[l];d.blockedOn===r&&(d.blockedOn=null)}}for(ra!==null&&Is(ra,r),aa!==null&&Is(aa,r),ia!==null&&Is(ia,r),Ls.forEach(i),Ds.forEach(i),l=0;l<sa.length;l++)d=sa[l],d.blockedOn===r&&(d.blockedOn=null);for(;0<sa.length&&(l=sa[0],l.blockedOn===null);)bm(l),l.blockedOn===null&&sa.shift()}var Ci=O.ReactCurrentBatchConfig,dl=!0;function Kx(r,i,l,d){var p=ct,g=Ci.transition;Ci.transition=null;try{ct=1,zu(r,i,l,d)}finally{ct=p,Ci.transition=g}}function Gx(r,i,l,d){var p=ct,g=Ci.transition;Ci.transition=null;try{ct=4,zu(r,i,l,d)}finally{ct=p,Ci.transition=g}}function zu(r,i,l,d){if(dl){var p=$u(r,i,l,d);if(p===null)sd(r,i,d,hl,l),_m(r,d);else if(Hx(p,r,i,l,d))d.stopPropagation();else if(_m(r,d),i&4&&-1<$x.indexOf(r)){for(;p!==null;){var g=Gs(p);if(g!==null&&gm(g),g=$u(r,i,l,d),g===null&&sd(r,i,d,hl,l),g===p)break;p=g}p!==null&&d.stopPropagation()}else sd(r,i,d,null,l)}}var hl=null;function $u(r,i,l,d){if(hl=null,r=Ss(d),r=Fa(r),r!==null)if(i=he(r),i===null)r=null;else if(l=i.tag,l===13){if(r=Me(i),r!==null)return r;r=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null);return hl=r,null}function xm(r){switch(r){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Er()){case Ar:return 1;case Gn:return 4;case nn:case As:return 16;case ea:return 536870912;default:return 16}default:return 16}}var oa=null,Hu=null,fl=null;function Pm(){if(fl)return fl;var r,i=Hu,l=i.length,d,p="value"in oa?oa.value:oa.textContent,g=p.length;for(r=0;r<l&&i[r]===p[r];r++);var _=l-r;for(d=1;d<=_&&i[l-d]===p[g-d];d++);return fl=p.slice(r,1<d?1-d:void 0)}function pl(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function ml(){return!0}function Sm(){return!1}function vn(r){function i(l,d,p,g,_){this._reactName=l,this._targetInst=p,this.type=d,this.nativeEvent=g,this.target=_,this.currentTarget=null;for(var E in r)r.hasOwnProperty(E)&&(l=r[E],this[E]=l?l(g):g[E]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?ml:Sm,this.isPropagationStopped=Sm,this}return H(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=ml)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=ml)},persist:function(){},isPersistent:ml}),i}var Ti={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wu=vn(Ti),Os=H({},Ti,{view:0,detail:0}),qx=vn(Os),Ku,Gu,js,gl=H({},Os,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yu,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==js&&(js&&r.type==="mousemove"?(Ku=r.screenX-js.screenX,Gu=r.screenY-js.screenY):Gu=Ku=0,js=r),Ku)},movementY:function(r){return"movementY"in r?r.movementY:Gu}}),Cm=vn(gl),Yx=H({},gl,{dataTransfer:0}),Zx=vn(Yx),Xx=H({},Os,{relatedTarget:0}),qu=vn(Xx),Qx=H({},Ti,{animationName:0,elapsedTime:0,pseudoElement:0}),Jx=vn(Qx),eP=H({},Ti,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),tP=vn(eP),nP=H({},Ti,{data:0}),Tm=vn(nP),rP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},aP={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},iP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function sP(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=iP[r])?!!i[r]:!1}function Yu(){return sP}var oP=H({},Os,{key:function(r){if(r.key){var i=rP[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=pl(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?aP[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yu,charCode:function(r){return r.type==="keypress"?pl(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?pl(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),lP=vn(oP),cP=H({},gl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Em=vn(cP),uP=H({},Os,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yu}),dP=vn(uP),hP=H({},Ti,{propertyName:0,elapsedTime:0,pseudoElement:0}),fP=vn(hP),pP=H({},gl,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),mP=vn(pP),gP=[9,13,27,32],Zu=u&&"CompositionEvent"in window,Us=null;u&&"documentMode"in document&&(Us=document.documentMode);var yP=u&&"TextEvent"in window&&!Us,Am=u&&(!Zu||Us&&8<Us&&11>=Us),Rm=" ",Lm=!1;function Dm(r,i){switch(r){case"keyup":return gP.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mm(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ei=!1;function vP(r,i){switch(r){case"compositionend":return Mm(i);case"keypress":return i.which!==32?null:(Lm=!0,Rm);case"textInput":return r=i.data,r===Rm&&Lm?null:r;default:return null}}function kP(r,i){if(Ei)return r==="compositionend"||!Zu&&Dm(r,i)?(r=Pm(),fl=Hu=oa=null,Ei=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Am&&i.locale!=="ko"?null:i.data;default:return null}}var _P={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Im(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!_P[r.type]:i==="textarea"}function Nm(r,i,l,d){ol(d),i=bl(i,"onChange"),0<i.length&&(l=new Wu("onChange","change",null,l,d),r.push({event:l,listeners:i}))}var Bs=null,Fs=null;function bP(r){Jm(r,0)}function yl(r){var i=Mi(r);if(Cr(i))return r}function wP(r,i){if(r==="change")return i}var Om=!1;if(u){var Xu;if(u){var Qu="oninput"in document;if(!Qu){var jm=document.createElement("div");jm.setAttribute("oninput","return;"),Qu=typeof jm.oninput=="function"}Xu=Qu}else Xu=!1;Om=Xu&&(!document.documentMode||9<document.documentMode)}function Um(){Bs&&(Bs.detachEvent("onpropertychange",Bm),Fs=Bs=null)}function Bm(r){if(r.propertyName==="value"&&yl(Fs)){var i=[];Nm(i,Fs,r,Ss(r)),Ua(bP,i)}}function xP(r,i,l){r==="focusin"?(Um(),Bs=i,Fs=l,Bs.attachEvent("onpropertychange",Bm)):r==="focusout"&&Um()}function PP(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return yl(Fs)}function SP(r,i){if(r==="click")return yl(i)}function CP(r,i){if(r==="input"||r==="change")return yl(i)}function TP(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var qn=typeof Object.is=="function"?Object.is:TP;function Vs(r,i){if(qn(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var l=Object.keys(r),d=Object.keys(i);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var p=l[d];if(!h.call(i,p)||!qn(r[p],i[p]))return!1}return!0}function Fm(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Vm(r,i){var l=Fm(r);r=0;for(var d;l;){if(l.nodeType===3){if(d=r+l.textContent.length,r<=i&&d>=i)return{node:l,offset:i-r};r=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Fm(l)}}function zm(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?zm(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function $m(){for(var r=window,i=pt();i instanceof r.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)r=i.contentWindow;else break;i=pt(r.document)}return i}function Ju(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}function EP(r){var i=$m(),l=r.focusedElem,d=r.selectionRange;if(i!==l&&l&&l.ownerDocument&&zm(l.ownerDocument.documentElement,l)){if(d!==null&&Ju(l)){if(i=d.start,r=d.end,r===void 0&&(r=i),"selectionStart"in l)l.selectionStart=i,l.selectionEnd=Math.min(r,l.value.length);else if(r=(i=l.ownerDocument||document)&&i.defaultView||window,r.getSelection){r=r.getSelection();var p=l.textContent.length,g=Math.min(d.start,p);d=d.end===void 0?g:Math.min(d.end,p),!r.extend&&g>d&&(p=d,d=g,g=p),p=Vm(l,g);var _=Vm(l,d);p&&_&&(r.rangeCount!==1||r.anchorNode!==p.node||r.anchorOffset!==p.offset||r.focusNode!==_.node||r.focusOffset!==_.offset)&&(i=i.createRange(),i.setStart(p.node,p.offset),r.removeAllRanges(),g>d?(r.addRange(i),r.extend(_.node,_.offset)):(i.setEnd(_.node,_.offset),r.addRange(i)))}}for(i=[],r=l;r=r.parentNode;)r.nodeType===1&&i.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<i.length;l++)r=i[l],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var AP=u&&"documentMode"in document&&11>=document.documentMode,Ai=null,ed=null,zs=null,td=!1;function Hm(r,i,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;td||Ai==null||Ai!==pt(d)||(d=Ai,"selectionStart"in d&&Ju(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),zs&&Vs(zs,d)||(zs=d,d=bl(ed,"onSelect"),0<d.length&&(i=new Wu("onSelect","select",null,i,l),r.push({event:i,listeners:d}),i.target=Ai)))}function vl(r,i){var l={};return l[r.toLowerCase()]=i.toLowerCase(),l["Webkit"+r]="webkit"+i,l["Moz"+r]="moz"+i,l}var Ri={animationend:vl("Animation","AnimationEnd"),animationiteration:vl("Animation","AnimationIteration"),animationstart:vl("Animation","AnimationStart"),transitionend:vl("Transition","TransitionEnd")},nd={},Wm={};u&&(Wm=document.createElement("div").style,"AnimationEvent"in window||(delete Ri.animationend.animation,delete Ri.animationiteration.animation,delete Ri.animationstart.animation),"TransitionEvent"in window||delete Ri.transitionend.transition);function kl(r){if(nd[r])return nd[r];if(!Ri[r])return r;var i=Ri[r],l;for(l in i)if(i.hasOwnProperty(l)&&l in Wm)return nd[r]=i[l];return r}var Km=kl("animationend"),Gm=kl("animationiteration"),qm=kl("animationstart"),Ym=kl("transitionend"),Zm=new Map,Xm="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function la(r,i){Zm.set(r,i),o(i,[r])}for(var rd=0;rd<Xm.length;rd++){var ad=Xm[rd],RP=ad.toLowerCase(),LP=ad[0].toUpperCase()+ad.slice(1);la(RP,"on"+LP)}la(Km,"onAnimationEnd"),la(Gm,"onAnimationIteration"),la(qm,"onAnimationStart"),la("dblclick","onDoubleClick"),la("focusin","onFocus"),la("focusout","onBlur"),la(Ym,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $s="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),DP=new Set("cancel close invalid load scroll toggle".split(" ").concat($s));function Qm(r,i,l){var d=r.type||"unknown-event";r.currentTarget=l,De(d,i,void 0,r),r.currentTarget=null}function Jm(r,i){i=(i&4)!==0;for(var l=0;l<r.length;l++){var d=r[l],p=d.event;d=d.listeners;e:{var g=void 0;if(i)for(var _=d.length-1;0<=_;_--){var E=d[_],M=E.instance,z=E.currentTarget;if(E=E.listener,M!==g&&p.isPropagationStopped())break e;Qm(p,E,z),g=M}else for(_=0;_<d.length;_++){if(E=d[_],M=E.instance,z=E.currentTarget,E=E.listener,M!==g&&p.isPropagationStopped())break e;Qm(p,E,z),g=M}}}if(te)throw r=ae,te=!1,ae=null,r}function mt(r,i){var l=i[hd];l===void 0&&(l=i[hd]=new Set);var d=r+"__bubble";l.has(d)||(eg(i,r,2,!1),l.add(d))}function id(r,i,l){var d=0;i&&(d|=4),eg(l,r,d,i)}var _l="_reactListening"+Math.random().toString(36).slice(2);function Hs(r){if(!r[_l]){r[_l]=!0,a.forEach(function(l){l!=="selectionchange"&&(DP.has(l)||id(l,!1,r),id(l,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[_l]||(i[_l]=!0,id("selectionchange",!1,i))}}function eg(r,i,l,d){switch(xm(i)){case 1:var p=Kx;break;case 4:p=Gx;break;default:p=zu}l=p.bind(null,i,l,r),p=void 0,!Es||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),d?p!==void 0?r.addEventListener(i,l,{capture:!0,passive:p}):r.addEventListener(i,l,!0):p!==void 0?r.addEventListener(i,l,{passive:p}):r.addEventListener(i,l,!1)}function sd(r,i,l,d,p){var g=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var _=d.tag;if(_===3||_===4){var E=d.stateNode.containerInfo;if(E===p||E.nodeType===8&&E.parentNode===p)break;if(_===4)for(_=d.return;_!==null;){var M=_.tag;if((M===3||M===4)&&(M=_.stateNode.containerInfo,M===p||M.nodeType===8&&M.parentNode===p))return;_=_.return}for(;E!==null;){if(_=Fa(E),_===null)return;if(M=_.tag,M===5||M===6){d=g=_;continue e}E=E.parentNode}}d=d.return}Ua(function(){var z=g,ee=Ss(l),ne=[];e:{var J=Zm.get(r);if(J!==void 0){var ue=Wu,ve=r;switch(r){case"keypress":if(pl(l)===0)break e;case"keydown":case"keyup":ue=lP;break;case"focusin":ve="focus",ue=qu;break;case"focusout":ve="blur",ue=qu;break;case"beforeblur":case"afterblur":ue=qu;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=Cm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=Zx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=dP;break;case Km:case Gm:case qm:ue=Jx;break;case Ym:ue=fP;break;case"scroll":ue=qx;break;case"wheel":ue=mP;break;case"copy":case"cut":case"paste":ue=tP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=Em}var we=(i&4)!==0,Ct=!we&&r==="scroll",B=we?J!==null?J+"Capture":null:J;we=[];for(var j=z,F;j!==null;){F=j;var se=F.stateNode;if(F.tag===5&&se!==null&&(F=se,B!==null&&(se=Jr(j,B),se!=null&&we.push(Ws(j,se,F)))),Ct)break;j=j.return}0<we.length&&(J=new ue(J,ve,null,l,ee),ne.push({event:J,listeners:we}))}}if((i&7)===0){e:{if(J=r==="mouseover"||r==="pointerover",ue=r==="mouseout"||r==="pointerout",J&&l!==bi&&(ve=l.relatedTarget||l.fromElement)&&(Fa(ve)||ve[Dr]))break e;if((ue||J)&&(J=ee.window===ee?ee:(J=ee.ownerDocument)?J.defaultView||J.parentWindow:window,ue?(ve=l.relatedTarget||l.toElement,ue=z,ve=ve?Fa(ve):null,ve!==null&&(Ct=he(ve),ve!==Ct||ve.tag!==5&&ve.tag!==6)&&(ve=null)):(ue=null,ve=z),ue!==ve)){if(we=Cm,se="onMouseLeave",B="onMouseEnter",j="mouse",(r==="pointerout"||r==="pointerover")&&(we=Em,se="onPointerLeave",B="onPointerEnter",j="pointer"),Ct=ue==null?J:Mi(ue),F=ve==null?J:Mi(ve),J=new we(se,j+"leave",ue,l,ee),J.target=Ct,J.relatedTarget=F,se=null,Fa(ee)===z&&(we=new we(B,j+"enter",ve,l,ee),we.target=F,we.relatedTarget=Ct,se=we),Ct=se,ue&&ve)t:{for(we=ue,B=ve,j=0,F=we;F;F=Li(F))j++;for(F=0,se=B;se;se=Li(se))F++;for(;0<j-F;)we=Li(we),j--;for(;0<F-j;)B=Li(B),F--;for(;j--;){if(we===B||B!==null&&we===B.alternate)break t;we=Li(we),B=Li(B)}we=null}else we=null;ue!==null&&tg(ne,J,ue,we,!1),ve!==null&&Ct!==null&&tg(ne,Ct,ve,we,!0)}}e:{if(J=z?Mi(z):window,ue=J.nodeName&&J.nodeName.toLowerCase(),ue==="select"||ue==="input"&&J.type==="file")var Se=wP;else if(Im(J))if(Om)Se=CP;else{Se=PP;var Oe=xP}else(ue=J.nodeName)&&ue.toLowerCase()==="input"&&(J.type==="checkbox"||J.type==="radio")&&(Se=SP);if(Se&&(Se=Se(r,z))){Nm(ne,Se,l,ee);break e}Oe&&Oe(r,J,z),r==="focusout"&&(Oe=J._wrapperState)&&Oe.controlled&&J.type==="number"&&xs(J,"number",J.value)}switch(Oe=z?Mi(z):window,r){case"focusin":(Im(Oe)||Oe.contentEditable==="true")&&(Ai=Oe,ed=z,zs=null);break;case"focusout":zs=ed=Ai=null;break;case"mousedown":td=!0;break;case"contextmenu":case"mouseup":case"dragend":td=!1,Hm(ne,l,ee);break;case"selectionchange":if(AP)break;case"keydown":case"keyup":Hm(ne,l,ee)}var je;if(Zu)e:{switch(r){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else Ei?Dm(r,l)&&(Ve="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(Ve="onCompositionStart");Ve&&(Am&&l.locale!=="ko"&&(Ei||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Ei&&(je=Pm()):(oa=ee,Hu="value"in oa?oa.value:oa.textContent,Ei=!0)),Oe=bl(z,Ve),0<Oe.length&&(Ve=new Tm(Ve,r,null,l,ee),ne.push({event:Ve,listeners:Oe}),je?Ve.data=je:(je=Mm(l),je!==null&&(Ve.data=je)))),(je=yP?vP(r,l):kP(r,l))&&(z=bl(z,"onBeforeInput"),0<z.length&&(ee=new Tm("onBeforeInput","beforeinput",null,l,ee),ne.push({event:ee,listeners:z}),ee.data=je))}Jm(ne,i)})}function Ws(r,i,l){return{instance:r,listener:i,currentTarget:l}}function bl(r,i){for(var l=i+"Capture",d=[];r!==null;){var p=r,g=p.stateNode;p.tag===5&&g!==null&&(p=g,g=Jr(r,l),g!=null&&d.unshift(Ws(r,g,p)),g=Jr(r,i),g!=null&&d.push(Ws(r,g,p))),r=r.return}return d}function Li(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function tg(r,i,l,d,p){for(var g=i._reactName,_=[];l!==null&&l!==d;){var E=l,M=E.alternate,z=E.stateNode;if(M!==null&&M===d)break;E.tag===5&&z!==null&&(E=z,p?(M=Jr(l,g),M!=null&&_.unshift(Ws(l,M,E))):p||(M=Jr(l,g),M!=null&&_.push(Ws(l,M,E)))),l=l.return}_.length!==0&&r.push({event:i,listeners:_})}var MP=/\r\n?/g,IP=/\u0000|\uFFFD/g;function ng(r){return(typeof r=="string"?r:""+r).replace(MP,`
7
- `).replace(IP,"")}function wl(r,i,l){if(i=ng(i),ng(r)!==i&&l)throw Error(n(425))}function xl(){}var od=null,ld=null;function cd(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var ud=typeof setTimeout=="function"?setTimeout:void 0,NP=typeof clearTimeout=="function"?clearTimeout:void 0,rg=typeof Promise=="function"?Promise:void 0,OP=typeof queueMicrotask=="function"?queueMicrotask:typeof rg<"u"?function(r){return rg.resolve(null).then(r).catch(jP)}:ud;function jP(r){setTimeout(function(){throw r})}function dd(r,i){var l=i,d=0;do{var p=l.nextSibling;if(r.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"){if(d===0){r.removeChild(p),Ns(i);return}d--}else l!=="$"&&l!=="$?"&&l!=="$!"||d++;l=p}while(l);Ns(i)}function ca(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?")break;if(i==="/$")return null}}return r}function ag(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="$"||l==="$!"||l==="$?"){if(i===0)return r;i--}else l==="/$"&&i++}r=r.previousSibling}return null}var Di=Math.random().toString(36).slice(2),cr="__reactFiber$"+Di,Ks="__reactProps$"+Di,Dr="__reactContainer$"+Di,hd="__reactEvents$"+Di,UP="__reactListeners$"+Di,BP="__reactHandles$"+Di;function Fa(r){var i=r[cr];if(i)return i;for(var l=r.parentNode;l;){if(i=l[Dr]||l[cr]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(r=ag(r);r!==null;){if(l=r[cr])return l;r=ag(r)}return i}r=l,l=r.parentNode}return null}function Gs(r){return r=r[cr]||r[Dr],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function Mi(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function Pl(r){return r[Ks]||null}var fd=[],Ii=-1;function ua(r){return{current:r}}function gt(r){0>Ii||(r.current=fd[Ii],fd[Ii]=null,Ii--)}function ft(r,i){Ii++,fd[Ii]=r.current,r.current=i}var da={},qt=ua(da),hn=ua(!1),Va=da;function Ni(r,i){var l=r.type.contextTypes;if(!l)return da;var d=r.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===i)return d.__reactInternalMemoizedMaskedChildContext;var p={},g;for(g in l)p[g]=i[g];return d&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=i,r.__reactInternalMemoizedMaskedChildContext=p),p}function fn(r){return r=r.childContextTypes,r!=null}function Sl(){gt(hn),gt(qt)}function ig(r,i,l){if(qt.current!==da)throw Error(n(168));ft(qt,i),ft(hn,l)}function sg(r,i,l){var d=r.stateNode;if(i=i.childContextTypes,typeof d.getChildContext!="function")return l;d=d.getChildContext();for(var p in d)if(!(p in i))throw Error(n(108,Ge(r)||"Unknown",p));return H({},l,d)}function Cl(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||da,Va=qt.current,ft(qt,r),ft(hn,hn.current),!0}function og(r,i,l){var d=r.stateNode;if(!d)throw Error(n(169));l?(r=sg(r,i,Va),d.__reactInternalMemoizedMergedChildContext=r,gt(hn),gt(qt),ft(qt,r)):gt(hn),ft(hn,l)}var Mr=null,Tl=!1,pd=!1;function lg(r){Mr===null?Mr=[r]:Mr.push(r)}function FP(r){Tl=!0,lg(r)}function ha(){if(!pd&&Mr!==null){pd=!0;var r=0,i=ct;try{var l=Mr;for(ct=1;r<l.length;r++){var d=l[r];do d=d(!0);while(d!==null)}Mr=null,Tl=!1}catch(p){throw Mr!==null&&(Mr=Mr.slice(r+1)),ht(Ar,ha),p}finally{ct=i,pd=!1}}return null}var Oi=[],ji=0,El=null,Al=0,En=[],An=0,za=null,Ir=1,Nr="";function $a(r,i){Oi[ji++]=Al,Oi[ji++]=El,El=r,Al=i}function cg(r,i,l){En[An++]=Ir,En[An++]=Nr,En[An++]=za,za=r;var d=Ir;r=Nr;var p=32-He(d)-1;d&=~(1<<p),l+=1;var g=32-He(i)+p;if(30<g){var _=p-p%5;g=(d&(1<<_)-1).toString(32),d>>=_,p-=_,Ir=1<<32-He(i)+p|l<<p|d,Nr=g+r}else Ir=1<<g|l<<p|d,Nr=r}function md(r){r.return!==null&&($a(r,1),cg(r,1,0))}function gd(r){for(;r===El;)El=Oi[--ji],Oi[ji]=null,Al=Oi[--ji],Oi[ji]=null;for(;r===za;)za=En[--An],En[An]=null,Nr=En[--An],En[An]=null,Ir=En[--An],En[An]=null}var kn=null,_n=null,kt=!1,Yn=null;function ug(r,i){var l=Mn(5,null,null,0);l.elementType="DELETED",l.stateNode=i,l.return=r,i=r.deletions,i===null?(r.deletions=[l],r.flags|=16):i.push(l)}function dg(r,i){switch(r.tag){case 5:var l=r.type;return i=i.nodeType!==1||l.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(r.stateNode=i,kn=r,_n=ca(i.firstChild),!0):!1;case 6:return i=r.pendingProps===""||i.nodeType!==3?null:i,i!==null?(r.stateNode=i,kn=r,_n=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(l=za!==null?{id:Ir,overflow:Nr}:null,r.memoizedState={dehydrated:i,treeContext:l,retryLane:1073741824},l=Mn(18,null,null,0),l.stateNode=i,l.return=r,r.child=l,kn=r,_n=null,!0):!1;default:return!1}}function yd(r){return(r.mode&1)!==0&&(r.flags&128)===0}function vd(r){if(kt){var i=_n;if(i){var l=i;if(!dg(r,i)){if(yd(r))throw Error(n(418));i=ca(l.nextSibling);var d=kn;i&&dg(r,i)?ug(d,l):(r.flags=r.flags&-4097|2,kt=!1,kn=r)}}else{if(yd(r))throw Error(n(418));r.flags=r.flags&-4097|2,kt=!1,kn=r}}}function hg(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;kn=r}function Rl(r){if(r!==kn)return!1;if(!kt)return hg(r),kt=!0,!1;var i;if((i=r.tag!==3)&&!(i=r.tag!==5)&&(i=r.type,i=i!=="head"&&i!=="body"&&!cd(r.type,r.memoizedProps)),i&&(i=_n)){if(yd(r))throw fg(),Error(n(418));for(;i;)ug(r,i),i=ca(i.nextSibling)}if(hg(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="/$"){if(i===0){_n=ca(r.nextSibling);break e}i--}else l!=="$"&&l!=="$!"&&l!=="$?"||i++}r=r.nextSibling}_n=null}}else _n=kn?ca(r.stateNode.nextSibling):null;return!0}function fg(){for(var r=_n;r;)r=ca(r.nextSibling)}function Ui(){_n=kn=null,kt=!1}function kd(r){Yn===null?Yn=[r]:Yn.push(r)}var VP=O.ReactCurrentBatchConfig;function qs(r,i,l){if(r=l.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(l._owner){if(l=l._owner,l){if(l.tag!==1)throw Error(n(309));var d=l.stateNode}if(!d)throw Error(n(147,r));var p=d,g=""+r;return i!==null&&i.ref!==null&&typeof i.ref=="function"&&i.ref._stringRef===g?i.ref:(i=function(_){var E=p.refs;_===null?delete E[g]:E[g]=_},i._stringRef=g,i)}if(typeof r!="string")throw Error(n(284));if(!l._owner)throw Error(n(290,r))}return r}function Ll(r,i){throw r=Object.prototype.toString.call(i),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r))}function pg(r){var i=r._init;return i(r._payload)}function mg(r){function i(B,j){if(r){var F=B.deletions;F===null?(B.deletions=[j],B.flags|=16):F.push(j)}}function l(B,j){if(!r)return null;for(;j!==null;)i(B,j),j=j.sibling;return null}function d(B,j){for(B=new Map;j!==null;)j.key!==null?B.set(j.key,j):B.set(j.index,j),j=j.sibling;return B}function p(B,j){return B=_a(B,j),B.index=0,B.sibling=null,B}function g(B,j,F){return B.index=F,r?(F=B.alternate,F!==null?(F=F.index,F<j?(B.flags|=2,j):F):(B.flags|=2,j)):(B.flags|=1048576,j)}function _(B){return r&&B.alternate===null&&(B.flags|=2),B}function E(B,j,F,se){return j===null||j.tag!==6?(j=uh(F,B.mode,se),j.return=B,j):(j=p(j,F),j.return=B,j)}function M(B,j,F,se){var Se=F.type;return Se===$?ee(B,j,F.props.children,se,F.key):j!==null&&(j.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===ye&&pg(Se)===j.type)?(se=p(j,F.props),se.ref=qs(B,j,F),se.return=B,se):(se=tc(F.type,F.key,F.props,null,B.mode,se),se.ref=qs(B,j,F),se.return=B,se)}function z(B,j,F,se){return j===null||j.tag!==4||j.stateNode.containerInfo!==F.containerInfo||j.stateNode.implementation!==F.implementation?(j=dh(F,B.mode,se),j.return=B,j):(j=p(j,F.children||[]),j.return=B,j)}function ee(B,j,F,se,Se){return j===null||j.tag!==7?(j=Xa(F,B.mode,se,Se),j.return=B,j):(j=p(j,F),j.return=B,j)}function ne(B,j,F){if(typeof j=="string"&&j!==""||typeof j=="number")return j=uh(""+j,B.mode,F),j.return=B,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case W:return F=tc(j.type,j.key,j.props,null,B.mode,F),F.ref=qs(B,null,j),F.return=B,F;case K:return j=dh(j,B.mode,F),j.return=B,j;case ye:var se=j._init;return ne(B,se(j._payload),F)}if(Gr(j)||Z(j))return j=Xa(j,B.mode,F,null),j.return=B,j;Ll(B,j)}return null}function J(B,j,F,se){var Se=j!==null?j.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return Se!==null?null:E(B,j,""+F,se);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case W:return F.key===Se?M(B,j,F,se):null;case K:return F.key===Se?z(B,j,F,se):null;case ye:return Se=F._init,J(B,j,Se(F._payload),se)}if(Gr(F)||Z(F))return Se!==null?null:ee(B,j,F,se,null);Ll(B,F)}return null}function ue(B,j,F,se,Se){if(typeof se=="string"&&se!==""||typeof se=="number")return B=B.get(F)||null,E(j,B,""+se,Se);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case W:return B=B.get(se.key===null?F:se.key)||null,M(j,B,se,Se);case K:return B=B.get(se.key===null?F:se.key)||null,z(j,B,se,Se);case ye:var Oe=se._init;return ue(B,j,F,Oe(se._payload),Se)}if(Gr(se)||Z(se))return B=B.get(F)||null,ee(j,B,se,Se,null);Ll(j,se)}return null}function ve(B,j,F,se){for(var Se=null,Oe=null,je=j,Ve=j=0,Vt=null;je!==null&&Ve<F.length;Ve++){je.index>Ve?(Vt=je,je=null):Vt=je.sibling;var ot=J(B,je,F[Ve],se);if(ot===null){je===null&&(je=Vt);break}r&&je&&ot.alternate===null&&i(B,je),j=g(ot,j,Ve),Oe===null?Se=ot:Oe.sibling=ot,Oe=ot,je=Vt}if(Ve===F.length)return l(B,je),kt&&$a(B,Ve),Se;if(je===null){for(;Ve<F.length;Ve++)je=ne(B,F[Ve],se),je!==null&&(j=g(je,j,Ve),Oe===null?Se=je:Oe.sibling=je,Oe=je);return kt&&$a(B,Ve),Se}for(je=d(B,je);Ve<F.length;Ve++)Vt=ue(je,B,Ve,F[Ve],se),Vt!==null&&(r&&Vt.alternate!==null&&je.delete(Vt.key===null?Ve:Vt.key),j=g(Vt,j,Ve),Oe===null?Se=Vt:Oe.sibling=Vt,Oe=Vt);return r&&je.forEach(function(ba){return i(B,ba)}),kt&&$a(B,Ve),Se}function we(B,j,F,se){var Se=Z(F);if(typeof Se!="function")throw Error(n(150));if(F=Se.call(F),F==null)throw Error(n(151));for(var Oe=Se=null,je=j,Ve=j=0,Vt=null,ot=F.next();je!==null&&!ot.done;Ve++,ot=F.next()){je.index>Ve?(Vt=je,je=null):Vt=je.sibling;var ba=J(B,je,ot.value,se);if(ba===null){je===null&&(je=Vt);break}r&&je&&ba.alternate===null&&i(B,je),j=g(ba,j,Ve),Oe===null?Se=ba:Oe.sibling=ba,Oe=ba,je=Vt}if(ot.done)return l(B,je),kt&&$a(B,Ve),Se;if(je===null){for(;!ot.done;Ve++,ot=F.next())ot=ne(B,ot.value,se),ot!==null&&(j=g(ot,j,Ve),Oe===null?Se=ot:Oe.sibling=ot,Oe=ot);return kt&&$a(B,Ve),Se}for(je=d(B,je);!ot.done;Ve++,ot=F.next())ot=ue(je,B,Ve,ot.value,se),ot!==null&&(r&&ot.alternate!==null&&je.delete(ot.key===null?Ve:ot.key),j=g(ot,j,Ve),Oe===null?Se=ot:Oe.sibling=ot,Oe=ot);return r&&je.forEach(function(_S){return i(B,_S)}),kt&&$a(B,Ve),Se}function Ct(B,j,F,se){if(typeof F=="object"&&F!==null&&F.type===$&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case W:e:{for(var Se=F.key,Oe=j;Oe!==null;){if(Oe.key===Se){if(Se=F.type,Se===$){if(Oe.tag===7){l(B,Oe.sibling),j=p(Oe,F.props.children),j.return=B,B=j;break e}}else if(Oe.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===ye&&pg(Se)===Oe.type){l(B,Oe.sibling),j=p(Oe,F.props),j.ref=qs(B,Oe,F),j.return=B,B=j;break e}l(B,Oe);break}else i(B,Oe);Oe=Oe.sibling}F.type===$?(j=Xa(F.props.children,B.mode,se,F.key),j.return=B,B=j):(se=tc(F.type,F.key,F.props,null,B.mode,se),se.ref=qs(B,j,F),se.return=B,B=se)}return _(B);case K:e:{for(Oe=F.key;j!==null;){if(j.key===Oe)if(j.tag===4&&j.stateNode.containerInfo===F.containerInfo&&j.stateNode.implementation===F.implementation){l(B,j.sibling),j=p(j,F.children||[]),j.return=B,B=j;break e}else{l(B,j);break}else i(B,j);j=j.sibling}j=dh(F,B.mode,se),j.return=B,B=j}return _(B);case ye:return Oe=F._init,Ct(B,j,Oe(F._payload),se)}if(Gr(F))return ve(B,j,F,se);if(Z(F))return we(B,j,F,se);Ll(B,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,j!==null&&j.tag===6?(l(B,j.sibling),j=p(j,F),j.return=B,B=j):(l(B,j),j=uh(F,B.mode,se),j.return=B,B=j),_(B)):l(B,j)}return Ct}var Bi=mg(!0),gg=mg(!1),Dl=ua(null),Ml=null,Fi=null,_d=null;function bd(){_d=Fi=Ml=null}function wd(r){var i=Dl.current;gt(Dl),r._currentValue=i}function xd(r,i,l){for(;r!==null;){var d=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),r===l)break;r=r.return}}function Vi(r,i){Ml=r,_d=Fi=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&i)!==0&&(pn=!0),r.firstContext=null)}function Rn(r){var i=r._currentValue;if(_d!==r)if(r={context:r,memoizedValue:i,next:null},Fi===null){if(Ml===null)throw Error(n(308));Fi=r,Ml.dependencies={lanes:0,firstContext:r}}else Fi=Fi.next=r;return i}var Ha=null;function Pd(r){Ha===null?Ha=[r]:Ha.push(r)}function yg(r,i,l,d){var p=i.interleaved;return p===null?(l.next=l,Pd(i)):(l.next=p.next,p.next=l),i.interleaved=l,Or(r,d)}function Or(r,i){r.lanes|=i;var l=r.alternate;for(l!==null&&(l.lanes|=i),l=r,r=r.return;r!==null;)r.childLanes|=i,l=r.alternate,l!==null&&(l.childLanes|=i),l=r,r=r.return;return l.tag===3?l.stateNode:null}var fa=!1;function Sd(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function vg(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function jr(r,i){return{eventTime:r,lane:i,tag:0,payload:null,callback:null,next:null}}function pa(r,i,l){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(at&2)!==0){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,Or(r,l)}return p=d.interleaved,p===null?(i.next=i,Pd(d)):(i.next=p.next,p.next=i),d.interleaved=i,Or(r,l)}function Il(r,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194240)!==0)){var d=i.lanes;d&=r.pendingLanes,l|=d,i.lanes=l,Bu(r,l)}}function kg(r,i){var l=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var p=null,g=null;if(l=l.firstBaseUpdate,l!==null){do{var _={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};g===null?p=g=_:g=g.next=_,l=l.next}while(l!==null);g===null?p=g=i:g=g.next=i}else p=g=i;l={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:d.shared,effects:d.effects},r.updateQueue=l;return}r=l.lastBaseUpdate,r===null?l.firstBaseUpdate=i:r.next=i,l.lastBaseUpdate=i}function Nl(r,i,l,d){var p=r.updateQueue;fa=!1;var g=p.firstBaseUpdate,_=p.lastBaseUpdate,E=p.shared.pending;if(E!==null){p.shared.pending=null;var M=E,z=M.next;M.next=null,_===null?g=z:_.next=z,_=M;var ee=r.alternate;ee!==null&&(ee=ee.updateQueue,E=ee.lastBaseUpdate,E!==_&&(E===null?ee.firstBaseUpdate=z:E.next=z,ee.lastBaseUpdate=M))}if(g!==null){var ne=p.baseState;_=0,ee=z=M=null,E=g;do{var J=E.lane,ue=E.eventTime;if((d&J)===J){ee!==null&&(ee=ee.next={eventTime:ue,lane:0,tag:E.tag,payload:E.payload,callback:E.callback,next:null});e:{var ve=r,we=E;switch(J=i,ue=l,we.tag){case 1:if(ve=we.payload,typeof ve=="function"){ne=ve.call(ue,ne,J);break e}ne=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=we.payload,J=typeof ve=="function"?ve.call(ue,ne,J):ve,J==null)break e;ne=H({},ne,J);break e;case 2:fa=!0}}E.callback!==null&&E.lane!==0&&(r.flags|=64,J=p.effects,J===null?p.effects=[E]:J.push(E))}else ue={eventTime:ue,lane:J,tag:E.tag,payload:E.payload,callback:E.callback,next:null},ee===null?(z=ee=ue,M=ne):ee=ee.next=ue,_|=J;if(E=E.next,E===null){if(E=p.shared.pending,E===null)break;J=E,E=J.next,J.next=null,p.lastBaseUpdate=J,p.shared.pending=null}}while(!0);if(ee===null&&(M=ne),p.baseState=M,p.firstBaseUpdate=z,p.lastBaseUpdate=ee,i=p.shared.interleaved,i!==null){p=i;do _|=p.lane,p=p.next;while(p!==i)}else g===null&&(p.shared.lanes=0);Ga|=_,r.lanes=_,r.memoizedState=ne}}function _g(r,i,l){if(r=i.effects,i.effects=null,r!==null)for(i=0;i<r.length;i++){var d=r[i],p=d.callback;if(p!==null){if(d.callback=null,d=l,typeof p!="function")throw Error(n(191,p));p.call(d)}}}var Ys={},ur=ua(Ys),Zs=ua(Ys),Xs=ua(Ys);function Wa(r){if(r===Ys)throw Error(n(174));return r}function Cd(r,i){switch(ft(Xs,i),ft(Zs,r),ft(ur,Ys),r=i.nodeType,r){case 9:case 11:i=(i=i.documentElement)?i.namespaceURI:yi(null,"");break;default:r=r===8?i.parentNode:i,i=r.namespaceURI||null,r=r.tagName,i=yi(i,r)}gt(ur),ft(ur,i)}function zi(){gt(ur),gt(Zs),gt(Xs)}function bg(r){Wa(Xs.current);var i=Wa(ur.current),l=yi(i,r.type);i!==l&&(ft(Zs,r),ft(ur,l))}function Td(r){Zs.current===r&&(gt(ur),gt(Zs))}var bt=ua(0);function Ol(r){for(var i=r;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Ed=[];function Ad(){for(var r=0;r<Ed.length;r++)Ed[r]._workInProgressVersionPrimary=null;Ed.length=0}var jl=O.ReactCurrentDispatcher,Rd=O.ReactCurrentBatchConfig,Ka=0,wt=null,Mt=null,Bt=null,Ul=!1,Qs=!1,Js=0,zP=0;function Yt(){throw Error(n(321))}function Ld(r,i){if(i===null)return!1;for(var l=0;l<i.length&&l<r.length;l++)if(!qn(r[l],i[l]))return!1;return!0}function Dd(r,i,l,d,p,g){if(Ka=g,wt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,jl.current=r===null||r.memoizedState===null?KP:GP,r=l(d,p),Qs){g=0;do{if(Qs=!1,Js=0,25<=g)throw Error(n(301));g+=1,Bt=Mt=null,i.updateQueue=null,jl.current=qP,r=l(d,p)}while(Qs)}if(jl.current=Vl,i=Mt!==null&&Mt.next!==null,Ka=0,Bt=Mt=wt=null,Ul=!1,i)throw Error(n(300));return r}function Md(){var r=Js!==0;return Js=0,r}function dr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?wt.memoizedState=Bt=r:Bt=Bt.next=r,Bt}function Ln(){if(Mt===null){var r=wt.alternate;r=r!==null?r.memoizedState:null}else r=Mt.next;var i=Bt===null?wt.memoizedState:Bt.next;if(i!==null)Bt=i,Mt=r;else{if(r===null)throw Error(n(310));Mt=r,r={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},Bt===null?wt.memoizedState=Bt=r:Bt=Bt.next=r}return Bt}function eo(r,i){return typeof i=="function"?i(r):i}function Id(r){var i=Ln(),l=i.queue;if(l===null)throw Error(n(311));l.lastRenderedReducer=r;var d=Mt,p=d.baseQueue,g=l.pending;if(g!==null){if(p!==null){var _=p.next;p.next=g.next,g.next=_}d.baseQueue=p=g,l.pending=null}if(p!==null){g=p.next,d=d.baseState;var E=_=null,M=null,z=g;do{var ee=z.lane;if((Ka&ee)===ee)M!==null&&(M=M.next={lane:0,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),d=z.hasEagerState?z.eagerState:r(d,z.action);else{var ne={lane:ee,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null};M===null?(E=M=ne,_=d):M=M.next=ne,wt.lanes|=ee,Ga|=ee}z=z.next}while(z!==null&&z!==g);M===null?_=d:M.next=E,qn(d,i.memoizedState)||(pn=!0),i.memoizedState=d,i.baseState=_,i.baseQueue=M,l.lastRenderedState=d}if(r=l.interleaved,r!==null){p=r;do g=p.lane,wt.lanes|=g,Ga|=g,p=p.next;while(p!==r)}else p===null&&(l.lanes=0);return[i.memoizedState,l.dispatch]}function Nd(r){var i=Ln(),l=i.queue;if(l===null)throw Error(n(311));l.lastRenderedReducer=r;var d=l.dispatch,p=l.pending,g=i.memoizedState;if(p!==null){l.pending=null;var _=p=p.next;do g=r(g,_.action),_=_.next;while(_!==p);qn(g,i.memoizedState)||(pn=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),l.lastRenderedState=g}return[g,d]}function wg(){}function xg(r,i){var l=wt,d=Ln(),p=i(),g=!qn(d.memoizedState,p);if(g&&(d.memoizedState=p,pn=!0),d=d.queue,Od(Cg.bind(null,l,d,r),[r]),d.getSnapshot!==i||g||Bt!==null&&Bt.memoizedState.tag&1){if(l.flags|=2048,to(9,Sg.bind(null,l,d,p,i),void 0,null),Ft===null)throw Error(n(349));(Ka&30)!==0||Pg(l,i,p)}return p}function Pg(r,i,l){r.flags|=16384,r={getSnapshot:i,value:l},i=wt.updateQueue,i===null?(i={lastEffect:null,stores:null},wt.updateQueue=i,i.stores=[r]):(l=i.stores,l===null?i.stores=[r]:l.push(r))}function Sg(r,i,l,d){i.value=l,i.getSnapshot=d,Tg(i)&&Eg(r)}function Cg(r,i,l){return l(function(){Tg(i)&&Eg(r)})}function Tg(r){var i=r.getSnapshot;r=r.value;try{var l=i();return!qn(r,l)}catch{return!0}}function Eg(r){var i=Or(r,1);i!==null&&Jn(i,r,1,-1)}function Ag(r){var i=dr();return typeof r=="function"&&(r=r()),i.memoizedState=i.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:eo,lastRenderedState:r},i.queue=r,r=r.dispatch=WP.bind(null,wt,r),[i.memoizedState,r]}function to(r,i,l,d){return r={tag:r,create:i,destroy:l,deps:d,next:null},i=wt.updateQueue,i===null?(i={lastEffect:null,stores:null},wt.updateQueue=i,i.lastEffect=r.next=r):(l=i.lastEffect,l===null?i.lastEffect=r.next=r:(d=l.next,l.next=r,r.next=d,i.lastEffect=r)),r}function Rg(){return Ln().memoizedState}function Bl(r,i,l,d){var p=dr();wt.flags|=r,p.memoizedState=to(1|i,l,void 0,d===void 0?null:d)}function Fl(r,i,l,d){var p=Ln();d=d===void 0?null:d;var g=void 0;if(Mt!==null){var _=Mt.memoizedState;if(g=_.destroy,d!==null&&Ld(d,_.deps)){p.memoizedState=to(i,l,g,d);return}}wt.flags|=r,p.memoizedState=to(1|i,l,g,d)}function Lg(r,i){return Bl(8390656,8,r,i)}function Od(r,i){return Fl(2048,8,r,i)}function Dg(r,i){return Fl(4,2,r,i)}function Mg(r,i){return Fl(4,4,r,i)}function Ig(r,i){if(typeof i=="function")return r=r(),i(r),function(){i(null)};if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function Ng(r,i,l){return l=l!=null?l.concat([r]):null,Fl(4,4,Ig.bind(null,i,r),l)}function jd(){}function Og(r,i){var l=Ln();i=i===void 0?null:i;var d=l.memoizedState;return d!==null&&i!==null&&Ld(i,d[1])?d[0]:(l.memoizedState=[r,i],r)}function jg(r,i){var l=Ln();i=i===void 0?null:i;var d=l.memoizedState;return d!==null&&i!==null&&Ld(i,d[1])?d[0]:(r=r(),l.memoizedState=[r,i],r)}function Ug(r,i,l){return(Ka&21)===0?(r.baseState&&(r.baseState=!1,pn=!0),r.memoizedState=l):(qn(l,i)||(l=pm(),wt.lanes|=l,Ga|=l,r.baseState=!0),i)}function $P(r,i){var l=ct;ct=l!==0&&4>l?l:4,r(!0);var d=Rd.transition;Rd.transition={};try{r(!1),i()}finally{ct=l,Rd.transition=d}}function Bg(){return Ln().memoizedState}function HP(r,i,l){var d=va(r);if(l={lane:d,action:l,hasEagerState:!1,eagerState:null,next:null},Fg(r))Vg(i,l);else if(l=yg(r,i,l,d),l!==null){var p=sn();Jn(l,r,d,p),zg(l,i,d)}}function WP(r,i,l){var d=va(r),p={lane:d,action:l,hasEagerState:!1,eagerState:null,next:null};if(Fg(r))Vg(i,p);else{var g=r.alternate;if(r.lanes===0&&(g===null||g.lanes===0)&&(g=i.lastRenderedReducer,g!==null))try{var _=i.lastRenderedState,E=g(_,l);if(p.hasEagerState=!0,p.eagerState=E,qn(E,_)){var M=i.interleaved;M===null?(p.next=p,Pd(i)):(p.next=M.next,M.next=p),i.interleaved=p;return}}catch{}l=yg(r,i,p,d),l!==null&&(p=sn(),Jn(l,r,d,p),zg(l,i,d))}}function Fg(r){var i=r.alternate;return r===wt||i!==null&&i===wt}function Vg(r,i){Qs=Ul=!0;var l=r.pending;l===null?i.next=i:(i.next=l.next,l.next=i),r.pending=i}function zg(r,i,l){if((l&4194240)!==0){var d=i.lanes;d&=r.pendingLanes,l|=d,i.lanes=l,Bu(r,l)}}var Vl={readContext:Rn,useCallback:Yt,useContext:Yt,useEffect:Yt,useImperativeHandle:Yt,useInsertionEffect:Yt,useLayoutEffect:Yt,useMemo:Yt,useReducer:Yt,useRef:Yt,useState:Yt,useDebugValue:Yt,useDeferredValue:Yt,useTransition:Yt,useMutableSource:Yt,useSyncExternalStore:Yt,useId:Yt,unstable_isNewReconciler:!1},KP={readContext:Rn,useCallback:function(r,i){return dr().memoizedState=[r,i===void 0?null:i],r},useContext:Rn,useEffect:Lg,useImperativeHandle:function(r,i,l){return l=l!=null?l.concat([r]):null,Bl(4194308,4,Ig.bind(null,i,r),l)},useLayoutEffect:function(r,i){return Bl(4194308,4,r,i)},useInsertionEffect:function(r,i){return Bl(4,2,r,i)},useMemo:function(r,i){var l=dr();return i=i===void 0?null:i,r=r(),l.memoizedState=[r,i],r},useReducer:function(r,i,l){var d=dr();return i=l!==void 0?l(i):i,d.memoizedState=d.baseState=i,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:i},d.queue=r,r=r.dispatch=HP.bind(null,wt,r),[d.memoizedState,r]},useRef:function(r){var i=dr();return r={current:r},i.memoizedState=r},useState:Ag,useDebugValue:jd,useDeferredValue:function(r){return dr().memoizedState=r},useTransition:function(){var r=Ag(!1),i=r[0];return r=$P.bind(null,r[1]),dr().memoizedState=r,[i,r]},useMutableSource:function(){},useSyncExternalStore:function(r,i,l){var d=wt,p=dr();if(kt){if(l===void 0)throw Error(n(407));l=l()}else{if(l=i(),Ft===null)throw Error(n(349));(Ka&30)!==0||Pg(d,i,l)}p.memoizedState=l;var g={value:l,getSnapshot:i};return p.queue=g,Lg(Cg.bind(null,d,g,r),[r]),d.flags|=2048,to(9,Sg.bind(null,d,g,l,i),void 0,null),l},useId:function(){var r=dr(),i=Ft.identifierPrefix;if(kt){var l=Nr,d=Ir;l=(d&~(1<<32-He(d)-1)).toString(32)+l,i=":"+i+"R"+l,l=Js++,0<l&&(i+="H"+l.toString(32)),i+=":"}else l=zP++,i=":"+i+"r"+l.toString(32)+":";return r.memoizedState=i},unstable_isNewReconciler:!1},GP={readContext:Rn,useCallback:Og,useContext:Rn,useEffect:Od,useImperativeHandle:Ng,useInsertionEffect:Dg,useLayoutEffect:Mg,useMemo:jg,useReducer:Id,useRef:Rg,useState:function(){return Id(eo)},useDebugValue:jd,useDeferredValue:function(r){var i=Ln();return Ug(i,Mt.memoizedState,r)},useTransition:function(){var r=Id(eo)[0],i=Ln().memoizedState;return[r,i]},useMutableSource:wg,useSyncExternalStore:xg,useId:Bg,unstable_isNewReconciler:!1},qP={readContext:Rn,useCallback:Og,useContext:Rn,useEffect:Od,useImperativeHandle:Ng,useInsertionEffect:Dg,useLayoutEffect:Mg,useMemo:jg,useReducer:Nd,useRef:Rg,useState:function(){return Nd(eo)},useDebugValue:jd,useDeferredValue:function(r){var i=Ln();return Mt===null?i.memoizedState=r:Ug(i,Mt.memoizedState,r)},useTransition:function(){var r=Nd(eo)[0],i=Ln().memoizedState;return[r,i]},useMutableSource:wg,useSyncExternalStore:xg,useId:Bg,unstable_isNewReconciler:!1};function Zn(r,i){if(r&&r.defaultProps){i=H({},i),r=r.defaultProps;for(var l in r)i[l]===void 0&&(i[l]=r[l]);return i}return i}function Ud(r,i,l,d){i=r.memoizedState,l=l(d,i),l=l==null?i:H({},i,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var zl={isMounted:function(r){return(r=r._reactInternals)?he(r)===r:!1},enqueueSetState:function(r,i,l){r=r._reactInternals;var d=sn(),p=va(r),g=jr(d,p);g.payload=i,l!=null&&(g.callback=l),i=pa(r,g,p),i!==null&&(Jn(i,r,p,d),Il(i,r,p))},enqueueReplaceState:function(r,i,l){r=r._reactInternals;var d=sn(),p=va(r),g=jr(d,p);g.tag=1,g.payload=i,l!=null&&(g.callback=l),i=pa(r,g,p),i!==null&&(Jn(i,r,p,d),Il(i,r,p))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var l=sn(),d=va(r),p=jr(l,d);p.tag=2,i!=null&&(p.callback=i),i=pa(r,p,d),i!==null&&(Jn(i,r,d,l),Il(i,r,d))}};function $g(r,i,l,d,p,g,_){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,g,_):i.prototype&&i.prototype.isPureReactComponent?!Vs(l,d)||!Vs(p,g):!0}function Hg(r,i,l){var d=!1,p=da,g=i.contextType;return typeof g=="object"&&g!==null?g=Rn(g):(p=fn(i)?Va:qt.current,d=i.contextTypes,g=(d=d!=null)?Ni(r,p):da),i=new i(l,g),r.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=zl,r.stateNode=i,i._reactInternals=r,d&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=p,r.__reactInternalMemoizedMaskedChildContext=g),i}function Wg(r,i,l,d){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,d),i.state!==r&&zl.enqueueReplaceState(i,i.state,null)}function Bd(r,i,l,d){var p=r.stateNode;p.props=l,p.state=r.memoizedState,p.refs={},Sd(r);var g=i.contextType;typeof g=="object"&&g!==null?p.context=Rn(g):(g=fn(i)?Va:qt.current,p.context=Ni(r,g)),p.state=r.memoizedState,g=i.getDerivedStateFromProps,typeof g=="function"&&(Ud(r,i,g,l),p.state=r.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(i=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),i!==p.state&&zl.enqueueReplaceState(p,p.state,null),Nl(r,l,p,d),p.state=r.memoizedState),typeof p.componentDidMount=="function"&&(r.flags|=4194308)}function $i(r,i){try{var l="",d=i;do l+=Pe(d),d=d.return;while(d);var p=l}catch(g){p=`
6
+ `+p[_].replace(" at new "," at ");return r.displayName&&M.includes("<anonymous>")&&(M=M.replace("<anonymous>",r.displayName)),M}while(1<=_&&0<=E);break}}}finally{xe=!1,Error.prepareStackTrace=l}return(r=r?r.displayName||r.name:"")?q(r):""}function Pe(r){switch(r.tag){case 5:return q(r.type);case 16:return q("Lazy");case 13:return q("Suspense");case 19:return q("SuspenseList");case 0:case 2:case 15:return r=Re(r.type,!1),r;case 11:return r=Re(r.type.render,!1),r;case 1:return r=Re(r.type,!0),r;default:return""}}function Te(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case z:return"Fragment";case W:return"Portal";case Y:return"Profiler";case P:return"StrictMode";case Ae:return"Suspense";case fe:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case de:return(r.displayName||"Context")+".Consumer";case X:return(r._context.displayName||"Context")+".Provider";case se:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case le:return i=r.displayName||null,i!==null?i:Te(r.type)||"Memo";case pe:i=r._payload,r=r._init;try{return Te(r(i))}catch{}}return null}function Ge(r){var i=r.type;switch(r.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=i.render,r=r.displayName||r.name||"",i.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Te(i);case 8:return i===P?"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 17:case 2:case 14:case 15:if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function Qe(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Ue(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function jt(r){var i=Ue(r)?"checked":"value",l=Object.getOwnPropertyDescriptor(r.constructor.prototype,i),d=""+r[i];if(!r.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var p=l.get,g=l.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(_){d=""+_,g.call(this,_)}}),Object.defineProperty(r,i,{enumerable:l.enumerable}),{getValue:function(){return d},setValue:function(_){d=""+_},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Hn(r){r._valueTracker||(r._valueTracker=jt(r))}function Cr(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var l=i.getValue(),d="";return r&&(d=Ue(r)?r.checked?"true":"false":r.value),r=d,r!==l?(i.setValue(r),!0):!1}function pt(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function en(r,i){var l=i.checked;return H({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??r._wrapperState.initialChecked})}function xo(r,i){var l=i.defaultValue==null?"":i.defaultValue,d=i.checked!=null?i.checked:i.defaultChecked;l=Qe(i.value!=null?i.value:l),r._wrapperState={initialChecked:d,initialValue:l,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function rl(r,i){i=i.checked,i!=null&&R(r,"checked",i,!1)}function Wn(r,i){rl(r,i);var l=Qe(i.value),d=i.type;if(l!=null)d==="number"?(l===0&&r.value===""||r.value!=l)&&(r.value=""+l):r.value!==""+l&&(r.value=""+l);else if(d==="submit"||d==="reset"){r.removeAttribute("value");return}i.hasOwnProperty("value")?Po(r,i.type,l):i.hasOwnProperty("defaultValue")&&Po(r,i.type,Qe(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(r.defaultChecked=!!i.defaultChecked)}function al(r,i,l){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var d=i.type;if(!(d!=="submit"&&d!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+r._wrapperState.initialValue,l||i===r.value||(r.value=i),r.defaultValue=i}l=r.name,l!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,l!==""&&(r.name=l)}function Po(r,i,l){(i!=="number"||pt(r.ownerDocument)!==r)&&(l==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+l&&(r.defaultValue=""+l))}var qr=Array.isArray;function Yr(r,i,l,d){if(r=r.options,i){i={};for(var p=0;p<l.length;p++)i["$"+l[p]]=!0;for(l=0;l<r.length;l++)p=i.hasOwnProperty("$"+r[l].value),r[l].selected!==p&&(r[l].selected=p),p&&d&&(r[l].defaultSelected=!0)}else{for(l=""+Qe(l),i=null,p=0;p<r.length;p++){if(r[p].value===l){r[p].selected=!0,d&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function So(r,i){if(i.dangerouslySetInnerHTML!=null)throw Error(n(91));return H({},i,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function il(r,i){var l=i.value;if(l==null){if(l=i.children,i=i.defaultValue,l!=null){if(i!=null)throw Error(n(92));if(qr(l)){if(1<l.length)throw Error(n(93));l=l[0]}i=l}i==null&&(i=""),l=i}r._wrapperState={initialValue:Qe(l)}}function ol(r,i){var l=Qe(i.value),d=Qe(i.defaultValue);l!=null&&(l=""+l,l!==r.value&&(r.value=l),i.defaultValue==null&&r.defaultValue!==l&&(r.defaultValue=l)),d!=null&&(r.defaultValue=""+d)}function lr(r){var i=r.textContent;i===r._wrapperState.initialValue&&i!==""&&i!==null&&(r.value=i)}function Zr(r){switch(r){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function yi(r,i){return r==null||r==="http://www.w3.org/1999/xhtml"?Zr(i):r==="http://www.w3.org/2000/svg"&&i==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var Xr,Cn=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(i,l,d,p){MSApp.execUnsafeLocalFunction(function(){return r(i,l,d,p)})}:r})(function(r,i){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=i;else{for(Xr=Xr||document.createElement("div"),Xr.innerHTML="<svg>"+i.valueOf().toString()+"</svg>",i=Xr.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;i.firstChild;)r.appendChild(i.firstChild)}});function tn(r,i){if(i){var l=r.firstChild;if(l&&l===r.lastChild&&l.nodeType===3){l.nodeValue=i;return}}r.textContent=i}var Qr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ou=["Webkit","ms","Moz","O"];Object.keys(Qr).forEach(function(r){Ou.forEach(function(i){i=i+r.charAt(0).toUpperCase()+r.substring(1),Qr[i]=Qr[r]})});function vi(r,i,l){return i==null||typeof i=="boolean"||i===""?"":l||typeof i!="number"||i===0||Qr.hasOwnProperty(r)&&Qr[r]?(""+i).trim():i+"px"}function sl(r,i){r=r.style;for(var l in i)if(i.hasOwnProperty(l)){var d=l.indexOf("--")===0,p=vi(l,i[l],d);l==="float"&&(l="cssFloat"),d?r.setProperty(l,p):r[l]=p}}var Kn=H({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ki(r,i){if(i){if(Kn[r]&&(i.children!=null||i.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(i.dangerouslySetInnerHTML!=null){if(i.children!=null)throw Error(n(60));if(typeof i.dangerouslySetInnerHTML!="object"||!("__html"in i.dangerouslySetInnerHTML))throw Error(n(61))}if(i.style!=null&&typeof i.style!="object")throw Error(n(62))}}function _i(r,i){if(r.indexOf("-")===-1)return typeof i.is=="string";switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var bi=null;function Co(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var wi=null,Gn=null,Tr=null;function xi(r){if(r=qo(r)){if(typeof wi!="function")throw Error(n(280));var i=r.stateNode;i&&(i=Sl(i),wi(r.stateNode,r.type,i))}}function ll(r){Gn?Tr?Tr.push(r):Tr=[r]:Gn=r}function To(){if(Gn){var r=Gn,i=Tr;if(Tr=Gn=null,xi(r),i)for(r=0;r<i.length;r++)xi(i[r])}}function cl(r,i){return r(i)}function Eo(){}var Jr=!1;function Ba(r,i,l){if(Jr)return r(i,l);Jr=!0;try{return cl(r,i,l)}finally{Jr=!1,(Gn!==null||Tr!==null)&&(Eo(),To())}}function ea(r,i){var l=r.stateNode;if(l===null)return null;var d=Sl(l);if(d===null)return null;l=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(l&&typeof l!="function")throw Error(n(231,i,typeof l));return l}var Ao=!1;if(u)try{var Fa={};Object.defineProperty(Fa,"passive",{get:function(){Ao=!0}}),window.addEventListener("test",Fa,Fa),window.removeEventListener("test",Fa,Fa)}catch{Ao=!1}function A(r,i,l,d,p,g,_,E,M){var $=Array.prototype.slice.call(arguments,3);try{i.apply(l,$)}catch(ee){this.onError(ee)}}var U=!1,V=null,te=!1,ae=null,Ee={onError:function(r){U=!0,V=r}};function me(r,i,l,d,p,g,_,E,M){U=!1,V=null,A.apply(Ee,arguments)}function De(r,i,l,d,p,g,_,E,M){if(me.apply(this,arguments),U){if(U){var $=V;U=!1,V=null}else throw Error(n(198));te||(te=!0,ae=$)}}function he(r){var i=r,l=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(l=i.return),r=i.return;while(r)}return i.tag===3?l:null}function Me(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function Ie(r){if(he(r)!==r)throw Error(n(188))}function Le(r){var i=r.alternate;if(!i){if(i=he(r),i===null)throw Error(n(188));return i!==r?null:r}for(var l=r,d=i;;){var p=l.return;if(p===null)break;var g=p.alternate;if(g===null){if(d=p.return,d!==null){l=d;continue}break}if(p.child===g.child){for(g=p.child;g;){if(g===l)return Ie(p),r;if(g===d)return Ie(p),i;g=g.sibling}throw Error(n(188))}if(l.return!==d.return)l=p,d=g;else{for(var _=!1,E=p.child;E;){if(E===l){_=!0,l=p,d=g;break}if(E===d){_=!0,d=p,l=g;break}E=E.sibling}if(!_){for(E=g.child;E;){if(E===l){_=!0,l=g,d=p;break}if(E===d){_=!0,d=g,l=p;break}E=E.sibling}if(!_)throw Error(n(189))}}if(l.alternate!==d)throw Error(n(190))}if(l.tag!==3)throw Error(n(188));return l.stateNode.current===l?r:i}function ot(r){return r=Le(r),r!==null?et(r):null}function et(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var i=et(r);if(i!==null)return i;r=r.sibling}return null}var ht=t.unstable_scheduleCallback,St=t.unstable_cancelCallback,$t=t.unstable_shouldYield,lt=t.unstable_requestPaint,rt=t.unstable_now,Er=t.unstable_getCurrentPriorityLevel,Ar=t.unstable_ImmediatePriority,qn=t.unstable_UserBlockingPriority,nn=t.unstable_NormalPriority,Ro=t.unstable_LowPriority,ta=t.unstable_IdlePriority,Tn=null,rn=null;function Pi(r){if(rn&&typeof rn.onCommitFiberRoot=="function")try{rn.onCommitFiberRoot(Tn,r,void 0,(r.current.flags&128)===128)}catch{}}var He=Math.clz32?Math.clz32:Rr,Ut=Math.log,na=Math.LN2;function Rr(r){return r>>>=0,r===0?32:31-(Ut(r)/na|0)|0}var ut=64,Lr=4194304;function ra(r){switch(r&-r){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: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 r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function Si(r,i){var l=r.pendingLanes;if(l===0)return 0;var d=0,p=r.suspendedLanes,g=r.pingedLanes,_=l&268435455;if(_!==0){var E=_&~p;E!==0?d=ra(E):(g&=_,g!==0&&(d=ra(g)))}else _=l&~p,_!==0?d=ra(_):g!==0&&(d=ra(g));if(d===0)return 0;if(i!==0&&i!==d&&(i&p)===0&&(p=d&-d,g=i&-i,p>=g||p===16&&(g&4194240)!==0))return i;if((d&4)!==0&&(d|=l&16),i=r.entangledLanes,i!==0)for(r=r.entanglements,i&=d;0<i;)l=31-He(i),p=1<<l,d|=r[l],i&=~p;return d}function zx(r,i){switch(r){case 1:case 2:case 4:return i+250;case 8:case 16:case 32:case 64: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 i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $x(r,i){for(var l=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,g=r.pendingLanes;0<g;){var _=31-He(g),E=1<<_,M=p[_];M===-1?((E&l)===0||(E&d)!==0)&&(p[_]=zx(E,i)):M<=i&&(r.expiredLanes|=E),g&=~E}}function ju(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function pm(){var r=ut;return ut<<=1,(ut&4194240)===0&&(ut=64),r}function Uu(r){for(var i=[],l=0;31>l;l++)i.push(r);return i}function Lo(r,i,l){r.pendingLanes|=i,i!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,i=31-He(i),r[i]=l}function Hx(r,i){var l=r.pendingLanes&~i;r.pendingLanes=i,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=i,r.mutableReadLanes&=i,r.entangledLanes&=i,i=r.entanglements;var d=r.eventTimes;for(r=r.expirationTimes;0<l;){var p=31-He(l),g=1<<p;i[p]=0,d[p]=-1,r[p]=-1,l&=~g}}function Bu(r,i){var l=r.entangledLanes|=i;for(r=r.entanglements;l;){var d=31-He(l),p=1<<d;p&i|r[d]&i&&(r[d]|=i),l&=~p}}var ct=0;function mm(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var gm,Fu,ym,vm,km,Vu=!1,ul=[],aa=null,ia=null,oa=null,Do=new Map,Mo=new Map,sa=[],Wx="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function _m(r,i){switch(r){case"focusin":case"focusout":aa=null;break;case"dragenter":case"dragleave":ia=null;break;case"mouseover":case"mouseout":oa=null;break;case"pointerover":case"pointerout":Do.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Mo.delete(i.pointerId)}}function Io(r,i,l,d,p,g){return r===null||r.nativeEvent!==g?(r={blockedOn:i,domEventName:l,eventSystemFlags:d,nativeEvent:g,targetContainers:[p]},i!==null&&(i=qo(i),i!==null&&Fu(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function Kx(r,i,l,d,p){switch(i){case"focusin":return aa=Io(aa,r,i,l,d,p),!0;case"dragenter":return ia=Io(ia,r,i,l,d,p),!0;case"mouseover":return oa=Io(oa,r,i,l,d,p),!0;case"pointerover":var g=p.pointerId;return Do.set(g,Io(Do.get(g)||null,r,i,l,d,p)),!0;case"gotpointercapture":return g=p.pointerId,Mo.set(g,Io(Mo.get(g)||null,r,i,l,d,p)),!0}return!1}function bm(r){var i=Va(r.target);if(i!==null){var l=he(i);if(l!==null){if(i=l.tag,i===13){if(i=Me(l),i!==null){r.blockedOn=i,km(r.priority,function(){ym(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){r.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}r.blockedOn=null}function dl(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var l=$u(r.domEventName,r.eventSystemFlags,i[0],r.nativeEvent);if(l===null){l=r.nativeEvent;var d=new l.constructor(l.type,l);bi=d,l.target.dispatchEvent(d),bi=null}else return i=qo(l),i!==null&&Fu(i),r.blockedOn=l,!1;i.shift()}return!0}function wm(r,i,l){dl(r)&&l.delete(i)}function Gx(){Vu=!1,aa!==null&&dl(aa)&&(aa=null),ia!==null&&dl(ia)&&(ia=null),oa!==null&&dl(oa)&&(oa=null),Do.forEach(wm),Mo.forEach(wm)}function No(r,i){r.blockedOn===i&&(r.blockedOn=null,Vu||(Vu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Gx)))}function Oo(r){function i(p){return No(p,r)}if(0<ul.length){No(ul[0],r);for(var l=1;l<ul.length;l++){var d=ul[l];d.blockedOn===r&&(d.blockedOn=null)}}for(aa!==null&&No(aa,r),ia!==null&&No(ia,r),oa!==null&&No(oa,r),Do.forEach(i),Mo.forEach(i),l=0;l<sa.length;l++)d=sa[l],d.blockedOn===r&&(d.blockedOn=null);for(;0<sa.length&&(l=sa[0],l.blockedOn===null);)bm(l),l.blockedOn===null&&sa.shift()}var Ci=O.ReactCurrentBatchConfig,hl=!0;function qx(r,i,l,d){var p=ct,g=Ci.transition;Ci.transition=null;try{ct=1,zu(r,i,l,d)}finally{ct=p,Ci.transition=g}}function Yx(r,i,l,d){var p=ct,g=Ci.transition;Ci.transition=null;try{ct=4,zu(r,i,l,d)}finally{ct=p,Ci.transition=g}}function zu(r,i,l,d){if(hl){var p=$u(r,i,l,d);if(p===null)od(r,i,d,fl,l),_m(r,d);else if(Kx(p,r,i,l,d))d.stopPropagation();else if(_m(r,d),i&4&&-1<Wx.indexOf(r)){for(;p!==null;){var g=qo(p);if(g!==null&&gm(g),g=$u(r,i,l,d),g===null&&od(r,i,d,fl,l),g===p)break;p=g}p!==null&&d.stopPropagation()}else od(r,i,d,null,l)}}var fl=null;function $u(r,i,l,d){if(fl=null,r=Co(d),r=Va(r),r!==null)if(i=he(r),i===null)r=null;else if(l=i.tag,l===13){if(r=Me(i),r!==null)return r;r=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null);return fl=r,null}function xm(r){switch(r){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Er()){case Ar:return 1;case qn:return 4;case nn:case Ro:return 16;case ta:return 536870912;default:return 16}default:return 16}}var la=null,Hu=null,pl=null;function Pm(){if(pl)return pl;var r,i=Hu,l=i.length,d,p="value"in la?la.value:la.textContent,g=p.length;for(r=0;r<l&&i[r]===p[r];r++);var _=l-r;for(d=1;d<=_&&i[l-d]===p[g-d];d++);return pl=p.slice(r,1<d?1-d:void 0)}function ml(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function gl(){return!0}function Sm(){return!1}function vn(r){function i(l,d,p,g,_){this._reactName=l,this._targetInst=p,this.type=d,this.nativeEvent=g,this.target=_,this.currentTarget=null;for(var E in r)r.hasOwnProperty(E)&&(l=r[E],this[E]=l?l(g):g[E]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?gl:Sm,this.isPropagationStopped=Sm,this}return H(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=gl)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=gl)},persist:function(){},isPersistent:gl}),i}var Ti={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wu=vn(Ti),jo=H({},Ti,{view:0,detail:0}),Zx=vn(jo),Ku,Gu,Uo,yl=H({},jo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yu,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Uo&&(Uo&&r.type==="mousemove"?(Ku=r.screenX-Uo.screenX,Gu=r.screenY-Uo.screenY):Gu=Ku=0,Uo=r),Ku)},movementY:function(r){return"movementY"in r?r.movementY:Gu}}),Cm=vn(yl),Xx=H({},yl,{dataTransfer:0}),Qx=vn(Xx),Jx=H({},jo,{relatedTarget:0}),qu=vn(Jx),eP=H({},Ti,{animationName:0,elapsedTime:0,pseudoElement:0}),tP=vn(eP),nP=H({},Ti,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),rP=vn(nP),aP=H({},Ti,{data:0}),Tm=vn(aP),iP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oP={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},sP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lP(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=sP[r])?!!i[r]:!1}function Yu(){return lP}var cP=H({},jo,{key:function(r){if(r.key){var i=iP[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=ml(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?oP[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yu,charCode:function(r){return r.type==="keypress"?ml(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?ml(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),uP=vn(cP),dP=H({},yl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Em=vn(dP),hP=H({},jo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yu}),fP=vn(hP),pP=H({},Ti,{propertyName:0,elapsedTime:0,pseudoElement:0}),mP=vn(pP),gP=H({},yl,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),yP=vn(gP),vP=[9,13,27,32],Zu=u&&"CompositionEvent"in window,Bo=null;u&&"documentMode"in document&&(Bo=document.documentMode);var kP=u&&"TextEvent"in window&&!Bo,Am=u&&(!Zu||Bo&&8<Bo&&11>=Bo),Rm=" ",Lm=!1;function Dm(r,i){switch(r){case"keyup":return vP.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mm(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ei=!1;function _P(r,i){switch(r){case"compositionend":return Mm(i);case"keypress":return i.which!==32?null:(Lm=!0,Rm);case"textInput":return r=i.data,r===Rm&&Lm?null:r;default:return null}}function bP(r,i){if(Ei)return r==="compositionend"||!Zu&&Dm(r,i)?(r=Pm(),pl=Hu=la=null,Ei=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Am&&i.locale!=="ko"?null:i.data;default:return null}}var wP={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Im(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!wP[r.type]:i==="textarea"}function Nm(r,i,l,d){ll(d),i=wl(i,"onChange"),0<i.length&&(l=new Wu("onChange","change",null,l,d),r.push({event:l,listeners:i}))}var Fo=null,Vo=null;function xP(r){Jm(r,0)}function vl(r){var i=Mi(r);if(Cr(i))return r}function PP(r,i){if(r==="change")return i}var Om=!1;if(u){var Xu;if(u){var Qu="oninput"in document;if(!Qu){var jm=document.createElement("div");jm.setAttribute("oninput","return;"),Qu=typeof jm.oninput=="function"}Xu=Qu}else Xu=!1;Om=Xu&&(!document.documentMode||9<document.documentMode)}function Um(){Fo&&(Fo.detachEvent("onpropertychange",Bm),Vo=Fo=null)}function Bm(r){if(r.propertyName==="value"&&vl(Vo)){var i=[];Nm(i,Vo,r,Co(r)),Ba(xP,i)}}function SP(r,i,l){r==="focusin"?(Um(),Fo=i,Vo=l,Fo.attachEvent("onpropertychange",Bm)):r==="focusout"&&Um()}function CP(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return vl(Vo)}function TP(r,i){if(r==="click")return vl(i)}function EP(r,i){if(r==="input"||r==="change")return vl(i)}function AP(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Yn=typeof Object.is=="function"?Object.is:AP;function zo(r,i){if(Yn(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var l=Object.keys(r),d=Object.keys(i);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var p=l[d];if(!h.call(i,p)||!Yn(r[p],i[p]))return!1}return!0}function Fm(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Vm(r,i){var l=Fm(r);r=0;for(var d;l;){if(l.nodeType===3){if(d=r+l.textContent.length,r<=i&&d>=i)return{node:l,offset:i-r};r=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Fm(l)}}function zm(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?zm(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function $m(){for(var r=window,i=pt();i instanceof r.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)r=i.contentWindow;else break;i=pt(r.document)}return i}function Ju(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}function RP(r){var i=$m(),l=r.focusedElem,d=r.selectionRange;if(i!==l&&l&&l.ownerDocument&&zm(l.ownerDocument.documentElement,l)){if(d!==null&&Ju(l)){if(i=d.start,r=d.end,r===void 0&&(r=i),"selectionStart"in l)l.selectionStart=i,l.selectionEnd=Math.min(r,l.value.length);else if(r=(i=l.ownerDocument||document)&&i.defaultView||window,r.getSelection){r=r.getSelection();var p=l.textContent.length,g=Math.min(d.start,p);d=d.end===void 0?g:Math.min(d.end,p),!r.extend&&g>d&&(p=d,d=g,g=p),p=Vm(l,g);var _=Vm(l,d);p&&_&&(r.rangeCount!==1||r.anchorNode!==p.node||r.anchorOffset!==p.offset||r.focusNode!==_.node||r.focusOffset!==_.offset)&&(i=i.createRange(),i.setStart(p.node,p.offset),r.removeAllRanges(),g>d?(r.addRange(i),r.extend(_.node,_.offset)):(i.setEnd(_.node,_.offset),r.addRange(i)))}}for(i=[],r=l;r=r.parentNode;)r.nodeType===1&&i.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<i.length;l++)r=i[l],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var LP=u&&"documentMode"in document&&11>=document.documentMode,Ai=null,ed=null,$o=null,td=!1;function Hm(r,i,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;td||Ai==null||Ai!==pt(d)||(d=Ai,"selectionStart"in d&&Ju(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),$o&&zo($o,d)||($o=d,d=wl(ed,"onSelect"),0<d.length&&(i=new Wu("onSelect","select",null,i,l),r.push({event:i,listeners:d}),i.target=Ai)))}function kl(r,i){var l={};return l[r.toLowerCase()]=i.toLowerCase(),l["Webkit"+r]="webkit"+i,l["Moz"+r]="moz"+i,l}var Ri={animationend:kl("Animation","AnimationEnd"),animationiteration:kl("Animation","AnimationIteration"),animationstart:kl("Animation","AnimationStart"),transitionend:kl("Transition","TransitionEnd")},nd={},Wm={};u&&(Wm=document.createElement("div").style,"AnimationEvent"in window||(delete Ri.animationend.animation,delete Ri.animationiteration.animation,delete Ri.animationstart.animation),"TransitionEvent"in window||delete Ri.transitionend.transition);function _l(r){if(nd[r])return nd[r];if(!Ri[r])return r;var i=Ri[r],l;for(l in i)if(i.hasOwnProperty(l)&&l in Wm)return nd[r]=i[l];return r}var Km=_l("animationend"),Gm=_l("animationiteration"),qm=_l("animationstart"),Ym=_l("transitionend"),Zm=new Map,Xm="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ca(r,i){Zm.set(r,i),s(i,[r])}for(var rd=0;rd<Xm.length;rd++){var ad=Xm[rd],DP=ad.toLowerCase(),MP=ad[0].toUpperCase()+ad.slice(1);ca(DP,"on"+MP)}ca(Km,"onAnimationEnd"),ca(Gm,"onAnimationIteration"),ca(qm,"onAnimationStart"),ca("dblclick","onDoubleClick"),ca("focusin","onFocus"),ca("focusout","onBlur"),ca(Ym,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ho="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),IP=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ho));function Qm(r,i,l){var d=r.type||"unknown-event";r.currentTarget=l,De(d,i,void 0,r),r.currentTarget=null}function Jm(r,i){i=(i&4)!==0;for(var l=0;l<r.length;l++){var d=r[l],p=d.event;d=d.listeners;e:{var g=void 0;if(i)for(var _=d.length-1;0<=_;_--){var E=d[_],M=E.instance,$=E.currentTarget;if(E=E.listener,M!==g&&p.isPropagationStopped())break e;Qm(p,E,$),g=M}else for(_=0;_<d.length;_++){if(E=d[_],M=E.instance,$=E.currentTarget,E=E.listener,M!==g&&p.isPropagationStopped())break e;Qm(p,E,$),g=M}}}if(te)throw r=ae,te=!1,ae=null,r}function mt(r,i){var l=i[hd];l===void 0&&(l=i[hd]=new Set);var d=r+"__bubble";l.has(d)||(eg(i,r,2,!1),l.add(d))}function id(r,i,l){var d=0;i&&(d|=4),eg(l,r,d,i)}var bl="_reactListening"+Math.random().toString(36).slice(2);function Wo(r){if(!r[bl]){r[bl]=!0,a.forEach(function(l){l!=="selectionchange"&&(IP.has(l)||id(l,!1,r),id(l,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[bl]||(i[bl]=!0,id("selectionchange",!1,i))}}function eg(r,i,l,d){switch(xm(i)){case 1:var p=qx;break;case 4:p=Yx;break;default:p=zu}l=p.bind(null,i,l,r),p=void 0,!Ao||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),d?p!==void 0?r.addEventListener(i,l,{capture:!0,passive:p}):r.addEventListener(i,l,!0):p!==void 0?r.addEventListener(i,l,{passive:p}):r.addEventListener(i,l,!1)}function od(r,i,l,d,p){var g=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var _=d.tag;if(_===3||_===4){var E=d.stateNode.containerInfo;if(E===p||E.nodeType===8&&E.parentNode===p)break;if(_===4)for(_=d.return;_!==null;){var M=_.tag;if((M===3||M===4)&&(M=_.stateNode.containerInfo,M===p||M.nodeType===8&&M.parentNode===p))return;_=_.return}for(;E!==null;){if(_=Va(E),_===null)return;if(M=_.tag,M===5||M===6){d=g=_;continue e}E=E.parentNode}}d=d.return}Ba(function(){var $=g,ee=Co(l),ne=[];e:{var J=Zm.get(r);if(J!==void 0){var ue=Wu,ve=r;switch(r){case"keypress":if(ml(l)===0)break e;case"keydown":case"keyup":ue=uP;break;case"focusin":ve="focus",ue=qu;break;case"focusout":ve="blur",ue=qu;break;case"beforeblur":case"afterblur":ue=qu;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=Cm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=Qx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=fP;break;case Km:case Gm:case qm:ue=tP;break;case Ym:ue=mP;break;case"scroll":ue=Zx;break;case"wheel":ue=yP;break;case"copy":case"cut":case"paste":ue=rP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=Em}var we=(i&4)!==0,Ct=!we&&r==="scroll",B=we?J!==null?J+"Capture":null:J;we=[];for(var j=$,F;j!==null;){F=j;var oe=F.stateNode;if(F.tag===5&&oe!==null&&(F=oe,B!==null&&(oe=ea(j,B),oe!=null&&we.push(Ko(j,oe,F)))),Ct)break;j=j.return}0<we.length&&(J=new ue(J,ve,null,l,ee),ne.push({event:J,listeners:we}))}}if((i&7)===0){e:{if(J=r==="mouseover"||r==="pointerover",ue=r==="mouseout"||r==="pointerout",J&&l!==bi&&(ve=l.relatedTarget||l.fromElement)&&(Va(ve)||ve[Dr]))break e;if((ue||J)&&(J=ee.window===ee?ee:(J=ee.ownerDocument)?J.defaultView||J.parentWindow:window,ue?(ve=l.relatedTarget||l.toElement,ue=$,ve=ve?Va(ve):null,ve!==null&&(Ct=he(ve),ve!==Ct||ve.tag!==5&&ve.tag!==6)&&(ve=null)):(ue=null,ve=$),ue!==ve)){if(we=Cm,oe="onMouseLeave",B="onMouseEnter",j="mouse",(r==="pointerout"||r==="pointerover")&&(we=Em,oe="onPointerLeave",B="onPointerEnter",j="pointer"),Ct=ue==null?J:Mi(ue),F=ve==null?J:Mi(ve),J=new we(oe,j+"leave",ue,l,ee),J.target=Ct,J.relatedTarget=F,oe=null,Va(ee)===$&&(we=new we(B,j+"enter",ve,l,ee),we.target=F,we.relatedTarget=Ct,oe=we),Ct=oe,ue&&ve)t:{for(we=ue,B=ve,j=0,F=we;F;F=Li(F))j++;for(F=0,oe=B;oe;oe=Li(oe))F++;for(;0<j-F;)we=Li(we),j--;for(;0<F-j;)B=Li(B),F--;for(;j--;){if(we===B||B!==null&&we===B.alternate)break t;we=Li(we),B=Li(B)}we=null}else we=null;ue!==null&&tg(ne,J,ue,we,!1),ve!==null&&Ct!==null&&tg(ne,Ct,ve,we,!0)}}e:{if(J=$?Mi($):window,ue=J.nodeName&&J.nodeName.toLowerCase(),ue==="select"||ue==="input"&&J.type==="file")var Se=PP;else if(Im(J))if(Om)Se=EP;else{Se=CP;var Oe=SP}else(ue=J.nodeName)&&ue.toLowerCase()==="input"&&(J.type==="checkbox"||J.type==="radio")&&(Se=TP);if(Se&&(Se=Se(r,$))){Nm(ne,Se,l,ee);break e}Oe&&Oe(r,J,$),r==="focusout"&&(Oe=J._wrapperState)&&Oe.controlled&&J.type==="number"&&Po(J,"number",J.value)}switch(Oe=$?Mi($):window,r){case"focusin":(Im(Oe)||Oe.contentEditable==="true")&&(Ai=Oe,ed=$,$o=null);break;case"focusout":$o=ed=Ai=null;break;case"mousedown":td=!0;break;case"contextmenu":case"mouseup":case"dragend":td=!1,Hm(ne,l,ee);break;case"selectionchange":if(LP)break;case"keydown":case"keyup":Hm(ne,l,ee)}var je;if(Zu)e:{switch(r){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else Ei?Dm(r,l)&&(Ve="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(Ve="onCompositionStart");Ve&&(Am&&l.locale!=="ko"&&(Ei||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Ei&&(je=Pm()):(la=ee,Hu="value"in la?la.value:la.textContent,Ei=!0)),Oe=wl($,Ve),0<Oe.length&&(Ve=new Tm(Ve,r,null,l,ee),ne.push({event:Ve,listeners:Oe}),je?Ve.data=je:(je=Mm(l),je!==null&&(Ve.data=je)))),(je=kP?_P(r,l):bP(r,l))&&($=wl($,"onBeforeInput"),0<$.length&&(ee=new Tm("onBeforeInput","beforeinput",null,l,ee),ne.push({event:ee,listeners:$}),ee.data=je))}Jm(ne,i)})}function Ko(r,i,l){return{instance:r,listener:i,currentTarget:l}}function wl(r,i){for(var l=i+"Capture",d=[];r!==null;){var p=r,g=p.stateNode;p.tag===5&&g!==null&&(p=g,g=ea(r,l),g!=null&&d.unshift(Ko(r,g,p)),g=ea(r,i),g!=null&&d.push(Ko(r,g,p))),r=r.return}return d}function Li(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function tg(r,i,l,d,p){for(var g=i._reactName,_=[];l!==null&&l!==d;){var E=l,M=E.alternate,$=E.stateNode;if(M!==null&&M===d)break;E.tag===5&&$!==null&&(E=$,p?(M=ea(l,g),M!=null&&_.unshift(Ko(l,M,E))):p||(M=ea(l,g),M!=null&&_.push(Ko(l,M,E)))),l=l.return}_.length!==0&&r.push({event:i,listeners:_})}var NP=/\r\n?/g,OP=/\u0000|\uFFFD/g;function ng(r){return(typeof r=="string"?r:""+r).replace(NP,`
7
+ `).replace(OP,"")}function xl(r,i,l){if(i=ng(i),ng(r)!==i&&l)throw Error(n(425))}function Pl(){}var sd=null,ld=null;function cd(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var ud=typeof setTimeout=="function"?setTimeout:void 0,jP=typeof clearTimeout=="function"?clearTimeout:void 0,rg=typeof Promise=="function"?Promise:void 0,UP=typeof queueMicrotask=="function"?queueMicrotask:typeof rg<"u"?function(r){return rg.resolve(null).then(r).catch(BP)}:ud;function BP(r){setTimeout(function(){throw r})}function dd(r,i){var l=i,d=0;do{var p=l.nextSibling;if(r.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"){if(d===0){r.removeChild(p),Oo(i);return}d--}else l!=="$"&&l!=="$?"&&l!=="$!"||d++;l=p}while(l);Oo(i)}function ua(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?")break;if(i==="/$")return null}}return r}function ag(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="$"||l==="$!"||l==="$?"){if(i===0)return r;i--}else l==="/$"&&i++}r=r.previousSibling}return null}var Di=Math.random().toString(36).slice(2),cr="__reactFiber$"+Di,Go="__reactProps$"+Di,Dr="__reactContainer$"+Di,hd="__reactEvents$"+Di,FP="__reactListeners$"+Di,VP="__reactHandles$"+Di;function Va(r){var i=r[cr];if(i)return i;for(var l=r.parentNode;l;){if(i=l[Dr]||l[cr]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(r=ag(r);r!==null;){if(l=r[cr])return l;r=ag(r)}return i}r=l,l=r.parentNode}return null}function qo(r){return r=r[cr]||r[Dr],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function Mi(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function Sl(r){return r[Go]||null}var fd=[],Ii=-1;function da(r){return{current:r}}function gt(r){0>Ii||(r.current=fd[Ii],fd[Ii]=null,Ii--)}function ft(r,i){Ii++,fd[Ii]=r.current,r.current=i}var ha={},qt=da(ha),hn=da(!1),za=ha;function Ni(r,i){var l=r.type.contextTypes;if(!l)return ha;var d=r.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===i)return d.__reactInternalMemoizedMaskedChildContext;var p={},g;for(g in l)p[g]=i[g];return d&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=i,r.__reactInternalMemoizedMaskedChildContext=p),p}function fn(r){return r=r.childContextTypes,r!=null}function Cl(){gt(hn),gt(qt)}function ig(r,i,l){if(qt.current!==ha)throw Error(n(168));ft(qt,i),ft(hn,l)}function og(r,i,l){var d=r.stateNode;if(i=i.childContextTypes,typeof d.getChildContext!="function")return l;d=d.getChildContext();for(var p in d)if(!(p in i))throw Error(n(108,Ge(r)||"Unknown",p));return H({},l,d)}function Tl(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||ha,za=qt.current,ft(qt,r),ft(hn,hn.current),!0}function sg(r,i,l){var d=r.stateNode;if(!d)throw Error(n(169));l?(r=og(r,i,za),d.__reactInternalMemoizedMergedChildContext=r,gt(hn),gt(qt),ft(qt,r)):gt(hn),ft(hn,l)}var Mr=null,El=!1,pd=!1;function lg(r){Mr===null?Mr=[r]:Mr.push(r)}function zP(r){El=!0,lg(r)}function fa(){if(!pd&&Mr!==null){pd=!0;var r=0,i=ct;try{var l=Mr;for(ct=1;r<l.length;r++){var d=l[r];do d=d(!0);while(d!==null)}Mr=null,El=!1}catch(p){throw Mr!==null&&(Mr=Mr.slice(r+1)),ht(Ar,fa),p}finally{ct=i,pd=!1}}return null}var Oi=[],ji=0,Al=null,Rl=0,En=[],An=0,$a=null,Ir=1,Nr="";function Ha(r,i){Oi[ji++]=Rl,Oi[ji++]=Al,Al=r,Rl=i}function cg(r,i,l){En[An++]=Ir,En[An++]=Nr,En[An++]=$a,$a=r;var d=Ir;r=Nr;var p=32-He(d)-1;d&=~(1<<p),l+=1;var g=32-He(i)+p;if(30<g){var _=p-p%5;g=(d&(1<<_)-1).toString(32),d>>=_,p-=_,Ir=1<<32-He(i)+p|l<<p|d,Nr=g+r}else Ir=1<<g|l<<p|d,Nr=r}function md(r){r.return!==null&&(Ha(r,1),cg(r,1,0))}function gd(r){for(;r===Al;)Al=Oi[--ji],Oi[ji]=null,Rl=Oi[--ji],Oi[ji]=null;for(;r===$a;)$a=En[--An],En[An]=null,Nr=En[--An],En[An]=null,Ir=En[--An],En[An]=null}var kn=null,_n=null,kt=!1,Zn=null;function ug(r,i){var l=Mn(5,null,null,0);l.elementType="DELETED",l.stateNode=i,l.return=r,i=r.deletions,i===null?(r.deletions=[l],r.flags|=16):i.push(l)}function dg(r,i){switch(r.tag){case 5:var l=r.type;return i=i.nodeType!==1||l.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(r.stateNode=i,kn=r,_n=ua(i.firstChild),!0):!1;case 6:return i=r.pendingProps===""||i.nodeType!==3?null:i,i!==null?(r.stateNode=i,kn=r,_n=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(l=$a!==null?{id:Ir,overflow:Nr}:null,r.memoizedState={dehydrated:i,treeContext:l,retryLane:1073741824},l=Mn(18,null,null,0),l.stateNode=i,l.return=r,r.child=l,kn=r,_n=null,!0):!1;default:return!1}}function yd(r){return(r.mode&1)!==0&&(r.flags&128)===0}function vd(r){if(kt){var i=_n;if(i){var l=i;if(!dg(r,i)){if(yd(r))throw Error(n(418));i=ua(l.nextSibling);var d=kn;i&&dg(r,i)?ug(d,l):(r.flags=r.flags&-4097|2,kt=!1,kn=r)}}else{if(yd(r))throw Error(n(418));r.flags=r.flags&-4097|2,kt=!1,kn=r}}}function hg(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;kn=r}function Ll(r){if(r!==kn)return!1;if(!kt)return hg(r),kt=!0,!1;var i;if((i=r.tag!==3)&&!(i=r.tag!==5)&&(i=r.type,i=i!=="head"&&i!=="body"&&!cd(r.type,r.memoizedProps)),i&&(i=_n)){if(yd(r))throw fg(),Error(n(418));for(;i;)ug(r,i),i=ua(i.nextSibling)}if(hg(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="/$"){if(i===0){_n=ua(r.nextSibling);break e}i--}else l!=="$"&&l!=="$!"&&l!=="$?"||i++}r=r.nextSibling}_n=null}}else _n=kn?ua(r.stateNode.nextSibling):null;return!0}function fg(){for(var r=_n;r;)r=ua(r.nextSibling)}function Ui(){_n=kn=null,kt=!1}function kd(r){Zn===null?Zn=[r]:Zn.push(r)}var $P=O.ReactCurrentBatchConfig;function Yo(r,i,l){if(r=l.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(l._owner){if(l=l._owner,l){if(l.tag!==1)throw Error(n(309));var d=l.stateNode}if(!d)throw Error(n(147,r));var p=d,g=""+r;return i!==null&&i.ref!==null&&typeof i.ref=="function"&&i.ref._stringRef===g?i.ref:(i=function(_){var E=p.refs;_===null?delete E[g]:E[g]=_},i._stringRef=g,i)}if(typeof r!="string")throw Error(n(284));if(!l._owner)throw Error(n(290,r))}return r}function Dl(r,i){throw r=Object.prototype.toString.call(i),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r))}function pg(r){var i=r._init;return i(r._payload)}function mg(r){function i(B,j){if(r){var F=B.deletions;F===null?(B.deletions=[j],B.flags|=16):F.push(j)}}function l(B,j){if(!r)return null;for(;j!==null;)i(B,j),j=j.sibling;return null}function d(B,j){for(B=new Map;j!==null;)j.key!==null?B.set(j.key,j):B.set(j.index,j),j=j.sibling;return B}function p(B,j){return B=ba(B,j),B.index=0,B.sibling=null,B}function g(B,j,F){return B.index=F,r?(F=B.alternate,F!==null?(F=F.index,F<j?(B.flags|=2,j):F):(B.flags|=2,j)):(B.flags|=1048576,j)}function _(B){return r&&B.alternate===null&&(B.flags|=2),B}function E(B,j,F,oe){return j===null||j.tag!==6?(j=uh(F,B.mode,oe),j.return=B,j):(j=p(j,F),j.return=B,j)}function M(B,j,F,oe){var Se=F.type;return Se===z?ee(B,j,F.props.children,oe,F.key):j!==null&&(j.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===pe&&pg(Se)===j.type)?(oe=p(j,F.props),oe.ref=Yo(B,j,F),oe.return=B,oe):(oe=nc(F.type,F.key,F.props,null,B.mode,oe),oe.ref=Yo(B,j,F),oe.return=B,oe)}function $(B,j,F,oe){return j===null||j.tag!==4||j.stateNode.containerInfo!==F.containerInfo||j.stateNode.implementation!==F.implementation?(j=dh(F,B.mode,oe),j.return=B,j):(j=p(j,F.children||[]),j.return=B,j)}function ee(B,j,F,oe,Se){return j===null||j.tag!==7?(j=Qa(F,B.mode,oe,Se),j.return=B,j):(j=p(j,F),j.return=B,j)}function ne(B,j,F){if(typeof j=="string"&&j!==""||typeof j=="number")return j=uh(""+j,B.mode,F),j.return=B,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case G:return F=nc(j.type,j.key,j.props,null,B.mode,F),F.ref=Yo(B,null,j),F.return=B,F;case W:return j=dh(j,B.mode,F),j.return=B,j;case pe:var oe=j._init;return ne(B,oe(j._payload),F)}if(qr(j)||Z(j))return j=Qa(j,B.mode,F,null),j.return=B,j;Dl(B,j)}return null}function J(B,j,F,oe){var Se=j!==null?j.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return Se!==null?null:E(B,j,""+F,oe);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case G:return F.key===Se?M(B,j,F,oe):null;case W:return F.key===Se?$(B,j,F,oe):null;case pe:return Se=F._init,J(B,j,Se(F._payload),oe)}if(qr(F)||Z(F))return Se!==null?null:ee(B,j,F,oe,null);Dl(B,F)}return null}function ue(B,j,F,oe,Se){if(typeof oe=="string"&&oe!==""||typeof oe=="number")return B=B.get(F)||null,E(j,B,""+oe,Se);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case G:return B=B.get(oe.key===null?F:oe.key)||null,M(j,B,oe,Se);case W:return B=B.get(oe.key===null?F:oe.key)||null,$(j,B,oe,Se);case pe:var Oe=oe._init;return ue(B,j,F,Oe(oe._payload),Se)}if(qr(oe)||Z(oe))return B=B.get(F)||null,ee(j,B,oe,Se,null);Dl(j,oe)}return null}function ve(B,j,F,oe){for(var Se=null,Oe=null,je=j,Ve=j=0,Vt=null;je!==null&&Ve<F.length;Ve++){je.index>Ve?(Vt=je,je=null):Vt=je.sibling;var st=J(B,je,F[Ve],oe);if(st===null){je===null&&(je=Vt);break}r&&je&&st.alternate===null&&i(B,je),j=g(st,j,Ve),Oe===null?Se=st:Oe.sibling=st,Oe=st,je=Vt}if(Ve===F.length)return l(B,je),kt&&Ha(B,Ve),Se;if(je===null){for(;Ve<F.length;Ve++)je=ne(B,F[Ve],oe),je!==null&&(j=g(je,j,Ve),Oe===null?Se=je:Oe.sibling=je,Oe=je);return kt&&Ha(B,Ve),Se}for(je=d(B,je);Ve<F.length;Ve++)Vt=ue(je,B,Ve,F[Ve],oe),Vt!==null&&(r&&Vt.alternate!==null&&je.delete(Vt.key===null?Ve:Vt.key),j=g(Vt,j,Ve),Oe===null?Se=Vt:Oe.sibling=Vt,Oe=Vt);return r&&je.forEach(function(wa){return i(B,wa)}),kt&&Ha(B,Ve),Se}function we(B,j,F,oe){var Se=Z(F);if(typeof Se!="function")throw Error(n(150));if(F=Se.call(F),F==null)throw Error(n(151));for(var Oe=Se=null,je=j,Ve=j=0,Vt=null,st=F.next();je!==null&&!st.done;Ve++,st=F.next()){je.index>Ve?(Vt=je,je=null):Vt=je.sibling;var wa=J(B,je,st.value,oe);if(wa===null){je===null&&(je=Vt);break}r&&je&&wa.alternate===null&&i(B,je),j=g(wa,j,Ve),Oe===null?Se=wa:Oe.sibling=wa,Oe=wa,je=Vt}if(st.done)return l(B,je),kt&&Ha(B,Ve),Se;if(je===null){for(;!st.done;Ve++,st=F.next())st=ne(B,st.value,oe),st!==null&&(j=g(st,j,Ve),Oe===null?Se=st:Oe.sibling=st,Oe=st);return kt&&Ha(B,Ve),Se}for(je=d(B,je);!st.done;Ve++,st=F.next())st=ue(je,B,Ve,st.value,oe),st!==null&&(r&&st.alternate!==null&&je.delete(st.key===null?Ve:st.key),j=g(st,j,Ve),Oe===null?Se=st:Oe.sibling=st,Oe=st);return r&&je.forEach(function(wS){return i(B,wS)}),kt&&Ha(B,Ve),Se}function Ct(B,j,F,oe){if(typeof F=="object"&&F!==null&&F.type===z&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case G:e:{for(var Se=F.key,Oe=j;Oe!==null;){if(Oe.key===Se){if(Se=F.type,Se===z){if(Oe.tag===7){l(B,Oe.sibling),j=p(Oe,F.props.children),j.return=B,B=j;break e}}else if(Oe.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===pe&&pg(Se)===Oe.type){l(B,Oe.sibling),j=p(Oe,F.props),j.ref=Yo(B,Oe,F),j.return=B,B=j;break e}l(B,Oe);break}else i(B,Oe);Oe=Oe.sibling}F.type===z?(j=Qa(F.props.children,B.mode,oe,F.key),j.return=B,B=j):(oe=nc(F.type,F.key,F.props,null,B.mode,oe),oe.ref=Yo(B,j,F),oe.return=B,B=oe)}return _(B);case W:e:{for(Oe=F.key;j!==null;){if(j.key===Oe)if(j.tag===4&&j.stateNode.containerInfo===F.containerInfo&&j.stateNode.implementation===F.implementation){l(B,j.sibling),j=p(j,F.children||[]),j.return=B,B=j;break e}else{l(B,j);break}else i(B,j);j=j.sibling}j=dh(F,B.mode,oe),j.return=B,B=j}return _(B);case pe:return Oe=F._init,Ct(B,j,Oe(F._payload),oe)}if(qr(F))return ve(B,j,F,oe);if(Z(F))return we(B,j,F,oe);Dl(B,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,j!==null&&j.tag===6?(l(B,j.sibling),j=p(j,F),j.return=B,B=j):(l(B,j),j=uh(F,B.mode,oe),j.return=B,B=j),_(B)):l(B,j)}return Ct}var Bi=mg(!0),gg=mg(!1),Ml=da(null),Il=null,Fi=null,_d=null;function bd(){_d=Fi=Il=null}function wd(r){var i=Ml.current;gt(Ml),r._currentValue=i}function xd(r,i,l){for(;r!==null;){var d=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),r===l)break;r=r.return}}function Vi(r,i){Il=r,_d=Fi=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&i)!==0&&(pn=!0),r.firstContext=null)}function Rn(r){var i=r._currentValue;if(_d!==r)if(r={context:r,memoizedValue:i,next:null},Fi===null){if(Il===null)throw Error(n(308));Fi=r,Il.dependencies={lanes:0,firstContext:r}}else Fi=Fi.next=r;return i}var Wa=null;function Pd(r){Wa===null?Wa=[r]:Wa.push(r)}function yg(r,i,l,d){var p=i.interleaved;return p===null?(l.next=l,Pd(i)):(l.next=p.next,p.next=l),i.interleaved=l,Or(r,d)}function Or(r,i){r.lanes|=i;var l=r.alternate;for(l!==null&&(l.lanes|=i),l=r,r=r.return;r!==null;)r.childLanes|=i,l=r.alternate,l!==null&&(l.childLanes|=i),l=r,r=r.return;return l.tag===3?l.stateNode:null}var pa=!1;function Sd(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function vg(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function jr(r,i){return{eventTime:r,lane:i,tag:0,payload:null,callback:null,next:null}}function ma(r,i,l){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(at&2)!==0){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,Or(r,l)}return p=d.interleaved,p===null?(i.next=i,Pd(d)):(i.next=p.next,p.next=i),d.interleaved=i,Or(r,l)}function Nl(r,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194240)!==0)){var d=i.lanes;d&=r.pendingLanes,l|=d,i.lanes=l,Bu(r,l)}}function kg(r,i){var l=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var p=null,g=null;if(l=l.firstBaseUpdate,l!==null){do{var _={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};g===null?p=g=_:g=g.next=_,l=l.next}while(l!==null);g===null?p=g=i:g=g.next=i}else p=g=i;l={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:d.shared,effects:d.effects},r.updateQueue=l;return}r=l.lastBaseUpdate,r===null?l.firstBaseUpdate=i:r.next=i,l.lastBaseUpdate=i}function Ol(r,i,l,d){var p=r.updateQueue;pa=!1;var g=p.firstBaseUpdate,_=p.lastBaseUpdate,E=p.shared.pending;if(E!==null){p.shared.pending=null;var M=E,$=M.next;M.next=null,_===null?g=$:_.next=$,_=M;var ee=r.alternate;ee!==null&&(ee=ee.updateQueue,E=ee.lastBaseUpdate,E!==_&&(E===null?ee.firstBaseUpdate=$:E.next=$,ee.lastBaseUpdate=M))}if(g!==null){var ne=p.baseState;_=0,ee=$=M=null,E=g;do{var J=E.lane,ue=E.eventTime;if((d&J)===J){ee!==null&&(ee=ee.next={eventTime:ue,lane:0,tag:E.tag,payload:E.payload,callback:E.callback,next:null});e:{var ve=r,we=E;switch(J=i,ue=l,we.tag){case 1:if(ve=we.payload,typeof ve=="function"){ne=ve.call(ue,ne,J);break e}ne=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=we.payload,J=typeof ve=="function"?ve.call(ue,ne,J):ve,J==null)break e;ne=H({},ne,J);break e;case 2:pa=!0}}E.callback!==null&&E.lane!==0&&(r.flags|=64,J=p.effects,J===null?p.effects=[E]:J.push(E))}else ue={eventTime:ue,lane:J,tag:E.tag,payload:E.payload,callback:E.callback,next:null},ee===null?($=ee=ue,M=ne):ee=ee.next=ue,_|=J;if(E=E.next,E===null){if(E=p.shared.pending,E===null)break;J=E,E=J.next,J.next=null,p.lastBaseUpdate=J,p.shared.pending=null}}while(!0);if(ee===null&&(M=ne),p.baseState=M,p.firstBaseUpdate=$,p.lastBaseUpdate=ee,i=p.shared.interleaved,i!==null){p=i;do _|=p.lane,p=p.next;while(p!==i)}else g===null&&(p.shared.lanes=0);qa|=_,r.lanes=_,r.memoizedState=ne}}function _g(r,i,l){if(r=i.effects,i.effects=null,r!==null)for(i=0;i<r.length;i++){var d=r[i],p=d.callback;if(p!==null){if(d.callback=null,d=l,typeof p!="function")throw Error(n(191,p));p.call(d)}}}var Zo={},ur=da(Zo),Xo=da(Zo),Qo=da(Zo);function Ka(r){if(r===Zo)throw Error(n(174));return r}function Cd(r,i){switch(ft(Qo,i),ft(Xo,r),ft(ur,Zo),r=i.nodeType,r){case 9:case 11:i=(i=i.documentElement)?i.namespaceURI:yi(null,"");break;default:r=r===8?i.parentNode:i,i=r.namespaceURI||null,r=r.tagName,i=yi(i,r)}gt(ur),ft(ur,i)}function zi(){gt(ur),gt(Xo),gt(Qo)}function bg(r){Ka(Qo.current);var i=Ka(ur.current),l=yi(i,r.type);i!==l&&(ft(Xo,r),ft(ur,l))}function Td(r){Xo.current===r&&(gt(ur),gt(Xo))}var bt=da(0);function jl(r){for(var i=r;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Ed=[];function Ad(){for(var r=0;r<Ed.length;r++)Ed[r]._workInProgressVersionPrimary=null;Ed.length=0}var Ul=O.ReactCurrentDispatcher,Rd=O.ReactCurrentBatchConfig,Ga=0,wt=null,Mt=null,Bt=null,Bl=!1,Jo=!1,es=0,HP=0;function Yt(){throw Error(n(321))}function Ld(r,i){if(i===null)return!1;for(var l=0;l<i.length&&l<r.length;l++)if(!Yn(r[l],i[l]))return!1;return!0}function Dd(r,i,l,d,p,g){if(Ga=g,wt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Ul.current=r===null||r.memoizedState===null?qP:YP,r=l(d,p),Jo){g=0;do{if(Jo=!1,es=0,25<=g)throw Error(n(301));g+=1,Bt=Mt=null,i.updateQueue=null,Ul.current=ZP,r=l(d,p)}while(Jo)}if(Ul.current=zl,i=Mt!==null&&Mt.next!==null,Ga=0,Bt=Mt=wt=null,Bl=!1,i)throw Error(n(300));return r}function Md(){var r=es!==0;return es=0,r}function dr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?wt.memoizedState=Bt=r:Bt=Bt.next=r,Bt}function Ln(){if(Mt===null){var r=wt.alternate;r=r!==null?r.memoizedState:null}else r=Mt.next;var i=Bt===null?wt.memoizedState:Bt.next;if(i!==null)Bt=i,Mt=r;else{if(r===null)throw Error(n(310));Mt=r,r={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},Bt===null?wt.memoizedState=Bt=r:Bt=Bt.next=r}return Bt}function ts(r,i){return typeof i=="function"?i(r):i}function Id(r){var i=Ln(),l=i.queue;if(l===null)throw Error(n(311));l.lastRenderedReducer=r;var d=Mt,p=d.baseQueue,g=l.pending;if(g!==null){if(p!==null){var _=p.next;p.next=g.next,g.next=_}d.baseQueue=p=g,l.pending=null}if(p!==null){g=p.next,d=d.baseState;var E=_=null,M=null,$=g;do{var ee=$.lane;if((Ga&ee)===ee)M!==null&&(M=M.next={lane:0,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null}),d=$.hasEagerState?$.eagerState:r(d,$.action);else{var ne={lane:ee,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null};M===null?(E=M=ne,_=d):M=M.next=ne,wt.lanes|=ee,qa|=ee}$=$.next}while($!==null&&$!==g);M===null?_=d:M.next=E,Yn(d,i.memoizedState)||(pn=!0),i.memoizedState=d,i.baseState=_,i.baseQueue=M,l.lastRenderedState=d}if(r=l.interleaved,r!==null){p=r;do g=p.lane,wt.lanes|=g,qa|=g,p=p.next;while(p!==r)}else p===null&&(l.lanes=0);return[i.memoizedState,l.dispatch]}function Nd(r){var i=Ln(),l=i.queue;if(l===null)throw Error(n(311));l.lastRenderedReducer=r;var d=l.dispatch,p=l.pending,g=i.memoizedState;if(p!==null){l.pending=null;var _=p=p.next;do g=r(g,_.action),_=_.next;while(_!==p);Yn(g,i.memoizedState)||(pn=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),l.lastRenderedState=g}return[g,d]}function wg(){}function xg(r,i){var l=wt,d=Ln(),p=i(),g=!Yn(d.memoizedState,p);if(g&&(d.memoizedState=p,pn=!0),d=d.queue,Od(Cg.bind(null,l,d,r),[r]),d.getSnapshot!==i||g||Bt!==null&&Bt.memoizedState.tag&1){if(l.flags|=2048,ns(9,Sg.bind(null,l,d,p,i),void 0,null),Ft===null)throw Error(n(349));(Ga&30)!==0||Pg(l,i,p)}return p}function Pg(r,i,l){r.flags|=16384,r={getSnapshot:i,value:l},i=wt.updateQueue,i===null?(i={lastEffect:null,stores:null},wt.updateQueue=i,i.stores=[r]):(l=i.stores,l===null?i.stores=[r]:l.push(r))}function Sg(r,i,l,d){i.value=l,i.getSnapshot=d,Tg(i)&&Eg(r)}function Cg(r,i,l){return l(function(){Tg(i)&&Eg(r)})}function Tg(r){var i=r.getSnapshot;r=r.value;try{var l=i();return!Yn(r,l)}catch{return!0}}function Eg(r){var i=Or(r,1);i!==null&&er(i,r,1,-1)}function Ag(r){var i=dr();return typeof r=="function"&&(r=r()),i.memoizedState=i.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ts,lastRenderedState:r},i.queue=r,r=r.dispatch=GP.bind(null,wt,r),[i.memoizedState,r]}function ns(r,i,l,d){return r={tag:r,create:i,destroy:l,deps:d,next:null},i=wt.updateQueue,i===null?(i={lastEffect:null,stores:null},wt.updateQueue=i,i.lastEffect=r.next=r):(l=i.lastEffect,l===null?i.lastEffect=r.next=r:(d=l.next,l.next=r,r.next=d,i.lastEffect=r)),r}function Rg(){return Ln().memoizedState}function Fl(r,i,l,d){var p=dr();wt.flags|=r,p.memoizedState=ns(1|i,l,void 0,d===void 0?null:d)}function Vl(r,i,l,d){var p=Ln();d=d===void 0?null:d;var g=void 0;if(Mt!==null){var _=Mt.memoizedState;if(g=_.destroy,d!==null&&Ld(d,_.deps)){p.memoizedState=ns(i,l,g,d);return}}wt.flags|=r,p.memoizedState=ns(1|i,l,g,d)}function Lg(r,i){return Fl(8390656,8,r,i)}function Od(r,i){return Vl(2048,8,r,i)}function Dg(r,i){return Vl(4,2,r,i)}function Mg(r,i){return Vl(4,4,r,i)}function Ig(r,i){if(typeof i=="function")return r=r(),i(r),function(){i(null)};if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function Ng(r,i,l){return l=l!=null?l.concat([r]):null,Vl(4,4,Ig.bind(null,i,r),l)}function jd(){}function Og(r,i){var l=Ln();i=i===void 0?null:i;var d=l.memoizedState;return d!==null&&i!==null&&Ld(i,d[1])?d[0]:(l.memoizedState=[r,i],r)}function jg(r,i){var l=Ln();i=i===void 0?null:i;var d=l.memoizedState;return d!==null&&i!==null&&Ld(i,d[1])?d[0]:(r=r(),l.memoizedState=[r,i],r)}function Ug(r,i,l){return(Ga&21)===0?(r.baseState&&(r.baseState=!1,pn=!0),r.memoizedState=l):(Yn(l,i)||(l=pm(),wt.lanes|=l,qa|=l,r.baseState=!0),i)}function WP(r,i){var l=ct;ct=l!==0&&4>l?l:4,r(!0);var d=Rd.transition;Rd.transition={};try{r(!1),i()}finally{ct=l,Rd.transition=d}}function Bg(){return Ln().memoizedState}function KP(r,i,l){var d=ka(r);if(l={lane:d,action:l,hasEagerState:!1,eagerState:null,next:null},Fg(r))Vg(i,l);else if(l=yg(r,i,l,d),l!==null){var p=on();er(l,r,d,p),zg(l,i,d)}}function GP(r,i,l){var d=ka(r),p={lane:d,action:l,hasEagerState:!1,eagerState:null,next:null};if(Fg(r))Vg(i,p);else{var g=r.alternate;if(r.lanes===0&&(g===null||g.lanes===0)&&(g=i.lastRenderedReducer,g!==null))try{var _=i.lastRenderedState,E=g(_,l);if(p.hasEagerState=!0,p.eagerState=E,Yn(E,_)){var M=i.interleaved;M===null?(p.next=p,Pd(i)):(p.next=M.next,M.next=p),i.interleaved=p;return}}catch{}l=yg(r,i,p,d),l!==null&&(p=on(),er(l,r,d,p),zg(l,i,d))}}function Fg(r){var i=r.alternate;return r===wt||i!==null&&i===wt}function Vg(r,i){Jo=Bl=!0;var l=r.pending;l===null?i.next=i:(i.next=l.next,l.next=i),r.pending=i}function zg(r,i,l){if((l&4194240)!==0){var d=i.lanes;d&=r.pendingLanes,l|=d,i.lanes=l,Bu(r,l)}}var zl={readContext:Rn,useCallback:Yt,useContext:Yt,useEffect:Yt,useImperativeHandle:Yt,useInsertionEffect:Yt,useLayoutEffect:Yt,useMemo:Yt,useReducer:Yt,useRef:Yt,useState:Yt,useDebugValue:Yt,useDeferredValue:Yt,useTransition:Yt,useMutableSource:Yt,useSyncExternalStore:Yt,useId:Yt,unstable_isNewReconciler:!1},qP={readContext:Rn,useCallback:function(r,i){return dr().memoizedState=[r,i===void 0?null:i],r},useContext:Rn,useEffect:Lg,useImperativeHandle:function(r,i,l){return l=l!=null?l.concat([r]):null,Fl(4194308,4,Ig.bind(null,i,r),l)},useLayoutEffect:function(r,i){return Fl(4194308,4,r,i)},useInsertionEffect:function(r,i){return Fl(4,2,r,i)},useMemo:function(r,i){var l=dr();return i=i===void 0?null:i,r=r(),l.memoizedState=[r,i],r},useReducer:function(r,i,l){var d=dr();return i=l!==void 0?l(i):i,d.memoizedState=d.baseState=i,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:i},d.queue=r,r=r.dispatch=KP.bind(null,wt,r),[d.memoizedState,r]},useRef:function(r){var i=dr();return r={current:r},i.memoizedState=r},useState:Ag,useDebugValue:jd,useDeferredValue:function(r){return dr().memoizedState=r},useTransition:function(){var r=Ag(!1),i=r[0];return r=WP.bind(null,r[1]),dr().memoizedState=r,[i,r]},useMutableSource:function(){},useSyncExternalStore:function(r,i,l){var d=wt,p=dr();if(kt){if(l===void 0)throw Error(n(407));l=l()}else{if(l=i(),Ft===null)throw Error(n(349));(Ga&30)!==0||Pg(d,i,l)}p.memoizedState=l;var g={value:l,getSnapshot:i};return p.queue=g,Lg(Cg.bind(null,d,g,r),[r]),d.flags|=2048,ns(9,Sg.bind(null,d,g,l,i),void 0,null),l},useId:function(){var r=dr(),i=Ft.identifierPrefix;if(kt){var l=Nr,d=Ir;l=(d&~(1<<32-He(d)-1)).toString(32)+l,i=":"+i+"R"+l,l=es++,0<l&&(i+="H"+l.toString(32)),i+=":"}else l=HP++,i=":"+i+"r"+l.toString(32)+":";return r.memoizedState=i},unstable_isNewReconciler:!1},YP={readContext:Rn,useCallback:Og,useContext:Rn,useEffect:Od,useImperativeHandle:Ng,useInsertionEffect:Dg,useLayoutEffect:Mg,useMemo:jg,useReducer:Id,useRef:Rg,useState:function(){return Id(ts)},useDebugValue:jd,useDeferredValue:function(r){var i=Ln();return Ug(i,Mt.memoizedState,r)},useTransition:function(){var r=Id(ts)[0],i=Ln().memoizedState;return[r,i]},useMutableSource:wg,useSyncExternalStore:xg,useId:Bg,unstable_isNewReconciler:!1},ZP={readContext:Rn,useCallback:Og,useContext:Rn,useEffect:Od,useImperativeHandle:Ng,useInsertionEffect:Dg,useLayoutEffect:Mg,useMemo:jg,useReducer:Nd,useRef:Rg,useState:function(){return Nd(ts)},useDebugValue:jd,useDeferredValue:function(r){var i=Ln();return Mt===null?i.memoizedState=r:Ug(i,Mt.memoizedState,r)},useTransition:function(){var r=Nd(ts)[0],i=Ln().memoizedState;return[r,i]},useMutableSource:wg,useSyncExternalStore:xg,useId:Bg,unstable_isNewReconciler:!1};function Xn(r,i){if(r&&r.defaultProps){i=H({},i),r=r.defaultProps;for(var l in r)i[l]===void 0&&(i[l]=r[l]);return i}return i}function Ud(r,i,l,d){i=r.memoizedState,l=l(d,i),l=l==null?i:H({},i,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var $l={isMounted:function(r){return(r=r._reactInternals)?he(r)===r:!1},enqueueSetState:function(r,i,l){r=r._reactInternals;var d=on(),p=ka(r),g=jr(d,p);g.payload=i,l!=null&&(g.callback=l),i=ma(r,g,p),i!==null&&(er(i,r,p,d),Nl(i,r,p))},enqueueReplaceState:function(r,i,l){r=r._reactInternals;var d=on(),p=ka(r),g=jr(d,p);g.tag=1,g.payload=i,l!=null&&(g.callback=l),i=ma(r,g,p),i!==null&&(er(i,r,p,d),Nl(i,r,p))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var l=on(),d=ka(r),p=jr(l,d);p.tag=2,i!=null&&(p.callback=i),i=ma(r,p,d),i!==null&&(er(i,r,d,l),Nl(i,r,d))}};function $g(r,i,l,d,p,g,_){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,g,_):i.prototype&&i.prototype.isPureReactComponent?!zo(l,d)||!zo(p,g):!0}function Hg(r,i,l){var d=!1,p=ha,g=i.contextType;return typeof g=="object"&&g!==null?g=Rn(g):(p=fn(i)?za:qt.current,d=i.contextTypes,g=(d=d!=null)?Ni(r,p):ha),i=new i(l,g),r.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=$l,r.stateNode=i,i._reactInternals=r,d&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=p,r.__reactInternalMemoizedMaskedChildContext=g),i}function Wg(r,i,l,d){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,d),i.state!==r&&$l.enqueueReplaceState(i,i.state,null)}function Bd(r,i,l,d){var p=r.stateNode;p.props=l,p.state=r.memoizedState,p.refs={},Sd(r);var g=i.contextType;typeof g=="object"&&g!==null?p.context=Rn(g):(g=fn(i)?za:qt.current,p.context=Ni(r,g)),p.state=r.memoizedState,g=i.getDerivedStateFromProps,typeof g=="function"&&(Ud(r,i,g,l),p.state=r.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(i=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),i!==p.state&&$l.enqueueReplaceState(p,p.state,null),Ol(r,l,p,d),p.state=r.memoizedState),typeof p.componentDidMount=="function"&&(r.flags|=4194308)}function $i(r,i){try{var l="",d=i;do l+=Pe(d),d=d.return;while(d);var p=l}catch(g){p=`
8
8
  Error generating stack: `+g.message+`
9
- `+g.stack}return{value:r,source:i,stack:p,digest:null}}function Fd(r,i,l){return{value:r,source:null,stack:l??null,digest:i??null}}function Vd(r,i){try{console.error(i.value)}catch(l){setTimeout(function(){throw l})}}var YP=typeof WeakMap=="function"?WeakMap:Map;function Kg(r,i,l){l=jr(-1,l),l.tag=3,l.payload={element:null};var d=i.value;return l.callback=function(){Yl||(Yl=!0,nh=d),Vd(r,i)},l}function Gg(r,i,l){l=jr(-1,l),l.tag=3;var d=r.type.getDerivedStateFromError;if(typeof d=="function"){var p=i.value;l.payload=function(){return d(p)},l.callback=function(){Vd(r,i)}}var g=r.stateNode;return g!==null&&typeof g.componentDidCatch=="function"&&(l.callback=function(){Vd(r,i),typeof d!="function"&&(ga===null?ga=new Set([this]):ga.add(this));var _=i.stack;this.componentDidCatch(i.value,{componentStack:_!==null?_:""})}),l}function qg(r,i,l){var d=r.pingCache;if(d===null){d=r.pingCache=new YP;var p=new Set;d.set(i,p)}else p=d.get(i),p===void 0&&(p=new Set,d.set(i,p));p.has(l)||(p.add(l),r=cS.bind(null,r,i,l),i.then(r,r))}function Yg(r){do{var i;if((i=r.tag===13)&&(i=r.memoizedState,i=i!==null?i.dehydrated!==null:!0),i)return r;r=r.return}while(r!==null);return null}function Zg(r,i,l,d,p){return(r.mode&1)===0?(r===i?r.flags|=65536:(r.flags|=128,l.flags|=131072,l.flags&=-52805,l.tag===1&&(l.alternate===null?l.tag=17:(i=jr(-1,1),i.tag=2,pa(l,i,1))),l.lanes|=1),r):(r.flags|=65536,r.lanes=p,r)}var ZP=O.ReactCurrentOwner,pn=!1;function an(r,i,l,d){i.child=r===null?gg(i,null,l,d):Bi(i,r.child,l,d)}function Xg(r,i,l,d,p){l=l.render;var g=i.ref;return Vi(i,p),d=Dd(r,i,l,d,g,p),l=Md(),r!==null&&!pn?(i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~p,Ur(r,i,p)):(kt&&l&&md(i),i.flags|=1,an(r,i,d,p),i.child)}function Qg(r,i,l,d,p){if(r===null){var g=l.type;return typeof g=="function"&&!ch(g)&&g.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(i.tag=15,i.type=g,Jg(r,i,g,d,p)):(r=tc(l.type,null,d,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(g=r.child,(r.lanes&p)===0){var _=g.memoizedProps;if(l=l.compare,l=l!==null?l:Vs,l(_,d)&&r.ref===i.ref)return Ur(r,i,p)}return i.flags|=1,r=_a(g,d),r.ref=i.ref,r.return=i,i.child=r}function Jg(r,i,l,d,p){if(r!==null){var g=r.memoizedProps;if(Vs(g,d)&&r.ref===i.ref)if(pn=!1,i.pendingProps=d=g,(r.lanes&p)!==0)(r.flags&131072)!==0&&(pn=!0);else return i.lanes=r.lanes,Ur(r,i,p)}return zd(r,i,l,d,p)}function ey(r,i,l){var d=i.pendingProps,p=d.children,g=r!==null?r.memoizedState:null;if(d.mode==="hidden")if((i.mode&1)===0)i.memoizedState={baseLanes:0,cachePool:null,transitions:null},ft(Wi,bn),bn|=l;else{if((l&1073741824)===0)return r=g!==null?g.baseLanes|l:l,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:r,cachePool:null,transitions:null},i.updateQueue=null,ft(Wi,bn),bn|=r,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=g!==null?g.baseLanes:l,ft(Wi,bn),bn|=d}else g!==null?(d=g.baseLanes|l,i.memoizedState=null):d=l,ft(Wi,bn),bn|=d;return an(r,i,p,l),i.child}function ty(r,i){var l=i.ref;(r===null&&l!==null||r!==null&&r.ref!==l)&&(i.flags|=512,i.flags|=2097152)}function zd(r,i,l,d,p){var g=fn(l)?Va:qt.current;return g=Ni(i,g),Vi(i,p),l=Dd(r,i,l,d,g,p),d=Md(),r!==null&&!pn?(i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~p,Ur(r,i,p)):(kt&&d&&md(i),i.flags|=1,an(r,i,l,p),i.child)}function ny(r,i,l,d,p){if(fn(l)){var g=!0;Cl(i)}else g=!1;if(Vi(i,p),i.stateNode===null)Hl(r,i),Hg(i,l,d),Bd(i,l,d,p),d=!0;else if(r===null){var _=i.stateNode,E=i.memoizedProps;_.props=E;var M=_.context,z=l.contextType;typeof z=="object"&&z!==null?z=Rn(z):(z=fn(l)?Va:qt.current,z=Ni(i,z));var ee=l.getDerivedStateFromProps,ne=typeof ee=="function"||typeof _.getSnapshotBeforeUpdate=="function";ne||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(E!==d||M!==z)&&Wg(i,_,d,z),fa=!1;var J=i.memoizedState;_.state=J,Nl(i,d,_,p),M=i.memoizedState,E!==d||J!==M||hn.current||fa?(typeof ee=="function"&&(Ud(i,l,ee,d),M=i.memoizedState),(E=fa||$g(i,l,E,d,J,M,z))?(ne||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(i.flags|=4194308)):(typeof _.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=M),_.props=d,_.state=M,_.context=z,d=E):(typeof _.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{_=i.stateNode,vg(r,i),E=i.memoizedProps,z=i.type===i.elementType?E:Zn(i.type,E),_.props=z,ne=i.pendingProps,J=_.context,M=l.contextType,typeof M=="object"&&M!==null?M=Rn(M):(M=fn(l)?Va:qt.current,M=Ni(i,M));var ue=l.getDerivedStateFromProps;(ee=typeof ue=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(E!==ne||J!==M)&&Wg(i,_,d,M),fa=!1,J=i.memoizedState,_.state=J,Nl(i,d,_,p);var ve=i.memoizedState;E!==ne||J!==ve||hn.current||fa?(typeof ue=="function"&&(Ud(i,l,ue,d),ve=i.memoizedState),(z=fa||$g(i,l,z,d,J,ve,M)||!1)?(ee||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(d,ve,M),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(d,ve,M)),typeof _.componentDidUpdate=="function"&&(i.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof _.componentDidUpdate!="function"||E===r.memoizedProps&&J===r.memoizedState||(i.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&J===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=ve),_.props=d,_.state=ve,_.context=M,d=z):(typeof _.componentDidUpdate!="function"||E===r.memoizedProps&&J===r.memoizedState||(i.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&J===r.memoizedState||(i.flags|=1024),d=!1)}return $d(r,i,l,d,g,p)}function $d(r,i,l,d,p,g){ty(r,i);var _=(i.flags&128)!==0;if(!d&&!_)return p&&og(i,l,!1),Ur(r,i,g);d=i.stateNode,ZP.current=i;var E=_&&typeof l.getDerivedStateFromError!="function"?null:d.render();return i.flags|=1,r!==null&&_?(i.child=Bi(i,r.child,null,g),i.child=Bi(i,null,E,g)):an(r,i,E,g),i.memoizedState=d.state,p&&og(i,l,!0),i.child}function ry(r){var i=r.stateNode;i.pendingContext?ig(r,i.pendingContext,i.pendingContext!==i.context):i.context&&ig(r,i.context,!1),Cd(r,i.containerInfo)}function ay(r,i,l,d,p){return Ui(),kd(p),i.flags|=256,an(r,i,l,d),i.child}var Hd={dehydrated:null,treeContext:null,retryLane:0};function Wd(r){return{baseLanes:r,cachePool:null,transitions:null}}function iy(r,i,l){var d=i.pendingProps,p=bt.current,g=!1,_=(i.flags&128)!==0,E;if((E=_)||(E=r!==null&&r.memoizedState===null?!1:(p&2)!==0),E?(g=!0,i.flags&=-129):(r===null||r.memoizedState!==null)&&(p|=1),ft(bt,p&1),r===null)return vd(i),r=i.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((i.mode&1)===0?i.lanes=1:r.data==="$!"?i.lanes=8:i.lanes=1073741824,null):(_=d.children,r=d.fallback,g?(d=i.mode,g=i.child,_={mode:"hidden",children:_},(d&1)===0&&g!==null?(g.childLanes=0,g.pendingProps=_):g=nc(_,d,0,null),r=Xa(r,d,l,null),g.return=i,r.return=i,g.sibling=r,i.child=g,i.child.memoizedState=Wd(l),i.memoizedState=Hd,r):Kd(i,_));if(p=r.memoizedState,p!==null&&(E=p.dehydrated,E!==null))return XP(r,i,_,d,E,p,l);if(g){g=d.fallback,_=i.mode,p=r.child,E=p.sibling;var M={mode:"hidden",children:d.children};return(_&1)===0&&i.child!==p?(d=i.child,d.childLanes=0,d.pendingProps=M,i.deletions=null):(d=_a(p,M),d.subtreeFlags=p.subtreeFlags&14680064),E!==null?g=_a(E,g):(g=Xa(g,_,l,null),g.flags|=2),g.return=i,d.return=i,d.sibling=g,i.child=d,d=g,g=i.child,_=r.child.memoizedState,_=_===null?Wd(l):{baseLanes:_.baseLanes|l,cachePool:null,transitions:_.transitions},g.memoizedState=_,g.childLanes=r.childLanes&~l,i.memoizedState=Hd,d}return g=r.child,r=g.sibling,d=_a(g,{mode:"visible",children:d.children}),(i.mode&1)===0&&(d.lanes=l),d.return=i,d.sibling=null,r!==null&&(l=i.deletions,l===null?(i.deletions=[r],i.flags|=16):l.push(r)),i.child=d,i.memoizedState=null,d}function Kd(r,i){return i=nc({mode:"visible",children:i},r.mode,0,null),i.return=r,r.child=i}function $l(r,i,l,d){return d!==null&&kd(d),Bi(i,r.child,null,l),r=Kd(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function XP(r,i,l,d,p,g,_){if(l)return i.flags&256?(i.flags&=-257,d=Fd(Error(n(422))),$l(r,i,_,d)):i.memoizedState!==null?(i.child=r.child,i.flags|=128,null):(g=d.fallback,p=i.mode,d=nc({mode:"visible",children:d.children},p,0,null),g=Xa(g,p,_,null),g.flags|=2,d.return=i,g.return=i,d.sibling=g,i.child=d,(i.mode&1)!==0&&Bi(i,r.child,null,_),i.child.memoizedState=Wd(_),i.memoizedState=Hd,g);if((i.mode&1)===0)return $l(r,i,_,null);if(p.data==="$!"){if(d=p.nextSibling&&p.nextSibling.dataset,d)var E=d.dgst;return d=E,g=Error(n(419)),d=Fd(g,d,void 0),$l(r,i,_,d)}if(E=(_&r.childLanes)!==0,pn||E){if(d=Ft,d!==null){switch(_&-_){case 4:p=2;break;case 16:p=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:p=32;break;case 536870912:p=268435456;break;default:p=0}p=(p&(d.suspendedLanes|_))!==0?0:p,p!==0&&p!==g.retryLane&&(g.retryLane=p,Or(r,p),Jn(d,r,p,-1))}return lh(),d=Fd(Error(n(421))),$l(r,i,_,d)}return p.data==="$?"?(i.flags|=128,i.child=r.child,i=uS.bind(null,r),p._reactRetry=i,null):(r=g.treeContext,_n=ca(p.nextSibling),kn=i,kt=!0,Yn=null,r!==null&&(En[An++]=Ir,En[An++]=Nr,En[An++]=za,Ir=r.id,Nr=r.overflow,za=i),i=Kd(i,d.children),i.flags|=4096,i)}function sy(r,i,l){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),xd(r.return,i,l)}function Gd(r,i,l,d,p){var g=r.memoizedState;g===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:p}:(g.isBackwards=i,g.rendering=null,g.renderingStartTime=0,g.last=d,g.tail=l,g.tailMode=p)}function oy(r,i,l){var d=i.pendingProps,p=d.revealOrder,g=d.tail;if(an(r,i,d.children,l),d=bt.current,(d&2)!==0)d=d&1|2,i.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&sy(r,l,i);else if(r.tag===19)sy(r,l,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}d&=1}if(ft(bt,d),(i.mode&1)===0)i.memoizedState=null;else switch(p){case"forwards":for(l=i.child,p=null;l!==null;)r=l.alternate,r!==null&&Ol(r)===null&&(p=l),l=l.sibling;l=p,l===null?(p=i.child,i.child=null):(p=l.sibling,l.sibling=null),Gd(i,!1,p,l,g);break;case"backwards":for(l=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&Ol(r)===null){i.child=p;break}r=p.sibling,p.sibling=l,l=p,p=r}Gd(i,!0,l,null,g);break;case"together":Gd(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function Hl(r,i){(i.mode&1)===0&&r!==null&&(r.alternate=null,i.alternate=null,i.flags|=2)}function Ur(r,i,l){if(r!==null&&(i.dependencies=r.dependencies),Ga|=i.lanes,(l&i.childLanes)===0)return null;if(r!==null&&i.child!==r.child)throw Error(n(153));if(i.child!==null){for(r=i.child,l=_a(r,r.pendingProps),i.child=l,l.return=i;r.sibling!==null;)r=r.sibling,l=l.sibling=_a(r,r.pendingProps),l.return=i;l.sibling=null}return i.child}function QP(r,i,l){switch(i.tag){case 3:ry(i),Ui();break;case 5:bg(i);break;case 1:fn(i.type)&&Cl(i);break;case 4:Cd(i,i.stateNode.containerInfo);break;case 10:var d=i.type._context,p=i.memoizedProps.value;ft(Dl,d._currentValue),d._currentValue=p;break;case 13:if(d=i.memoizedState,d!==null)return d.dehydrated!==null?(ft(bt,bt.current&1),i.flags|=128,null):(l&i.child.childLanes)!==0?iy(r,i,l):(ft(bt,bt.current&1),r=Ur(r,i,l),r!==null?r.sibling:null);ft(bt,bt.current&1);break;case 19:if(d=(l&i.childLanes)!==0,(r.flags&128)!==0){if(d)return oy(r,i,l);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),ft(bt,bt.current),d)break;return null;case 22:case 23:return i.lanes=0,ey(r,i,l)}return Ur(r,i,l)}var ly,qd,cy,uy;ly=function(r,i){for(var l=i.child;l!==null;){if(l.tag===5||l.tag===6)r.appendChild(l.stateNode);else if(l.tag!==4&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return;l=l.return}l.sibling.return=l.return,l=l.sibling}},qd=function(){},cy=function(r,i,l,d){var p=r.memoizedProps;if(p!==d){r=i.stateNode,Wa(ur.current);var g=null;switch(l){case"input":p=en(r,p),d=en(r,d),g=[];break;case"select":p=H({},p,{value:void 0}),d=H({},d,{value:void 0}),g=[];break;case"textarea":p=Ps(r,p),d=Ps(r,d),g=[];break;default:typeof p.onClick!="function"&&typeof d.onClick=="function"&&(r.onclick=xl)}ki(l,d);var _;l=null;for(z in p)if(!d.hasOwnProperty(z)&&p.hasOwnProperty(z)&&p[z]!=null)if(z==="style"){var E=p[z];for(_ in E)E.hasOwnProperty(_)&&(l||(l={}),l[_]="")}else z!=="dangerouslySetInnerHTML"&&z!=="children"&&z!=="suppressContentEditableWarning"&&z!=="suppressHydrationWarning"&&z!=="autoFocus"&&(s.hasOwnProperty(z)?g||(g=[]):(g=g||[]).push(z,null));for(z in d){var M=d[z];if(E=p?.[z],d.hasOwnProperty(z)&&M!==E&&(M!=null||E!=null))if(z==="style")if(E){for(_ in E)!E.hasOwnProperty(_)||M&&M.hasOwnProperty(_)||(l||(l={}),l[_]="");for(_ in M)M.hasOwnProperty(_)&&E[_]!==M[_]&&(l||(l={}),l[_]=M[_])}else l||(g||(g=[]),g.push(z,l)),l=M;else z==="dangerouslySetInnerHTML"?(M=M?M.__html:void 0,E=E?E.__html:void 0,M!=null&&E!==M&&(g=g||[]).push(z,M)):z==="children"?typeof M!="string"&&typeof M!="number"||(g=g||[]).push(z,""+M):z!=="suppressContentEditableWarning"&&z!=="suppressHydrationWarning"&&(s.hasOwnProperty(z)?(M!=null&&z==="onScroll"&&mt("scroll",r),g||E===M||(g=[])):(g=g||[]).push(z,M))}l&&(g=g||[]).push("style",l);var z=g;(i.updateQueue=z)&&(i.flags|=4)}},uy=function(r,i,l,d){l!==d&&(i.flags|=4)};function no(r,i){if(!kt)switch(r.tailMode){case"hidden":i=r.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?r.tail=null:l.sibling=null;break;case"collapsed":l=r.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function Zt(r){var i=r.alternate!==null&&r.alternate.child===r.child,l=0,d=0;if(i)for(var p=r.child;p!==null;)l|=p.lanes|p.childLanes,d|=p.subtreeFlags&14680064,d|=p.flags&14680064,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)l|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=d,r.childLanes=l,i}function JP(r,i,l){var d=i.pendingProps;switch(gd(i),i.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zt(i),null;case 1:return fn(i.type)&&Sl(),Zt(i),null;case 3:return d=i.stateNode,zi(),gt(hn),gt(qt),Ad(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(r===null||r.child===null)&&(Rl(i)?i.flags|=4:r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Yn!==null&&(ih(Yn),Yn=null))),qd(r,i),Zt(i),null;case 5:Td(i);var p=Wa(Xs.current);if(l=i.type,r!==null&&i.stateNode!=null)cy(r,i,l,d,p),r.ref!==i.ref&&(i.flags|=512,i.flags|=2097152);else{if(!d){if(i.stateNode===null)throw Error(n(166));return Zt(i),null}if(r=Wa(ur.current),Rl(i)){d=i.stateNode,l=i.type;var g=i.memoizedProps;switch(d[cr]=i,d[Ks]=g,r=(i.mode&1)!==0,l){case"dialog":mt("cancel",d),mt("close",d);break;case"iframe":case"object":case"embed":mt("load",d);break;case"video":case"audio":for(p=0;p<$s.length;p++)mt($s[p],d);break;case"source":mt("error",d);break;case"img":case"image":case"link":mt("error",d),mt("load",d);break;case"details":mt("toggle",d);break;case"input":ws(d,g),mt("invalid",d);break;case"select":d._wrapperState={wasMultiple:!!g.multiple},mt("invalid",d);break;case"textarea":al(d,g),mt("invalid",d)}ki(l,g),p=null;for(var _ in g)if(g.hasOwnProperty(_)){var E=g[_];_==="children"?typeof E=="string"?d.textContent!==E&&(g.suppressHydrationWarning!==!0&&wl(d.textContent,E,r),p=["children",E]):typeof E=="number"&&d.textContent!==""+E&&(g.suppressHydrationWarning!==!0&&wl(d.textContent,E,r),p=["children",""+E]):s.hasOwnProperty(_)&&E!=null&&_==="onScroll"&&mt("scroll",d)}switch(l){case"input":$n(d),rl(d,g,!0);break;case"textarea":$n(d),lr(d);break;case"select":case"option":break;default:typeof g.onClick=="function"&&(d.onclick=xl)}d=p,i.updateQueue=d,d!==null&&(i.flags|=4)}else{_=p.nodeType===9?p:p.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=Yr(l)),r==="http://www.w3.org/1999/xhtml"?l==="script"?(r=_.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof d.is=="string"?r=_.createElement(l,{is:d.is}):(r=_.createElement(l),l==="select"&&(_=r,d.multiple?_.multiple=!0:d.size&&(_.size=d.size))):r=_.createElementNS(r,l),r[cr]=i,r[Ks]=d,ly(r,i,!1,!1),i.stateNode=r;e:{switch(_=_i(l,d),l){case"dialog":mt("cancel",r),mt("close",r),p=d;break;case"iframe":case"object":case"embed":mt("load",r),p=d;break;case"video":case"audio":for(p=0;p<$s.length;p++)mt($s[p],r);p=d;break;case"source":mt("error",r),p=d;break;case"img":case"image":case"link":mt("error",r),mt("load",r),p=d;break;case"details":mt("toggle",r),p=d;break;case"input":ws(r,d),p=en(r,d),mt("invalid",r);break;case"option":p=d;break;case"select":r._wrapperState={wasMultiple:!!d.multiple},p=H({},d,{value:void 0}),mt("invalid",r);break;case"textarea":al(r,d),p=Ps(r,d),mt("invalid",r);break;default:p=d}ki(l,p),E=p;for(g in E)if(E.hasOwnProperty(g)){var M=E[g];g==="style"?sl(r,M):g==="dangerouslySetInnerHTML"?(M=M?M.__html:void 0,M!=null&&Cn(r,M)):g==="children"?typeof M=="string"?(l!=="textarea"||M!=="")&&tn(r,M):typeof M=="number"&&tn(r,""+M):g!=="suppressContentEditableWarning"&&g!=="suppressHydrationWarning"&&g!=="autoFocus"&&(s.hasOwnProperty(g)?M!=null&&g==="onScroll"&&mt("scroll",r):M!=null&&R(r,g,M,_))}switch(l){case"input":$n(r),rl(r,d,!1);break;case"textarea":$n(r),lr(r);break;case"option":d.value!=null&&r.setAttribute("value",""+Qe(d.value));break;case"select":r.multiple=!!d.multiple,g=d.value,g!=null?qr(r,!!d.multiple,g,!1):d.defaultValue!=null&&qr(r,!!d.multiple,d.defaultValue,!0);break;default:typeof p.onClick=="function"&&(r.onclick=xl)}switch(l){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}}d&&(i.flags|=4)}i.ref!==null&&(i.flags|=512,i.flags|=2097152)}return Zt(i),null;case 6:if(r&&i.stateNode!=null)uy(r,i,r.memoizedProps,d);else{if(typeof d!="string"&&i.stateNode===null)throw Error(n(166));if(l=Wa(Xs.current),Wa(ur.current),Rl(i)){if(d=i.stateNode,l=i.memoizedProps,d[cr]=i,(g=d.nodeValue!==l)&&(r=kn,r!==null))switch(r.tag){case 3:wl(d.nodeValue,l,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&wl(d.nodeValue,l,(r.mode&1)!==0)}g&&(i.flags|=4)}else d=(l.nodeType===9?l:l.ownerDocument).createTextNode(d),d[cr]=i,i.stateNode=d}return Zt(i),null;case 13:if(gt(bt),d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(kt&&_n!==null&&(i.mode&1)!==0&&(i.flags&128)===0)fg(),Ui(),i.flags|=98560,g=!1;else if(g=Rl(i),d!==null&&d.dehydrated!==null){if(r===null){if(!g)throw Error(n(318));if(g=i.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(n(317));g[cr]=i}else Ui(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Zt(i),g=!1}else Yn!==null&&(ih(Yn),Yn=null),g=!0;if(!g)return i.flags&65536?i:null}return(i.flags&128)!==0?(i.lanes=l,i):(d=d!==null,d!==(r!==null&&r.memoizedState!==null)&&d&&(i.child.flags|=8192,(i.mode&1)!==0&&(r===null||(bt.current&1)!==0?It===0&&(It=3):lh())),i.updateQueue!==null&&(i.flags|=4),Zt(i),null);case 4:return zi(),qd(r,i),r===null&&Hs(i.stateNode.containerInfo),Zt(i),null;case 10:return wd(i.type._context),Zt(i),null;case 17:return fn(i.type)&&Sl(),Zt(i),null;case 19:if(gt(bt),g=i.memoizedState,g===null)return Zt(i),null;if(d=(i.flags&128)!==0,_=g.rendering,_===null)if(d)no(g,!1);else{if(It!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(_=Ol(r),_!==null){for(i.flags|=128,no(g,!1),d=_.updateQueue,d!==null&&(i.updateQueue=d,i.flags|=4),i.subtreeFlags=0,d=l,l=i.child;l!==null;)g=l,r=d,g.flags&=14680066,_=g.alternate,_===null?(g.childLanes=0,g.lanes=r,g.child=null,g.subtreeFlags=0,g.memoizedProps=null,g.memoizedState=null,g.updateQueue=null,g.dependencies=null,g.stateNode=null):(g.childLanes=_.childLanes,g.lanes=_.lanes,g.child=_.child,g.subtreeFlags=0,g.deletions=null,g.memoizedProps=_.memoizedProps,g.memoizedState=_.memoizedState,g.updateQueue=_.updateQueue,g.type=_.type,r=_.dependencies,g.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),l=l.sibling;return ft(bt,bt.current&1|2),i.child}r=r.sibling}g.tail!==null&&rt()>Ki&&(i.flags|=128,d=!0,no(g,!1),i.lanes=4194304)}else{if(!d)if(r=Ol(_),r!==null){if(i.flags|=128,d=!0,l=r.updateQueue,l!==null&&(i.updateQueue=l,i.flags|=4),no(g,!0),g.tail===null&&g.tailMode==="hidden"&&!_.alternate&&!kt)return Zt(i),null}else 2*rt()-g.renderingStartTime>Ki&&l!==1073741824&&(i.flags|=128,d=!0,no(g,!1),i.lanes=4194304);g.isBackwards?(_.sibling=i.child,i.child=_):(l=g.last,l!==null?l.sibling=_:i.child=_,g.last=_)}return g.tail!==null?(i=g.tail,g.rendering=i,g.tail=i.sibling,g.renderingStartTime=rt(),i.sibling=null,l=bt.current,ft(bt,d?l&1|2:l&1),i):(Zt(i),null);case 22:case 23:return oh(),d=i.memoizedState!==null,r!==null&&r.memoizedState!==null!==d&&(i.flags|=8192),d&&(i.mode&1)!==0?(bn&1073741824)!==0&&(Zt(i),i.subtreeFlags&6&&(i.flags|=8192)):Zt(i),null;case 24:return null;case 25:return null}throw Error(n(156,i.tag))}function eS(r,i){switch(gd(i),i.tag){case 1:return fn(i.type)&&Sl(),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return zi(),gt(hn),gt(qt),Ad(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 5:return Td(i),null;case 13:if(gt(bt),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(n(340));Ui()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return gt(bt),null;case 4:return zi(),null;case 10:return wd(i.type._context),null;case 22:case 23:return oh(),null;case 24:return null;default:return null}}var Wl=!1,Xt=!1,tS=typeof WeakSet=="function"?WeakSet:Set,me=null;function Hi(r,i){var l=r.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(d){xt(r,i,d)}else l.current=null}function Yd(r,i,l){try{l()}catch(d){xt(r,i,d)}}var dy=!1;function nS(r,i){if(od=dl,r=$m(),Ju(r)){if("selectionStart"in r)var l={start:r.selectionStart,end:r.selectionEnd};else e:{l=(l=r.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var p=d.anchorOffset,g=d.focusNode;d=d.focusOffset;try{l.nodeType,g.nodeType}catch{l=null;break e}var _=0,E=-1,M=-1,z=0,ee=0,ne=r,J=null;t:for(;;){for(var ue;ne!==l||p!==0&&ne.nodeType!==3||(E=_+p),ne!==g||d!==0&&ne.nodeType!==3||(M=_+d),ne.nodeType===3&&(_+=ne.nodeValue.length),(ue=ne.firstChild)!==null;)J=ne,ne=ue;for(;;){if(ne===r)break t;if(J===l&&++z===p&&(E=_),J===g&&++ee===d&&(M=_),(ue=ne.nextSibling)!==null)break;ne=J,J=ne.parentNode}ne=ue}l=E===-1||M===-1?null:{start:E,end:M}}else l=null}l=l||{start:0,end:0}}else l=null;for(ld={focusedElem:r,selectionRange:l},dl=!1,me=i;me!==null;)if(i=me,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,me=r;else for(;me!==null;){i=me;try{var ve=i.alternate;if((i.flags&1024)!==0)switch(i.tag){case 0:case 11:case 15:break;case 1:if(ve!==null){var we=ve.memoizedProps,Ct=ve.memoizedState,B=i.stateNode,j=B.getSnapshotBeforeUpdate(i.elementType===i.type?we:Zn(i.type,we),Ct);B.__reactInternalSnapshotBeforeUpdate=j}break;case 3:var F=i.stateNode.containerInfo;F.nodeType===1?F.textContent="":F.nodeType===9&&F.documentElement&&F.removeChild(F.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(se){xt(i,i.return,se)}if(r=i.sibling,r!==null){r.return=i.return,me=r;break}me=i.return}return ve=dy,dy=!1,ve}function ro(r,i,l){var d=i.updateQueue;if(d=d!==null?d.lastEffect:null,d!==null){var p=d=d.next;do{if((p.tag&r)===r){var g=p.destroy;p.destroy=void 0,g!==void 0&&Yd(i,l,g)}p=p.next}while(p!==d)}}function Kl(r,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var l=i=i.next;do{if((l.tag&r)===r){var d=l.create;l.destroy=d()}l=l.next}while(l!==i)}}function Zd(r){var i=r.ref;if(i!==null){var l=r.stateNode;r.tag,r=l,typeof i=="function"?i(r):i.current=r}}function hy(r){var i=r.alternate;i!==null&&(r.alternate=null,hy(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&(delete i[cr],delete i[Ks],delete i[hd],delete i[UP],delete i[BP])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function fy(r){return r.tag===5||r.tag===3||r.tag===4}function py(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||fy(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Xd(r,i,l){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?l.nodeType===8?l.parentNode.insertBefore(r,i):l.insertBefore(r,i):(l.nodeType===8?(i=l.parentNode,i.insertBefore(r,l)):(i=l,i.appendChild(r)),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=xl));else if(d!==4&&(r=r.child,r!==null))for(Xd(r,i,l),r=r.sibling;r!==null;)Xd(r,i,l),r=r.sibling}function Qd(r,i,l){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?l.insertBefore(r,i):l.appendChild(r);else if(d!==4&&(r=r.child,r!==null))for(Qd(r,i,l),r=r.sibling;r!==null;)Qd(r,i,l),r=r.sibling}var Ht=null,Xn=!1;function ma(r,i,l){for(l=l.child;l!==null;)my(r,i,l),l=l.sibling}function my(r,i,l){if(rn&&typeof rn.onCommitFiberUnmount=="function")try{rn.onCommitFiberUnmount(Tn,l)}catch{}switch(l.tag){case 5:Xt||Hi(l,i);case 6:var d=Ht,p=Xn;Ht=null,ma(r,i,l),Ht=d,Xn=p,Ht!==null&&(Xn?(r=Ht,l=l.stateNode,r.nodeType===8?r.parentNode.removeChild(l):r.removeChild(l)):Ht.removeChild(l.stateNode));break;case 18:Ht!==null&&(Xn?(r=Ht,l=l.stateNode,r.nodeType===8?dd(r.parentNode,l):r.nodeType===1&&dd(r,l),Ns(r)):dd(Ht,l.stateNode));break;case 4:d=Ht,p=Xn,Ht=l.stateNode.containerInfo,Xn=!0,ma(r,i,l),Ht=d,Xn=p;break;case 0:case 11:case 14:case 15:if(!Xt&&(d=l.updateQueue,d!==null&&(d=d.lastEffect,d!==null))){p=d=d.next;do{var g=p,_=g.destroy;g=g.tag,_!==void 0&&((g&2)!==0||(g&4)!==0)&&Yd(l,i,_),p=p.next}while(p!==d)}ma(r,i,l);break;case 1:if(!Xt&&(Hi(l,i),d=l.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=l.memoizedProps,d.state=l.memoizedState,d.componentWillUnmount()}catch(E){xt(l,i,E)}ma(r,i,l);break;case 21:ma(r,i,l);break;case 22:l.mode&1?(Xt=(d=Xt)||l.memoizedState!==null,ma(r,i,l),Xt=d):ma(r,i,l);break;default:ma(r,i,l)}}function gy(r){var i=r.updateQueue;if(i!==null){r.updateQueue=null;var l=r.stateNode;l===null&&(l=r.stateNode=new tS),i.forEach(function(d){var p=dS.bind(null,r,d);l.has(d)||(l.add(d),d.then(p,p))})}}function Qn(r,i){var l=i.deletions;if(l!==null)for(var d=0;d<l.length;d++){var p=l[d];try{var g=r,_=i,E=_;e:for(;E!==null;){switch(E.tag){case 5:Ht=E.stateNode,Xn=!1;break e;case 3:Ht=E.stateNode.containerInfo,Xn=!0;break e;case 4:Ht=E.stateNode.containerInfo,Xn=!0;break e}E=E.return}if(Ht===null)throw Error(n(160));my(g,_,p),Ht=null,Xn=!1;var M=p.alternate;M!==null&&(M.return=null),p.return=null}catch(z){xt(p,i,z)}}if(i.subtreeFlags&12854)for(i=i.child;i!==null;)yy(i,r),i=i.sibling}function yy(r,i){var l=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(Qn(i,r),hr(r),d&4){try{ro(3,r,r.return),Kl(3,r)}catch(we){xt(r,r.return,we)}try{ro(5,r,r.return)}catch(we){xt(r,r.return,we)}}break;case 1:Qn(i,r),hr(r),d&512&&l!==null&&Hi(l,l.return);break;case 5:if(Qn(i,r),hr(r),d&512&&l!==null&&Hi(l,l.return),r.flags&32){var p=r.stateNode;try{tn(p,"")}catch(we){xt(r,r.return,we)}}if(d&4&&(p=r.stateNode,p!=null)){var g=r.memoizedProps,_=l!==null?l.memoizedProps:g,E=r.type,M=r.updateQueue;if(r.updateQueue=null,M!==null)try{E==="input"&&g.type==="radio"&&g.name!=null&&nl(p,g),_i(E,_);var z=_i(E,g);for(_=0;_<M.length;_+=2){var ee=M[_],ne=M[_+1];ee==="style"?sl(p,ne):ee==="dangerouslySetInnerHTML"?Cn(p,ne):ee==="children"?tn(p,ne):R(p,ee,ne,z)}switch(E){case"input":Hn(p,g);break;case"textarea":il(p,g);break;case"select":var J=p._wrapperState.wasMultiple;p._wrapperState.wasMultiple=!!g.multiple;var ue=g.value;ue!=null?qr(p,!!g.multiple,ue,!1):J!==!!g.multiple&&(g.defaultValue!=null?qr(p,!!g.multiple,g.defaultValue,!0):qr(p,!!g.multiple,g.multiple?[]:"",!1))}p[Ks]=g}catch(we){xt(r,r.return,we)}}break;case 6:if(Qn(i,r),hr(r),d&4){if(r.stateNode===null)throw Error(n(162));p=r.stateNode,g=r.memoizedProps;try{p.nodeValue=g}catch(we){xt(r,r.return,we)}}break;case 3:if(Qn(i,r),hr(r),d&4&&l!==null&&l.memoizedState.isDehydrated)try{Ns(i.containerInfo)}catch(we){xt(r,r.return,we)}break;case 4:Qn(i,r),hr(r);break;case 13:Qn(i,r),hr(r),p=r.child,p.flags&8192&&(g=p.memoizedState!==null,p.stateNode.isHidden=g,!g||p.alternate!==null&&p.alternate.memoizedState!==null||(th=rt())),d&4&&gy(r);break;case 22:if(ee=l!==null&&l.memoizedState!==null,r.mode&1?(Xt=(z=Xt)||ee,Qn(i,r),Xt=z):Qn(i,r),hr(r),d&8192){if(z=r.memoizedState!==null,(r.stateNode.isHidden=z)&&!ee&&(r.mode&1)!==0)for(me=r,ee=r.child;ee!==null;){for(ne=me=ee;me!==null;){switch(J=me,ue=J.child,J.tag){case 0:case 11:case 14:case 15:ro(4,J,J.return);break;case 1:Hi(J,J.return);var ve=J.stateNode;if(typeof ve.componentWillUnmount=="function"){d=J,l=J.return;try{i=d,ve.props=i.memoizedProps,ve.state=i.memoizedState,ve.componentWillUnmount()}catch(we){xt(d,l,we)}}break;case 5:Hi(J,J.return);break;case 22:if(J.memoizedState!==null){_y(ne);continue}}ue!==null?(ue.return=J,me=ue):_y(ne)}ee=ee.sibling}e:for(ee=null,ne=r;;){if(ne.tag===5){if(ee===null){ee=ne;try{p=ne.stateNode,z?(g=p.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none"):(E=ne.stateNode,M=ne.memoizedProps.style,_=M!=null&&M.hasOwnProperty("display")?M.display:null,E.style.display=vi("display",_))}catch(we){xt(r,r.return,we)}}}else if(ne.tag===6){if(ee===null)try{ne.stateNode.nodeValue=z?"":ne.memoizedProps}catch(we){xt(r,r.return,we)}}else if((ne.tag!==22&&ne.tag!==23||ne.memoizedState===null||ne===r)&&ne.child!==null){ne.child.return=ne,ne=ne.child;continue}if(ne===r)break e;for(;ne.sibling===null;){if(ne.return===null||ne.return===r)break e;ee===ne&&(ee=null),ne=ne.return}ee===ne&&(ee=null),ne.sibling.return=ne.return,ne=ne.sibling}}break;case 19:Qn(i,r),hr(r),d&4&&gy(r);break;case 21:break;default:Qn(i,r),hr(r)}}function hr(r){var i=r.flags;if(i&2){try{e:{for(var l=r.return;l!==null;){if(fy(l)){var d=l;break e}l=l.return}throw Error(n(160))}switch(d.tag){case 5:var p=d.stateNode;d.flags&32&&(tn(p,""),d.flags&=-33);var g=py(r);Qd(r,g,p);break;case 3:case 4:var _=d.stateNode.containerInfo,E=py(r);Xd(r,E,_);break;default:throw Error(n(161))}}catch(M){xt(r,r.return,M)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function rS(r,i,l){me=r,vy(r)}function vy(r,i,l){for(var d=(r.mode&1)!==0;me!==null;){var p=me,g=p.child;if(p.tag===22&&d){var _=p.memoizedState!==null||Wl;if(!_){var E=p.alternate,M=E!==null&&E.memoizedState!==null||Xt;E=Wl;var z=Xt;if(Wl=_,(Xt=M)&&!z)for(me=p;me!==null;)_=me,M=_.child,_.tag===22&&_.memoizedState!==null?by(p):M!==null?(M.return=_,me=M):by(p);for(;g!==null;)me=g,vy(g),g=g.sibling;me=p,Wl=E,Xt=z}ky(r)}else(p.subtreeFlags&8772)!==0&&g!==null?(g.return=p,me=g):ky(r)}}function ky(r){for(;me!==null;){var i=me;if((i.flags&8772)!==0){var l=i.alternate;try{if((i.flags&8772)!==0)switch(i.tag){case 0:case 11:case 15:Xt||Kl(5,i);break;case 1:var d=i.stateNode;if(i.flags&4&&!Xt)if(l===null)d.componentDidMount();else{var p=i.elementType===i.type?l.memoizedProps:Zn(i.type,l.memoizedProps);d.componentDidUpdate(p,l.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var g=i.updateQueue;g!==null&&_g(i,g,d);break;case 3:var _=i.updateQueue;if(_!==null){if(l=null,i.child!==null)switch(i.child.tag){case 5:l=i.child.stateNode;break;case 1:l=i.child.stateNode}_g(i,_,l)}break;case 5:var E=i.stateNode;if(l===null&&i.flags&4){l=E;var M=i.memoizedProps;switch(i.type){case"button":case"input":case"select":case"textarea":M.autoFocus&&l.focus();break;case"img":M.src&&(l.src=M.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(i.memoizedState===null){var z=i.alternate;if(z!==null){var ee=z.memoizedState;if(ee!==null){var ne=ee.dehydrated;ne!==null&&Ns(ne)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Xt||i.flags&512&&Zd(i)}catch(J){xt(i,i.return,J)}}if(i===r){me=null;break}if(l=i.sibling,l!==null){l.return=i.return,me=l;break}me=i.return}}function _y(r){for(;me!==null;){var i=me;if(i===r){me=null;break}var l=i.sibling;if(l!==null){l.return=i.return,me=l;break}me=i.return}}function by(r){for(;me!==null;){var i=me;try{switch(i.tag){case 0:case 11:case 15:var l=i.return;try{Kl(4,i)}catch(M){xt(i,l,M)}break;case 1:var d=i.stateNode;if(typeof d.componentDidMount=="function"){var p=i.return;try{d.componentDidMount()}catch(M){xt(i,p,M)}}var g=i.return;try{Zd(i)}catch(M){xt(i,g,M)}break;case 5:var _=i.return;try{Zd(i)}catch(M){xt(i,_,M)}}}catch(M){xt(i,i.return,M)}if(i===r){me=null;break}var E=i.sibling;if(E!==null){E.return=i.return,me=E;break}me=i.return}}var aS=Math.ceil,Gl=O.ReactCurrentDispatcher,Jd=O.ReactCurrentOwner,Dn=O.ReactCurrentBatchConfig,at=0,Ft=null,At=null,Wt=0,bn=0,Wi=ua(0),It=0,ao=null,Ga=0,ql=0,eh=0,io=null,mn=null,th=0,Ki=1/0,Br=null,Yl=!1,nh=null,ga=null,Zl=!1,ya=null,Xl=0,so=0,rh=null,Ql=-1,Jl=0;function sn(){return(at&6)!==0?rt():Ql!==-1?Ql:Ql=rt()}function va(r){return(r.mode&1)===0?1:(at&2)!==0&&Wt!==0?Wt&-Wt:VP.transition!==null?(Jl===0&&(Jl=pm()),Jl):(r=ct,r!==0||(r=window.event,r=r===void 0?16:xm(r.type)),r)}function Jn(r,i,l,d){if(50<so)throw so=0,rh=null,Error(n(185));Rs(r,l,d),((at&2)===0||r!==Ft)&&(r===Ft&&((at&2)===0&&(ql|=l),It===4&&ka(r,Wt)),gn(r,d),l===1&&at===0&&(i.mode&1)===0&&(Ki=rt()+500,Tl&&ha()))}function gn(r,i){var l=r.callbackNode;Vx(r,i);var d=Si(r,r===Ft?Wt:0);if(d===0)l!==null&&St(l),r.callbackNode=null,r.callbackPriority=0;else if(i=d&-d,r.callbackPriority!==i){if(l!=null&&St(l),i===1)r.tag===0?FP(xy.bind(null,r)):lg(xy.bind(null,r)),OP(function(){(at&6)===0&&ha()}),l=null;else{switch(mm(d)){case 1:l=Ar;break;case 4:l=Gn;break;case 16:l=nn;break;case 536870912:l=ea;break;default:l=nn}l=Ly(l,wy.bind(null,r))}r.callbackPriority=i,r.callbackNode=l}}function wy(r,i){if(Ql=-1,Jl=0,(at&6)!==0)throw Error(n(327));var l=r.callbackNode;if(Gi()&&r.callbackNode!==l)return null;var d=Si(r,r===Ft?Wt:0);if(d===0)return null;if((d&30)!==0||(d&r.expiredLanes)!==0||i)i=ec(r,d);else{i=d;var p=at;at|=2;var g=Sy();(Ft!==r||Wt!==i)&&(Br=null,Ki=rt()+500,Ya(r,i));do try{oS();break}catch(E){Py(r,E)}while(!0);bd(),Gl.current=g,at=p,At!==null?i=0:(Ft=null,Wt=0,i=It)}if(i!==0){if(i===2&&(p=ju(r),p!==0&&(d=p,i=ah(r,p))),i===1)throw l=ao,Ya(r,0),ka(r,d),gn(r,rt()),l;if(i===6)ka(r,d);else{if(p=r.current.alternate,(d&30)===0&&!iS(p)&&(i=ec(r,d),i===2&&(g=ju(r),g!==0&&(d=g,i=ah(r,g))),i===1))throw l=ao,Ya(r,0),ka(r,d),gn(r,rt()),l;switch(r.finishedWork=p,r.finishedLanes=d,i){case 0:case 1:throw Error(n(345));case 2:Za(r,mn,Br);break;case 3:if(ka(r,d),(d&130023424)===d&&(i=th+500-rt(),10<i)){if(Si(r,0)!==0)break;if(p=r.suspendedLanes,(p&d)!==d){sn(),r.pingedLanes|=r.suspendedLanes&p;break}r.timeoutHandle=ud(Za.bind(null,r,mn,Br),i);break}Za(r,mn,Br);break;case 4:if(ka(r,d),(d&4194240)===d)break;for(i=r.eventTimes,p=-1;0<d;){var _=31-He(d);g=1<<_,_=i[_],_>p&&(p=_),d&=~g}if(d=p,d=rt()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*aS(d/1960))-d,10<d){r.timeoutHandle=ud(Za.bind(null,r,mn,Br),d);break}Za(r,mn,Br);break;case 5:Za(r,mn,Br);break;default:throw Error(n(329))}}}return gn(r,rt()),r.callbackNode===l?wy.bind(null,r):null}function ah(r,i){var l=io;return r.current.memoizedState.isDehydrated&&(Ya(r,i).flags|=256),r=ec(r,i),r!==2&&(i=mn,mn=l,i!==null&&ih(i)),r}function ih(r){mn===null?mn=r:mn.push.apply(mn,r)}function iS(r){for(var i=r;;){if(i.flags&16384){var l=i.updateQueue;if(l!==null&&(l=l.stores,l!==null))for(var d=0;d<l.length;d++){var p=l[d],g=p.getSnapshot;p=p.value;try{if(!qn(g(),p))return!1}catch{return!1}}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ka(r,i){for(i&=~eh,i&=~ql,r.suspendedLanes|=i,r.pingedLanes&=~i,r=r.expirationTimes;0<i;){var l=31-He(i),d=1<<l;r[l]=-1,i&=~d}}function xy(r){if((at&6)!==0)throw Error(n(327));Gi();var i=Si(r,0);if((i&1)===0)return gn(r,rt()),null;var l=ec(r,i);if(r.tag!==0&&l===2){var d=ju(r);d!==0&&(i=d,l=ah(r,d))}if(l===1)throw l=ao,Ya(r,0),ka(r,i),gn(r,rt()),l;if(l===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=i,Za(r,mn,Br),gn(r,rt()),null}function sh(r,i){var l=at;at|=1;try{return r(i)}finally{at=l,at===0&&(Ki=rt()+500,Tl&&ha())}}function qa(r){ya!==null&&ya.tag===0&&(at&6)===0&&Gi();var i=at;at|=1;var l=Dn.transition,d=ct;try{if(Dn.transition=null,ct=1,r)return r()}finally{ct=d,Dn.transition=l,at=i,(at&6)===0&&ha()}}function oh(){bn=Wi.current,gt(Wi)}function Ya(r,i){r.finishedWork=null,r.finishedLanes=0;var l=r.timeoutHandle;if(l!==-1&&(r.timeoutHandle=-1,NP(l)),At!==null)for(l=At.return;l!==null;){var d=l;switch(gd(d),d.tag){case 1:d=d.type.childContextTypes,d!=null&&Sl();break;case 3:zi(),gt(hn),gt(qt),Ad();break;case 5:Td(d);break;case 4:zi();break;case 13:gt(bt);break;case 19:gt(bt);break;case 10:wd(d.type._context);break;case 22:case 23:oh()}l=l.return}if(Ft=r,At=r=_a(r.current,null),Wt=bn=i,It=0,ao=null,eh=ql=Ga=0,mn=io=null,Ha!==null){for(i=0;i<Ha.length;i++)if(l=Ha[i],d=l.interleaved,d!==null){l.interleaved=null;var p=d.next,g=l.pending;if(g!==null){var _=g.next;g.next=p,d.next=_}l.pending=d}Ha=null}return r}function Py(r,i){do{var l=At;try{if(bd(),jl.current=Vl,Ul){for(var d=wt.memoizedState;d!==null;){var p=d.queue;p!==null&&(p.pending=null),d=d.next}Ul=!1}if(Ka=0,Bt=Mt=wt=null,Qs=!1,Js=0,Jd.current=null,l===null||l.return===null){It=1,ao=i,At=null;break}e:{var g=r,_=l.return,E=l,M=i;if(i=Wt,E.flags|=32768,M!==null&&typeof M=="object"&&typeof M.then=="function"){var z=M,ee=E,ne=ee.tag;if((ee.mode&1)===0&&(ne===0||ne===11||ne===15)){var J=ee.alternate;J?(ee.updateQueue=J.updateQueue,ee.memoizedState=J.memoizedState,ee.lanes=J.lanes):(ee.updateQueue=null,ee.memoizedState=null)}var ue=Yg(_);if(ue!==null){ue.flags&=-257,Zg(ue,_,E,g,i),ue.mode&1&&qg(g,z,i),i=ue,M=z;var ve=i.updateQueue;if(ve===null){var we=new Set;we.add(M),i.updateQueue=we}else ve.add(M);break e}else{if((i&1)===0){qg(g,z,i),lh();break e}M=Error(n(426))}}else if(kt&&E.mode&1){var Ct=Yg(_);if(Ct!==null){(Ct.flags&65536)===0&&(Ct.flags|=256),Zg(Ct,_,E,g,i),kd($i(M,E));break e}}g=M=$i(M,E),It!==4&&(It=2),io===null?io=[g]:io.push(g),g=_;do{switch(g.tag){case 3:g.flags|=65536,i&=-i,g.lanes|=i;var B=Kg(g,M,i);kg(g,B);break e;case 1:E=M;var j=g.type,F=g.stateNode;if((g.flags&128)===0&&(typeof j.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(ga===null||!ga.has(F)))){g.flags|=65536,i&=-i,g.lanes|=i;var se=Gg(g,E,i);kg(g,se);break e}}g=g.return}while(g!==null)}Ty(l)}catch(Se){i=Se,At===l&&l!==null&&(At=l=l.return);continue}break}while(!0)}function Sy(){var r=Gl.current;return Gl.current=Vl,r===null?Vl:r}function lh(){(It===0||It===3||It===2)&&(It=4),Ft===null||(Ga&268435455)===0&&(ql&268435455)===0||ka(Ft,Wt)}function ec(r,i){var l=at;at|=2;var d=Sy();(Ft!==r||Wt!==i)&&(Br=null,Ya(r,i));do try{sS();break}catch(p){Py(r,p)}while(!0);if(bd(),at=l,Gl.current=d,At!==null)throw Error(n(261));return Ft=null,Wt=0,It}function sS(){for(;At!==null;)Cy(At)}function oS(){for(;At!==null&&!$t();)Cy(At)}function Cy(r){var i=Ry(r.alternate,r,bn);r.memoizedProps=r.pendingProps,i===null?Ty(r):At=i,Jd.current=null}function Ty(r){var i=r;do{var l=i.alternate;if(r=i.return,(i.flags&32768)===0){if(l=JP(l,i,bn),l!==null){At=l;return}}else{if(l=eS(l,i),l!==null){l.flags&=32767,At=l;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{It=6,At=null;return}}if(i=i.sibling,i!==null){At=i;return}At=i=r}while(i!==null);It===0&&(It=5)}function Za(r,i,l){var d=ct,p=Dn.transition;try{Dn.transition=null,ct=1,lS(r,i,l,d)}finally{Dn.transition=p,ct=d}return null}function lS(r,i,l,d){do Gi();while(ya!==null);if((at&6)!==0)throw Error(n(327));l=r.finishedWork;var p=r.finishedLanes;if(l===null)return null;if(r.finishedWork=null,r.finishedLanes=0,l===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var g=l.lanes|l.childLanes;if(zx(r,g),r===Ft&&(At=Ft=null,Wt=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||Zl||(Zl=!0,Ly(nn,function(){return Gi(),null})),g=(l.flags&15990)!==0,(l.subtreeFlags&15990)!==0||g){g=Dn.transition,Dn.transition=null;var _=ct;ct=1;var E=at;at|=4,Jd.current=null,nS(r,l),yy(l,r),EP(ld),dl=!!od,ld=od=null,r.current=l,rS(l),lt(),at=E,ct=_,Dn.transition=g}else r.current=l;if(Zl&&(Zl=!1,ya=r,Xl=p),g=r.pendingLanes,g===0&&(ga=null),Pi(l.stateNode),gn(r,rt()),i!==null)for(d=r.onRecoverableError,l=0;l<i.length;l++)p=i[l],d(p.value,{componentStack:p.stack,digest:p.digest});if(Yl)throw Yl=!1,r=nh,nh=null,r;return(Xl&1)!==0&&r.tag!==0&&Gi(),g=r.pendingLanes,(g&1)!==0?r===rh?so++:(so=0,rh=r):so=0,ha(),null}function Gi(){if(ya!==null){var r=mm(Xl),i=Dn.transition,l=ct;try{if(Dn.transition=null,ct=16>r?16:r,ya===null)var d=!1;else{if(r=ya,ya=null,Xl=0,(at&6)!==0)throw Error(n(331));var p=at;for(at|=4,me=r.current;me!==null;){var g=me,_=g.child;if((me.flags&16)!==0){var E=g.deletions;if(E!==null){for(var M=0;M<E.length;M++){var z=E[M];for(me=z;me!==null;){var ee=me;switch(ee.tag){case 0:case 11:case 15:ro(8,ee,g)}var ne=ee.child;if(ne!==null)ne.return=ee,me=ne;else for(;me!==null;){ee=me;var J=ee.sibling,ue=ee.return;if(hy(ee),ee===z){me=null;break}if(J!==null){J.return=ue,me=J;break}me=ue}}}var ve=g.alternate;if(ve!==null){var we=ve.child;if(we!==null){ve.child=null;do{var Ct=we.sibling;we.sibling=null,we=Ct}while(we!==null)}}me=g}}if((g.subtreeFlags&2064)!==0&&_!==null)_.return=g,me=_;else e:for(;me!==null;){if(g=me,(g.flags&2048)!==0)switch(g.tag){case 0:case 11:case 15:ro(9,g,g.return)}var B=g.sibling;if(B!==null){B.return=g.return,me=B;break e}me=g.return}}var j=r.current;for(me=j;me!==null;){_=me;var F=_.child;if((_.subtreeFlags&2064)!==0&&F!==null)F.return=_,me=F;else e:for(_=j;me!==null;){if(E=me,(E.flags&2048)!==0)try{switch(E.tag){case 0:case 11:case 15:Kl(9,E)}}catch(Se){xt(E,E.return,Se)}if(E===_){me=null;break e}var se=E.sibling;if(se!==null){se.return=E.return,me=se;break e}me=E.return}}if(at=p,ha(),rn&&typeof rn.onPostCommitFiberRoot=="function")try{rn.onPostCommitFiberRoot(Tn,r)}catch{}d=!0}return d}finally{ct=l,Dn.transition=i}}return!1}function Ey(r,i,l){i=$i(l,i),i=Kg(r,i,1),r=pa(r,i,1),i=sn(),r!==null&&(Rs(r,1,i),gn(r,i))}function xt(r,i,l){if(r.tag===3)Ey(r,r,l);else for(;i!==null;){if(i.tag===3){Ey(i,r,l);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(ga===null||!ga.has(d))){r=$i(l,r),r=Gg(i,r,1),i=pa(i,r,1),r=sn(),i!==null&&(Rs(i,1,r),gn(i,r));break}}i=i.return}}function cS(r,i,l){var d=r.pingCache;d!==null&&d.delete(i),i=sn(),r.pingedLanes|=r.suspendedLanes&l,Ft===r&&(Wt&l)===l&&(It===4||It===3&&(Wt&130023424)===Wt&&500>rt()-th?Ya(r,0):eh|=l),gn(r,i)}function Ay(r,i){i===0&&((r.mode&1)===0?i=1:(i=Lr,Lr<<=1,(Lr&130023424)===0&&(Lr=4194304)));var l=sn();r=Or(r,i),r!==null&&(Rs(r,i,l),gn(r,l))}function uS(r){var i=r.memoizedState,l=0;i!==null&&(l=i.retryLane),Ay(r,l)}function dS(r,i){var l=0;switch(r.tag){case 13:var d=r.stateNode,p=r.memoizedState;p!==null&&(l=p.retryLane);break;case 19:d=r.stateNode;break;default:throw Error(n(314))}d!==null&&d.delete(i),Ay(r,l)}var Ry;Ry=function(r,i,l){if(r!==null)if(r.memoizedProps!==i.pendingProps||hn.current)pn=!0;else{if((r.lanes&l)===0&&(i.flags&128)===0)return pn=!1,QP(r,i,l);pn=(r.flags&131072)!==0}else pn=!1,kt&&(i.flags&1048576)!==0&&cg(i,Al,i.index);switch(i.lanes=0,i.tag){case 2:var d=i.type;Hl(r,i),r=i.pendingProps;var p=Ni(i,qt.current);Vi(i,l),p=Dd(null,i,d,r,p,l);var g=Md();return i.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(i.tag=1,i.memoizedState=null,i.updateQueue=null,fn(d)?(g=!0,Cl(i)):g=!1,i.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,Sd(i),p.updater=zl,i.stateNode=p,p._reactInternals=i,Bd(i,d,r,l),i=$d(null,i,d,!0,g,l)):(i.tag=0,kt&&g&&md(i),an(null,i,p,l),i=i.child),i;case 16:d=i.elementType;e:{switch(Hl(r,i),r=i.pendingProps,p=d._init,d=p(d._payload),i.type=d,p=i.tag=fS(d),r=Zn(d,r),p){case 0:i=zd(null,i,d,r,l);break e;case 1:i=ny(null,i,d,r,l);break e;case 11:i=Xg(null,i,d,r,l);break e;case 14:i=Qg(null,i,d,Zn(d.type,r),l);break e}throw Error(n(306,d,""))}return i;case 0:return d=i.type,p=i.pendingProps,p=i.elementType===d?p:Zn(d,p),zd(r,i,d,p,l);case 1:return d=i.type,p=i.pendingProps,p=i.elementType===d?p:Zn(d,p),ny(r,i,d,p,l);case 3:e:{if(ry(i),r===null)throw Error(n(387));d=i.pendingProps,g=i.memoizedState,p=g.element,vg(r,i),Nl(i,d,null,l);var _=i.memoizedState;if(d=_.element,g.isDehydrated)if(g={element:d,isDehydrated:!1,cache:_.cache,pendingSuspenseBoundaries:_.pendingSuspenseBoundaries,transitions:_.transitions},i.updateQueue.baseState=g,i.memoizedState=g,i.flags&256){p=$i(Error(n(423)),i),i=ay(r,i,d,l,p);break e}else if(d!==p){p=$i(Error(n(424)),i),i=ay(r,i,d,l,p);break e}else for(_n=ca(i.stateNode.containerInfo.firstChild),kn=i,kt=!0,Yn=null,l=gg(i,null,d,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Ui(),d===p){i=Ur(r,i,l);break e}an(r,i,d,l)}i=i.child}return i;case 5:return bg(i),r===null&&vd(i),d=i.type,p=i.pendingProps,g=r!==null?r.memoizedProps:null,_=p.children,cd(d,p)?_=null:g!==null&&cd(d,g)&&(i.flags|=32),ty(r,i),an(r,i,_,l),i.child;case 6:return r===null&&vd(i),null;case 13:return iy(r,i,l);case 4:return Cd(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=Bi(i,null,d,l):an(r,i,d,l),i.child;case 11:return d=i.type,p=i.pendingProps,p=i.elementType===d?p:Zn(d,p),Xg(r,i,d,p,l);case 7:return an(r,i,i.pendingProps,l),i.child;case 8:return an(r,i,i.pendingProps.children,l),i.child;case 12:return an(r,i,i.pendingProps.children,l),i.child;case 10:e:{if(d=i.type._context,p=i.pendingProps,g=i.memoizedProps,_=p.value,ft(Dl,d._currentValue),d._currentValue=_,g!==null)if(qn(g.value,_)){if(g.children===p.children&&!hn.current){i=Ur(r,i,l);break e}}else for(g=i.child,g!==null&&(g.return=i);g!==null;){var E=g.dependencies;if(E!==null){_=g.child;for(var M=E.firstContext;M!==null;){if(M.context===d){if(g.tag===1){M=jr(-1,l&-l),M.tag=2;var z=g.updateQueue;if(z!==null){z=z.shared;var ee=z.pending;ee===null?M.next=M:(M.next=ee.next,ee.next=M),z.pending=M}}g.lanes|=l,M=g.alternate,M!==null&&(M.lanes|=l),xd(g.return,l,i),E.lanes|=l;break}M=M.next}}else if(g.tag===10)_=g.type===i.type?null:g.child;else if(g.tag===18){if(_=g.return,_===null)throw Error(n(341));_.lanes|=l,E=_.alternate,E!==null&&(E.lanes|=l),xd(_,l,i),_=g.sibling}else _=g.child;if(_!==null)_.return=g;else for(_=g;_!==null;){if(_===i){_=null;break}if(g=_.sibling,g!==null){g.return=_.return,_=g;break}_=_.return}g=_}an(r,i,p.children,l),i=i.child}return i;case 9:return p=i.type,d=i.pendingProps.children,Vi(i,l),p=Rn(p),d=d(p),i.flags|=1,an(r,i,d,l),i.child;case 14:return d=i.type,p=Zn(d,i.pendingProps),p=Zn(d.type,p),Qg(r,i,d,p,l);case 15:return Jg(r,i,i.type,i.pendingProps,l);case 17:return d=i.type,p=i.pendingProps,p=i.elementType===d?p:Zn(d,p),Hl(r,i),i.tag=1,fn(d)?(r=!0,Cl(i)):r=!1,Vi(i,l),Hg(i,d,p),Bd(i,d,p,l),$d(null,i,d,!0,r,l);case 19:return oy(r,i,l);case 22:return ey(r,i,l)}throw Error(n(156,i.tag))};function Ly(r,i){return ht(r,i)}function hS(r,i,l,d){this.tag=r,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mn(r,i,l,d){return new hS(r,i,l,d)}function ch(r){return r=r.prototype,!(!r||!r.isReactComponent)}function fS(r){if(typeof r=="function")return ch(r)?1:0;if(r!=null){if(r=r.$$typeof,r===oe)return 11;if(r===fe)return 14}return 2}function _a(r,i){var l=r.alternate;return l===null?(l=Mn(r.tag,i,r.key,r.mode),l.elementType=r.elementType,l.type=r.type,l.stateNode=r.stateNode,l.alternate=r,r.alternate=l):(l.pendingProps=i,l.type=r.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=r.flags&14680064,l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,i=r.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=r.sibling,l.index=r.index,l.ref=r.ref,l}function tc(r,i,l,d,p,g){var _=2;if(d=r,typeof r=="function")ch(r)&&(_=1);else if(typeof r=="string")_=5;else e:switch(r){case $:return Xa(l.children,p,g,i);case x:_=8,p|=8;break;case Y:return r=Mn(12,l,i,p|2),r.elementType=Y,r.lanes=g,r;case Ae:return r=Mn(13,l,i,p),r.elementType=Ae,r.lanes=g,r;case de:return r=Mn(19,l,i,p),r.elementType=de,r.lanes=g,r;case Ne:return nc(l,p,g,i);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case X:_=10;break e;case le:_=9;break e;case oe:_=11;break e;case fe:_=14;break e;case ye:_=16,d=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return i=Mn(_,l,i,p),i.elementType=r,i.type=d,i.lanes=g,i}function Xa(r,i,l,d){return r=Mn(7,r,d,i),r.lanes=l,r}function nc(r,i,l,d){return r=Mn(22,r,d,i),r.elementType=Ne,r.lanes=l,r.stateNode={isHidden:!1},r}function uh(r,i,l){return r=Mn(6,r,null,i),r.lanes=l,r}function dh(r,i,l){return i=Mn(4,r.children!==null?r.children:[],r.key,i),i.lanes=l,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}function pS(r,i,l,d,p){this.tag=i,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Uu(0),this.expirationTimes=Uu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Uu(0),this.identifierPrefix=d,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function hh(r,i,l,d,p,g,_,E,M){return r=new pS(r,i,l,E,M),i===1?(i=1,g===!0&&(i|=8)):i=0,g=Mn(3,null,null,i),r.current=g,g.stateNode=r,g.memoizedState={element:d,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sd(g),r}function mS(r,i,l){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:K,key:d==null?null:""+d,children:r,containerInfo:i,implementation:l}}function Dy(r){if(!r)return da;r=r._reactInternals;e:{if(he(r)!==r||r.tag!==1)throw Error(n(170));var i=r;do{switch(i.tag){case 3:i=i.stateNode.context;break e;case 1:if(fn(i.type)){i=i.stateNode.__reactInternalMemoizedMergedChildContext;break e}}i=i.return}while(i!==null);throw Error(n(171))}if(r.tag===1){var l=r.type;if(fn(l))return sg(r,l,i)}return i}function My(r,i,l,d,p,g,_,E,M){return r=hh(l,d,!0,r,p,g,_,E,M),r.context=Dy(null),l=r.current,d=sn(),p=va(l),g=jr(d,p),g.callback=i??null,pa(l,g,p),r.current.lanes=p,Rs(r,p,d),gn(r,d),r}function rc(r,i,l,d){var p=i.current,g=sn(),_=va(p);return l=Dy(l),i.context===null?i.context=l:i.pendingContext=l,i=jr(g,_),i.payload={element:r},d=d===void 0?null:d,d!==null&&(i.callback=d),r=pa(p,i,_),r!==null&&(Jn(r,p,_,g),Il(r,p,_)),_}function ac(r){return r=r.current,r.child?(r.child.tag===5,r.child.stateNode):null}function Iy(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<i?l:i}}function fh(r,i){Iy(r,i),(r=r.alternate)&&Iy(r,i)}function gS(){return null}var Ny=typeof reportError=="function"?reportError:function(r){console.error(r)};function ph(r){this._internalRoot=r}ic.prototype.render=ph.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(n(409));rc(r,i,null,null)},ic.prototype.unmount=ph.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;qa(function(){rc(null,r,null,null)}),i[Dr]=null}};function ic(r){this._internalRoot=r}ic.prototype.unstable_scheduleHydration=function(r){if(r){var i=vm();r={blockedOn:null,target:r,priority:i};for(var l=0;l<sa.length&&i!==0&&i<sa[l].priority;l++);sa.splice(l,0,r),l===0&&bm(r)}};function mh(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function sc(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Oy(){}function yS(r,i,l,d,p){if(p){if(typeof d=="function"){var g=d;d=function(){var z=ac(_);g.call(z)}}var _=My(i,d,r,0,null,!1,!1,"",Oy);return r._reactRootContainer=_,r[Dr]=_.current,Hs(r.nodeType===8?r.parentNode:r),qa(),_}for(;p=r.lastChild;)r.removeChild(p);if(typeof d=="function"){var E=d;d=function(){var z=ac(M);E.call(z)}}var M=hh(r,0,!1,null,null,!1,!1,"",Oy);return r._reactRootContainer=M,r[Dr]=M.current,Hs(r.nodeType===8?r.parentNode:r),qa(function(){rc(i,M,l,d)}),M}function oc(r,i,l,d,p){var g=l._reactRootContainer;if(g){var _=g;if(typeof p=="function"){var E=p;p=function(){var M=ac(_);E.call(M)}}rc(i,_,r,p)}else _=yS(l,i,r,p,d);return ac(_)}gm=function(r){switch(r.tag){case 3:var i=r.stateNode;if(i.current.memoizedState.isDehydrated){var l=na(i.pendingLanes);l!==0&&(Bu(i,l|1),gn(i,rt()),(at&6)===0&&(Ki=rt()+500,ha()))}break;case 13:qa(function(){var d=Or(r,1);if(d!==null){var p=sn();Jn(d,r,1,p)}}),fh(r,1)}},Fu=function(r){if(r.tag===13){var i=Or(r,134217728);if(i!==null){var l=sn();Jn(i,r,134217728,l)}fh(r,134217728)}},ym=function(r){if(r.tag===13){var i=va(r),l=Or(r,i);if(l!==null){var d=sn();Jn(l,r,i,d)}fh(r,i)}},vm=function(){return ct},km=function(r,i){var l=ct;try{return ct=r,i()}finally{ct=l}},wi=function(r,i,l){switch(i){case"input":if(Hn(r,l),i=l.name,l.type==="radio"&&i!=null){for(l=r;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),i=0;i<l.length;i++){var d=l[i];if(d!==r&&d.form===r.form){var p=Pl(d);if(!p)throw Error(n(90));Cr(d),Hn(d,p)}}}break;case"textarea":il(r,l);break;case"select":i=l.value,i!=null&&qr(r,!!l.multiple,i,!1)}},ll=sh,Ts=qa;var vS={usingClientEntryPoint:!1,Events:[Gs,Mi,Pl,ol,Cs,sh]},oo={findFiberByHostInstance:Fa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},kS={bundleType:oo.bundleType,version:oo.version,rendererPackageName:oo.rendererPackageName,rendererConfig:oo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:O.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=st(r),r===null?null:r.stateNode},findFiberByHostInstance:oo.findFiberByHostInstance||gS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var lc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lc.isDisabled&&lc.supportsFiber)try{Tn=lc.inject(kS),rn=lc}catch{}}return yn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vS,yn.createPortal=function(r,i){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!mh(i))throw Error(n(200));return mS(r,i,null,l)},yn.createRoot=function(r,i){if(!mh(r))throw Error(n(299));var l=!1,d="",p=Ny;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onRecoverableError!==void 0&&(p=i.onRecoverableError)),i=hh(r,1,!1,null,null,l,!1,d,p),r[Dr]=i.current,Hs(r.nodeType===8?r.parentNode:r),new ph(i)},yn.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=st(i),r=r===null?null:r.stateNode,r},yn.flushSync=function(r){return qa(r)},yn.hydrate=function(r,i,l){if(!sc(i))throw Error(n(200));return oc(null,r,i,!0,l)},yn.hydrateRoot=function(r,i,l){if(!mh(r))throw Error(n(405));var d=l!=null&&l.hydratedSources||null,p=!1,g="",_=Ny;if(l!=null&&(l.unstable_strictMode===!0&&(p=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onRecoverableError!==void 0&&(_=l.onRecoverableError)),i=My(i,null,r,1,l??null,p,!1,g,_),r[Dr]=i.current,Hs(r),d)for(r=0;r<d.length;r++)l=d[r],p=l._getVersion,p=p(l._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[l,p]:i.mutableSourceEagerHydrationData.push(l,p);return new ic(i)},yn.render=function(r,i,l){if(!sc(i))throw Error(n(200));return oc(null,r,i,!1,l)},yn.unmountComponentAtNode=function(r){if(!sc(r))throw Error(n(40));return r._reactRootContainer?(qa(function(){oc(null,null,r,!1,function(){r._reactRootContainer=null,r[Dr]=null})}),!0):!1},yn.unstable_batchedUpdates=sh,yn.unstable_renderSubtreeIntoContainer=function(r,i,l,d){if(!sc(l))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return oc(r,i,l,!1,d)},yn.version="18.3.1-next-f1338f8080-20240426",yn}var Hy;function D_(){if(Hy)return vh.exports;Hy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),vh.exports=AS(),vh.exports}var Wy;function RS(){if(Wy)return cc;Wy=1;var e=D_();return cc.createRoot=e.createRoot,cc.hydrateRoot=e.hydrateRoot,cc}var LS=RS();var M_=e=>{throw TypeError(e)},DS=(e,t,n)=>t.has(e)||M_("Cannot "+n),bh=(e,t,n)=>(DS(e,t,"read from private field"),n?n.call(e):t.get(e)),MS=(e,t,n)=>t.has(e)?M_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ky="popstate";function Gy(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function IS(e={}){function t(a,s){let o=s.state?.masked,{pathname:c,search:u,hash:h}=o||a.location;return Lo("",{pathname:c,search:u,hash:h},s.state&&s.state.usr||null,s.state&&s.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function n(a,s){return typeof s=="string"?s:kr(s)}return OS(t,n,null,e)}function Xe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Et(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function NS(){return Math.random().toString(36).substring(2,10)}function qy(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Lo(e,t,n=null,a,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Wr(t):t,state:n,key:t&&t.key||a||NS(),unstable_mask:s}}function kr({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Wr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function OS(e,t,n,a={}){let{window:s=document.defaultView,v5Compat:o=!1}=a,c=s.history,u="POP",h=null,f=m();f==null&&(f=0,c.replaceState({...c.state,idx:f},""));function m(){return(c.state||{idx:null}).idx}function y(){u="POP";let S=m(),D=S==null?null:S-f;f=S,h&&h({action:u,location:C.location,delta:D})}function k(S,D){u="PUSH";let L=Gy(S)?S:Lo(C.location,S,D);f=m()+1;let R=qy(L,f),O=C.createHref(L.unstable_mask||L);try{c.pushState(R,"",O)}catch(W){if(W instanceof DOMException&&W.name==="DataCloneError")throw W;s.location.assign(O)}o&&h&&h({action:u,location:C.location,delta:1})}function w(S,D){u="REPLACE";let L=Gy(S)?S:Lo(C.location,S,D);f=m();let R=qy(L,f),O=C.createHref(L.unstable_mask||L);c.replaceState(R,"",O),o&&h&&h({action:u,location:C.location,delta:0})}function P(S){return I_(S)}let C={get action(){return u},get location(){return e(s,c)},listen(S){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(Ky,y),h=S,()=>{s.removeEventListener(Ky,y),h=null}},createHref(S){return t(s,S)},createURL:P,encodeLocation(S){let D=P(S);return{pathname:D.pathname,search:D.search,hash:D.hash}},push:k,replace:w,go(S){return c.go(S)}};return C}function I_(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Xe(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:kr(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}var go,Yy=class{constructor(e){if(MS(this,go,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(bh(this,go).has(e))return bh(this,go).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){bh(this,go).set(e,t)}};go=new WeakMap;var jS=new Set(["lazy","caseSensitive","path","id","index","children"]);function US(e){return jS.has(e)}var BS=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function FS(e){return BS.has(e)}function VS(e){return e.index===!0}function Do(e,t,n=[],a={},s=!1){return e.map((o,c)=>{let u=[...n,String(c)],h=typeof o.id=="string"?o.id:u.join("-");if(Xe(o.index!==!0||!o.children,"Cannot specify children on an index route"),Xe(s||!a[h],`Found a route id collision on id "${h}". Route id's must be globally unique within Data Router usages`),VS(o)){let f={...o,id:h};return a[h]=Zy(f,t(f)),f}else{let f={...o,id:h,children:void 0};return a[h]=Zy(f,t(f)),o.children&&(f.children=Do(o.children,t,u,a,s)),f}})}function Zy(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ca(e,t,n="/"){return yo(e,t,n,!1)}function yo(e,t,n,a){let s=typeof t=="string"?Wr(t):t,o=Un(s.pathname||"/",n);if(o==null)return null;let c=N_(e);$S(c);let u=null;for(let h=0;u==null&&h<c.length;++h){let f=eC(o);u=QS(c[h],f,a)}return u}function zS(e,t){let{route:n,pathname:a,params:s}=e;return{id:n.id,pathname:a,params:s,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function N_(e,t=[],n=[],a="",s=!1){let o=(c,u,h=s,f)=>{let m={relativePath:f===void 0?c.path||"":f,caseSensitive:c.caseSensitive===!0,childrenIndex:u,route:c};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(a)&&h)return;Xe(m.relativePath.startsWith(a),`Absolute route path "${m.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(a.length)}let y=ar([a,m.relativePath]),k=n.concat(m);c.children&&c.children.length>0&&(Xe(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),N_(c.children,t,k,y,h)),!(c.path==null&&!c.index)&&t.push({path:y,score:ZS(y,c.index),routesMeta:k})};return e.forEach((c,u)=>{if(c.path===""||!c.path?.includes("?"))o(c,u);else for(let h of O_(c.path))o(c,u,!0,h)}),t}function O_(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(a.length===0)return s?[o,""]:[o];let c=O_(a.join("/")),u=[];return u.push(...c.map(h=>h===""?o:[o,h].join("/"))),s&&u.push(...c),u.map(h=>e.startsWith("/")&&h===""?"/":h)}function $S(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:XS(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var HS=/^:[\w-]+$/,WS=3,KS=2,GS=1,qS=10,YS=-2,Xy=e=>e==="*";function ZS(e,t){let n=e.split("/"),a=n.length;return n.some(Xy)&&(a+=YS),t&&(a+=KS),n.filter(s=>!Xy(s)).reduce((s,o)=>s+(HS.test(o)?WS:o===""?GS:qS),a)}function XS(e,t){return e.length===t.length&&e.slice(0,-1).every((a,s)=>a===t[s])?e[e.length-1]-t[t.length-1]:0}function QS(e,t,n=!1){let{routesMeta:a}=e,s={},o="/",c=[];for(let u=0;u<a.length;++u){let h=a[u],f=u===a.length-1,m=o==="/"?t:t.slice(o.length)||"/",y=Wc({path:h.relativePath,caseSensitive:h.caseSensitive,end:f},m),k=h.route;if(!y&&f&&n&&!a[a.length-1].route.index&&(y=Wc({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},m)),!y)return null;Object.assign(s,y.params),c.push({params:s,pathname:ar([o,y.pathname]),pathnameBase:rC(ar([o,y.pathnameBase])),route:k}),y.pathnameBase!=="/"&&(o=ar([o,y.pathnameBase]))}return c}function Wc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=JS(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],c=o.replace(/(.)\/+$/,"$1"),u=s.slice(1);return{params:a.reduce((f,{paramName:m,isOptional:y},k)=>{if(m==="*"){let P=u[k]||"";c=o.slice(0,o.length-P.length).replace(/(.)\/+$/,"$1")}const w=u[k];return y&&!w?f[m]=void 0:f[m]=(w||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:c,pattern:e}}function JS(e,t=!1,n=!0){Et(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,u,h,f,m)=>{if(a.push({paramName:u,isOptional:h!=null}),h){let y=m.charAt(f+c.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),a]}function eC(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Et(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Un(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}function tC({basename:e,pathname:t}){return t==="/"?e:ar([e,t])}var j_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jf=e=>j_.test(e);function nC(e,t="/"){let{pathname:n,search:a="",hash:s=""}=typeof e=="string"?Wr(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=Qy(n.substring(1),"/"):o=Qy(n,t)):o=t,{pathname:o,search:aC(a),hash:iC(s)}}function Qy(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function wh(e,t,n,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function U_(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ep(e){let t=U_(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function ku(e,t,n,a=!1){let s;typeof e=="string"?s=Wr(e):(s={...e},Xe(!s.pathname||!s.pathname.includes("?"),wh("?","pathname","search",s)),Xe(!s.pathname||!s.pathname.includes("#"),wh("#","pathname","hash",s)),Xe(!s.search||!s.search.includes("#"),wh("#","search","hash",s)));let o=e===""||s.pathname==="",c=o?"/":s.pathname,u;if(c==null)u=n;else{let y=t.length-1;if(!a&&c.startsWith("..")){let k=c.split("/");for(;k[0]==="..";)k.shift(),y-=1;s.pathname=k.join("/")}u=y>=0?t[y]:"/"}let h=nC(s,u),f=c&&c!=="/"&&c.endsWith("/"),m=(o||c===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(f||m)&&(h.pathname+="/"),h}var ar=e=>e.join("/").replace(/\/\/+/g,"/"),rC=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),aC=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,iC=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Vo=class{constructor(e,t,n,a=!1){this.status=e,this.statusText=t||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Mo(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function zo(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var B_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function F_(e,t){let n=e;if(typeof n!="string"||!j_.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,s=!1;if(B_)try{let o=new URL(window.location.href),c=n.startsWith("//")?new URL(o.protocol+n):new URL(n),u=Un(c.pathname,t);c.origin===o.origin&&u!=null?n=u+c.search+c.hash:s=!0}catch{Et(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:s,to:n}}var Aa=Symbol("Uninstrumented");function sC(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(s=>s({id:t.id,index:t.index,path:t.path,instrument(o){let c=Object.keys(n);for(let u of c)o[u]&&n[u].push(o[u])}}));let a={};if(typeof t.lazy=="function"&&n.lazy.length>0){let s=ns(n.lazy,t.lazy,()=>{});s&&(a.lazy=s)}if(typeof t.lazy=="object"){let s=t.lazy;["middleware","loader","action"].forEach(o=>{let c=s[o],u=n[`lazy.${o}`];if(typeof c=="function"&&u.length>0){let h=ns(u,c,()=>{});h&&(a.lazy=Object.assign(a.lazy||{},{[o]:h}))}})}return["loader","action"].forEach(s=>{let o=t[s];if(typeof o=="function"&&n[s].length>0){let c=o[Aa]??o,u=ns(n[s],c,(...h)=>Jy(h[0]));u&&(s==="loader"&&c.hydrate===!0&&(u.hydrate=!0),u[Aa]=c,a[s]=u)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(a.middleware=t.middleware.map(s=>{let o=s[Aa]??s,c=ns(n.middleware,o,(...u)=>Jy(u[0]));return c?(c[Aa]=o,c):s})),a}function oC(e,t){let n={navigate:[],fetch:[]};if(t.forEach(a=>a({instrument(s){let o=Object.keys(s);for(let c of o)s[c]&&n[c].push(s[c])}})),n.navigate.length>0){let a=e.navigate[Aa]??e.navigate,s=ns(n.navigate,a,(...o)=>{let[c,u]=o;return{to:typeof c=="number"||typeof c=="string"?c:c?kr(c):".",...ev(e,u??{})}});s&&(s[Aa]=a,e.navigate=s)}if(n.fetch.length>0){let a=e.fetch[Aa]??e.fetch,s=ns(n.fetch,a,(...o)=>{let[c,,u,h]=o;return{href:u??".",fetcherKey:c,...ev(e,h??{})}});s&&(s[Aa]=a,e.fetch=s)}return e}function ns(e,t,n){return e.length===0?null:async(...a)=>{let s=await V_(e,n(...a),()=>t(...a),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function V_(e,t,n,a){let s=e[a],o;if(s){let c,u=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=V_(e,t,n,a-1),o=await c,Xe(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await s(u,t)}catch(h){console.error("An instrumentation function threw an error:",h)}c||await u(),await c}else try{o={type:"success",value:await n()}}catch(c){o={type:"error",value:c}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Jy(e){let{request:t,context:n,params:a,unstable_pattern:s}=e;return{request:lC(t),params:{...a},unstable_pattern:s,context:cC(n)}}function ev(e,t){return{currentUrl:kr(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function lC(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function cC(e){if(dC(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var uC=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function dC(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===uC}var z_=["POST","PUT","PATCH","DELETE"],hC=new Set(z_),fC=["GET",...z_],pC=new Set(fC),$_=new Set([301,302,303,307,308]),mC=new Set([307,308]),xh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},gC={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},co={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},yC=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),H_="remix-router-transitions",W_=Symbol("ResetLoaderData");function vC(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";Xe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],s=e.mapRouteProperties||yC,o=s;if(e.unstable_instrumentations){let A=e.unstable_instrumentations;o=U=>({...s(U),...sC(A.map(V=>V.route).filter(Boolean),U)})}let c={},u=Do(e.routes,o,void 0,c),h,f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let m=e.dataStrategy||xC,y={...e.future},k=null,w=new Set,P=null,C=null,S=null,D=e.hydrationData!=null,L=Ca(u,e.history.location,f),R=!1,O=null,W,K;if(L==null&&!e.patchRoutesOnNavigation){let A=In(404,{pathname:e.history.location.pathname}),{matches:U,route:V}=uc(u);W=!0,K=!W,L=U,O={[V.id]:A}}else if(L&&!e.hydrationData&&Qr(L,u,e.history.location.pathname).active&&(L=null),L)if(L.some(A=>A.route.lazy))W=!1,K=!W;else if(!L.some(A=>tp(A.route)))W=!0,K=!W;else{let A=e.hydrationData?e.hydrationData.loaderData:null,U=e.hydrationData?e.hydrationData.errors:null,V=L;if(U){let te=L.findIndex(ae=>U[ae.route.id]!==void 0);V=V.slice(0,te+1)}K=!1,W=V.every(te=>{let ae=K_(te.route,A,U);return K=K||ae.renderFallback,!ae.shouldLoad})}else{W=!1,K=!W,L=[];let A=Qr(null,u,e.history.location.pathname);A.active&&A.matches&&(R=!0,L=A.matches)}let $,x={historyAction:e.history.action,location:e.history.location,matches:L,initialized:W,renderFallback:K,navigation:xh,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||O,fetchers:new Map,blockers:new Map},Y="POP",X=null,le=!1,oe,Ae=!1,de=new Map,fe=null,ye=!1,Ne=!1,G=new Set,Z=new Map,H=0,I=-1,q=new Map,xe=new Set,Re=new Map,Pe=new Map,Te=new Set,Ge=new Map,Qe,Ue=null;function jt(){if(k=e.history.listen(({action:A,location:U,delta:V})=>{if(Qe){Qe(),Qe=void 0;return}Et(Ge.size===0||V!=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 te=Tr({currentLocation:x.location,nextLocation:U,historyAction:A});if(te&&V!=null){let ae=new Promise(Ee=>{Qe=Ee});e.history.go(V*-1),Kn(te,{state:"blocked",location:U,proceed(){Kn(te,{state:"proceeding",proceed:void 0,reset:void 0,location:U}),ae.then(()=>e.history.go(V))},reset(){let Ee=new Map(x.blockers);Ee.set(te,co),pt({blockers:Ee})}}),X?.resolve(),X=null;return}return Hn(A,U)}),n){VC(t,de);let A=()=>zC(t,de);t.addEventListener("pagehide",A),fe=()=>t.removeEventListener("pagehide",A)}return x.initialized||Hn("POP",x.location,{initialHydration:!0}),$}function $n(){k&&k(),fe&&fe(),w.clear(),oe&&oe.abort(),x.fetchers.forEach((A,U)=>vi(U)),x.blockers.forEach((A,U)=>wi(U))}function Cr(A){return w.add(A),()=>w.delete(A)}function pt(A,U={}){A.matches&&(A.matches=A.matches.map(ae=>{let Ee=c[ae.route.id],pe=ae.route;return pe.element!==Ee.element||pe.errorElement!==Ee.errorElement||pe.hydrateFallbackElement!==Ee.hydrateFallbackElement?{...ae,route:Ee}:ae})),x={...x,...A};let V=[],te=[];x.fetchers.forEach((ae,Ee)=>{ae.state==="idle"&&(Te.has(Ee)?V.push(Ee):te.push(Ee))}),Te.forEach(ae=>{!x.fetchers.has(ae)&&!Z.has(ae)&&V.push(ae)}),[...w].forEach(ae=>ae(x,{deletedFetchers:V,newErrors:A.errors??null,viewTransitionOpts:U.viewTransitionOpts,flushSync:U.flushSync===!0})),V.forEach(ae=>vi(ae)),te.forEach(ae=>x.fetchers.delete(ae))}function en(A,U,{flushSync:V}={}){let te=x.actionData!=null&&x.navigation.formMethod!=null&&Qt(x.navigation.formMethod)&&x.navigation.state==="loading"&&A.state?._isRedirect!==!0,ae;U.actionData?Object.keys(U.actionData).length>0?ae=U.actionData:ae=null:te?ae=x.actionData:ae=null;let Ee=U.loaderData?uv(x.loaderData,U.loaderData,U.matches||[],U.errors):x.loaderData,pe=x.blockers;pe.size>0&&(pe=new Map(pe),pe.forEach((Ie,Le)=>pe.set(Le,co)));let De=ye?!1:Ts(A,U.matches||x.matches),he=le===!0||x.navigation.formMethod!=null&&Qt(x.navigation.formMethod)&&A.state?._isRedirect!==!0;h&&(u=h,h=void 0),ye||Y==="POP"||(Y==="PUSH"?e.history.push(A,A.state):Y==="REPLACE"&&e.history.replace(A,A.state));let Me;if(Y==="POP"){let Ie=de.get(x.location.pathname);Ie&&Ie.has(A.pathname)?Me={currentLocation:x.location,nextLocation:A}:de.has(A.pathname)&&(Me={currentLocation:A,nextLocation:x.location})}else if(Ae){let Ie=de.get(x.location.pathname);Ie?Ie.add(A.pathname):(Ie=new Set([A.pathname]),de.set(x.location.pathname,Ie)),Me={currentLocation:x.location,nextLocation:A}}pt({...U,actionData:ae,loaderData:Ee,historyAction:Y,location:A,initialized:!0,renderFallback:!1,navigation:xh,revalidation:"idle",restoreScrollPosition:De,preventScrollReset:he,blockers:pe},{viewTransitionOpts:Me,flushSync:V===!0}),Y="POP",le=!1,Ae=!1,ye=!1,Ne=!1,X?.resolve(),X=null,Ue?.resolve(),Ue=null}async function ws(A,U){if(X?.resolve(),X=null,typeof A=="number"){X||(X=pv());let ht=X.promise;return e.history.go(A),ht}let V=nf(x.location,x.matches,f,A,U?.fromRouteId,U?.relative),{path:te,submission:ae,error:Ee}=tv(!1,V,U),pe;U?.unstable_mask&&(pe={pathname:"",search:"",hash:"",...typeof U.unstable_mask=="string"?Wr(U.unstable_mask):{...x.location.unstable_mask,...U.unstable_mask}});let De=x.location,he=Lo(De,te,U&&U.state,void 0,pe);he={...he,...e.history.encodeLocation(he)};let Me=U&&U.replace!=null?U.replace:void 0,Ie="PUSH";Me===!0?Ie="REPLACE":Me===!1||ae!=null&&Qt(ae.formMethod)&&ae.formAction===x.location.pathname+x.location.search&&(Ie="REPLACE");let Le=U&&"preventScrollReset"in U?U.preventScrollReset===!0:void 0,st=(U&&U.flushSync)===!0,et=Tr({currentLocation:De,nextLocation:he,historyAction:Ie});if(et){Kn(et,{state:"blocked",location:he,proceed(){Kn(et,{state:"proceeding",proceed:void 0,reset:void 0,location:he}),ws(A,U)},reset(){let ht=new Map(x.blockers);ht.set(et,co),pt({blockers:ht})}});return}await Hn(Ie,he,{submission:ae,pendingError:Ee,preventScrollReset:Le,replace:U&&U.replace,enableViewTransition:U&&U.viewTransition,flushSync:st,callSiteDefaultShouldRevalidate:U&&U.unstable_defaultShouldRevalidate})}function nl(){Ue||(Ue=pv()),Zr(),pt({revalidation:"loading"});let A=Ue.promise;return x.navigation.state==="submitting"?A:x.navigation.state==="idle"?(Hn(x.historyAction,x.location,{startUninterruptedRevalidation:!0}),A):(Hn(Y||x.historyAction,x.navigation.location,{overrideNavigation:x.navigation,enableViewTransition:Ae===!0}),A)}async function Hn(A,U,V){oe&&oe.abort(),oe=null,Y=A,ye=(V&&V.startUninterruptedRevalidation)===!0,ll(x.location,x.matches),le=(V&&V.preventScrollReset)===!0,Ae=(V&&V.enableViewTransition)===!0;let te=h||u,ae=V&&V.overrideNavigation,Ee=V?.initialHydration&&x.matches&&x.matches.length>0&&!R?x.matches:Ca(te,U,f),pe=(V&&V.flushSync)===!0;if(Ee&&x.initialized&&!Ne&&LC(x.location,U)&&!(V&&V.submission&&Qt(V.submission.formMethod))){en(U,{matches:Ee},{flushSync:pe});return}let De=Qr(Ee,te,U.pathname);if(De.active&&De.matches&&(Ee=De.matches),!Ee){let{error:St,notFoundMatches:$t,route:lt}=xi(U.pathname);en(U,{matches:$t,loaderData:{},errors:{[lt.id]:St}},{flushSync:pe});return}oe=new AbortController;let he=Ji(e.history,U,oe.signal,V&&V.submission),Me=e.getContext?await e.getContext():new Yy,Ie;if(V&&V.pendingError)Ie=[Ta(Ee).route.id,{type:"error",error:V.pendingError}];else if(V&&V.submission&&Qt(V.submission.formMethod)){let St=await rl(he,U,V.submission,Ee,Me,De.active,V&&V.initialHydration===!0,{replace:V.replace,flushSync:pe});if(St.shortCircuited)return;if(St.pendingActionResult){let[$t,lt]=St.pendingActionResult;if(xn(lt)&&Mo(lt.error)&&lt.error.status===404){oe=null,en(U,{matches:St.matches,loaderData:{},errors:{[$t]:lt.error}});return}}Ee=St.matches||Ee,Ie=St.pendingActionResult,ae=Ph(U,V.submission),pe=!1,De.active=!1,he=Ji(e.history,he.url,he.signal)}let{shortCircuited:Le,matches:st,loaderData:et,errors:ht}=await xs(he,U,Ee,Me,De.active,ae,V&&V.submission,V&&V.fetcherSubmission,V&&V.replace,V&&V.initialHydration===!0,pe,Ie,V&&V.callSiteDefaultShouldRevalidate);Le||(oe=null,en(U,{matches:st||Ee,...dv(Ie),loaderData:et,errors:ht}))}async function rl(A,U,V,te,ae,Ee,pe,De={}){Zr();let he=BC(U,V);if(pt({navigation:he},{flushSync:De.flushSync===!0}),Ee){let Le=await Ua(te,U.pathname,A.signal);if(Le.type==="aborted")return{shortCircuited:!0};if(Le.type==="error"){if(Le.partialMatches.length===0){let{matches:et,route:ht}=uc(u);return{matches:et,pendingActionResult:[ht.id,{type:"error",error:Le.error}]}}let st=Ta(Le.partialMatches).route.id;return{matches:Le.partialMatches,pendingActionResult:[st,{type:"error",error:Le.error}]}}else if(Le.matches)te=Le.matches;else{let{notFoundMatches:st,error:et,route:ht}=xi(U.pathname);return{matches:st,pendingActionResult:[ht.id,{type:"error",error:et}]}}}let Me,Ie=Cc(te,U);if(!Ie.route.action&&!Ie.route.lazy)Me={type:"error",error:In(405,{method:A.method,pathname:U.pathname,routeId:Ie.route.id})};else{let Le=os(o,c,A,te,Ie,pe?[]:a,ae),st=await Yr(A,Le,ae,null);if(Me=st[Ie.route.id],!Me){for(let et of te)if(st[et.route.id]){Me=st[et.route.id];break}}if(A.signal.aborted)return{shortCircuited:!0}}if(ti(Me)){let Le;return De&&De.replace!=null?Le=De.replace:Le=ov(Me.response.headers.get("Location"),new URL(A.url),f,e.history)===x.location.pathname+x.location.search,await lr(A,Me,!0,{submission:V,replace:Le}),{shortCircuited:!0}}if(xn(Me)){let Le=Ta(te,Ie.route.id);return(De&&De.replace)!==!0&&(Y="PUSH"),{matches:te,pendingActionResult:[Le.route.id,Me,Ie.route.id]}}return{matches:te,pendingActionResult:[Ie.route.id,Me]}}async function xs(A,U,V,te,ae,Ee,pe,De,he,Me,Ie,Le,st){let et=Ee||Ph(U,pe),ht=pe||De||fv(et),St=!ye&&!Me;if(ae){if(St){let Ut=Gr(Le);pt({navigation:et,...Ut!==void 0?{actionData:Ut}:{}},{flushSync:Ie})}let He=await Ua(V,U.pathname,A.signal);if(He.type==="aborted")return{shortCircuited:!0};if(He.type==="error"){if(He.partialMatches.length===0){let{matches:ta,route:Rr}=uc(u);return{matches:ta,loaderData:{},errors:{[Rr.id]:He.error}}}let Ut=Ta(He.partialMatches).route.id;return{matches:He.partialMatches,loaderData:{},errors:{[Ut]:He.error}}}else if(He.matches)V=He.matches;else{let{error:Ut,notFoundMatches:ta,route:Rr}=xi(U.pathname);return{matches:ta,loaderData:{},errors:{[Rr.id]:Ut}}}}let $t=h||u,{dsMatches:lt,revalidatingFetchers:rt}=nv(A,te,o,c,e.history,x,V,ht,U,Me?[]:a,Me===!0,Ne,G,Te,Re,xe,$t,f,e.patchRoutesOnNavigation!=null,Le,st);if(I=++H,!e.dataStrategy&&!lt.some(He=>He.shouldLoad)&&!lt.some(He=>He.route.middleware&&He.route.middleware.length>0)&&rt.length===0){let He=_i();return en(U,{matches:V,loaderData:{},errors:Le&&xn(Le[1])?{[Le[0]]:Le[1].error}:null,...dv(Le),...He?{fetchers:new Map(x.fetchers)}:{}},{flushSync:Ie}),{shortCircuited:!0}}if(St){let He={};if(!ae){He.navigation=et;let Ut=Gr(Le);Ut!==void 0&&(He.actionData=Ut)}rt.length>0&&(He.fetchers=qr(rt)),pt(He,{flushSync:Ie})}rt.forEach(He=>{Wn(He.key),He.controller&&Z.set(He.key,He.controller)});let Er=()=>rt.forEach(He=>Wn(He.key));oe&&oe.signal.addEventListener("abort",Er);let{loaderResults:Ar,fetcherResults:Gn}=await yi(lt,rt,A,te);if(A.signal.aborted)return{shortCircuited:!0};oe&&oe.signal.removeEventListener("abort",Er),rt.forEach(He=>Z.delete(He.key));let nn=dc(Ar);if(nn)return await lr(A,nn.result,!0,{replace:he}),{shortCircuited:!0};if(nn=dc(Gn),nn)return xe.add(nn.key),await lr(A,nn.result,!0,{replace:he}),{shortCircuited:!0};let{loaderData:As,errors:ea}=cv(x,V,Ar,Le,rt,Gn);Me&&x.errors&&(ea={...x.errors,...ea});let Tn=_i(),rn=bi(I),Pi=Tn||rn||rt.length>0;return{matches:V,loaderData:As,errors:ea,...Pi?{fetchers:new Map(x.fetchers)}:{}}}function Gr(A){if(A&&!xn(A[1]))return{[A[0]]:A[1].data};if(x.actionData)return Object.keys(x.actionData).length===0?null:x.actionData}function qr(A){return A.forEach(U=>{let V=x.fetchers.get(U.key),te=uo(void 0,V?V.data:void 0);x.fetchers.set(U.key,te)}),new Map(x.fetchers)}async function Ps(A,U,V,te){Wn(A);let ae=(te&&te.flushSync)===!0,Ee=h||u,pe=nf(x.location,x.matches,f,V,U,te?.relative),De=Ca(Ee,pe,f),he=Qr(De,Ee,pe);if(he.active&&he.matches&&(De=he.matches),!De){tn(A,U,In(404,{pathname:pe}),{flushSync:ae});return}let{path:Me,submission:Ie,error:Le}=tv(!0,pe,te);if(Le){tn(A,U,Le,{flushSync:ae});return}let st=e.getContext?await e.getContext():new Yy,et=(te&&te.preventScrollReset)===!0;if(Ie&&Qt(Ie.formMethod)){await al(A,U,Me,De,st,he.active,ae,et,Ie,te&&te.unstable_defaultShouldRevalidate);return}Re.set(A,{routeId:U,path:Me}),await il(A,U,Me,De,st,he.active,ae,et,Ie)}async function al(A,U,V,te,ae,Ee,pe,De,he,Me){Zr(),Re.delete(A);let Ie=x.fetchers.get(A);Cn(A,FC(he,Ie),{flushSync:pe});let Le=new AbortController,st=Ji(e.history,V,Le.signal,he);if(Ee){let ut=await Ua(te,new URL(st.url).pathname,st.signal,A);if(ut.type==="aborted")return;if(ut.type==="error"){tn(A,U,ut.error,{flushSync:pe});return}else if(ut.matches)te=ut.matches;else{tn(A,U,In(404,{pathname:V}),{flushSync:pe});return}}let et=Cc(te,V);if(!et.route.action&&!et.route.lazy){let ut=In(405,{method:he.formMethod,pathname:V,routeId:U});tn(A,U,ut,{flushSync:pe});return}Z.set(A,Le);let ht=H,St=os(o,c,st,te,et,a,ae),$t=await Yr(st,St,ae,A),lt=$t[et.route.id];if(!lt){for(let ut of St)if($t[ut.route.id]){lt=$t[ut.route.id];break}}if(st.signal.aborted){Z.get(A)===Le&&Z.delete(A);return}if(Te.has(A)){if(ti(lt)||xn(lt)){Cn(A,Vr(void 0));return}}else{if(ti(lt))if(Z.delete(A),I>ht){Cn(A,Vr(void 0));return}else return xe.add(A),Cn(A,uo(he)),lr(st,lt,!1,{fetcherSubmission:he,preventScrollReset:De});if(xn(lt)){tn(A,U,lt.error);return}}let rt=x.navigation.location||x.location,Er=Ji(e.history,rt,Le.signal),Ar=h||u,Gn=x.navigation.state!=="idle"?Ca(Ar,x.navigation.location,f):x.matches;Xe(Gn,"Didn't find any matches after fetcher action");let nn=++H;q.set(A,nn);let As=uo(he,lt.data);x.fetchers.set(A,As);let{dsMatches:ea,revalidatingFetchers:Tn}=nv(Er,ae,o,c,e.history,x,Gn,he,rt,a,!1,Ne,G,Te,Re,xe,Ar,f,e.patchRoutesOnNavigation!=null,[et.route.id,lt],Me);Tn.filter(ut=>ut.key!==A).forEach(ut=>{let Lr=ut.key,na=x.fetchers.get(Lr),Si=uo(void 0,na?na.data:void 0);x.fetchers.set(Lr,Si),Wn(Lr),ut.controller&&Z.set(Lr,ut.controller)}),pt({fetchers:new Map(x.fetchers)});let rn=()=>Tn.forEach(ut=>Wn(ut.key));Le.signal.addEventListener("abort",rn);let{loaderResults:Pi,fetcherResults:He}=await yi(ea,Tn,Er,ae);if(Le.signal.aborted)return;if(Le.signal.removeEventListener("abort",rn),q.delete(A),Z.delete(A),Tn.forEach(ut=>Z.delete(ut.key)),x.fetchers.has(A)){let ut=Vr(lt.data);x.fetchers.set(A,ut)}let Ut=dc(Pi);if(Ut)return lr(Er,Ut.result,!1,{preventScrollReset:De});if(Ut=dc(He),Ut)return xe.add(Ut.key),lr(Er,Ut.result,!1,{preventScrollReset:De});let{loaderData:ta,errors:Rr}=cv(x,Gn,Pi,void 0,Tn,He);bi(nn),x.navigation.state==="loading"&&nn>I?(Xe(Y,"Expected pending action"),oe&&oe.abort(),en(x.navigation.location,{matches:Gn,loaderData:ta,errors:Rr,fetchers:new Map(x.fetchers)})):(pt({errors:Rr,loaderData:uv(x.loaderData,ta,Gn,Rr),fetchers:new Map(x.fetchers)}),Ne=!1)}async function il(A,U,V,te,ae,Ee,pe,De,he){let Me=x.fetchers.get(A);Cn(A,uo(he,Me?Me.data:void 0),{flushSync:pe});let Ie=new AbortController,Le=Ji(e.history,V,Ie.signal);if(Ee){let lt=await Ua(te,new URL(Le.url).pathname,Le.signal,A);if(lt.type==="aborted")return;if(lt.type==="error"){tn(A,U,lt.error,{flushSync:pe});return}else if(lt.matches)te=lt.matches;else{tn(A,U,In(404,{pathname:V}),{flushSync:pe});return}}let st=Cc(te,V);Z.set(A,Ie);let et=H,ht=os(o,c,Le,te,st,a,ae),$t=(await Yr(Le,ht,ae,A))[st.route.id];if(Z.get(A)===Ie&&Z.delete(A),!Le.signal.aborted){if(Te.has(A)){Cn(A,Vr(void 0));return}if(ti($t))if(I>et){Cn(A,Vr(void 0));return}else{xe.add(A),await lr(Le,$t,!1,{preventScrollReset:De});return}if(xn($t)){tn(A,U,$t.error);return}Cn(A,Vr($t.data))}}async function lr(A,U,V,{submission:te,fetcherSubmission:ae,preventScrollReset:Ee,replace:pe}={}){V||(X?.resolve(),X=null),U.response.headers.has("X-Remix-Revalidate")&&(Ne=!0);let De=U.response.headers.get("Location");Xe(De,"Expected a Location header on the redirect Response"),De=ov(De,new URL(A.url),f,e.history);let he=Lo(x.location,De,{_isRedirect:!0});if(n){let ht=!1;if(U.response.headers.has("X-Remix-Reload-Document"))ht=!0;else if(Jf(De)){const St=I_(De,!0);ht=St.origin!==t.location.origin||Un(St.pathname,f)==null}if(ht){pe?t.location.replace(De):t.location.assign(De);return}}oe=null;let Me=pe===!0||U.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ie,formAction:Le,formEncType:st}=x.navigation;!te&&!ae&&Ie&&Le&&st&&(te=fv(x.navigation));let et=te||ae;if(mC.has(U.response.status)&&et&&Qt(et.formMethod))await Hn(Me,he,{submission:{...et,formAction:De},preventScrollReset:Ee||le,enableViewTransition:V?Ae:void 0});else{let ht=Ph(he,te);await Hn(Me,he,{overrideNavigation:ht,fetcherSubmission:ae,preventScrollReset:Ee||le,enableViewTransition:V?Ae:void 0})}}async function Yr(A,U,V,te){let ae,Ee={};try{ae=await SC(m,A,U,te,V,!1)}catch(pe){return U.filter(De=>De.shouldLoad).forEach(De=>{Ee[De.route.id]={type:"error",error:pe}}),Ee}if(A.signal.aborted)return Ee;if(!Qt(A.method))for(let pe of U){if(ae[pe.route.id]?.type==="error")break;!ae.hasOwnProperty(pe.route.id)&&!x.loaderData.hasOwnProperty(pe.route.id)&&(!x.errors||!x.errors.hasOwnProperty(pe.route.id))&&pe.shouldCallHandler()&&(ae[pe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${pe.route.id}`)})}for(let[pe,De]of Object.entries(ae))if(NC(De)){let he=De.result;Ee[pe]={type:"redirect",response:AC(he,A,pe,U,f)}}else Ee[pe]=await EC(De);return Ee}async function yi(A,U,V,te){let ae=Yr(V,A,te,null),Ee=Promise.all(U.map(async he=>{if(he.matches&&he.match&&he.request&&he.controller){let Ie=(await Yr(he.request,he.matches,te,he.key))[he.match.route.id];return{[he.key]:Ie}}else return Promise.resolve({[he.key]:{type:"error",error:In(404,{pathname:he.path})}})})),pe=await ae,De=(await Ee).reduce((he,Me)=>Object.assign(he,Me),{});return{loaderResults:pe,fetcherResults:De}}function Zr(){Ne=!0,Re.forEach((A,U)=>{Z.has(U)&&G.add(U),Wn(U)})}function Cn(A,U,V={}){x.fetchers.set(A,U),pt({fetchers:new Map(x.fetchers)},{flushSync:(V&&V.flushSync)===!0})}function tn(A,U,V,te={}){let ae=Ta(x.matches,U);vi(A),pt({errors:{[ae.route.id]:V},fetchers:new Map(x.fetchers)},{flushSync:(te&&te.flushSync)===!0})}function Xr(A){return Pe.set(A,(Pe.get(A)||0)+1),Te.has(A)&&Te.delete(A),x.fetchers.get(A)||gC}function Ou(A,U){Wn(A,U?.reason),Cn(A,Vr(null))}function vi(A){let U=x.fetchers.get(A);Z.has(A)&&!(U&&U.state==="loading"&&q.has(A))&&Wn(A),Re.delete(A),q.delete(A),xe.delete(A),Te.delete(A),G.delete(A),x.fetchers.delete(A)}function sl(A){let U=(Pe.get(A)||0)-1;U<=0?(Pe.delete(A),Te.add(A)):Pe.set(A,U),pt({fetchers:new Map(x.fetchers)})}function Wn(A,U){let V=Z.get(A);V&&(V.abort(U),Z.delete(A))}function ki(A){for(let U of A){let V=Xr(U),te=Vr(V.data);x.fetchers.set(U,te)}}function _i(){let A=[],U=!1;for(let V of xe){let te=x.fetchers.get(V);Xe(te,`Expected fetcher: ${V}`),te.state==="loading"&&(xe.delete(V),A.push(V),U=!0)}return ki(A),U}function bi(A){let U=[];for(let[V,te]of q)if(te<A){let ae=x.fetchers.get(V);Xe(ae,`Expected fetcher: ${V}`),ae.state==="loading"&&(Wn(V),q.delete(V),U.push(V))}return ki(U),U.length>0}function Ss(A,U){let V=x.blockers.get(A)||co;return Ge.get(A)!==U&&Ge.set(A,U),V}function wi(A){x.blockers.delete(A),Ge.delete(A)}function Kn(A,U){let V=x.blockers.get(A)||co;Xe(V.state==="unblocked"&&U.state==="blocked"||V.state==="blocked"&&U.state==="blocked"||V.state==="blocked"&&U.state==="proceeding"||V.state==="blocked"&&U.state==="unblocked"||V.state==="proceeding"&&U.state==="unblocked",`Invalid blocker state transition: ${V.state} -> ${U.state}`);let te=new Map(x.blockers);te.set(A,U),pt({blockers:te})}function Tr({currentLocation:A,nextLocation:U,historyAction:V}){if(Ge.size===0)return;Ge.size>1&&Et(!1,"A router only supports one blocker at a time");let te=Array.from(Ge.entries()),[ae,Ee]=te[te.length-1],pe=x.blockers.get(ae);if(!(pe&&pe.state==="proceeding")&&Ee({currentLocation:A,nextLocation:U,historyAction:V}))return ae}function xi(A){let U=In(404,{pathname:A}),V=h||u,{matches:te,route:ae}=uc(V);return{notFoundMatches:te,route:ae,error:U}}function ol(A,U,V){if(P=A,S=U,C=V||null,!D&&x.navigation===xh){D=!0;let te=Ts(x.location,x.matches);te!=null&&pt({restoreScrollPosition:te})}return()=>{P=null,S=null,C=null}}function Cs(A,U){return C&&C(A,U.map(te=>zS(te,x.loaderData)))||A.key}function ll(A,U){if(P&&S){let V=Cs(A,U);P[V]=S()}}function Ts(A,U){if(P){let V=Cs(A,U),te=P[V];if(typeof te=="number")return te}return null}function Qr(A,U,V){if(e.patchRoutesOnNavigation)if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:yo(U,V,f,!0)}}else return{active:!0,matches:yo(U,V,f,!0)||[]};return{active:!1,matches:null}}async function Ua(A,U,V,te){if(!e.patchRoutesOnNavigation)return{type:"success",matches:A};let ae=A;for(;;){let Ee=h==null,pe=h||u,De=c;try{await e.patchRoutesOnNavigation({signal:V,path:U,matches:ae,fetcherKey:te,patch:(Ie,Le)=>{V.aborted||rv(Ie,Le,pe,De,o,!1)}})}catch(Ie){return{type:"error",error:Ie,partialMatches:ae}}finally{Ee&&!V.aborted&&(u=[...u])}if(V.aborted)return{type:"aborted"};let he=Ca(pe,U,f),Me=null;if(he){if(Object.keys(he[0].params).length===0)return{type:"success",matches:he};if(Me=yo(pe,U,f,!0),!(Me&&ae.length<Me.length&&Jr(ae,Me.slice(0,ae.length))))return{type:"success",matches:he}}if(Me||(Me=yo(pe,U,f,!0)),!Me||Jr(ae,Me))return{type:"success",matches:null};ae=Me}}function Jr(A,U){return A.length===U.length&&A.every((V,te)=>V.route.id===U[te].route.id)}function Es(A){c={},h=Do(A,o,void 0,c)}function Ba(A,U,V=!1){let te=h==null;rv(A,U,h||u,c,o,V),te&&(u=[...u],pt({}))}return $={get basename(){return f},get future(){return y},get state(){return x},get routes(){return u},get window(){return t},initialize:jt,subscribe:Cr,enableScrollRestoration:ol,navigate:ws,fetch:Ps,revalidate:nl,createHref:A=>e.history.createHref(A),encodeLocation:A=>e.history.encodeLocation(A),getFetcher:Xr,resetFetcher:Ou,deleteFetcher:sl,dispose:$n,getBlocker:Ss,deleteBlocker:wi,patchRoutes:Ba,_internalFetchControllers:Z,_internalSetRoutes:Es,_internalSetStateDoNotUseOrYouWillBreakYourApp(A){pt(A)}},e.unstable_instrumentations&&($=oC($,e.unstable_instrumentations.map(A=>A.router).filter(Boolean))),$}function kC(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function nf(e,t,n,a,s,o){let c,u;if(s){c=[];for(let f of t)if(c.push(f),f.route.id===s){u=f;break}}else c=t,u=t[t.length-1];let h=ku(a||".",ep(c),Un(e.pathname,n)||e.pathname,o==="path");if(a==null&&(h.search=e.search,h.hash=e.hash),(a==null||a===""||a===".")&&u){let f=rp(h.search);if(u.route.index&&!f)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&f){let m=new URLSearchParams(h.search),y=m.getAll("index");m.delete("index"),y.filter(w=>w).forEach(w=>m.append("index",w));let k=m.toString();h.search=k?`?${k}`:""}}return n!=="/"&&(h.pathname=tC({basename:n,pathname:h.pathname})),kr(h)}function tv(e,t,n){if(!n||!kC(n))return{path:t};if(n.formMethod&&!UC(n.formMethod))return{path:t,error:In(405,{method:n.formMethod})};let a=()=>({path:t,error:In(400,{type:"invalid-body"})}),o=(n.formMethod||"get").toUpperCase(),c=Q_(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Qt(o))return a();let y=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((k,[w,P])=>`${k}${w}=${P}
10
- `,""):String(n.body);return{path:t,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:y}}}else if(n.formEncType==="application/json"){if(!Qt(o))return a();try{let y=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:y,text:void 0}}}catch{return a()}}}Xe(typeof FormData=="function","FormData is not available in this environment");let u,h;if(n.formData)u=af(n.formData),h=n.formData;else if(n.body instanceof FormData)u=af(n.body),h=n.body;else if(n.body instanceof URLSearchParams)u=n.body,h=lv(u);else if(n.body==null)u=new URLSearchParams,h=new FormData;else try{u=new URLSearchParams(n.body),h=lv(u)}catch{return a()}let f={formMethod:o,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:h,json:void 0,text:void 0};if(Qt(f.formMethod))return{path:t,submission:f};let m=Wr(t);return e&&m.search&&rp(m.search)&&u.append("index",""),m.search=`?${u}`,{path:kr(m),submission:f}}function nv(e,t,n,a,s,o,c,u,h,f,m,y,k,w,P,C,S,D,L,R,O){let W=R?xn(R[1])?R[1].error:R[1].data:void 0,K=s.createURL(o.location),$=s.createURL(h),x;if(m&&o.errors){let fe=Object.keys(o.errors)[0];x=c.findIndex(ye=>ye.route.id===fe)}else if(R&&xn(R[1])){let fe=R[0];x=c.findIndex(ye=>ye.route.id===fe)-1}let Y=R?R[1].statusCode:void 0,X=Y&&Y>=400,le={currentUrl:K,currentParams:o.matches[0]?.params||{},nextUrl:$,nextParams:c[0].params,...u,actionResult:W,actionStatus:Y},oe=zo(c),Ae=c.map((fe,ye)=>{let{route:Ne}=fe,G=null;if(x!=null&&ye>x)G=!1;else if(Ne.lazy)G=!0;else if(!tp(Ne))G=!1;else if(m){let{shouldLoad:q}=K_(Ne,o.loaderData,o.errors);G=q}else _C(o.loaderData,o.matches[ye],fe)&&(G=!0);if(G!==null)return rf(n,a,e,oe,fe,f,t,G);let Z=!1;typeof O=="boolean"?Z=O:X?Z=!1:(y||K.pathname+K.search===$.pathname+$.search||K.search!==$.search||bC(o.matches[ye],fe))&&(Z=!0);let H={...le,defaultShouldRevalidate:Z},I=bo(fe,H);return rf(n,a,e,oe,fe,f,t,I,H,O)}),de=[];return P.forEach((fe,ye)=>{if(m||!c.some(Re=>Re.route.id===fe.routeId)||w.has(ye))return;let Ne=o.fetchers.get(ye),G=Ne&&Ne.state!=="idle"&&Ne.data===void 0,Z=Ca(S,fe.path,D);if(!Z){if(L&&G)return;de.push({key:ye,routeId:fe.routeId,path:fe.path,matches:null,match:null,request:null,controller:null});return}if(C.has(ye))return;let H=Cc(Z,fe.path),I=new AbortController,q=Ji(s,fe.path,I.signal),xe=null;if(k.has(ye))k.delete(ye),xe=os(n,a,q,Z,H,f,t);else if(G)y&&(xe=os(n,a,q,Z,H,f,t));else{let Re;typeof O=="boolean"?Re=O:X?Re=!1:Re=y;let Pe={...le,defaultShouldRevalidate:Re};bo(H,Pe)&&(xe=os(n,a,q,Z,H,f,t,Pe))}xe&&de.push({key:ye,routeId:fe.routeId,path:fe.path,matches:xe,match:H,request:q,controller:I})}),{dsMatches:Ae,revalidatingFetchers:de}}function tp(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function K_(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!tp(e))return{shouldLoad:!1,renderFallback:!1};let a=t!=null&&e.id in t,s=n!=null&&n[e.id]!==void 0;if(!a&&s)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!a};let o=!a&&!s;return{shouldLoad:o,renderFallback:o}}function _C(e,t,n){let a=!t||n.route.id!==t.route.id,s=!e.hasOwnProperty(n.route.id);return a||s}function bC(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function bo(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function rv(e,t,n,a,s,o){let c;if(e){let f=a[e];Xe(f,`No route found to patch children into: routeId = ${e}`),f.children||(f.children=[]),c=f.children}else c=n;let u=[],h=[];if(t.forEach(f=>{let m=c.find(y=>G_(f,y));m?h.push({existingRoute:m,newRoute:f}):u.push(f)}),u.length>0){let f=Do(u,s,[e||"_","patch",String(c?.length||"0")],a);c.push(...f)}if(o&&h.length>0)for(let f=0;f<h.length;f++){let{existingRoute:m,newRoute:y}=h[f],k=m,[w]=Do([y],s,[],{},!0);Object.assign(k,{element:w.element?w.element:k.element,errorElement:w.errorElement?w.errorElement:k.errorElement,hydrateFallbackElement:w.hydrateFallbackElement?w.hydrateFallbackElement:k.hydrateFallbackElement})}}function G_(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((n,a)=>t.children?.some(s=>G_(n,s)))??!1:!1}var av=new WeakMap,q_=({key:e,route:t,manifest:n,mapRouteProperties:a})=>{let s=n[t.id];if(Xe(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let o=s.lazy[e];if(!o)return;let c=av.get(s);c||(c={},av.set(s,c));let u=c[e];if(u)return u;let h=(async()=>{let f=US(e),y=s[e]!==void 0&&e!=="hasErrorBoundary";if(f)Et(!f,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(y)Et(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let k=await o();k!=null&&(Object.assign(s,{[e]:k}),Object.assign(s,a(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(k=>k===void 0)&&(s.lazy=void 0))})();return c[e]=h,h},iv=new WeakMap;function wC(e,t,n,a,s){let o=n[e.id];if(Xe(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=iv.get(o);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let y=(async()=>{Xe(typeof e.lazy=="function","No lazy route function found");let k=await e.lazy(),w={};for(let P in k){let C=k[P];if(C===void 0)continue;let S=FS(P),L=o[P]!==void 0&&P!=="hasErrorBoundary";S?Et(!S,"Route property "+P+" is not a supported property to be returned from a lazy route function. This property will be ignored."):L?Et(!L,`Route "${o.id}" has a static property "${P}" defined but its lazy function is also returning a value for this property. The lazy route property "${P}" will be ignored.`):w[P]=C}Object.assign(o,w),Object.assign(o,{...a(o),lazy:void 0})})();return iv.set(o,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let c=Object.keys(e.lazy),u=[],h;for(let m of c){if(s&&s.includes(m))continue;let y=q_({key:m,route:e,manifest:n,mapRouteProperties:a});y&&(u.push(y),m===t&&(h=y))}let f=u.length>0?Promise.all(u).then(()=>{}):void 0;return f?.catch(()=>{}),h?.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:h}}async function sv(e){let t=e.matches.filter(s=>s.shouldLoad),n={};return(await Promise.all(t.map(s=>s.resolve()))).forEach((s,o)=>{n[t[o].route.id]=s}),n}async function xC(e){return e.matches.some(t=>t.route.middleware)?Y_(e,()=>sv(e)):sv(e)}function Y_(e,t){return PC(e,t,a=>{if(jC(a))throw a;return a},MC,n);function n(a,s,o){if(o)return Promise.resolve(Object.assign(o.value,{[s]:{type:"error",result:a}}));{let{matches:c}=e,u=Math.min(Math.max(c.findIndex(f=>f.route.id===s),0),Math.max(c.findIndex(f=>f.shouldCallHandler()),0)),h=Ta(c,c[u].route.id).route.id;return Promise.resolve({[h]:{type:"error",result:a}})}}}async function PC(e,t,n,a,s){let{matches:o,request:c,params:u,context:h,unstable_pattern:f}=e,m=o.flatMap(k=>k.route.middleware?k.route.middleware.map(w=>[k.route.id,w]):[]);return await Z_({request:c,params:u,context:h,unstable_pattern:f},m,t,n,a,s)}async function Z_(e,t,n,a,s,o,c=0){let{request:u}=e;if(u.signal.aborted)throw u.signal.reason??new Error(`Request aborted: ${u.method} ${u.url}`);let h=t[c];if(!h)return await n();let[f,m]=h,y,k=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await Z_(e,t,n,a,s,o,c+1)},y.value}catch(w){return y={value:await o(w,f,y)},y.value}};try{let w=await m(e,k),P=w!=null?a(w):void 0;return s(P)?P:y?P??y.value:(y={value:await k()},y.value)}catch(w){return await o(w,f,y)}}function X_(e,t,n,a,s){let o=q_({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),c=wC(a.route,Qt(n.method)?"action":"loader",t,e,s);return{middleware:o,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function rf(e,t,n,a,s,o,c,u,h=null,f){let m=!1,y=X_(e,t,n,s,o);return{...s,_lazyPromises:y,shouldLoad:u,shouldRevalidateArgs:h,shouldCallHandler(k){return m=!0,h?typeof f=="boolean"?bo(s,{...h,defaultShouldRevalidate:f}):typeof k=="boolean"?bo(s,{...h,defaultShouldRevalidate:k}):bo(s,h):u},resolve(k){let{lazy:w,loader:P,middleware:C}=s.route,S=m||u||k&&!Qt(n.method)&&(w||P),D=C&&C.length>0&&!P&&!w;return S&&(Qt(n.method)||!D)?CC({request:n,unstable_pattern:a,match:s,lazyHandlerPromise:y?.handler,lazyRoutePromise:y?.route,handlerOverride:k,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function os(e,t,n,a,s,o,c,u=null){return a.map(h=>h.route.id!==s.route.id?{...h,shouldLoad:!1,shouldRevalidateArgs:u,shouldCallHandler:()=>!1,_lazyPromises:X_(e,t,n,h,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:rf(e,t,n,zo(a),h,o,c,!0,u))}async function SC(e,t,n,a,s,o){n.some(f=>f._lazyPromises?.middleware)&&await Promise.all(n.map(f=>f._lazyPromises?.middleware));let c={request:t,unstable_pattern:zo(n),params:n[0].params,context:s,matches:n},h=await e({...c,fetcherKey:a,runClientMiddleware:f=>{let m=c;return Y_(m,()=>f({...m,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(f=>[f._lazyPromises?.handler,f._lazyPromises?.route]))}catch{}return h}async function CC({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:a,lazyRoutePromise:s,handlerOverride:o,scopedContext:c}){let u,h,f=Qt(e.method),m=f?"action":"loader",y=k=>{let w,P=new Promise((D,L)=>w=L);h=()=>w(),e.signal.addEventListener("abort",h);let C=D=>typeof k!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${n.route.id}]`)):k({request:e,unstable_pattern:t,params:n.params,context:c},...D!==void 0?[D]:[]),S=(async()=>{try{return{type:"data",result:await(o?o(L=>C(L)):C())}}catch(D){return{type:"error",result:D}}})();return Promise.race([S,P])};try{let k=f?n.route.action:n.route.loader;if(a||s)if(k){let w,[P]=await Promise.all([y(k).catch(C=>{w=C}),a,s]);if(w!==void 0)throw w;u=P}else{await a;let w=f?n.route.action:n.route.loader;if(w)[u]=await Promise.all([y(w),s]);else if(m==="action"){let P=new URL(e.url),C=P.pathname+P.search;throw In(405,{method:e.method,pathname:C,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(k)u=await y(k);else{let w=new URL(e.url),P=w.pathname+w.search;throw In(404,{pathname:P})}}catch(k){return{type:"error",result:k}}finally{h&&e.signal.removeEventListener("abort",h)}return u}async function TC(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function EC(e){let{result:t,type:n}=e;if(np(t)){let a;try{a=await TC(t)}catch(s){return{type:"error",error:s}}return n==="error"?{type:"error",error:new Vo(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:"data",data:a,statusCode:t.status,headers:t.headers}}return n==="error"?hv(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:DC(t),statusCode:Mo(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Mo(t)?t.status:void 0}:hv(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function AC(e,t,n,a,s){let o=e.headers.get("Location");if(Xe(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Jf(o)){let c=a.slice(0,a.findIndex(u=>u.route.id===n)+1);o=nf(new URL(t.url),c,s,o),e.headers.set("Location",o)}return e}function ov(e,t,n,a){let s=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Jf(e)){let o=e,c=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(s.includes(c.protocol))throw new Error("Invalid redirect location");let u=Un(c.pathname,n)!=null;if(c.origin===t.origin&&u)return c.pathname+c.search+c.hash}try{let o=a.createURL(e);if(s.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Ji(e,t,n,a){let s=e.createURL(Q_(t)).toString(),o={signal:n};if(a&&Qt(a.formMethod)){let{formMethod:c,formEncType:u}=a;o.method=c.toUpperCase(),u==="application/json"?(o.headers=new Headers({"Content-Type":u}),o.body=JSON.stringify(a.json)):u==="text/plain"?o.body=a.text:u==="application/x-www-form-urlencoded"&&a.formData?o.body=af(a.formData):o.body=a.formData}return new Request(s,o)}function af(e){let t=new URLSearchParams;for(let[n,a]of e.entries())t.append(n,typeof a=="string"?a:a.name);return t}function lv(e){let t=new FormData;for(let[n,a]of e.entries())t.append(n,a);return t}function RC(e,t,n,a=!1,s=!1){let o={},c=null,u,h=!1,f={},m=n&&xn(n[1])?n[1].error:void 0;return e.forEach(y=>{if(!(y.route.id in t))return;let k=y.route.id,w=t[k];if(Xe(!ti(w),"Cannot handle redirect results in processLoaderData"),xn(w)){let P=w.error;if(m!==void 0&&(P=m,m=void 0),c=c||{},s)c[k]=P;else{let C=Ta(e,k);c[C.route.id]==null&&(c[C.route.id]=P)}a||(o[k]=W_),h||(h=!0,u=Mo(w.error)?w.error.status:500),w.headers&&(f[k]=w.headers)}else o[k]=w.data,w.statusCode&&w.statusCode!==200&&!h&&(u=w.statusCode),w.headers&&(f[k]=w.headers)}),m!==void 0&&n&&(c={[n[0]]:m},n[2]&&(o[n[2]]=void 0)),{loaderData:o,errors:c,statusCode:u||200,loaderHeaders:f}}function cv(e,t,n,a,s,o){let{loaderData:c,errors:u}=RC(t,n,a);return s.filter(h=>!h.matches||h.matches.some(f=>f.shouldLoad)).forEach(h=>{let{key:f,match:m,controller:y}=h;if(y&&y.signal.aborted)return;let k=o[f];if(Xe(k,"Did not find corresponding fetcher result"),xn(k)){let w=Ta(e.matches,m?.route.id);u&&u[w.route.id]||(u={...u,[w.route.id]:k.error}),e.fetchers.delete(f)}else if(ti(k))Xe(!1,"Unhandled fetcher revalidation redirect");else{let w=Vr(k.data);e.fetchers.set(f,w)}}),{loaderData:c,errors:u}}function uv(e,t,n,a){let s=Object.entries(t).filter(([,o])=>o!==W_).reduce((o,[c,u])=>(o[c]=u,o),{});for(let o of n){let c=o.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&o.route.loader&&(s[c]=e[c]),a&&a.hasOwnProperty(c))break}return s}function dv(e){return e?xn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ta(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function uc(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function In(e,{pathname:t,routeId:n,method:a,type:s,message:o}={}){let c="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(c="Bad Request",a&&t&&n?u=`You made a ${a} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:s==="invalid-body"&&(u="Unable to encode submission body")):e===403?(c="Forbidden",u=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",u=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",a&&t&&n?u=`You made a ${a.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:a&&(u=`Invalid request method "${a.toUpperCase()}"`)),new Vo(e||500,c,new Error(u),!0)}function dc(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[a,s]=t[n];if(ti(s))return{key:a,result:s}}}function Q_(e){let t=typeof e=="string"?Wr(e):e;return kr({...t,hash:""})}function LC(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function DC(e){return new Vo(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function MC(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&IC(n))}function IC(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function NC(e){return np(e.result)&&$_.has(e.result.status)}function xn(e){return e.type==="error"}function ti(e){return(e&&e.type)==="redirect"}function hv(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function np(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function OC(e){return $_.has(e)}function jC(e){return np(e)&&OC(e.status)&&e.headers.has("Location")}function UC(e){return pC.has(e.toUpperCase())}function Qt(e){return hC.has(e.toUpperCase())}function rp(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Cc(e,t){let n=typeof t=="string"?Wr(t).search:t.search;if(e[e.length-1].route.index&&rp(n||""))return e[e.length-1];let a=U_(e);return a[a.length-1]}function fv(e){let{formMethod:t,formAction:n,formEncType:a,text:s,formData:o,json:c}=e;if(!(!t||!n||!a)){if(s!=null)return{formMethod:t,formAction:n,formEncType:a,formData:void 0,json:void 0,text:s};if(o!=null)return{formMethod:t,formAction:n,formEncType:a,formData:o,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:a,formData:void 0,json:c,text:void 0}}}function Ph(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function BC(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function uo(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function FC(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Vr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function VC(e,t){try{let n=e.sessionStorage.getItem(H_);if(n){let a=JSON.parse(n);for(let[s,o]of Object.entries(a||{}))o&&Array.isArray(o)&&t.set(s,new Set(o||[]))}}catch{}}function zC(e,t){if(t.size>0){let n={};for(let[a,s]of t)n[a]=[...s];try{e.sessionStorage.setItem(H_,JSON.stringify(n))}catch(a){Et(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function pv(){let e,t,n=new Promise((a,s)=>{e=async o=>{a(o);try{await n}catch{}},t=async o=>{s(o);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var pi=b.createContext(null);pi.displayName="DataRouter";var $o=b.createContext(null);$o.displayName="DataRouterState";var J_=b.createContext(!1);function $C(){return b.useContext(J_)}var ap=b.createContext({isTransitioning:!1});ap.displayName="ViewTransition";var eb=b.createContext(new Map);eb.displayName="Fetchers";var HC=b.createContext(null);HC.displayName="Await";var Bn=b.createContext(null);Bn.displayName="Navigation";var _u=b.createContext(null);_u.displayName="Location";var Kr=b.createContext({outlet:null,matches:[],isDataRoute:!1});Kr.displayName="Route";var ip=b.createContext(null);ip.displayName="RouteError";var tb="REACT_ROUTER_ERROR",WC="REDIRECT",KC="ROUTE_ERROR_RESPONSE";function GC(e){if(e.startsWith(`${tb}:${WC}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function qC(e){if(e.startsWith(`${tb}:${KC}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Vo(t.status,t.statusText,t.data)}catch{}}function YC(e,{relative:t}={}){Xe(Ho(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=b.useContext(Bn),{hash:s,pathname:o,search:c}=Wo(e,{relative:t}),u=o;return n!=="/"&&(u=o==="/"?n:ar([n,o])),a.createHref({pathname:u,search:c,hash:s})}function Ho(){return b.useContext(_u)!=null}function Fn(){return Xe(Ho(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(_u).location}var nb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function rb(e){b.useContext(Bn).static||b.useLayoutEffect(e)}function bu(){let{isDataRoute:e}=b.useContext(Kr);return e?l1():ZC()}function ZC(){Xe(Ho(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(pi),{basename:t,navigator:n}=b.useContext(Bn),{matches:a}=b.useContext(Kr),{pathname:s}=Fn(),o=JSON.stringify(ep(a)),c=b.useRef(!1);return rb(()=>{c.current=!0}),b.useCallback((h,f={})=>{if(Et(c.current,nb),!c.current)return;if(typeof h=="number"){n.go(h);return}let m=ku(h,JSON.parse(o),s,f.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:ar([t,m.pathname])),(f.replace?n.replace:n.push)(m,f.state,f)},[t,n,o,s,e])}b.createContext(null);function Wo(e,{relative:t}={}){let{matches:n}=b.useContext(Kr),{pathname:a}=Fn(),s=JSON.stringify(ep(n));return b.useMemo(()=>ku(e,JSON.parse(s),a,t==="path"),[e,s,a,t])}function XC(e,t,n){Xe(Ho(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=b.useContext(Bn),{matches:s}=b.useContext(Kr),o=s[s.length-1],c=o?o.params:{},u=o?o.pathname:"/",h=o?o.pathnameBase:"/",f=o&&o.route;{let S=f&&f.path||"";ib(u,!f||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${S}">) 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.
9
+ `+g.stack}return{value:r,source:i,stack:p,digest:null}}function Fd(r,i,l){return{value:r,source:null,stack:l??null,digest:i??null}}function Vd(r,i){try{console.error(i.value)}catch(l){setTimeout(function(){throw l})}}var XP=typeof WeakMap=="function"?WeakMap:Map;function Kg(r,i,l){l=jr(-1,l),l.tag=3,l.payload={element:null};var d=i.value;return l.callback=function(){Zl||(Zl=!0,nh=d),Vd(r,i)},l}function Gg(r,i,l){l=jr(-1,l),l.tag=3;var d=r.type.getDerivedStateFromError;if(typeof d=="function"){var p=i.value;l.payload=function(){return d(p)},l.callback=function(){Vd(r,i)}}var g=r.stateNode;return g!==null&&typeof g.componentDidCatch=="function"&&(l.callback=function(){Vd(r,i),typeof d!="function"&&(ya===null?ya=new Set([this]):ya.add(this));var _=i.stack;this.componentDidCatch(i.value,{componentStack:_!==null?_:""})}),l}function qg(r,i,l){var d=r.pingCache;if(d===null){d=r.pingCache=new XP;var p=new Set;d.set(i,p)}else p=d.get(i),p===void 0&&(p=new Set,d.set(i,p));p.has(l)||(p.add(l),r=dS.bind(null,r,i,l),i.then(r,r))}function Yg(r){do{var i;if((i=r.tag===13)&&(i=r.memoizedState,i=i!==null?i.dehydrated!==null:!0),i)return r;r=r.return}while(r!==null);return null}function Zg(r,i,l,d,p){return(r.mode&1)===0?(r===i?r.flags|=65536:(r.flags|=128,l.flags|=131072,l.flags&=-52805,l.tag===1&&(l.alternate===null?l.tag=17:(i=jr(-1,1),i.tag=2,ma(l,i,1))),l.lanes|=1),r):(r.flags|=65536,r.lanes=p,r)}var QP=O.ReactCurrentOwner,pn=!1;function an(r,i,l,d){i.child=r===null?gg(i,null,l,d):Bi(i,r.child,l,d)}function Xg(r,i,l,d,p){l=l.render;var g=i.ref;return Vi(i,p),d=Dd(r,i,l,d,g,p),l=Md(),r!==null&&!pn?(i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~p,Ur(r,i,p)):(kt&&l&&md(i),i.flags|=1,an(r,i,d,p),i.child)}function Qg(r,i,l,d,p){if(r===null){var g=l.type;return typeof g=="function"&&!ch(g)&&g.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(i.tag=15,i.type=g,Jg(r,i,g,d,p)):(r=nc(l.type,null,d,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(g=r.child,(r.lanes&p)===0){var _=g.memoizedProps;if(l=l.compare,l=l!==null?l:zo,l(_,d)&&r.ref===i.ref)return Ur(r,i,p)}return i.flags|=1,r=ba(g,d),r.ref=i.ref,r.return=i,i.child=r}function Jg(r,i,l,d,p){if(r!==null){var g=r.memoizedProps;if(zo(g,d)&&r.ref===i.ref)if(pn=!1,i.pendingProps=d=g,(r.lanes&p)!==0)(r.flags&131072)!==0&&(pn=!0);else return i.lanes=r.lanes,Ur(r,i,p)}return zd(r,i,l,d,p)}function ey(r,i,l){var d=i.pendingProps,p=d.children,g=r!==null?r.memoizedState:null;if(d.mode==="hidden")if((i.mode&1)===0)i.memoizedState={baseLanes:0,cachePool:null,transitions:null},ft(Wi,bn),bn|=l;else{if((l&1073741824)===0)return r=g!==null?g.baseLanes|l:l,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:r,cachePool:null,transitions:null},i.updateQueue=null,ft(Wi,bn),bn|=r,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=g!==null?g.baseLanes:l,ft(Wi,bn),bn|=d}else g!==null?(d=g.baseLanes|l,i.memoizedState=null):d=l,ft(Wi,bn),bn|=d;return an(r,i,p,l),i.child}function ty(r,i){var l=i.ref;(r===null&&l!==null||r!==null&&r.ref!==l)&&(i.flags|=512,i.flags|=2097152)}function zd(r,i,l,d,p){var g=fn(l)?za:qt.current;return g=Ni(i,g),Vi(i,p),l=Dd(r,i,l,d,g,p),d=Md(),r!==null&&!pn?(i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~p,Ur(r,i,p)):(kt&&d&&md(i),i.flags|=1,an(r,i,l,p),i.child)}function ny(r,i,l,d,p){if(fn(l)){var g=!0;Tl(i)}else g=!1;if(Vi(i,p),i.stateNode===null)Wl(r,i),Hg(i,l,d),Bd(i,l,d,p),d=!0;else if(r===null){var _=i.stateNode,E=i.memoizedProps;_.props=E;var M=_.context,$=l.contextType;typeof $=="object"&&$!==null?$=Rn($):($=fn(l)?za:qt.current,$=Ni(i,$));var ee=l.getDerivedStateFromProps,ne=typeof ee=="function"||typeof _.getSnapshotBeforeUpdate=="function";ne||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(E!==d||M!==$)&&Wg(i,_,d,$),pa=!1;var J=i.memoizedState;_.state=J,Ol(i,d,_,p),M=i.memoizedState,E!==d||J!==M||hn.current||pa?(typeof ee=="function"&&(Ud(i,l,ee,d),M=i.memoizedState),(E=pa||$g(i,l,E,d,J,M,$))?(ne||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(i.flags|=4194308)):(typeof _.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=M),_.props=d,_.state=M,_.context=$,d=E):(typeof _.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{_=i.stateNode,vg(r,i),E=i.memoizedProps,$=i.type===i.elementType?E:Xn(i.type,E),_.props=$,ne=i.pendingProps,J=_.context,M=l.contextType,typeof M=="object"&&M!==null?M=Rn(M):(M=fn(l)?za:qt.current,M=Ni(i,M));var ue=l.getDerivedStateFromProps;(ee=typeof ue=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(E!==ne||J!==M)&&Wg(i,_,d,M),pa=!1,J=i.memoizedState,_.state=J,Ol(i,d,_,p);var ve=i.memoizedState;E!==ne||J!==ve||hn.current||pa?(typeof ue=="function"&&(Ud(i,l,ue,d),ve=i.memoizedState),($=pa||$g(i,l,$,d,J,ve,M)||!1)?(ee||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(d,ve,M),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(d,ve,M)),typeof _.componentDidUpdate=="function"&&(i.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof _.componentDidUpdate!="function"||E===r.memoizedProps&&J===r.memoizedState||(i.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&J===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=ve),_.props=d,_.state=ve,_.context=M,d=$):(typeof _.componentDidUpdate!="function"||E===r.memoizedProps&&J===r.memoizedState||(i.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&J===r.memoizedState||(i.flags|=1024),d=!1)}return $d(r,i,l,d,g,p)}function $d(r,i,l,d,p,g){ty(r,i);var _=(i.flags&128)!==0;if(!d&&!_)return p&&sg(i,l,!1),Ur(r,i,g);d=i.stateNode,QP.current=i;var E=_&&typeof l.getDerivedStateFromError!="function"?null:d.render();return i.flags|=1,r!==null&&_?(i.child=Bi(i,r.child,null,g),i.child=Bi(i,null,E,g)):an(r,i,E,g),i.memoizedState=d.state,p&&sg(i,l,!0),i.child}function ry(r){var i=r.stateNode;i.pendingContext?ig(r,i.pendingContext,i.pendingContext!==i.context):i.context&&ig(r,i.context,!1),Cd(r,i.containerInfo)}function ay(r,i,l,d,p){return Ui(),kd(p),i.flags|=256,an(r,i,l,d),i.child}var Hd={dehydrated:null,treeContext:null,retryLane:0};function Wd(r){return{baseLanes:r,cachePool:null,transitions:null}}function iy(r,i,l){var d=i.pendingProps,p=bt.current,g=!1,_=(i.flags&128)!==0,E;if((E=_)||(E=r!==null&&r.memoizedState===null?!1:(p&2)!==0),E?(g=!0,i.flags&=-129):(r===null||r.memoizedState!==null)&&(p|=1),ft(bt,p&1),r===null)return vd(i),r=i.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((i.mode&1)===0?i.lanes=1:r.data==="$!"?i.lanes=8:i.lanes=1073741824,null):(_=d.children,r=d.fallback,g?(d=i.mode,g=i.child,_={mode:"hidden",children:_},(d&1)===0&&g!==null?(g.childLanes=0,g.pendingProps=_):g=rc(_,d,0,null),r=Qa(r,d,l,null),g.return=i,r.return=i,g.sibling=r,i.child=g,i.child.memoizedState=Wd(l),i.memoizedState=Hd,r):Kd(i,_));if(p=r.memoizedState,p!==null&&(E=p.dehydrated,E!==null))return JP(r,i,_,d,E,p,l);if(g){g=d.fallback,_=i.mode,p=r.child,E=p.sibling;var M={mode:"hidden",children:d.children};return(_&1)===0&&i.child!==p?(d=i.child,d.childLanes=0,d.pendingProps=M,i.deletions=null):(d=ba(p,M),d.subtreeFlags=p.subtreeFlags&14680064),E!==null?g=ba(E,g):(g=Qa(g,_,l,null),g.flags|=2),g.return=i,d.return=i,d.sibling=g,i.child=d,d=g,g=i.child,_=r.child.memoizedState,_=_===null?Wd(l):{baseLanes:_.baseLanes|l,cachePool:null,transitions:_.transitions},g.memoizedState=_,g.childLanes=r.childLanes&~l,i.memoizedState=Hd,d}return g=r.child,r=g.sibling,d=ba(g,{mode:"visible",children:d.children}),(i.mode&1)===0&&(d.lanes=l),d.return=i,d.sibling=null,r!==null&&(l=i.deletions,l===null?(i.deletions=[r],i.flags|=16):l.push(r)),i.child=d,i.memoizedState=null,d}function Kd(r,i){return i=rc({mode:"visible",children:i},r.mode,0,null),i.return=r,r.child=i}function Hl(r,i,l,d){return d!==null&&kd(d),Bi(i,r.child,null,l),r=Kd(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function JP(r,i,l,d,p,g,_){if(l)return i.flags&256?(i.flags&=-257,d=Fd(Error(n(422))),Hl(r,i,_,d)):i.memoizedState!==null?(i.child=r.child,i.flags|=128,null):(g=d.fallback,p=i.mode,d=rc({mode:"visible",children:d.children},p,0,null),g=Qa(g,p,_,null),g.flags|=2,d.return=i,g.return=i,d.sibling=g,i.child=d,(i.mode&1)!==0&&Bi(i,r.child,null,_),i.child.memoizedState=Wd(_),i.memoizedState=Hd,g);if((i.mode&1)===0)return Hl(r,i,_,null);if(p.data==="$!"){if(d=p.nextSibling&&p.nextSibling.dataset,d)var E=d.dgst;return d=E,g=Error(n(419)),d=Fd(g,d,void 0),Hl(r,i,_,d)}if(E=(_&r.childLanes)!==0,pn||E){if(d=Ft,d!==null){switch(_&-_){case 4:p=2;break;case 16:p=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:p=32;break;case 536870912:p=268435456;break;default:p=0}p=(p&(d.suspendedLanes|_))!==0?0:p,p!==0&&p!==g.retryLane&&(g.retryLane=p,Or(r,p),er(d,r,p,-1))}return lh(),d=Fd(Error(n(421))),Hl(r,i,_,d)}return p.data==="$?"?(i.flags|=128,i.child=r.child,i=hS.bind(null,r),p._reactRetry=i,null):(r=g.treeContext,_n=ua(p.nextSibling),kn=i,kt=!0,Zn=null,r!==null&&(En[An++]=Ir,En[An++]=Nr,En[An++]=$a,Ir=r.id,Nr=r.overflow,$a=i),i=Kd(i,d.children),i.flags|=4096,i)}function oy(r,i,l){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),xd(r.return,i,l)}function Gd(r,i,l,d,p){var g=r.memoizedState;g===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:p}:(g.isBackwards=i,g.rendering=null,g.renderingStartTime=0,g.last=d,g.tail=l,g.tailMode=p)}function sy(r,i,l){var d=i.pendingProps,p=d.revealOrder,g=d.tail;if(an(r,i,d.children,l),d=bt.current,(d&2)!==0)d=d&1|2,i.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&oy(r,l,i);else if(r.tag===19)oy(r,l,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}d&=1}if(ft(bt,d),(i.mode&1)===0)i.memoizedState=null;else switch(p){case"forwards":for(l=i.child,p=null;l!==null;)r=l.alternate,r!==null&&jl(r)===null&&(p=l),l=l.sibling;l=p,l===null?(p=i.child,i.child=null):(p=l.sibling,l.sibling=null),Gd(i,!1,p,l,g);break;case"backwards":for(l=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&jl(r)===null){i.child=p;break}r=p.sibling,p.sibling=l,l=p,p=r}Gd(i,!0,l,null,g);break;case"together":Gd(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function Wl(r,i){(i.mode&1)===0&&r!==null&&(r.alternate=null,i.alternate=null,i.flags|=2)}function Ur(r,i,l){if(r!==null&&(i.dependencies=r.dependencies),qa|=i.lanes,(l&i.childLanes)===0)return null;if(r!==null&&i.child!==r.child)throw Error(n(153));if(i.child!==null){for(r=i.child,l=ba(r,r.pendingProps),i.child=l,l.return=i;r.sibling!==null;)r=r.sibling,l=l.sibling=ba(r,r.pendingProps),l.return=i;l.sibling=null}return i.child}function eS(r,i,l){switch(i.tag){case 3:ry(i),Ui();break;case 5:bg(i);break;case 1:fn(i.type)&&Tl(i);break;case 4:Cd(i,i.stateNode.containerInfo);break;case 10:var d=i.type._context,p=i.memoizedProps.value;ft(Ml,d._currentValue),d._currentValue=p;break;case 13:if(d=i.memoizedState,d!==null)return d.dehydrated!==null?(ft(bt,bt.current&1),i.flags|=128,null):(l&i.child.childLanes)!==0?iy(r,i,l):(ft(bt,bt.current&1),r=Ur(r,i,l),r!==null?r.sibling:null);ft(bt,bt.current&1);break;case 19:if(d=(l&i.childLanes)!==0,(r.flags&128)!==0){if(d)return sy(r,i,l);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),ft(bt,bt.current),d)break;return null;case 22:case 23:return i.lanes=0,ey(r,i,l)}return Ur(r,i,l)}var ly,qd,cy,uy;ly=function(r,i){for(var l=i.child;l!==null;){if(l.tag===5||l.tag===6)r.appendChild(l.stateNode);else if(l.tag!==4&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return;l=l.return}l.sibling.return=l.return,l=l.sibling}},qd=function(){},cy=function(r,i,l,d){var p=r.memoizedProps;if(p!==d){r=i.stateNode,Ka(ur.current);var g=null;switch(l){case"input":p=en(r,p),d=en(r,d),g=[];break;case"select":p=H({},p,{value:void 0}),d=H({},d,{value:void 0}),g=[];break;case"textarea":p=So(r,p),d=So(r,d),g=[];break;default:typeof p.onClick!="function"&&typeof d.onClick=="function"&&(r.onclick=Pl)}ki(l,d);var _;l=null;for($ in p)if(!d.hasOwnProperty($)&&p.hasOwnProperty($)&&p[$]!=null)if($==="style"){var E=p[$];for(_ in E)E.hasOwnProperty(_)&&(l||(l={}),l[_]="")}else $!=="dangerouslySetInnerHTML"&&$!=="children"&&$!=="suppressContentEditableWarning"&&$!=="suppressHydrationWarning"&&$!=="autoFocus"&&(o.hasOwnProperty($)?g||(g=[]):(g=g||[]).push($,null));for($ in d){var M=d[$];if(E=p?.[$],d.hasOwnProperty($)&&M!==E&&(M!=null||E!=null))if($==="style")if(E){for(_ in E)!E.hasOwnProperty(_)||M&&M.hasOwnProperty(_)||(l||(l={}),l[_]="");for(_ in M)M.hasOwnProperty(_)&&E[_]!==M[_]&&(l||(l={}),l[_]=M[_])}else l||(g||(g=[]),g.push($,l)),l=M;else $==="dangerouslySetInnerHTML"?(M=M?M.__html:void 0,E=E?E.__html:void 0,M!=null&&E!==M&&(g=g||[]).push($,M)):$==="children"?typeof M!="string"&&typeof M!="number"||(g=g||[]).push($,""+M):$!=="suppressContentEditableWarning"&&$!=="suppressHydrationWarning"&&(o.hasOwnProperty($)?(M!=null&&$==="onScroll"&&mt("scroll",r),g||E===M||(g=[])):(g=g||[]).push($,M))}l&&(g=g||[]).push("style",l);var $=g;(i.updateQueue=$)&&(i.flags|=4)}},uy=function(r,i,l,d){l!==d&&(i.flags|=4)};function rs(r,i){if(!kt)switch(r.tailMode){case"hidden":i=r.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?r.tail=null:l.sibling=null;break;case"collapsed":l=r.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function Zt(r){var i=r.alternate!==null&&r.alternate.child===r.child,l=0,d=0;if(i)for(var p=r.child;p!==null;)l|=p.lanes|p.childLanes,d|=p.subtreeFlags&14680064,d|=p.flags&14680064,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)l|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=d,r.childLanes=l,i}function tS(r,i,l){var d=i.pendingProps;switch(gd(i),i.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zt(i),null;case 1:return fn(i.type)&&Cl(),Zt(i),null;case 3:return d=i.stateNode,zi(),gt(hn),gt(qt),Ad(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(r===null||r.child===null)&&(Ll(i)?i.flags|=4:r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Zn!==null&&(ih(Zn),Zn=null))),qd(r,i),Zt(i),null;case 5:Td(i);var p=Ka(Qo.current);if(l=i.type,r!==null&&i.stateNode!=null)cy(r,i,l,d,p),r.ref!==i.ref&&(i.flags|=512,i.flags|=2097152);else{if(!d){if(i.stateNode===null)throw Error(n(166));return Zt(i),null}if(r=Ka(ur.current),Ll(i)){d=i.stateNode,l=i.type;var g=i.memoizedProps;switch(d[cr]=i,d[Go]=g,r=(i.mode&1)!==0,l){case"dialog":mt("cancel",d),mt("close",d);break;case"iframe":case"object":case"embed":mt("load",d);break;case"video":case"audio":for(p=0;p<Ho.length;p++)mt(Ho[p],d);break;case"source":mt("error",d);break;case"img":case"image":case"link":mt("error",d),mt("load",d);break;case"details":mt("toggle",d);break;case"input":xo(d,g),mt("invalid",d);break;case"select":d._wrapperState={wasMultiple:!!g.multiple},mt("invalid",d);break;case"textarea":il(d,g),mt("invalid",d)}ki(l,g),p=null;for(var _ in g)if(g.hasOwnProperty(_)){var E=g[_];_==="children"?typeof E=="string"?d.textContent!==E&&(g.suppressHydrationWarning!==!0&&xl(d.textContent,E,r),p=["children",E]):typeof E=="number"&&d.textContent!==""+E&&(g.suppressHydrationWarning!==!0&&xl(d.textContent,E,r),p=["children",""+E]):o.hasOwnProperty(_)&&E!=null&&_==="onScroll"&&mt("scroll",d)}switch(l){case"input":Hn(d),al(d,g,!0);break;case"textarea":Hn(d),lr(d);break;case"select":case"option":break;default:typeof g.onClick=="function"&&(d.onclick=Pl)}d=p,i.updateQueue=d,d!==null&&(i.flags|=4)}else{_=p.nodeType===9?p:p.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=Zr(l)),r==="http://www.w3.org/1999/xhtml"?l==="script"?(r=_.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof d.is=="string"?r=_.createElement(l,{is:d.is}):(r=_.createElement(l),l==="select"&&(_=r,d.multiple?_.multiple=!0:d.size&&(_.size=d.size))):r=_.createElementNS(r,l),r[cr]=i,r[Go]=d,ly(r,i,!1,!1),i.stateNode=r;e:{switch(_=_i(l,d),l){case"dialog":mt("cancel",r),mt("close",r),p=d;break;case"iframe":case"object":case"embed":mt("load",r),p=d;break;case"video":case"audio":for(p=0;p<Ho.length;p++)mt(Ho[p],r);p=d;break;case"source":mt("error",r),p=d;break;case"img":case"image":case"link":mt("error",r),mt("load",r),p=d;break;case"details":mt("toggle",r),p=d;break;case"input":xo(r,d),p=en(r,d),mt("invalid",r);break;case"option":p=d;break;case"select":r._wrapperState={wasMultiple:!!d.multiple},p=H({},d,{value:void 0}),mt("invalid",r);break;case"textarea":il(r,d),p=So(r,d),mt("invalid",r);break;default:p=d}ki(l,p),E=p;for(g in E)if(E.hasOwnProperty(g)){var M=E[g];g==="style"?sl(r,M):g==="dangerouslySetInnerHTML"?(M=M?M.__html:void 0,M!=null&&Cn(r,M)):g==="children"?typeof M=="string"?(l!=="textarea"||M!=="")&&tn(r,M):typeof M=="number"&&tn(r,""+M):g!=="suppressContentEditableWarning"&&g!=="suppressHydrationWarning"&&g!=="autoFocus"&&(o.hasOwnProperty(g)?M!=null&&g==="onScroll"&&mt("scroll",r):M!=null&&R(r,g,M,_))}switch(l){case"input":Hn(r),al(r,d,!1);break;case"textarea":Hn(r),lr(r);break;case"option":d.value!=null&&r.setAttribute("value",""+Qe(d.value));break;case"select":r.multiple=!!d.multiple,g=d.value,g!=null?Yr(r,!!d.multiple,g,!1):d.defaultValue!=null&&Yr(r,!!d.multiple,d.defaultValue,!0);break;default:typeof p.onClick=="function"&&(r.onclick=Pl)}switch(l){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}}d&&(i.flags|=4)}i.ref!==null&&(i.flags|=512,i.flags|=2097152)}return Zt(i),null;case 6:if(r&&i.stateNode!=null)uy(r,i,r.memoizedProps,d);else{if(typeof d!="string"&&i.stateNode===null)throw Error(n(166));if(l=Ka(Qo.current),Ka(ur.current),Ll(i)){if(d=i.stateNode,l=i.memoizedProps,d[cr]=i,(g=d.nodeValue!==l)&&(r=kn,r!==null))switch(r.tag){case 3:xl(d.nodeValue,l,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&xl(d.nodeValue,l,(r.mode&1)!==0)}g&&(i.flags|=4)}else d=(l.nodeType===9?l:l.ownerDocument).createTextNode(d),d[cr]=i,i.stateNode=d}return Zt(i),null;case 13:if(gt(bt),d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(kt&&_n!==null&&(i.mode&1)!==0&&(i.flags&128)===0)fg(),Ui(),i.flags|=98560,g=!1;else if(g=Ll(i),d!==null&&d.dehydrated!==null){if(r===null){if(!g)throw Error(n(318));if(g=i.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(n(317));g[cr]=i}else Ui(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Zt(i),g=!1}else Zn!==null&&(ih(Zn),Zn=null),g=!0;if(!g)return i.flags&65536?i:null}return(i.flags&128)!==0?(i.lanes=l,i):(d=d!==null,d!==(r!==null&&r.memoizedState!==null)&&d&&(i.child.flags|=8192,(i.mode&1)!==0&&(r===null||(bt.current&1)!==0?It===0&&(It=3):lh())),i.updateQueue!==null&&(i.flags|=4),Zt(i),null);case 4:return zi(),qd(r,i),r===null&&Wo(i.stateNode.containerInfo),Zt(i),null;case 10:return wd(i.type._context),Zt(i),null;case 17:return fn(i.type)&&Cl(),Zt(i),null;case 19:if(gt(bt),g=i.memoizedState,g===null)return Zt(i),null;if(d=(i.flags&128)!==0,_=g.rendering,_===null)if(d)rs(g,!1);else{if(It!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(_=jl(r),_!==null){for(i.flags|=128,rs(g,!1),d=_.updateQueue,d!==null&&(i.updateQueue=d,i.flags|=4),i.subtreeFlags=0,d=l,l=i.child;l!==null;)g=l,r=d,g.flags&=14680066,_=g.alternate,_===null?(g.childLanes=0,g.lanes=r,g.child=null,g.subtreeFlags=0,g.memoizedProps=null,g.memoizedState=null,g.updateQueue=null,g.dependencies=null,g.stateNode=null):(g.childLanes=_.childLanes,g.lanes=_.lanes,g.child=_.child,g.subtreeFlags=0,g.deletions=null,g.memoizedProps=_.memoizedProps,g.memoizedState=_.memoizedState,g.updateQueue=_.updateQueue,g.type=_.type,r=_.dependencies,g.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),l=l.sibling;return ft(bt,bt.current&1|2),i.child}r=r.sibling}g.tail!==null&&rt()>Ki&&(i.flags|=128,d=!0,rs(g,!1),i.lanes=4194304)}else{if(!d)if(r=jl(_),r!==null){if(i.flags|=128,d=!0,l=r.updateQueue,l!==null&&(i.updateQueue=l,i.flags|=4),rs(g,!0),g.tail===null&&g.tailMode==="hidden"&&!_.alternate&&!kt)return Zt(i),null}else 2*rt()-g.renderingStartTime>Ki&&l!==1073741824&&(i.flags|=128,d=!0,rs(g,!1),i.lanes=4194304);g.isBackwards?(_.sibling=i.child,i.child=_):(l=g.last,l!==null?l.sibling=_:i.child=_,g.last=_)}return g.tail!==null?(i=g.tail,g.rendering=i,g.tail=i.sibling,g.renderingStartTime=rt(),i.sibling=null,l=bt.current,ft(bt,d?l&1|2:l&1),i):(Zt(i),null);case 22:case 23:return sh(),d=i.memoizedState!==null,r!==null&&r.memoizedState!==null!==d&&(i.flags|=8192),d&&(i.mode&1)!==0?(bn&1073741824)!==0&&(Zt(i),i.subtreeFlags&6&&(i.flags|=8192)):Zt(i),null;case 24:return null;case 25:return null}throw Error(n(156,i.tag))}function nS(r,i){switch(gd(i),i.tag){case 1:return fn(i.type)&&Cl(),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return zi(),gt(hn),gt(qt),Ad(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 5:return Td(i),null;case 13:if(gt(bt),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(n(340));Ui()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return gt(bt),null;case 4:return zi(),null;case 10:return wd(i.type._context),null;case 22:case 23:return sh(),null;case 24:return null;default:return null}}var Kl=!1,Xt=!1,rS=typeof WeakSet=="function"?WeakSet:Set,ge=null;function Hi(r,i){var l=r.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(d){xt(r,i,d)}else l.current=null}function Yd(r,i,l){try{l()}catch(d){xt(r,i,d)}}var dy=!1;function aS(r,i){if(sd=hl,r=$m(),Ju(r)){if("selectionStart"in r)var l={start:r.selectionStart,end:r.selectionEnd};else e:{l=(l=r.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var p=d.anchorOffset,g=d.focusNode;d=d.focusOffset;try{l.nodeType,g.nodeType}catch{l=null;break e}var _=0,E=-1,M=-1,$=0,ee=0,ne=r,J=null;t:for(;;){for(var ue;ne!==l||p!==0&&ne.nodeType!==3||(E=_+p),ne!==g||d!==0&&ne.nodeType!==3||(M=_+d),ne.nodeType===3&&(_+=ne.nodeValue.length),(ue=ne.firstChild)!==null;)J=ne,ne=ue;for(;;){if(ne===r)break t;if(J===l&&++$===p&&(E=_),J===g&&++ee===d&&(M=_),(ue=ne.nextSibling)!==null)break;ne=J,J=ne.parentNode}ne=ue}l=E===-1||M===-1?null:{start:E,end:M}}else l=null}l=l||{start:0,end:0}}else l=null;for(ld={focusedElem:r,selectionRange:l},hl=!1,ge=i;ge!==null;)if(i=ge,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,ge=r;else for(;ge!==null;){i=ge;try{var ve=i.alternate;if((i.flags&1024)!==0)switch(i.tag){case 0:case 11:case 15:break;case 1:if(ve!==null){var we=ve.memoizedProps,Ct=ve.memoizedState,B=i.stateNode,j=B.getSnapshotBeforeUpdate(i.elementType===i.type?we:Xn(i.type,we),Ct);B.__reactInternalSnapshotBeforeUpdate=j}break;case 3:var F=i.stateNode.containerInfo;F.nodeType===1?F.textContent="":F.nodeType===9&&F.documentElement&&F.removeChild(F.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(oe){xt(i,i.return,oe)}if(r=i.sibling,r!==null){r.return=i.return,ge=r;break}ge=i.return}return ve=dy,dy=!1,ve}function as(r,i,l){var d=i.updateQueue;if(d=d!==null?d.lastEffect:null,d!==null){var p=d=d.next;do{if((p.tag&r)===r){var g=p.destroy;p.destroy=void 0,g!==void 0&&Yd(i,l,g)}p=p.next}while(p!==d)}}function Gl(r,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var l=i=i.next;do{if((l.tag&r)===r){var d=l.create;l.destroy=d()}l=l.next}while(l!==i)}}function Zd(r){var i=r.ref;if(i!==null){var l=r.stateNode;r.tag,r=l,typeof i=="function"?i(r):i.current=r}}function hy(r){var i=r.alternate;i!==null&&(r.alternate=null,hy(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&(delete i[cr],delete i[Go],delete i[hd],delete i[FP],delete i[VP])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function fy(r){return r.tag===5||r.tag===3||r.tag===4}function py(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||fy(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Xd(r,i,l){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?l.nodeType===8?l.parentNode.insertBefore(r,i):l.insertBefore(r,i):(l.nodeType===8?(i=l.parentNode,i.insertBefore(r,l)):(i=l,i.appendChild(r)),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=Pl));else if(d!==4&&(r=r.child,r!==null))for(Xd(r,i,l),r=r.sibling;r!==null;)Xd(r,i,l),r=r.sibling}function Qd(r,i,l){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?l.insertBefore(r,i):l.appendChild(r);else if(d!==4&&(r=r.child,r!==null))for(Qd(r,i,l),r=r.sibling;r!==null;)Qd(r,i,l),r=r.sibling}var Ht=null,Qn=!1;function ga(r,i,l){for(l=l.child;l!==null;)my(r,i,l),l=l.sibling}function my(r,i,l){if(rn&&typeof rn.onCommitFiberUnmount=="function")try{rn.onCommitFiberUnmount(Tn,l)}catch{}switch(l.tag){case 5:Xt||Hi(l,i);case 6:var d=Ht,p=Qn;Ht=null,ga(r,i,l),Ht=d,Qn=p,Ht!==null&&(Qn?(r=Ht,l=l.stateNode,r.nodeType===8?r.parentNode.removeChild(l):r.removeChild(l)):Ht.removeChild(l.stateNode));break;case 18:Ht!==null&&(Qn?(r=Ht,l=l.stateNode,r.nodeType===8?dd(r.parentNode,l):r.nodeType===1&&dd(r,l),Oo(r)):dd(Ht,l.stateNode));break;case 4:d=Ht,p=Qn,Ht=l.stateNode.containerInfo,Qn=!0,ga(r,i,l),Ht=d,Qn=p;break;case 0:case 11:case 14:case 15:if(!Xt&&(d=l.updateQueue,d!==null&&(d=d.lastEffect,d!==null))){p=d=d.next;do{var g=p,_=g.destroy;g=g.tag,_!==void 0&&((g&2)!==0||(g&4)!==0)&&Yd(l,i,_),p=p.next}while(p!==d)}ga(r,i,l);break;case 1:if(!Xt&&(Hi(l,i),d=l.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=l.memoizedProps,d.state=l.memoizedState,d.componentWillUnmount()}catch(E){xt(l,i,E)}ga(r,i,l);break;case 21:ga(r,i,l);break;case 22:l.mode&1?(Xt=(d=Xt)||l.memoizedState!==null,ga(r,i,l),Xt=d):ga(r,i,l);break;default:ga(r,i,l)}}function gy(r){var i=r.updateQueue;if(i!==null){r.updateQueue=null;var l=r.stateNode;l===null&&(l=r.stateNode=new rS),i.forEach(function(d){var p=fS.bind(null,r,d);l.has(d)||(l.add(d),d.then(p,p))})}}function Jn(r,i){var l=i.deletions;if(l!==null)for(var d=0;d<l.length;d++){var p=l[d];try{var g=r,_=i,E=_;e:for(;E!==null;){switch(E.tag){case 5:Ht=E.stateNode,Qn=!1;break e;case 3:Ht=E.stateNode.containerInfo,Qn=!0;break e;case 4:Ht=E.stateNode.containerInfo,Qn=!0;break e}E=E.return}if(Ht===null)throw Error(n(160));my(g,_,p),Ht=null,Qn=!1;var M=p.alternate;M!==null&&(M.return=null),p.return=null}catch($){xt(p,i,$)}}if(i.subtreeFlags&12854)for(i=i.child;i!==null;)yy(i,r),i=i.sibling}function yy(r,i){var l=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(Jn(i,r),hr(r),d&4){try{as(3,r,r.return),Gl(3,r)}catch(we){xt(r,r.return,we)}try{as(5,r,r.return)}catch(we){xt(r,r.return,we)}}break;case 1:Jn(i,r),hr(r),d&512&&l!==null&&Hi(l,l.return);break;case 5:if(Jn(i,r),hr(r),d&512&&l!==null&&Hi(l,l.return),r.flags&32){var p=r.stateNode;try{tn(p,"")}catch(we){xt(r,r.return,we)}}if(d&4&&(p=r.stateNode,p!=null)){var g=r.memoizedProps,_=l!==null?l.memoizedProps:g,E=r.type,M=r.updateQueue;if(r.updateQueue=null,M!==null)try{E==="input"&&g.type==="radio"&&g.name!=null&&rl(p,g),_i(E,_);var $=_i(E,g);for(_=0;_<M.length;_+=2){var ee=M[_],ne=M[_+1];ee==="style"?sl(p,ne):ee==="dangerouslySetInnerHTML"?Cn(p,ne):ee==="children"?tn(p,ne):R(p,ee,ne,$)}switch(E){case"input":Wn(p,g);break;case"textarea":ol(p,g);break;case"select":var J=p._wrapperState.wasMultiple;p._wrapperState.wasMultiple=!!g.multiple;var ue=g.value;ue!=null?Yr(p,!!g.multiple,ue,!1):J!==!!g.multiple&&(g.defaultValue!=null?Yr(p,!!g.multiple,g.defaultValue,!0):Yr(p,!!g.multiple,g.multiple?[]:"",!1))}p[Go]=g}catch(we){xt(r,r.return,we)}}break;case 6:if(Jn(i,r),hr(r),d&4){if(r.stateNode===null)throw Error(n(162));p=r.stateNode,g=r.memoizedProps;try{p.nodeValue=g}catch(we){xt(r,r.return,we)}}break;case 3:if(Jn(i,r),hr(r),d&4&&l!==null&&l.memoizedState.isDehydrated)try{Oo(i.containerInfo)}catch(we){xt(r,r.return,we)}break;case 4:Jn(i,r),hr(r);break;case 13:Jn(i,r),hr(r),p=r.child,p.flags&8192&&(g=p.memoizedState!==null,p.stateNode.isHidden=g,!g||p.alternate!==null&&p.alternate.memoizedState!==null||(th=rt())),d&4&&gy(r);break;case 22:if(ee=l!==null&&l.memoizedState!==null,r.mode&1?(Xt=($=Xt)||ee,Jn(i,r),Xt=$):Jn(i,r),hr(r),d&8192){if($=r.memoizedState!==null,(r.stateNode.isHidden=$)&&!ee&&(r.mode&1)!==0)for(ge=r,ee=r.child;ee!==null;){for(ne=ge=ee;ge!==null;){switch(J=ge,ue=J.child,J.tag){case 0:case 11:case 14:case 15:as(4,J,J.return);break;case 1:Hi(J,J.return);var ve=J.stateNode;if(typeof ve.componentWillUnmount=="function"){d=J,l=J.return;try{i=d,ve.props=i.memoizedProps,ve.state=i.memoizedState,ve.componentWillUnmount()}catch(we){xt(d,l,we)}}break;case 5:Hi(J,J.return);break;case 22:if(J.memoizedState!==null){_y(ne);continue}}ue!==null?(ue.return=J,ge=ue):_y(ne)}ee=ee.sibling}e:for(ee=null,ne=r;;){if(ne.tag===5){if(ee===null){ee=ne;try{p=ne.stateNode,$?(g=p.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none"):(E=ne.stateNode,M=ne.memoizedProps.style,_=M!=null&&M.hasOwnProperty("display")?M.display:null,E.style.display=vi("display",_))}catch(we){xt(r,r.return,we)}}}else if(ne.tag===6){if(ee===null)try{ne.stateNode.nodeValue=$?"":ne.memoizedProps}catch(we){xt(r,r.return,we)}}else if((ne.tag!==22&&ne.tag!==23||ne.memoizedState===null||ne===r)&&ne.child!==null){ne.child.return=ne,ne=ne.child;continue}if(ne===r)break e;for(;ne.sibling===null;){if(ne.return===null||ne.return===r)break e;ee===ne&&(ee=null),ne=ne.return}ee===ne&&(ee=null),ne.sibling.return=ne.return,ne=ne.sibling}}break;case 19:Jn(i,r),hr(r),d&4&&gy(r);break;case 21:break;default:Jn(i,r),hr(r)}}function hr(r){var i=r.flags;if(i&2){try{e:{for(var l=r.return;l!==null;){if(fy(l)){var d=l;break e}l=l.return}throw Error(n(160))}switch(d.tag){case 5:var p=d.stateNode;d.flags&32&&(tn(p,""),d.flags&=-33);var g=py(r);Qd(r,g,p);break;case 3:case 4:var _=d.stateNode.containerInfo,E=py(r);Xd(r,E,_);break;default:throw Error(n(161))}}catch(M){xt(r,r.return,M)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function iS(r,i,l){ge=r,vy(r)}function vy(r,i,l){for(var d=(r.mode&1)!==0;ge!==null;){var p=ge,g=p.child;if(p.tag===22&&d){var _=p.memoizedState!==null||Kl;if(!_){var E=p.alternate,M=E!==null&&E.memoizedState!==null||Xt;E=Kl;var $=Xt;if(Kl=_,(Xt=M)&&!$)for(ge=p;ge!==null;)_=ge,M=_.child,_.tag===22&&_.memoizedState!==null?by(p):M!==null?(M.return=_,ge=M):by(p);for(;g!==null;)ge=g,vy(g),g=g.sibling;ge=p,Kl=E,Xt=$}ky(r)}else(p.subtreeFlags&8772)!==0&&g!==null?(g.return=p,ge=g):ky(r)}}function ky(r){for(;ge!==null;){var i=ge;if((i.flags&8772)!==0){var l=i.alternate;try{if((i.flags&8772)!==0)switch(i.tag){case 0:case 11:case 15:Xt||Gl(5,i);break;case 1:var d=i.stateNode;if(i.flags&4&&!Xt)if(l===null)d.componentDidMount();else{var p=i.elementType===i.type?l.memoizedProps:Xn(i.type,l.memoizedProps);d.componentDidUpdate(p,l.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var g=i.updateQueue;g!==null&&_g(i,g,d);break;case 3:var _=i.updateQueue;if(_!==null){if(l=null,i.child!==null)switch(i.child.tag){case 5:l=i.child.stateNode;break;case 1:l=i.child.stateNode}_g(i,_,l)}break;case 5:var E=i.stateNode;if(l===null&&i.flags&4){l=E;var M=i.memoizedProps;switch(i.type){case"button":case"input":case"select":case"textarea":M.autoFocus&&l.focus();break;case"img":M.src&&(l.src=M.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(i.memoizedState===null){var $=i.alternate;if($!==null){var ee=$.memoizedState;if(ee!==null){var ne=ee.dehydrated;ne!==null&&Oo(ne)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Xt||i.flags&512&&Zd(i)}catch(J){xt(i,i.return,J)}}if(i===r){ge=null;break}if(l=i.sibling,l!==null){l.return=i.return,ge=l;break}ge=i.return}}function _y(r){for(;ge!==null;){var i=ge;if(i===r){ge=null;break}var l=i.sibling;if(l!==null){l.return=i.return,ge=l;break}ge=i.return}}function by(r){for(;ge!==null;){var i=ge;try{switch(i.tag){case 0:case 11:case 15:var l=i.return;try{Gl(4,i)}catch(M){xt(i,l,M)}break;case 1:var d=i.stateNode;if(typeof d.componentDidMount=="function"){var p=i.return;try{d.componentDidMount()}catch(M){xt(i,p,M)}}var g=i.return;try{Zd(i)}catch(M){xt(i,g,M)}break;case 5:var _=i.return;try{Zd(i)}catch(M){xt(i,_,M)}}}catch(M){xt(i,i.return,M)}if(i===r){ge=null;break}var E=i.sibling;if(E!==null){E.return=i.return,ge=E;break}ge=i.return}}var oS=Math.ceil,ql=O.ReactCurrentDispatcher,Jd=O.ReactCurrentOwner,Dn=O.ReactCurrentBatchConfig,at=0,Ft=null,At=null,Wt=0,bn=0,Wi=da(0),It=0,is=null,qa=0,Yl=0,eh=0,os=null,mn=null,th=0,Ki=1/0,Br=null,Zl=!1,nh=null,ya=null,Xl=!1,va=null,Ql=0,ss=0,rh=null,Jl=-1,ec=0;function on(){return(at&6)!==0?rt():Jl!==-1?Jl:Jl=rt()}function ka(r){return(r.mode&1)===0?1:(at&2)!==0&&Wt!==0?Wt&-Wt:$P.transition!==null?(ec===0&&(ec=pm()),ec):(r=ct,r!==0||(r=window.event,r=r===void 0?16:xm(r.type)),r)}function er(r,i,l,d){if(50<ss)throw ss=0,rh=null,Error(n(185));Lo(r,l,d),((at&2)===0||r!==Ft)&&(r===Ft&&((at&2)===0&&(Yl|=l),It===4&&_a(r,Wt)),gn(r,d),l===1&&at===0&&(i.mode&1)===0&&(Ki=rt()+500,El&&fa()))}function gn(r,i){var l=r.callbackNode;$x(r,i);var d=Si(r,r===Ft?Wt:0);if(d===0)l!==null&&St(l),r.callbackNode=null,r.callbackPriority=0;else if(i=d&-d,r.callbackPriority!==i){if(l!=null&&St(l),i===1)r.tag===0?zP(xy.bind(null,r)):lg(xy.bind(null,r)),UP(function(){(at&6)===0&&fa()}),l=null;else{switch(mm(d)){case 1:l=Ar;break;case 4:l=qn;break;case 16:l=nn;break;case 536870912:l=ta;break;default:l=nn}l=Ly(l,wy.bind(null,r))}r.callbackPriority=i,r.callbackNode=l}}function wy(r,i){if(Jl=-1,ec=0,(at&6)!==0)throw Error(n(327));var l=r.callbackNode;if(Gi()&&r.callbackNode!==l)return null;var d=Si(r,r===Ft?Wt:0);if(d===0)return null;if((d&30)!==0||(d&r.expiredLanes)!==0||i)i=tc(r,d);else{i=d;var p=at;at|=2;var g=Sy();(Ft!==r||Wt!==i)&&(Br=null,Ki=rt()+500,Za(r,i));do try{cS();break}catch(E){Py(r,E)}while(!0);bd(),ql.current=g,at=p,At!==null?i=0:(Ft=null,Wt=0,i=It)}if(i!==0){if(i===2&&(p=ju(r),p!==0&&(d=p,i=ah(r,p))),i===1)throw l=is,Za(r,0),_a(r,d),gn(r,rt()),l;if(i===6)_a(r,d);else{if(p=r.current.alternate,(d&30)===0&&!sS(p)&&(i=tc(r,d),i===2&&(g=ju(r),g!==0&&(d=g,i=ah(r,g))),i===1))throw l=is,Za(r,0),_a(r,d),gn(r,rt()),l;switch(r.finishedWork=p,r.finishedLanes=d,i){case 0:case 1:throw Error(n(345));case 2:Xa(r,mn,Br);break;case 3:if(_a(r,d),(d&130023424)===d&&(i=th+500-rt(),10<i)){if(Si(r,0)!==0)break;if(p=r.suspendedLanes,(p&d)!==d){on(),r.pingedLanes|=r.suspendedLanes&p;break}r.timeoutHandle=ud(Xa.bind(null,r,mn,Br),i);break}Xa(r,mn,Br);break;case 4:if(_a(r,d),(d&4194240)===d)break;for(i=r.eventTimes,p=-1;0<d;){var _=31-He(d);g=1<<_,_=i[_],_>p&&(p=_),d&=~g}if(d=p,d=rt()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*oS(d/1960))-d,10<d){r.timeoutHandle=ud(Xa.bind(null,r,mn,Br),d);break}Xa(r,mn,Br);break;case 5:Xa(r,mn,Br);break;default:throw Error(n(329))}}}return gn(r,rt()),r.callbackNode===l?wy.bind(null,r):null}function ah(r,i){var l=os;return r.current.memoizedState.isDehydrated&&(Za(r,i).flags|=256),r=tc(r,i),r!==2&&(i=mn,mn=l,i!==null&&ih(i)),r}function ih(r){mn===null?mn=r:mn.push.apply(mn,r)}function sS(r){for(var i=r;;){if(i.flags&16384){var l=i.updateQueue;if(l!==null&&(l=l.stores,l!==null))for(var d=0;d<l.length;d++){var p=l[d],g=p.getSnapshot;p=p.value;try{if(!Yn(g(),p))return!1}catch{return!1}}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function _a(r,i){for(i&=~eh,i&=~Yl,r.suspendedLanes|=i,r.pingedLanes&=~i,r=r.expirationTimes;0<i;){var l=31-He(i),d=1<<l;r[l]=-1,i&=~d}}function xy(r){if((at&6)!==0)throw Error(n(327));Gi();var i=Si(r,0);if((i&1)===0)return gn(r,rt()),null;var l=tc(r,i);if(r.tag!==0&&l===2){var d=ju(r);d!==0&&(i=d,l=ah(r,d))}if(l===1)throw l=is,Za(r,0),_a(r,i),gn(r,rt()),l;if(l===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=i,Xa(r,mn,Br),gn(r,rt()),null}function oh(r,i){var l=at;at|=1;try{return r(i)}finally{at=l,at===0&&(Ki=rt()+500,El&&fa())}}function Ya(r){va!==null&&va.tag===0&&(at&6)===0&&Gi();var i=at;at|=1;var l=Dn.transition,d=ct;try{if(Dn.transition=null,ct=1,r)return r()}finally{ct=d,Dn.transition=l,at=i,(at&6)===0&&fa()}}function sh(){bn=Wi.current,gt(Wi)}function Za(r,i){r.finishedWork=null,r.finishedLanes=0;var l=r.timeoutHandle;if(l!==-1&&(r.timeoutHandle=-1,jP(l)),At!==null)for(l=At.return;l!==null;){var d=l;switch(gd(d),d.tag){case 1:d=d.type.childContextTypes,d!=null&&Cl();break;case 3:zi(),gt(hn),gt(qt),Ad();break;case 5:Td(d);break;case 4:zi();break;case 13:gt(bt);break;case 19:gt(bt);break;case 10:wd(d.type._context);break;case 22:case 23:sh()}l=l.return}if(Ft=r,At=r=ba(r.current,null),Wt=bn=i,It=0,is=null,eh=Yl=qa=0,mn=os=null,Wa!==null){for(i=0;i<Wa.length;i++)if(l=Wa[i],d=l.interleaved,d!==null){l.interleaved=null;var p=d.next,g=l.pending;if(g!==null){var _=g.next;g.next=p,d.next=_}l.pending=d}Wa=null}return r}function Py(r,i){do{var l=At;try{if(bd(),Ul.current=zl,Bl){for(var d=wt.memoizedState;d!==null;){var p=d.queue;p!==null&&(p.pending=null),d=d.next}Bl=!1}if(Ga=0,Bt=Mt=wt=null,Jo=!1,es=0,Jd.current=null,l===null||l.return===null){It=1,is=i,At=null;break}e:{var g=r,_=l.return,E=l,M=i;if(i=Wt,E.flags|=32768,M!==null&&typeof M=="object"&&typeof M.then=="function"){var $=M,ee=E,ne=ee.tag;if((ee.mode&1)===0&&(ne===0||ne===11||ne===15)){var J=ee.alternate;J?(ee.updateQueue=J.updateQueue,ee.memoizedState=J.memoizedState,ee.lanes=J.lanes):(ee.updateQueue=null,ee.memoizedState=null)}var ue=Yg(_);if(ue!==null){ue.flags&=-257,Zg(ue,_,E,g,i),ue.mode&1&&qg(g,$,i),i=ue,M=$;var ve=i.updateQueue;if(ve===null){var we=new Set;we.add(M),i.updateQueue=we}else ve.add(M);break e}else{if((i&1)===0){qg(g,$,i),lh();break e}M=Error(n(426))}}else if(kt&&E.mode&1){var Ct=Yg(_);if(Ct!==null){(Ct.flags&65536)===0&&(Ct.flags|=256),Zg(Ct,_,E,g,i),kd($i(M,E));break e}}g=M=$i(M,E),It!==4&&(It=2),os===null?os=[g]:os.push(g),g=_;do{switch(g.tag){case 3:g.flags|=65536,i&=-i,g.lanes|=i;var B=Kg(g,M,i);kg(g,B);break e;case 1:E=M;var j=g.type,F=g.stateNode;if((g.flags&128)===0&&(typeof j.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(ya===null||!ya.has(F)))){g.flags|=65536,i&=-i,g.lanes|=i;var oe=Gg(g,E,i);kg(g,oe);break e}}g=g.return}while(g!==null)}Ty(l)}catch(Se){i=Se,At===l&&l!==null&&(At=l=l.return);continue}break}while(!0)}function Sy(){var r=ql.current;return ql.current=zl,r===null?zl:r}function lh(){(It===0||It===3||It===2)&&(It=4),Ft===null||(qa&268435455)===0&&(Yl&268435455)===0||_a(Ft,Wt)}function tc(r,i){var l=at;at|=2;var d=Sy();(Ft!==r||Wt!==i)&&(Br=null,Za(r,i));do try{lS();break}catch(p){Py(r,p)}while(!0);if(bd(),at=l,ql.current=d,At!==null)throw Error(n(261));return Ft=null,Wt=0,It}function lS(){for(;At!==null;)Cy(At)}function cS(){for(;At!==null&&!$t();)Cy(At)}function Cy(r){var i=Ry(r.alternate,r,bn);r.memoizedProps=r.pendingProps,i===null?Ty(r):At=i,Jd.current=null}function Ty(r){var i=r;do{var l=i.alternate;if(r=i.return,(i.flags&32768)===0){if(l=tS(l,i,bn),l!==null){At=l;return}}else{if(l=nS(l,i),l!==null){l.flags&=32767,At=l;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{It=6,At=null;return}}if(i=i.sibling,i!==null){At=i;return}At=i=r}while(i!==null);It===0&&(It=5)}function Xa(r,i,l){var d=ct,p=Dn.transition;try{Dn.transition=null,ct=1,uS(r,i,l,d)}finally{Dn.transition=p,ct=d}return null}function uS(r,i,l,d){do Gi();while(va!==null);if((at&6)!==0)throw Error(n(327));l=r.finishedWork;var p=r.finishedLanes;if(l===null)return null;if(r.finishedWork=null,r.finishedLanes=0,l===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var g=l.lanes|l.childLanes;if(Hx(r,g),r===Ft&&(At=Ft=null,Wt=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||Xl||(Xl=!0,Ly(nn,function(){return Gi(),null})),g=(l.flags&15990)!==0,(l.subtreeFlags&15990)!==0||g){g=Dn.transition,Dn.transition=null;var _=ct;ct=1;var E=at;at|=4,Jd.current=null,aS(r,l),yy(l,r),RP(ld),hl=!!sd,ld=sd=null,r.current=l,iS(l),lt(),at=E,ct=_,Dn.transition=g}else r.current=l;if(Xl&&(Xl=!1,va=r,Ql=p),g=r.pendingLanes,g===0&&(ya=null),Pi(l.stateNode),gn(r,rt()),i!==null)for(d=r.onRecoverableError,l=0;l<i.length;l++)p=i[l],d(p.value,{componentStack:p.stack,digest:p.digest});if(Zl)throw Zl=!1,r=nh,nh=null,r;return(Ql&1)!==0&&r.tag!==0&&Gi(),g=r.pendingLanes,(g&1)!==0?r===rh?ss++:(ss=0,rh=r):ss=0,fa(),null}function Gi(){if(va!==null){var r=mm(Ql),i=Dn.transition,l=ct;try{if(Dn.transition=null,ct=16>r?16:r,va===null)var d=!1;else{if(r=va,va=null,Ql=0,(at&6)!==0)throw Error(n(331));var p=at;for(at|=4,ge=r.current;ge!==null;){var g=ge,_=g.child;if((ge.flags&16)!==0){var E=g.deletions;if(E!==null){for(var M=0;M<E.length;M++){var $=E[M];for(ge=$;ge!==null;){var ee=ge;switch(ee.tag){case 0:case 11:case 15:as(8,ee,g)}var ne=ee.child;if(ne!==null)ne.return=ee,ge=ne;else for(;ge!==null;){ee=ge;var J=ee.sibling,ue=ee.return;if(hy(ee),ee===$){ge=null;break}if(J!==null){J.return=ue,ge=J;break}ge=ue}}}var ve=g.alternate;if(ve!==null){var we=ve.child;if(we!==null){ve.child=null;do{var Ct=we.sibling;we.sibling=null,we=Ct}while(we!==null)}}ge=g}}if((g.subtreeFlags&2064)!==0&&_!==null)_.return=g,ge=_;else e:for(;ge!==null;){if(g=ge,(g.flags&2048)!==0)switch(g.tag){case 0:case 11:case 15:as(9,g,g.return)}var B=g.sibling;if(B!==null){B.return=g.return,ge=B;break e}ge=g.return}}var j=r.current;for(ge=j;ge!==null;){_=ge;var F=_.child;if((_.subtreeFlags&2064)!==0&&F!==null)F.return=_,ge=F;else e:for(_=j;ge!==null;){if(E=ge,(E.flags&2048)!==0)try{switch(E.tag){case 0:case 11:case 15:Gl(9,E)}}catch(Se){xt(E,E.return,Se)}if(E===_){ge=null;break e}var oe=E.sibling;if(oe!==null){oe.return=E.return,ge=oe;break e}ge=E.return}}if(at=p,fa(),rn&&typeof rn.onPostCommitFiberRoot=="function")try{rn.onPostCommitFiberRoot(Tn,r)}catch{}d=!0}return d}finally{ct=l,Dn.transition=i}}return!1}function Ey(r,i,l){i=$i(l,i),i=Kg(r,i,1),r=ma(r,i,1),i=on(),r!==null&&(Lo(r,1,i),gn(r,i))}function xt(r,i,l){if(r.tag===3)Ey(r,r,l);else for(;i!==null;){if(i.tag===3){Ey(i,r,l);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(ya===null||!ya.has(d))){r=$i(l,r),r=Gg(i,r,1),i=ma(i,r,1),r=on(),i!==null&&(Lo(i,1,r),gn(i,r));break}}i=i.return}}function dS(r,i,l){var d=r.pingCache;d!==null&&d.delete(i),i=on(),r.pingedLanes|=r.suspendedLanes&l,Ft===r&&(Wt&l)===l&&(It===4||It===3&&(Wt&130023424)===Wt&&500>rt()-th?Za(r,0):eh|=l),gn(r,i)}function Ay(r,i){i===0&&((r.mode&1)===0?i=1:(i=Lr,Lr<<=1,(Lr&130023424)===0&&(Lr=4194304)));var l=on();r=Or(r,i),r!==null&&(Lo(r,i,l),gn(r,l))}function hS(r){var i=r.memoizedState,l=0;i!==null&&(l=i.retryLane),Ay(r,l)}function fS(r,i){var l=0;switch(r.tag){case 13:var d=r.stateNode,p=r.memoizedState;p!==null&&(l=p.retryLane);break;case 19:d=r.stateNode;break;default:throw Error(n(314))}d!==null&&d.delete(i),Ay(r,l)}var Ry;Ry=function(r,i,l){if(r!==null)if(r.memoizedProps!==i.pendingProps||hn.current)pn=!0;else{if((r.lanes&l)===0&&(i.flags&128)===0)return pn=!1,eS(r,i,l);pn=(r.flags&131072)!==0}else pn=!1,kt&&(i.flags&1048576)!==0&&cg(i,Rl,i.index);switch(i.lanes=0,i.tag){case 2:var d=i.type;Wl(r,i),r=i.pendingProps;var p=Ni(i,qt.current);Vi(i,l),p=Dd(null,i,d,r,p,l);var g=Md();return i.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(i.tag=1,i.memoizedState=null,i.updateQueue=null,fn(d)?(g=!0,Tl(i)):g=!1,i.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,Sd(i),p.updater=$l,i.stateNode=p,p._reactInternals=i,Bd(i,d,r,l),i=$d(null,i,d,!0,g,l)):(i.tag=0,kt&&g&&md(i),an(null,i,p,l),i=i.child),i;case 16:d=i.elementType;e:{switch(Wl(r,i),r=i.pendingProps,p=d._init,d=p(d._payload),i.type=d,p=i.tag=mS(d),r=Xn(d,r),p){case 0:i=zd(null,i,d,r,l);break e;case 1:i=ny(null,i,d,r,l);break e;case 11:i=Xg(null,i,d,r,l);break e;case 14:i=Qg(null,i,d,Xn(d.type,r),l);break e}throw Error(n(306,d,""))}return i;case 0:return d=i.type,p=i.pendingProps,p=i.elementType===d?p:Xn(d,p),zd(r,i,d,p,l);case 1:return d=i.type,p=i.pendingProps,p=i.elementType===d?p:Xn(d,p),ny(r,i,d,p,l);case 3:e:{if(ry(i),r===null)throw Error(n(387));d=i.pendingProps,g=i.memoizedState,p=g.element,vg(r,i),Ol(i,d,null,l);var _=i.memoizedState;if(d=_.element,g.isDehydrated)if(g={element:d,isDehydrated:!1,cache:_.cache,pendingSuspenseBoundaries:_.pendingSuspenseBoundaries,transitions:_.transitions},i.updateQueue.baseState=g,i.memoizedState=g,i.flags&256){p=$i(Error(n(423)),i),i=ay(r,i,d,l,p);break e}else if(d!==p){p=$i(Error(n(424)),i),i=ay(r,i,d,l,p);break e}else for(_n=ua(i.stateNode.containerInfo.firstChild),kn=i,kt=!0,Zn=null,l=gg(i,null,d,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Ui(),d===p){i=Ur(r,i,l);break e}an(r,i,d,l)}i=i.child}return i;case 5:return bg(i),r===null&&vd(i),d=i.type,p=i.pendingProps,g=r!==null?r.memoizedProps:null,_=p.children,cd(d,p)?_=null:g!==null&&cd(d,g)&&(i.flags|=32),ty(r,i),an(r,i,_,l),i.child;case 6:return r===null&&vd(i),null;case 13:return iy(r,i,l);case 4:return Cd(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=Bi(i,null,d,l):an(r,i,d,l),i.child;case 11:return d=i.type,p=i.pendingProps,p=i.elementType===d?p:Xn(d,p),Xg(r,i,d,p,l);case 7:return an(r,i,i.pendingProps,l),i.child;case 8:return an(r,i,i.pendingProps.children,l),i.child;case 12:return an(r,i,i.pendingProps.children,l),i.child;case 10:e:{if(d=i.type._context,p=i.pendingProps,g=i.memoizedProps,_=p.value,ft(Ml,d._currentValue),d._currentValue=_,g!==null)if(Yn(g.value,_)){if(g.children===p.children&&!hn.current){i=Ur(r,i,l);break e}}else for(g=i.child,g!==null&&(g.return=i);g!==null;){var E=g.dependencies;if(E!==null){_=g.child;for(var M=E.firstContext;M!==null;){if(M.context===d){if(g.tag===1){M=jr(-1,l&-l),M.tag=2;var $=g.updateQueue;if($!==null){$=$.shared;var ee=$.pending;ee===null?M.next=M:(M.next=ee.next,ee.next=M),$.pending=M}}g.lanes|=l,M=g.alternate,M!==null&&(M.lanes|=l),xd(g.return,l,i),E.lanes|=l;break}M=M.next}}else if(g.tag===10)_=g.type===i.type?null:g.child;else if(g.tag===18){if(_=g.return,_===null)throw Error(n(341));_.lanes|=l,E=_.alternate,E!==null&&(E.lanes|=l),xd(_,l,i),_=g.sibling}else _=g.child;if(_!==null)_.return=g;else for(_=g;_!==null;){if(_===i){_=null;break}if(g=_.sibling,g!==null){g.return=_.return,_=g;break}_=_.return}g=_}an(r,i,p.children,l),i=i.child}return i;case 9:return p=i.type,d=i.pendingProps.children,Vi(i,l),p=Rn(p),d=d(p),i.flags|=1,an(r,i,d,l),i.child;case 14:return d=i.type,p=Xn(d,i.pendingProps),p=Xn(d.type,p),Qg(r,i,d,p,l);case 15:return Jg(r,i,i.type,i.pendingProps,l);case 17:return d=i.type,p=i.pendingProps,p=i.elementType===d?p:Xn(d,p),Wl(r,i),i.tag=1,fn(d)?(r=!0,Tl(i)):r=!1,Vi(i,l),Hg(i,d,p),Bd(i,d,p,l),$d(null,i,d,!0,r,l);case 19:return sy(r,i,l);case 22:return ey(r,i,l)}throw Error(n(156,i.tag))};function Ly(r,i){return ht(r,i)}function pS(r,i,l,d){this.tag=r,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mn(r,i,l,d){return new pS(r,i,l,d)}function ch(r){return r=r.prototype,!(!r||!r.isReactComponent)}function mS(r){if(typeof r=="function")return ch(r)?1:0;if(r!=null){if(r=r.$$typeof,r===se)return 11;if(r===le)return 14}return 2}function ba(r,i){var l=r.alternate;return l===null?(l=Mn(r.tag,i,r.key,r.mode),l.elementType=r.elementType,l.type=r.type,l.stateNode=r.stateNode,l.alternate=r,r.alternate=l):(l.pendingProps=i,l.type=r.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=r.flags&14680064,l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,i=r.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=r.sibling,l.index=r.index,l.ref=r.ref,l}function nc(r,i,l,d,p,g){var _=2;if(d=r,typeof r=="function")ch(r)&&(_=1);else if(typeof r=="string")_=5;else e:switch(r){case z:return Qa(l.children,p,g,i);case P:_=8,p|=8;break;case Y:return r=Mn(12,l,i,p|2),r.elementType=Y,r.lanes=g,r;case Ae:return r=Mn(13,l,i,p),r.elementType=Ae,r.lanes=g,r;case fe:return r=Mn(19,l,i,p),r.elementType=fe,r.lanes=g,r;case Ne:return rc(l,p,g,i);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case X:_=10;break e;case de:_=9;break e;case se:_=11;break e;case le:_=14;break e;case pe:_=16,d=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return i=Mn(_,l,i,p),i.elementType=r,i.type=d,i.lanes=g,i}function Qa(r,i,l,d){return r=Mn(7,r,d,i),r.lanes=l,r}function rc(r,i,l,d){return r=Mn(22,r,d,i),r.elementType=Ne,r.lanes=l,r.stateNode={isHidden:!1},r}function uh(r,i,l){return r=Mn(6,r,null,i),r.lanes=l,r}function dh(r,i,l){return i=Mn(4,r.children!==null?r.children:[],r.key,i),i.lanes=l,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}function gS(r,i,l,d,p){this.tag=i,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Uu(0),this.expirationTimes=Uu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Uu(0),this.identifierPrefix=d,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function hh(r,i,l,d,p,g,_,E,M){return r=new gS(r,i,l,E,M),i===1?(i=1,g===!0&&(i|=8)):i=0,g=Mn(3,null,null,i),r.current=g,g.stateNode=r,g.memoizedState={element:d,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sd(g),r}function yS(r,i,l){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:W,key:d==null?null:""+d,children:r,containerInfo:i,implementation:l}}function Dy(r){if(!r)return ha;r=r._reactInternals;e:{if(he(r)!==r||r.tag!==1)throw Error(n(170));var i=r;do{switch(i.tag){case 3:i=i.stateNode.context;break e;case 1:if(fn(i.type)){i=i.stateNode.__reactInternalMemoizedMergedChildContext;break e}}i=i.return}while(i!==null);throw Error(n(171))}if(r.tag===1){var l=r.type;if(fn(l))return og(r,l,i)}return i}function My(r,i,l,d,p,g,_,E,M){return r=hh(l,d,!0,r,p,g,_,E,M),r.context=Dy(null),l=r.current,d=on(),p=ka(l),g=jr(d,p),g.callback=i??null,ma(l,g,p),r.current.lanes=p,Lo(r,p,d),gn(r,d),r}function ac(r,i,l,d){var p=i.current,g=on(),_=ka(p);return l=Dy(l),i.context===null?i.context=l:i.pendingContext=l,i=jr(g,_),i.payload={element:r},d=d===void 0?null:d,d!==null&&(i.callback=d),r=ma(p,i,_),r!==null&&(er(r,p,_,g),Nl(r,p,_)),_}function ic(r){return r=r.current,r.child?(r.child.tag===5,r.child.stateNode):null}function Iy(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<i?l:i}}function fh(r,i){Iy(r,i),(r=r.alternate)&&Iy(r,i)}function vS(){return null}var Ny=typeof reportError=="function"?reportError:function(r){console.error(r)};function ph(r){this._internalRoot=r}oc.prototype.render=ph.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(n(409));ac(r,i,null,null)},oc.prototype.unmount=ph.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;Ya(function(){ac(null,r,null,null)}),i[Dr]=null}};function oc(r){this._internalRoot=r}oc.prototype.unstable_scheduleHydration=function(r){if(r){var i=vm();r={blockedOn:null,target:r,priority:i};for(var l=0;l<sa.length&&i!==0&&i<sa[l].priority;l++);sa.splice(l,0,r),l===0&&bm(r)}};function mh(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function sc(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Oy(){}function kS(r,i,l,d,p){if(p){if(typeof d=="function"){var g=d;d=function(){var $=ic(_);g.call($)}}var _=My(i,d,r,0,null,!1,!1,"",Oy);return r._reactRootContainer=_,r[Dr]=_.current,Wo(r.nodeType===8?r.parentNode:r),Ya(),_}for(;p=r.lastChild;)r.removeChild(p);if(typeof d=="function"){var E=d;d=function(){var $=ic(M);E.call($)}}var M=hh(r,0,!1,null,null,!1,!1,"",Oy);return r._reactRootContainer=M,r[Dr]=M.current,Wo(r.nodeType===8?r.parentNode:r),Ya(function(){ac(i,M,l,d)}),M}function lc(r,i,l,d,p){var g=l._reactRootContainer;if(g){var _=g;if(typeof p=="function"){var E=p;p=function(){var M=ic(_);E.call(M)}}ac(i,_,r,p)}else _=kS(l,i,r,p,d);return ic(_)}gm=function(r){switch(r.tag){case 3:var i=r.stateNode;if(i.current.memoizedState.isDehydrated){var l=ra(i.pendingLanes);l!==0&&(Bu(i,l|1),gn(i,rt()),(at&6)===0&&(Ki=rt()+500,fa()))}break;case 13:Ya(function(){var d=Or(r,1);if(d!==null){var p=on();er(d,r,1,p)}}),fh(r,1)}},Fu=function(r){if(r.tag===13){var i=Or(r,134217728);if(i!==null){var l=on();er(i,r,134217728,l)}fh(r,134217728)}},ym=function(r){if(r.tag===13){var i=ka(r),l=Or(r,i);if(l!==null){var d=on();er(l,r,i,d)}fh(r,i)}},vm=function(){return ct},km=function(r,i){var l=ct;try{return ct=r,i()}finally{ct=l}},wi=function(r,i,l){switch(i){case"input":if(Wn(r,l),i=l.name,l.type==="radio"&&i!=null){for(l=r;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),i=0;i<l.length;i++){var d=l[i];if(d!==r&&d.form===r.form){var p=Sl(d);if(!p)throw Error(n(90));Cr(d),Wn(d,p)}}}break;case"textarea":ol(r,l);break;case"select":i=l.value,i!=null&&Yr(r,!!l.multiple,i,!1)}},cl=oh,Eo=Ya;var _S={usingClientEntryPoint:!1,Events:[qo,Mi,Sl,ll,To,oh]},ls={findFiberByHostInstance:Va,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},bS={bundleType:ls.bundleType,version:ls.version,rendererPackageName:ls.rendererPackageName,rendererConfig:ls.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:O.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=ot(r),r===null?null:r.stateNode},findFiberByHostInstance:ls.findFiberByHostInstance||vS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var cc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cc.isDisabled&&cc.supportsFiber)try{Tn=cc.inject(bS),rn=cc}catch{}}return yn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_S,yn.createPortal=function(r,i){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!mh(i))throw Error(n(200));return yS(r,i,null,l)},yn.createRoot=function(r,i){if(!mh(r))throw Error(n(299));var l=!1,d="",p=Ny;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onRecoverableError!==void 0&&(p=i.onRecoverableError)),i=hh(r,1,!1,null,null,l,!1,d,p),r[Dr]=i.current,Wo(r.nodeType===8?r.parentNode:r),new ph(i)},yn.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=ot(i),r=r===null?null:r.stateNode,r},yn.flushSync=function(r){return Ya(r)},yn.hydrate=function(r,i,l){if(!sc(i))throw Error(n(200));return lc(null,r,i,!0,l)},yn.hydrateRoot=function(r,i,l){if(!mh(r))throw Error(n(405));var d=l!=null&&l.hydratedSources||null,p=!1,g="",_=Ny;if(l!=null&&(l.unstable_strictMode===!0&&(p=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onRecoverableError!==void 0&&(_=l.onRecoverableError)),i=My(i,null,r,1,l??null,p,!1,g,_),r[Dr]=i.current,Wo(r),d)for(r=0;r<d.length;r++)l=d[r],p=l._getVersion,p=p(l._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[l,p]:i.mutableSourceEagerHydrationData.push(l,p);return new oc(i)},yn.render=function(r,i,l){if(!sc(i))throw Error(n(200));return lc(null,r,i,!1,l)},yn.unmountComponentAtNode=function(r){if(!sc(r))throw Error(n(40));return r._reactRootContainer?(Ya(function(){lc(null,null,r,!1,function(){r._reactRootContainer=null,r[Dr]=null})}),!0):!1},yn.unstable_batchedUpdates=oh,yn.unstable_renderSubtreeIntoContainer=function(r,i,l,d){if(!sc(l))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return lc(r,i,l,!1,d)},yn.version="18.3.1-next-f1338f8080-20240426",yn}var Hy;function D_(){if(Hy)return vh.exports;Hy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),vh.exports=LS(),vh.exports}var Wy;function DS(){if(Wy)return uc;Wy=1;var e=D_();return uc.createRoot=e.createRoot,uc.hydrateRoot=e.hydrateRoot,uc}var MS=DS();var M_=e=>{throw TypeError(e)},IS=(e,t,n)=>t.has(e)||M_("Cannot "+n),bh=(e,t,n)=>(IS(e,t,"read from private field"),n?n.call(e):t.get(e)),NS=(e,t,n)=>t.has(e)?M_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ky="popstate";function Gy(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function OS(e={}){function t(a,o){let s=o.state?.masked,{pathname:c,search:u,hash:h}=s||a.location;return Ls("",{pathname:c,search:u,hash:h},o.state&&o.state.usr||null,o.state&&o.state.key||"default",s?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function n(a,o){return typeof o=="string"?o:kr(o)}return US(t,n,null,e)}function Xe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Et(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function jS(){return Math.random().toString(36).substring(2,10)}function qy(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Ls(e,t,n=null,a,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Kr(t):t,state:n,key:t&&t.key||a||jS(),unstable_mask:o}}function kr({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Kr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function US(e,t,n,a={}){let{window:o=document.defaultView,v5Compat:s=!1}=a,c=o.history,u="POP",h=null,f=m();f==null&&(f=0,c.replaceState({...c.state,idx:f},""));function m(){return(c.state||{idx:null}).idx}function y(){u="POP";let S=m(),D=S==null?null:S-f;f=S,h&&h({action:u,location:C.location,delta:D})}function k(S,D){u="PUSH";let L=Gy(S)?S:Ls(C.location,S,D);f=m()+1;let R=qy(L,f),O=C.createHref(L.unstable_mask||L);try{c.pushState(R,"",O)}catch(G){if(G instanceof DOMException&&G.name==="DataCloneError")throw G;o.location.assign(O)}s&&h&&h({action:u,location:C.location,delta:1})}function w(S,D){u="REPLACE";let L=Gy(S)?S:Ls(C.location,S,D);f=m();let R=qy(L,f),O=C.createHref(L.unstable_mask||L);c.replaceState(R,"",O),s&&h&&h({action:u,location:C.location,delta:0})}function x(S){return I_(S)}let C={get action(){return u},get location(){return e(o,c)},listen(S){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(Ky,y),h=S,()=>{o.removeEventListener(Ky,y),h=null}},createHref(S){return t(o,S)},createURL:x,encodeLocation(S){let D=x(S);return{pathname:D.pathname,search:D.search,hash:D.hash}},push:k,replace:w,go(S){return c.go(S)}};return C}function I_(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Xe(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:kr(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}var gs,Yy=class{constructor(e){if(NS(this,gs,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(bh(this,gs).has(e))return bh(this,gs).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){bh(this,gs).set(e,t)}};gs=new WeakMap;var BS=new Set(["lazy","caseSensitive","path","id","index","children"]);function FS(e){return BS.has(e)}var VS=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function zS(e){return VS.has(e)}function $S(e){return e.index===!0}function Ds(e,t,n=[],a={},o=!1){return e.map((s,c)=>{let u=[...n,String(c)],h=typeof s.id=="string"?s.id:u.join("-");if(Xe(s.index!==!0||!s.children,"Cannot specify children on an index route"),Xe(o||!a[h],`Found a route id collision on id "${h}". Route id's must be globally unique within Data Router usages`),$S(s)){let f={...s,id:h};return a[h]=Zy(f,t(f)),f}else{let f={...s,id:h,children:void 0};return a[h]=Zy(f,t(f)),s.children&&(f.children=Ds(s.children,t,u,a,o)),f}})}function Zy(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ta(e,t,n="/"){return ys(e,t,n,!1)}function ys(e,t,n,a){let o=typeof t=="string"?Kr(t):t,s=Un(o.pathname||"/",n);if(s==null)return null;let c=N_(e);WS(c);let u=null;for(let h=0;u==null&&h<c.length;++h){let f=nC(s);u=eC(c[h],f,a)}return u}function HS(e,t){let{route:n,pathname:a,params:o}=e;return{id:n.id,pathname:a,params:o,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function N_(e,t=[],n=[],a="",o=!1){let s=(c,u,h=o,f)=>{let m={relativePath:f===void 0?c.path||"":f,caseSensitive:c.caseSensitive===!0,childrenIndex:u,route:c};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(a)&&h)return;Xe(m.relativePath.startsWith(a),`Absolute route path "${m.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(a.length)}let y=ir([a,m.relativePath]),k=n.concat(m);c.children&&c.children.length>0&&(Xe(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),N_(c.children,t,k,y,h)),!(c.path==null&&!c.index)&&t.push({path:y,score:QS(y,c.index),routesMeta:k})};return e.forEach((c,u)=>{if(c.path===""||!c.path?.includes("?"))s(c,u);else for(let h of O_(c.path))s(c,u,!0,h)}),t}function O_(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,o=n.endsWith("?"),s=n.replace(/\?$/,"");if(a.length===0)return o?[s,""]:[s];let c=O_(a.join("/")),u=[];return u.push(...c.map(h=>h===""?s:[s,h].join("/"))),o&&u.push(...c),u.map(h=>e.startsWith("/")&&h===""?"/":h)}function WS(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:JS(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var KS=/^:[\w-]+$/,GS=3,qS=2,YS=1,ZS=10,XS=-2,Xy=e=>e==="*";function QS(e,t){let n=e.split("/"),a=n.length;return n.some(Xy)&&(a+=XS),t&&(a+=qS),n.filter(o=>!Xy(o)).reduce((o,s)=>o+(KS.test(s)?GS:s===""?YS:ZS),a)}function JS(e,t){return e.length===t.length&&e.slice(0,-1).every((a,o)=>a===t[o])?e[e.length-1]-t[t.length-1]:0}function eC(e,t,n=!1){let{routesMeta:a}=e,o={},s="/",c=[];for(let u=0;u<a.length;++u){let h=a[u],f=u===a.length-1,m=s==="/"?t:t.slice(s.length)||"/",y=Kc({path:h.relativePath,caseSensitive:h.caseSensitive,end:f},m),k=h.route;if(!y&&f&&n&&!a[a.length-1].route.index&&(y=Kc({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},m)),!y)return null;Object.assign(o,y.params),c.push({params:o,pathname:ir([s,y.pathname]),pathnameBase:iC(ir([s,y.pathnameBase])),route:k}),y.pathnameBase!=="/"&&(s=ir([s,y.pathnameBase]))}return c}function Kc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=tC(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let s=o[0],c=s.replace(/(.)\/+$/,"$1"),u=o.slice(1);return{params:a.reduce((f,{paramName:m,isOptional:y},k)=>{if(m==="*"){let x=u[k]||"";c=s.slice(0,s.length-x.length).replace(/(.)\/+$/,"$1")}const w=u[k];return y&&!w?f[m]=void 0:f[m]=(w||"").replace(/%2F/g,"/"),f},{}),pathname:s,pathnameBase:c,pattern:e}}function tC(e,t=!1,n=!0){Et(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,u,h,f,m)=>{if(a.push({paramName:u,isOptional:h!=null}),h){let y=m.charAt(f+c.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),a]}function nC(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Et(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Un(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}function rC({basename:e,pathname:t}){return t==="/"?e:ir([e,t])}var j_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jf=e=>j_.test(e);function aC(e,t="/"){let{pathname:n,search:a="",hash:o=""}=typeof e=="string"?Kr(e):e,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=Qy(n.substring(1),"/"):s=Qy(n,t)):s=t,{pathname:s,search:oC(a),hash:sC(o)}}function Qy(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function wh(e,t,n,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function U_(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ep(e){let t=U_(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function _u(e,t,n,a=!1){let o;typeof e=="string"?o=Kr(e):(o={...e},Xe(!o.pathname||!o.pathname.includes("?"),wh("?","pathname","search",o)),Xe(!o.pathname||!o.pathname.includes("#"),wh("#","pathname","hash",o)),Xe(!o.search||!o.search.includes("#"),wh("#","search","hash",o)));let s=e===""||o.pathname==="",c=s?"/":o.pathname,u;if(c==null)u=n;else{let y=t.length-1;if(!a&&c.startsWith("..")){let k=c.split("/");for(;k[0]==="..";)k.shift(),y-=1;o.pathname=k.join("/")}u=y>=0?t[y]:"/"}let h=aC(o,u),f=c&&c!=="/"&&c.endsWith("/"),m=(s||c===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(f||m)&&(h.pathname+="/"),h}var ir=e=>e.join("/").replace(/\/\/+/g,"/"),iC=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),oC=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,sC=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Vs=class{constructor(e,t,n,a=!1){this.status=e,this.statusText=t||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Ms(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function zs(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var B_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function F_(e,t){let n=e;if(typeof n!="string"||!j_.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,o=!1;if(B_)try{let s=new URL(window.location.href),c=n.startsWith("//")?new URL(s.protocol+n):new URL(n),u=Un(c.pathname,t);c.origin===s.origin&&u!=null?n=u+c.search+c.hash:o=!0}catch{Et(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:o,to:n}}var Ra=Symbol("Uninstrumented");function lC(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:t.id,index:t.index,path:t.path,instrument(s){let c=Object.keys(n);for(let u of c)s[u]&&n[u].push(s[u])}}));let a={};if(typeof t.lazy=="function"&&n.lazy.length>0){let o=no(n.lazy,t.lazy,()=>{});o&&(a.lazy=o)}if(typeof t.lazy=="object"){let o=t.lazy;["middleware","loader","action"].forEach(s=>{let c=o[s],u=n[`lazy.${s}`];if(typeof c=="function"&&u.length>0){let h=no(u,c,()=>{});h&&(a.lazy=Object.assign(a.lazy||{},{[s]:h}))}})}return["loader","action"].forEach(o=>{let s=t[o];if(typeof s=="function"&&n[o].length>0){let c=s[Ra]??s,u=no(n[o],c,(...h)=>Jy(h[0]));u&&(o==="loader"&&c.hydrate===!0&&(u.hydrate=!0),u[Ra]=c,a[o]=u)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(a.middleware=t.middleware.map(o=>{let s=o[Ra]??o,c=no(n.middleware,s,(...u)=>Jy(u[0]));return c?(c[Ra]=s,c):o})),a}function cC(e,t){let n={navigate:[],fetch:[]};if(t.forEach(a=>a({instrument(o){let s=Object.keys(o);for(let c of s)o[c]&&n[c].push(o[c])}})),n.navigate.length>0){let a=e.navigate[Ra]??e.navigate,o=no(n.navigate,a,(...s)=>{let[c,u]=s;return{to:typeof c=="number"||typeof c=="string"?c:c?kr(c):".",...ev(e,u??{})}});o&&(o[Ra]=a,e.navigate=o)}if(n.fetch.length>0){let a=e.fetch[Ra]??e.fetch,o=no(n.fetch,a,(...s)=>{let[c,,u,h]=s;return{href:u??".",fetcherKey:c,...ev(e,h??{})}});o&&(o[Ra]=a,e.fetch=o)}return e}function no(e,t,n){return e.length===0?null:async(...a)=>{let o=await V_(e,n(...a),()=>t(...a),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function V_(e,t,n,a){let o=e[a],s;if(o){let c,u=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=V_(e,t,n,a-1),s=await c,Xe(s,"Expected a result"),s.type==="error"&&s.value instanceof Error?{status:"error",error:s.value}:{status:"success",error:void 0});try{await o(u,t)}catch(h){console.error("An instrumentation function threw an error:",h)}c||await u(),await c}else try{s={type:"success",value:await n()}}catch(c){s={type:"error",value:c}}return s||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Jy(e){let{request:t,context:n,params:a,unstable_pattern:o}=e;return{request:uC(t),params:{...a},unstable_pattern:o,context:dC(n)}}function ev(e,t){return{currentUrl:kr(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function uC(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function dC(e){if(fC(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var hC=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function fC(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===hC}var z_=["POST","PUT","PATCH","DELETE"],pC=new Set(z_),mC=["GET",...z_],gC=new Set(mC),$_=new Set([301,302,303,307,308]),yC=new Set([307,308]),xh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},vC={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},us={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},kC=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),H_="remix-router-transitions",W_=Symbol("ResetLoaderData");function _C(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";Xe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],o=e.mapRouteProperties||kC,s=o;if(e.unstable_instrumentations){let A=e.unstable_instrumentations;s=U=>({...o(U),...lC(A.map(V=>V.route).filter(Boolean),U)})}let c={},u=Ds(e.routes,s,void 0,c),h,f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let m=e.dataStrategy||SC,y={...e.future},k=null,w=new Set,x=null,C=null,S=null,D=e.hydrationData!=null,L=Ta(u,e.history.location,f),R=!1,O=null,G,W;if(L==null&&!e.patchRoutesOnNavigation){let A=In(404,{pathname:e.history.location.pathname}),{matches:U,route:V}=dc(u);G=!0,W=!G,L=U,O={[V.id]:A}}else if(L&&!e.hydrationData&&Jr(L,u,e.history.location.pathname).active&&(L=null),L)if(L.some(A=>A.route.lazy))G=!1,W=!G;else if(!L.some(A=>tp(A.route)))G=!0,W=!G;else{let A=e.hydrationData?e.hydrationData.loaderData:null,U=e.hydrationData?e.hydrationData.errors:null,V=L;if(U){let te=L.findIndex(ae=>U[ae.route.id]!==void 0);V=V.slice(0,te+1)}W=!1,G=V.every(te=>{let ae=K_(te.route,A,U);return W=W||ae.renderFallback,!ae.shouldLoad})}else{G=!1,W=!G,L=[];let A=Jr(null,u,e.history.location.pathname);A.active&&A.matches&&(R=!0,L=A.matches)}let z,P={historyAction:e.history.action,location:e.history.location,matches:L,initialized:G,renderFallback:W,navigation:xh,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||O,fetchers:new Map,blockers:new Map},Y="POP",X=null,de=!1,se,Ae=!1,fe=new Map,le=null,pe=!1,Ne=!1,K=new Set,Z=new Map,H=0,I=-1,q=new Map,xe=new Set,Re=new Map,Pe=new Map,Te=new Set,Ge=new Map,Qe,Ue=null;function jt(){if(k=e.history.listen(({action:A,location:U,delta:V})=>{if(Qe){Qe(),Qe=void 0;return}Et(Ge.size===0||V!=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 te=Tr({currentLocation:P.location,nextLocation:U,historyAction:A});if(te&&V!=null){let ae=new Promise(Ee=>{Qe=Ee});e.history.go(V*-1),Gn(te,{state:"blocked",location:U,proceed(){Gn(te,{state:"proceeding",proceed:void 0,reset:void 0,location:U}),ae.then(()=>e.history.go(V))},reset(){let Ee=new Map(P.blockers);Ee.set(te,us),pt({blockers:Ee})}}),X?.resolve(),X=null;return}return Wn(A,U)}),n){$C(t,fe);let A=()=>HC(t,fe);t.addEventListener("pagehide",A),le=()=>t.removeEventListener("pagehide",A)}return P.initialized||Wn("POP",P.location,{initialHydration:!0}),z}function Hn(){k&&k(),le&&le(),w.clear(),se&&se.abort(),P.fetchers.forEach((A,U)=>vi(U)),P.blockers.forEach((A,U)=>wi(U))}function Cr(A){return w.add(A),()=>w.delete(A)}function pt(A,U={}){A.matches&&(A.matches=A.matches.map(ae=>{let Ee=c[ae.route.id],me=ae.route;return me.element!==Ee.element||me.errorElement!==Ee.errorElement||me.hydrateFallbackElement!==Ee.hydrateFallbackElement?{...ae,route:Ee}:ae})),P={...P,...A};let V=[],te=[];P.fetchers.forEach((ae,Ee)=>{ae.state==="idle"&&(Te.has(Ee)?V.push(Ee):te.push(Ee))}),Te.forEach(ae=>{!P.fetchers.has(ae)&&!Z.has(ae)&&V.push(ae)}),[...w].forEach(ae=>ae(P,{deletedFetchers:V,newErrors:A.errors??null,viewTransitionOpts:U.viewTransitionOpts,flushSync:U.flushSync===!0})),V.forEach(ae=>vi(ae)),te.forEach(ae=>P.fetchers.delete(ae))}function en(A,U,{flushSync:V}={}){let te=P.actionData!=null&&P.navigation.formMethod!=null&&Qt(P.navigation.formMethod)&&P.navigation.state==="loading"&&A.state?._isRedirect!==!0,ae;U.actionData?Object.keys(U.actionData).length>0?ae=U.actionData:ae=null:te?ae=P.actionData:ae=null;let Ee=U.loaderData?uv(P.loaderData,U.loaderData,U.matches||[],U.errors):P.loaderData,me=P.blockers;me.size>0&&(me=new Map(me),me.forEach((Ie,Le)=>me.set(Le,us)));let De=pe?!1:Eo(A,U.matches||P.matches),he=de===!0||P.navigation.formMethod!=null&&Qt(P.navigation.formMethod)&&A.state?._isRedirect!==!0;h&&(u=h,h=void 0),pe||Y==="POP"||(Y==="PUSH"?e.history.push(A,A.state):Y==="REPLACE"&&e.history.replace(A,A.state));let Me;if(Y==="POP"){let Ie=fe.get(P.location.pathname);Ie&&Ie.has(A.pathname)?Me={currentLocation:P.location,nextLocation:A}:fe.has(A.pathname)&&(Me={currentLocation:A,nextLocation:P.location})}else if(Ae){let Ie=fe.get(P.location.pathname);Ie?Ie.add(A.pathname):(Ie=new Set([A.pathname]),fe.set(P.location.pathname,Ie)),Me={currentLocation:P.location,nextLocation:A}}pt({...U,actionData:ae,loaderData:Ee,historyAction:Y,location:A,initialized:!0,renderFallback:!1,navigation:xh,revalidation:"idle",restoreScrollPosition:De,preventScrollReset:he,blockers:me},{viewTransitionOpts:Me,flushSync:V===!0}),Y="POP",de=!1,Ae=!1,pe=!1,Ne=!1,X?.resolve(),X=null,Ue?.resolve(),Ue=null}async function xo(A,U){if(X?.resolve(),X=null,typeof A=="number"){X||(X=pv());let ht=X.promise;return e.history.go(A),ht}let V=nf(P.location,P.matches,f,A,U?.fromRouteId,U?.relative),{path:te,submission:ae,error:Ee}=tv(!1,V,U),me;U?.unstable_mask&&(me={pathname:"",search:"",hash:"",...typeof U.unstable_mask=="string"?Kr(U.unstable_mask):{...P.location.unstable_mask,...U.unstable_mask}});let De=P.location,he=Ls(De,te,U&&U.state,void 0,me);he={...he,...e.history.encodeLocation(he)};let Me=U&&U.replace!=null?U.replace:void 0,Ie="PUSH";Me===!0?Ie="REPLACE":Me===!1||ae!=null&&Qt(ae.formMethod)&&ae.formAction===P.location.pathname+P.location.search&&(Ie="REPLACE");let Le=U&&"preventScrollReset"in U?U.preventScrollReset===!0:void 0,ot=(U&&U.flushSync)===!0,et=Tr({currentLocation:De,nextLocation:he,historyAction:Ie});if(et){Gn(et,{state:"blocked",location:he,proceed(){Gn(et,{state:"proceeding",proceed:void 0,reset:void 0,location:he}),xo(A,U)},reset(){let ht=new Map(P.blockers);ht.set(et,us),pt({blockers:ht})}});return}await Wn(Ie,he,{submission:ae,pendingError:Ee,preventScrollReset:Le,replace:U&&U.replace,enableViewTransition:U&&U.viewTransition,flushSync:ot,callSiteDefaultShouldRevalidate:U&&U.unstable_defaultShouldRevalidate})}function rl(){Ue||(Ue=pv()),Xr(),pt({revalidation:"loading"});let A=Ue.promise;return P.navigation.state==="submitting"?A:P.navigation.state==="idle"?(Wn(P.historyAction,P.location,{startUninterruptedRevalidation:!0}),A):(Wn(Y||P.historyAction,P.navigation.location,{overrideNavigation:P.navigation,enableViewTransition:Ae===!0}),A)}async function Wn(A,U,V){se&&se.abort(),se=null,Y=A,pe=(V&&V.startUninterruptedRevalidation)===!0,cl(P.location,P.matches),de=(V&&V.preventScrollReset)===!0,Ae=(V&&V.enableViewTransition)===!0;let te=h||u,ae=V&&V.overrideNavigation,Ee=V?.initialHydration&&P.matches&&P.matches.length>0&&!R?P.matches:Ta(te,U,f),me=(V&&V.flushSync)===!0;if(Ee&&P.initialized&&!Ne&&MC(P.location,U)&&!(V&&V.submission&&Qt(V.submission.formMethod))){en(U,{matches:Ee},{flushSync:me});return}let De=Jr(Ee,te,U.pathname);if(De.active&&De.matches&&(Ee=De.matches),!Ee){let{error:St,notFoundMatches:$t,route:lt}=xi(U.pathname);en(U,{matches:$t,loaderData:{},errors:{[lt.id]:St}},{flushSync:me});return}se=new AbortController;let he=Ji(e.history,U,se.signal,V&&V.submission),Me=e.getContext?await e.getContext():new Yy,Ie;if(V&&V.pendingError)Ie=[Ea(Ee).route.id,{type:"error",error:V.pendingError}];else if(V&&V.submission&&Qt(V.submission.formMethod)){let St=await al(he,U,V.submission,Ee,Me,De.active,V&&V.initialHydration===!0,{replace:V.replace,flushSync:me});if(St.shortCircuited)return;if(St.pendingActionResult){let[$t,lt]=St.pendingActionResult;if(xn(lt)&&Ms(lt.error)&&lt.error.status===404){se=null,en(U,{matches:St.matches,loaderData:{},errors:{[$t]:lt.error}});return}}Ee=St.matches||Ee,Ie=St.pendingActionResult,ae=Ph(U,V.submission),me=!1,De.active=!1,he=Ji(e.history,he.url,he.signal)}let{shortCircuited:Le,matches:ot,loaderData:et,errors:ht}=await Po(he,U,Ee,Me,De.active,ae,V&&V.submission,V&&V.fetcherSubmission,V&&V.replace,V&&V.initialHydration===!0,me,Ie,V&&V.callSiteDefaultShouldRevalidate);Le||(se=null,en(U,{matches:ot||Ee,...dv(Ie),loaderData:et,errors:ht}))}async function al(A,U,V,te,ae,Ee,me,De={}){Xr();let he=VC(U,V);if(pt({navigation:he},{flushSync:De.flushSync===!0}),Ee){let Le=await Ba(te,U.pathname,A.signal);if(Le.type==="aborted")return{shortCircuited:!0};if(Le.type==="error"){if(Le.partialMatches.length===0){let{matches:et,route:ht}=dc(u);return{matches:et,pendingActionResult:[ht.id,{type:"error",error:Le.error}]}}let ot=Ea(Le.partialMatches).route.id;return{matches:Le.partialMatches,pendingActionResult:[ot,{type:"error",error:Le.error}]}}else if(Le.matches)te=Le.matches;else{let{notFoundMatches:ot,error:et,route:ht}=xi(U.pathname);return{matches:ot,pendingActionResult:[ht.id,{type:"error",error:et}]}}}let Me,Ie=Tc(te,U);if(!Ie.route.action&&!Ie.route.lazy)Me={type:"error",error:In(405,{method:A.method,pathname:U.pathname,routeId:Ie.route.id})};else{let Le=so(s,c,A,te,Ie,me?[]:a,ae),ot=await Zr(A,Le,ae,null);if(Me=ot[Ie.route.id],!Me){for(let et of te)if(ot[et.route.id]){Me=ot[et.route.id];break}}if(A.signal.aborted)return{shortCircuited:!0}}if(ni(Me)){let Le;return De&&De.replace!=null?Le=De.replace:Le=sv(Me.response.headers.get("Location"),new URL(A.url),f,e.history)===P.location.pathname+P.location.search,await lr(A,Me,!0,{submission:V,replace:Le}),{shortCircuited:!0}}if(xn(Me)){let Le=Ea(te,Ie.route.id);return(De&&De.replace)!==!0&&(Y="PUSH"),{matches:te,pendingActionResult:[Le.route.id,Me,Ie.route.id]}}return{matches:te,pendingActionResult:[Ie.route.id,Me]}}async function Po(A,U,V,te,ae,Ee,me,De,he,Me,Ie,Le,ot){let et=Ee||Ph(U,me),ht=me||De||fv(et),St=!pe&&!Me;if(ae){if(St){let Ut=qr(Le);pt({navigation:et,...Ut!==void 0?{actionData:Ut}:{}},{flushSync:Ie})}let He=await Ba(V,U.pathname,A.signal);if(He.type==="aborted")return{shortCircuited:!0};if(He.type==="error"){if(He.partialMatches.length===0){let{matches:na,route:Rr}=dc(u);return{matches:na,loaderData:{},errors:{[Rr.id]:He.error}}}let Ut=Ea(He.partialMatches).route.id;return{matches:He.partialMatches,loaderData:{},errors:{[Ut]:He.error}}}else if(He.matches)V=He.matches;else{let{error:Ut,notFoundMatches:na,route:Rr}=xi(U.pathname);return{matches:na,loaderData:{},errors:{[Rr.id]:Ut}}}}let $t=h||u,{dsMatches:lt,revalidatingFetchers:rt}=nv(A,te,s,c,e.history,P,V,ht,U,Me?[]:a,Me===!0,Ne,K,Te,Re,xe,$t,f,e.patchRoutesOnNavigation!=null,Le,ot);if(I=++H,!e.dataStrategy&&!lt.some(He=>He.shouldLoad)&&!lt.some(He=>He.route.middleware&&He.route.middleware.length>0)&&rt.length===0){let He=_i();return en(U,{matches:V,loaderData:{},errors:Le&&xn(Le[1])?{[Le[0]]:Le[1].error}:null,...dv(Le),...He?{fetchers:new Map(P.fetchers)}:{}},{flushSync:Ie}),{shortCircuited:!0}}if(St){let He={};if(!ae){He.navigation=et;let Ut=qr(Le);Ut!==void 0&&(He.actionData=Ut)}rt.length>0&&(He.fetchers=Yr(rt)),pt(He,{flushSync:Ie})}rt.forEach(He=>{Kn(He.key),He.controller&&Z.set(He.key,He.controller)});let Er=()=>rt.forEach(He=>Kn(He.key));se&&se.signal.addEventListener("abort",Er);let{loaderResults:Ar,fetcherResults:qn}=await yi(lt,rt,A,te);if(A.signal.aborted)return{shortCircuited:!0};se&&se.signal.removeEventListener("abort",Er),rt.forEach(He=>Z.delete(He.key));let nn=hc(Ar);if(nn)return await lr(A,nn.result,!0,{replace:he}),{shortCircuited:!0};if(nn=hc(qn),nn)return xe.add(nn.key),await lr(A,nn.result,!0,{replace:he}),{shortCircuited:!0};let{loaderData:Ro,errors:ta}=cv(P,V,Ar,Le,rt,qn);Me&&P.errors&&(ta={...P.errors,...ta});let Tn=_i(),rn=bi(I),Pi=Tn||rn||rt.length>0;return{matches:V,loaderData:Ro,errors:ta,...Pi?{fetchers:new Map(P.fetchers)}:{}}}function qr(A){if(A&&!xn(A[1]))return{[A[0]]:A[1].data};if(P.actionData)return Object.keys(P.actionData).length===0?null:P.actionData}function Yr(A){return A.forEach(U=>{let V=P.fetchers.get(U.key),te=ds(void 0,V?V.data:void 0);P.fetchers.set(U.key,te)}),new Map(P.fetchers)}async function So(A,U,V,te){Kn(A);let ae=(te&&te.flushSync)===!0,Ee=h||u,me=nf(P.location,P.matches,f,V,U,te?.relative),De=Ta(Ee,me,f),he=Jr(De,Ee,me);if(he.active&&he.matches&&(De=he.matches),!De){tn(A,U,In(404,{pathname:me}),{flushSync:ae});return}let{path:Me,submission:Ie,error:Le}=tv(!0,me,te);if(Le){tn(A,U,Le,{flushSync:ae});return}let ot=e.getContext?await e.getContext():new Yy,et=(te&&te.preventScrollReset)===!0;if(Ie&&Qt(Ie.formMethod)){await il(A,U,Me,De,ot,he.active,ae,et,Ie,te&&te.unstable_defaultShouldRevalidate);return}Re.set(A,{routeId:U,path:Me}),await ol(A,U,Me,De,ot,he.active,ae,et,Ie)}async function il(A,U,V,te,ae,Ee,me,De,he,Me){Xr(),Re.delete(A);let Ie=P.fetchers.get(A);Cn(A,zC(he,Ie),{flushSync:me});let Le=new AbortController,ot=Ji(e.history,V,Le.signal,he);if(Ee){let ut=await Ba(te,new URL(ot.url).pathname,ot.signal,A);if(ut.type==="aborted")return;if(ut.type==="error"){tn(A,U,ut.error,{flushSync:me});return}else if(ut.matches)te=ut.matches;else{tn(A,U,In(404,{pathname:V}),{flushSync:me});return}}let et=Tc(te,V);if(!et.route.action&&!et.route.lazy){let ut=In(405,{method:he.formMethod,pathname:V,routeId:U});tn(A,U,ut,{flushSync:me});return}Z.set(A,Le);let ht=H,St=so(s,c,ot,te,et,a,ae),$t=await Zr(ot,St,ae,A),lt=$t[et.route.id];if(!lt){for(let ut of St)if($t[ut.route.id]){lt=$t[ut.route.id];break}}if(ot.signal.aborted){Z.get(A)===Le&&Z.delete(A);return}if(Te.has(A)){if(ni(lt)||xn(lt)){Cn(A,Vr(void 0));return}}else{if(ni(lt))if(Z.delete(A),I>ht){Cn(A,Vr(void 0));return}else return xe.add(A),Cn(A,ds(he)),lr(ot,lt,!1,{fetcherSubmission:he,preventScrollReset:De});if(xn(lt)){tn(A,U,lt.error);return}}let rt=P.navigation.location||P.location,Er=Ji(e.history,rt,Le.signal),Ar=h||u,qn=P.navigation.state!=="idle"?Ta(Ar,P.navigation.location,f):P.matches;Xe(qn,"Didn't find any matches after fetcher action");let nn=++H;q.set(A,nn);let Ro=ds(he,lt.data);P.fetchers.set(A,Ro);let{dsMatches:ta,revalidatingFetchers:Tn}=nv(Er,ae,s,c,e.history,P,qn,he,rt,a,!1,Ne,K,Te,Re,xe,Ar,f,e.patchRoutesOnNavigation!=null,[et.route.id,lt],Me);Tn.filter(ut=>ut.key!==A).forEach(ut=>{let Lr=ut.key,ra=P.fetchers.get(Lr),Si=ds(void 0,ra?ra.data:void 0);P.fetchers.set(Lr,Si),Kn(Lr),ut.controller&&Z.set(Lr,ut.controller)}),pt({fetchers:new Map(P.fetchers)});let rn=()=>Tn.forEach(ut=>Kn(ut.key));Le.signal.addEventListener("abort",rn);let{loaderResults:Pi,fetcherResults:He}=await yi(ta,Tn,Er,ae);if(Le.signal.aborted)return;if(Le.signal.removeEventListener("abort",rn),q.delete(A),Z.delete(A),Tn.forEach(ut=>Z.delete(ut.key)),P.fetchers.has(A)){let ut=Vr(lt.data);P.fetchers.set(A,ut)}let Ut=hc(Pi);if(Ut)return lr(Er,Ut.result,!1,{preventScrollReset:De});if(Ut=hc(He),Ut)return xe.add(Ut.key),lr(Er,Ut.result,!1,{preventScrollReset:De});let{loaderData:na,errors:Rr}=cv(P,qn,Pi,void 0,Tn,He);bi(nn),P.navigation.state==="loading"&&nn>I?(Xe(Y,"Expected pending action"),se&&se.abort(),en(P.navigation.location,{matches:qn,loaderData:na,errors:Rr,fetchers:new Map(P.fetchers)})):(pt({errors:Rr,loaderData:uv(P.loaderData,na,qn,Rr),fetchers:new Map(P.fetchers)}),Ne=!1)}async function ol(A,U,V,te,ae,Ee,me,De,he){let Me=P.fetchers.get(A);Cn(A,ds(he,Me?Me.data:void 0),{flushSync:me});let Ie=new AbortController,Le=Ji(e.history,V,Ie.signal);if(Ee){let lt=await Ba(te,new URL(Le.url).pathname,Le.signal,A);if(lt.type==="aborted")return;if(lt.type==="error"){tn(A,U,lt.error,{flushSync:me});return}else if(lt.matches)te=lt.matches;else{tn(A,U,In(404,{pathname:V}),{flushSync:me});return}}let ot=Tc(te,V);Z.set(A,Ie);let et=H,ht=so(s,c,Le,te,ot,a,ae),$t=(await Zr(Le,ht,ae,A))[ot.route.id];if(Z.get(A)===Ie&&Z.delete(A),!Le.signal.aborted){if(Te.has(A)){Cn(A,Vr(void 0));return}if(ni($t))if(I>et){Cn(A,Vr(void 0));return}else{xe.add(A),await lr(Le,$t,!1,{preventScrollReset:De});return}if(xn($t)){tn(A,U,$t.error);return}Cn(A,Vr($t.data))}}async function lr(A,U,V,{submission:te,fetcherSubmission:ae,preventScrollReset:Ee,replace:me}={}){V||(X?.resolve(),X=null),U.response.headers.has("X-Remix-Revalidate")&&(Ne=!0);let De=U.response.headers.get("Location");Xe(De,"Expected a Location header on the redirect Response"),De=sv(De,new URL(A.url),f,e.history);let he=Ls(P.location,De,{_isRedirect:!0});if(n){let ht=!1;if(U.response.headers.has("X-Remix-Reload-Document"))ht=!0;else if(Jf(De)){const St=I_(De,!0);ht=St.origin!==t.location.origin||Un(St.pathname,f)==null}if(ht){me?t.location.replace(De):t.location.assign(De);return}}se=null;let Me=me===!0||U.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ie,formAction:Le,formEncType:ot}=P.navigation;!te&&!ae&&Ie&&Le&&ot&&(te=fv(P.navigation));let et=te||ae;if(yC.has(U.response.status)&&et&&Qt(et.formMethod))await Wn(Me,he,{submission:{...et,formAction:De},preventScrollReset:Ee||de,enableViewTransition:V?Ae:void 0});else{let ht=Ph(he,te);await Wn(Me,he,{overrideNavigation:ht,fetcherSubmission:ae,preventScrollReset:Ee||de,enableViewTransition:V?Ae:void 0})}}async function Zr(A,U,V,te){let ae,Ee={};try{ae=await TC(m,A,U,te,V,!1)}catch(me){return U.filter(De=>De.shouldLoad).forEach(De=>{Ee[De.route.id]={type:"error",error:me}}),Ee}if(A.signal.aborted)return Ee;if(!Qt(A.method))for(let me of U){if(ae[me.route.id]?.type==="error")break;!ae.hasOwnProperty(me.route.id)&&!P.loaderData.hasOwnProperty(me.route.id)&&(!P.errors||!P.errors.hasOwnProperty(me.route.id))&&me.shouldCallHandler()&&(ae[me.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${me.route.id}`)})}for(let[me,De]of Object.entries(ae))if(jC(De)){let he=De.result;Ee[me]={type:"redirect",response:LC(he,A,me,U,f)}}else Ee[me]=await RC(De);return Ee}async function yi(A,U,V,te){let ae=Zr(V,A,te,null),Ee=Promise.all(U.map(async he=>{if(he.matches&&he.match&&he.request&&he.controller){let Ie=(await Zr(he.request,he.matches,te,he.key))[he.match.route.id];return{[he.key]:Ie}}else return Promise.resolve({[he.key]:{type:"error",error:In(404,{pathname:he.path})}})})),me=await ae,De=(await Ee).reduce((he,Me)=>Object.assign(he,Me),{});return{loaderResults:me,fetcherResults:De}}function Xr(){Ne=!0,Re.forEach((A,U)=>{Z.has(U)&&K.add(U),Kn(U)})}function Cn(A,U,V={}){P.fetchers.set(A,U),pt({fetchers:new Map(P.fetchers)},{flushSync:(V&&V.flushSync)===!0})}function tn(A,U,V,te={}){let ae=Ea(P.matches,U);vi(A),pt({errors:{[ae.route.id]:V},fetchers:new Map(P.fetchers)},{flushSync:(te&&te.flushSync)===!0})}function Qr(A){return Pe.set(A,(Pe.get(A)||0)+1),Te.has(A)&&Te.delete(A),P.fetchers.get(A)||vC}function Ou(A,U){Kn(A,U?.reason),Cn(A,Vr(null))}function vi(A){let U=P.fetchers.get(A);Z.has(A)&&!(U&&U.state==="loading"&&q.has(A))&&Kn(A),Re.delete(A),q.delete(A),xe.delete(A),Te.delete(A),K.delete(A),P.fetchers.delete(A)}function sl(A){let U=(Pe.get(A)||0)-1;U<=0?(Pe.delete(A),Te.add(A)):Pe.set(A,U),pt({fetchers:new Map(P.fetchers)})}function Kn(A,U){let V=Z.get(A);V&&(V.abort(U),Z.delete(A))}function ki(A){for(let U of A){let V=Qr(U),te=Vr(V.data);P.fetchers.set(U,te)}}function _i(){let A=[],U=!1;for(let V of xe){let te=P.fetchers.get(V);Xe(te,`Expected fetcher: ${V}`),te.state==="loading"&&(xe.delete(V),A.push(V),U=!0)}return ki(A),U}function bi(A){let U=[];for(let[V,te]of q)if(te<A){let ae=P.fetchers.get(V);Xe(ae,`Expected fetcher: ${V}`),ae.state==="loading"&&(Kn(V),q.delete(V),U.push(V))}return ki(U),U.length>0}function Co(A,U){let V=P.blockers.get(A)||us;return Ge.get(A)!==U&&Ge.set(A,U),V}function wi(A){P.blockers.delete(A),Ge.delete(A)}function Gn(A,U){let V=P.blockers.get(A)||us;Xe(V.state==="unblocked"&&U.state==="blocked"||V.state==="blocked"&&U.state==="blocked"||V.state==="blocked"&&U.state==="proceeding"||V.state==="blocked"&&U.state==="unblocked"||V.state==="proceeding"&&U.state==="unblocked",`Invalid blocker state transition: ${V.state} -> ${U.state}`);let te=new Map(P.blockers);te.set(A,U),pt({blockers:te})}function Tr({currentLocation:A,nextLocation:U,historyAction:V}){if(Ge.size===0)return;Ge.size>1&&Et(!1,"A router only supports one blocker at a time");let te=Array.from(Ge.entries()),[ae,Ee]=te[te.length-1],me=P.blockers.get(ae);if(!(me&&me.state==="proceeding")&&Ee({currentLocation:A,nextLocation:U,historyAction:V}))return ae}function xi(A){let U=In(404,{pathname:A}),V=h||u,{matches:te,route:ae}=dc(V);return{notFoundMatches:te,route:ae,error:U}}function ll(A,U,V){if(x=A,S=U,C=V||null,!D&&P.navigation===xh){D=!0;let te=Eo(P.location,P.matches);te!=null&&pt({restoreScrollPosition:te})}return()=>{x=null,S=null,C=null}}function To(A,U){return C&&C(A,U.map(te=>HS(te,P.loaderData)))||A.key}function cl(A,U){if(x&&S){let V=To(A,U);x[V]=S()}}function Eo(A,U){if(x){let V=To(A,U),te=x[V];if(typeof te=="number")return te}return null}function Jr(A,U,V){if(e.patchRoutesOnNavigation)if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:ys(U,V,f,!0)}}else return{active:!0,matches:ys(U,V,f,!0)||[]};return{active:!1,matches:null}}async function Ba(A,U,V,te){if(!e.patchRoutesOnNavigation)return{type:"success",matches:A};let ae=A;for(;;){let Ee=h==null,me=h||u,De=c;try{await e.patchRoutesOnNavigation({signal:V,path:U,matches:ae,fetcherKey:te,patch:(Ie,Le)=>{V.aborted||rv(Ie,Le,me,De,s,!1)}})}catch(Ie){return{type:"error",error:Ie,partialMatches:ae}}finally{Ee&&!V.aborted&&(u=[...u])}if(V.aborted)return{type:"aborted"};let he=Ta(me,U,f),Me=null;if(he){if(Object.keys(he[0].params).length===0)return{type:"success",matches:he};if(Me=ys(me,U,f,!0),!(Me&&ae.length<Me.length&&ea(ae,Me.slice(0,ae.length))))return{type:"success",matches:he}}if(Me||(Me=ys(me,U,f,!0)),!Me||ea(ae,Me))return{type:"success",matches:null};ae=Me}}function ea(A,U){return A.length===U.length&&A.every((V,te)=>V.route.id===U[te].route.id)}function Ao(A){c={},h=Ds(A,s,void 0,c)}function Fa(A,U,V=!1){let te=h==null;rv(A,U,h||u,c,s,V),te&&(u=[...u],pt({}))}return z={get basename(){return f},get future(){return y},get state(){return P},get routes(){return u},get window(){return t},initialize:jt,subscribe:Cr,enableScrollRestoration:ll,navigate:xo,fetch:So,revalidate:rl,createHref:A=>e.history.createHref(A),encodeLocation:A=>e.history.encodeLocation(A),getFetcher:Qr,resetFetcher:Ou,deleteFetcher:sl,dispose:Hn,getBlocker:Co,deleteBlocker:wi,patchRoutes:Fa,_internalFetchControllers:Z,_internalSetRoutes:Ao,_internalSetStateDoNotUseOrYouWillBreakYourApp(A){pt(A)}},e.unstable_instrumentations&&(z=cC(z,e.unstable_instrumentations.map(A=>A.router).filter(Boolean))),z}function bC(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function nf(e,t,n,a,o,s){let c,u;if(o){c=[];for(let f of t)if(c.push(f),f.route.id===o){u=f;break}}else c=t,u=t[t.length-1];let h=_u(a||".",ep(c),Un(e.pathname,n)||e.pathname,s==="path");if(a==null&&(h.search=e.search,h.hash=e.hash),(a==null||a===""||a===".")&&u){let f=rp(h.search);if(u.route.index&&!f)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&f){let m=new URLSearchParams(h.search),y=m.getAll("index");m.delete("index"),y.filter(w=>w).forEach(w=>m.append("index",w));let k=m.toString();h.search=k?`?${k}`:""}}return n!=="/"&&(h.pathname=rC({basename:n,pathname:h.pathname})),kr(h)}function tv(e,t,n){if(!n||!bC(n))return{path:t};if(n.formMethod&&!FC(n.formMethod))return{path:t,error:In(405,{method:n.formMethod})};let a=()=>({path:t,error:In(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),c=Q_(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Qt(s))return a();let y=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((k,[w,x])=>`${k}${w}=${x}
10
+ `,""):String(n.body);return{path:t,submission:{formMethod:s,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:y}}}else if(n.formEncType==="application/json"){if(!Qt(s))return a();try{let y=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:s,formAction:c,formEncType:n.formEncType,formData:void 0,json:y,text:void 0}}}catch{return a()}}}Xe(typeof FormData=="function","FormData is not available in this environment");let u,h;if(n.formData)u=af(n.formData),h=n.formData;else if(n.body instanceof FormData)u=af(n.body),h=n.body;else if(n.body instanceof URLSearchParams)u=n.body,h=lv(u);else if(n.body==null)u=new URLSearchParams,h=new FormData;else try{u=new URLSearchParams(n.body),h=lv(u)}catch{return a()}let f={formMethod:s,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:h,json:void 0,text:void 0};if(Qt(f.formMethod))return{path:t,submission:f};let m=Kr(t);return e&&m.search&&rp(m.search)&&u.append("index",""),m.search=`?${u}`,{path:kr(m),submission:f}}function nv(e,t,n,a,o,s,c,u,h,f,m,y,k,w,x,C,S,D,L,R,O){let G=R?xn(R[1])?R[1].error:R[1].data:void 0,W=o.createURL(s.location),z=o.createURL(h),P;if(m&&s.errors){let le=Object.keys(s.errors)[0];P=c.findIndex(pe=>pe.route.id===le)}else if(R&&xn(R[1])){let le=R[0];P=c.findIndex(pe=>pe.route.id===le)-1}let Y=R?R[1].statusCode:void 0,X=Y&&Y>=400,de={currentUrl:W,currentParams:s.matches[0]?.params||{},nextUrl:z,nextParams:c[0].params,...u,actionResult:G,actionStatus:Y},se=zs(c),Ae=c.map((le,pe)=>{let{route:Ne}=le,K=null;if(P!=null&&pe>P)K=!1;else if(Ne.lazy)K=!0;else if(!tp(Ne))K=!1;else if(m){let{shouldLoad:q}=K_(Ne,s.loaderData,s.errors);K=q}else wC(s.loaderData,s.matches[pe],le)&&(K=!0);if(K!==null)return rf(n,a,e,se,le,f,t,K);let Z=!1;typeof O=="boolean"?Z=O:X?Z=!1:(y||W.pathname+W.search===z.pathname+z.search||W.search!==z.search||xC(s.matches[pe],le))&&(Z=!0);let H={...de,defaultShouldRevalidate:Z},I=bs(le,H);return rf(n,a,e,se,le,f,t,I,H,O)}),fe=[];return x.forEach((le,pe)=>{if(m||!c.some(Re=>Re.route.id===le.routeId)||w.has(pe))return;let Ne=s.fetchers.get(pe),K=Ne&&Ne.state!=="idle"&&Ne.data===void 0,Z=Ta(S,le.path,D);if(!Z){if(L&&K)return;fe.push({key:pe,routeId:le.routeId,path:le.path,matches:null,match:null,request:null,controller:null});return}if(C.has(pe))return;let H=Tc(Z,le.path),I=new AbortController,q=Ji(o,le.path,I.signal),xe=null;if(k.has(pe))k.delete(pe),xe=so(n,a,q,Z,H,f,t);else if(K)y&&(xe=so(n,a,q,Z,H,f,t));else{let Re;typeof O=="boolean"?Re=O:X?Re=!1:Re=y;let Pe={...de,defaultShouldRevalidate:Re};bs(H,Pe)&&(xe=so(n,a,q,Z,H,f,t,Pe))}xe&&fe.push({key:pe,routeId:le.routeId,path:le.path,matches:xe,match:H,request:q,controller:I})}),{dsMatches:Ae,revalidatingFetchers:fe}}function tp(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function K_(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!tp(e))return{shouldLoad:!1,renderFallback:!1};let a=t!=null&&e.id in t,o=n!=null&&n[e.id]!==void 0;if(!a&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!a};let s=!a&&!o;return{shouldLoad:s,renderFallback:s}}function wC(e,t,n){let a=!t||n.route.id!==t.route.id,o=!e.hasOwnProperty(n.route.id);return a||o}function xC(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function bs(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function rv(e,t,n,a,o,s){let c;if(e){let f=a[e];Xe(f,`No route found to patch children into: routeId = ${e}`),f.children||(f.children=[]),c=f.children}else c=n;let u=[],h=[];if(t.forEach(f=>{let m=c.find(y=>G_(f,y));m?h.push({existingRoute:m,newRoute:f}):u.push(f)}),u.length>0){let f=Ds(u,o,[e||"_","patch",String(c?.length||"0")],a);c.push(...f)}if(s&&h.length>0)for(let f=0;f<h.length;f++){let{existingRoute:m,newRoute:y}=h[f],k=m,[w]=Ds([y],o,[],{},!0);Object.assign(k,{element:w.element?w.element:k.element,errorElement:w.errorElement?w.errorElement:k.errorElement,hydrateFallbackElement:w.hydrateFallbackElement?w.hydrateFallbackElement:k.hydrateFallbackElement})}}function G_(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((n,a)=>t.children?.some(o=>G_(n,o)))??!1:!1}var av=new WeakMap,q_=({key:e,route:t,manifest:n,mapRouteProperties:a})=>{let o=n[t.id];if(Xe(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let s=o.lazy[e];if(!s)return;let c=av.get(o);c||(c={},av.set(o,c));let u=c[e];if(u)return u;let h=(async()=>{let f=FS(e),y=o[e]!==void 0&&e!=="hasErrorBoundary";if(f)Et(!f,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(y)Et(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let k=await s();k!=null&&(Object.assign(o,{[e]:k}),Object.assign(o,a(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(k=>k===void 0)&&(o.lazy=void 0))})();return c[e]=h,h},iv=new WeakMap;function PC(e,t,n,a,o){let s=n[e.id];if(Xe(s,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=iv.get(s);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let y=(async()=>{Xe(typeof e.lazy=="function","No lazy route function found");let k=await e.lazy(),w={};for(let x in k){let C=k[x];if(C===void 0)continue;let S=zS(x),L=s[x]!==void 0&&x!=="hasErrorBoundary";S?Et(!S,"Route property "+x+" is not a supported property to be returned from a lazy route function. This property will be ignored."):L?Et(!L,`Route "${s.id}" has a static property "${x}" defined but its lazy function is also returning a value for this property. The lazy route property "${x}" will be ignored.`):w[x]=C}Object.assign(s,w),Object.assign(s,{...a(s),lazy:void 0})})();return iv.set(s,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let c=Object.keys(e.lazy),u=[],h;for(let m of c){if(o&&o.includes(m))continue;let y=q_({key:m,route:e,manifest:n,mapRouteProperties:a});y&&(u.push(y),m===t&&(h=y))}let f=u.length>0?Promise.all(u).then(()=>{}):void 0;return f?.catch(()=>{}),h?.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:h}}async function ov(e){let t=e.matches.filter(o=>o.shouldLoad),n={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,s)=>{n[t[s].route.id]=o}),n}async function SC(e){return e.matches.some(t=>t.route.middleware)?Y_(e,()=>ov(e)):ov(e)}function Y_(e,t){return CC(e,t,a=>{if(BC(a))throw a;return a},NC,n);function n(a,o,s){if(s)return Promise.resolve(Object.assign(s.value,{[o]:{type:"error",result:a}}));{let{matches:c}=e,u=Math.min(Math.max(c.findIndex(f=>f.route.id===o),0),Math.max(c.findIndex(f=>f.shouldCallHandler()),0)),h=Ea(c,c[u].route.id).route.id;return Promise.resolve({[h]:{type:"error",result:a}})}}}async function CC(e,t,n,a,o){let{matches:s,request:c,params:u,context:h,unstable_pattern:f}=e,m=s.flatMap(k=>k.route.middleware?k.route.middleware.map(w=>[k.route.id,w]):[]);return await Z_({request:c,params:u,context:h,unstable_pattern:f},m,t,n,a,o)}async function Z_(e,t,n,a,o,s,c=0){let{request:u}=e;if(u.signal.aborted)throw u.signal.reason??new Error(`Request aborted: ${u.method} ${u.url}`);let h=t[c];if(!h)return await n();let[f,m]=h,y,k=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await Z_(e,t,n,a,o,s,c+1)},y.value}catch(w){return y={value:await s(w,f,y)},y.value}};try{let w=await m(e,k),x=w!=null?a(w):void 0;return o(x)?x:y?x??y.value:(y={value:await k()},y.value)}catch(w){return await s(w,f,y)}}function X_(e,t,n,a,o){let s=q_({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),c=PC(a.route,Qt(n.method)?"action":"loader",t,e,o);return{middleware:s,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function rf(e,t,n,a,o,s,c,u,h=null,f){let m=!1,y=X_(e,t,n,o,s);return{...o,_lazyPromises:y,shouldLoad:u,shouldRevalidateArgs:h,shouldCallHandler(k){return m=!0,h?typeof f=="boolean"?bs(o,{...h,defaultShouldRevalidate:f}):typeof k=="boolean"?bs(o,{...h,defaultShouldRevalidate:k}):bs(o,h):u},resolve(k){let{lazy:w,loader:x,middleware:C}=o.route,S=m||u||k&&!Qt(n.method)&&(w||x),D=C&&C.length>0&&!x&&!w;return S&&(Qt(n.method)||!D)?EC({request:n,unstable_pattern:a,match:o,lazyHandlerPromise:y?.handler,lazyRoutePromise:y?.route,handlerOverride:k,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function so(e,t,n,a,o,s,c,u=null){return a.map(h=>h.route.id!==o.route.id?{...h,shouldLoad:!1,shouldRevalidateArgs:u,shouldCallHandler:()=>!1,_lazyPromises:X_(e,t,n,h,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:rf(e,t,n,zs(a),h,s,c,!0,u))}async function TC(e,t,n,a,o,s){n.some(f=>f._lazyPromises?.middleware)&&await Promise.all(n.map(f=>f._lazyPromises?.middleware));let c={request:t,unstable_pattern:zs(n),params:n[0].params,context:o,matches:n},h=await e({...c,fetcherKey:a,runClientMiddleware:f=>{let m=c;return Y_(m,()=>f({...m,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(f=>[f._lazyPromises?.handler,f._lazyPromises?.route]))}catch{}return h}async function EC({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:a,lazyRoutePromise:o,handlerOverride:s,scopedContext:c}){let u,h,f=Qt(e.method),m=f?"action":"loader",y=k=>{let w,x=new Promise((D,L)=>w=L);h=()=>w(),e.signal.addEventListener("abort",h);let C=D=>typeof k!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${n.route.id}]`)):k({request:e,unstable_pattern:t,params:n.params,context:c},...D!==void 0?[D]:[]),S=(async()=>{try{return{type:"data",result:await(s?s(L=>C(L)):C())}}catch(D){return{type:"error",result:D}}})();return Promise.race([S,x])};try{let k=f?n.route.action:n.route.loader;if(a||o)if(k){let w,[x]=await Promise.all([y(k).catch(C=>{w=C}),a,o]);if(w!==void 0)throw w;u=x}else{await a;let w=f?n.route.action:n.route.loader;if(w)[u]=await Promise.all([y(w),o]);else if(m==="action"){let x=new URL(e.url),C=x.pathname+x.search;throw In(405,{method:e.method,pathname:C,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(k)u=await y(k);else{let w=new URL(e.url),x=w.pathname+w.search;throw In(404,{pathname:x})}}catch(k){return{type:"error",result:k}}finally{h&&e.signal.removeEventListener("abort",h)}return u}async function AC(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function RC(e){let{result:t,type:n}=e;if(np(t)){let a;try{a=await AC(t)}catch(o){return{type:"error",error:o}}return n==="error"?{type:"error",error:new Vs(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:"data",data:a,statusCode:t.status,headers:t.headers}}return n==="error"?hv(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:IC(t),statusCode:Ms(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Ms(t)?t.status:void 0}:hv(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function LC(e,t,n,a,o){let s=e.headers.get("Location");if(Xe(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Jf(s)){let c=a.slice(0,a.findIndex(u=>u.route.id===n)+1);s=nf(new URL(t.url),c,o,s),e.headers.set("Location",s)}return e}function sv(e,t,n,a){let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Jf(e)){let s=e,c=s.startsWith("//")?new URL(t.protocol+s):new URL(s);if(o.includes(c.protocol))throw new Error("Invalid redirect location");let u=Un(c.pathname,n)!=null;if(c.origin===t.origin&&u)return c.pathname+c.search+c.hash}try{let s=a.createURL(e);if(o.includes(s.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Ji(e,t,n,a){let o=e.createURL(Q_(t)).toString(),s={signal:n};if(a&&Qt(a.formMethod)){let{formMethod:c,formEncType:u}=a;s.method=c.toUpperCase(),u==="application/json"?(s.headers=new Headers({"Content-Type":u}),s.body=JSON.stringify(a.json)):u==="text/plain"?s.body=a.text:u==="application/x-www-form-urlencoded"&&a.formData?s.body=af(a.formData):s.body=a.formData}return new Request(o,s)}function af(e){let t=new URLSearchParams;for(let[n,a]of e.entries())t.append(n,typeof a=="string"?a:a.name);return t}function lv(e){let t=new FormData;for(let[n,a]of e.entries())t.append(n,a);return t}function DC(e,t,n,a=!1,o=!1){let s={},c=null,u,h=!1,f={},m=n&&xn(n[1])?n[1].error:void 0;return e.forEach(y=>{if(!(y.route.id in t))return;let k=y.route.id,w=t[k];if(Xe(!ni(w),"Cannot handle redirect results in processLoaderData"),xn(w)){let x=w.error;if(m!==void 0&&(x=m,m=void 0),c=c||{},o)c[k]=x;else{let C=Ea(e,k);c[C.route.id]==null&&(c[C.route.id]=x)}a||(s[k]=W_),h||(h=!0,u=Ms(w.error)?w.error.status:500),w.headers&&(f[k]=w.headers)}else s[k]=w.data,w.statusCode&&w.statusCode!==200&&!h&&(u=w.statusCode),w.headers&&(f[k]=w.headers)}),m!==void 0&&n&&(c={[n[0]]:m},n[2]&&(s[n[2]]=void 0)),{loaderData:s,errors:c,statusCode:u||200,loaderHeaders:f}}function cv(e,t,n,a,o,s){let{loaderData:c,errors:u}=DC(t,n,a);return o.filter(h=>!h.matches||h.matches.some(f=>f.shouldLoad)).forEach(h=>{let{key:f,match:m,controller:y}=h;if(y&&y.signal.aborted)return;let k=s[f];if(Xe(k,"Did not find corresponding fetcher result"),xn(k)){let w=Ea(e.matches,m?.route.id);u&&u[w.route.id]||(u={...u,[w.route.id]:k.error}),e.fetchers.delete(f)}else if(ni(k))Xe(!1,"Unhandled fetcher revalidation redirect");else{let w=Vr(k.data);e.fetchers.set(f,w)}}),{loaderData:c,errors:u}}function uv(e,t,n,a){let o=Object.entries(t).filter(([,s])=>s!==W_).reduce((s,[c,u])=>(s[c]=u,s),{});for(let s of n){let c=s.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&s.route.loader&&(o[c]=e[c]),a&&a.hasOwnProperty(c))break}return o}function dv(e){return e?xn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ea(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function dc(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function In(e,{pathname:t,routeId:n,method:a,type:o,message:s}={}){let c="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(c="Bad Request",a&&t&&n?u=`You made a ${a} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:o==="invalid-body"&&(u="Unable to encode submission body")):e===403?(c="Forbidden",u=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",u=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",a&&t&&n?u=`You made a ${a.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:a&&(u=`Invalid request method "${a.toUpperCase()}"`)),new Vs(e||500,c,new Error(u),!0)}function hc(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[a,o]=t[n];if(ni(o))return{key:a,result:o}}}function Q_(e){let t=typeof e=="string"?Kr(e):e;return kr({...t,hash:""})}function MC(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function IC(e){return new Vs(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function NC(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&OC(n))}function OC(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function jC(e){return np(e.result)&&$_.has(e.result.status)}function xn(e){return e.type==="error"}function ni(e){return(e&&e.type)==="redirect"}function hv(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function np(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function UC(e){return $_.has(e)}function BC(e){return np(e)&&UC(e.status)&&e.headers.has("Location")}function FC(e){return gC.has(e.toUpperCase())}function Qt(e){return pC.has(e.toUpperCase())}function rp(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Tc(e,t){let n=typeof t=="string"?Kr(t).search:t.search;if(e[e.length-1].route.index&&rp(n||""))return e[e.length-1];let a=U_(e);return a[a.length-1]}function fv(e){let{formMethod:t,formAction:n,formEncType:a,text:o,formData:s,json:c}=e;if(!(!t||!n||!a)){if(o!=null)return{formMethod:t,formAction:n,formEncType:a,formData:void 0,json:void 0,text:o};if(s!=null)return{formMethod:t,formAction:n,formEncType:a,formData:s,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:a,formData:void 0,json:c,text:void 0}}}function Ph(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function VC(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function ds(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function zC(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Vr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function $C(e,t){try{let n=e.sessionStorage.getItem(H_);if(n){let a=JSON.parse(n);for(let[o,s]of Object.entries(a||{}))s&&Array.isArray(s)&&t.set(o,new Set(s||[]))}}catch{}}function HC(e,t){if(t.size>0){let n={};for(let[a,o]of t)n[a]=[...o];try{e.sessionStorage.setItem(H_,JSON.stringify(n))}catch(a){Et(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function pv(){let e,t,n=new Promise((a,o)=>{e=async s=>{a(s);try{await n}catch{}},t=async s=>{o(s);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var pi=b.createContext(null);pi.displayName="DataRouter";var $s=b.createContext(null);$s.displayName="DataRouterState";var J_=b.createContext(!1);function WC(){return b.useContext(J_)}var ap=b.createContext({isTransitioning:!1});ap.displayName="ViewTransition";var eb=b.createContext(new Map);eb.displayName="Fetchers";var KC=b.createContext(null);KC.displayName="Await";var Bn=b.createContext(null);Bn.displayName="Navigation";var bu=b.createContext(null);bu.displayName="Location";var Gr=b.createContext({outlet:null,matches:[],isDataRoute:!1});Gr.displayName="Route";var ip=b.createContext(null);ip.displayName="RouteError";var tb="REACT_ROUTER_ERROR",GC="REDIRECT",qC="ROUTE_ERROR_RESPONSE";function YC(e){if(e.startsWith(`${tb}:${GC}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function ZC(e){if(e.startsWith(`${tb}:${qC}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Vs(t.status,t.statusText,t.data)}catch{}}function XC(e,{relative:t}={}){Xe(Hs(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=b.useContext(Bn),{hash:o,pathname:s,search:c}=Ws(e,{relative:t}),u=s;return n!=="/"&&(u=s==="/"?n:ir([n,s])),a.createHref({pathname:u,search:c,hash:o})}function Hs(){return b.useContext(bu)!=null}function Fn(){return Xe(Hs(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(bu).location}var nb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function rb(e){b.useContext(Bn).static||b.useLayoutEffect(e)}function wu(){let{isDataRoute:e}=b.useContext(Gr);return e?u1():QC()}function QC(){Xe(Hs(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(pi),{basename:t,navigator:n}=b.useContext(Bn),{matches:a}=b.useContext(Gr),{pathname:o}=Fn(),s=JSON.stringify(ep(a)),c=b.useRef(!1);return rb(()=>{c.current=!0}),b.useCallback((h,f={})=>{if(Et(c.current,nb),!c.current)return;if(typeof h=="number"){n.go(h);return}let m=_u(h,JSON.parse(s),o,f.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:ir([t,m.pathname])),(f.replace?n.replace:n.push)(m,f.state,f)},[t,n,s,o,e])}b.createContext(null);function Ws(e,{relative:t}={}){let{matches:n}=b.useContext(Gr),{pathname:a}=Fn(),o=JSON.stringify(ep(n));return b.useMemo(()=>_u(e,JSON.parse(o),a,t==="path"),[e,o,a,t])}function JC(e,t,n){Xe(Hs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=b.useContext(Bn),{matches:o}=b.useContext(Gr),s=o[o.length-1],c=s?s.params:{},u=s?s.pathname:"/",h=s?s.pathnameBase:"/",f=s&&s.route;{let S=f&&f.path||"";ib(u,!f||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
11
11
 
12
- Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let m=Fn(),y;y=m;let k=y.pathname||"/",w=k;if(h!=="/"){let S=h.replace(/^\//,"").split("/");w="/"+k.replace(/^\//,"").split("/").slice(S.length).join("/")}let P=Ca(e,{pathname:w});return Et(f||P!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Et(P==null||P[P.length-1].route.element!==void 0||P[P.length-1].route.Component!==void 0||P[P.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.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.`),n1(P&&P.map(S=>Object.assign({},S,{params:Object.assign({},c,S.params),pathname:ar([h,a.encodeLocation?a.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?h:ar([h,a.encodeLocation?a.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),s,n)}function QC(){let e=o1(),t=Mo(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:o},"ErrorBoundary")," or"," ",b.createElement("code",{style:o},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:s},n):null,c)}var JC=b.createElement(QC,null),ab=class extends b.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=qC(e.digest);n&&(e=n)}let t=e!==void 0?b.createElement(Kr.Provider,{value:this.props.routeContext},b.createElement(ip.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(e1,{error:e},t):t}};ab.contextType=J_;var Sh=new WeakMap;function e1({children:e,error:t}){let{basename:n}=b.useContext(Bn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=GC(t.digest);if(a){let s=Sh.get(t);if(s)throw s;let o=F_(a.location,n);if(B_&&!Sh.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw Sh.set(t,c),c}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function t1({routeContext:e,match:t,children:n}){let a=b.useContext(pi);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(Kr.Provider,{value:e},n)}function n1(e,t=[],n){let a=n?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let s=e,o=a?.errors;if(o!=null){let m=s.findIndex(y=>y.route.id&&o?.[y.route.id]!==void 0);Xe(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,m+1))}let c=!1,u=-1;if(n&&a){c=a.renderFallback;for(let m=0;m<s.length;m++){let y=s[m];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(u=m),y.route.id){let{loaderData:k,errors:w}=a,P=y.route.loader&&!k.hasOwnProperty(y.route.id)&&(!w||w[y.route.id]===void 0);if(y.route.lazy||P){n.isStatic&&(c=!0),u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}}let h=n?.onError,f=a&&h?(m,y)=>{h(m,{location:a.location,params:a.matches?.[0]?.params??{},unstable_pattern:zo(a.matches),errorInfo:y})}:void 0;return s.reduceRight((m,y,k)=>{let w,P=!1,C=null,S=null;a&&(w=o&&y.route.id?o[y.route.id]:void 0,C=y.route.errorElement||JC,c&&(u<0&&k===0?(ib("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),P=!0,S=null):u===k&&(P=!0,S=y.route.hydrateFallbackElement||null)));let D=t.concat(s.slice(0,k+1)),L=()=>{let R;return w?R=C:P?R=S:y.route.Component?R=b.createElement(y.route.Component,null):y.route.element?R=y.route.element:R=m,b.createElement(t1,{match:y,routeContext:{outlet:m,matches:D,isDataRoute:a!=null},children:R})};return a&&(y.route.ErrorBoundary||y.route.errorElement||k===0)?b.createElement(ab,{location:a.location,revalidation:a.revalidation,component:C,error:w,children:L(),routeContext:{outlet:null,matches:D,isDataRoute:!0},onError:f}):L()},null)}function sp(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function r1(e){let t=b.useContext(pi);return Xe(t,sp(e)),t}function a1(e){let t=b.useContext($o);return Xe(t,sp(e)),t}function i1(e){let t=b.useContext(Kr);return Xe(t,sp(e)),t}function op(e){let t=i1(e),n=t.matches[t.matches.length-1];return Xe(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function s1(){return op("useRouteId")}function o1(){let e=b.useContext(ip),t=a1("useRouteError"),n=op("useRouteError");return e!==void 0?e:t.errors?.[n]}function l1(){let{router:e}=r1("useNavigate"),t=op("useNavigate"),n=b.useRef(!1);return rb(()=>{n.current=!0}),b.useCallback(async(s,o={})=>{Et(n.current,nb),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var mv={};function ib(e,t,n){!t&&!mv[e]&&(mv[e]=!0,Et(!1,n))}var gv={};function yv(e,t){!e&&!gv[t]&&(gv[t]=!0,console.warn(t))}var c1="useOptimistic",vv=CS[c1],u1=()=>{};function d1(e){return vv?vv(e):[e,u1]}function h1(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Et(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:b.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Et(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:b.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Et(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:b.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var f1=["HydrateFallback","hydrateFallbackElement"],p1=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function m1({router:e,flushSync:t,onError:n,unstable_useTransitions:a}){a=$C()||a;let[o,c]=b.useState(e.state),[u,h]=d1(o),[f,m]=b.useState(),[y,k]=b.useState({isTransitioning:!1}),[w,P]=b.useState(),[C,S]=b.useState(),[D,L]=b.useState(),R=b.useRef(new Map),O=b.useCallback((x,{deletedFetchers:Y,newErrors:X,flushSync:le,viewTransitionOpts:oe})=>{X&&n&&Object.values(X).forEach(de=>n(de,{location:x.location,params:x.matches[0]?.params??{},unstable_pattern:zo(x.matches)})),x.fetchers.forEach((de,fe)=>{de.data!==void 0&&R.current.set(fe,de.data)}),Y.forEach(de=>R.current.delete(de)),yv(le===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let Ae=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(yv(oe==null||Ae,"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."),!oe||!Ae){t&&le?t(()=>c(x)):a===!1?c(x):b.startTransition(()=>{a===!0&&h(de=>kv(de,x)),c(x)});return}if(t&&le){t(()=>{C&&(w?.resolve(),C.skipTransition()),k({isTransitioning:!0,flushSync:!0,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation})});let de=e.window.document.startViewTransition(()=>{t(()=>c(x))});de.finished.finally(()=>{t(()=>{P(void 0),S(void 0),m(void 0),k({isTransitioning:!1})})}),t(()=>S(de));return}C?(w?.resolve(),C.skipTransition(),L({state:x,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation})):(m(x),k({isTransitioning:!0,flushSync:!1,currentLocation:oe.currentLocation,nextLocation:oe.nextLocation}))},[e.window,t,C,w,a,h,n]);b.useLayoutEffect(()=>e.subscribe(O),[e,O]),b.useEffect(()=>{y.isTransitioning&&!y.flushSync&&P(new p1)},[y]),b.useEffect(()=>{if(w&&f&&e.window){let x=f,Y=w.promise,X=e.window.document.startViewTransition(async()=>{a===!1?c(x):b.startTransition(()=>{a===!0&&h(le=>kv(le,x)),c(x)}),await Y});X.finished.finally(()=>{P(void 0),S(void 0),m(void 0),k({isTransitioning:!1})}),S(X)}},[f,w,e.window,a,h]),b.useEffect(()=>{w&&f&&u.location.key===f.location.key&&w.resolve()},[w,C,u.location,f]),b.useEffect(()=>{!y.isTransitioning&&D&&(m(D.state),k({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}),L(void 0))},[y.isTransitioning,D]);let W=b.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:x=>e.navigate(x),push:(x,Y,X)=>e.navigate(x,{state:Y,preventScrollReset:X?.preventScrollReset}),replace:(x,Y,X)=>e.navigate(x,{replace:!0,state:Y,preventScrollReset:X?.preventScrollReset})}),[e]),K=e.basename||"/",$=b.useMemo(()=>({router:e,navigator:W,static:!1,basename:K,onError:n}),[e,W,K,n]);return b.createElement(b.Fragment,null,b.createElement(pi.Provider,{value:$},b.createElement($o.Provider,{value:u},b.createElement(eb.Provider,{value:R.current},b.createElement(ap.Provider,{value:y},b.createElement(v1,{basename:K,location:u.location,navigationType:u.historyAction,navigator:W,unstable_useTransitions:a},b.createElement(g1,{routes:e.routes,future:e.future,state:u,isStatic:!1,onError:n})))))),null)}function kv(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var g1=b.memo(y1);function y1({routes:e,future:t,state:n,isStatic:a,onError:s}){return XC(e,void 0,{state:n,isStatic:a,onError:s})}function v1({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:s,static:o=!1,unstable_useTransitions:c}){Xe(!Ho(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),h=b.useMemo(()=>({basename:u,navigator:s,static:o,unstable_useTransitions:c,future:{}}),[u,s,o,c]);typeof n=="string"&&(n=Wr(n));let{pathname:f="/",search:m="",hash:y="",state:k=null,key:w="default",unstable_mask:P}=n,C=b.useMemo(()=>{let S=Un(f,u);return S==null?null:{location:{pathname:S,search:m,hash:y,state:k,key:w,unstable_mask:P},navigationType:a}},[u,f,m,y,k,w,a,P]);return Et(C!=null,`<Router basename="${u}"> is not able to match the URL "${f}${m}${y}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:b.createElement(Bn.Provider,{value:h},b.createElement(_u.Provider,{children:t,value:C}))}var Tc="get",Ec="application/x-www-form-urlencoded";function wu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function k1(e){return wu(e)&&e.tagName.toLowerCase()==="button"}function _1(e){return wu(e)&&e.tagName.toLowerCase()==="form"}function b1(e){return wu(e)&&e.tagName.toLowerCase()==="input"}function w1(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function x1(e,t){return e.button===0&&(!t||t==="_self")&&!w1(e)}function sf(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let a=e[n];return t.concat(Array.isArray(a)?a.map(s=>[n,s]):[[n,a]])},[]))}function P1(e,t){let n=sf(e);return t&&t.forEach((a,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}var hc=null;function S1(){if(hc===null)try{new FormData(document.createElement("form"),0),hc=!1}catch{hc=!0}return hc}var C1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ch(e){return e!=null&&!C1.has(e)?(Et(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ec}"`),null):e}function T1(e,t){let n,a,s,o,c;if(_1(e)){let u=e.getAttribute("action");a=u?Un(u,t):null,n=e.getAttribute("method")||Tc,s=Ch(e.getAttribute("enctype"))||Ec,o=new FormData(e)}else if(k1(e)||b1(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||u.getAttribute("action");if(a=h?Un(h,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Tc,s=Ch(e.getAttribute("formenctype"))||Ch(u.getAttribute("enctype"))||Ec,o=new FormData(u,e),!S1()){let{name:f,type:m,value:y}=e;if(m==="image"){let k=f?`${f}.`:"";o.append(`${k}x`,"0"),o.append(`${k}y`,"0")}else f&&o.append(f,y)}}else{if(wu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Tc,a=null,s=Ec,c=e}return o&&s==="text/plain"&&(c=o,o=void 0),{action:a,method:n.toLowerCase(),encType:s,formData:o,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function lp(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function E1(e,t,n,a){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${a}`:s.pathname=`${s.pathname}.${a}`:s.pathname==="/"?s.pathname=`_root.${a}`:t&&Un(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${a}`,s}async function A1(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function R1(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function L1(e,t,n){let a=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let c=await A1(o,n);return c.links?c.links():[]}return[]}));return N1(a.flat(1).filter(R1).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function _v(e,t,n,a,s,o){let c=(h,f)=>n[f]?h.route.id!==n[f].route.id:!0,u=(h,f)=>n[f].pathname!==h.pathname||n[f].route.path?.endsWith("*")&&n[f].params["*"]!==h.params["*"];return o==="assets"?t.filter((h,f)=>c(h,f)||u(h,f)):o==="data"?t.filter((h,f)=>{let m=a.routes[h.route.id];if(!m||!m.hasLoader)return!1;if(c(h,f)||u(h,f))return!0;if(h.route.shouldRevalidate){let y=h.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function D1(e,t,{includeHydrateFallback:n}={}){return M1(e.map(a=>{let s=t.routes[a.route.id];if(!s)return[];let o=[s.module];return s.clientActionModule&&(o=o.concat(s.clientActionModule)),s.clientLoaderModule&&(o=o.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(o=o.concat(s.hydrateFallbackModule)),s.imports&&(o=o.concat(s.imports)),o}).flat(1))}function M1(e){return[...new Set(e)]}function I1(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function N1(e,t){let n=new Set;return new Set(t),e.reduce((a,s)=>{let o=JSON.stringify(I1(s));return n.has(o)||(n.add(o),a.push({key:o,link:s})),a},[])}function sb(){let e=b.useContext(pi);return lp(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function O1(){let e=b.useContext($o);return lp(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var cp=b.createContext(void 0);cp.displayName="FrameworkContext";function ob(){let e=b.useContext(cp);return lp(e,"You must render this element inside a <HydratedRouter> element"),e}function j1(e,t){let n=b.useContext(cp),[a,s]=b.useState(!1),[o,c]=b.useState(!1),{onFocus:u,onBlur:h,onMouseEnter:f,onMouseLeave:m,onTouchStart:y}=t,k=b.useRef(null);b.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let C=D=>{D.forEach(L=>{c(L.isIntersecting)})},S=new IntersectionObserver(C,{threshold:.5});return k.current&&S.observe(k.current),()=>{S.disconnect()}}},[e]),b.useEffect(()=>{if(a){let C=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(C)}}},[a]);let w=()=>{s(!0)},P=()=>{s(!1),c(!1)};return n?e!=="intent"?[o,k,{}]:[o,k,{onFocus:ho(u,w),onBlur:ho(h,P),onMouseEnter:ho(f,w),onMouseLeave:ho(m,P),onTouchStart:ho(y,w)}]:[!1,k,{}]}function ho(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function U1({page:e,...t}){let{router:n}=sb(),a=b.useMemo(()=>Ca(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?b.createElement(F1,{page:e,matches:a,...t}):null}function B1(e){let{manifest:t,routeModules:n}=ob(),[a,s]=b.useState([]);return b.useEffect(()=>{let o=!1;return L1(e,t,n).then(c=>{o||s(c)}),()=>{o=!0}},[e,t,n]),a}function F1({page:e,matches:t,...n}){let a=Fn(),{future:s,manifest:o,routeModules:c}=ob(),{basename:u}=sb(),{loaderData:h,matches:f}=O1(),m=b.useMemo(()=>_v(e,t,f,o,a,"data"),[e,t,f,o,a]),y=b.useMemo(()=>_v(e,t,f,o,a,"assets"),[e,t,f,o,a]),k=b.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let C=new Set,S=!1;if(t.forEach(L=>{let R=o.routes[L.route.id];!R||!R.hasLoader||(!m.some(O=>O.route.id===L.route.id)&&L.route.id in h&&c[L.route.id]?.shouldRevalidate||R.hasClientLoader?S=!0:C.add(L.route.id))}),C.size===0)return[];let D=E1(e,u,s.unstable_trailingSlashAwareDataRequests,"data");return S&&C.size>0&&D.searchParams.set("_routes",t.filter(L=>C.has(L.route.id)).map(L=>L.route.id).join(",")),[D.pathname+D.search]},[u,s.unstable_trailingSlashAwareDataRequests,h,a,o,m,t,e,c]),w=b.useMemo(()=>D1(y,o),[y,o]),P=B1(y);return b.createElement(b.Fragment,null,k.map(C=>b.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...n})),w.map(C=>b.createElement("link",{key:C,rel:"modulepreload",href:C,...n})),P.map(({key:C,link:S})=>b.createElement("link",{key:C,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function V1(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var z1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{z1&&(window.__reactRouterVersion="7.13.1")}catch{}function $1(e,t){return vC({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:IS({window:t?.window}),hydrationData:H1(),routes:e,mapRouteProperties:h1,hydrationRouteProperties:f1,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function H1(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:W1(e.errors)}),e}function W1(e){if(!e)return null;let t=Object.entries(e),n={};for(let[a,s]of t)if(s&&s.__type==="RouteErrorResponse")n[a]=new Vo(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let o=window[s.__subType];if(typeof o=="function")try{let c=new o(s.message);c.stack="",n[a]=c}catch{}}if(n[a]==null){let o=new Error(s.message);o.stack="",n[a]=o}}else n[a]=s;return n}var lb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,xu=b.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:s,reloadDocument:o,replace:c,unstable_mask:u,state:h,target:f,to:m,preventScrollReset:y,viewTransition:k,unstable_defaultShouldRevalidate:w,...P},C){let{basename:S,navigator:D,unstable_useTransitions:L}=b.useContext(Bn),R=typeof m=="string"&&lb.test(m),O=F_(m,S);m=O.to;let W=YC(m,{relative:s}),K=Fn(),$=null;if(u){let fe=ku(u,[],K.unstable_mask?K.unstable_mask.pathname:"/",!0);S!=="/"&&(fe.pathname=fe.pathname==="/"?S:ar([S,fe.pathname])),$=D.createHref(fe)}let[x,Y,X]=j1(a,P),le=Y1(m,{replace:c,unstable_mask:u,state:h,target:f,preventScrollReset:y,relative:s,viewTransition:k,unstable_defaultShouldRevalidate:w,unstable_useTransitions:L});function oe(fe){t&&t(fe),fe.defaultPrevented||le(fe)}let Ae=!(O.isExternal||o),de=b.createElement("a",{...P,...X,href:(Ae?$:void 0)||O.absoluteURL||W,onClick:Ae?oe:t,ref:V1(C,Y),target:f,"data-discover":!R&&n==="render"?"true":void 0});return x&&!R?b.createElement(b.Fragment,null,de,b.createElement(U1,{page:W})):de});xu.displayName="Link";var K1=b.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:s=!1,style:o,to:c,viewTransition:u,children:h,...f},m){let y=Wo(c,{relative:f.relative}),k=Fn(),w=b.useContext($o),{navigator:P,basename:C}=b.useContext(Bn),S=w!=null&&eT(y)&&u===!0,D=P.encodeLocation?P.encodeLocation(y).pathname:y.pathname,L=k.pathname,R=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;n||(L=L.toLowerCase(),R=R?R.toLowerCase():null,D=D.toLowerCase()),R&&C&&(R=Un(R,C)||R);const O=D!=="/"&&D.endsWith("/")?D.length-1:D.length;let W=L===D||!s&&L.startsWith(D)&&L.charAt(O)==="/",K=R!=null&&(R===D||!s&&R.startsWith(D)&&R.charAt(D.length)==="/"),$={isActive:W,isPending:K,isTransitioning:S},x=W?t:void 0,Y;typeof a=="function"?Y=a($):Y=[a,W?"active":null,K?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let X=typeof o=="function"?o($):o;return b.createElement(xu,{...f,"aria-current":x,className:Y,ref:m,style:X,to:c,viewTransition:u},typeof h=="function"?h($):h)});K1.displayName="NavLink";var G1=b.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:s,state:o,method:c=Tc,action:u,onSubmit:h,relative:f,preventScrollReset:m,viewTransition:y,unstable_defaultShouldRevalidate:k,...w},P)=>{let{unstable_useTransitions:C}=b.useContext(Bn),S=Q1(),D=J1(u,{relative:f}),L=c.toLowerCase()==="get"?"get":"post",R=typeof u=="string"&&lb.test(u),O=W=>{if(h&&h(W),W.defaultPrevented)return;W.preventDefault();let K=W.nativeEvent.submitter,$=K?.getAttribute("formmethod")||c,x=()=>S(K||W.currentTarget,{fetcherKey:t,method:$,navigate:n,replace:s,state:o,relative:f,preventScrollReset:m,viewTransition:y,unstable_defaultShouldRevalidate:k});C&&n!==!1?b.startTransition(()=>x()):x()};return b.createElement("form",{ref:P,method:L,action:D,onSubmit:a?h:O,...w,"data-discover":!R&&e==="render"?"true":void 0})});G1.displayName="Form";function q1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cb(e){let t=b.useContext(pi);return Xe(t,q1(e)),t}function Y1(e,{target:t,replace:n,unstable_mask:a,state:s,preventScrollReset:o,relative:c,viewTransition:u,unstable_defaultShouldRevalidate:h,unstable_useTransitions:f}={}){let m=bu(),y=Fn(),k=Wo(e,{relative:c});return b.useCallback(w=>{if(x1(w,t)){w.preventDefault();let P=n!==void 0?n:kr(y)===kr(k),C=()=>m(e,{replace:P,unstable_mask:a,state:s,preventScrollReset:o,relative:c,viewTransition:u,unstable_defaultShouldRevalidate:h});f?b.startTransition(()=>C()):C()}},[y,m,k,n,a,s,t,e,o,c,u,h,f])}function Jj(e){Et(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=b.useRef(sf(e)),n=b.useRef(!1),a=Fn(),s=b.useMemo(()=>P1(a.search,n.current?null:t.current),[a.search]),o=bu(),c=b.useCallback((u,h)=>{const f=sf(typeof u=="function"?u(new URLSearchParams(s)):u);n.current=!0,o("?"+f,h)},[o,s]);return[s,c]}var Z1=0,X1=()=>`__${String(++Z1)}__`;function Q1(){let{router:e}=cb("useSubmit"),{basename:t}=b.useContext(Bn),n=s1(),a=e.fetch,s=e.navigate;return b.useCallback(async(o,c={})=>{let{action:u,method:h,encType:f,formData:m,body:y}=T1(o,t);if(c.navigate===!1){let k=c.fetcherKey||X1();await a(k,n,c.action||u,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:m,body:y,formMethod:c.method||h,formEncType:c.encType||f,flushSync:c.flushSync})}else await s(c.action||u,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:m,body:y,formMethod:c.method||h,formEncType:c.encType||f,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[a,s,t,n])}function J1(e,{relative:t}={}){let{basename:n}=b.useContext(Bn),a=b.useContext(Kr);Xe(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),o={...Wo(e||".",{relative:t})},c=Fn();if(e==null){o.search=c.search;let u=new URLSearchParams(o.search),h=u.getAll("index");if(h.some(m=>m==="")){u.delete("index"),h.filter(y=>y).forEach(y=>u.append("index",y));let m=u.toString();o.search=m?`?${m}`:""}}return(!e||e===".")&&s.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:ar([n,o.pathname])),kr(o)}function eT(e,{relative:t}={}){let n=b.useContext(ap);Xe(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=cb("useViewTransitionState"),s=Wo(e,{relative:t});if(!n.isTransitioning)return!1;let o=Un(n.currentLocation.pathname,a)||n.currentLocation.pathname,c=Un(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Wc(s.pathname,c)!=null||Wc(s.pathname,o)!=null}var tT=D_();function nT(e){return b.createElement(m1,{flushSync:tT.flushSync,...e})}var it;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const o={};for(const c of s)o[c]=c;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),c={};for(const u of o)c[u]=s[u];return e.objectValues(c)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&o.push(c);return o},e.find=(s,o)=>{for(const c of s)if(o(c))return c},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function a(s,o=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(o)}e.joinValues=a,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(it||(it={}));var bv;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(bv||(bv={}));const ge=it.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Sa=e=>{switch(typeof e){case"undefined":return ge.undefined;case"string":return ge.string;case"number":return Number.isNaN(e)?ge.nan:ge.number;case"boolean":return ge.boolean;case"function":return ge.function;case"bigint":return ge.bigint;case"symbol":return ge.symbol;case"object":return Array.isArray(e)?ge.array:e===null?ge.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ge.promise:typeof Map<"u"&&e instanceof Map?ge.map:typeof Set<"u"&&e instanceof Set?ge.set:typeof Date<"u"&&e instanceof Date?ge.date:ge.object;default:return ge.unknown}},re=it.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Hr extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(o){return o.message},a={_errors:[]},s=o=>{for(const c of o.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)a._errors.push(n(c));else{let u=a,h=0;for(;h<c.path.length;){const f=c.path[h];h===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],h++}}};return s(this),a}static assert(t){if(!(t instanceof Hr))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,it.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},a=[];for(const s of this.issues)if(s.path.length>0){const o=s.path[0];n[o]=n[o]||[],n[o].push(t(s))}else a.push(t(s));return{formErrors:a,fieldErrors:n}}get formErrors(){return this.flatten()}}Hr.create=e=>new Hr(e);const of=(e,t)=>{let n;switch(e.code){case re.invalid_type:e.received===ge.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case re.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,it.jsonStringifyReplacer)}`;break;case re.unrecognized_keys:n=`Unrecognized key(s) in object: ${it.joinValues(e.keys,", ")}`;break;case re.invalid_union:n="Invalid input";break;case re.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${it.joinValues(e.options)}`;break;case re.invalid_enum_value:n=`Invalid enum value. Expected ${it.joinValues(e.options)}, received '${e.received}'`;break;case re.invalid_arguments:n="Invalid function arguments";break;case re.invalid_return_type:n="Invalid function return type";break;case re.invalid_date:n="Invalid date";break;case re.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:it.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case re.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case re.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case re.custom:n="Invalid input";break;case re.invalid_intersection_types:n="Intersection results could not be merged";break;case re.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case re.not_finite:n="Number must be finite";break;default:n=t.defaultError,it.assertNever(e)}return{message:n}};let rT=of;function aT(){return rT}const iT=e=>{const{data:t,path:n,errorMaps:a,issueData:s}=e,o=[...n,...s.path||[]],c={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let u="";const h=a.filter(f=>!!f).slice().reverse();for(const f of h)u=f(c,{data:t,defaultError:u}).message;return{...s,path:o,message:u}};function ce(e,t){const n=aT(),a=iT({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===of?void 0:of].filter(s=>!!s)});e.common.issues.push(a)}class un{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const a=[];for(const s of n){if(s.status==="aborted")return ze;s.status==="dirty"&&t.dirty(),a.push(s.value)}return{status:t.value,value:a}}static async mergeObjectAsync(t,n){const a=[];for(const s of n){const o=await s.key,c=await s.value;a.push({key:o,value:c})}return un.mergeObjectSync(t,a)}static mergeObjectSync(t,n){const a={};for(const s of n){const{key:o,value:c}=s;if(o.status==="aborted"||c.status==="aborted")return ze;o.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(a[o.value]=c.value)}return{status:t.value,value:a}}}const ze=Object.freeze({status:"aborted"}),vo=e=>({status:"dirty",value:e}),Vn=e=>({status:"valid",value:e}),wv=e=>e.status==="aborted",xv=e=>e.status==="dirty",cs=e=>e.status==="valid",Kc=e=>typeof Promise<"u"&&e instanceof Promise;var Ce;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Ce||(Ce={}));class _r{constructor(t,n,a,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=a,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Pv=(e,t)=>{if(cs(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Hr(e.common.issues);return this._error=n,this._error}}};function Ke(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:a,description:s}=e;if(t&&(n||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(c,u)=>{const{message:h}=e;return c.code==="invalid_enum_value"?{message:h??u.defaultError}:typeof u.data>"u"?{message:h??a??u.defaultError}:c.code!=="invalid_type"?{message:u.defaultError}:{message:h??n??u.defaultError}},description:s}}class Je{get description(){return this._def.description}_getType(t){return Sa(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Sa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new un,ctx:{common:t.parent.common,data:t.data,parsedType:Sa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Kc(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const a=this.safeParse(t,n);if(a.success)return a.data;throw a.error}safeParse(t,n){const a={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Sa(t)},s=this._parseSync({data:t,path:a.path,parent:a});return Pv(a,s)}"~validate"(t){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Sa(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:n});return cs(a)?{value:a.value}:{issues:n.common.issues}}catch(a){a?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(a=>cs(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(t,n){const a=await this.safeParseAsync(t,n);if(a.success)return a.data;throw a.error}async safeParseAsync(t,n){const a={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Sa(t)},s=this._parse({data:t,path:a.path,parent:a}),o=await(Kc(s)?s:Promise.resolve(s));return Pv(a,o)}refine(t,n){const a=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,o)=>{const c=t(s),u=()=>o.addIssue({code:re.custom,...a(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(h=>h?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(t,n){return this._refinement((a,s)=>t(a)?!0:(s.addIssue(typeof n=="function"?n(a,s):n),!1))}_refinement(t){return new di({schema:this,typeName:$e.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return $r.create(this,this._def)}nullable(){return hi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return yr.create(this)}promise(){return Qc.create(this,this._def)}or(t){return qc.create([this,t],this._def)}and(t){return Yc.create(this,t,this._def)}transform(t){return new di({...Ke(this._def),schema:this,typeName:$e.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Jc({...Ke(this._def),innerType:this,defaultValue:n,typeName:$e.ZodDefault})}brand(){return new fb({typeName:$e.ZodBranded,type:this,...Ke(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new eu({...Ke(this._def),innerType:this,catchValue:n,typeName:$e.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return dp.create(this,t)}readonly(){return tu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const sT=/^c[^\s-]{8,}$/i,oT=/^[0-9a-z]+$/,lT=/^[0-9A-HJKMNP-TV-Z]{26}$/i,cT=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,uT=/^[a-z0-9_-]{21}$/i,dT=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,hT=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,fT=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,pT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Th;const mT=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gT=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,yT=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,vT=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,kT=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_T=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ub="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",bT=new RegExp(`^${ub}$`);function db(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function wT(e){return new RegExp(`^${db(e)}$`)}function xT(e){let t=`${ub}T${db(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function PT(e,t){return!!((t==="v4"||!t)&&mT.test(e)||(t==="v6"||!t)&&yT.test(e))}function ST(e,t){if(!dT.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const a=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(a));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function CT(e,t){return!!((t==="v4"||!t)&&gT.test(e)||(t==="v6"||!t)&&vT.test(e))}class gr extends Je{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ge.string){const o=this._getOrReturnCtx(t);return ce(o,{code:re.invalid_type,expected:ge.string,received:o.parsedType}),ze}const a=new un;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(s=this._getOrReturnCtx(t,s),ce(s,{code:re.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),a.dirty());else if(o.kind==="max")t.data.length>o.value&&(s=this._getOrReturnCtx(t,s),ce(s,{code:re.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),a.dirty());else if(o.kind==="length"){const c=t.data.length>o.value,u=t.data.length<o.value;(c||u)&&(s=this._getOrReturnCtx(t,s),c?ce(s,{code:re.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):u&&ce(s,{code:re.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),a.dirty())}else if(o.kind==="email")fT.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"email",code:re.invalid_string,message:o.message}),a.dirty());else if(o.kind==="emoji")Th||(Th=new RegExp(pT,"u")),Th.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"emoji",code:re.invalid_string,message:o.message}),a.dirty());else if(o.kind==="uuid")cT.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"uuid",code:re.invalid_string,message:o.message}),a.dirty());else if(o.kind==="nanoid")uT.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"nanoid",code:re.invalid_string,message:o.message}),a.dirty());else if(o.kind==="cuid")sT.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"cuid",code:re.invalid_string,message:o.message}),a.dirty());else if(o.kind==="cuid2")oT.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"cuid2",code:re.invalid_string,message:o.message}),a.dirty());else if(o.kind==="ulid")lT.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"ulid",code:re.invalid_string,message:o.message}),a.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),ce(s,{validation:"url",code:re.invalid_string,message:o.message}),a.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"regex",code:re.invalid_string,message:o.message}),a.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(t,s),ce(s,{code:re.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),a.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(s=this._getOrReturnCtx(t,s),ce(s,{code:re.invalid_string,validation:{startsWith:o.value},message:o.message}),a.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(s=this._getOrReturnCtx(t,s),ce(s,{code:re.invalid_string,validation:{endsWith:o.value},message:o.message}),a.dirty()):o.kind==="datetime"?xT(o).test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{code:re.invalid_string,validation:"datetime",message:o.message}),a.dirty()):o.kind==="date"?bT.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{code:re.invalid_string,validation:"date",message:o.message}),a.dirty()):o.kind==="time"?wT(o).test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{code:re.invalid_string,validation:"time",message:o.message}),a.dirty()):o.kind==="duration"?hT.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"duration",code:re.invalid_string,message:o.message}),a.dirty()):o.kind==="ip"?PT(t.data,o.version)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"ip",code:re.invalid_string,message:o.message}),a.dirty()):o.kind==="jwt"?ST(t.data,o.alg)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"jwt",code:re.invalid_string,message:o.message}),a.dirty()):o.kind==="cidr"?CT(t.data,o.version)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"cidr",code:re.invalid_string,message:o.message}),a.dirty()):o.kind==="base64"?kT.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"base64",code:re.invalid_string,message:o.message}),a.dirty()):o.kind==="base64url"?_T.test(t.data)||(s=this._getOrReturnCtx(t,s),ce(s,{validation:"base64url",code:re.invalid_string,message:o.message}),a.dirty()):it.assertNever(o);return{status:a.value,value:t.data}}_regex(t,n,a){return this.refinement(s=>t.test(s),{validation:n,code:re.invalid_string,...Ce.errToObj(a)})}_addCheck(t){return new gr({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ce.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ce.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ce.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ce.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ce.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ce.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ce.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ce.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ce.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ce.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ce.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ce.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ce.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...Ce.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Ce.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Ce.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ce.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Ce.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ce.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ce.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ce.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ce.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ce.errToObj(n)})}nonempty(t){return this.min(1,Ce.errToObj(t))}trim(){return new gr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new gr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new gr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}gr.create=e=>new gr({checks:[],typeName:$e.ZodString,coerce:e?.coerce??!1,...Ke(e)});function TT(e,t){const n=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,s=n>a?n:a,o=Number.parseInt(e.toFixed(s).replace(".","")),c=Number.parseInt(t.toFixed(s).replace(".",""));return o%c/10**s}class oi extends Je{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ge.number){const o=this._getOrReturnCtx(t);return ce(o,{code:re.invalid_type,expected:ge.number,received:o.parsedType}),ze}let a;const s=new un;for(const o of this._def.checks)o.kind==="int"?it.isInteger(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{code:re.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?TT(t.data,o.value)!==0&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{code:re.not_finite,message:o.message}),s.dirty()):it.assertNever(o);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ce.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ce.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ce.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ce.toString(n))}setLimit(t,n,a,s){return new oi({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:a,message:Ce.toString(s)}]})}_addCheck(t){return new oi({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ce.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ce.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ce.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ce.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ce.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ce.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&it.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(n===null||a.value>n)&&(n=a.value):a.kind==="max"&&(t===null||a.value<t)&&(t=a.value)}return Number.isFinite(n)&&Number.isFinite(t)}}oi.create=e=>new oi({checks:[],typeName:$e.ZodNumber,coerce:e?.coerce||!1,...Ke(e)});class li extends Je{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ge.bigint)return this._getInvalidInput(t);let a;const s=new un;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):it.assertNever(o);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return ce(n,{code:re.invalid_type,expected:ge.bigint,received:n.parsedType}),ze}gte(t,n){return this.setLimit("min",t,!0,Ce.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ce.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ce.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ce.toString(n))}setLimit(t,n,a,s){return new li({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:a,message:Ce.toString(s)}]})}_addCheck(t){return new li({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ce.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ce.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}li.create=e=>new li({checks:[],typeName:$e.ZodBigInt,coerce:e?.coerce??!1,...Ke(e)});class Gc extends Je{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ge.boolean){const a=this._getOrReturnCtx(t);return ce(a,{code:re.invalid_type,expected:ge.boolean,received:a.parsedType}),ze}return Vn(t.data)}}Gc.create=e=>new Gc({typeName:$e.ZodBoolean,coerce:e?.coerce||!1,...Ke(e)});class us extends Je{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ge.date){const o=this._getOrReturnCtx(t);return ce(o,{code:re.invalid_type,expected:ge.date,received:o.parsedType}),ze}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ce(o,{code:re.invalid_date}),ze}const a=new un;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(s=this._getOrReturnCtx(t,s),ce(s,{code:re.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),a.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(s=this._getOrReturnCtx(t,s),ce(s,{code:re.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),a.dirty()):it.assertNever(o);return{status:a.value,value:new Date(t.data.getTime())}}_addCheck(t){return new us({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ce.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ce.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}us.create=e=>new us({checks:[],coerce:e?.coerce||!1,typeName:$e.ZodDate,...Ke(e)});class Sv extends Je{_parse(t){if(this._getType(t)!==ge.symbol){const a=this._getOrReturnCtx(t);return ce(a,{code:re.invalid_type,expected:ge.symbol,received:a.parsedType}),ze}return Vn(t.data)}}Sv.create=e=>new Sv({typeName:$e.ZodSymbol,...Ke(e)});class lf extends Je{_parse(t){if(this._getType(t)!==ge.undefined){const a=this._getOrReturnCtx(t);return ce(a,{code:re.invalid_type,expected:ge.undefined,received:a.parsedType}),ze}return Vn(t.data)}}lf.create=e=>new lf({typeName:$e.ZodUndefined,...Ke(e)});class cf extends Je{_parse(t){if(this._getType(t)!==ge.null){const a=this._getOrReturnCtx(t);return ce(a,{code:re.invalid_type,expected:ge.null,received:a.parsedType}),ze}return Vn(t.data)}}cf.create=e=>new cf({typeName:$e.ZodNull,...Ke(e)});class Cv extends Je{constructor(){super(...arguments),this._any=!0}_parse(t){return Vn(t.data)}}Cv.create=e=>new Cv({typeName:$e.ZodAny,...Ke(e)});class uf extends Je{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Vn(t.data)}}uf.create=e=>new uf({typeName:$e.ZodUnknown,...Ke(e)});class Da extends Je{_parse(t){const n=this._getOrReturnCtx(t);return ce(n,{code:re.invalid_type,expected:ge.never,received:n.parsedType}),ze}}Da.create=e=>new Da({typeName:$e.ZodNever,...Ke(e)});class Tv extends Je{_parse(t){if(this._getType(t)!==ge.undefined){const a=this._getOrReturnCtx(t);return ce(a,{code:re.invalid_type,expected:ge.void,received:a.parsedType}),ze}return Vn(t.data)}}Tv.create=e=>new Tv({typeName:$e.ZodVoid,...Ke(e)});class yr extends Je{_parse(t){const{ctx:n,status:a}=this._processInputParams(t),s=this._def;if(n.parsedType!==ge.array)return ce(n,{code:re.invalid_type,expected:ge.array,received:n.parsedType}),ze;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(ce(n,{code:c?re.too_big:re.too_small,minimum:u?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),a.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ce(n,{code:re.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),a.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ce(n,{code:re.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),a.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>s.type._parseAsync(new _r(n,c,n.path,u)))).then(c=>un.mergeArray(a,c));const o=[...n.data].map((c,u)=>s.type._parseSync(new _r(n,c,n.path,u)));return un.mergeArray(a,o)}get element(){return this._def.type}min(t,n){return new yr({...this._def,minLength:{value:t,message:Ce.toString(n)}})}max(t,n){return new yr({...this._def,maxLength:{value:t,message:Ce.toString(n)}})}length(t,n){return new yr({...this._def,exactLength:{value:t,message:Ce.toString(n)}})}nonempty(t){return this.min(1,t)}}yr.create=(e,t)=>new yr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$e.ZodArray,...Ke(t)});function es(e){if(e instanceof Rt){const t={};for(const n in e.shape){const a=e.shape[n];t[n]=$r.create(es(a))}return new Rt({...e._def,shape:()=>t})}else return e instanceof yr?new yr({...e._def,type:es(e.element)}):e instanceof $r?$r.create(es(e.unwrap())):e instanceof hi?hi.create(es(e.unwrap())):e instanceof ci?ci.create(e.items.map(t=>es(t))):e}class Rt extends Je{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=it.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==ge.object){const f=this._getOrReturnCtx(t);return ce(f,{code:re.invalid_type,expected:ge.object,received:f.parsedType}),ze}const{status:a,ctx:s}=this._processInputParams(t),{shape:o,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Da&&this._def.unknownKeys==="strip"))for(const f in s.data)c.includes(f)||u.push(f);const h=[];for(const f of c){const m=o[f],y=s.data[f];h.push({key:{status:"valid",value:f},value:m._parse(new _r(s,y,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Da){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)h.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(f==="strict")u.length>0&&(ce(s,{code:re.unrecognized_keys,keys:u}),a.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const y=s.data[m];h.push({key:{status:"valid",value:m},value:f._parse(new _r(s,y,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of h){const y=await m.key,k=await m.value;f.push({key:y,value:k,alwaysSet:m.alwaysSet})}return f}).then(f=>un.mergeObjectSync(a,f)):un.mergeObjectSync(a,h)}get shape(){return this._def.shape()}strict(t){return Ce.errToObj,new Rt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,a)=>{const s=this._def.errorMap?.(n,a).message??a.defaultError;return n.code==="unrecognized_keys"?{message:Ce.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new Rt({...this._def,unknownKeys:"strip"})}passthrough(){return new Rt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Rt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Rt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:$e.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Rt({...this._def,catchall:t})}pick(t){const n={};for(const a of it.objectKeys(t))t[a]&&this.shape[a]&&(n[a]=this.shape[a]);return new Rt({...this._def,shape:()=>n})}omit(t){const n={};for(const a of it.objectKeys(this.shape))t[a]||(n[a]=this.shape[a]);return new Rt({...this._def,shape:()=>n})}deepPartial(){return es(this)}partial(t){const n={};for(const a of it.objectKeys(this.shape)){const s=this.shape[a];t&&!t[a]?n[a]=s:n[a]=s.optional()}return new Rt({...this._def,shape:()=>n})}required(t){const n={};for(const a of it.objectKeys(this.shape))if(t&&!t[a])n[a]=this.shape[a];else{let o=this.shape[a];for(;o instanceof $r;)o=o._def.innerType;n[a]=o}return new Rt({...this._def,shape:()=>n})}keyof(){return hb(it.objectKeys(this.shape))}}Rt.create=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strip",catchall:Da.create(),typeName:$e.ZodObject,...Ke(t)});Rt.strictCreate=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strict",catchall:Da.create(),typeName:$e.ZodObject,...Ke(t)});Rt.lazycreate=(e,t)=>new Rt({shape:e,unknownKeys:"strip",catchall:Da.create(),typeName:$e.ZodObject,...Ke(t)});class qc extends Je{_parse(t){const{ctx:n}=this._processInputParams(t),a=this._def.options;function s(o){for(const u of o)if(u.result.status==="valid")return u.result;for(const u of o)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=o.map(u=>new Hr(u.ctx.common.issues));return ce(n,{code:re.invalid_union,unionErrors:c}),ze}if(n.common.async)return Promise.all(a.map(async o=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let o;const c=[];for(const h of a){const f={...n,common:{...n.common,issues:[]},parent:null},m=h._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!o&&(o={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const u=c.map(h=>new Hr(h));return ce(n,{code:re.invalid_union,unionErrors:u}),ze}}get options(){return this._def.options}}qc.create=(e,t)=>new qc({options:e,typeName:$e.ZodUnion,...Ke(t)});const zr=e=>e instanceof hf?zr(e.schema):e instanceof di?zr(e.innerType()):e instanceof Xc?[e.value]:e instanceof ui?e.options:e instanceof ff?it.objectValues(e.enum):e instanceof Jc?zr(e._def.innerType):e instanceof lf?[void 0]:e instanceof cf?[null]:e instanceof $r?[void 0,...zr(e.unwrap())]:e instanceof hi?[null,...zr(e.unwrap())]:e instanceof fb||e instanceof tu?zr(e.unwrap()):e instanceof eu?zr(e._def.innerType):[];class up extends Je{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ge.object)return ce(n,{code:re.invalid_type,expected:ge.object,received:n.parsedType}),ze;const a=this.discriminator,s=n.data[a],o=this.optionsMap.get(s);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(ce(n,{code:re.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),ze)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,a){const s=new Map;for(const o of n){const c=zr(o.shape[t]);if(!c.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const u of c){if(s.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);s.set(u,o)}}return new up({typeName:$e.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...Ke(a)})}}function df(e,t){const n=Sa(e),a=Sa(t);if(e===t)return{valid:!0,data:e};if(n===ge.object&&a===ge.object){const s=it.objectKeys(t),o=it.objectKeys(e).filter(u=>s.indexOf(u)!==-1),c={...e,...t};for(const u of o){const h=df(e[u],t[u]);if(!h.valid)return{valid:!1};c[u]=h.data}return{valid:!0,data:c}}else if(n===ge.array&&a===ge.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o<e.length;o++){const c=e[o],u=t[o],h=df(c,u);if(!h.valid)return{valid:!1};s.push(h.data)}return{valid:!0,data:s}}else return n===ge.date&&a===ge.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Yc extends Je{_parse(t){const{status:n,ctx:a}=this._processInputParams(t),s=(o,c)=>{if(wv(o)||wv(c))return ze;const u=df(o.value,c.value);return u.valid?((xv(o)||xv(c))&&n.dirty(),{status:n.value,value:u.data}):(ce(a,{code:re.invalid_intersection_types}),ze)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([o,c])=>s(o,c)):s(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}Yc.create=(e,t,n)=>new Yc({left:e,right:t,typeName:$e.ZodIntersection,...Ke(n)});class ci extends Je{_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.parsedType!==ge.array)return ce(a,{code:re.invalid_type,expected:ge.array,received:a.parsedType}),ze;if(a.data.length<this._def.items.length)return ce(a,{code:re.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ze;!this._def.rest&&a.data.length>this._def.items.length&&(ce(a,{code:re.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...a.data].map((c,u)=>{const h=this._def.items[u]||this._def.rest;return h?h._parse(new _r(a,c,a.path,u)):null}).filter(c=>!!c);return a.common.async?Promise.all(o).then(c=>un.mergeArray(n,c)):un.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new ci({...this._def,rest:t})}}ci.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ci({items:e,typeName:$e.ZodTuple,rest:null,...Ke(t)})};class Zc extends Je{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.parsedType!==ge.object)return ce(a,{code:re.invalid_type,expected:ge.object,received:a.parsedType}),ze;const s=[],o=this._def.keyType,c=this._def.valueType;for(const u in a.data)s.push({key:o._parse(new _r(a,u,a.path,u)),value:c._parse(new _r(a,a.data[u],a.path,u)),alwaysSet:u in a.data});return a.common.async?un.mergeObjectAsync(n,s):un.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,a){return n instanceof Je?new Zc({keyType:t,valueType:n,typeName:$e.ZodRecord,...Ke(a)}):new Zc({keyType:gr.create(),valueType:t,typeName:$e.ZodRecord,...Ke(n)})}}class Ev extends Je{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.parsedType!==ge.map)return ce(a,{code:re.invalid_type,expected:ge.map,received:a.parsedType}),ze;const s=this._def.keyType,o=this._def.valueType,c=[...a.data.entries()].map(([u,h],f)=>({key:s._parse(new _r(a,u,a.path,[f,"key"])),value:o._parse(new _r(a,h,a.path,[f,"value"]))}));if(a.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const h of c){const f=await h.key,m=await h.value;if(f.status==="aborted"||m.status==="aborted")return ze;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const h of c){const f=h.key,m=h.value;if(f.status==="aborted"||m.status==="aborted")return ze;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}Ev.create=(e,t,n)=>new Ev({valueType:t,keyType:e,typeName:$e.ZodMap,...Ke(n)});class Io extends Je{_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.parsedType!==ge.set)return ce(a,{code:re.invalid_type,expected:ge.set,received:a.parsedType}),ze;const s=this._def;s.minSize!==null&&a.data.size<s.minSize.value&&(ce(a,{code:re.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&a.data.size>s.maxSize.value&&(ce(a,{code:re.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const o=this._def.valueType;function c(h){const f=new Set;for(const m of h){if(m.status==="aborted")return ze;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...a.data.values()].map((h,f)=>o._parse(new _r(a,h,a.path,f)));return a.common.async?Promise.all(u).then(h=>c(h)):c(u)}min(t,n){return new Io({...this._def,minSize:{value:t,message:Ce.toString(n)}})}max(t,n){return new Io({...this._def,maxSize:{value:t,message:Ce.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Io.create=(e,t)=>new Io({valueType:e,minSize:null,maxSize:null,typeName:$e.ZodSet,...Ke(t)});class hf extends Je{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}hf.create=(e,t)=>new hf({getter:e,typeName:$e.ZodLazy,...Ke(t)});class Xc extends Je{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ce(n,{received:n.data,code:re.invalid_literal,expected:this._def.value}),ze}return{status:"valid",value:t.data}}get value(){return this._def.value}}Xc.create=(e,t)=>new Xc({value:e,typeName:$e.ZodLiteral,...Ke(t)});function hb(e,t){return new ui({values:e,typeName:$e.ZodEnum,...Ke(t)})}class ui extends Je{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),a=this._def.values;return ce(n,{expected:it.joinValues(a),received:n.parsedType,code:re.invalid_type}),ze}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),a=this._def.values;return ce(n,{received:n.data,code:re.invalid_enum_value,options:a}),ze}return Vn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return ui.create(t,{...this._def,...n})}exclude(t,n=this._def){return ui.create(this.options.filter(a=>!t.includes(a)),{...this._def,...n})}}ui.create=hb;class ff extends Je{_parse(t){const n=it.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(t);if(a.parsedType!==ge.string&&a.parsedType!==ge.number){const s=it.objectValues(n);return ce(a,{expected:it.joinValues(s),received:a.parsedType,code:re.invalid_type}),ze}if(this._cache||(this._cache=new Set(it.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=it.objectValues(n);return ce(a,{received:a.data,code:re.invalid_enum_value,options:s}),ze}return Vn(t.data)}get enum(){return this._def.values}}ff.create=(e,t)=>new ff({values:e,typeName:$e.ZodNativeEnum,...Ke(t)});class Qc extends Je{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ge.promise&&n.common.async===!1)return ce(n,{code:re.invalid_type,expected:ge.promise,received:n.parsedType}),ze;const a=n.parsedType===ge.promise?n.data:Promise.resolve(n.data);return Vn(a.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Qc.create=(e,t)=>new Qc({type:e,typeName:$e.ZodPromise,...Ke(t)});class di extends Je{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:a}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:c=>{ce(a,c),c.fatal?n.abort():n.dirty()},get path(){return a.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const c=s.transform(a.data,o);if(a.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return ze;const h=await this._def.schema._parseAsync({data:u,path:a.path,parent:a});return h.status==="aborted"?ze:h.status==="dirty"||n.value==="dirty"?vo(h.value):h});{if(n.value==="aborted")return ze;const u=this._def.schema._parseSync({data:c,path:a.path,parent:a});return u.status==="aborted"?ze:u.status==="dirty"||n.value==="dirty"?vo(u.value):u}}if(s.type==="refinement"){const c=u=>{const h=s.refinement(u,o);if(a.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(a.common.async===!1){const u=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return u.status==="aborted"?ze:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(u=>u.status==="aborted"?ze:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(a.common.async===!1){const c=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!cs(c))return ze;const u=s.transform(c.value,o);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(c=>cs(c)?Promise.resolve(s.transform(c.value,o)).then(u=>({status:n.value,value:u})):ze);it.assertNever(s)}}di.create=(e,t,n)=>new di({schema:e,typeName:$e.ZodEffects,effect:t,...Ke(n)});di.createWithPreprocess=(e,t,n)=>new di({schema:t,effect:{type:"preprocess",transform:e},typeName:$e.ZodEffects,...Ke(n)});class $r extends Je{_parse(t){return this._getType(t)===ge.undefined?Vn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}$r.create=(e,t)=>new $r({innerType:e,typeName:$e.ZodOptional,...Ke(t)});class hi extends Je{_parse(t){return this._getType(t)===ge.null?Vn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}hi.create=(e,t)=>new hi({innerType:e,typeName:$e.ZodNullable,...Ke(t)});class Jc extends Je{_parse(t){const{ctx:n}=this._processInputParams(t);let a=n.data;return n.parsedType===ge.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Jc.create=(e,t)=>new Jc({innerType:e,typeName:$e.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ke(t)});class eu extends Je{_parse(t){const{ctx:n}=this._processInputParams(t),a={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Kc(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Hr(a.common.issues)},input:a.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Hr(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}eu.create=(e,t)=>new eu({innerType:e,typeName:$e.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ke(t)});class Av extends Je{_parse(t){if(this._getType(t)!==ge.nan){const a=this._getOrReturnCtx(t);return ce(a,{code:re.invalid_type,expected:ge.nan,received:a.parsedType}),ze}return{status:"valid",value:t.data}}}Av.create=e=>new Av({typeName:$e.ZodNaN,...Ke(e)});class fb extends Je{_parse(t){const{ctx:n}=this._processInputParams(t),a=n.data;return this._def.type._parse({data:a,path:n.path,parent:n})}unwrap(){return this._def.type}}class dp extends Je{_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return o.status==="aborted"?ze:o.status==="dirty"?(n.dirty(),vo(o.value)):this._def.out._parseAsync({data:o.value,path:a.path,parent:a})})();{const s=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?ze:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:a.path,parent:a})}}static create(t,n){return new dp({in:t,out:n,typeName:$e.ZodPipeline})}}class tu extends Je{_parse(t){const n=this._def.innerType._parse(t),a=s=>(cs(s)&&(s.value=Object.freeze(s.value)),s);return Kc(n)?n.then(s=>a(s)):a(n)}unwrap(){return this._def.innerType}}tu.create=(e,t)=>new tu({innerType:e,typeName:$e.ZodReadonly,...Ke(t)});var $e;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})($e||($e={}));const v=gr.create,Q=oi.create;li.create;const Be=Gc.create,hp=us.create,Jt=uf.create;Da.create;const ie=yr.create,T=Rt.create,zn=qc.create,pb=up.create;Yc.create;ci.create;const _t=Zc.create,Ye=Xc.create,nt=ui.create;Qc.create;$r.create;hi.create;const pf={string:(e=>gr.create({...e,coerce:!0})),number:(e=>oi.create({...e,coerce:!0})),boolean:(e=>Gc.create({...e,coerce:!0})),bigint:(e=>li.create({...e,coerce:!0})),date:(e=>us.create({...e,coerce:!0}))};var fr;(function(e){e.STRING="string",e.DATE="date",e.DATETIME="datetime",e.INTEGER="integer",e.FLOAT="float",e.BOOLEAN="boolean",e.UUID="uuid",e.JSON="json"})(fr||(fr={}));const ET=nt(["CASCADE","RESTRICT","NO ACTION"]),AT=nt(["CASCADE","SET NULL","SET DEFAULT","RESTRICT","NO ACTION"]),RT=nt([fr.STRING,fr.DATE,fr.DATETIME,fr.INTEGER,fr.FLOAT,fr.BOOLEAN,fr.UUID,fr.JSON]),mb=T({referenceTable:v().min(1,"Target table cannot be empty"),referenceColumn:v().min(1,"Target column cannot be empty"),onDelete:AT,onUpdate:ET}),gb=T({columnName:v().min(1,"Column name cannot be empty").max(64,"Column name must be less than 64 characters"),type:zn([RT,v()]),defaultValue:v().optional(),isPrimaryKey:Be().optional(),isNullable:Be(),isUnique:Be(),foreignKey:mb.optional()}),yb=T({tableName:v().min(1,"Table name cannot be empty").max(64,"Table name must be less than 64 characters"),columns:ie(gb).min(1,"At least one column is required"),recordCount:Q().optional(),createdAt:v().optional(),updatedAt:v().optional()}),LT=T({functionName:v(),functionDef:v(),kind:v()}),DT=T({tableName:v(),indexName:v(),indexDef:v(),isUnique:Be().nullable(),isPrimary:Be().nullable()}),MT=T({tableName:v(),policyName:v(),cmd:v(),roles:ie(v()),qual:v().nullable(),withCheck:v().nullable()}),IT=T({tableName:v(),triggerName:v(),actionTiming:v(),eventManipulation:v(),actionOrientation:v(),actionCondition:v().nullable(),actionStatement:v()});yb.pick({tableName:!0,columns:!0}).extend({rlsEnabled:Be().default(!0)});yb.pick({tableName:!0,columns:!0}).extend({message:v(),autoFields:ie(v()),nextActions:v()});T({addColumns:ie(gb.omit({foreignKey:!0})).optional(),dropColumns:ie(v()).optional(),updateColumns:ie(T({columnName:v(),defaultValue:v().optional(),newColumnName:v().min(1,"New column name cannot be empty").max(64,"New column name must be less than 64 characters").optional()})).optional(),addForeignKeys:ie(T({columnName:v().min(1,"Column name is required for adding foreign key"),foreignKey:mb})).optional(),dropForeignKeys:ie(v()).optional(),renameTable:T({newTableName:v().min(1,"New table name cannot be empty").max(64,"New table name must be less than 64 characters")}).optional()});T({message:v(),tableName:v(),operations:ie(v())});T({message:v(),tableName:v(),nextActions:v()});T({query:v().min(1,"Query is required"),params:ie(Jt()).optional()});T({rows:ie(_t(v(),Jt())),rowCount:Q().nullable(),fields:ie(T({name:v(),dataTypeID:Q()})).optional()});T({tables:ie(v()).optional(),format:nt(["sql","json"]).default("sql"),includeData:Be().default(!0),includeFunctions:Be().default(!1),includeSequences:Be().default(!1),includeViews:Be().default(!1),rowLimit:Q().int().positive().max(1e4).default(1e3)});const NT=T({timestamp:v(),tables:_t(v(),T({schema:ie(T({columnName:v(),dataType:v(),characterMaximumLength:Q().nullable(),isNullable:v(),columnDefault:v().nullable()})),indexes:ie(T({indexname:v(),indexdef:v(),isUnique:Be().nullable(),isPrimary:Be().nullable()})),foreignKeys:ie(T({constraintName:v(),columnName:v(),foreignTableName:v(),foreignColumnName:v(),deleteRule:v().nullable(),updateRule:v().nullable()})),rlsEnabled:Be().optional(),policies:ie(T({policyname:v(),cmd:v(),roles:ie(v()),qual:v().nullable(),withCheck:v().nullable()})),triggers:ie(T({triggerName:v(),actionTiming:v(),eventManipulation:v(),actionOrientation:v(),actionCondition:v().nullable(),actionStatement:v(),newTable:v().nullable(),oldTable:v().nullable()})),rows:ie(_t(v(),Jt())).optional(),recordCount:Q().optional()})),functions:ie(T({functionName:v(),functionDef:v(),kind:v()})),sequences:ie(T({sequenceName:v(),startValue:v(),increment:v(),minValue:v().nullable(),maxValue:v().nullable(),cycle:v()})),views:ie(T({viewName:v(),definition:v()}))});T({format:nt(["sql","json"]),data:zn([v(),NT]),timestamp:v()});T({truncate:zn([Be(),v().transform(e=>{if(e==="true")return!0;if(e==="false")return!1;throw new Error("Invalid boolean string")})]).default(!1)});T({success:Be(),message:v(),filename:v(),tables:ie(v()),rowsImported:Q(),fileSize:Q()});T({table:v().min(1,"Table name is required"),upsertKey:v().optional()});T({success:Be(),message:v(),table:v(),rowsAffected:Q(),totalRecords:Q(),filename:v()});T({functions:ie(LT)});T({indexes:ie(DT)});T({policies:ie(MT)});T({triggers:ie(IT)});const OT=T({id:v(),key:v(),isActive:Be(),isReserved:Be(),lastUsedAt:v().nullable(),expiresAt:v().nullable(),createdAt:v(),updatedAt:v()});T({secrets:ie(OT)});T({key:v(),value:v()});T({key:v().regex(/^[A-Z0-9_]+$/,"Use uppercase letters, numbers, and underscores only"),value:v().min(1,"Value is required")});T({success:Ye(!0),message:v(),id:v()});T({success:Ye(!0),message:v()});T({success:Ye(!0),message:v()});const jT=T({key:v(),bucket:v(),size:Q(),mimeType:v().optional(),uploadedAt:v(),url:v()}),UT=T({name:v(),public:Be(),createdAt:v()});T({id:v().uuid(),maxFileSizeMb:Q().int().positive(),createdAt:v(),updatedAt:v()});T({bucketName:v().min(1,"Bucket name cannot be empty"),isPublic:Be().default(!0)});T({isPublic:Be()});T({objects:ie(jT),pagination:T({offset:Q(),limit:Q(),total:Q()})});T({filename:v().min(1,"Filename cannot be empty"),contentType:v().optional(),size:Q().optional()});T({method:nt(["presigned","direct"]),uploadUrl:v(),fields:_t(v()).optional(),key:v(),confirmRequired:Be(),confirmUrl:v().optional(),expiresAt:hp().optional()});T({expiresIn:Q().optional().default(3600)});T({method:nt(["presigned","direct"]),url:v(),expiresAt:hp().optional(),headers:_t(v()).optional()});T({size:Q(),contentType:v().optional(),etag:v().optional()});T({maxFileSizeMb:Q().int().min(1,"Must be at least 1 MB").max(200,"Must be at most 200 MB")});const Pu=v().uuid("Invalid user ID format"),br=v().email("Invalid email format").toLowerCase().trim(),fp=v(),BT=v().min(1,"Name is required").max(100,"Name must be less than 100 characters").trim(),FT=nt(["anon","authenticated","project_admin"]),Rv=nt(["code","link"]),vb=T({name:v().optional(),avatar_url:v().url().optional()}).passthrough(),ys=T({id:Pu,email:br,emailVerified:Be(),providers:ie(v()).optional(),createdAt:v(),updatedAt:v(),profile:vb.nullable(),metadata:_t(Jt()).nullable()}),Su=nt(["google","github","discord","linkedin","facebook","instagram","tiktok","apple","x","spotify","microsoft"]);T({provider:Su,redirectUri:v().url().optional()});const pp=T({id:v().uuid(),provider:Su,clientId:v().optional(),scopes:ie(v()).optional(),redirectUri:v().optional(),useSharedKey:Be(),createdAt:v(),updatedAt:v()}),VT=/^(?:(?:https?:\/\/)(?:(?:\*\.)?[^\s/:?#]+|\[[0-9A-Fa-f:.]+\])(?::\d+)?(?:\/[^\s]*)?|(?!(?:https?|javascript|data|file|vbscript):)[a-zA-Z][a-zA-Z0-9+.-]*:(?:\/\/[^\s/]+(?:\/[^\s]*)?|\/[^\s]*))$/i,kb=T({id:v().uuid(),requireEmailVerification:Be(),passwordMinLength:Q().min(4).max(128),requireNumber:Be(),requireLowercase:Be(),requireUppercase:Be(),requireSpecialChar:Be(),verifyEmailMethod:Rv,resetPasswordMethod:Rv,allowedRedirectUrls:ie(v().regex(VT,{message:"Invalid URL or wildcard URL"})).optional().nullable(),createdAt:v(),updatedAt:v()});T({sub:Pu,email:br,role:FT,iat:Q().optional(),exp:Q().optional()});const _b=v().min(1).max(64).regex(/^[a-z0-9_-]+$/,"Key must contain only lowercase letters, numbers, hyphens, and underscores"),mp=T({id:v().uuid(),key:_b,name:v().min(1),discoveryEndpoint:v().url(),clientId:v().min(1),createdAt:v(),updatedAt:v()}),zT=T({limit:v().optional(),offset:v().optional()});T({email:br,password:fp,name:BT.optional(),redirectTo:v().url().optional()});T({email:br,password:fp});T({refreshToken:v().min(1,"refreshToken is required")});T({code:v()});zT.extend({search:v().optional()}).optional();T({userIds:ie(Pu).min(1,"At least one user ID is required")});T({profile:_t(Jt())});T({email:br,redirectTo:v().url().optional()});T({email:br,otp:v().regex(/^\d{6}$/,"OTP code must be a 6-digit numeric code")});T({email:br,redirectTo:v().url().optional()});T({email:br,code:v().regex(/^\d{6}$/,"Reset password code must be a 6-digit numeric code")});T({newPassword:fp,otp:v().min(1,"OTP/token is required")});T({user:ys.optional(),accessToken:v().nullable(),requireEmailVerification:Be().optional(),csrfToken:v().nullable().optional(),refreshToken:v().optional()});T({user:ys,accessToken:v(),csrfToken:v().nullable().optional(),refreshToken:v().optional()});T({user:ys,accessToken:v(),csrfToken:v().nullable().optional(),refreshToken:v().optional()});T({accessToken:v(),user:ys,csrfToken:v().optional(),refreshToken:v().optional()});T({token:v(),expiresAt:v().datetime()});T({message:v()});T({user:ys});T({id:Pu,profile:vb.nullable()});T({data:ie(ys),pagination:T({offset:Q(),limit:Q(),total:Q()})});T({message:v(),deletedCount:Q().int().nonnegative()});T({authUrl:v().url()});pp.omit({id:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:v().optional()});pp.omit({id:!0,provider:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:v().optional()}).partial();const bb=/^[A-Za-z0-9._~-]+$/;T({redirect_uri:v().url().optional(),code_challenge:v().min(43,"Code challenge must be at least 43 characters").max(128,"Code challenge must be at most 128 characters").regex(bb,"Code challenge must be base64url encoded")});T({code:v().min(1,"Exchange code is required"),code_verifier:v().min(43,"Code verifier must be at least 43 characters").max(128,"Code verifier must be at most 128 characters").regex(bb,"Code verifier must be base64url encoded")});T({data:ie(pp),count:Q()});kb.omit({id:!0,createdAt:!0,updatedAt:!0}).partial();const $T=T({oAuthProviders:ie(Su),customOAuthProviders:ie(_b),...kb.omit({id:!0,updatedAt:!0,createdAt:!0,allowedRedirectUrls:!0}).shape});T({error:v(),message:v(),statusCode:Q().int(),nextActions:v().optional()});mp.omit({id:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:v().min(1,"Client secret is required")});mp.omit({id:!0,key:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:v().min(1).optional()}).partial();T({data:ie(mp),count:Q()});const wb=nt(["system","user"]),xb=T({id:v().uuid(),pattern:v().min(1),description:v().nullable(),webhookUrls:ie(v().url()).nullable(),enabled:Be(),createdAt:v().datetime(),updatedAt:v().datetime()}),HT=T({id:v().uuid(),eventName:v().min(1),channelId:v().uuid().nullable(),channelName:v().min(1),payload:_t(v(),Jt()),senderType:wb,senderId:v().uuid().nullable(),wsAudienceCount:Q().int().min(0),whAudienceCount:Q().int().min(0),whDeliveredCount:Q().int().min(0),createdAt:v().datetime()}),WT=T({retentionDays:Q().int().positive().nullable()});T({channel:v().min(1)});T({channel:v().min(1)});T({channel:v().min(1),event:v().min(1),payload:_t(v(),Jt())});pb("ok",[T({ok:Ye(!0),channel:v().min(1)}),T({ok:Ye(!1),channel:v().min(1),error:T({code:v().min(1),message:v().min(1)})})]);T({channel:v().optional(),code:v().min(1),message:v().min(1)});T({messageId:v().uuid(),channel:v().min(1),eventName:v().min(1),payload:_t(v(),Jt())});const KT=T({channel:v().optional(),messageId:v().uuid(),senderType:wb,senderId:v().uuid().optional(),timestamp:v().datetime()});T({meta:KT}).passthrough();T({pattern:v().min(1,"Channel pattern is required"),description:v().optional(),webhookUrls:ie(v().url()).optional(),enabled:Be().optional().default(!0)});T({pattern:v().min(1).optional(),description:v().optional(),webhookUrls:ie(v().url()).optional(),enabled:Be().optional()});ie(xb);T({message:v()});T({channelId:v().uuid().optional(),eventName:v().optional(),limit:pf.number().int().min(1).max(1e3).optional().default(100),offset:pf.number().int().min(0).optional().default(0)});ie(HT);T({channelId:v().uuid().optional(),since:pf.date().optional()});T({totalMessages:Q().int().min(0),whDeliveryRate:Q().min(0).max(1),topEvents:ie(T({eventName:v(),count:Q().int().min(0)})),retentionDays:WT.shape.retentionDays});const Lv=T({policyName:v(),tableName:v(),command:v(),roles:ie(v()),using:v().nullable(),withCheck:v().nullable()}),GT=T({subscribe:T({policies:ie(Lv)}),publish:T({policies:ie(Lv)})}),qT=$T,YT=T({tables:ie(T({tableName:v(),recordCount:Q()})),totalSizeInGB:Q(),hint:v().optional()}),ZT=UT.extend({objectCount:Q().optional()}),XT=T({buckets:ie(ZT),totalSizeInGB:Q()}),QT=T({slug:v(),name:v(),description:v().nullable(),status:v()}),JT=T({models:ie(T({inputModality:ie(v()),outputModality:ie(v()),modelId:v()}))}),eE=T({channels:ie(xb),permissions:GT});T({auth:qT,database:YT,storage:XT,aiIntegration:JT.optional(),functions:ie(QT),realtime:eE.optional(),version:v().optional()});const tE=T({host:v(),port:Q(),database:v(),user:v(),password:v(),sslmode:v()});T({connectionURL:v(),parameters:tE});T({databasePassword:v()});T({apiKey:v()});T({projectId:v().nullable()});const ds=nt(["text","image","audio"]),nE=T({inputModality:ie(ds).min(1),outputModality:ie(ds).min(1),provider:v(),modelId:v(),systemPrompt:v().optional()}),Pb=nE.extend({id:v().uuid()});Pb.extend({usageStats:T({totalInputTokens:Q(),totalOutputTokens:Q(),totalTokens:Q(),totalImageCount:Q(),totalRequests:Q()}).optional()});const rE=T({configId:v().uuid(),inputTokens:Q().int().optional(),outputTokens:Q().int().optional(),imageCount:Q().int().optional(),imageResolution:v().optional()}),aE=rE.extend({id:v().uuid(),createdAt:hp(),modelId:v().nullable().optional(),model:v().nullable(),provider:v().nullable(),inputModality:ie(ds).nullable(),outputModality:ie(ds).nullable()});T({totalInputTokens:Q(),totalOutputTokens:Q(),totalTokens:Q(),totalImageCount:Q(),totalRequests:Q()});const iE=T({type:Ye("text"),text:v()}),sE=T({type:Ye("image_url"),image_url:T({url:v(),detail:nt(["auto","low","high"]).optional()})}),oE=T({type:Ye("input_audio"),input_audio:T({data:v(),format:nt(["wav","mp3","aiff","aac","ogg","flac","m4a"])})}),lE=T({type:Ye("file"),file:T({filename:v(),file_data:v()})}),cE=zn([iE,sE,oE,lE]),uE=T({name:v(),description:v().optional(),parameters:_t(Jt()).optional()}),dE=T({type:Ye("function"),function:uE}),hE=zn([nt(["auto","none","required"]),T({type:Ye("function"),function:T({name:v()})})]),Sb=T({id:v(),type:Ye("function"),function:T({name:v(),arguments:v()})}),fE=T({role:nt(["user","assistant","system","tool"]),content:zn([v(),ie(cE)]).nullable(),images:ie(T({url:v()})).optional(),tool_calls:ie(Sb).optional(),tool_call_id:v().optional()}),pE=T({enabled:Be(),engine:nt(["native","exa"]).optional(),maxResults:Q().min(1).max(10).optional(),searchPrompt:v().optional()}),mE=T({enabled:Be(),pdf:T({engine:nt(["pdf-text","mistral-ocr","native"]).optional()}).optional()});T({model:v(),messages:ie(fE),temperature:Q().min(0).max(2).optional(),maxTokens:Q().positive().optional(),topP:Q().min(0).max(1).optional(),stream:Be().optional(),webSearch:pE.optional(),fileParser:mE.optional(),thinking:Be().optional(),tools:ie(dE).optional(),toolChoice:hE.optional(),parallelToolCalls:Be().optional()});const gE=T({type:Ye("url_citation"),urlCitation:T({url:v(),title:v().optional(),content:v().optional(),startIndex:Q().optional(),endIndex:Q().optional()})}),yE=T({type:Ye("file"),file:T({filename:v(),parsedContent:v().optional(),metadata:_t(Jt()).optional()})}),vE=zn([gE,yE]);T({text:v(),tool_calls:ie(Sb).optional(),annotations:ie(vE).optional(),metadata:T({model:v(),usage:T({promptTokens:Q().optional(),completionTokens:Q().optional(),totalTokens:Q().optional()}).optional()}).optional()});T({model:v(),input:zn([v(),ie(v())]),encoding_format:nt(["float","base64"]).optional(),dimensions:Q().int().min(0).optional()});const kE=T({object:Ye("embedding"),embedding:zn([ie(Q()),v()]),index:Q()});T({object:Ye("list"),data:ie(kE),metadata:T({model:v(),usage:T({promptTokens:Q().optional(),totalTokens:Q().optional()}).optional()}).optional()});T({model:v(),prompt:v(),images:ie(T({url:v()})).optional()});T({text:v().optional(),images:ie(T({type:Ye("imageUrl"),imageUrl:v()})),metadata:T({model:v(),usage:T({promptTokens:Q().optional(),completionTokens:Q().optional(),totalTokens:Q().optional()}).optional()}).optional()});T({id:v(),inputModality:ie(ds).min(1),outputModality:ie(ds).min(1),provider:v(),modelId:v(),inputPrice:Q().min(0).optional(),outputPrice:Q().min(0).optional()});Pb.omit({id:!0});T({systemPrompt:v().nullable()});T({records:ie(aE),total:Q()});T({startDate:v().datetime().optional(),endDate:v().datetime().optional(),limit:v().regex(/^\d+$/).default("50"),offset:v().regex(/^\d+$/).default("0")});T({configId:v().uuid().optional(),startDate:v().datetime().optional(),endDate:v().datetime().optional()});const _E=nt(["byok","cloud","env","unconfigured"]);T({keySource:_E,hasByokKey:Be(),maskedKey:v().optional()});T({apiKey:v().min(1,"API key is required")});const Cb=T({id:v(),actor:v(),action:v(),module:v(),details:_t(Jt()).nullable(),ipAddress:v().nullable(),createdAt:v(),updatedAt:v()});T({id:v(),name:v(),token:v()});const bE=T({id:v(),eventMessage:v(),timestamp:v(),body:_t(v(),Jt()),source:v().optional()});T({source:v(),count:Q(),lastActivity:v()});const wE=T({level:v(),message:v()});T({deploymentId:v(),status:nt(["pending","success","failed"]),logs:ie(wE),createdAt:v()});T({limit:Q().default(100),offset:Q().default(0),actor:v().optional(),action:v().optional(),module:v().optional(),startDate:v().optional(),endDate:v().optional()});T({data:ie(Cb),pagination:T({limit:Q(),offset:Q(),total:Q()})});T({days:Q().default(7)});T({totalLogs:Q(),uniqueActors:Q(),uniqueModules:Q(),actionsByModule:_t(Q()),recentActivity:ie(Cb)});T({daysToKeep:Q().default(90)});T({message:v(),deleted:Q()});T({logs:ie(bE),total:Q()});const Tb=T({id:v(),slug:v(),name:v(),description:v().nullable(),code:v(),status:nt(["draft","active","error"]),createdAt:v(),updatedAt:v(),deployedAt:v().nullable()});T({name:v().min(1,"Name is required"),slug:v().regex(/^[a-zA-Z0-9_-]+$/,"Invalid slug format - must be alphanumeric with hyphens or underscores only").optional(),code:v().min(1),description:v().optional(),status:nt(["draft","active"]).optional().default("active")});T({name:v().optional(),code:v().optional(),description:v().optional(),status:nt(["draft","active"]).optional()});T({functions:ie(Tb),runtime:T({status:nt(["running","unavailable"])}),deploymentUrl:v().nullable().optional()});const xE=T({id:v(),status:nt(["success","failed"]),url:v().nullable(),buildLogs:ie(v()).optional()});T({success:Be(),function:Tb,deployment:xE.nullable().optional()});const PE=T({type:Ye("APP_ROUTE_CHANGE"),path:v()}),SE=T({type:Ye("AUTH_SUCCESS")}),CE=T({type:Ye("AUTH_ERROR"),message:v()}),TE=T({type:Ye("MCP_CONNECTION_STATUS"),connected:Be(),toolName:v(),timestamp:zn([Q(),v()])}),EE=T({type:Ye("SHOW_ONBOARDING_OVERLAY")}),AE=T({type:Ye("SHOW_SETTINGS_OVERLAY")}),RE=T({type:Ye("ONBOARDING_SUCCESS")}),LE=T({type:Ye("NAVIGATE_TO_USAGE")}),DE=T({type:Ye("SHOW_CONTACT_MODAL")}),ME=T({type:Ye("SHOW_CONNECT_OVERLAY")}),IE=T({type:Ye("SHOW_PLAN_MODAL")}),NE=T({type:Ye("AUTHORIZATION_CODE"),code:v()}),OE=T({type:Ye("ROUTE_CHANGE"),path:v()}),jE=T({type:Ye("REQUEST_PROJECT_INFO")}),UE=T({type:Ye("PROJECT_INFO"),name:v(),instanceType:v(),region:v(),latestVersion:v().optional()}),BE=T({type:Ye("REQUEST_INSTANCE_INFO")}),FE=T({type:Ye("INSTANCE_INFO"),currentInstanceType:v(),planName:v(),computeCredits:Q(),currentOrgComputeCost:Q(),instanceTypes:ie(T({id:v(),name:v(),cpu:v(),ram:v(),pricePerHour:Q(),pricePerMonth:Q()})),projects:ie(T({name:v(),instanceType:v(),monthlyCost:Q(),isCurrent:Be(),status:v()}))}),VE=T({type:Ye("REQUEST_INSTANCE_TYPE_CHANGE"),instanceType:v()}),zE=T({type:Ye("INSTANCE_TYPE_CHANGE_RESULT"),success:Be(),instanceType:v().optional(),error:v().optional()});pb("type",[PE,SE,CE,TE,EE,AE,RE,LE,DE,ME,IE,NE,OE,jE,UE,BE,FE,VE,zE]);nt(["db","storage","functions","auth","ai","realtime"]).describe(`
12
+ Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let m=Fn(),y;y=m;let k=y.pathname||"/",w=k;if(h!=="/"){let S=h.replace(/^\//,"").split("/");w="/"+k.replace(/^\//,"").split("/").slice(S.length).join("/")}let x=Ta(e,{pathname:w});return Et(f||x!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Et(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.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.`),a1(x&&x.map(S=>Object.assign({},S,{params:Object.assign({},c,S.params),pathname:ir([h,a.encodeLocation?a.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?h:ir([h,a.encodeLocation?a.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),o,n)}function e1(){let e=c1(),t=Ms(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:a},s={padding:"2px 4px",backgroundColor:a},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:s},"ErrorBoundary")," or"," ",b.createElement("code",{style:s},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:o},n):null,c)}var t1=b.createElement(e1,null),ab=class extends b.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=ZC(e.digest);n&&(e=n)}let t=e!==void 0?b.createElement(Gr.Provider,{value:this.props.routeContext},b.createElement(ip.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(n1,{error:e},t):t}};ab.contextType=J_;var Sh=new WeakMap;function n1({children:e,error:t}){let{basename:n}=b.useContext(Bn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=YC(t.digest);if(a){let o=Sh.get(t);if(o)throw o;let s=F_(a.location,n);if(B_&&!Sh.get(t))if(s.isExternal||a.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:a.replace}));throw Sh.set(t,c),c}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function r1({routeContext:e,match:t,children:n}){let a=b.useContext(pi);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(Gr.Provider,{value:e},n)}function a1(e,t=[],n){let a=n?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let o=e,s=a?.errors;if(s!=null){let m=o.findIndex(y=>y.route.id&&s?.[y.route.id]!==void 0);Xe(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),o=o.slice(0,Math.min(o.length,m+1))}let c=!1,u=-1;if(n&&a){c=a.renderFallback;for(let m=0;m<o.length;m++){let y=o[m];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(u=m),y.route.id){let{loaderData:k,errors:w}=a,x=y.route.loader&&!k.hasOwnProperty(y.route.id)&&(!w||w[y.route.id]===void 0);if(y.route.lazy||x){n.isStatic&&(c=!0),u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}}let h=n?.onError,f=a&&h?(m,y)=>{h(m,{location:a.location,params:a.matches?.[0]?.params??{},unstable_pattern:zs(a.matches),errorInfo:y})}:void 0;return o.reduceRight((m,y,k)=>{let w,x=!1,C=null,S=null;a&&(w=s&&y.route.id?s[y.route.id]:void 0,C=y.route.errorElement||t1,c&&(u<0&&k===0?(ib("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,S=null):u===k&&(x=!0,S=y.route.hydrateFallbackElement||null)));let D=t.concat(o.slice(0,k+1)),L=()=>{let R;return w?R=C:x?R=S:y.route.Component?R=b.createElement(y.route.Component,null):y.route.element?R=y.route.element:R=m,b.createElement(r1,{match:y,routeContext:{outlet:m,matches:D,isDataRoute:a!=null},children:R})};return a&&(y.route.ErrorBoundary||y.route.errorElement||k===0)?b.createElement(ab,{location:a.location,revalidation:a.revalidation,component:C,error:w,children:L(),routeContext:{outlet:null,matches:D,isDataRoute:!0},onError:f}):L()},null)}function op(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function i1(e){let t=b.useContext(pi);return Xe(t,op(e)),t}function o1(e){let t=b.useContext($s);return Xe(t,op(e)),t}function s1(e){let t=b.useContext(Gr);return Xe(t,op(e)),t}function sp(e){let t=s1(e),n=t.matches[t.matches.length-1];return Xe(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function l1(){return sp("useRouteId")}function c1(){let e=b.useContext(ip),t=o1("useRouteError"),n=sp("useRouteError");return e!==void 0?e:t.errors?.[n]}function u1(){let{router:e}=i1("useNavigate"),t=sp("useNavigate"),n=b.useRef(!1);return rb(()=>{n.current=!0}),b.useCallback(async(o,s={})=>{Et(n.current,nb),n.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...s}))},[e,t])}var mv={};function ib(e,t,n){!t&&!mv[e]&&(mv[e]=!0,Et(!1,n))}var gv={};function yv(e,t){!e&&!gv[t]&&(gv[t]=!0,console.warn(t))}var d1="useOptimistic",vv=ES[d1],h1=()=>{};function f1(e){return vv?vv(e):[e,h1]}function p1(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Et(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:b.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Et(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:b.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Et(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:b.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var m1=["HydrateFallback","hydrateFallbackElement"],g1=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function y1({router:e,flushSync:t,onError:n,unstable_useTransitions:a}){a=WC()||a;let[s,c]=b.useState(e.state),[u,h]=f1(s),[f,m]=b.useState(),[y,k]=b.useState({isTransitioning:!1}),[w,x]=b.useState(),[C,S]=b.useState(),[D,L]=b.useState(),R=b.useRef(new Map),O=b.useCallback((P,{deletedFetchers:Y,newErrors:X,flushSync:de,viewTransitionOpts:se})=>{X&&n&&Object.values(X).forEach(fe=>n(fe,{location:P.location,params:P.matches[0]?.params??{},unstable_pattern:zs(P.matches)})),P.fetchers.forEach((fe,le)=>{fe.data!==void 0&&R.current.set(le,fe.data)}),Y.forEach(fe=>R.current.delete(fe)),yv(de===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let Ae=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(yv(se==null||Ae,"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."),!se||!Ae){t&&de?t(()=>c(P)):a===!1?c(P):b.startTransition(()=>{a===!0&&h(fe=>kv(fe,P)),c(P)});return}if(t&&de){t(()=>{C&&(w?.resolve(),C.skipTransition()),k({isTransitioning:!0,flushSync:!0,currentLocation:se.currentLocation,nextLocation:se.nextLocation})});let fe=e.window.document.startViewTransition(()=>{t(()=>c(P))});fe.finished.finally(()=>{t(()=>{x(void 0),S(void 0),m(void 0),k({isTransitioning:!1})})}),t(()=>S(fe));return}C?(w?.resolve(),C.skipTransition(),L({state:P,currentLocation:se.currentLocation,nextLocation:se.nextLocation})):(m(P),k({isTransitioning:!0,flushSync:!1,currentLocation:se.currentLocation,nextLocation:se.nextLocation}))},[e.window,t,C,w,a,h,n]);b.useLayoutEffect(()=>e.subscribe(O),[e,O]),b.useEffect(()=>{y.isTransitioning&&!y.flushSync&&x(new g1)},[y]),b.useEffect(()=>{if(w&&f&&e.window){let P=f,Y=w.promise,X=e.window.document.startViewTransition(async()=>{a===!1?c(P):b.startTransition(()=>{a===!0&&h(de=>kv(de,P)),c(P)}),await Y});X.finished.finally(()=>{x(void 0),S(void 0),m(void 0),k({isTransitioning:!1})}),S(X)}},[f,w,e.window,a,h]),b.useEffect(()=>{w&&f&&u.location.key===f.location.key&&w.resolve()},[w,C,u.location,f]),b.useEffect(()=>{!y.isTransitioning&&D&&(m(D.state),k({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}),L(void 0))},[y.isTransitioning,D]);let G=b.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:P=>e.navigate(P),push:(P,Y,X)=>e.navigate(P,{state:Y,preventScrollReset:X?.preventScrollReset}),replace:(P,Y,X)=>e.navigate(P,{replace:!0,state:Y,preventScrollReset:X?.preventScrollReset})}),[e]),W=e.basename||"/",z=b.useMemo(()=>({router:e,navigator:G,static:!1,basename:W,onError:n}),[e,G,W,n]);return b.createElement(b.Fragment,null,b.createElement(pi.Provider,{value:z},b.createElement($s.Provider,{value:u},b.createElement(eb.Provider,{value:R.current},b.createElement(ap.Provider,{value:y},b.createElement(_1,{basename:W,location:u.location,navigationType:u.historyAction,navigator:G,unstable_useTransitions:a},b.createElement(v1,{routes:e.routes,future:e.future,state:u,isStatic:!1,onError:n})))))),null)}function kv(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var v1=b.memo(k1);function k1({routes:e,future:t,state:n,isStatic:a,onError:o}){return JC(e,void 0,{state:n,isStatic:a,onError:o})}function _1({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:o,static:s=!1,unstable_useTransitions:c}){Xe(!Hs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),h=b.useMemo(()=>({basename:u,navigator:o,static:s,unstable_useTransitions:c,future:{}}),[u,o,s,c]);typeof n=="string"&&(n=Kr(n));let{pathname:f="/",search:m="",hash:y="",state:k=null,key:w="default",unstable_mask:x}=n,C=b.useMemo(()=>{let S=Un(f,u);return S==null?null:{location:{pathname:S,search:m,hash:y,state:k,key:w,unstable_mask:x},navigationType:a}},[u,f,m,y,k,w,a,x]);return Et(C!=null,`<Router basename="${u}"> is not able to match the URL "${f}${m}${y}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:b.createElement(Bn.Provider,{value:h},b.createElement(bu.Provider,{children:t,value:C}))}var Ec="get",Ac="application/x-www-form-urlencoded";function xu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function b1(e){return xu(e)&&e.tagName.toLowerCase()==="button"}function w1(e){return xu(e)&&e.tagName.toLowerCase()==="form"}function x1(e){return xu(e)&&e.tagName.toLowerCase()==="input"}function P1(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function S1(e,t){return e.button===0&&(!t||t==="_self")&&!P1(e)}function of(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let a=e[n];return t.concat(Array.isArray(a)?a.map(o=>[n,o]):[[n,a]])},[]))}function C1(e,t){let n=of(e);return t&&t.forEach((a,o)=>{n.has(o)||t.getAll(o).forEach(s=>{n.append(o,s)})}),n}var fc=null;function T1(){if(fc===null)try{new FormData(document.createElement("form"),0),fc=!1}catch{fc=!0}return fc}var E1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ch(e){return e!=null&&!E1.has(e)?(Et(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ac}"`),null):e}function A1(e,t){let n,a,o,s,c;if(w1(e)){let u=e.getAttribute("action");a=u?Un(u,t):null,n=e.getAttribute("method")||Ec,o=Ch(e.getAttribute("enctype"))||Ac,s=new FormData(e)}else if(b1(e)||x1(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||u.getAttribute("action");if(a=h?Un(h,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Ec,o=Ch(e.getAttribute("formenctype"))||Ch(u.getAttribute("enctype"))||Ac,s=new FormData(u,e),!T1()){let{name:f,type:m,value:y}=e;if(m==="image"){let k=f?`${f}.`:"";s.append(`${k}x`,"0"),s.append(`${k}y`,"0")}else f&&s.append(f,y)}}else{if(xu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ec,a=null,o=Ac,c=e}return s&&o==="text/plain"&&(c=s,s=void 0),{action:a,method:n.toLowerCase(),encType:o,formData:s,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function lp(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function R1(e,t,n,a){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${a}`:o.pathname=`${o.pathname}.${a}`:o.pathname==="/"?o.pathname=`_root.${a}`:t&&Un(o.pathname,t)==="/"?o.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${a}`,o}async function L1(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function D1(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function M1(e,t,n){let a=await Promise.all(e.map(async o=>{let s=t.routes[o.route.id];if(s){let c=await L1(s,n);return c.links?c.links():[]}return[]}));return j1(a.flat(1).filter(D1).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function _v(e,t,n,a,o,s){let c=(h,f)=>n[f]?h.route.id!==n[f].route.id:!0,u=(h,f)=>n[f].pathname!==h.pathname||n[f].route.path?.endsWith("*")&&n[f].params["*"]!==h.params["*"];return s==="assets"?t.filter((h,f)=>c(h,f)||u(h,f)):s==="data"?t.filter((h,f)=>{let m=a.routes[h.route.id];if(!m||!m.hasLoader)return!1;if(c(h,f)||u(h,f))return!0;if(h.route.shouldRevalidate){let y=h.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function I1(e,t,{includeHydrateFallback:n}={}){return N1(e.map(a=>{let o=t.routes[a.route.id];if(!o)return[];let s=[o.module];return o.clientActionModule&&(s=s.concat(o.clientActionModule)),o.clientLoaderModule&&(s=s.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(s=s.concat(o.hydrateFallbackModule)),o.imports&&(s=s.concat(o.imports)),s}).flat(1))}function N1(e){return[...new Set(e)]}function O1(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function j1(e,t){let n=new Set;return new Set(t),e.reduce((a,o)=>{let s=JSON.stringify(O1(o));return n.has(s)||(n.add(s),a.push({key:s,link:o})),a},[])}function ob(){let e=b.useContext(pi);return lp(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function U1(){let e=b.useContext($s);return lp(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var cp=b.createContext(void 0);cp.displayName="FrameworkContext";function sb(){let e=b.useContext(cp);return lp(e,"You must render this element inside a <HydratedRouter> element"),e}function B1(e,t){let n=b.useContext(cp),[a,o]=b.useState(!1),[s,c]=b.useState(!1),{onFocus:u,onBlur:h,onMouseEnter:f,onMouseLeave:m,onTouchStart:y}=t,k=b.useRef(null);b.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let C=D=>{D.forEach(L=>{c(L.isIntersecting)})},S=new IntersectionObserver(C,{threshold:.5});return k.current&&S.observe(k.current),()=>{S.disconnect()}}},[e]),b.useEffect(()=>{if(a){let C=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(C)}}},[a]);let w=()=>{o(!0)},x=()=>{o(!1),c(!1)};return n?e!=="intent"?[s,k,{}]:[s,k,{onFocus:hs(u,w),onBlur:hs(h,x),onMouseEnter:hs(f,w),onMouseLeave:hs(m,x),onTouchStart:hs(y,w)}]:[!1,k,{}]}function hs(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function F1({page:e,...t}){let{router:n}=ob(),a=b.useMemo(()=>Ta(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?b.createElement(z1,{page:e,matches:a,...t}):null}function V1(e){let{manifest:t,routeModules:n}=sb(),[a,o]=b.useState([]);return b.useEffect(()=>{let s=!1;return M1(e,t,n).then(c=>{s||o(c)}),()=>{s=!0}},[e,t,n]),a}function z1({page:e,matches:t,...n}){let a=Fn(),{future:o,manifest:s,routeModules:c}=sb(),{basename:u}=ob(),{loaderData:h,matches:f}=U1(),m=b.useMemo(()=>_v(e,t,f,s,a,"data"),[e,t,f,s,a]),y=b.useMemo(()=>_v(e,t,f,s,a,"assets"),[e,t,f,s,a]),k=b.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let C=new Set,S=!1;if(t.forEach(L=>{let R=s.routes[L.route.id];!R||!R.hasLoader||(!m.some(O=>O.route.id===L.route.id)&&L.route.id in h&&c[L.route.id]?.shouldRevalidate||R.hasClientLoader?S=!0:C.add(L.route.id))}),C.size===0)return[];let D=R1(e,u,o.unstable_trailingSlashAwareDataRequests,"data");return S&&C.size>0&&D.searchParams.set("_routes",t.filter(L=>C.has(L.route.id)).map(L=>L.route.id).join(",")),[D.pathname+D.search]},[u,o.unstable_trailingSlashAwareDataRequests,h,a,s,m,t,e,c]),w=b.useMemo(()=>I1(y,s),[y,s]),x=V1(y);return b.createElement(b.Fragment,null,k.map(C=>b.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...n})),w.map(C=>b.createElement("link",{key:C,rel:"modulepreload",href:C,...n})),x.map(({key:C,link:S})=>b.createElement("link",{key:C,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function $1(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var H1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{H1&&(window.__reactRouterVersion="7.13.1")}catch{}function W1(e,t){return _C({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:OS({window:t?.window}),hydrationData:K1(),routes:e,mapRouteProperties:p1,hydrationRouteProperties:m1,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function K1(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:G1(e.errors)}),e}function G1(e){if(!e)return null;let t=Object.entries(e),n={};for(let[a,o]of t)if(o&&o.__type==="RouteErrorResponse")n[a]=new Vs(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let s=window[o.__subType];if(typeof s=="function")try{let c=new s(o.message);c.stack="",n[a]=c}catch{}}if(n[a]==null){let s=new Error(o.message);s.stack="",n[a]=s}}else n[a]=o;return n}var lb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pu=b.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:o,reloadDocument:s,replace:c,unstable_mask:u,state:h,target:f,to:m,preventScrollReset:y,viewTransition:k,unstable_defaultShouldRevalidate:w,...x},C){let{basename:S,navigator:D,unstable_useTransitions:L}=b.useContext(Bn),R=typeof m=="string"&&lb.test(m),O=F_(m,S);m=O.to;let G=XC(m,{relative:o}),W=Fn(),z=null;if(u){let le=_u(u,[],W.unstable_mask?W.unstable_mask.pathname:"/",!0);S!=="/"&&(le.pathname=le.pathname==="/"?S:ir([S,le.pathname])),z=D.createHref(le)}let[P,Y,X]=B1(a,x),de=X1(m,{replace:c,unstable_mask:u,state:h,target:f,preventScrollReset:y,relative:o,viewTransition:k,unstable_defaultShouldRevalidate:w,unstable_useTransitions:L});function se(le){t&&t(le),le.defaultPrevented||de(le)}let Ae=!(O.isExternal||s),fe=b.createElement("a",{...x,...X,href:(Ae?z:void 0)||O.absoluteURL||G,onClick:Ae?se:t,ref:$1(C,Y),target:f,"data-discover":!R&&n==="render"?"true":void 0});return P&&!R?b.createElement(b.Fragment,null,fe,b.createElement(F1,{page:G})):fe});Pu.displayName="Link";var q1=b.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:o=!1,style:s,to:c,viewTransition:u,children:h,...f},m){let y=Ws(c,{relative:f.relative}),k=Fn(),w=b.useContext($s),{navigator:x,basename:C}=b.useContext(Bn),S=w!=null&&nT(y)&&u===!0,D=x.encodeLocation?x.encodeLocation(y).pathname:y.pathname,L=k.pathname,R=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;n||(L=L.toLowerCase(),R=R?R.toLowerCase():null,D=D.toLowerCase()),R&&C&&(R=Un(R,C)||R);const O=D!=="/"&&D.endsWith("/")?D.length-1:D.length;let G=L===D||!o&&L.startsWith(D)&&L.charAt(O)==="/",W=R!=null&&(R===D||!o&&R.startsWith(D)&&R.charAt(D.length)==="/"),z={isActive:G,isPending:W,isTransitioning:S},P=G?t:void 0,Y;typeof a=="function"?Y=a(z):Y=[a,G?"active":null,W?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let X=typeof s=="function"?s(z):s;return b.createElement(Pu,{...f,"aria-current":P,className:Y,ref:m,style:X,to:c,viewTransition:u},typeof h=="function"?h(z):h)});q1.displayName="NavLink";var Y1=b.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:o,state:s,method:c=Ec,action:u,onSubmit:h,relative:f,preventScrollReset:m,viewTransition:y,unstable_defaultShouldRevalidate:k,...w},x)=>{let{unstable_useTransitions:C}=b.useContext(Bn),S=eT(),D=tT(u,{relative:f}),L=c.toLowerCase()==="get"?"get":"post",R=typeof u=="string"&&lb.test(u),O=G=>{if(h&&h(G),G.defaultPrevented)return;G.preventDefault();let W=G.nativeEvent.submitter,z=W?.getAttribute("formmethod")||c,P=()=>S(W||G.currentTarget,{fetcherKey:t,method:z,navigate:n,replace:o,state:s,relative:f,preventScrollReset:m,viewTransition:y,unstable_defaultShouldRevalidate:k});C&&n!==!1?b.startTransition(()=>P()):P()};return b.createElement("form",{ref:x,method:L,action:D,onSubmit:a?h:O,...w,"data-discover":!R&&e==="render"?"true":void 0})});Y1.displayName="Form";function Z1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cb(e){let t=b.useContext(pi);return Xe(t,Z1(e)),t}function X1(e,{target:t,replace:n,unstable_mask:a,state:o,preventScrollReset:s,relative:c,viewTransition:u,unstable_defaultShouldRevalidate:h,unstable_useTransitions:f}={}){let m=wu(),y=Fn(),k=Ws(e,{relative:c});return b.useCallback(w=>{if(S1(w,t)){w.preventDefault();let x=n!==void 0?n:kr(y)===kr(k),C=()=>m(e,{replace:x,unstable_mask:a,state:o,preventScrollReset:s,relative:c,viewTransition:u,unstable_defaultShouldRevalidate:h});f?b.startTransition(()=>C()):C()}},[y,m,k,n,a,o,t,e,s,c,u,h,f])}function a4(e){Et(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=b.useRef(of(e)),n=b.useRef(!1),a=Fn(),o=b.useMemo(()=>C1(a.search,n.current?null:t.current),[a.search]),s=wu(),c=b.useCallback((u,h)=>{const f=of(typeof u=="function"?u(new URLSearchParams(o)):u);n.current=!0,s("?"+f,h)},[s,o]);return[o,c]}var Q1=0,J1=()=>`__${String(++Q1)}__`;function eT(){let{router:e}=cb("useSubmit"),{basename:t}=b.useContext(Bn),n=l1(),a=e.fetch,o=e.navigate;return b.useCallback(async(s,c={})=>{let{action:u,method:h,encType:f,formData:m,body:y}=A1(s,t);if(c.navigate===!1){let k=c.fetcherKey||J1();await a(k,n,c.action||u,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:m,body:y,formMethod:c.method||h,formEncType:c.encType||f,flushSync:c.flushSync})}else await o(c.action||u,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:m,body:y,formMethod:c.method||h,formEncType:c.encType||f,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[a,o,t,n])}function tT(e,{relative:t}={}){let{basename:n}=b.useContext(Bn),a=b.useContext(Gr);Xe(a,"useFormAction must be used inside a RouteContext");let[o]=a.matches.slice(-1),s={...Ws(e||".",{relative:t})},c=Fn();if(e==null){s.search=c.search;let u=new URLSearchParams(s.search),h=u.getAll("index");if(h.some(m=>m==="")){u.delete("index"),h.filter(y=>y).forEach(y=>u.append("index",y));let m=u.toString();s.search=m?`?${m}`:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:ir([n,s.pathname])),kr(s)}function nT(e,{relative:t}={}){let n=b.useContext(ap);Xe(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=cb("useViewTransitionState"),o=Ws(e,{relative:t});if(!n.isTransitioning)return!1;let s=Un(n.currentLocation.pathname,a)||n.currentLocation.pathname,c=Un(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Kc(o.pathname,c)!=null||Kc(o.pathname,s)!=null}var rT=D_();function aT(e){return b.createElement(y1,{flushSync:rT.flushSync,...e})}var it;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const s={};for(const c of o)s[c]=c;return s},e.getValidEnumValues=o=>{const s=e.objectKeys(o).filter(u=>typeof o[o[u]]!="number"),c={};for(const u of s)c[u]=o[u];return e.objectValues(c)},e.objectValues=o=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const s=[];for(const c in o)Object.prototype.hasOwnProperty.call(o,c)&&s.push(c);return s},e.find=(o,s)=>{for(const c of o)if(s(c))return c},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function a(o,s=" | "){return o.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}e.joinValues=a,e.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(it||(it={}));var bv;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(bv||(bv={}));const ye=it.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ca=e=>{switch(typeof e){case"undefined":return ye.undefined;case"string":return ye.string;case"number":return Number.isNaN(e)?ye.nan:ye.number;case"boolean":return ye.boolean;case"function":return ye.function;case"bigint":return ye.bigint;case"symbol":return ye.symbol;case"object":return Array.isArray(e)?ye.array:e===null?ye.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ye.promise:typeof Map<"u"&&e instanceof Map?ye.map:typeof Set<"u"&&e instanceof Set?ye.set:typeof Date<"u"&&e instanceof Date?ye.date:ye.object;default:return ye.unknown}},re=it.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Hr extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(s){return s.message},a={_errors:[]},o=s=>{for(const c of s.issues)if(c.code==="invalid_union")c.unionErrors.map(o);else if(c.code==="invalid_return_type")o(c.returnTypeError);else if(c.code==="invalid_arguments")o(c.argumentsError);else if(c.path.length===0)a._errors.push(n(c));else{let u=a,h=0;for(;h<c.path.length;){const f=c.path[h];h===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],h++}}};return o(this),a}static assert(t){if(!(t instanceof Hr))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,it.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},a=[];for(const o of this.issues)if(o.path.length>0){const s=o.path[0];n[s]=n[s]||[],n[s].push(t(o))}else a.push(t(o));return{formErrors:a,fieldErrors:n}}get formErrors(){return this.flatten()}}Hr.create=e=>new Hr(e);const sf=(e,t)=>{let n;switch(e.code){case re.invalid_type:e.received===ye.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case re.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,it.jsonStringifyReplacer)}`;break;case re.unrecognized_keys:n=`Unrecognized key(s) in object: ${it.joinValues(e.keys,", ")}`;break;case re.invalid_union:n="Invalid input";break;case re.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${it.joinValues(e.options)}`;break;case re.invalid_enum_value:n=`Invalid enum value. Expected ${it.joinValues(e.options)}, received '${e.received}'`;break;case re.invalid_arguments:n="Invalid function arguments";break;case re.invalid_return_type:n="Invalid function return type";break;case re.invalid_date:n="Invalid date";break;case re.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:it.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case re.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case re.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case re.custom:n="Invalid input";break;case re.invalid_intersection_types:n="Intersection results could not be merged";break;case re.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case re.not_finite:n="Number must be finite";break;default:n=t.defaultError,it.assertNever(e)}return{message:n}};let iT=sf;function oT(){return iT}const sT=e=>{const{data:t,path:n,errorMaps:a,issueData:o}=e,s=[...n,...o.path||[]],c={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let u="";const h=a.filter(f=>!!f).slice().reverse();for(const f of h)u=f(c,{data:t,defaultError:u}).message;return{...o,path:s,message:u}};function ce(e,t){const n=oT(),a=sT({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===sf?void 0:sf].filter(o=>!!o)});e.common.issues.push(a)}class un{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const a=[];for(const o of n){if(o.status==="aborted")return ze;o.status==="dirty"&&t.dirty(),a.push(o.value)}return{status:t.value,value:a}}static async mergeObjectAsync(t,n){const a=[];for(const o of n){const s=await o.key,c=await o.value;a.push({key:s,value:c})}return un.mergeObjectSync(t,a)}static mergeObjectSync(t,n){const a={};for(const o of n){const{key:s,value:c}=o;if(s.status==="aborted"||c.status==="aborted")return ze;s.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof c.value<"u"||o.alwaysSet)&&(a[s.value]=c.value)}return{status:t.value,value:a}}}const ze=Object.freeze({status:"aborted"}),vs=e=>({status:"dirty",value:e}),Vn=e=>({status:"valid",value:e}),wv=e=>e.status==="aborted",xv=e=>e.status==="dirty",co=e=>e.status==="valid",Gc=e=>typeof Promise<"u"&&e instanceof Promise;var Ce;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Ce||(Ce={}));class _r{constructor(t,n,a,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=a,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Pv=(e,t)=>{if(co(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Hr(e.common.issues);return this._error=n,this._error}}};function Ke(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:a,description:o}=e;if(t&&(n||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(c,u)=>{const{message:h}=e;return c.code==="invalid_enum_value"?{message:h??u.defaultError}:typeof u.data>"u"?{message:h??a??u.defaultError}:c.code!=="invalid_type"?{message:u.defaultError}:{message:h??n??u.defaultError}},description:o}}class Je{get description(){return this._def.description}_getType(t){return Ca(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Ca(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new un,ctx:{common:t.parent.common,data:t.data,parsedType:Ca(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Gc(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const a=this.safeParse(t,n);if(a.success)return a.data;throw a.error}safeParse(t,n){const a={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ca(t)},o=this._parseSync({data:t,path:a.path,parent:a});return Pv(a,o)}"~validate"(t){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ca(t)};if(!this["~standard"].async)try{const a=this._parseSync({data:t,path:[],parent:n});return co(a)?{value:a.value}:{issues:n.common.issues}}catch(a){a?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(a=>co(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(t,n){const a=await this.safeParseAsync(t,n);if(a.success)return a.data;throw a.error}async safeParseAsync(t,n){const a={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ca(t)},o=this._parse({data:t,path:a.path,parent:a}),s=await(Gc(o)?o:Promise.resolve(o));return Pv(a,s)}refine(t,n){const a=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{const c=t(o),u=()=>s.addIssue({code:re.custom,...a(o)});return typeof Promise<"u"&&c instanceof Promise?c.then(h=>h?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(t,n){return this._refinement((a,o)=>t(a)?!0:(o.addIssue(typeof n=="function"?n(a,o):n),!1))}_refinement(t){return new hi({schema:this,typeName:$e.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return $r.create(this,this._def)}nullable(){return fi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return yr.create(this)}promise(){return Jc.create(this,this._def)}or(t){return Yc.create([this,t],this._def)}and(t){return Zc.create(this,t,this._def)}transform(t){return new hi({...Ke(this._def),schema:this,typeName:$e.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new eu({...Ke(this._def),innerType:this,defaultValue:n,typeName:$e.ZodDefault})}brand(){return new fb({typeName:$e.ZodBranded,type:this,...Ke(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new tu({...Ke(this._def),innerType:this,catchValue:n,typeName:$e.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return dp.create(this,t)}readonly(){return nu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const lT=/^c[^\s-]{8,}$/i,cT=/^[0-9a-z]+$/,uT=/^[0-9A-HJKMNP-TV-Z]{26}$/i,dT=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,hT=/^[a-z0-9_-]{21}$/i,fT=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,pT=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,mT=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,gT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Th;const yT=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,vT=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,kT=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,_T=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,bT=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,wT=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ub="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",xT=new RegExp(`^${ub}$`);function db(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function PT(e){return new RegExp(`^${db(e)}$`)}function ST(e){let t=`${ub}T${db(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function CT(e,t){return!!((t==="v4"||!t)&&yT.test(e)||(t==="v6"||!t)&&kT.test(e))}function TT(e,t){if(!fT.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const a=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(a));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function ET(e,t){return!!((t==="v4"||!t)&&vT.test(e)||(t==="v6"||!t)&&_T.test(e))}class gr extends Je{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ye.string){const s=this._getOrReturnCtx(t);return ce(s,{code:re.invalid_type,expected:ye.string,received:s.parsedType}),ze}const a=new un;let o;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:re.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),a.dirty());else if(s.kind==="max")t.data.length>s.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:re.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),a.dirty());else if(s.kind==="length"){const c=t.data.length>s.value,u=t.data.length<s.value;(c||u)&&(o=this._getOrReturnCtx(t,o),c?ce(o,{code:re.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):u&&ce(o,{code:re.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),a.dirty())}else if(s.kind==="email")mT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"email",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="emoji")Th||(Th=new RegExp(gT,"u")),Th.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"emoji",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="uuid")dT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"uuid",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="nanoid")hT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"nanoid",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="cuid")lT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cuid",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="cuid2")cT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cuid2",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="ulid")uT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"ulid",code:re.invalid_string,message:s.message}),a.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ce(o,{validation:"url",code:re.invalid_string,message:s.message}),a.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"regex",code:re.invalid_string,message:s.message}),a.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(t,o),ce(o,{code:re.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),a.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(o=this._getOrReturnCtx(t,o),ce(o,{code:re.invalid_string,validation:{startsWith:s.value},message:s.message}),a.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(o=this._getOrReturnCtx(t,o),ce(o,{code:re.invalid_string,validation:{endsWith:s.value},message:s.message}),a.dirty()):s.kind==="datetime"?ST(s).test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:re.invalid_string,validation:"datetime",message:s.message}),a.dirty()):s.kind==="date"?xT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:re.invalid_string,validation:"date",message:s.message}),a.dirty()):s.kind==="time"?PT(s).test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:re.invalid_string,validation:"time",message:s.message}),a.dirty()):s.kind==="duration"?pT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"duration",code:re.invalid_string,message:s.message}),a.dirty()):s.kind==="ip"?CT(t.data,s.version)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"ip",code:re.invalid_string,message:s.message}),a.dirty()):s.kind==="jwt"?TT(t.data,s.alg)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"jwt",code:re.invalid_string,message:s.message}),a.dirty()):s.kind==="cidr"?ET(t.data,s.version)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cidr",code:re.invalid_string,message:s.message}),a.dirty()):s.kind==="base64"?bT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64",code:re.invalid_string,message:s.message}),a.dirty()):s.kind==="base64url"?wT.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64url",code:re.invalid_string,message:s.message}),a.dirty()):it.assertNever(s);return{status:a.value,value:t.data}}_regex(t,n,a){return this.refinement(o=>t.test(o),{validation:n,code:re.invalid_string,...Ce.errToObj(a)})}_addCheck(t){return new gr({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ce.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ce.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ce.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ce.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ce.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ce.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ce.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ce.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ce.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ce.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ce.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ce.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ce.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...Ce.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Ce.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Ce.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ce.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Ce.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ce.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ce.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ce.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ce.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ce.errToObj(n)})}nonempty(t){return this.min(1,Ce.errToObj(t))}trim(){return new gr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new gr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new gr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}gr.create=e=>new gr({checks:[],typeName:$e.ZodString,coerce:e?.coerce??!1,...Ke(e)});function AT(e,t){const n=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,o=n>a?n:a,s=Number.parseInt(e.toFixed(o).replace(".","")),c=Number.parseInt(t.toFixed(o).replace(".",""));return s%c/10**o}class li extends Je{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ye.number){const s=this._getOrReturnCtx(t);return ce(s,{code:re.invalid_type,expected:ye.number,received:s.parsedType}),ze}let a;const o=new un;for(const s of this._def.checks)s.kind==="int"?it.isInteger(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{code:re.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?AT(t.data,s.value)!==0&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(a=this._getOrReturnCtx(t,a),ce(a,{code:re.not_finite,message:s.message}),o.dirty()):it.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ce.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ce.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ce.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ce.toString(n))}setLimit(t,n,a,o){return new li({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:a,message:Ce.toString(o)}]})}_addCheck(t){return new li({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ce.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ce.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ce.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ce.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ce.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ce.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&it.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(n===null||a.value>n)&&(n=a.value):a.kind==="max"&&(t===null||a.value<t)&&(t=a.value)}return Number.isFinite(n)&&Number.isFinite(t)}}li.create=e=>new li({checks:[],typeName:$e.ZodNumber,coerce:e?.coerce||!1,...Ke(e)});class ci extends Je{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ye.bigint)return this._getInvalidInput(t);let a;const o=new un;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(a=this._getOrReturnCtx(t,a),ce(a,{code:re.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):it.assertNever(s);return{status:o.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return ce(n,{code:re.invalid_type,expected:ye.bigint,received:n.parsedType}),ze}gte(t,n){return this.setLimit("min",t,!0,Ce.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ce.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ce.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ce.toString(n))}setLimit(t,n,a,o){return new ci({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:a,message:Ce.toString(o)}]})}_addCheck(t){return new ci({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ce.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ce.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}ci.create=e=>new ci({checks:[],typeName:$e.ZodBigInt,coerce:e?.coerce??!1,...Ke(e)});class qc extends Je{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ye.boolean){const a=this._getOrReturnCtx(t);return ce(a,{code:re.invalid_type,expected:ye.boolean,received:a.parsedType}),ze}return Vn(t.data)}}qc.create=e=>new qc({typeName:$e.ZodBoolean,coerce:e?.coerce||!1,...Ke(e)});class uo extends Je{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ye.date){const s=this._getOrReturnCtx(t);return ce(s,{code:re.invalid_type,expected:ye.date,received:s.parsedType}),ze}if(Number.isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return ce(s,{code:re.invalid_date}),ze}const a=new un;let o;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:re.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),a.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:re.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),a.dirty()):it.assertNever(s);return{status:a.value,value:new Date(t.data.getTime())}}_addCheck(t){return new uo({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ce.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ce.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}uo.create=e=>new uo({checks:[],coerce:e?.coerce||!1,typeName:$e.ZodDate,...Ke(e)});class Sv extends Je{_parse(t){if(this._getType(t)!==ye.symbol){const a=this._getOrReturnCtx(t);return ce(a,{code:re.invalid_type,expected:ye.symbol,received:a.parsedType}),ze}return Vn(t.data)}}Sv.create=e=>new Sv({typeName:$e.ZodSymbol,...Ke(e)});class lf extends Je{_parse(t){if(this._getType(t)!==ye.undefined){const a=this._getOrReturnCtx(t);return ce(a,{code:re.invalid_type,expected:ye.undefined,received:a.parsedType}),ze}return Vn(t.data)}}lf.create=e=>new lf({typeName:$e.ZodUndefined,...Ke(e)});class cf extends Je{_parse(t){if(this._getType(t)!==ye.null){const a=this._getOrReturnCtx(t);return ce(a,{code:re.invalid_type,expected:ye.null,received:a.parsedType}),ze}return Vn(t.data)}}cf.create=e=>new cf({typeName:$e.ZodNull,...Ke(e)});class Cv extends Je{constructor(){super(...arguments),this._any=!0}_parse(t){return Vn(t.data)}}Cv.create=e=>new Cv({typeName:$e.ZodAny,...Ke(e)});class uf extends Je{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Vn(t.data)}}uf.create=e=>new uf({typeName:$e.ZodUnknown,...Ke(e)});class Ma extends Je{_parse(t){const n=this._getOrReturnCtx(t);return ce(n,{code:re.invalid_type,expected:ye.never,received:n.parsedType}),ze}}Ma.create=e=>new Ma({typeName:$e.ZodNever,...Ke(e)});class Tv extends Je{_parse(t){if(this._getType(t)!==ye.undefined){const a=this._getOrReturnCtx(t);return ce(a,{code:re.invalid_type,expected:ye.void,received:a.parsedType}),ze}return Vn(t.data)}}Tv.create=e=>new Tv({typeName:$e.ZodVoid,...Ke(e)});class yr extends Je{_parse(t){const{ctx:n,status:a}=this._processInputParams(t),o=this._def;if(n.parsedType!==ye.array)return ce(n,{code:re.invalid_type,expected:ye.array,received:n.parsedType}),ze;if(o.exactLength!==null){const c=n.data.length>o.exactLength.value,u=n.data.length<o.exactLength.value;(c||u)&&(ce(n,{code:c?re.too_big:re.too_small,minimum:u?o.exactLength.value:void 0,maximum:c?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),a.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(ce(n,{code:re.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),a.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(ce(n,{code:re.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),a.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>o.type._parseAsync(new _r(n,c,n.path,u)))).then(c=>un.mergeArray(a,c));const s=[...n.data].map((c,u)=>o.type._parseSync(new _r(n,c,n.path,u)));return un.mergeArray(a,s)}get element(){return this._def.type}min(t,n){return new yr({...this._def,minLength:{value:t,message:Ce.toString(n)}})}max(t,n){return new yr({...this._def,maxLength:{value:t,message:Ce.toString(n)}})}length(t,n){return new yr({...this._def,exactLength:{value:t,message:Ce.toString(n)}})}nonempty(t){return this.min(1,t)}}yr.create=(e,t)=>new yr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$e.ZodArray,...Ke(t)});function eo(e){if(e instanceof Rt){const t={};for(const n in e.shape){const a=e.shape[n];t[n]=$r.create(eo(a))}return new Rt({...e._def,shape:()=>t})}else return e instanceof yr?new yr({...e._def,type:eo(e.element)}):e instanceof $r?$r.create(eo(e.unwrap())):e instanceof fi?fi.create(eo(e.unwrap())):e instanceof ui?ui.create(e.items.map(t=>eo(t))):e}class Rt extends Je{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=it.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==ye.object){const f=this._getOrReturnCtx(t);return ce(f,{code:re.invalid_type,expected:ye.object,received:f.parsedType}),ze}const{status:a,ctx:o}=this._processInputParams(t),{shape:s,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ma&&this._def.unknownKeys==="strip"))for(const f in o.data)c.includes(f)||u.push(f);const h=[];for(const f of c){const m=s[f],y=o.data[f];h.push({key:{status:"valid",value:f},value:m._parse(new _r(o,y,o.path,f)),alwaysSet:f in o.data})}if(this._def.catchall instanceof Ma){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)h.push({key:{status:"valid",value:m},value:{status:"valid",value:o.data[m]}});else if(f==="strict")u.length>0&&(ce(o,{code:re.unrecognized_keys,keys:u}),a.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const y=o.data[m];h.push({key:{status:"valid",value:m},value:f._parse(new _r(o,y,o.path,m)),alwaysSet:m in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of h){const y=await m.key,k=await m.value;f.push({key:y,value:k,alwaysSet:m.alwaysSet})}return f}).then(f=>un.mergeObjectSync(a,f)):un.mergeObjectSync(a,h)}get shape(){return this._def.shape()}strict(t){return Ce.errToObj,new Rt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,a)=>{const o=this._def.errorMap?.(n,a).message??a.defaultError;return n.code==="unrecognized_keys"?{message:Ce.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new Rt({...this._def,unknownKeys:"strip"})}passthrough(){return new Rt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Rt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Rt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:$e.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Rt({...this._def,catchall:t})}pick(t){const n={};for(const a of it.objectKeys(t))t[a]&&this.shape[a]&&(n[a]=this.shape[a]);return new Rt({...this._def,shape:()=>n})}omit(t){const n={};for(const a of it.objectKeys(this.shape))t[a]||(n[a]=this.shape[a]);return new Rt({...this._def,shape:()=>n})}deepPartial(){return eo(this)}partial(t){const n={};for(const a of it.objectKeys(this.shape)){const o=this.shape[a];t&&!t[a]?n[a]=o:n[a]=o.optional()}return new Rt({...this._def,shape:()=>n})}required(t){const n={};for(const a of it.objectKeys(this.shape))if(t&&!t[a])n[a]=this.shape[a];else{let s=this.shape[a];for(;s instanceof $r;)s=s._def.innerType;n[a]=s}return new Rt({...this._def,shape:()=>n})}keyof(){return hb(it.objectKeys(this.shape))}}Rt.create=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strip",catchall:Ma.create(),typeName:$e.ZodObject,...Ke(t)});Rt.strictCreate=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strict",catchall:Ma.create(),typeName:$e.ZodObject,...Ke(t)});Rt.lazycreate=(e,t)=>new Rt({shape:e,unknownKeys:"strip",catchall:Ma.create(),typeName:$e.ZodObject,...Ke(t)});class Yc extends Je{_parse(t){const{ctx:n}=this._processInputParams(t),a=this._def.options;function o(s){for(const u of s)if(u.result.status==="valid")return u.result;for(const u of s)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=s.map(u=>new Hr(u.ctx.common.issues));return ce(n,{code:re.invalid_union,unionErrors:c}),ze}if(n.common.async)return Promise.all(a.map(async s=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(o);{let s;const c=[];for(const h of a){const f={...n,common:{...n.common,issues:[]},parent:null},m=h._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!s&&(s={result:m,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const u=c.map(h=>new Hr(h));return ce(n,{code:re.invalid_union,unionErrors:u}),ze}}get options(){return this._def.options}}Yc.create=(e,t)=>new Yc({options:e,typeName:$e.ZodUnion,...Ke(t)});const zr=e=>e instanceof hf?zr(e.schema):e instanceof hi?zr(e.innerType()):e instanceof Qc?[e.value]:e instanceof di?e.options:e instanceof ff?it.objectValues(e.enum):e instanceof eu?zr(e._def.innerType):e instanceof lf?[void 0]:e instanceof cf?[null]:e instanceof $r?[void 0,...zr(e.unwrap())]:e instanceof fi?[null,...zr(e.unwrap())]:e instanceof fb||e instanceof nu?zr(e.unwrap()):e instanceof tu?zr(e._def.innerType):[];class up extends Je{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.object)return ce(n,{code:re.invalid_type,expected:ye.object,received:n.parsedType}),ze;const a=this.discriminator,o=n.data[a],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(ce(n,{code:re.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),ze)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,a){const o=new Map;for(const s of n){const c=zr(s.shape[t]);if(!c.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const u of c){if(o.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);o.set(u,s)}}return new up({typeName:$e.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...Ke(a)})}}function df(e,t){const n=Ca(e),a=Ca(t);if(e===t)return{valid:!0,data:e};if(n===ye.object&&a===ye.object){const o=it.objectKeys(t),s=it.objectKeys(e).filter(u=>o.indexOf(u)!==-1),c={...e,...t};for(const u of s){const h=df(e[u],t[u]);if(!h.valid)return{valid:!1};c[u]=h.data}return{valid:!0,data:c}}else if(n===ye.array&&a===ye.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let s=0;s<e.length;s++){const c=e[s],u=t[s],h=df(c,u);if(!h.valid)return{valid:!1};o.push(h.data)}return{valid:!0,data:o}}else return n===ye.date&&a===ye.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Zc extends Je{_parse(t){const{status:n,ctx:a}=this._processInputParams(t),o=(s,c)=>{if(wv(s)||wv(c))return ze;const u=df(s.value,c.value);return u.valid?((xv(s)||xv(c))&&n.dirty(),{status:n.value,value:u.data}):(ce(a,{code:re.invalid_intersection_types}),ze)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([s,c])=>o(s,c)):o(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}Zc.create=(e,t,n)=>new Zc({left:e,right:t,typeName:$e.ZodIntersection,...Ke(n)});class ui extends Je{_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.parsedType!==ye.array)return ce(a,{code:re.invalid_type,expected:ye.array,received:a.parsedType}),ze;if(a.data.length<this._def.items.length)return ce(a,{code:re.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ze;!this._def.rest&&a.data.length>this._def.items.length&&(ce(a,{code:re.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...a.data].map((c,u)=>{const h=this._def.items[u]||this._def.rest;return h?h._parse(new _r(a,c,a.path,u)):null}).filter(c=>!!c);return a.common.async?Promise.all(s).then(c=>un.mergeArray(n,c)):un.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new ui({...this._def,rest:t})}}ui.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ui({items:e,typeName:$e.ZodTuple,rest:null,...Ke(t)})};class Xc extends Je{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.parsedType!==ye.object)return ce(a,{code:re.invalid_type,expected:ye.object,received:a.parsedType}),ze;const o=[],s=this._def.keyType,c=this._def.valueType;for(const u in a.data)o.push({key:s._parse(new _r(a,u,a.path,u)),value:c._parse(new _r(a,a.data[u],a.path,u)),alwaysSet:u in a.data});return a.common.async?un.mergeObjectAsync(n,o):un.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,a){return n instanceof Je?new Xc({keyType:t,valueType:n,typeName:$e.ZodRecord,...Ke(a)}):new Xc({keyType:gr.create(),valueType:t,typeName:$e.ZodRecord,...Ke(n)})}}class Ev extends Je{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.parsedType!==ye.map)return ce(a,{code:re.invalid_type,expected:ye.map,received:a.parsedType}),ze;const o=this._def.keyType,s=this._def.valueType,c=[...a.data.entries()].map(([u,h],f)=>({key:o._parse(new _r(a,u,a.path,[f,"key"])),value:s._parse(new _r(a,h,a.path,[f,"value"]))}));if(a.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const h of c){const f=await h.key,m=await h.value;if(f.status==="aborted"||m.status==="aborted")return ze;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const h of c){const f=h.key,m=h.value;if(f.status==="aborted"||m.status==="aborted")return ze;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}Ev.create=(e,t,n)=>new Ev({valueType:t,keyType:e,typeName:$e.ZodMap,...Ke(n)});class Is extends Je{_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.parsedType!==ye.set)return ce(a,{code:re.invalid_type,expected:ye.set,received:a.parsedType}),ze;const o=this._def;o.minSize!==null&&a.data.size<o.minSize.value&&(ce(a,{code:re.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&a.data.size>o.maxSize.value&&(ce(a,{code:re.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const s=this._def.valueType;function c(h){const f=new Set;for(const m of h){if(m.status==="aborted")return ze;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...a.data.values()].map((h,f)=>s._parse(new _r(a,h,a.path,f)));return a.common.async?Promise.all(u).then(h=>c(h)):c(u)}min(t,n){return new Is({...this._def,minSize:{value:t,message:Ce.toString(n)}})}max(t,n){return new Is({...this._def,maxSize:{value:t,message:Ce.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Is.create=(e,t)=>new Is({valueType:e,minSize:null,maxSize:null,typeName:$e.ZodSet,...Ke(t)});class hf extends Je{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}hf.create=(e,t)=>new hf({getter:e,typeName:$e.ZodLazy,...Ke(t)});class Qc extends Je{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ce(n,{received:n.data,code:re.invalid_literal,expected:this._def.value}),ze}return{status:"valid",value:t.data}}get value(){return this._def.value}}Qc.create=(e,t)=>new Qc({value:e,typeName:$e.ZodLiteral,...Ke(t)});function hb(e,t){return new di({values:e,typeName:$e.ZodEnum,...Ke(t)})}class di extends Je{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),a=this._def.values;return ce(n,{expected:it.joinValues(a),received:n.parsedType,code:re.invalid_type}),ze}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),a=this._def.values;return ce(n,{received:n.data,code:re.invalid_enum_value,options:a}),ze}return Vn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return di.create(t,{...this._def,...n})}exclude(t,n=this._def){return di.create(this.options.filter(a=>!t.includes(a)),{...this._def,...n})}}di.create=hb;class ff extends Je{_parse(t){const n=it.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(t);if(a.parsedType!==ye.string&&a.parsedType!==ye.number){const o=it.objectValues(n);return ce(a,{expected:it.joinValues(o),received:a.parsedType,code:re.invalid_type}),ze}if(this._cache||(this._cache=new Set(it.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const o=it.objectValues(n);return ce(a,{received:a.data,code:re.invalid_enum_value,options:o}),ze}return Vn(t.data)}get enum(){return this._def.values}}ff.create=(e,t)=>new ff({values:e,typeName:$e.ZodNativeEnum,...Ke(t)});class Jc extends Je{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ye.promise&&n.common.async===!1)return ce(n,{code:re.invalid_type,expected:ye.promise,received:n.parsedType}),ze;const a=n.parsedType===ye.promise?n.data:Promise.resolve(n.data);return Vn(a.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Jc.create=(e,t)=>new Jc({type:e,typeName:$e.ZodPromise,...Ke(t)});class hi extends Je{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:a}=this._processInputParams(t),o=this._def.effect||null,s={addIssue:c=>{ce(a,c),c.fatal?n.abort():n.dirty()},get path(){return a.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){const c=o.transform(a.data,s);if(a.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return ze;const h=await this._def.schema._parseAsync({data:u,path:a.path,parent:a});return h.status==="aborted"?ze:h.status==="dirty"||n.value==="dirty"?vs(h.value):h});{if(n.value==="aborted")return ze;const u=this._def.schema._parseSync({data:c,path:a.path,parent:a});return u.status==="aborted"?ze:u.status==="dirty"||n.value==="dirty"?vs(u.value):u}}if(o.type==="refinement"){const c=u=>{const h=o.refinement(u,s);if(a.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(a.common.async===!1){const u=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return u.status==="aborted"?ze:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(u=>u.status==="aborted"?ze:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(o.type==="transform")if(a.common.async===!1){const c=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!co(c))return ze;const u=o.transform(c.value,s);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(c=>co(c)?Promise.resolve(o.transform(c.value,s)).then(u=>({status:n.value,value:u})):ze);it.assertNever(o)}}hi.create=(e,t,n)=>new hi({schema:e,typeName:$e.ZodEffects,effect:t,...Ke(n)});hi.createWithPreprocess=(e,t,n)=>new hi({schema:t,effect:{type:"preprocess",transform:e},typeName:$e.ZodEffects,...Ke(n)});class $r extends Je{_parse(t){return this._getType(t)===ye.undefined?Vn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}$r.create=(e,t)=>new $r({innerType:e,typeName:$e.ZodOptional,...Ke(t)});class fi extends Je{_parse(t){return this._getType(t)===ye.null?Vn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}fi.create=(e,t)=>new fi({innerType:e,typeName:$e.ZodNullable,...Ke(t)});class eu extends Je{_parse(t){const{ctx:n}=this._processInputParams(t);let a=n.data;return n.parsedType===ye.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}eu.create=(e,t)=>new eu({innerType:e,typeName:$e.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ke(t)});class tu extends Je{_parse(t){const{ctx:n}=this._processInputParams(t),a={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Gc(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Hr(a.common.issues)},input:a.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Hr(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}tu.create=(e,t)=>new tu({innerType:e,typeName:$e.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ke(t)});class Av extends Je{_parse(t){if(this._getType(t)!==ye.nan){const a=this._getOrReturnCtx(t);return ce(a,{code:re.invalid_type,expected:ye.nan,received:a.parsedType}),ze}return{status:"valid",value:t.data}}}Av.create=e=>new Av({typeName:$e.ZodNaN,...Ke(e)});class fb extends Je{_parse(t){const{ctx:n}=this._processInputParams(t),a=n.data;return this._def.type._parse({data:a,path:n.path,parent:n})}unwrap(){return this._def.type}}class dp extends Je{_parse(t){const{status:n,ctx:a}=this._processInputParams(t);if(a.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?ze:s.status==="dirty"?(n.dirty(),vs(s.value)):this._def.out._parseAsync({data:s.value,path:a.path,parent:a})})();{const o=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return o.status==="aborted"?ze:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:a.path,parent:a})}}static create(t,n){return new dp({in:t,out:n,typeName:$e.ZodPipeline})}}class nu extends Je{_parse(t){const n=this._def.innerType._parse(t),a=o=>(co(o)&&(o.value=Object.freeze(o.value)),o);return Gc(n)?n.then(o=>a(o)):a(n)}unwrap(){return this._def.innerType}}nu.create=(e,t)=>new nu({innerType:e,typeName:$e.ZodReadonly,...Ke(t)});var $e;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})($e||($e={}));const v=gr.create,Q=li.create;ci.create;const Be=qc.create,hp=uo.create,Jt=uf.create;Ma.create;const ie=yr.create,T=Rt.create,zn=Yc.create,pb=up.create;Zc.create;ui.create;const _t=Xc.create,Ye=Qc.create,nt=di.create;Jc.create;$r.create;fi.create;const pf={string:(e=>gr.create({...e,coerce:!0})),number:(e=>li.create({...e,coerce:!0})),boolean:(e=>qc.create({...e,coerce:!0})),bigint:(e=>ci.create({...e,coerce:!0})),date:(e=>uo.create({...e,coerce:!0}))};var fr;(function(e){e.STRING="string",e.DATE="date",e.DATETIME="datetime",e.INTEGER="integer",e.FLOAT="float",e.BOOLEAN="boolean",e.UUID="uuid",e.JSON="json"})(fr||(fr={}));const RT=nt(["CASCADE","RESTRICT","NO ACTION"]),LT=nt(["CASCADE","SET NULL","SET DEFAULT","RESTRICT","NO ACTION"]),DT=nt([fr.STRING,fr.DATE,fr.DATETIME,fr.INTEGER,fr.FLOAT,fr.BOOLEAN,fr.UUID,fr.JSON]),mb=T({referenceTable:v().min(1,"Target table cannot be empty"),referenceColumn:v().min(1,"Target column cannot be empty"),onDelete:LT,onUpdate:RT}),gb=T({columnName:v().min(1,"Column name cannot be empty").max(64,"Column name must be less than 64 characters"),type:zn([DT,v()]),defaultValue:v().optional(),isPrimaryKey:Be().optional(),isNullable:Be(),isUnique:Be(),foreignKey:mb.optional()}),yb=T({tableName:v().min(1,"Table name cannot be empty").max(64,"Table name must be less than 64 characters"),columns:ie(gb).min(1,"At least one column is required"),recordCount:Q().optional(),createdAt:v().optional(),updatedAt:v().optional()}),MT=T({functionName:v(),functionDef:v(),kind:v()}),IT=T({tableName:v(),indexName:v(),indexDef:v(),isUnique:Be().nullable(),isPrimary:Be().nullable()}),NT=T({tableName:v(),policyName:v(),cmd:v(),roles:ie(v()),qual:v().nullable(),withCheck:v().nullable()}),OT=T({tableName:v(),triggerName:v(),actionTiming:v(),eventManipulation:v(),actionOrientation:v(),actionCondition:v().nullable(),actionStatement:v()});yb.pick({tableName:!0,columns:!0}).extend({rlsEnabled:Be().default(!0)});yb.pick({tableName:!0,columns:!0}).extend({message:v(),autoFields:ie(v()),nextActions:v()});T({addColumns:ie(gb.omit({foreignKey:!0})).optional(),dropColumns:ie(v()).optional(),updateColumns:ie(T({columnName:v(),defaultValue:v().optional(),newColumnName:v().min(1,"New column name cannot be empty").max(64,"New column name must be less than 64 characters").optional()})).optional(),addForeignKeys:ie(T({columnName:v().min(1,"Column name is required for adding foreign key"),foreignKey:mb})).optional(),dropForeignKeys:ie(v()).optional(),renameTable:T({newTableName:v().min(1,"New table name cannot be empty").max(64,"New table name must be less than 64 characters")}).optional()});T({message:v(),tableName:v(),operations:ie(v())});T({message:v(),tableName:v(),nextActions:v()});T({query:v().min(1,"Query is required"),params:ie(Jt()).optional()});T({rows:ie(_t(v(),Jt())),rowCount:Q().nullable(),fields:ie(T({name:v(),dataTypeID:Q()})).optional()});T({tables:ie(v()).optional(),format:nt(["sql","json"]).default("sql"),includeData:Be().default(!0),includeFunctions:Be().default(!1),includeSequences:Be().default(!1),includeViews:Be().default(!1),rowLimit:Q().int().positive().max(1e4).default(1e3)});const jT=T({timestamp:v(),tables:_t(v(),T({schema:ie(T({columnName:v(),dataType:v(),characterMaximumLength:Q().nullable(),isNullable:v(),columnDefault:v().nullable()})),indexes:ie(T({indexname:v(),indexdef:v(),isUnique:Be().nullable(),isPrimary:Be().nullable()})),foreignKeys:ie(T({constraintName:v(),columnName:v(),foreignTableName:v(),foreignColumnName:v(),deleteRule:v().nullable(),updateRule:v().nullable()})),rlsEnabled:Be().optional(),policies:ie(T({policyname:v(),cmd:v(),roles:ie(v()),qual:v().nullable(),withCheck:v().nullable()})),triggers:ie(T({triggerName:v(),actionTiming:v(),eventManipulation:v(),actionOrientation:v(),actionCondition:v().nullable(),actionStatement:v(),newTable:v().nullable(),oldTable:v().nullable()})),rows:ie(_t(v(),Jt())).optional(),recordCount:Q().optional()})),functions:ie(T({functionName:v(),functionDef:v(),kind:v()})),sequences:ie(T({sequenceName:v(),startValue:v(),increment:v(),minValue:v().nullable(),maxValue:v().nullable(),cycle:v()})),views:ie(T({viewName:v(),definition:v()}))});T({format:nt(["sql","json"]),data:zn([v(),jT]),timestamp:v()});T({truncate:zn([Be(),v().transform(e=>{if(e==="true")return!0;if(e==="false")return!1;throw new Error("Invalid boolean string")})]).default(!1)});T({success:Be(),message:v(),filename:v(),tables:ie(v()),rowsImported:Q(),fileSize:Q()});T({table:v().min(1,"Table name is required"),upsertKey:v().optional()});T({success:Be(),message:v(),table:v(),rowsAffected:Q(),totalRecords:Q(),filename:v()});T({functions:ie(MT)});T({indexes:ie(IT)});T({policies:ie(NT)});T({triggers:ie(OT)});const UT=T({id:v(),key:v(),isActive:Be(),isReserved:Be(),lastUsedAt:v().nullable(),expiresAt:v().nullable(),createdAt:v(),updatedAt:v()});T({secrets:ie(UT)});T({key:v(),value:v()});T({key:v().regex(/^[A-Z0-9_]+$/,"Use uppercase letters, numbers, and underscores only"),value:v().min(1,"Value is required")});T({success:Ye(!0),message:v(),id:v()});T({success:Ye(!0),message:v()});T({success:Ye(!0),message:v()});const BT=T({key:v(),bucket:v(),size:Q(),mimeType:v().optional(),uploadedAt:v(),url:v()}),FT=T({name:v(),public:Be(),createdAt:v()});T({id:v().uuid(),maxFileSizeMb:Q().int().positive(),createdAt:v(),updatedAt:v()});T({bucketName:v().min(1,"Bucket name cannot be empty"),isPublic:Be().default(!0)});T({isPublic:Be()});T({objects:ie(BT),pagination:T({offset:Q(),limit:Q(),total:Q()})});T({filename:v().min(1,"Filename cannot be empty"),contentType:v().optional(),size:Q().optional()});T({method:nt(["presigned","direct"]),uploadUrl:v(),fields:_t(v()).optional(),key:v(),confirmRequired:Be(),confirmUrl:v().optional(),expiresAt:hp().optional()});T({expiresIn:Q().optional().default(3600)});T({method:nt(["presigned","direct"]),url:v(),expiresAt:hp().optional(),headers:_t(v()).optional()});T({size:Q(),contentType:v().optional(),etag:v().optional()});T({maxFileSizeMb:Q().int().min(1,"Must be at least 1 MB").max(200,"Must be at most 200 MB")});const Su=v().uuid("Invalid user ID format"),br=v().email("Invalid email format").toLowerCase().trim(),fp=v(),VT=v().min(1,"Name is required").max(100,"Name must be less than 100 characters").trim(),zT=nt(["anon","authenticated","project_admin"]),Rv=nt(["code","link"]),vb=T({name:v().optional(),avatar_url:v().url().optional()}).passthrough(),vo=T({id:Su,email:br,emailVerified:Be(),providers:ie(v()).optional(),createdAt:v(),updatedAt:v(),profile:vb.nullable(),metadata:_t(Jt()).nullable()}),Cu=nt(["google","github","discord","linkedin","facebook","instagram","tiktok","apple","x","spotify","microsoft"]);T({provider:Cu,redirectUri:v().url().optional()});const pp=T({id:v().uuid(),provider:Cu,clientId:v().optional(),scopes:ie(v()).optional(),redirectUri:v().optional(),useSharedKey:Be(),createdAt:v(),updatedAt:v()}),$T=/^(?:(?:https?:\/\/)(?:(?:\*\.)?[^\s/:?#]+|\[[0-9A-Fa-f:.]+\])(?::\d+)?(?:\/[^\s]*)?|(?!(?:https?|javascript|data|file|vbscript):)[a-zA-Z][a-zA-Z0-9+.-]*:(?:\/\/[^\s/]+(?:\/[^\s]*)?|\/[^\s]*))$/i,kb=T({id:v().uuid(),requireEmailVerification:Be(),passwordMinLength:Q().min(4).max(128),requireNumber:Be(),requireLowercase:Be(),requireUppercase:Be(),requireSpecialChar:Be(),verifyEmailMethod:Rv,resetPasswordMethod:Rv,allowedRedirectUrls:ie(v().regex($T,{message:"Invalid URL or wildcard URL"})).optional().nullable(),createdAt:v(),updatedAt:v()});T({sub:Su,email:br,role:zT,iat:Q().optional(),exp:Q().optional()});const _b=v().min(1).max(64).regex(/^[a-z0-9_-]+$/,"Key must contain only lowercase letters, numbers, hyphens, and underscores"),mp=T({id:v().uuid(),key:_b,name:v().min(1),discoveryEndpoint:v().url(),clientId:v().min(1),createdAt:v(),updatedAt:v()}),HT=T({limit:v().optional(),offset:v().optional()});T({email:br,password:fp,name:VT.optional(),redirectTo:v().url().optional()});T({email:br,password:fp});T({refreshToken:v().min(1,"refreshToken is required")});T({code:v()});HT.extend({search:v().optional()}).optional();T({userIds:ie(Su).min(1,"At least one user ID is required")});T({profile:_t(Jt())});T({email:br,redirectTo:v().url().optional()});T({email:br,otp:v().regex(/^\d{6}$/,"OTP code must be a 6-digit numeric code")});T({email:br,redirectTo:v().url().optional()});T({email:br,code:v().regex(/^\d{6}$/,"Reset password code must be a 6-digit numeric code")});T({newPassword:fp,otp:v().min(1,"OTP/token is required")});T({user:vo.optional(),accessToken:v().nullable(),requireEmailVerification:Be().optional(),csrfToken:v().nullable().optional(),refreshToken:v().optional()});T({user:vo,accessToken:v(),csrfToken:v().nullable().optional(),refreshToken:v().optional()});T({user:vo,accessToken:v(),csrfToken:v().nullable().optional(),refreshToken:v().optional()});T({accessToken:v(),user:vo,csrfToken:v().optional(),refreshToken:v().optional()});T({token:v(),expiresAt:v().datetime()});T({message:v()});T({user:vo});T({id:Su,profile:vb.nullable()});T({data:ie(vo),pagination:T({offset:Q(),limit:Q(),total:Q()})});T({message:v(),deletedCount:Q().int().nonnegative()});T({authUrl:v().url()});pp.omit({id:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:v().optional()});pp.omit({id:!0,provider:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:v().optional()}).partial();const bb=/^[A-Za-z0-9._~-]+$/;T({redirect_uri:v().url().optional(),code_challenge:v().min(43,"Code challenge must be at least 43 characters").max(128,"Code challenge must be at most 128 characters").regex(bb,"Code challenge must be base64url encoded")});T({code:v().min(1,"Exchange code is required"),code_verifier:v().min(43,"Code verifier must be at least 43 characters").max(128,"Code verifier must be at most 128 characters").regex(bb,"Code verifier must be base64url encoded")});T({data:ie(pp),count:Q()});kb.omit({id:!0,createdAt:!0,updatedAt:!0}).partial();const WT=T({oAuthProviders:ie(Cu),customOAuthProviders:ie(_b),...kb.omit({id:!0,updatedAt:!0,createdAt:!0,allowedRedirectUrls:!0}).shape});T({error:v(),message:v(),statusCode:Q().int(),nextActions:v().optional()});mp.omit({id:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:v().min(1,"Client secret is required")});mp.omit({id:!0,key:!0,createdAt:!0,updatedAt:!0}).extend({clientSecret:v().min(1).optional()}).partial();T({data:ie(mp),count:Q()});const wb=nt(["system","user"]),xb=T({id:v().uuid(),pattern:v().min(1),description:v().nullable(),webhookUrls:ie(v().url()).nullable(),enabled:Be(),createdAt:v().datetime(),updatedAt:v().datetime()}),KT=T({id:v().uuid(),eventName:v().min(1),channelId:v().uuid().nullable(),channelName:v().min(1),payload:_t(v(),Jt()),senderType:wb,senderId:v().uuid().nullable(),wsAudienceCount:Q().int().min(0),whAudienceCount:Q().int().min(0),whDeliveredCount:Q().int().min(0),createdAt:v().datetime()}),GT=T({retentionDays:Q().int().positive().nullable()});T({channel:v().min(1)});T({channel:v().min(1)});T({channel:v().min(1),event:v().min(1),payload:_t(v(),Jt())});pb("ok",[T({ok:Ye(!0),channel:v().min(1)}),T({ok:Ye(!1),channel:v().min(1),error:T({code:v().min(1),message:v().min(1)})})]);T({channel:v().optional(),code:v().min(1),message:v().min(1)});T({messageId:v().uuid(),channel:v().min(1),eventName:v().min(1),payload:_t(v(),Jt())});const qT=T({channel:v().optional(),messageId:v().uuid(),senderType:wb,senderId:v().uuid().optional(),timestamp:v().datetime()});T({meta:qT}).passthrough();T({pattern:v().min(1,"Channel pattern is required"),description:v().optional(),webhookUrls:ie(v().url()).optional(),enabled:Be().optional().default(!0)});T({pattern:v().min(1).optional(),description:v().optional(),webhookUrls:ie(v().url()).optional(),enabled:Be().optional()});ie(xb);T({message:v()});T({channelId:v().uuid().optional(),eventName:v().optional(),limit:pf.number().int().min(1).max(1e3).optional().default(100),offset:pf.number().int().min(0).optional().default(0)});ie(KT);T({channelId:v().uuid().optional(),since:pf.date().optional()});T({totalMessages:Q().int().min(0),whDeliveryRate:Q().min(0).max(1),topEvents:ie(T({eventName:v(),count:Q().int().min(0)})),retentionDays:GT.shape.retentionDays});const Lv=T({policyName:v(),tableName:v(),command:v(),roles:ie(v()),using:v().nullable(),withCheck:v().nullable()}),YT=T({subscribe:T({policies:ie(Lv)}),publish:T({policies:ie(Lv)})}),ZT=WT,XT=T({tables:ie(T({tableName:v(),recordCount:Q()})),totalSizeInGB:Q(),hint:v().optional()}),QT=FT.extend({objectCount:Q().optional()}),JT=T({buckets:ie(QT),totalSizeInGB:Q()}),eE=T({slug:v(),name:v(),description:v().nullable(),status:v()}),tE=T({models:ie(T({inputModality:ie(v()),outputModality:ie(v()),modelId:v()}))}),nE=T({channels:ie(xb),permissions:YT});T({auth:ZT,database:XT,storage:JT,aiIntegration:tE.optional(),functions:ie(eE),realtime:nE.optional(),version:v().optional()});const rE=T({host:v(),port:Q(),database:v(),user:v(),password:v(),sslmode:v()});T({connectionURL:v(),parameters:rE});T({databasePassword:v()});T({apiKey:v()});T({projectId:v().nullable()});const ho=nt(["text","image","audio"]),aE=T({inputModality:ie(ho).min(1),outputModality:ie(ho).min(1),provider:v(),modelId:v(),systemPrompt:v().optional()}),Pb=aE.extend({id:v().uuid()});Pb.extend({usageStats:T({totalInputTokens:Q(),totalOutputTokens:Q(),totalTokens:Q(),totalImageCount:Q(),totalRequests:Q()}).optional()});const iE=T({configId:v().uuid(),inputTokens:Q().int().optional(),outputTokens:Q().int().optional(),imageCount:Q().int().optional(),imageResolution:v().optional()}),oE=iE.extend({id:v().uuid(),createdAt:hp(),modelId:v().nullable().optional(),model:v().nullable(),provider:v().nullable(),inputModality:ie(ho).nullable(),outputModality:ie(ho).nullable()});T({totalInputTokens:Q(),totalOutputTokens:Q(),totalTokens:Q(),totalImageCount:Q(),totalRequests:Q()});const sE=T({type:Ye("text"),text:v()}),lE=T({type:Ye("image_url"),image_url:T({url:v(),detail:nt(["auto","low","high"]).optional()})}),cE=T({type:Ye("input_audio"),input_audio:T({data:v(),format:nt(["wav","mp3","aiff","aac","ogg","flac","m4a"])})}),uE=T({type:Ye("file"),file:T({filename:v(),file_data:v()})}),dE=zn([sE,lE,cE,uE]),hE=T({name:v(),description:v().optional(),parameters:_t(Jt()).optional()}),fE=T({type:Ye("function"),function:hE}),pE=zn([nt(["auto","none","required"]),T({type:Ye("function"),function:T({name:v()})})]),Sb=T({id:v(),type:Ye("function"),function:T({name:v(),arguments:v()})}),mE=T({role:nt(["user","assistant","system","tool"]),content:zn([v(),ie(dE)]).nullable(),images:ie(T({url:v()})).optional(),tool_calls:ie(Sb).optional(),tool_call_id:v().optional()}),gE=T({enabled:Be(),engine:nt(["native","exa"]).optional(),maxResults:Q().min(1).max(10).optional(),searchPrompt:v().optional()}),yE=T({enabled:Be(),pdf:T({engine:nt(["pdf-text","mistral-ocr","native"]).optional()}).optional()});T({model:v(),messages:ie(mE),temperature:Q().min(0).max(2).optional(),maxTokens:Q().positive().optional(),topP:Q().min(0).max(1).optional(),stream:Be().optional(),webSearch:gE.optional(),fileParser:yE.optional(),thinking:Be().optional(),tools:ie(fE).optional(),toolChoice:pE.optional(),parallelToolCalls:Be().optional()});const vE=T({type:Ye("url_citation"),urlCitation:T({url:v(),title:v().optional(),content:v().optional(),startIndex:Q().optional(),endIndex:Q().optional()})}),kE=T({type:Ye("file"),file:T({filename:v(),parsedContent:v().optional(),metadata:_t(Jt()).optional()})}),_E=zn([vE,kE]);T({text:v(),tool_calls:ie(Sb).optional(),annotations:ie(_E).optional(),metadata:T({model:v(),usage:T({promptTokens:Q().optional(),completionTokens:Q().optional(),totalTokens:Q().optional()}).optional()}).optional()});T({model:v(),input:zn([v(),ie(v())]),encoding_format:nt(["float","base64"]).optional(),dimensions:Q().int().min(0).optional()});const bE=T({object:Ye("embedding"),embedding:zn([ie(Q()),v()]),index:Q()});T({object:Ye("list"),data:ie(bE),metadata:T({model:v(),usage:T({promptTokens:Q().optional(),totalTokens:Q().optional()}).optional()}).optional()});T({model:v(),prompt:v(),images:ie(T({url:v()})).optional()});T({text:v().optional(),images:ie(T({type:Ye("imageUrl"),imageUrl:v()})),metadata:T({model:v(),usage:T({promptTokens:Q().optional(),completionTokens:Q().optional(),totalTokens:Q().optional()}).optional()}).optional()});T({id:v(),inputModality:ie(ho).min(1),outputModality:ie(ho).min(1),provider:v(),modelId:v(),inputPrice:Q().min(0).optional(),outputPrice:Q().min(0).optional()});Pb.omit({id:!0});T({systemPrompt:v().nullable()});T({records:ie(oE),total:Q()});T({startDate:v().datetime().optional(),endDate:v().datetime().optional(),limit:v().regex(/^\d+$/).default("50"),offset:v().regex(/^\d+$/).default("0")});T({configId:v().uuid().optional(),startDate:v().datetime().optional(),endDate:v().datetime().optional()});const wE=nt(["byok","cloud","env","unconfigured"]);T({keySource:wE,hasByokKey:Be(),maskedKey:v().optional()});T({apiKey:v().min(1,"API key is required")});const Cb=T({id:v(),actor:v(),action:v(),module:v(),details:_t(Jt()).nullable(),ipAddress:v().nullable(),createdAt:v(),updatedAt:v()});T({id:v(),name:v(),token:v()});const xE=T({id:v(),eventMessage:v(),timestamp:v(),body:_t(v(),Jt()),source:v().optional()});T({source:v(),count:Q(),lastActivity:v()});const PE=T({level:v(),message:v()});T({deploymentId:v(),status:nt(["pending","success","failed"]),logs:ie(PE),createdAt:v()});T({limit:Q().default(100),offset:Q().default(0),actor:v().optional(),action:v().optional(),module:v().optional(),startDate:v().optional(),endDate:v().optional()});T({data:ie(Cb),pagination:T({limit:Q(),offset:Q(),total:Q()})});T({days:Q().default(7)});T({totalLogs:Q(),uniqueActors:Q(),uniqueModules:Q(),actionsByModule:_t(Q()),recentActivity:ie(Cb)});T({daysToKeep:Q().default(90)});T({message:v(),deleted:Q()});T({logs:ie(xE),total:Q()});const Tb=T({id:v(),slug:v(),name:v(),description:v().nullable(),code:v(),status:nt(["draft","active","error"]),createdAt:v(),updatedAt:v(),deployedAt:v().nullable()});T({name:v().min(1,"Name is required"),slug:v().regex(/^[a-zA-Z0-9_-]+$/,"Invalid slug format - must be alphanumeric with hyphens or underscores only").optional(),code:v().min(1),description:v().optional(),status:nt(["draft","active"]).optional().default("active")});T({name:v().optional(),code:v().optional(),description:v().optional(),status:nt(["draft","active"]).optional()});T({functions:ie(Tb),runtime:T({status:nt(["running","unavailable"])}),deploymentUrl:v().nullable().optional()});const SE=T({id:v(),status:nt(["success","failed"]),url:v().nullable(),buildLogs:ie(v()).optional()});T({success:Be(),function:Tb,deployment:SE.nullable().optional()});const CE=T({type:Ye("APP_ROUTE_CHANGE"),path:v()}),TE=T({type:Ye("AUTH_SUCCESS")}),EE=T({type:Ye("AUTH_ERROR"),message:v()}),AE=T({type:Ye("MCP_CONNECTION_STATUS"),connected:Be(),toolName:v(),timestamp:zn([Q(),v()])}),RE=T({type:Ye("SHOW_ONBOARDING_OVERLAY")}),LE=T({type:Ye("SHOW_SETTINGS_OVERLAY")}),DE=T({type:Ye("ONBOARDING_SUCCESS")}),ME=T({type:Ye("NAVIGATE_TO_USAGE")}),IE=T({type:Ye("SHOW_CONTACT_MODAL")}),NE=T({type:Ye("SHOW_CONNECT_OVERLAY")}),OE=T({type:Ye("SHOW_PLAN_MODAL")}),jE=T({type:Ye("AUTHORIZATION_CODE"),code:v()}),UE=T({type:Ye("ROUTE_CHANGE"),path:v()}),BE=T({type:Ye("REQUEST_PROJECT_INFO")}),FE=T({type:Ye("PROJECT_INFO"),name:v(),instanceType:v(),region:v(),latestVersion:v().optional()}),VE=T({type:Ye("REQUEST_INSTANCE_INFO")}),zE=T({type:Ye("INSTANCE_INFO"),currentInstanceType:v(),planName:v(),computeCredits:Q(),currentOrgComputeCost:Q(),instanceTypes:ie(T({id:v(),name:v(),cpu:v(),ram:v(),pricePerHour:Q(),pricePerMonth:Q()})),projects:ie(T({name:v(),instanceType:v(),monthlyCost:Q(),isCurrent:Be(),status:v()}))}),$E=T({type:Ye("REQUEST_INSTANCE_TYPE_CHANGE"),instanceType:v()}),HE=T({type:Ye("INSTANCE_TYPE_CHANGE_RESULT"),success:Be(),instanceType:v().optional(),error:v().optional()});pb("type",[CE,TE,EE,AE,RE,LE,DE,ME,IE,NE,OE,jE,UE,BE,FE,VE,zE,$E,HE]);nt(["db","storage","functions","auth","ai","realtime"]).describe(`
13
13
  SDK feature categories:
14
14
 
15
15
  - "db" - Database operations
@@ -35,11 +35,11 @@ Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}
35
35
  "ai-integration-sdk" (AI features),
36
36
  "real-time" (real-time pub/sub through WebSockets),
37
37
  "deployment" (deploy frontend applications via MCP tool)
38
- `);const Eh=zn([br,ie(br).min(1,"At least one email is required").max(50,"Maximum 50 recipients allowed")]);T({to:Eh,subject:v().trim().min(1,"Subject is required").max(500,"Subject too long"),html:v().trim().min(1,"HTML content is required"),cc:Eh.optional(),bcc:Eh.optional(),from:v().trim().max(100,"From name too long").optional(),replyTo:v().email("Reply-To must be a valid email").optional()});T({});const $E=nt(["WAITING","UPLOADING","QUEUED","BUILDING","READY","ERROR","CANCELED"]),HE=T({id:v().uuid(),providerDeploymentId:v().nullable(),provider:v(),status:$E,url:v().nullable(),metadata:_t(Jt()).nullable(),createdAt:v().datetime(),updatedAt:v().datetime()}),WE=T({buildCommand:v().nullable().optional(),outputDirectory:v().nullable().optional(),installCommand:v().nullable().optional(),devCommand:v().nullable().optional(),rootDirectory:v().nullable().optional()}),KE=T({key:v(),value:v()});T({id:v().uuid(),uploadUrl:v().url(),uploadFields:_t(v())});T({projectSettings:WE.optional(),envVars:ie(KE).optional(),meta:_t(v()).optional()});T({data:ie(HE),pagination:T({limit:Q(),offset:Q(),total:Q()})});const GE=T({id:v(),key:v(),type:nt(["plain","encrypted","secret","sensitive","system"]),updatedAt:Q().optional()}),qE=T({id:v(),key:v(),value:v(),type:nt(["plain","encrypted","secret","sensitive","system"]),updatedAt:Q().optional()});T({envVars:ie(GE)});T({envVar:qE});const YE=T({key:v().trim().min(1,"key is required"),value:v()});T({envVars:ie(YE).min(1)}).superRefine(({envVars:e},t)=>{const n=new Map;e.forEach((a,s)=>{if(n.get(a.key)!==void 0){t.addIssue({code:re.custom,message:"duplicate environment variable key",path:["envVars",s,"key"]});return}n.set(a.key,s)})});T({success:Ye(!0),message:v()});T({success:Ye(!0),message:v(),count:Q().int().positive()});T({success:Ye(!0),message:v()});T({slug:v().trim().min(3,"slug must be at least 3 characters").max(63,"slug must be at most 63 characters").regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/,"slug must be lowercase alphanumeric with hyphens, not starting or ending with hyphen").nullable()});T({success:Be(),slug:v().nullable(),domain:v().nullable()});T({currentDeploymentId:v().uuid().nullable(),defaultDomainUrl:v().nullable(),customDomainUrl:v().nullable()});const ZE=T({type:v(),domain:v(),value:v()}),XE=T({domain:v(),apexDomain:v(),verified:Be(),misconfigured:Be(),verification:ie(ZE),cnameTarget:v().nullable(),aRecordValue:v().nullable()});T({domain:v().trim().min(1,"Domain is required").regex(/^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$/i,"Invalid domain format (e.g. myapp.com or www.myapp.com)").refine(e=>!e.toLowerCase().endsWith(".insforge.site"),{message:"Domains ending with .insforge.site are reserved by InsForge"})});T({domains:ie(XE)});const QE=T({id:v().uuid(),name:v(),cronSchedule:v(),functionUrl:v().url(),httpMethod:nt(["GET","POST","PUT","PATCH","DELETE"]),headers:_t(v()).nullable(),body:zn([v(),_t(Jt())]).nullable(),cronJobId:v().nullable(),lastExecutedAt:v().datetime().nullable(),isActive:Be().default(!0),nextRun:v().datetime().nullable(),createdAt:v().datetime(),updatedAt:v().datetime()}),JE=T({id:v().uuid(),scheduleId:v().uuid(),executedAt:v().datetime(),statusCode:Q().int(),success:Be(),durationMs:Q().int(),message:v().nullable()}),Eb=v().refine(e=>{const t=e.split(" ");return t.length===5||t.length===6},{message:'Invalid cron schedule format. Use 5 or 6 parts (e.g., "* * * * *").'});T({name:v().min(3,"Schedule name must be at least 3 characters long"),cronSchedule:Eb,functionUrl:v().url("The function URL must be a valid URL."),httpMethod:nt(["GET","POST","PUT","PATCH","DELETE"]),headers:_t(v()).optional().describe("Header values can reference secrets using ${{secrets.KEY_NAME}} syntax."),body:_t(Jt()).optional().describe("The JSON body to send with the request.")});T({name:v().min(3,"Schedule name must be at least 3 characters long").optional(),cronSchedule:Eb.optional(),functionUrl:v().url("The function URL must be a valid URL.").optional(),httpMethod:nt(["GET","POST","PUT","PATCH","DELETE"]).optional(),headers:_t(v()).optional().describe("Header values can reference secrets using ${{secrets.KEY_NAME}} syntax."),body:_t(Jt()).optional().describe("The JSON body to send with the request."),isActive:Be().optional().describe("Enable or disable the schedule.")});ie(QE);const eA=JE;T({logs:ie(eA),totalCount:Q().int().nonnegative(),limit:Q().int().positive(),offset:Q().int().nonnegative()});T({id:v().uuid(),cronJobId:v(),message:v()});T({id:v().uuid(),cronJobId:v().optional(),message:v()});T({message:v()});var zt={},qi={},Yi={},Zi={},Xi={},Qi={},tA=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},hs=tA();const nA=hs.fetch,rA=hs.fetch.bind(hs),aA=hs.Headers,iA=hs.Request,sA=hs.Response,oA=Object.freeze(Object.defineProperty({__proto__:null,Headers:aA,Request:iA,Response:sA,default:rA,fetch:nA},Symbol.toStringTag,{value:"Module"})),lA=wS(oA);var fc={},Dv;function Ab(){if(Dv)return fc;Dv=1,Object.defineProperty(fc,"__esModule",{value:!0});class e extends Error{constructor(n){super(n.message),this.name="PostgrestError",this.details=n.details,this.hint=n.hint,this.code=n.code}}return fc.default=e,fc}var Mv;function Rb(){if(Mv)return Qi;Mv=1;var e=Qi&&Qi.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Qi,"__esModule",{value:!0});const t=e(lA),n=e(Ab());class a{constructor(o){var c,u;this.shouldThrowOnError=!1,this.method=o.method,this.url=o.url,this.headers=new Headers(o.headers),this.schema=o.schema,this.body=o.body,this.shouldThrowOnError=(c=o.shouldThrowOnError)!==null&&c!==void 0?c:!1,this.signal=o.signal,this.isMaybeSingle=(u=o.isMaybeSingle)!==null&&u!==void 0?u:!1,o.fetch?this.fetch=o.fetch:typeof fetch>"u"?this.fetch=t.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(o,c){return this.headers=new Headers(this.headers),this.headers.set(o,c),this}then(o,c){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const u=this.fetch;let h=u(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async f=>{var m,y,k,w;let P=null,C=null,S=null,D=f.status,L=f.statusText;if(f.ok){if(this.method!=="HEAD"){const K=await f.text();K===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((m=this.headers.get("Accept"))===null||m===void 0)&&m.includes("application/vnd.pgrst.plan+text"))?C=K:C=JSON.parse(K))}const O=(y=this.headers.get("Prefer"))===null||y===void 0?void 0:y.match(/count=(exact|planned|estimated)/),W=(k=f.headers.get("content-range"))===null||k===void 0?void 0:k.split("/");O&&W&&W.length>1&&(S=parseInt(W[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(C)&&(C.length>1?(P={code:"PGRST116",details:`Results contain ${C.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},C=null,S=null,D=406,L="Not Acceptable"):C.length===1?C=C[0]:C=null)}else{const O=await f.text();try{P=JSON.parse(O),Array.isArray(P)&&f.status===404&&(C=[],P=null,D=200,L="OK")}catch{f.status===404&&O===""?(D=204,L="No Content"):P={message:O}}if(P&&this.isMaybeSingle&&(!((w=P?.details)===null||w===void 0)&&w.includes("0 rows"))&&(P=null,D=200,L="OK"),P&&this.shouldThrowOnError)throw new n.default(P)}return{error:P,data:C,count:S,status:D,statusText:L}});return this.shouldThrowOnError||(h=h.catch(f=>{var m,y,k;return{error:{message:`${(m=f?.name)!==null&&m!==void 0?m:"FetchError"}: ${f?.message}`,details:`${(y=f?.stack)!==null&&y!==void 0?y:""}`,hint:"",code:`${(k=f?.code)!==null&&k!==void 0?k:""}`},data:null,count:null,status:0,statusText:""}})),h.then(o,c)}returns(){return this}overrideTypes(){return this}}return Qi.default=a,Qi}var Iv;function Lb(){if(Iv)return Xi;Iv=1;var e=Xi&&Xi.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Xi,"__esModule",{value:!0});const t=e(Rb());class n extends t.default{select(s){let o=!1;const c=(s??"*").split("").map(u=>/\s/.test(u)&&!o?"":(u==='"'&&(o=!o),u)).join("");return this.url.searchParams.set("select",c),this.headers.append("Prefer","return=representation"),this}order(s,{ascending:o=!0,nullsFirst:c,foreignTable:u,referencedTable:h=u}={}){const f=h?`${h}.order`:"order",m=this.url.searchParams.get(f);return this.url.searchParams.set(f,`${m?`${m},`:""}${s}.${o?"asc":"desc"}${c===void 0?"":c?".nullsfirst":".nullslast"}`),this}limit(s,{foreignTable:o,referencedTable:c=o}={}){const u=typeof c>"u"?"limit":`${c}.limit`;return this.url.searchParams.set(u,`${s}`),this}range(s,o,{foreignTable:c,referencedTable:u=c}={}){const h=typeof u>"u"?"offset":`${u}.offset`,f=typeof u>"u"?"limit":`${u}.limit`;return this.url.searchParams.set(h,`${s}`),this.url.searchParams.set(f,`${o-s+1}`),this}abortSignal(s){return this.signal=s,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:s=!1,verbose:o=!1,settings:c=!1,buffers:u=!1,wal:h=!1,format:f="text"}={}){var m;const y=[s?"analyze":null,o?"verbose":null,c?"settings":null,u?"buffers":null,h?"wal":null].filter(Boolean).join("|"),k=(m=this.headers.get("Accept"))!==null&&m!==void 0?m:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${f}; for="${k}"; options=${y};`),f==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(s){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${s}`),this}}return Xi.default=n,Xi}var Nv;function gp(){if(Nv)return Zi;Nv=1;var e=Zi&&Zi.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Zi,"__esModule",{value:!0});const t=e(Lb());class n extends t.default{eq(s,o){return this.url.searchParams.append(s,`eq.${o}`),this}neq(s,o){return this.url.searchParams.append(s,`neq.${o}`),this}gt(s,o){return this.url.searchParams.append(s,`gt.${o}`),this}gte(s,o){return this.url.searchParams.append(s,`gte.${o}`),this}lt(s,o){return this.url.searchParams.append(s,`lt.${o}`),this}lte(s,o){return this.url.searchParams.append(s,`lte.${o}`),this}like(s,o){return this.url.searchParams.append(s,`like.${o}`),this}likeAllOf(s,o){return this.url.searchParams.append(s,`like(all).{${o.join(",")}}`),this}likeAnyOf(s,o){return this.url.searchParams.append(s,`like(any).{${o.join(",")}}`),this}ilike(s,o){return this.url.searchParams.append(s,`ilike.${o}`),this}ilikeAllOf(s,o){return this.url.searchParams.append(s,`ilike(all).{${o.join(",")}}`),this}ilikeAnyOf(s,o){return this.url.searchParams.append(s,`ilike(any).{${o.join(",")}}`),this}is(s,o){return this.url.searchParams.append(s,`is.${o}`),this}in(s,o){const c=Array.from(new Set(o)).map(u=>typeof u=="string"&&new RegExp("[,()]").test(u)?`"${u}"`:`${u}`).join(",");return this.url.searchParams.append(s,`in.(${c})`),this}contains(s,o){return typeof o=="string"?this.url.searchParams.append(s,`cs.${o}`):Array.isArray(o)?this.url.searchParams.append(s,`cs.{${o.join(",")}}`):this.url.searchParams.append(s,`cs.${JSON.stringify(o)}`),this}containedBy(s,o){return typeof o=="string"?this.url.searchParams.append(s,`cd.${o}`):Array.isArray(o)?this.url.searchParams.append(s,`cd.{${o.join(",")}}`):this.url.searchParams.append(s,`cd.${JSON.stringify(o)}`),this}rangeGt(s,o){return this.url.searchParams.append(s,`sr.${o}`),this}rangeGte(s,o){return this.url.searchParams.append(s,`nxl.${o}`),this}rangeLt(s,o){return this.url.searchParams.append(s,`sl.${o}`),this}rangeLte(s,o){return this.url.searchParams.append(s,`nxr.${o}`),this}rangeAdjacent(s,o){return this.url.searchParams.append(s,`adj.${o}`),this}overlaps(s,o){return typeof o=="string"?this.url.searchParams.append(s,`ov.${o}`):this.url.searchParams.append(s,`ov.{${o.join(",")}}`),this}textSearch(s,o,{config:c,type:u}={}){let h="";u==="plain"?h="pl":u==="phrase"?h="ph":u==="websearch"&&(h="w");const f=c===void 0?"":`(${c})`;return this.url.searchParams.append(s,`${h}fts${f}.${o}`),this}match(s){return Object.entries(s).forEach(([o,c])=>{this.url.searchParams.append(o,`eq.${c}`)}),this}not(s,o,c){return this.url.searchParams.append(s,`not.${o}.${c}`),this}or(s,{foreignTable:o,referencedTable:c=o}={}){const u=c?`${c}.or`:"or";return this.url.searchParams.append(u,`(${s})`),this}filter(s,o,c){return this.url.searchParams.append(s,`${o}.${c}`),this}}return Zi.default=n,Zi}var Ov;function Db(){if(Ov)return Yi;Ov=1;var e=Yi&&Yi.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Yi,"__esModule",{value:!0});const t=e(gp());class n{constructor(s,{headers:o={},schema:c,fetch:u}){this.url=s,this.headers=new Headers(o),this.schema=c,this.fetch=u}select(s,{head:o=!1,count:c}={}){const u=o?"HEAD":"GET";let h=!1;const f=(s??"*").split("").map(m=>/\s/.test(m)&&!h?"":(m==='"'&&(h=!h),m)).join("");return this.url.searchParams.set("select",f),c&&this.headers.append("Prefer",`count=${c}`),new t.default({method:u,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(s,{count:o,defaultToNull:c=!0}={}){var u;const h="POST";if(o&&this.headers.append("Prefer",`count=${o}`),c||this.headers.append("Prefer","missing=default"),Array.isArray(s)){const f=s.reduce((m,y)=>m.concat(Object.keys(y)),[]);if(f.length>0){const m=[...new Set(f)].map(y=>`"${y}"`);this.url.searchParams.set("columns",m.join(","))}}return new t.default({method:h,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}upsert(s,{onConflict:o,ignoreDuplicates:c=!1,count:u,defaultToNull:h=!0}={}){var f;const m="POST";if(this.headers.append("Prefer",`resolution=${c?"ignore":"merge"}-duplicates`),o!==void 0&&this.url.searchParams.set("on_conflict",o),u&&this.headers.append("Prefer",`count=${u}`),h||this.headers.append("Prefer","missing=default"),Array.isArray(s)){const y=s.reduce((k,w)=>k.concat(Object.keys(w)),[]);if(y.length>0){const k=[...new Set(y)].map(w=>`"${w}"`);this.url.searchParams.set("columns",k.join(","))}}return new t.default({method:m,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(f=this.fetch)!==null&&f!==void 0?f:fetch})}update(s,{count:o}={}){var c;const u="PATCH";return o&&this.headers.append("Prefer",`count=${o}`),new t.default({method:u,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch})}delete({count:s}={}){var o;const c="DELETE";return s&&this.headers.append("Prefer",`count=${s}`),new t.default({method:c,url:this.url,headers:this.headers,schema:this.schema,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}}return Yi.default=n,Yi}var jv;function cA(){if(jv)return qi;jv=1;var e=qi&&qi.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(qi,"__esModule",{value:!0});const t=e(Db()),n=e(gp());class a{constructor(o,{headers:c={},schema:u,fetch:h}={}){this.url=o,this.headers=new Headers(c),this.schemaName=u,this.fetch=h}from(o){const c=new URL(`${this.url}/${o}`);return new t.default(c,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(o){return new a(this.url,{headers:this.headers,schema:o,fetch:this.fetch})}rpc(o,c={},{head:u=!1,get:h=!1,count:f}={}){var m;let y;const k=new URL(`${this.url}/rpc/${o}`);let w;u||h?(y=u?"HEAD":"GET",Object.entries(c).filter(([C,S])=>S!==void 0).map(([C,S])=>[C,Array.isArray(S)?`{${S.join(",")}}`:`${S}`]).forEach(([C,S])=>{k.searchParams.append(C,S)})):(y="POST",w=c);const P=new Headers(this.headers);return f&&P.set("Prefer",`count=${f}`),new n.default({method:y,url:k,headers:P,schema:this.schemaName,body:w,fetch:(m=this.fetch)!==null&&m!==void 0?m:fetch})}}return qi.default=a,qi}var Uv;function uA(){if(Uv)return zt;Uv=1;var e=zt&&zt.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(zt,"__esModule",{value:!0}),zt.PostgrestError=zt.PostgrestBuilder=zt.PostgrestTransformBuilder=zt.PostgrestFilterBuilder=zt.PostgrestQueryBuilder=zt.PostgrestClient=void 0;const t=e(cA());zt.PostgrestClient=t.default;const n=e(Db());zt.PostgrestQueryBuilder=n.default;const a=e(gp());zt.PostgrestFilterBuilder=a.default;const s=e(Lb());zt.PostgrestTransformBuilder=s.default;const o=e(Rb());zt.PostgrestBuilder=o.default;const c=e(Ab());return zt.PostgrestError=c.default,zt.default={PostgrestClient:t.default,PostgrestQueryBuilder:n.default,PostgrestFilterBuilder:a.default,PostgrestTransformBuilder:s.default,PostgrestBuilder:o.default,PostgrestError:c.default},zt}var dA=uA();const hA=L_(dA),{PostgrestClient:fA,PostgrestQueryBuilder:e4,PostgrestFilterBuilder:t4,PostgrestTransformBuilder:n4,PostgrestBuilder:r4,PostgrestError:a4}=hA,wr=Object.create(null);wr.open="0";wr.close="1";wr.ping="2";wr.pong="3";wr.message="4";wr.upgrade="5";wr.noop="6";const Ac=Object.create(null);Object.keys(wr).forEach(e=>{Ac[wr[e]]=e});const mf={type:"error",data:"parser error"},Mb=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ib=typeof ArrayBuffer=="function",Nb=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,yp=({type:e,data:t},n,a)=>Mb&&t instanceof Blob?n?a(t):Bv(t,a):Ib&&(t instanceof ArrayBuffer||Nb(t))?n?a(t):Bv(new Blob([t]),a):a(wr[e]+(t||"")),Bv=(e,t)=>{const n=new FileReader;return n.onload=function(){const a=n.result.split(",")[1];t("b"+(a||""))},n.readAsDataURL(e)};function Fv(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Ah;function pA(e,t){if(Mb&&e.data instanceof Blob)return e.data.arrayBuffer().then(Fv).then(t);if(Ib&&(e.data instanceof ArrayBuffer||Nb(e.data)))return t(Fv(e.data));yp(e,!1,n=>{Ah||(Ah=new TextEncoder),t(Ah.encode(n))})}const Vv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ko=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Vv.length;e++)ko[Vv.charCodeAt(e)]=e;const mA=e=>{let t=e.length*.75,n=e.length,a,s=0,o,c,u,h;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),m=new Uint8Array(f);for(a=0;a<n;a+=4)o=ko[e.charCodeAt(a)],c=ko[e.charCodeAt(a+1)],u=ko[e.charCodeAt(a+2)],h=ko[e.charCodeAt(a+3)],m[s++]=o<<2|c>>4,m[s++]=(c&15)<<4|u>>2,m[s++]=(u&3)<<6|h&63;return f},gA=typeof ArrayBuffer=="function",vp=(e,t)=>{if(typeof e!="string")return{type:"message",data:Ob(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:yA(e.substring(1),t)}:Ac[n]?e.length>1?{type:Ac[n],data:e.substring(1)}:{type:Ac[n]}:mf},yA=(e,t)=>{if(gA){const n=mA(e);return Ob(n,t)}else return{base64:!0,data:e}},Ob=(e,t)=>t==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,jb="",vA=(e,t)=>{const n=e.length,a=new Array(n);let s=0;e.forEach((o,c)=>{yp(o,!1,u=>{a[c]=u,++s===n&&t(a.join(jb))})})},kA=(e,t)=>{const n=e.split(jb),a=[];for(let s=0;s<n.length;s++){const o=vp(n[s],t);if(a.push(o),o.type==="error")break}return a};function _A(){return new TransformStream({transform(e,t){pA(e,n=>{const a=n.length;let s;if(a<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,a);else if(a<65536){s=new Uint8Array(3);const o=new DataView(s.buffer);o.setUint8(0,126),o.setUint16(1,a)}else{s=new Uint8Array(9);const o=new DataView(s.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(a))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let Rh;function pc(e){return e.reduce((t,n)=>t+n.length,0)}function mc(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let a=0;for(let s=0;s<t;s++)n[s]=e[0][a++],a===e[0].length&&(e.shift(),a=0);return e.length&&a<e[0].length&&(e[0]=e[0].slice(a)),n}function bA(e,t){Rh||(Rh=new TextDecoder);const n=[];let a=0,s=-1,o=!1;return new TransformStream({transform(c,u){for(n.push(c);;){if(a===0){if(pc(n)<1)break;const h=mc(n,1);o=(h[0]&128)===128,s=h[0]&127,s<126?a=3:s===126?a=1:a=2}else if(a===1){if(pc(n)<2)break;const h=mc(n,2);s=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),a=3}else if(a===2){if(pc(n)<8)break;const h=mc(n,8),f=new DataView(h.buffer,h.byteOffset,h.length),m=f.getUint32(0);if(m>Math.pow(2,21)-1){u.enqueue(mf);break}s=m*Math.pow(2,32)+f.getUint32(4),a=3}else{if(pc(n)<s)break;const h=mc(n,s);u.enqueue(vp(o?h:Rh.decode(h),t)),a=0}if(s===0||s>e){u.enqueue(mf);break}}}})}const Ub=4;function Dt(e){if(e)return wA(e)}function wA(e){for(var t in Dt.prototype)e[t]=Dt.prototype[t];return e}Dt.prototype.on=Dt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Dt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Dt.prototype.off=Dt.prototype.removeListener=Dt.prototype.removeAllListeners=Dt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var a,s=0;s<n.length;s++)if(a=n[s],a===t||a.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Dt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],a=1;a<arguments.length;a++)t[a-1]=arguments[a];if(n){n=n.slice(0);for(var a=0,s=n.length;a<s;++a)n[a].apply(this,t)}return this};Dt.prototype.emitReserved=Dt.prototype.emit;Dt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Dt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Cu=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Nn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),xA="arraybuffer";function Bb(e,...t){return t.reduce((n,a)=>(e.hasOwnProperty(a)&&(n[a]=e[a]),n),{})}const PA=Nn.setTimeout,SA=Nn.clearTimeout;function Tu(e,t){t.useNativeTimers?(e.setTimeoutFn=PA.bind(Nn),e.clearTimeoutFn=SA.bind(Nn)):(e.setTimeoutFn=Nn.setTimeout.bind(Nn),e.clearTimeoutFn=Nn.clearTimeout.bind(Nn))}const CA=1.33;function TA(e){return typeof e=="string"?EA(e):Math.ceil((e.byteLength||e.size)*CA)}function EA(e){let t=0,n=0;for(let a=0,s=e.length;a<s;a++)t=e.charCodeAt(a),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(a++,n+=4);return n}function Fb(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function AA(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function RA(e){let t={},n=e.split("&");for(let a=0,s=n.length;a<s;a++){let o=n[a].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class LA extends Error{constructor(t,n,a){super(t),this.description=n,this.context=a,this.type="TransportError"}}class kp extends Dt{constructor(t){super(),this.writable=!1,Tu(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,a){return super.emitReserved("error",new LA(t,n,a)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=vp(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=AA(t);return n.length?"?"+n:""}}class DA extends kp{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let a=0;this._polling&&(a++,this.once("pollComplete",function(){--a||n()})),this.writable||(a++,this.once("drain",function(){--a||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=a=>{if(this.readyState==="opening"&&a.type==="open"&&this.onOpen(),a.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(a)};kA(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,vA(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Fb()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Vb=!1;try{Vb=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const MA=Vb;function IA(){}class NA extends DA{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let a=location.port;a||(a=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||a!==t.port}}doWrite(t,n){const a=this.request({method:"POST",data:t});a.on("success",n),a.on("error",(s,o)=>{this.onError("xhr post error",s,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,a)=>{this.onError("xhr poll error",n,a)}),this.pollXhr=t}}let ls=class Rc extends Dt{constructor(t,n,a){super(),this.createRequest=t,Tu(this,a),this._opts=a,this._method=a.method||"GET",this._uri=n,this._data=a.data!==void 0?a.data:null,this._create()}_create(){var t;const n=Bb(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const a=this._xhr=this.createRequest(n);try{a.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){a.setDisableHeaderCheck&&a.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&a.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{a.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{a.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(a),"withCredentials"in a&&(a.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(a.timeout=this._opts.requestTimeout),a.onreadystatechange=()=>{var s;a.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(a.getResponseHeader("set-cookie"))),a.readyState===4&&(a.status===200||a.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof a.status=="number"?a.status:0)},0))},a.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=Rc.requestsCount++,Rc.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=IA,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Rc.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};ls.requestsCount=0;ls.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",zv);else if(typeof addEventListener=="function"){const e="onpagehide"in Nn?"pagehide":"unload";addEventListener(e,zv,!1)}}function zv(){for(let e in ls.requests)ls.requests.hasOwnProperty(e)&&ls.requests[e].abort()}const OA=(function(){const e=zb({xdomain:!1});return e&&e.responseType!==null})();class jA extends NA{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=OA&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new ls(zb,this.uri(),t)}}function zb(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||MA))return new XMLHttpRequest}catch{}if(!t)try{return new Nn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const $b=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class UA extends kp{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,a=$b?{}:Bb(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(a.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,a)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const a=t[n],s=n===t.length-1;yp(a,this.supportsBinary,o=>{try{this.doWrite(a,o)}catch{}s&&Cu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Fb()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Lh=Nn.WebSocket||Nn.MozWebSocket;class BA extends UA{createSocket(t,n,a){return $b?new Lh(t,n,a):n?new Lh(t,n):new Lh(t)}doWrite(t,n){this.ws.send(n)}}class FA extends kp{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=bA(Number.MAX_SAFE_INTEGER,this.socket.binaryType),a=t.readable.pipeThrough(n).getReader(),s=_A();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const o=()=>{a.read().then(({done:u,value:h})=>{u||(this.onPacket(h),o())}).catch(u=>{})};o();const c={type:"open"};this.query.sid&&(c.data=`{"sid":"${this.query.sid}"}`),this._writer.write(c).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const a=t[n],s=n===t.length-1;this._writer.write(a).then(()=>{s&&Cu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const VA={websocket:BA,webtransport:FA,polling:jA},zA=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,$A=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function gf(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),a=e.indexOf("]");n!=-1&&a!=-1&&(e=e.substring(0,n)+e.substring(n,a).replace(/:/g,";")+e.substring(a,e.length));let s=zA.exec(e||""),o={},c=14;for(;c--;)o[$A[c]]=s[c]||"";return n!=-1&&a!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=HA(o,o.path),o.queryKey=WA(o,o.query),o}function HA(e,t){const n=/\/{2,9}/g,a=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&a.splice(0,1),t.slice(-1)=="/"&&a.splice(a.length-1,1),a}function WA(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(a,s,o){s&&(n[s]=o)}),n}const yf=typeof addEventListener=="function"&&typeof removeEventListener=="function",Lc=[];yf&&addEventListener("offline",()=>{Lc.forEach(e=>e())},!1);class La extends Dt{constructor(t,n){if(super(),this.binaryType=xA,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const a=gf(t);n.hostname=a.host,n.secure=a.protocol==="https"||a.protocol==="wss",n.port=a.port,a.query&&(n.query=a.query)}else n.host&&(n.hostname=gf(n.host).host);Tu(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(a=>{const s=a.prototype.name;this.transports.push(s),this._transportsByName[s]=a}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=RA(this.opts.query)),yf&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Lc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Ub,n.transport=t,this.id&&(n.sid=this.id);const a=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](a)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&La.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",La.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let a=0;a<this.writeBuffer.length;a++){const s=this.writeBuffer[a].data;if(s&&(n+=TA(s)),a>0&&n>this._maxPayload)return this.writeBuffer.slice(0,a);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Cu(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,a){return this._sendPacket("message",t,n,a),this}send(t,n,a){return this._sendPacket("message",t,n,a),this}_sendPacket(t,n,a,s){if(typeof n=="function"&&(s=n,n=void 0),typeof a=="function"&&(s=a,a=null),this.readyState==="closing"||this.readyState==="closed")return;a=a||{},a.compress=a.compress!==!1;const o={type:t,data:n,options:a};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},a=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?a():t()}):this.upgrading?a():t()),this}_onError(t){if(La.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),yf&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const a=Lc.indexOf(this._offlineEventListener);a!==-1&&Lc.splice(a,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}La.protocol=Ub;class KA extends La{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),a=!1;La.priorWebsocketSuccess=!1;const s=()=>{a||(n.send([{type:"ping",data:"probe"}]),n.once("packet",y=>{if(!a)if(y.type==="pong"&&y.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;La.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{a||this.readyState!=="closed"&&(m(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const k=new Error("probe error");k.transport=n.name,this.emitReserved("upgradeError",k)}}))};function o(){a||(a=!0,m(),n.close(),n=null)}const c=y=>{const k=new Error("probe error: "+y);k.transport=n.name,o(),this.emitReserved("upgradeError",k)};function u(){c("transport closed")}function h(){c("socket closed")}function f(y){n&&y.name!==n.name&&o()}const m=()=>{n.removeListener("open",s),n.removeListener("error",c),n.removeListener("close",u),this.off("close",h),this.off("upgrading",f)};n.once("open",s),n.once("error",c),n.once("close",u),this.once("close",h),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{a||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let a=0;a<t.length;a++)~this.transports.indexOf(t[a])&&n.push(t[a]);return n}}let GA=class extends KA{constructor(t,n={}){const a=typeof t=="object"?t:n;(!a.transports||a.transports&&typeof a.transports[0]=="string")&&(a.transports=(a.transports||["polling","websocket","webtransport"]).map(s=>VA[s]).filter(s=>!!s)),super(t,a)}};function qA(e,t="",n){let a=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),a=gf(e)),a.port||(/^(http|ws)$/.test(a.protocol)?a.port="80":/^(http|ws)s$/.test(a.protocol)&&(a.port="443")),a.path=a.path||"/";const o=a.host.indexOf(":")!==-1?"["+a.host+"]":a.host;return a.id=a.protocol+"://"+o+":"+a.port+t,a.href=a.protocol+"://"+o+(n&&n.port===a.port?"":":"+a.port),a}const YA=typeof ArrayBuffer=="function",ZA=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Hb=Object.prototype.toString,XA=typeof Blob=="function"||typeof Blob<"u"&&Hb.call(Blob)==="[object BlobConstructor]",QA=typeof File=="function"||typeof File<"u"&&Hb.call(File)==="[object FileConstructor]";function _p(e){return YA&&(e instanceof ArrayBuffer||ZA(e))||XA&&e instanceof Blob||QA&&e instanceof File}function Dc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,a=e.length;n<a;n++)if(Dc(e[n]))return!0;return!1}if(_p(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Dc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Dc(e[n]))return!0;return!1}function JA(e){const t=[],n=e.data,a=e;return a.data=vf(n,t),a.attachments=t.length,{packet:a,buffers:t}}function vf(e,t){if(!e)return e;if(_p(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let a=0;a<e.length;a++)n[a]=vf(e[a],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=vf(e[a],t));return n}return e}function eR(e,t){return e.data=kf(e.data,t),delete e.attachments,e}function kf(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=kf(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=kf(e[n],t));return e}const tR=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var tt;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(tt||(tt={}));class nR{constructor(t){this.replacer=t}encode(t){return(t.type===tt.EVENT||t.type===tt.ACK)&&Dc(t)?this.encodeAsBinary({type:t.type===tt.EVENT?tt.BINARY_EVENT:tt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===tt.BINARY_EVENT||t.type===tt.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=JA(t),a=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(a),s}}class bp extends Dt{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const a=n.type===tt.BINARY_EVENT;a||n.type===tt.BINARY_ACK?(n.type=a?tt.EVENT:tt.ACK,this.reconstructor=new rR(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(_p(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const a={type:Number(t.charAt(0))};if(tt[a.type]===void 0)throw new Error("unknown packet type "+a.type);if(a.type===tt.BINARY_EVENT||a.type===tt.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const c=t.substring(o,n);if(c!=Number(c)||t.charAt(n)!=="-")throw new Error("Illegal attachments");const u=Number(c);if(!aR(u)||u<0)throw new Error("Illegal attachments");if(u>this.opts.maxAttachments)throw new Error("too many attachments");a.attachments=u}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););a.nsp=t.substring(o,n)}else a.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const o=n+1;for(;++n;){const c=t.charAt(n);if(c==null||Number(c)!=c){--n;break}if(n===t.length)break}a.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(bp.isPayloadValid(a.type,o))a.data=o;else throw new Error("invalid payload")}return a}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case tt.CONNECT:return $v(n);case tt.DISCONNECT:return n===void 0;case tt.CONNECT_ERROR:return typeof n=="string"||$v(n);case tt.EVENT:case tt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&tR.indexOf(n[0])===-1);case tt.ACK:case tt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class rR{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=eR(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const aR=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function $v(e){return Object.prototype.toString.call(e)==="[object Object]"}const iR=Object.freeze(Object.defineProperty({__proto__:null,Decoder:bp,Encoder:nR,get PacketType(){return tt}},Symbol.toStringTag,{value:"Module"}));function nr(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const sR=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Wb extends Dt{constructor(t,n,a){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,a&&a.auth&&(this.auth=a.auth),this._opts=Object.assign({},a),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[nr(t,"open",this.onopen.bind(this)),nr(t,"packet",this.onpacket.bind(this)),nr(t,"error",this.onerror.bind(this)),nr(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var a,s,o;if(sR.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const c={type:tt.EVENT,data:n};if(c.options={},c.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const m=this.ids++,y=n.pop();this._registerAckCallback(m,y),c.id=m}const u=(s=(a=this.io.engine)===null||a===void 0?void 0:a.transport)===null||s===void 0?void 0:s.writable,h=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!u||(h?(this.notifyOutgoingListeners(c),this.packet(c)):this.sendBuffer.push(c)),this.flags={},this}_registerAckCallback(t,n){var a;const s=(a=this.flags.timeout)!==null&&a!==void 0?a:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let u=0;u<this.sendBuffer.length;u++)this.sendBuffer[u].id===t&&this.sendBuffer.splice(u,1);n.call(this,new Error("operation has timed out"))},s),c=(...u)=>{this.io.clearTimeoutFn(o),n.apply(this,u)};c.withError=!0,this.acks[t]=c}emitWithAck(t,...n){return new Promise((a,s)=>{const o=(c,u)=>c?s(c):a(u);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const a={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...o)=>(this._queue[0],s!==null?a.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...o)),a.pending=!1,this._drainQueue())),this._queue.push(a),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:tt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(a=>String(a.id)===t)){const a=this.acks[t];delete this.acks[t],a.withError&&a.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case tt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case tt.EVENT:case tt.BINARY_EVENT:this.onevent(t);break;case tt.ACK:case tt.BINARY_ACK:this.onack(t);break;case tt.DISCONNECT:this.ondisconnect();break;case tt.CONNECT_ERROR:this.destroy();const a=new Error(t.data.message);a.data=t.data.data,this.emitReserved("connect_error",a);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const a of n)a.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let a=!1;return function(...s){a||(a=!0,n.packet({type:tt.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:tt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let a=0;a<n.length;a++)if(t===n[a])return n.splice(a,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let a=0;a<n.length;a++)if(t===n[a])return n.splice(a,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const a of n)a.apply(this,t.data)}}}function vs(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}vs.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};vs.prototype.reset=function(){this.attempts=0};vs.prototype.setMin=function(e){this.ms=e};vs.prototype.setMax=function(e){this.max=e};vs.prototype.setJitter=function(e){this.jitter=e};class _f extends Dt{constructor(t,n){var a;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Tu(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((a=n.randomizationFactor)!==null&&a!==void 0?a:.5),this.backoff=new vs({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||iR;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new GA(this.uri,this.opts);const n=this.engine,a=this;this._readyState="opening",this.skipReconnect=!1;const s=nr(n,"open",function(){a.onopen(),t&&t()}),o=u=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",u),t?t(u):this.maybeReconnectOnOpen()},c=nr(n,"error",o);if(this._timeout!==!1){const u=this._timeout,h=this.setTimeoutFn(()=>{s(),o(new Error("timeout")),n.close()},u);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(s),this.subs.push(c),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(nr(t,"ping",this.onping.bind(this)),nr(t,"data",this.ondata.bind(this)),nr(t,"error",this.onerror.bind(this)),nr(t,"close",this.onclose.bind(this)),nr(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Cu(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let a=this.nsps[t];return a?this._autoConnect&&!a.active&&a.connect():(a=new Wb(this,t,n),this.nsps[t]=a),a}_destroy(t){const n=Object.keys(this.nsps);for(const a of n)if(this.nsps[a].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let a=0;a<n.length;a++)this.engine.write(n[a],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var a;this.cleanup(),(a=this.engine)===null||a===void 0||a.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const a=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const fo={};function Mc(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=qA(e,t.path||"/socket.io"),a=n.source,s=n.id,o=n.path,c=fo[s]&&o in fo[s].nsps,u=t.forceNew||t["force new connection"]||t.multiplex===!1||c;let h;return u?h=new _f(a,t):(fo[s]||(fo[s]=new _f(a,t)),h=fo[s]),n.query&&!t.query&&(t.query=n.queryKey),h.socket(n.path,t)}Object.assign(Mc,{Manager:_f,Socket:Wb,io:Mc,connect:Mc});var We=class Kb extends Error{constructor(t,n,a,s){super(t),this.name="InsForgeError",this.statusCode=n,this.error=a,this.nextActions=s}static fromApiError(t){return new Kb(t.message,t.statusCode,t.error,t.nextActions)}},oR=["authorization","x-api-key","cookie","set-cookie"],lR=["password","token","accesstoken","refreshtoken","authorization","secret","apikey","api_key","email","ssn","creditcard","credit_card"];function cR(e){const t={};for(const[n,a]of Object.entries(e))oR.includes(n.toLowerCase())?t[n]="***REDACTED***":t[n]=a;return t}function wo(e){if(e==null)return e;if(typeof e=="string")try{const t=JSON.parse(e);return wo(t)}catch{return e}if(Array.isArray(e))return e.map(wo);if(typeof e=="object"){const t={};for(const[n,a]of Object.entries(e))lR.includes(n.toLowerCase().replace(/[-_]/g,""))?t[n]="***REDACTED***":t[n]=wo(a);return t}return e}function Hv(e){if(e==null)return"";if(typeof e=="string")try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}if(typeof FormData<"u"&&e instanceof FormData)return"[FormData]";try{return JSON.stringify(e,null,2)}catch{return"[Unserializable body]"}}var Gb=class{constructor(e){typeof e=="function"?(this.enabled=!0,this.customLog=e):(this.enabled=!!e,this.customLog=null)}log(e,...t){if(!this.enabled)return;const n=`[InsForge Debug] ${e}`;this.customLog?this.customLog(n,...t):console.log(n,...t)}warn(e,...t){if(!this.enabled)return;const n=`[InsForge Debug] ${e}`;this.customLog?this.customLog(n,...t):console.warn(n,...t)}error(e,...t){if(!this.enabled)return;const n=`[InsForge Debug] ${e}`;this.customLog?this.customLog(n,...t):console.error(n,...t)}logRequest(e,t,n,a){if(!this.enabled)return;const s=[`→ ${e} ${t}`];n&&Object.keys(n).length>0&&s.push(` Headers: ${JSON.stringify(cR(n))}`);const o=Hv(wo(a));if(o){const c=o.length>1e3?o.slice(0,1e3)+"... [truncated]":o;s.push(` Body: ${c}`)}this.log(s.join(`
39
- `))}logResponse(e,t,n,a,s){if(!this.enabled)return;const o=[`← ${e} ${t} ${n} (${a}ms)`],c=Hv(wo(s));if(c){const u=c.length>1e3?c.slice(0,1e3)+"... [truncated]":c;o.push(` Body: ${u}`)}n>=400?this.error(o.join(`
40
- `)):this.log(o.join(`
41
- `))}},wp="insforge_csrf_token";function qb(){if(typeof document>"u")return null;const e=document.cookie.split(";").find(t=>t.trim().startsWith(`${wp}=`));return e&&e.split("=")[1]||null}function Yb(e){if(typeof document>"u")return;const t=10080*60,n=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=`${wp}=${encodeURIComponent(e)}; path=/; max-age=${t}; SameSite=Lax${n}`}function Zb(){if(typeof document>"u")return;const e=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=`${wp}=; path=/; max-age=0; SameSite=Lax${e}`}var Xb=class{constructor(){this.accessToken=null,this.user=null,this.onTokenChange=null}saveSession(e){const t=e.accessToken!==this.accessToken;this.accessToken=e.accessToken,this.user=e.user,t&&this.onTokenChange&&this.onTokenChange()}getSession(){return!this.accessToken||!this.user?null:{accessToken:this.accessToken,user:this.user}}getAccessToken(){return this.accessToken}setAccessToken(e){const t=e!==this.accessToken;this.accessToken=e,t&&this.onTokenChange&&this.onTokenChange()}getUser(){return this.user}setUser(e){this.user=e}clearSession(){const e=this.accessToken!==null;this.accessToken=null,this.user=null,e&&this.onTokenChange&&this.onTokenChange()}},uR=new Set([500,502,503,504]),dR=new Set(["GET","HEAD","PUT","DELETE","OPTIONS"]),hR=class{constructor(e,t,n){if(this.userToken=null,this.autoRefreshToken=!0,this.isRefreshing=!1,this.refreshPromise=null,this.refreshToken=null,this.baseUrl=e.baseUrl||"http://localhost:7130",this.autoRefreshToken=e.autoRefreshToken??!0,this.fetch=e.fetch||(globalThis.fetch?globalThis.fetch.bind(globalThis):void 0),this.anonKey=e.anonKey,this.defaultHeaders={...e.headers},this.tokenManager=t??new Xb,this.logger=n||new Gb(!1),this.timeout=e.timeout??3e4,this.retryCount=e.retryCount??3,this.retryDelay=e.retryDelay??500,!this.fetch)throw new Error("Fetch is not available. Please provide a fetch implementation in the config.")}buildUrl(e,t){const n=new URL(e,this.baseUrl);return t&&Object.entries(t).forEach(([a,s])=>{if(a==="select"){let o=s.replace(/\s+/g," ").trim();o=o.replace(/\s*\(\s*/g,"(").replace(/\s*\)\s*/g,")").replace(/\(\s+/g,"(").replace(/\s+\)/g,")").replace(/,\s+(?=[^()]*\))/g,","),n.searchParams.append(a,o)}else n.searchParams.append(a,s)}),n.toString()}isRetryableStatus(e){return uR.has(e)}computeRetryDelay(e){const n=this.retryDelay*Math.pow(2,e-1)*(.85+Math.random()*.3);return Math.round(n)}async handleRequest(e,t,n={}){const{params:a,headers:s={},body:o,signal:c,...u}=n,h=this.buildUrl(t,a),f=Date.now(),y=dR.has(e.toUpperCase())||n.idempotent===!0?this.retryCount:0,k={...this.defaultHeaders},w=this.userToken||this.anonKey;w&&(k.Authorization=`Bearer ${w}`);let P;o!==void 0&&(typeof FormData<"u"&&o instanceof FormData?P=o:(e!=="GET"&&(k["Content-Type"]="application/json;charset=UTF-8"),P=JSON.stringify(o))),s instanceof Headers?s.forEach((S,D)=>{k[D]=S}):Array.isArray(s)?s.forEach(([S,D])=>{k[S]=D}):Object.assign(k,s),this.logger.logRequest(e,h,k,P);let C;for(let S=0;S<=y;S++){if(S>0){const R=this.computeRetryDelay(S);if(this.logger.warn(`Retry ${S}/${y} for ${e} ${h} in ${R}ms`),c?.aborted)throw c.reason;await new Promise((O,W)=>{const K=()=>{clearTimeout($),W(c.reason)},$=setTimeout(()=>{c&&c.removeEventListener("abort",K),O()},R);c&&c.addEventListener("abort",K,{once:!0})})}let D,L;if((this.timeout>0||c)&&(D=new AbortController,this.timeout>0&&(L=setTimeout(()=>D.abort(),this.timeout)),c))if(c.aborted)D.abort(c.reason);else{const R=()=>D.abort(c.reason);c.addEventListener("abort",R,{once:!0}),D.signal.addEventListener("abort",()=>{c.removeEventListener("abort",R)},{once:!0})}try{const R=await this.fetch(h,{method:e,headers:k,body:P,...u,...D?{signal:D.signal}:{}});if(this.isRetryableStatus(R.status)&&S<y){L!==void 0&&clearTimeout(L),await R.body?.cancel(),C=new We(`Server error: ${R.status} ${R.statusText}`,R.status,"SERVER_ERROR");continue}if(R.status===204){L!==void 0&&clearTimeout(L);return}let O;const W=R.headers.get("content-type");try{W?.includes("json")?O=await R.json():O=await R.text()}catch(K){throw L!==void 0&&clearTimeout(L),new We(`Failed to parse response body: ${K?.message||"Unknown error"}`,R.status,R.ok?"PARSE_ERROR":"REQUEST_FAILED")}if(L!==void 0&&clearTimeout(L),!R.ok){if(this.logger.logResponse(e,h,R.status,Date.now()-f,O),O&&typeof O=="object"&&"error"in O){!O.statusCode&&!O.status&&(O.statusCode=R.status);const K=We.fromApiError(O);throw Object.keys(O).forEach($=>{$!=="error"&&$!=="message"&&$!=="statusCode"&&(K[$]=O[$])}),K}throw new We(`Request failed: ${R.statusText}`,R.status,"REQUEST_FAILED")}return this.logger.logResponse(e,h,R.status,Date.now()-f,O),O}catch(R){if(L!==void 0&&clearTimeout(L),R?.name==="AbortError")throw D&&D.signal.aborted&&this.timeout>0&&!c?.aborted?new We(`Request timed out after ${this.timeout}ms`,408,"REQUEST_TIMEOUT"):R;if(R instanceof We)throw R;if(S<y){C=R;continue}throw new We(`Network request failed: ${R?.message||"Unknown error"}`,0,"NETWORK_ERROR")}}throw C||new We("Request failed after all retry attempts",0,"NETWORK_ERROR")}async request(e,t,n={}){try{return await this.handleRequest(e,t,{...n})}catch(a){if(a instanceof We&&a.statusCode===401&&a.error==="INVALID_TOKEN"&&this.autoRefreshToken)try{const s=await this.handleTokenRefresh();return this.setAuthToken(s.accessToken),this.tokenManager.saveSession(s),s.csrfToken&&Yb(s.csrfToken),s.refreshToken&&this.setRefreshToken(s.refreshToken),await this.handleRequest(e,t,{...n})}catch(s){throw this.tokenManager.clearSession(),this.userToken=null,this.refreshToken=null,Zb(),s}throw a}}get(e,t){return this.request("GET",e,t)}post(e,t,n){return this.request("POST",e,{...n,body:t})}put(e,t,n){return this.request("PUT",e,{...n,body:t})}patch(e,t,n){return this.request("PATCH",e,{...n,body:t})}delete(e,t){return this.request("DELETE",e,t)}setAuthToken(e){this.userToken=e}setRefreshToken(e){this.refreshToken=e}getHeaders(){const e={...this.defaultHeaders},t=this.userToken||this.anonKey;return t&&(e.Authorization=`Bearer ${t}`),e}async handleTokenRefresh(){return this.isRefreshing?this.refreshPromise:(this.isRefreshing=!0,this.refreshPromise=(async()=>{try{const e=qb(),t=this.refreshToken?{refreshToken:this.refreshToken}:void 0;return await this.handleRequest("POST","/api/auth/sessions/current",{body:t,headers:e?{"X-CSRF-Token":e}:{},credentials:"include"})}finally{this.isRefreshing=!1,this.refreshPromise=null}})(),this.refreshPromise)}},bf="insforge_pkce_verifier";function Qb(e){return btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function fR(){const e=new Uint8Array(32);return crypto.getRandomValues(e),Qb(e)}async function pR(e){const n=new TextEncoder().encode(e),a=await crypto.subtle.digest("SHA-256",n);return Qb(new Uint8Array(a))}function mR(e){typeof sessionStorage<"u"&&sessionStorage.setItem(bf,e)}function gR(){if(typeof sessionStorage>"u")return null;const e=sessionStorage.getItem(bf);return e&&sessionStorage.removeItem(bf),e}function wn(e,t){return e instanceof We?{data:null,error:e}:{data:null,error:new We(e instanceof Error?e.message:t,500,"UNEXPECTED_ERROR")}}function Wv(...e){if(typeof window>"u")return;const t=new URL(window.location.href);e.forEach(n=>t.searchParams.delete(n)),window.history.replaceState({},document.title,t.toString())}var yR=class{constructor(e,t,n={}){this.http=e,this.tokenManager=t,this.options=n,this.authCallbackHandled=this.detectAuthCallback()}isServerMode(){return!!this.options.isServerMode}saveSessionFromResponse(e){if(!e.accessToken||!e.user)return!1;const t={accessToken:e.accessToken,user:e.user};return!this.isServerMode()&&e.csrfToken&&Yb(e.csrfToken),this.isServerMode()||this.tokenManager.saveSession(t),this.http.setAuthToken(e.accessToken),this.http.setRefreshToken(e.refreshToken??null),!0}async detectAuthCallback(){if(!(this.isServerMode()||typeof window>"u"))try{const e=new URLSearchParams(window.location.search),t=e.get("error");if(t){Wv("error"),console.debug("OAuth callback error:",t);return}const n=e.get("insforge_code");if(n){Wv("insforge_code");const{error:a}=await this.exchangeOAuthCode(n);a&&console.debug("OAuth code exchange failed:",a.message);return}}catch(e){console.debug("OAuth callback detection skipped:",e)}}async signUp(e){try{const t=await this.http.post(this.isServerMode()?"/api/auth/users?client_type=mobile":"/api/auth/users",e,{credentials:"include"});return t.accessToken&&t.user&&this.saveSessionFromResponse(t),t.refreshToken&&this.http.setRefreshToken(t.refreshToken),{data:t,error:null}}catch(t){return wn(t,"An unexpected error occurred during sign up")}}async signInWithPassword(e){try{const t=await this.http.post(this.isServerMode()?"/api/auth/sessions?client_type=mobile":"/api/auth/sessions",e,{credentials:"include"});return this.saveSessionFromResponse(t),t.refreshToken&&this.http.setRefreshToken(t.refreshToken),{data:t,error:null}}catch(t){return wn(t,"An unexpected error occurred during sign in")}}async signOut(){try{try{await this.http.post(this.isServerMode()?"/api/auth/logout?client_type=mobile":"/api/auth/logout",void 0,{credentials:"include"})}catch{}return this.tokenManager.clearSession(),this.http.setAuthToken(null),this.http.setRefreshToken(null),this.isServerMode()||Zb(),{error:null}}catch{return{error:new We("Failed to sign out",500,"SIGNOUT_ERROR")}}}async signInWithOAuth(e){try{const{provider:t,redirectTo:n,skipBrowserRedirect:a}=e,s=encodeURIComponent(t.toLowerCase()),o=fR(),c=await pR(o);mR(o);const u={code_challenge:c};n&&(u.redirect_uri=n);const f=Su.options.includes(s)?`/api/auth/oauth/${s}`:`/api/auth/oauth/custom/${s}`,m=await this.http.get(f,{params:u});return!this.isServerMode()&&typeof window<"u"&&!a?(window.location.href=m.authUrl,{data:{},error:null}):{data:{url:m.authUrl,provider:s,codeVerifier:o},error:null}}catch(t){return t instanceof We?{data:{},error:t}:{data:{},error:new We("An unexpected error occurred during OAuth initialization",500,"UNEXPECTED_ERROR")}}}async exchangeOAuthCode(e,t){try{const n=t??gR();if(!n)return{data:null,error:new We("PKCE code verifier not found. Ensure signInWithOAuth was called in the same browser session.",400,"PKCE_VERIFIER_MISSING")};const a={code:e,code_verifier:n},s=await this.http.post(this.isServerMode()?"/api/auth/oauth/exchange?client_type=mobile":"/api/auth/oauth/exchange",a,{credentials:"include"});return this.saveSessionFromResponse(s),{data:s,error:null}}catch(n){return wn(n,"An unexpected error occurred during OAuth code exchange")}}async signInWithIdToken(e){try{const{provider:t,token:n}=e,a=await this.http.post("/api/auth/id-token?client_type=mobile",{provider:t,token:n},{credentials:"include"});return this.saveSessionFromResponse(a),a.refreshToken&&this.http.setRefreshToken(a.refreshToken),{data:a,error:null}}catch(t){return wn(t,"An unexpected error occurred during ID token sign in")}}async refreshSession(e){try{if(this.isServerMode()&&!e?.refreshToken)return{data:null,error:new We("refreshToken is required when refreshing session in server mode",400,"REFRESH_TOKEN_REQUIRED")};const t=this.isServerMode()?null:qb(),n=await this.http.post(this.isServerMode()?"/api/auth/refresh?client_type=mobile":"/api/auth/refresh",this.isServerMode()?{refresh_token:e?.refreshToken}:void 0,{headers:t?{"X-CSRF-Token":t}:{},credentials:"include"});return n.accessToken&&this.saveSessionFromResponse(n),{data:n,error:null}}catch(t){return wn(t,"An unexpected error occurred during session refresh")}}async getCurrentUser(){await this.authCallbackHandled;try{if(this.isServerMode()){const t=this.tokenManager.getAccessToken();return t?(this.http.setAuthToken(t),{data:{user:(await this.http.get("/api/auth/sessions/current")).user??null},error:null}):{data:{user:null},error:null}}const e=this.tokenManager.getSession();if(e)return this.http.setAuthToken(e.accessToken),{data:{user:e.user},error:null};if(typeof window<"u"){const{data:t,error:n}=await this.refreshSession();if(n)return{data:{user:null},error:n};if(t?.accessToken)return{data:{user:t.user??null},error:null}}return{data:{user:null},error:null}}catch(e){return e instanceof We?{data:{user:null},error:e}:{data:{user:null},error:new We("An unexpected error occurred while getting user",500,"UNEXPECTED_ERROR")}}}async getProfile(e){try{return{data:await this.http.get(`/api/auth/profiles/${e}`),error:null}}catch(t){return wn(t,"An unexpected error occurred while fetching user profile")}}async setProfile(e){try{const t=await this.http.patch("/api/auth/profiles/current",{profile:e}),n=this.tokenManager.getUser();return!this.isServerMode()&&n&&t.profile!==void 0&&this.tokenManager.setUser({...n,profile:t.profile}),{data:t,error:null}}catch(t){return wn(t,"An unexpected error occurred while updating user profile")}}async resendVerificationEmail(e){try{return{data:await this.http.post("/api/auth/email/send-verification",e),error:null}}catch(t){return wn(t,"An unexpected error occurred while sending verification email")}}async verifyEmail(e){try{const t=await this.http.post(this.isServerMode()?"/api/auth/email/verify?client_type=mobile":"/api/auth/email/verify",e,{credentials:"include"});return this.saveSessionFromResponse(t),t.refreshToken&&this.http.setRefreshToken(t.refreshToken),{data:t,error:null}}catch(t){return wn(t,"An unexpected error occurred while verifying email")}}async sendResetPasswordEmail(e){try{return{data:await this.http.post("/api/auth/email/send-reset-password",e),error:null}}catch(t){return wn(t,"An unexpected error occurred while sending password reset email")}}async exchangeResetPasswordToken(e){try{return{data:await this.http.post("/api/auth/email/exchange-reset-password-token",e),error:null}}catch(t){return wn(t,"An unexpected error occurred while verifying reset code")}}async resetPassword(e){try{return{data:await this.http.post("/api/auth/email/reset-password",e),error:null}}catch(t){return wn(t,"An unexpected error occurred while resetting password")}}async getPublicAuthConfig(){try{return{data:await this.http.get("/api/auth/public-config"),error:null}}catch(e){return wn(e,"An unexpected error occurred while fetching auth configuration")}}};function vR(e,t){return async(n,a)=>{const s=typeof n=="string"?n:n.toString(),o=new URL(s),c=o.pathname.slice(1),u=c.match(/^rpc\/(.+)$/),h=u?`/api/database/rpc/${u[1]}`:`/api/database/records/${c}`,f=`${e.baseUrl}${h}${o.search}`,m=t.getAccessToken(),y=e.getHeaders(),k=m||y.Authorization?.replace("Bearer ",""),w=new Headers(a?.headers);return k&&!w.has("Authorization")&&w.set("Authorization",`Bearer ${k}`),await fetch(f,{...a,headers:w})}}var kR=class{constructor(e,t){this.postgrest=new fA("http://dummy",{fetch:vR(e,t),headers:{}})}from(e){return this.postgrest.from(e)}rpc(e,t,n){return this.postgrest.rpc(e,t,n)}},_R=class{constructor(e,t){this.bucketName=e,this.http=t}async upload(e,t){try{const n=await this.http.post(`/api/storage/buckets/${this.bucketName}/upload-strategy`,{filename:e,contentType:t.type||"application/octet-stream",size:t.size});if(n.method==="presigned")return await this.uploadWithPresignedUrl(n,t);if(n.method==="direct"){const a=new FormData;return a.append("file",t),{data:await this.http.request("PUT",`/api/storage/buckets/${this.bucketName}/objects/${encodeURIComponent(e)}`,{body:a,headers:{}}),error:null}}throw new We(`Unsupported upload method: ${n.method}`,500,"STORAGE_ERROR")}catch(n){return{data:null,error:n instanceof We?n:new We("Upload failed",500,"STORAGE_ERROR")}}}async uploadAuto(e){try{const t=e instanceof File?e.name:"file",n=await this.http.post(`/api/storage/buckets/${this.bucketName}/upload-strategy`,{filename:t,contentType:e.type||"application/octet-stream",size:e.size});if(n.method==="presigned")return await this.uploadWithPresignedUrl(n,e);if(n.method==="direct"){const a=new FormData;return a.append("file",e),{data:await this.http.request("POST",`/api/storage/buckets/${this.bucketName}/objects`,{body:a,headers:{}}),error:null}}throw new We(`Unsupported upload method: ${n.method}`,500,"STORAGE_ERROR")}catch(t){return{data:null,error:t instanceof We?t:new We("Upload failed",500,"STORAGE_ERROR")}}}async uploadWithPresignedUrl(e,t){try{const n=new FormData;e.fields&&Object.entries(e.fields).forEach(([s,o])=>{n.append(s,o)}),n.append("file",t);const a=await fetch(e.uploadUrl,{method:"POST",body:n});if(!a.ok)throw new We(`Upload to storage failed: ${a.statusText}`,a.status,"STORAGE_ERROR");return e.confirmRequired&&e.confirmUrl?{data:await this.http.post(e.confirmUrl,{size:t.size,contentType:t.type||"application/octet-stream"}),error:null}:{data:{key:e.key,bucket:this.bucketName,size:t.size,mimeType:t.type||"application/octet-stream",uploadedAt:new Date().toISOString(),url:this.getPublicUrl(e.key)},error:null}}catch(n){throw n instanceof We?n:new We("Presigned upload failed",500,"STORAGE_ERROR")}}async download(e){try{const t=await this.http.post(`/api/storage/buckets/${this.bucketName}/objects/${encodeURIComponent(e)}/download-strategy`,{expiresIn:3600}),n=t.url,a={};t.method==="direct"&&Object.assign(a,this.http.getHeaders());const s=await fetch(n,{method:"GET",headers:a});if(!s.ok)try{const c=await s.json();throw We.fromApiError(c)}catch{throw new We(`Download failed: ${s.statusText}`,s.status,"STORAGE_ERROR")}return{data:await s.blob(),error:null}}catch(t){return{data:null,error:t instanceof We?t:new We("Download failed",500,"STORAGE_ERROR")}}}getPublicUrl(e){return`${this.http.baseUrl}/api/storage/buckets/${this.bucketName}/objects/${encodeURIComponent(e)}`}async list(e){try{const t={};return e?.prefix&&(t.prefix=e.prefix),e?.search&&(t.search=e.search),e?.limit&&(t.limit=e.limit.toString()),e?.offset&&(t.offset=e.offset.toString()),{data:await this.http.get(`/api/storage/buckets/${this.bucketName}/objects`,{params:t}),error:null}}catch(t){return{data:null,error:t instanceof We?t:new We("List failed",500,"STORAGE_ERROR")}}}async remove(e){try{return{data:await this.http.delete(`/api/storage/buckets/${this.bucketName}/objects/${encodeURIComponent(e)}`),error:null}}catch(t){return{data:null,error:t instanceof We?t:new We("Delete failed",500,"STORAGE_ERROR")}}}},bR=class{constructor(e){this.http=e}from(e){return new _R(e,this.http)}},wR=class{constructor(e){this.http=e,this.chat=new xR(e),this.images=new CR(e),this.embeddings=new SR(e)}},xR=class{constructor(e){this.completions=new PR(e)}},PR=class{constructor(e){this.http=e}async create(e){const t={model:e.model,messages:e.messages,temperature:e.temperature,maxTokens:e.maxTokens,topP:e.topP,stream:e.stream,webSearch:e.webSearch,fileParser:e.fileParser,thinking:e.thinking,tools:e.tools,toolChoice:e.toolChoice,parallelToolCalls:e.parallelToolCalls};if(e.stream){const s=this.http.getHeaders();s["Content-Type"]="application/json";const o=await this.http.fetch(`${this.http.baseUrl}/api/ai/chat/completion`,{method:"POST",headers:s,body:JSON.stringify(t)});if(!o.ok){const c=await o.json();throw new Error(c.error||"Stream request failed")}return this.parseSSEStream(o,e.model)}const n=await this.http.post("/api/ai/chat/completion",t),a=n.text||"";return{id:`chatcmpl-${Date.now()}`,object:"chat.completion",created:Math.floor(Date.now()/1e3),model:n.metadata?.model,choices:[{index:0,message:{role:"assistant",content:a,...n.tool_calls?.length&&{tool_calls:n.tool_calls},...n.annotations?.length&&{annotations:n.annotations}},finish_reason:n.tool_calls?.length?"tool_calls":"stop"}],usage:n.metadata?.usage||{prompt_tokens:0,completion_tokens:0,total_tokens:0}}}async*parseSSEStream(e,t){const n=e.body.getReader(),a=new TextDecoder;let s="";try{for(;;){const{done:o,value:c}=await n.read();if(o)break;s+=a.decode(c,{stream:!0});const u=s.split(`
42
- `);s=u.pop()||"";for(const h of u)if(h.startsWith("data: ")){const f=h.slice(6).trim();if(f)try{const m=JSON.parse(f);if((m.chunk||m.content)&&(yield{id:`chatcmpl-${Date.now()}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:t,choices:[{index:0,delta:{content:m.chunk||m.content},finish_reason:null}]}),m.tool_calls?.length&&(yield{id:`chatcmpl-${Date.now()}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:t,choices:[{index:0,delta:{tool_calls:m.tool_calls},finish_reason:"tool_calls"}]}),m.done){n.releaseLock();return}}catch{console.warn("Failed to parse SSE data:",f)}}}}finally{n.releaseLock()}}},SR=class{constructor(e){this.http=e}async create(e){const t=await this.http.post("/api/ai/embeddings",e);return{object:t.object,data:t.data,model:t.metadata?.model,usage:t.metadata?.usage?{prompt_tokens:t.metadata.usage.promptTokens||0,total_tokens:t.metadata.usage.totalTokens||0}:{prompt_tokens:0,total_tokens:0}}}},CR=class{constructor(e){this.http=e}async generate(e){const t=await this.http.post("/api/ai/image/generation",e);let n=[];return t.images&&t.images.length>0?n=t.images.map(a=>({b64_json:a.imageUrl.replace(/^data:image\/\w+;base64,/,""),content:t.text})):t.text&&(n=[{content:t.text}]),{created:Math.floor(Date.now()/1e3),data:n,...t.metadata?.usage&&{usage:{total_tokens:t.metadata.usage.totalTokens||0,input_tokens:t.metadata.usage.promptTokens||0,output_tokens:t.metadata.usage.completionTokens||0}}}}},TR=class Jb{constructor(t,n){this.http=t,this.functionsUrl=n||Jb.deriveSubhostingUrl(t.baseUrl)}static deriveSubhostingUrl(t){try{const{hostname:n}=new URL(t);return n.endsWith(".insforge.app")?`https://${n.split(".")[0]}.functions.insforge.app`:void 0}catch{return}}async invoke(t,n={}){const{method:a="POST",body:s,headers:o={}}=n;if(this.functionsUrl)try{return{data:await this.http.request(a,`${this.functionsUrl}/${t}`,{body:s,headers:o}),error:null}}catch(c){if(c instanceof Error&&c.name==="AbortError")throw c;if(!(c instanceof We&&c.statusCode===404))return{data:null,error:c instanceof We?c:new We(c instanceof Error?c.message:"Function invocation failed",500,"FUNCTION_ERROR")}}try{const c=`/functions/${t}`;return{data:await this.http.request(a,c,{body:s,headers:o}),error:null}}catch(c){if(c instanceof Error&&c.name==="AbortError")throw c;return{data:null,error:c instanceof We?c:new We(c instanceof Error?c.message:"Function invocation failed",500,"FUNCTION_ERROR")}}}},Kv=1e4,ER=class{constructor(e,t,n){this.socket=null,this.connectPromise=null,this.subscribedChannels=new Set,this.eventListeners=new Map,this.baseUrl=e,this.tokenManager=t,this.anonKey=n,this.tokenManager.onTokenChange=()=>this.onTokenChange()}notifyListeners(e,t){const n=this.eventListeners.get(e);if(n)for(const a of n)try{a(t)}catch(s){console.error(`Error in ${e} callback:`,s)}}connect(){return this.socket?.connected?Promise.resolve():this.connectPromise?this.connectPromise:(this.connectPromise=new Promise((e,t)=>{const n=this.tokenManager.getAccessToken()??this.anonKey;this.socket=Mc(this.baseUrl,{transports:["websocket"],auth:n?{token:n}:void 0});let a=!0,s=null;const o=()=>{s&&(clearTimeout(s),s=null)};s=setTimeout(()=>{a&&(a=!1,this.connectPromise=null,this.socket?.disconnect(),this.socket=null,t(new Error(`Connection timeout after ${Kv}ms`)))},Kv),this.socket.on("connect",()=>{o();for(const c of this.subscribedChannels)this.socket.emit("realtime:subscribe",{channel:c});this.notifyListeners("connect"),a&&(a=!1,this.connectPromise=null,e())}),this.socket.on("connect_error",c=>{o(),this.notifyListeners("connect_error",c),a&&(a=!1,this.connectPromise=null,t(c))}),this.socket.on("disconnect",c=>{this.notifyListeners("disconnect",c)}),this.socket.on("realtime:error",c=>{this.notifyListeners("error",c)}),this.socket.onAny((c,u)=>{c!=="realtime:error"&&this.notifyListeners(c,u)})}),this.connectPromise)}disconnect(){this.socket&&(this.socket.disconnect(),this.socket=null),this.subscribedChannels.clear()}onTokenChange(){const e=this.tokenManager.getAccessToken()??this.anonKey;this.socket&&(this.socket.auth=e?{token:e}:{}),this.socket&&(this.socket.connected||this.connectPromise)&&(this.socket.disconnect(),this.socket.connect())}get isConnected(){return this.socket?.connected??!1}get connectionState(){return this.socket?this.socket.connected?"connected":"connecting":"disconnected"}get socketId(){return this.socket?.id}async subscribe(e){if(this.subscribedChannels.has(e))return{ok:!0,channel:e};if(!this.socket?.connected)try{await this.connect()}catch(t){const n=t instanceof Error?t.message:"Connection failed";return{ok:!1,channel:e,error:{code:"CONNECTION_FAILED",message:n}}}return new Promise(t=>{this.socket.emit("realtime:subscribe",{channel:e},n=>{n.ok&&this.subscribedChannels.add(e),t(n)})})}unsubscribe(e){this.subscribedChannels.delete(e),this.socket?.connected&&this.socket.emit("realtime:unsubscribe",{channel:e})}async publish(e,t,n){if(!this.socket?.connected)throw new Error("Not connected to realtime server. Call connect() first.");this.socket.emit("realtime:publish",{channel:e,event:t,payload:n})}on(e,t){this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e).add(t)}off(e,t){const n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}once(e,t){const n=a=>{this.off(e,n),t(a)};this.on(e,n)}getSubscribedChannels(){return Array.from(this.subscribedChannels)}},AR=class{constructor(e){this.http=e}async send(e){try{return{data:await this.http.post("/api/email/send-raw",e),error:null}}catch(t){if(t instanceof Error&&t.name==="AbortError")throw t;return{data:null,error:t instanceof We?t:new We(t instanceof Error?t.message:"Email send failed",500,"EMAIL_ERROR")}}}},RR=class{constructor(e={}){const t=new Gb(e.debug);this.tokenManager=new Xb,this.http=new hR(e,this.tokenManager,t),e.edgeFunctionToken&&(this.http.setAuthToken(e.edgeFunctionToken),this.tokenManager.setAccessToken(e.edgeFunctionToken)),this.auth=new yR(this.http,this.tokenManager,{isServerMode:e.isServerMode??!1}),this.database=new kR(this.http,this.tokenManager),this.storage=new bR(this.http),this.ai=new wR(this.http),this.functions=new TR(this.http,e.functionsUrl),this.realtime=new ER(this.http.baseUrl,this.tokenManager,e.anonKey),this.emails=new AR(this.http)}getHttpClient(){return this.http}};function LR(e){return new RR(e)}const xp={VITE_INSFORGE_ANON_KEY:"ik_9f35735991b684f7cf57fa00bb4d0487",VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"};function fi(){const e=typeof import.meta<"u"?xp:void 0;return(e?.VITE_INSFORGE_BASE_URL||e?.VITE_TOKENTRACKER_BACKEND_BASE_URL||"").trim()}function e0(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return window.location.origin;const t=typeof import.meta<"u"?xp:void 0;return(t?.VITE_INSFORGE_BASE_URL||t?.VITE_TOKENTRACKER_BACKEND_BASE_URL||"").trim()}function Eu(){const e=typeof import.meta<"u"?xp:void 0;return(e?.VITE_INSFORGE_ANON_KEY||e?.VITE_TOKENTRACKER_BACKEND_ANON_KEY||"").trim()}function wf(){return!!e0()}let Dh=null;function DR(){return wf()?(Dh||(Dh=LR({baseUrl:e0(),anonKey:Eu()||void 0,autoRefreshToken:!0})),Dh):null}const t0="tokentracker_cloud_sync_enabled",MR="tokentracker_cloud_device_session_v1",Pp="tokentracker_cloud_last_sync_ts";let Sp=null;function Cp(){try{localStorage.removeItem(MR)}catch{}}function IR(){if(typeof window>"u")return!1;const e=window.location.hostname;return e==="localhost"||e==="127.0.0.1"}function NR(){try{const e=localStorage.getItem(t0);return e===null||e===""?!1:e==="1"||e==="true"}catch{return!1}}function s4(e){try{localStorage.setItem(t0,e?"1":"0")}catch{}}function n0(){return Cp(),Sp}function OR(e){Sp=e,Cp()}function r0(){Sp=null;try{localStorage.removeItem(Pp)}catch{}Cp()}function jR(){try{const e=Number(localStorage.getItem(Pp));return Number.isFinite(e)?e:0}catch{return 0}}function a0(e){try{localStorage.setItem(Pp,String(e))}catch{}}function Ea(e){if(typeof e!="string")return null;const t=e.trim();return t.length>0?t:null}function UR(e){const t=Ea(e);if(!t)return null;const n=t.split(".");if(n.length<2)return null;const a=n[1];try{const s=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),o=typeof atob=="function"?atob(s):Buffer.from(s,"base64").toString("utf8"),u=JSON.parse(o)?.exp;return typeof u!="number"||!Number.isFinite(u)||u<=0?null:Math.floor(u*1e3)}catch{return null}}function BR(e){const t=Ea(e);if(!t)return!1;const n=t.split(".");if(n.length!==3)return!1;try{for(let a=0;a<2;a++){const s=n[a];if(!/^[A-Za-z0-9_-]+$/.test(s))return!1;const o=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),c=typeof atob=="function"?atob(o):Buffer.from(o,"base64").toString("utf8");a===1&&JSON.parse(c)}return!0}catch{return!1}}function FR(e,t=3e4){const n=UR(e);return n?n<=Date.now()+Math.max(0,Number(t)||0):!1}async function VR(e){if(!e)return null;if(typeof e=="string")return Ea(e);if(typeof e=="function")try{const t=await e();return Ea(t)}catch{return null}if(typeof e=="object"){if(typeof e.getAccessToken=="function"){try{const t=await e.getAccessToken(),n=Ea(t);if(n)return n}catch{}return Ea(e.accessToken)}return null}return Ea(e)}async function o4(e,t={}){const n=Math.max(1,Math.min(12,Math.floor(Number(t.maxAttempts)||8))),a=Math.max(20,Math.floor(Number(t.baseDelayMs)||50));for(let s=0;s<n;s++){const o=await VR(e);if(o)return o;s<n-1&&await new Promise(c=>setTimeout(c,a*(s+1)))}return null}function l4(e){return typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1")||typeof e=="function"||e&&typeof e=="object"&&typeof e.getAccessToken=="function"?!0:!!Ea(e)}function c4(){if(typeof Intl>"u"||!Intl.DateTimeFormat)return null;try{return Intl.DateTimeFormat().resolvedOptions().timeZone||null}catch{return null}}function u4(e=new Date){const t=e instanceof Date?e:new Date(e);if(!Number.isFinite(t.getTime()))return 0;const n=t.getTimezoneOffset();return Number.isFinite(n)?-n:0}function i0(e){if(!Number.isFinite(e)||e===0)return"UTC";const t=e>=0?"+":"-",n=Math.abs(e),a=String(Math.floor(n/60)).padStart(2,"0"),s=String(n%60).padStart(2,"0");return`UTC${t}${a}:${s}`}function d4({timeZone:e,offsetMinutes:t}={}){const n=i0(t);return e&&e!=="UTC"?`${e} (${n})`:n}function h4({timeZone:e,offsetMinutes:t}={}){return Number.isFinite(t)?i0(t):e||"UTC"}function f4({timeZone:e,offsetMinutes:t,date:n=new Date}={}){const a=n instanceof Date?n:new Date(n);if(!Number.isFinite(a.getTime()))return"";if(e&&typeof Intl<"u"&&Intl.DateTimeFormat)try{const c=new Intl.DateTimeFormat("en-CA",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(a).reduce((m,y)=>(y.type&&y.value&&(m[y.type]=y.value),m),{}),u=c.year,h=c.month,f=c.day;if(u&&h&&f)return`${u}-${h}-${f}`}catch{}if(typeof t=="number"&&Number.isFinite(t)){const s=new Date(a.getTime()+t*6e4);return $R(s)}return HR(a)}function zR({timeZone:e,offsetMinutes:t,date:n=new Date}={}){const a=n instanceof Date?n:new Date(n);if(!Number.isFinite(a.getTime()))return null;if(e&&typeof Intl<"u"&&Intl.DateTimeFormat)try{const c=new Intl.DateTimeFormat("en-CA",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(a).reduce((m,y)=>(y.type&&y.value&&(m[y.type]=y.value),m),{}),u=Number(c.year),h=Number(c.month),f=Number(c.day);if(Number.isFinite(u)&&Number.isFinite(h)&&Number.isFinite(f))return{year:u,month:h,day:f}}catch{}if(typeof t=="number"&&Number.isFinite(t)){const s=new Date(a.getTime()+t*6e4);return{year:s.getUTCFullYear(),month:s.getUTCMonth()+1,day:s.getUTCDate()}}return{year:a.getFullYear(),month:a.getMonth()+1,day:a.getDate()}}function p4({timeZone:e,offsetMinutes:t}={}){return e?`tz:${e}`:typeof t=="number"&&Number.isFinite(t)?`offset:${Math.trunc(t)}`:"utc"}function $R(e){const t=e.getUTCFullYear(),n=String(e.getUTCMonth()+1).padStart(2,"0"),a=String(e.getUTCDate()).padStart(2,"0");return`${t}-${n}-${a}`}function HR(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${a}`}function yt(e){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())).toISOString().slice(0,10)}function Pr(e){const t=e instanceof Date?e:new Date(e);if(!Number.isFinite(t.getTime()))return"";const n=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0");return`${n}-${a}-${s}`}function WR(e){if(!e)return null;const t=String(e).trim(),n=t.split("-");if(n.length!==3)return null;const a=Number(n[0]),s=Number(n[1])-1,o=Number(n[2]);if(!Number.isFinite(a)||!Number.isFinite(s)||!Number.isFinite(o))return null;const c=new Date(Date.UTC(a,s,o));return Number.isFinite(c.getTime())&&yt(c)===t?c:null}function KR(e){if(!e)return"";const t=e.year,n=String(e.month).padStart(2,"0"),a=String(e.day).padStart(2,"0");return!t||!n||!a?"":`${t}-${n}-${a}`}function GR(e,{timeZone:t,offsetMinutes:n,now:a}={}){const s=a instanceof Date&&Number.isFinite(a.getTime())?a:new Date,o=zR({timeZone:t,offsetMinutes:n,date:s});if(!o){const h=Pr(new Date);return{from:h,to:h}}const c=KR(o),u=WR(c);if(!u)return{from:c,to:c};if(e==="day")return{from:c,to:c};if(e==="week"){const h=new Date(u),m=(h.getUTCDay()+6)%7;h.setUTCDate(h.getUTCDate()-m);const y=new Date(h);return y.setUTCDate(y.getUTCDate()+6),{from:yt(h),to:yt(y)}}if(e==="month"){const h=new Date(Date.UTC(u.getUTCFullYear(),u.getUTCMonth(),1)),f=new Date(Date.UTC(u.getUTCFullYear(),u.getUTCMonth()+1,0));return{from:yt(h),to:yt(f)}}if(e==="total"){const h=new Date(Date.UTC(u.getUTCFullYear(),u.getUTCMonth()-23,1));return{from:yt(h),to:c}}return GR("week")}function s0(){return typeof window>"u"?null:window.localStorage||null}function o0(){return typeof navigator>"u"?null:navigator.clipboard||null}function qR(){return typeof window>"u"?null:window.ClipboardItem||null}function xo(e,{storage:t}={}){const n=t??s0();if(!n||typeof n.getItem!="function")return null;try{return n.getItem(e)}catch{return null}}function Po(e,t,{storage:n}={}){const a=n??s0();if(!a||typeof a.setItem!="function")return!1;try{return a.setItem(e,t),!0}catch{return!1}}async function m4(e,{clipboard:t}={}){const n=t??o0();if(!n||typeof n.writeText!="function")return!1;try{return await n.writeText(e),!0}catch{return!1}}async function g4(e,{clipboard:t}={}){const n=t??o0(),a=qR();if(!e||!n||typeof n.write!="function"||!a)return!1;try{const s=e.type||"image/png",o=e.type&&e.type!==s?e.slice(0,e.size,s):e.type?e:e.slice(0,e.size,s),c=new a({[s]:o});return await n.write([c]),!0}catch{return!1}}const No="USD",Tp=["USD","EUR","GBP","CNY","JPY","HKD"],l0={USD:{symbol:"$",labelKey:"settings.appearance.currency.opt.usd"},EUR:{symbol:"€",labelKey:"settings.appearance.currency.opt.eur"},GBP:{symbol:"£",labelKey:"settings.appearance.currency.opt.gbp"},CNY:{symbol:"¥",labelKey:"settings.appearance.currency.opt.cny"},JPY:{symbol:"¥",labelKey:"settings.appearance.currency.opt.jpy"},HKD:{symbol:"HK$",labelKey:"settings.appearance.currency.opt.hkd"}},Ep={USD:1,EUR:.92,GBP:.79,CNY:7.2,JPY:155,HKD:7.8},c0="tokentracker-currency",u0="tokentracker-exchange-rates",d0="tokentracker-exchange-rate-source",h0="tokentracker-exchange-rate-fetched-at";function nu(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Ap(e){if(typeof e!="string")return No;const t=e.trim().toUpperCase();return Tp.includes(t)?t:No}function Ic(e){const t=typeof e=="string"?e.trim().toUpperCase():No;return l0[t]?.symbol??"$"}function y4(){return Tp.map(e=>({code:e,...l0[e]}))}function YR(){return Ap(xo(c0))}function ZR(e){return Po(c0,Ap(e))}function f0(e){return e==="fetched"?"fetched":"default"}function XR(e){if(e==null)return null;try{const t=JSON.parse(String(e));if(!t||typeof t!="object")return null;const n={};for(const[a,s]of Object.entries(t)){const o=Number(s);Number.isFinite(o)&&o>0&&(n[a.toUpperCase()]=o)}return n}catch{return null}}function QR(){const e=XR(xo(u0)),t=xo(h0),n=t==null?NaN:Number(t),a=Number.isFinite(n)&&n>0?n:null,s=xo(d0),o=f0(s);return e&&Object.keys(e).length>0?{rates:{USD:1,...e},source:o,fetchedAt:a}:{rates:{...Ep},source:"default",fetchedAt:null}}function JR(e){const{rates:t,source:n,fetchedAt:a}=e;if(!t||typeof t!="object")return!1;const s=Po(u0,JSON.stringify(t)),o=Po(d0,f0(n)),c=a?Po(h0,String(a)):!0;return s&&o&&c}function Mh(e,t){if(t===No)return 1;const n=e?.[t];if(nu(n))return n;const a=Ep[t];return nu(a)?a:1}function v4(e){if(e==null)return"-";try{if(typeof e=="bigint")return new Intl.NumberFormat().format(e);if(typeof e=="number")return new Intl.NumberFormat().format(e);const t=String(e).trim();return/^[0-9]+$/.test(t)?new Intl.NumberFormat().format(BigInt(t)):t}catch{return String(e)}}function k4(e,{thousandSuffix:t="K",millionSuffix:n="M",billionSuffix:a="B",decimals:s=1}={}){const o=Number(String(e));if(!Number.isFinite(o))return"-";const c=o<0?"-":"",u=Math.abs(o),h=Math.max(0,Math.min(6,Math.floor(s)));if(u<1e3)return`${c}${String(u)}`;const f=(w,P)=>{const C=w.toFixed(h),S=Number(C).toString();return`${c}${S}${P}`},m=(w,P,C)=>{const S=w.toFixed(h),D=Number(S);return C&&D>=1e3?f(D/1e3,C):`${c}${D.toString()}${P}`};if(u>=1e9)return f(u/1e9,a);if(u>=1e6)return m(u/1e6,n,a);const y=u/1e3,k=Number(y.toFixed(h));return k>=1e3?f(k/1e3,n):f(k,t)}function p0(e){const t=Number(String(e));return Number.isFinite(t)?t:null}function _4(e,t={}){const{decimals:n=2,currency:a="USD",rate:s=1}=t;if(e==null||typeof e=="string"&&e.trim()==="")return"-";let o;if(typeof e=="number")o=e;else if(typeof e=="bigint")o=Number(e);else{const S=String(e).trim(),D=Number(S);if(!Number.isFinite(D))return S;o=D}if(!Number.isFinite(o))return String(e);const c=Ic(a);a!=="USD"&&typeof s=="number"&&Number.isFinite(s)&&s>0&&(o=o*s);const h=o.toFixed(6).match(/^(-?\d+)(?:\.(\d+))?$/);if(!h)return`${c}${String(o)}`;const f=h[1],m=h[2]||"";let y=f;try{y=new Intl.NumberFormat().format(BigInt(f))}catch{y=f}const k=Math.max(0,Math.min(6,Math.floor(n))),w=k?m.slice(0,k).padEnd(k,"0"):"",P=f.startsWith("-")?"-":"",C=k?`${y.replace("-","")}.${w}`:y.replace("-","");return`${P}${c}${C}`}function ru(e){if(typeof e!="string")return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());if(!t)return null;const n=Number(t[1]),a=Number(t[2])-1,s=Number(t[3]),o=new Date(Date.UTC(n,a,s));return Number.isFinite(o.getTime())&&yt(o)===e.trim()?o:null}function ni(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+t))}function eL(e,t){const n=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())-Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate());return Math.floor(n/864e5)}function Ih(e,t){if(!Array.isArray(e)||e.length===0)return 0;const n=e.length,a=(n-1)*t,s=Math.floor(a),o=a-s,c=e[s]??e[n-1],u=e[Math.min(n-1,s+1)]??e[n-1];return Math.round(c+(u-c)*o)}function tL(e){return e<=0?0:e>=4?4:e}function m0({weeks:e=52,now:t,weekStartsOn:n="sun"}={}){const a=t instanceof Date&&Number.isFinite(t.getTime())?t:new Date,s=Pr(a),o=ru(s)||new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate())),c=n==="mon"?1:0,u=o.getUTCDay(),h=ni(o,-((u-c+7)%7)),f=ni(h,-7*(Math.max(1,e)-1));return{from:yt(f),to:s}}function nL({dailyRows:e,weeks:t=52,to:n,weekStartsOn:a="sun"}={}){const s=ru(n)||new Date(Date.UTC(new Date().getFullYear(),new Date().getMonth(),new Date().getDate())),{from:o}=m0({weeks:t,now:s,weekStartsOn:a}),c=ru(o)||ni(s,-(t*7-1)),u=(()=>{const O=(c.getUTCDay()-(a==="mon"?1:0)+7)%7;return ni(c,-O)})(),h=new Map;for(const L of Array.isArray(e)?e:[]){const R=typeof L?.day=="string"?L.day:null;if(!R)continue;const O=p0(L?.billable_total_tokens??L?.total_tokens)??0;h.set(R,{value:Math.max(0,O),models:L?.models||null})}const f=eL(u,s)+1,m=Math.ceil(f/7),y=[];for(let L=0;L<f;L++){const R=ni(u,L),O=yt(R),W=h.get(O),K=W?W.value:0;K>0&&y.push(K)}y.sort((L,R)=>L-R);const k=Ih(y,.5),w=Ih(y,.75),P=Ih(y,.9);function C(L){return!L||L<=0?0:L<=k?1:L<=w?2:L<=P?3:4}const S=[];for(let L=0;L<m;L++){const R=[];for(let O=0;O<7;O++){const W=L*7+O,K=ni(u,W);if(K.getTime()>s.getTime()){R.push(null);continue}const $=yt(K),x=h.get($),Y=x?x.value:0,X=x?x.models:null;R.push({day:$,value:Y,level:tL(C(Y)),models:X})}S.push(R)}const D=S.length>t?S.slice(S.length-t):S;return{from:o,to:yt(s),weeks:D,thresholds:{t1:k,t2:w,t3:P}}}function rL({dailyRows:e,to:t}={}){const n=ru(t)||new Date(Date.UTC(new Date().getFullYear(),new Date().getMonth(),new Date().getDate())),a=new Map;for(const o of Array.isArray(e)?e:[]){const c=typeof o?.day=="string"?o.day:null;if(!c)continue;const u=p0(o?.billable_total_tokens??o?.total_tokens)??0;a.set(c,Math.max(0,u))}let s=0;for(let o=0;o<370;o++){const c=yt(ni(n,-o));if((a.get(c)??0)>0){s+=1;continue}break}return s}const Au={},g0="tokentracker",aL=["tokentracker/tokentracker","spacedriveapp/spacedrive","acme/alpha","acme/beta","neo/nebula","signal/flux","matrix/terminal","orbit/atlas","lumen/core","delta/horizon"],Gv=["NEO","TRINITY","MORPHEUS","ORACLE","CYPHER","SWITCH","APOC","TANK","SMITH","SERAPH","NIOBE","MOUSE","DOZER","LINK","BLADE"];function Sn(){if(typeof window<"u"){const e=new URLSearchParams(window.location.search),t=String(e.get("mock")||"").toLowerCase();if(t==="0"||t==="false"||t==="off"||t==="no")return!1;if(t==="1"||t==="true"||t==="on"||t==="yes")return!0}if(typeof import.meta<"u"&&Au){const e="".toLowerCase();if(e==="1"||e==="true")return!0}return!1}function iL(){if(typeof import.meta<"u"&&Au){const e="".trim();if(e)return e;const t="".trim();if(t)return t}if(typeof window<"u"){const e=new URLSearchParams(window.location.search),t=String(e.get("mock_now")||"").trim();if(t)return t;const n=String(e.get("mock_today")||"").trim();if(n)return n}return""}function sL(e){if(!e)return null;const t=String(e).trim();if(!t)return null;if(/^\d{4}-\d{2}-\d{2}$/.test(t)){const[a,s,o]=t.split("-").map(Number);if(!Number.isFinite(a)||!Number.isFinite(s)||!Number.isFinite(o))return null;const c=new Date(a,s-1,o,12,0,0);return Number.isFinite(c.getTime())?c:null}const n=new Date(t);return Number.isFinite(n.getTime())?n:null}function b4(){return Sn()?sL(iL()):null}function oL(){if(typeof import.meta<"u"&&Au){const e="".trim();if(e)return e}if(typeof window<"u"){const e=new URLSearchParams(window.location.search),t=String(e.get("mock_seed")||"").trim();if(t)return t}return g0}function lL(){if(typeof import.meta<"u"&&Au){const e="".trim(),t=Number(e);if(Number.isFinite(t)&&t>0)return Math.floor(t)}if(typeof window<"u"){const e=new URLSearchParams(window.location.search),t=String(e.get("mock_missing")||"").trim(),n=Number(t);if(Number.isFinite(n)&&n>0)return Math.floor(n)}return 0}function Ko(e){return(e==null?oL():String(e)).trim()||g0}function Go(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function cn(e){if(typeof e!="string")return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());if(!t)return null;const n=Number(t[1]),a=Number(t[2])-1,s=Number(t[3]),o=new Date(Date.UTC(n,a,s));return Number.isFinite(o.getTime())&&yt(o)===e.trim()?o:null}function Oo(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+t))}function y0(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+t,1))}function cL(e){return`${e.getUTCFullYear()}-${String(e.getUTCMonth()+1).padStart(2,"0")}`}function fs({from:e,to:t,seed:n}){const a=cn(Pr(new Date))||new Date,s=cn(e)||a,o=cn(t)||s,c=[],u=Ko(n),h=Math.floor((Date.UTC(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate())-Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()))/864e5)+1;for(let f=0;f<h;f+=1){const m=Oo(s,f),y=yt(m),k=Go(`${u}:${y}`),w=k%1e3/1e3,P=.6+.4*Math.sin(f/6*Math.PI*.5),C=m.getUTCDay()===0||m.getUTCDay()===6?.65:1,S=18e3+Math.round(12e3*w),D=Math.max(0,Math.round(S*P*C)),L=Math.round(D*.46),R=Math.round(D*.34),O=Math.round(D*.14),W=Math.max(0,D-L-R-O),K={};if(D>0){const $=["gpt-4o","claude-3.5-sonnet","gemini-1.5-pro","deepseek-coder"],x=1+k%3;let Y=D;for(let X=0;X<x;X++){const le=$[(k+X)%$.length];if(X===x-1)K[le]=Y;else{const oe=Math.round(Y*(.3+.4*((k+X*17)%10)/10));K[le]=oe,Y-=oe}}}c.push({day:y,total_tokens:D,billable_total_tokens:D,input_tokens:L,output_tokens:R,cached_input_tokens:O,reasoning_output_tokens:W,conversation_count:1+k%5,models:K})}return c}function uL({day:e,seed:t}){const n=cn(e)||cn(Pr(new Date))||new Date,a=yt(n),s=Ko(t),o=Array.from({length:48},(u,h)=>{const f=Math.floor(h/2),m=h%2===0?0:30,y=Go(`${s}:${a}:${f}:${m}`),k=y%1e3/1e3,w=(f+m/60)/24,P=.4+.6*Math.sin(w*Math.PI*2),C=900+Math.round(700*k),S=Math.max(0,Math.round(C*P)),D=Math.round(S*.46),L=Math.round(S*.34),R=Math.round(S*.14),O=Math.max(0,S-D-L-R),W={};if(S>0){const K=["gpt-4o","claude-3.5-sonnet","gemini-1.5-pro","deepseek-coder"],$=1+y%2;let x=S;for(let Y=0;Y<$;Y++){const X=K[(y+Y)%K.length];if(Y===$-1)W[X]=x;else{const le=Math.round(x*(.3+.4*((y+Y*17)%10)/10));W[X]=le,x-=le}}}return{hour:`${a}T${String(f).padStart(2,"0")}:${String(m).padStart(2,"0")}:00`,total_tokens:S,billable_total_tokens:S,input_tokens:D,output_tokens:L,cached_input_tokens:R,reasoning_output_tokens:O,models:W}}),c=Math.max(0,Math.min(48,lL()));if(c>0){const u=Date.now(),h=o.map((y,k)=>{const w=Date.parse(y.hour);return Number.isFinite(w)&&w<=u?{index:k,ts:w}:null}).filter(Boolean),f=Math.max(0,h.length-c),m=h.slice(f);for(const y of m){const k=o[y.index];k&&(o[y.index]={...k,missing:!0})}}return o}function dL({months:e=24,to:t,seed:n}){const a=cn(t)||cn(Pr(new Date))||new Date,s=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1)),o=Ko(n),c=[];for(let u=e-1;u>=0;u-=1){const h=y0(s,-u),f=cL(h),m=Go(`${o}:${f}`),y=m%1e3/1e3,k=.7+.3*Math.sin(c.length/6*Math.PI*.5),w=36e4+Math.round(2e5*y),P=Math.max(0,Math.round(w*k)),C=Math.round(P*.46),S=Math.round(P*.34),D=Math.round(P*.14),L=Math.max(0,P-C-S-D),R={};if(P>0){const O=["gpt-4o","claude-3.5-sonnet","gemini-1.5-pro","deepseek-coder"],W=1+m%3;let K=P;for(let $=0;$<W;$++){const x=O[(m+$)%O.length];if($===W-1)R[x]=K;else{const Y=Math.round(K*(.3+.4*((m+$*17)%10)/10));R[x]=Y,K-=Y}}}c.push({month:f,total_tokens:P,billable_total_tokens:P,input_tokens:C,output_tokens:S,cached_input_tokens:D,reasoning_output_tokens:L,models:R})}return c}function Rp(e){return e.reduce((t,n)=>(t.total_tokens+=Number(n.total_tokens||0),t.billable_total_tokens+=Number(n.billable_total_tokens||n.total_tokens||0),t.input_tokens+=Number(n.input_tokens||0),t.output_tokens+=Number(n.output_tokens||0),t.cached_input_tokens+=Number(n.cached_input_tokens||0),t.reasoning_output_tokens+=Number(n.reasoning_output_tokens||0),t.conversation_count+=Number(n.conversation_count||0),t),{total_tokens:0,billable_total_tokens:0,input_tokens:0,output_tokens:0,cached_input_tokens:0,reasoning_output_tokens:0,conversation_count:0})}function hL(e,t=1.75){const n=Number(e||0);return!Number.isFinite(n)||n<=0?"0.000000":(n*t/1e6).toFixed(6)}function qv(e,t){const n=Number.isFinite(t)?t:0;return{total_tokens:Math.max(0,Math.round(e.total_tokens*n)),billable_total_tokens:Math.max(0,Math.round((e.billable_total_tokens??e.total_tokens)*n)),input_tokens:Math.max(0,Math.round(e.input_tokens*n)),output_tokens:Math.max(0,Math.round(e.output_tokens*n)),cached_input_tokens:Math.max(0,Math.round(e.cached_input_tokens*n)),reasoning_output_tokens:Math.max(0,Math.round(e.reasoning_output_tokens*n))}}function xf(e){return{...e,total_cost_usd:hL(e.total_tokens)}}function fL({from:e,to:t,seed:n}={}){const a=fs({from:e,to:t,seed:n});return{from:e,to:t,data:a}}function pL({day:e,seed:t}={}){const n=cn(e)||new Date,a=yt(n),s=uL({day:a,seed:t});return{day:a,data:s}}function mL({months:e=24,to:t,seed:n}={}){const a=cn(t)||cn(Pr(new Date))||new Date,s=yt(a),o=dL({months:e,to:s,seed:n}),c=y0(new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1)),-(e-1));return{from:yt(c),to:s,months:e,data:o}}function gL({from:e,to:t,seed:n,rolling:a=!0}={}){const s=fs({from:e,to:t,seed:n}),o=Rp(s),c=xf(o),u=a?yL({to:t,seed:n}):null;return{from:e,to:t,days:s.length,totals:c,...u?{rolling:u}:{}}}function yL({to:e,seed:t}={}){const n=cn(e)||cn(Pr(new Date))||new Date,a=yt(n),s=yt(Oo(n,-6)),o=yt(Oo(n,-29)),c=fs({from:s,to:a,seed:t}),u=fs({from:o,to:a,seed:t});return{last_7d:Yv({rows:c,from:s,to:a}),last_30d:Yv({rows:u,from:o,to:a})}}function Yv({rows:e,from:t,to:n}={}){const a=Rp(e||[]),s=(e||[]).filter(c=>Number(c.billable_total_tokens??c.total_tokens)>0).length,o=s>0?Math.floor(a.billable_total_tokens/s):0;return{from:t,to:n,totals:{billable_total_tokens:a.billable_total_tokens,conversation_count:a.conversation_count},active_days:s,avg_per_active_day:o}}function vL({seed:e,limit:t=3}={}){const n=Ko(e),a=aL.map((s,o)=>{const u=12e4+Go(`${n}:${s}`)%9e5,h=o%4*4200,f=Math.max(0,u+h),m=Math.max(0,Math.round(f*.96));return{project_key:s,project_ref:`https://github.com/${s}`,total_tokens:String(f),billable_total_tokens:String(m)}}).sort((s,o)=>Number(o.billable_total_tokens)-Number(s.billable_total_tokens)).slice(0,Math.max(1,Math.min(10,Math.floor(Number(t)||3))));return{generated_at:new Date().toISOString(),entries:a}}function kL(e){const t=cn(Pr(new Date))||new Date,n=String(e).trim().toLowerCase()||"week";if(n==="total")return{from:"1970-01-01",to:"9999-12-31"};if(n==="month"){const c=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),1)),u=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,0));return{from:yt(c),to:yt(u)}}const a=t.getUTCDay(),s=yt(Oo(t,-a)),o=yt(Oo(t,-a+6));return{from:s,to:o}}function v0({seed:e,period:t,metric:n,limit:a=20,offset:s=0}={}){const o=Ko(e),c=Math.max(1,Math.min(100,Math.floor(Number(a)||20))),u=Math.max(0,Math.min(1e4,Math.floor(Number(s)||0))),h=String(n||"all").trim().toLowerCase()||"all",f=String(t||"week").trim().toLowerCase()||"week",m=f==="month"||f==="total"||f==="week"?f:"week",{from:y,to:k}=kL(m),w=250,P=w>0?Math.ceil(w/c):0,C=Math.floor(u/c)+1,S=Array.from({length:w},($,x)=>{const Y=x+1,X=`00000000-0000-0000-0000-${String(Y).padStart(12,"0")}`,le=Gv[Y%Gv.length],Ae=18e4+Go(`${o}:${le}:${Y}`)%9e5,de=Math.max(0,Ae+Y*1200),fe=Math.floor(de*.28),ye=Math.floor(de*.18),Ne=Math.floor(de*.1),G=Math.floor(de*.1),Z=Math.floor(de*.08),H=Math.floor(de*.03),I=Math.floor(de*.02),q=Math.floor(de*.04),xe=Math.floor(de*.03),Re=Math.max(0,de-fe-ye-Ne-G-Z-H-I-q-xe),Pe=Y%7!==0;return{id:Y,user_id:X,is_public:Pe,is_me:!1,display_name:Pe?le:"Anonymous",avatar_url:null,gpt_tokens:fe,claude_tokens:ye,gemini_tokens:Ne,cursor_tokens:G,opencode_tokens:Z,openclaw_tokens:Re,hermes_tokens:H,kiro_tokens:I,copilot_tokens:q,kimi_tokens:xe,other_tokens:0,total_tokens:de}}),D=Math.max(0,Math.min(w-1,Math.floor(w*.8)));S[D]&&(S[D].is_me=!0);const L=h==="gpt"||h==="codex"?"gpt_tokens":h==="claude"?"claude_tokens":h==="gemini"?"gemini_tokens":h==="cursor"?"cursor_tokens":h==="opencode"?"opencode_tokens":h==="openclaw"?"openclaw_tokens":h==="hermes"?"hermes_tokens":h==="kiro"?"kiro_tokens":h==="copilot"?"copilot_tokens":h==="kimi"?"kimi_tokens":"total_tokens",R=S.slice().sort(($,x)=>Number(x[L])-Number($[L])||$.id-x.id).map(($,x)=>({user_id:$.is_public?$.user_id:null,rank:x+1,is_me:!!$.is_me,display_name:$.display_name,avatar_url:$.avatar_url,gpt_tokens:String($.gpt_tokens),claude_tokens:String($.claude_tokens),gemini_tokens:String($.gemini_tokens),cursor_tokens:String($.cursor_tokens),opencode_tokens:String($.opencode_tokens),openclaw_tokens:String($.openclaw_tokens),hermes_tokens:String($.hermes_tokens??0),kiro_tokens:String($.kiro_tokens??0),copilot_tokens:String($.copilot_tokens??0),kimi_tokens:String($.kimi_tokens??0),other_tokens:String($.other_tokens??0),total_tokens:String($.total_tokens),is_public:!!$.is_public})),O=R.find($=>$?.is_me)||null,W=O?{rank:O.rank,gpt_tokens:O.gpt_tokens,claude_tokens:O.claude_tokens,gemini_tokens:O.gemini_tokens,cursor_tokens:O.cursor_tokens,opencode_tokens:O.opencode_tokens,openclaw_tokens:O.openclaw_tokens,hermes_tokens:O.hermes_tokens,kiro_tokens:O.kiro_tokens,copilot_tokens:O.copilot_tokens,kimi_tokens:O.kimi_tokens,other_tokens:O.other_tokens,total_tokens:O.total_tokens}:{rank:null,gpt_tokens:"0",claude_tokens:"0",gemini_tokens:"0",cursor_tokens:"0",opencode_tokens:"0",openclaw_tokens:"0",hermes_tokens:"0",kiro_tokens:"0",copilot_tokens:"0",kimi_tokens:"0",other_tokens:"0",total_tokens:"0"},K=R.slice(u,u+c);return{period:m,metric:h,from:y,to:k,generated_at:new Date().toISOString(),page:C,limit:c,offset:u,total_entries:w,total_pages:P,entries:K,me:W}}function _L({weeks:e=52,to:t,weekStartsOn:n="sun",seed:a}={}){const s=m0({weeks:e,now:cn(t)||cn(Pr(new Date))||new Date,weekStartsOn:n}),o=fs({from:s.from,to:s.to,seed:a});return{...nL({dailyRows:o,weeks:e,to:s.to,weekStartsOn:n}),week_starts_on:n,active_days:o.filter(u=>Number(u.billable_total_tokens??u.total_tokens)>0).length,streak_days:rL({dailyRows:o,to:s.to})}}function bL({from:e,to:t,seed:n}={}){const a=fs({from:e,to:t,seed:n}),s=Rp(a),c=[{source:"codex",weight:.7,models:[{model:"gpt-5.2-codex",model_id:"gpt-5.2-codex",weight:.2},{model:"unknown",model_id:"unknown",weight:.8}]},{source:"claude",weight:.2,models:[{model:"claude-3.5",model_id:"claude-3.5",weight:.3},{model:"unknown",model_id:"unknown",weight:.7}]},{source:"every-code",weight:.1,models:[{model:"unknown",model_id:"unknown",weight:1}]}].map(u=>{const h=qv(s,u.weight),f=u.models.map(m=>{const y=qv(h,m.weight);return{model:m.model,model_id:m.model_id||m.model,totals:xf(y)}});return{source:u.source,totals:xf(h),models:f}});return{from:e,to:t,days:a.length,sources:c,pricing:{model:"mock",pricing_mode:"add",source:"mock",effective_from:Pr(new Date),rates_per_million_usd:{input:"1.750000",cached_input:"0.175000",output:"14.000000",reasoning_output:"14.000000"}}}}function wL({from:e,to:t,source:n="claude"}={}){if(n==="codex")return{from:e,to:t,source:"codex",scope:"supported",totals:{input_tokens:142e4,cached_input_tokens:588e4,cache_creation_input_tokens:92e4,output_tokens:256e4,reasoning_output_tokens:61e4,total_tokens:1078e4},session_count:188,message_count:5436,tool_calls_breakdown:{categories:[{name:"Execution",calls:742,totals:{input_tokens:32e4,cached_input_tokens:104e4,cache_creation_input_tokens:11e4,output_tokens:46e4,reasoning_output_tokens:12e4,total_tokens:193e4},tools:[{name:"exec_command",calls:510,totals:{input_tokens:25e4,cached_input_tokens:82e4,cache_creation_input_tokens:8e4,output_tokens:37e4,reasoning_output_tokens:9e4,total_tokens:152e4}},{name:"write_stdin",calls:232,totals:{input_tokens:7e4,cached_input_tokens:22e4,cache_creation_input_tokens:3e4,output_tokens:9e4,reasoning_output_tokens:3e4,total_tokens:41e4}}]},{name:"Browser",calls:406,totals:{input_tokens:21e4,cached_input_tokens:88e4,cache_creation_input_tokens:9e4,output_tokens:42e4,reasoning_output_tokens:1e5,total_tokens:17e5},tools:[{name:"take_snapshot",calls:180,totals:{input_tokens:1e5,cached_input_tokens:4e5,cache_creation_input_tokens:4e4,output_tokens:18e4,reasoning_output_tokens:4e4,total_tokens:76e4}},{name:"click",calls:126,totals:{input_tokens:6e4,cached_input_tokens:25e4,cache_creation_input_tokens:3e4,output_tokens:12e4,reasoning_output_tokens:35e3,total_tokens:495e3}},{name:"evaluate_script",calls:100,totals:{input_tokens:5e4,cached_input_tokens:23e4,cache_creation_input_tokens:2e4,output_tokens:12e4,reasoning_output_tokens:25e3,total_tokens:445e3}}]}],tools_total:363e4,privacy:{includes_inputs:!1,note:"Aggregated tool names only; no tool arguments or outputs are included."}},exec_command_breakdown:{by_type:[{name:"test",calls:168,failures:14,duration_ms:482e3,max_duration_ms:18400,output_chars:45e4,output_lines:8600,totals:{input_tokens:9e4,cached_input_tokens:32e4,output_tokens:16e4,reasoning_output_tokens:42e3,total_tokens:612e3}},{name:"build",calls:116,failures:9,duration_ms:392e3,max_duration_ms:22100,output_chars:31e4,output_lines:5200,totals:{input_tokens:7e4,cached_input_tokens:24e4,output_tokens:13e4,reasoning_output_tokens:3e4,total_tokens:47e4}}],by_exit:[{name:"completed:0",calls:438,failures:0,duration_ms:104e4,max_duration_ms:22100,output_chars:83e4,output_lines:13100,totals:{input_tokens:22e4,cached_input_tokens:78e4,output_tokens:35e4,reasoning_output_tokens:82e3,total_tokens:1432e3}},{name:"completed:1",calls:72,failures:72,duration_ms:155e3,max_duration_ms:11800,output_chars:12e4,output_lines:2300,totals:{input_tokens:3e4,cached_input_tokens:11e4,output_tokens:55e3,reasoning_output_tokens:8e3,total_tokens:195e3}}]}};if(n!=="claude")return{from:e,to:t,source:n,scope:"unsupported",totals:{input_tokens:0,cached_input_tokens:0,cache_creation_input_tokens:0,output_tokens:0,reasoning_output_tokens:0,total_tokens:0},categories:["system_prefix","conversation_history","user_input","tool_calls","subagents","reasoning","assistant_response"].map(c=>({key:c,totals:{input_tokens:0,cached_input_tokens:0,cache_creation_input_tokens:0,output_tokens:0,reasoning_output_tokens:0,total_tokens:0},percent:0})),session_count:0,message_count:0};const a=[{key:"system_prefix",total:12896539},{key:"conversation_history",total:320207200},{key:"user_input",total:998025},{key:"tool_calls",total:4808739},{key:"subagents",total:1022828},{key:"reasoning",total:11073118},{key:"assistant_response",total:1289174}],s=a.reduce((c,u)=>c+u.total,0),o=a.map(({key:c,total:u})=>({key:c,totals:{input_tokens:c==="user_input"?u:0,cached_input_tokens:c==="conversation_history"?Math.round(u*.95):0,cache_creation_input_tokens:c==="system_prefix"?u:c==="conversation_history"?Math.round(u*.05):0,output_tokens:["tool_calls","subagents","reasoning","assistant_response"].includes(c)?u:0,reasoning_output_tokens:c==="reasoning"?u:0,total_tokens:u},percent:Number((u/s*100).toFixed(2))}));return{from:e,to:t,source:"claude",scope:"supported",totals:{input_tokens:998025,cached_input_tokens:Math.round(320207200*.95),cache_creation_input_tokens:12896539+Math.round(320207200*.05),output_tokens:18193859,reasoning_output_tokens:11073118,total_tokens:s},categories:o,session_count:312,message_count:12046}}let Nc=null;function xL(){Nc=null}async function PL(e=fetch){if(Nc)return Nc;const t=await e("/api/local-auth",{method:"GET",headers:{Accept:"application/json"},cache:"no-store"});if(!t.ok)throw new Error(`Local auth request failed with HTTP ${t.status}`);const n=await t.json().catch(()=>null),a=typeof n?.token=="string"?n.token.trim():"";if(!a)throw new Error("Local auth token missing from response");return Nc=a,a}async function Lp(e=fetch){return{"x-tokentracker-local-auth":await PL(e)}}const sr={usageSummary:"tokentracker-usage-summary",usageDaily:"tokentracker-usage-daily",usageHourly:"tokentracker-usage-hourly",usageMonthly:"tokentracker-usage-monthly",usageHeatmap:"tokentracker-usage-heatmap",usageModelBreakdown:"tokentracker-usage-model-breakdown",usageCategoryBreakdown:"tokentracker-usage-category-breakdown",projectUsageSummary:"tokentracker-project-usage-summary",userStatus:"tokentracker-user-status",localSync:"tokentracker-local-sync",usageLimits:"tokentracker-usage-limits"};async function Sr(e,t,n){const a=new URL(`/functions/${e}`,window.location.origin);if(t)for(const[o,c]of Object.entries(t))c!=null&&c!==""&&a.searchParams.set(o,String(c));const s=await fetch(a.toString(),{headers:{Accept:"application/json"},cache:"no-store",...n});if(!s.ok){const o=new Error(`Request failed with HTTP ${s.status}`);throw o.status=s.status,o}return s.json()}function Na({timeZone:e,tzOffsetMinutes:t}={}){const n={},a=typeof e=="string"?e.trim():"";return a&&(n.tz=a),Number.isFinite(t)&&(n.tz_offset_minutes=String(Math.trunc(t))),n}function mi({source:e,model:t}={}){const n={},a=typeof e=="string"?e.trim().toLowerCase():"";a&&(n.source=a);const s=typeof t=="string"?t.trim():"";return s&&(n.model=s),n}async function w4({from:e,to:t,source:n,model:a,timeZone:s,tzOffsetMinutes:o,rolling:c=!1,accessToken:u}={}){if(Sn())return gL({from:e,to:t,seed:u,rolling:c});const h=Na({timeZone:s,tzOffsetMinutes:o}),f=mi({source:n,model:a}),m=c?{rolling:"1"}:{};return Sr(sr.usageSummary,{from:e,to:t,...f,...h,...m})}async function x4({from:e,to:t,source:n,limit:a,timeZone:s,tzOffsetMinutes:o,accessToken:c}={}){if(Sn())return vL({seed:c,limit:a});const u=Na({timeZone:s,tzOffsetMinutes:o}),f={...mi({source:n}),...u};return e&&(f.from=e),t&&(f.to=t),a!=null&&(f.limit=String(a)),Sr(sr.projectUsageSummary,f)}async function qo(e,t={}){const n=fi();if(!n)throw new Error("InsForge base URL not configured");const a=n.replace(/\/$/,""),s=new URL(`${a}/functions/${e}`);if(t.params)for(const[h,f]of Object.entries(t.params))f!=null&&f!==""&&s.searchParams.set(h,String(f));const o={Accept:"application/json","Content-Type":"application/json"},c=Eu();c&&(o.apikey=c),t.accessToken&&BR(t.accessToken)&&(o.Authorization=`Bearer ${t.accessToken}`);const u=await fetch(s.toString(),{method:t.method||"GET",headers:o,...t.body!=null?{body:JSON.stringify(t.body)}:{}});if(!u.ok){const h=new Error(`Request failed with HTTP ${u.status}`);throw h.status=u.status,h}return u.json()}async function P4({accessToken:e,userId:t,period:n,metric:a,limit:s,offset:o}={}){return Sn()?v0({seed:e||t,period:n,metric:a,limit:s,offset:o}):qo("tokentracker-leaderboard",{params:{period:n,limit:s,offset:o,user_id:t}})}async function Zv({accessToken:e}={}){return qo("tokentracker-public-visibility",{accessToken:e,method:"GET"})}async function S4({accessToken:e,enabled:t,anonymous:n,display_name:a,github_url:s,show_github_url:o}={}){const c={};return t!==void 0&&(c.enabled=!!t),n!==void 0&&(c.anonymous=!!n),a!==void 0&&(c.display_name=String(a)),s!==void 0&&(c.github_url=s===null?null:String(s)),o!==void 0&&(c.show_github_url=!!o),qo("tokentracker-public-visibility",{accessToken:e,method:"POST",body:c})}async function C4({accessToken:e,period:t,source:n}={}){const a={};return t&&(a.period=t),typeof n=="string"&&n.trim()&&(a.source=n.trim()),qo("tokentracker-leaderboard-refresh",{accessToken:e,method:"POST",body:a})}async function T4({accessToken:e,userId:t,period:n}={}){if(Sn()){const a=v0({seed:e,period:n,metric:"all",limit:250,offset:0}),s=Array.isArray(a?.entries)?a.entries:[],o=s.find(m=>m?.user_id===t)||s[0]||null,c=Number(o?.total_tokens)||0,u=new Date,h=Array.from({length:365}).map((m,y)=>{const k=new Date(u);return k.setUTCDate(k.getUTCDate()-(364-y)),{date:k.toISOString().slice(0,10),total_tokens:y%7===0?Math.floor(c/365):0}}),f=h.slice(-7);return{user:{user_id:t,display_name:o?.display_name||"Mock User",avatar_url:o?.avatar_url||null,github_url:o?.github_url||null,is_anonymous:!1,rank:o?.rank??null},period:{kind:n||"week",from:a?.from??null,to:a?.to??null,generated_at:a?.generated_at??new Date().toISOString()},totals:{total_tokens:c,estimated_cost_usd:Number(o?.estimated_cost_usd)||0,active_days:53,avg_per_day_usd:0},streak:{current_days:3,longest_days:12},best_day:c?{date:u.toISOString().slice(0,10),total_tokens:Math.floor(c/30),estimated_cost_usd:0}:null,models:{count:5,favorite:{model_name:"claude-opus-4-7",total_tokens:Math.floor(c/2)}},by_provider:[],heatmap:h,daily_trend:f}}return qo("tokentracker-leaderboard-profile",{accessToken:e,params:{user_id:t,period:n}})}async function E4(e={}){if(Sn()){const t=new Date().toISOString();return{user_id:"local-user",created_at:t,pro:{active:!1,sources:[],expires_at:null,partial:!1,as_of:t},subscriptions:{partial:!1,as_of:t,items:[]},install:{partial:!1,as_of:t,has_active_device_token:!1,has_active_device:!1,active_device_tokens:0,active_devices:0,latest_token_activity_at:null,latest_device_seen_at:null}}}return Sr(sr.userStatus)}async function A4({signal:e}={}){const t=await Lp(),n=await fetch(`/functions/${sr.localSync}`,{method:"POST",headers:{Accept:"application/json",...t},cache:"no-store",signal:e}),a=await n.json().catch(()=>({ok:!1,error:`Local sync request failed with HTTP ${n.status}`}));if(!n.ok||a?.ok===!1){const s=a?.error||a?.message||`Local sync request failed with HTTP ${n.status}`,o=new Error(s);throw o.status=n.status,o}return a}async function R4({from:e,to:t,source:n,timeZone:a,tzOffsetMinutes:s,accessToken:o}={}){if(Sn())return bL({from:e,to:t,seed:o});const c=Na({timeZone:a,tzOffsetMinutes:s}),u=mi({source:n});return Sr(sr.usageModelBreakdown,{from:e,to:t,...u,...c})}async function L4({from:e,to:t,source:n="claude",timeZone:a,tzOffsetMinutes:s}={}){if(Sn())return wL({from:e,to:t,source:n});const o=Na({timeZone:a,tzOffsetMinutes:s});return Sr(sr.usageCategoryBreakdown,{from:e,to:t,source:n,...o})}async function D4({from:e,to:t,source:n,model:a,timeZone:s,tzOffsetMinutes:o,accessToken:c}={}){if(Sn())return fL({from:e,to:t,seed:c});const u=Na({timeZone:s,tzOffsetMinutes:o}),h=mi({source:n,model:a});return Sr(sr.usageDaily,{from:e,to:t,...h,...u})}async function M4({day:e,source:t,model:n,timeZone:a,tzOffsetMinutes:s,accessToken:o}={}){if(Sn())return pL({day:e,seed:o});const c=Na({timeZone:a,tzOffsetMinutes:s}),u=mi({source:t,model:n}),h=e?{day:e,...u,...c}:{...u,...c};return Sr(sr.usageHourly,h)}async function I4({months:e,to:t,source:n,model:a,timeZone:s,tzOffsetMinutes:o,accessToken:c}={}){if(Sn())return mL({months:e,to:t,seed:c});const u=Na({timeZone:s,tzOffsetMinutes:o}),h=mi({source:n,model:a});return Sr(sr.usageMonthly,{...e?{months:String(e)}:{},...t?{to:t}:{},...h,...u})}async function N4(e={}){const t=e?.refresh?{refresh:"1"}:void 0;return Sr(sr.usageLimits,t)}async function O4({weeks:e,to:t,weekStartsOn:n,source:a,model:s,timeZone:o,tzOffsetMinutes:c,accessToken:u}={}){if(Sn())return _L({weeks:e,to:t,weekStartsOn:n,seed:u});const h=Na({timeZone:o,tzOffsetMinutes:c}),f=mi({source:a,model:s});return Sr(sr.usageHeatmap,{weeks:String(e),to:t,week_starts_on:n,...f,...h})}const k0=b.createContext(null);function SL(e){if(!e||typeof e!="object")return"";const t=e.user_metadata&&typeof e.user_metadata=="object"?e.user_metadata:{},n=e.profile&&typeof e.profile=="object"?e.profile:{},a=t.full_name||t.name||n.name||t.user_name||t.preferred_username;return typeof a=="string"&&a.trim()?a.trim():typeof e.email=="string"&&e.email.includes("@")?e.email.split("@")[0].trim()||e.email.trim():typeof e.email=="string"?e.email.trim():""}function Xv(e){if(!e||typeof e!="object")return null;const t=e,n=t.session&&typeof t.session=="object"?t.session:null,a=typeof t.accessToken=="string"&&t.accessToken||typeof t.access_token=="string"&&t.access_token||n&&typeof n.accessToken=="string"&&n.accessToken||n&&typeof n.access_token=="string"&&n.access_token||null;return a&&a.length>0?a:null}async function Nh(e,t={}){if(!e)return null;const n=Math.max(0,Math.floor(Number(t.skewMs)||6e4)),a=e.tokenManager,s=()=>a?.getAccessToken?.()??a?.getSession?.()?.accessToken??null;let o=s();if(!o||FR(o,n)){const{data:c}=await e.auth.refreshSession();if(o=s()??Xv(c)??null,!o&&typeof e.auth.getCurrentUser=="function")try{await e.auth.getCurrentUser(),o=s()??Xv(c)??null}catch{}}return o||null}function CL({children:e}){const[t,n]=b.useState(null),[a,s]=b.useState(null),[o,c]=b.useState(!0);b.useEffect(()=>{if(!wf()){n(null),s(null),c(!1);return}n(DR())},[]),b.useEffect(()=>{if(!t)return;let K=!0;return c(!0),(async()=>{try{let{data:$,error:x}=await t.auth.getCurrentUser();if(!K)return;if(!x&&!$?.user){if(await new Promise(X=>setTimeout(X,150)),!K)return;const Y=await t.auth.getCurrentUser();$=Y.data,x=Y.error}if(x){s(null);return}s($?.user??null)}catch{K&&s(null)}finally{K&&c(!1)}})(),()=>{K=!1}},[t]);const u=b.useCallback(async()=>{if(t)try{let{data:K,error:$}=await t.auth.getCurrentUser();if(!$&&!K?.user){await new Promise(Y=>setTimeout(Y,150));const x=await t.auth.getCurrentUser();K=x.data,$=x.error}if($){s(null);return}s(K?.user??null)}catch{s(null)}},[t]),h=b.useCallback(async(K,$)=>{if(!t)return{error:new Error("InsForge client not configured")};const x=typeof window<"u"&&window.webkit?.messageHandlers?.nativeOAuth;if(x){const le=typeof $=="string"&&$.trim()?$.trim():`${window.location.origin}/auth/callback`,oe=await t.auth.signInWithOAuth({provider:K,redirectTo:le,skipBrowserRedirect:!0});if(oe.data?.url){try{const Ae=await Lp();await fetch("/api/auth-bridge/verifier",{method:"PUT",headers:{"Content-Type":"application/json",...Ae},body:JSON.stringify({native:!0})})}catch{}x.postMessage(oe.data.url)}return oe}const Y=typeof $=="string"&&$.trim()?$.trim():typeof window<"u"?`${window.location.origin}/dashboard`:void 0;return await t.auth.signInWithOAuth({provider:K,redirectTo:Y})},[t]),f=b.useCallback(async K=>{if(!t)return{data:null,error:new Error("InsForge client not configured")};const{data:$,error:x}=await t.auth.signInWithPassword(K);return $?.user&&s($.user),{data:$,error:x}},[t]),m=b.useCallback(async K=>{if(!t)return{data:null,error:new Error("InsForge client not configured")};const{data:$,error:x}=await t.auth.signUp(K);return $?.user&&$?.accessToken&&s($.user),{data:$,error:x}},[t]),y=b.useCallback(async()=>t?t.auth.getPublicAuthConfig():{data:null,error:new Error("InsForge client not configured")},[t]),k=b.useCallback(async()=>{t&&(await t.auth.signOut(),r0(),xL(),s(null))},[t]),w=b.useCallback(async()=>Nh(t),[t]),[P,C]=b.useState(null),[S,D]=b.useState(!1),L=b.useMemo(()=>SL(a),[a]);b.useEffect(()=>{if(!a||!t){C(null),D(!1);return}let K=!0;return(async()=>{try{const $=await Nh(t);if(!K||!$){K&&D(!0);return}const x=await Zv({accessToken:$});K&&x?.display_name&&C(x.display_name)}catch{}K&&D(!0)})(),()=>{K=!1}},[a,t]);const R=S?P||L:"",O=b.useCallback(async()=>{if(t)try{const K=await Nh(t);if(!K)return;const $=await Zv({accessToken:K});$?.display_name&&C($.display_name)}catch{}},[t]),W=b.useMemo(()=>!wf()||!t?{enabled:!1,client:null,user:null,signedIn:!1,loading:!1,displayName:"",refreshUser:async()=>{},refreshDisplayName:async()=>{},signInWithOAuth:async()=>({error:new Error("InsForge not configured")}),signInWithPassword:async()=>({data:null,error:new Error("InsForge not configured")}),signUp:async()=>({data:null,error:new Error("InsForge not configured")}),getPublicAuthConfig:async()=>({data:null,error:new Error("InsForge not configured")}),signOut:async()=>{},getAccessToken:async()=>null}:{enabled:!0,client:t,user:a,signedIn:!!a,loading:o,displayName:R,refreshUser:u,refreshDisplayName:O,signInWithOAuth:h,signInWithPassword:f,signUp:m,getPublicAuthConfig:y,signOut:k,getAccessToken:w},[t,a,o,R,u,O,h,f,m,y,k,w]);return N.jsx(k0.Provider,{value:W,children:e})}function Yo(){return b.useContext(k0)}const TL=`key,module,page,component,slot,text,notes,status
38
+ `);const Eh=zn([br,ie(br).min(1,"At least one email is required").max(50,"Maximum 50 recipients allowed")]);T({to:Eh,subject:v().trim().min(1,"Subject is required").max(500,"Subject too long"),html:v().trim().min(1,"HTML content is required"),cc:Eh.optional(),bcc:Eh.optional(),from:v().trim().max(100,"From name too long").optional(),replyTo:v().email("Reply-To must be a valid email").optional()});T({});const WE=nt(["WAITING","UPLOADING","QUEUED","BUILDING","READY","ERROR","CANCELED"]),KE=T({id:v().uuid(),providerDeploymentId:v().nullable(),provider:v(),status:WE,url:v().nullable(),metadata:_t(Jt()).nullable(),createdAt:v().datetime(),updatedAt:v().datetime()}),GE=T({buildCommand:v().nullable().optional(),outputDirectory:v().nullable().optional(),installCommand:v().nullable().optional(),devCommand:v().nullable().optional(),rootDirectory:v().nullable().optional()}),qE=T({key:v(),value:v()});T({id:v().uuid(),uploadUrl:v().url(),uploadFields:_t(v())});T({projectSettings:GE.optional(),envVars:ie(qE).optional(),meta:_t(v()).optional()});T({data:ie(KE),pagination:T({limit:Q(),offset:Q(),total:Q()})});const YE=T({id:v(),key:v(),type:nt(["plain","encrypted","secret","sensitive","system"]),updatedAt:Q().optional()}),ZE=T({id:v(),key:v(),value:v(),type:nt(["plain","encrypted","secret","sensitive","system"]),updatedAt:Q().optional()});T({envVars:ie(YE)});T({envVar:ZE});const XE=T({key:v().trim().min(1,"key is required"),value:v()});T({envVars:ie(XE).min(1)}).superRefine(({envVars:e},t)=>{const n=new Map;e.forEach((a,o)=>{if(n.get(a.key)!==void 0){t.addIssue({code:re.custom,message:"duplicate environment variable key",path:["envVars",o,"key"]});return}n.set(a.key,o)})});T({success:Ye(!0),message:v()});T({success:Ye(!0),message:v(),count:Q().int().positive()});T({success:Ye(!0),message:v()});T({slug:v().trim().min(3,"slug must be at least 3 characters").max(63,"slug must be at most 63 characters").regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/,"slug must be lowercase alphanumeric with hyphens, not starting or ending with hyphen").nullable()});T({success:Be(),slug:v().nullable(),domain:v().nullable()});T({currentDeploymentId:v().uuid().nullable(),defaultDomainUrl:v().nullable(),customDomainUrl:v().nullable()});const QE=T({type:v(),domain:v(),value:v()}),JE=T({domain:v(),apexDomain:v(),verified:Be(),misconfigured:Be(),verification:ie(QE),cnameTarget:v().nullable(),aRecordValue:v().nullable()});T({domain:v().trim().min(1,"Domain is required").regex(/^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}$/i,"Invalid domain format (e.g. myapp.com or www.myapp.com)").refine(e=>!e.toLowerCase().endsWith(".insforge.site"),{message:"Domains ending with .insforge.site are reserved by InsForge"})});T({domains:ie(JE)});const eA=T({id:v().uuid(),name:v(),cronSchedule:v(),functionUrl:v().url(),httpMethod:nt(["GET","POST","PUT","PATCH","DELETE"]),headers:_t(v()).nullable(),body:zn([v(),_t(Jt())]).nullable(),cronJobId:v().nullable(),lastExecutedAt:v().datetime().nullable(),isActive:Be().default(!0),nextRun:v().datetime().nullable(),createdAt:v().datetime(),updatedAt:v().datetime()}),tA=T({id:v().uuid(),scheduleId:v().uuid(),executedAt:v().datetime(),statusCode:Q().int(),success:Be(),durationMs:Q().int(),message:v().nullable()}),Eb=v().refine(e=>{const t=e.split(" ");return t.length===5||t.length===6},{message:'Invalid cron schedule format. Use 5 or 6 parts (e.g., "* * * * *").'});T({name:v().min(3,"Schedule name must be at least 3 characters long"),cronSchedule:Eb,functionUrl:v().url("The function URL must be a valid URL."),httpMethod:nt(["GET","POST","PUT","PATCH","DELETE"]),headers:_t(v()).optional().describe("Header values can reference secrets using ${{secrets.KEY_NAME}} syntax."),body:_t(Jt()).optional().describe("The JSON body to send with the request.")});T({name:v().min(3,"Schedule name must be at least 3 characters long").optional(),cronSchedule:Eb.optional(),functionUrl:v().url("The function URL must be a valid URL.").optional(),httpMethod:nt(["GET","POST","PUT","PATCH","DELETE"]).optional(),headers:_t(v()).optional().describe("Header values can reference secrets using ${{secrets.KEY_NAME}} syntax."),body:_t(Jt()).optional().describe("The JSON body to send with the request."),isActive:Be().optional().describe("Enable or disable the schedule.")});ie(eA);const nA=tA;T({logs:ie(nA),totalCount:Q().int().nonnegative(),limit:Q().int().positive(),offset:Q().int().nonnegative()});T({id:v().uuid(),cronJobId:v(),message:v()});T({id:v().uuid(),cronJobId:v().optional(),message:v()});T({message:v()});var zt={},qi={},Yi={},Zi={},Xi={},Qi={},rA=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},fo=rA();const aA=fo.fetch,iA=fo.fetch.bind(fo),oA=fo.Headers,sA=fo.Request,lA=fo.Response,cA=Object.freeze(Object.defineProperty({__proto__:null,Headers:oA,Request:sA,Response:lA,default:iA,fetch:aA},Symbol.toStringTag,{value:"Module"})),uA=PS(cA);var pc={},Dv;function Ab(){if(Dv)return pc;Dv=1,Object.defineProperty(pc,"__esModule",{value:!0});class e extends Error{constructor(n){super(n.message),this.name="PostgrestError",this.details=n.details,this.hint=n.hint,this.code=n.code}}return pc.default=e,pc}var Mv;function Rb(){if(Mv)return Qi;Mv=1;var e=Qi&&Qi.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Qi,"__esModule",{value:!0});const t=e(uA),n=e(Ab());class a{constructor(s){var c,u;this.shouldThrowOnError=!1,this.method=s.method,this.url=s.url,this.headers=new Headers(s.headers),this.schema=s.schema,this.body=s.body,this.shouldThrowOnError=(c=s.shouldThrowOnError)!==null&&c!==void 0?c:!1,this.signal=s.signal,this.isMaybeSingle=(u=s.isMaybeSingle)!==null&&u!==void 0?u:!1,s.fetch?this.fetch=s.fetch:typeof fetch>"u"?this.fetch=t.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(s,c){return this.headers=new Headers(this.headers),this.headers.set(s,c),this}then(s,c){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const u=this.fetch;let h=u(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async f=>{var m,y,k,w;let x=null,C=null,S=null,D=f.status,L=f.statusText;if(f.ok){if(this.method!=="HEAD"){const W=await f.text();W===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((m=this.headers.get("Accept"))===null||m===void 0)&&m.includes("application/vnd.pgrst.plan+text"))?C=W:C=JSON.parse(W))}const O=(y=this.headers.get("Prefer"))===null||y===void 0?void 0:y.match(/count=(exact|planned|estimated)/),G=(k=f.headers.get("content-range"))===null||k===void 0?void 0:k.split("/");O&&G&&G.length>1&&(S=parseInt(G[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(C)&&(C.length>1?(x={code:"PGRST116",details:`Results contain ${C.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},C=null,S=null,D=406,L="Not Acceptable"):C.length===1?C=C[0]:C=null)}else{const O=await f.text();try{x=JSON.parse(O),Array.isArray(x)&&f.status===404&&(C=[],x=null,D=200,L="OK")}catch{f.status===404&&O===""?(D=204,L="No Content"):x={message:O}}if(x&&this.isMaybeSingle&&(!((w=x?.details)===null||w===void 0)&&w.includes("0 rows"))&&(x=null,D=200,L="OK"),x&&this.shouldThrowOnError)throw new n.default(x)}return{error:x,data:C,count:S,status:D,statusText:L}});return this.shouldThrowOnError||(h=h.catch(f=>{var m,y,k;return{error:{message:`${(m=f?.name)!==null&&m!==void 0?m:"FetchError"}: ${f?.message}`,details:`${(y=f?.stack)!==null&&y!==void 0?y:""}`,hint:"",code:`${(k=f?.code)!==null&&k!==void 0?k:""}`},data:null,count:null,status:0,statusText:""}})),h.then(s,c)}returns(){return this}overrideTypes(){return this}}return Qi.default=a,Qi}var Iv;function Lb(){if(Iv)return Xi;Iv=1;var e=Xi&&Xi.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Xi,"__esModule",{value:!0});const t=e(Rb());class n extends t.default{select(o){let s=!1;const c=(o??"*").split("").map(u=>/\s/.test(u)&&!s?"":(u==='"'&&(s=!s),u)).join("");return this.url.searchParams.set("select",c),this.headers.append("Prefer","return=representation"),this}order(o,{ascending:s=!0,nullsFirst:c,foreignTable:u,referencedTable:h=u}={}){const f=h?`${h}.order`:"order",m=this.url.searchParams.get(f);return this.url.searchParams.set(f,`${m?`${m},`:""}${o}.${s?"asc":"desc"}${c===void 0?"":c?".nullsfirst":".nullslast"}`),this}limit(o,{foreignTable:s,referencedTable:c=s}={}){const u=typeof c>"u"?"limit":`${c}.limit`;return this.url.searchParams.set(u,`${o}`),this}range(o,s,{foreignTable:c,referencedTable:u=c}={}){const h=typeof u>"u"?"offset":`${u}.offset`,f=typeof u>"u"?"limit":`${u}.limit`;return this.url.searchParams.set(h,`${o}`),this.url.searchParams.set(f,`${s-o+1}`),this}abortSignal(o){return this.signal=o,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:o=!1,verbose:s=!1,settings:c=!1,buffers:u=!1,wal:h=!1,format:f="text"}={}){var m;const y=[o?"analyze":null,s?"verbose":null,c?"settings":null,u?"buffers":null,h?"wal":null].filter(Boolean).join("|"),k=(m=this.headers.get("Accept"))!==null&&m!==void 0?m:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${f}; for="${k}"; options=${y};`),f==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(o){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${o}`),this}}return Xi.default=n,Xi}var Nv;function gp(){if(Nv)return Zi;Nv=1;var e=Zi&&Zi.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Zi,"__esModule",{value:!0});const t=e(Lb());class n extends t.default{eq(o,s){return this.url.searchParams.append(o,`eq.${s}`),this}neq(o,s){return this.url.searchParams.append(o,`neq.${s}`),this}gt(o,s){return this.url.searchParams.append(o,`gt.${s}`),this}gte(o,s){return this.url.searchParams.append(o,`gte.${s}`),this}lt(o,s){return this.url.searchParams.append(o,`lt.${s}`),this}lte(o,s){return this.url.searchParams.append(o,`lte.${s}`),this}like(o,s){return this.url.searchParams.append(o,`like.${s}`),this}likeAllOf(o,s){return this.url.searchParams.append(o,`like(all).{${s.join(",")}}`),this}likeAnyOf(o,s){return this.url.searchParams.append(o,`like(any).{${s.join(",")}}`),this}ilike(o,s){return this.url.searchParams.append(o,`ilike.${s}`),this}ilikeAllOf(o,s){return this.url.searchParams.append(o,`ilike(all).{${s.join(",")}}`),this}ilikeAnyOf(o,s){return this.url.searchParams.append(o,`ilike(any).{${s.join(",")}}`),this}is(o,s){return this.url.searchParams.append(o,`is.${s}`),this}in(o,s){const c=Array.from(new Set(s)).map(u=>typeof u=="string"&&new RegExp("[,()]").test(u)?`"${u}"`:`${u}`).join(",");return this.url.searchParams.append(o,`in.(${c})`),this}contains(o,s){return typeof s=="string"?this.url.searchParams.append(o,`cs.${s}`):Array.isArray(s)?this.url.searchParams.append(o,`cs.{${s.join(",")}}`):this.url.searchParams.append(o,`cs.${JSON.stringify(s)}`),this}containedBy(o,s){return typeof s=="string"?this.url.searchParams.append(o,`cd.${s}`):Array.isArray(s)?this.url.searchParams.append(o,`cd.{${s.join(",")}}`):this.url.searchParams.append(o,`cd.${JSON.stringify(s)}`),this}rangeGt(o,s){return this.url.searchParams.append(o,`sr.${s}`),this}rangeGte(o,s){return this.url.searchParams.append(o,`nxl.${s}`),this}rangeLt(o,s){return this.url.searchParams.append(o,`sl.${s}`),this}rangeLte(o,s){return this.url.searchParams.append(o,`nxr.${s}`),this}rangeAdjacent(o,s){return this.url.searchParams.append(o,`adj.${s}`),this}overlaps(o,s){return typeof s=="string"?this.url.searchParams.append(o,`ov.${s}`):this.url.searchParams.append(o,`ov.{${s.join(",")}}`),this}textSearch(o,s,{config:c,type:u}={}){let h="";u==="plain"?h="pl":u==="phrase"?h="ph":u==="websearch"&&(h="w");const f=c===void 0?"":`(${c})`;return this.url.searchParams.append(o,`${h}fts${f}.${s}`),this}match(o){return Object.entries(o).forEach(([s,c])=>{this.url.searchParams.append(s,`eq.${c}`)}),this}not(o,s,c){return this.url.searchParams.append(o,`not.${s}.${c}`),this}or(o,{foreignTable:s,referencedTable:c=s}={}){const u=c?`${c}.or`:"or";return this.url.searchParams.append(u,`(${o})`),this}filter(o,s,c){return this.url.searchParams.append(o,`${s}.${c}`),this}}return Zi.default=n,Zi}var Ov;function Db(){if(Ov)return Yi;Ov=1;var e=Yi&&Yi.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Yi,"__esModule",{value:!0});const t=e(gp());class n{constructor(o,{headers:s={},schema:c,fetch:u}){this.url=o,this.headers=new Headers(s),this.schema=c,this.fetch=u}select(o,{head:s=!1,count:c}={}){const u=s?"HEAD":"GET";let h=!1;const f=(o??"*").split("").map(m=>/\s/.test(m)&&!h?"":(m==='"'&&(h=!h),m)).join("");return this.url.searchParams.set("select",f),c&&this.headers.append("Prefer",`count=${c}`),new t.default({method:u,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(o,{count:s,defaultToNull:c=!0}={}){var u;const h="POST";if(s&&this.headers.append("Prefer",`count=${s}`),c||this.headers.append("Prefer","missing=default"),Array.isArray(o)){const f=o.reduce((m,y)=>m.concat(Object.keys(y)),[]);if(f.length>0){const m=[...new Set(f)].map(y=>`"${y}"`);this.url.searchParams.set("columns",m.join(","))}}return new t.default({method:h,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}upsert(o,{onConflict:s,ignoreDuplicates:c=!1,count:u,defaultToNull:h=!0}={}){var f;const m="POST";if(this.headers.append("Prefer",`resolution=${c?"ignore":"merge"}-duplicates`),s!==void 0&&this.url.searchParams.set("on_conflict",s),u&&this.headers.append("Prefer",`count=${u}`),h||this.headers.append("Prefer","missing=default"),Array.isArray(o)){const y=o.reduce((k,w)=>k.concat(Object.keys(w)),[]);if(y.length>0){const k=[...new Set(y)].map(w=>`"${w}"`);this.url.searchParams.set("columns",k.join(","))}}return new t.default({method:m,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(f=this.fetch)!==null&&f!==void 0?f:fetch})}update(o,{count:s}={}){var c;const u="PATCH";return s&&this.headers.append("Prefer",`count=${s}`),new t.default({method:u,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch})}delete({count:o}={}){var s;const c="DELETE";return o&&this.headers.append("Prefer",`count=${o}`),new t.default({method:c,url:this.url,headers:this.headers,schema:this.schema,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}}return Yi.default=n,Yi}var jv;function dA(){if(jv)return qi;jv=1;var e=qi&&qi.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(qi,"__esModule",{value:!0});const t=e(Db()),n=e(gp());class a{constructor(s,{headers:c={},schema:u,fetch:h}={}){this.url=s,this.headers=new Headers(c),this.schemaName=u,this.fetch=h}from(s){const c=new URL(`${this.url}/${s}`);return new t.default(c,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(s){return new a(this.url,{headers:this.headers,schema:s,fetch:this.fetch})}rpc(s,c={},{head:u=!1,get:h=!1,count:f}={}){var m;let y;const k=new URL(`${this.url}/rpc/${s}`);let w;u||h?(y=u?"HEAD":"GET",Object.entries(c).filter(([C,S])=>S!==void 0).map(([C,S])=>[C,Array.isArray(S)?`{${S.join(",")}}`:`${S}`]).forEach(([C,S])=>{k.searchParams.append(C,S)})):(y="POST",w=c);const x=new Headers(this.headers);return f&&x.set("Prefer",`count=${f}`),new n.default({method:y,url:k,headers:x,schema:this.schemaName,body:w,fetch:(m=this.fetch)!==null&&m!==void 0?m:fetch})}}return qi.default=a,qi}var Uv;function hA(){if(Uv)return zt;Uv=1;var e=zt&&zt.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(zt,"__esModule",{value:!0}),zt.PostgrestError=zt.PostgrestBuilder=zt.PostgrestTransformBuilder=zt.PostgrestFilterBuilder=zt.PostgrestQueryBuilder=zt.PostgrestClient=void 0;const t=e(dA());zt.PostgrestClient=t.default;const n=e(Db());zt.PostgrestQueryBuilder=n.default;const a=e(gp());zt.PostgrestFilterBuilder=a.default;const o=e(Lb());zt.PostgrestTransformBuilder=o.default;const s=e(Rb());zt.PostgrestBuilder=s.default;const c=e(Ab());return zt.PostgrestError=c.default,zt.default={PostgrestClient:t.default,PostgrestQueryBuilder:n.default,PostgrestFilterBuilder:a.default,PostgrestTransformBuilder:o.default,PostgrestBuilder:s.default,PostgrestError:c.default},zt}var fA=hA();const pA=L_(fA),{PostgrestClient:mA,PostgrestQueryBuilder:i4,PostgrestFilterBuilder:o4,PostgrestTransformBuilder:s4,PostgrestBuilder:l4,PostgrestError:c4}=pA,wr=Object.create(null);wr.open="0";wr.close="1";wr.ping="2";wr.pong="3";wr.message="4";wr.upgrade="5";wr.noop="6";const Rc=Object.create(null);Object.keys(wr).forEach(e=>{Rc[wr[e]]=e});const mf={type:"error",data:"parser error"},Mb=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ib=typeof ArrayBuffer=="function",Nb=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,yp=({type:e,data:t},n,a)=>Mb&&t instanceof Blob?n?a(t):Bv(t,a):Ib&&(t instanceof ArrayBuffer||Nb(t))?n?a(t):Bv(new Blob([t]),a):a(wr[e]+(t||"")),Bv=(e,t)=>{const n=new FileReader;return n.onload=function(){const a=n.result.split(",")[1];t("b"+(a||""))},n.readAsDataURL(e)};function Fv(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Ah;function gA(e,t){if(Mb&&e.data instanceof Blob)return e.data.arrayBuffer().then(Fv).then(t);if(Ib&&(e.data instanceof ArrayBuffer||Nb(e.data)))return t(Fv(e.data));yp(e,!1,n=>{Ah||(Ah=new TextEncoder),t(Ah.encode(n))})}const Vv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ks=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Vv.length;e++)ks[Vv.charCodeAt(e)]=e;const yA=e=>{let t=e.length*.75,n=e.length,a,o=0,s,c,u,h;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),m=new Uint8Array(f);for(a=0;a<n;a+=4)s=ks[e.charCodeAt(a)],c=ks[e.charCodeAt(a+1)],u=ks[e.charCodeAt(a+2)],h=ks[e.charCodeAt(a+3)],m[o++]=s<<2|c>>4,m[o++]=(c&15)<<4|u>>2,m[o++]=(u&3)<<6|h&63;return f},vA=typeof ArrayBuffer=="function",vp=(e,t)=>{if(typeof e!="string")return{type:"message",data:Ob(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:kA(e.substring(1),t)}:Rc[n]?e.length>1?{type:Rc[n],data:e.substring(1)}:{type:Rc[n]}:mf},kA=(e,t)=>{if(vA){const n=yA(e);return Ob(n,t)}else return{base64:!0,data:e}},Ob=(e,t)=>t==="blob"?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,jb="",_A=(e,t)=>{const n=e.length,a=new Array(n);let o=0;e.forEach((s,c)=>{yp(s,!1,u=>{a[c]=u,++o===n&&t(a.join(jb))})})},bA=(e,t)=>{const n=e.split(jb),a=[];for(let o=0;o<n.length;o++){const s=vp(n[o],t);if(a.push(s),s.type==="error")break}return a};function wA(){return new TransformStream({transform(e,t){gA(e,n=>{const a=n.length;let o;if(a<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,a);else if(a<65536){o=new Uint8Array(3);const s=new DataView(o.buffer);s.setUint8(0,126),s.setUint16(1,a)}else{o=new Uint8Array(9);const s=new DataView(o.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(a))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let Rh;function mc(e){return e.reduce((t,n)=>t+n.length,0)}function gc(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let a=0;for(let o=0;o<t;o++)n[o]=e[0][a++],a===e[0].length&&(e.shift(),a=0);return e.length&&a<e[0].length&&(e[0]=e[0].slice(a)),n}function xA(e,t){Rh||(Rh=new TextDecoder);const n=[];let a=0,o=-1,s=!1;return new TransformStream({transform(c,u){for(n.push(c);;){if(a===0){if(mc(n)<1)break;const h=gc(n,1);s=(h[0]&128)===128,o=h[0]&127,o<126?a=3:o===126?a=1:a=2}else if(a===1){if(mc(n)<2)break;const h=gc(n,2);o=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),a=3}else if(a===2){if(mc(n)<8)break;const h=gc(n,8),f=new DataView(h.buffer,h.byteOffset,h.length),m=f.getUint32(0);if(m>Math.pow(2,21)-1){u.enqueue(mf);break}o=m*Math.pow(2,32)+f.getUint32(4),a=3}else{if(mc(n)<o)break;const h=gc(n,o);u.enqueue(vp(s?h:Rh.decode(h),t)),a=0}if(o===0||o>e){u.enqueue(mf);break}}}})}const Ub=4;function Dt(e){if(e)return PA(e)}function PA(e){for(var t in Dt.prototype)e[t]=Dt.prototype[t];return e}Dt.prototype.on=Dt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Dt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Dt.prototype.off=Dt.prototype.removeListener=Dt.prototype.removeAllListeners=Dt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var a,o=0;o<n.length;o++)if(a=n[o],a===t||a.fn===t){n.splice(o,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Dt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],a=1;a<arguments.length;a++)t[a-1]=arguments[a];if(n){n=n.slice(0);for(var a=0,o=n.length;a<o;++a)n[a].apply(this,t)}return this};Dt.prototype.emitReserved=Dt.prototype.emit;Dt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Dt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Tu=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Nn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),SA="arraybuffer";function Bb(e,...t){return t.reduce((n,a)=>(e.hasOwnProperty(a)&&(n[a]=e[a]),n),{})}const CA=Nn.setTimeout,TA=Nn.clearTimeout;function Eu(e,t){t.useNativeTimers?(e.setTimeoutFn=CA.bind(Nn),e.clearTimeoutFn=TA.bind(Nn)):(e.setTimeoutFn=Nn.setTimeout.bind(Nn),e.clearTimeoutFn=Nn.clearTimeout.bind(Nn))}const EA=1.33;function AA(e){return typeof e=="string"?RA(e):Math.ceil((e.byteLength||e.size)*EA)}function RA(e){let t=0,n=0;for(let a=0,o=e.length;a<o;a++)t=e.charCodeAt(a),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(a++,n+=4);return n}function Fb(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function LA(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function DA(e){let t={},n=e.split("&");for(let a=0,o=n.length;a<o;a++){let s=n[a].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class MA extends Error{constructor(t,n,a){super(t),this.description=n,this.context=a,this.type="TransportError"}}class kp extends Dt{constructor(t){super(),this.writable=!1,Eu(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,a){return super.emitReserved("error",new MA(t,n,a)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=vp(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=LA(t);return n.length?"?"+n:""}}class IA extends kp{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let a=0;this._polling&&(a++,this.once("pollComplete",function(){--a||n()})),this.writable||(a++,this.once("drain",function(){--a||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=a=>{if(this.readyState==="opening"&&a.type==="open"&&this.onOpen(),a.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(a)};bA(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,_A(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Fb()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Vb=!1;try{Vb=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const NA=Vb;function OA(){}class jA extends IA{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let a=location.port;a||(a=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||a!==t.port}}doWrite(t,n){const a=this.request({method:"POST",data:t});a.on("success",n),a.on("error",(o,s)=>{this.onError("xhr post error",o,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,a)=>{this.onError("xhr poll error",n,a)}),this.pollXhr=t}}let lo=class Lc extends Dt{constructor(t,n,a){super(),this.createRequest=t,Eu(this,a),this._opts=a,this._method=a.method||"GET",this._uri=n,this._data=a.data!==void 0?a.data:null,this._create()}_create(){var t;const n=Bb(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const a=this._xhr=this.createRequest(n);try{a.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){a.setDisableHeaderCheck&&a.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&a.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{a.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{a.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(a),"withCredentials"in a&&(a.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(a.timeout=this._opts.requestTimeout),a.onreadystatechange=()=>{var o;a.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(a.getResponseHeader("set-cookie"))),a.readyState===4&&(a.status===200||a.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof a.status=="number"?a.status:0)},0))},a.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=Lc.requestsCount++,Lc.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=OA,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Lc.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};lo.requestsCount=0;lo.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",zv);else if(typeof addEventListener=="function"){const e="onpagehide"in Nn?"pagehide":"unload";addEventListener(e,zv,!1)}}function zv(){for(let e in lo.requests)lo.requests.hasOwnProperty(e)&&lo.requests[e].abort()}const UA=(function(){const e=zb({xdomain:!1});return e&&e.responseType!==null})();class BA extends jA{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=UA&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new lo(zb,this.uri(),t)}}function zb(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||NA))return new XMLHttpRequest}catch{}if(!t)try{return new Nn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const $b=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class FA extends kp{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,a=$b?{}:Bb(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(a.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,a)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const a=t[n],o=n===t.length-1;yp(a,this.supportsBinary,s=>{try{this.doWrite(a,s)}catch{}o&&Tu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Fb()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Lh=Nn.WebSocket||Nn.MozWebSocket;class VA extends FA{createSocket(t,n,a){return $b?new Lh(t,n,a):n?new Lh(t,n):new Lh(t)}doWrite(t,n){this.ws.send(n)}}class zA extends kp{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=xA(Number.MAX_SAFE_INTEGER,this.socket.binaryType),a=t.readable.pipeThrough(n).getReader(),o=wA();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const s=()=>{a.read().then(({done:u,value:h})=>{u||(this.onPacket(h),s())}).catch(u=>{})};s();const c={type:"open"};this.query.sid&&(c.data=`{"sid":"${this.query.sid}"}`),this._writer.write(c).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const a=t[n],o=n===t.length-1;this._writer.write(a).then(()=>{o&&Tu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const $A={websocket:VA,webtransport:zA,polling:BA},HA=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,WA=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function gf(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),a=e.indexOf("]");n!=-1&&a!=-1&&(e=e.substring(0,n)+e.substring(n,a).replace(/:/g,";")+e.substring(a,e.length));let o=HA.exec(e||""),s={},c=14;for(;c--;)s[WA[c]]=o[c]||"";return n!=-1&&a!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=KA(s,s.path),s.queryKey=GA(s,s.query),s}function KA(e,t){const n=/\/{2,9}/g,a=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&a.splice(0,1),t.slice(-1)=="/"&&a.splice(a.length-1,1),a}function GA(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(a,o,s){o&&(n[o]=s)}),n}const yf=typeof addEventListener=="function"&&typeof removeEventListener=="function",Dc=[];yf&&addEventListener("offline",()=>{Dc.forEach(e=>e())},!1);class Da extends Dt{constructor(t,n){if(super(),this.binaryType=SA,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const a=gf(t);n.hostname=a.host,n.secure=a.protocol==="https"||a.protocol==="wss",n.port=a.port,a.query&&(n.query=a.query)}else n.host&&(n.hostname=gf(n.host).host);Eu(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(a=>{const o=a.prototype.name;this.transports.push(o),this._transportsByName[o]=a}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=DA(this.opts.query)),yf&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Dc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Ub,n.transport=t,this.id&&(n.sid=this.id);const a=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](a)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Da.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Da.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let a=0;a<this.writeBuffer.length;a++){const o=this.writeBuffer[a].data;if(o&&(n+=AA(o)),a>0&&n>this._maxPayload)return this.writeBuffer.slice(0,a);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Tu(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,a){return this._sendPacket("message",t,n,a),this}send(t,n,a){return this._sendPacket("message",t,n,a),this}_sendPacket(t,n,a,o){if(typeof n=="function"&&(o=n,n=void 0),typeof a=="function"&&(o=a,a=null),this.readyState==="closing"||this.readyState==="closed")return;a=a||{},a.compress=a.compress!==!1;const s={type:t,data:n,options:a};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),o&&this.once("flush",o),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},a=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?a():t()}):this.upgrading?a():t()),this}_onError(t){if(Da.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),yf&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const a=Dc.indexOf(this._offlineEventListener);a!==-1&&Dc.splice(a,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Da.protocol=Ub;class qA extends Da{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),a=!1;Da.priorWebsocketSuccess=!1;const o=()=>{a||(n.send([{type:"ping",data:"probe"}]),n.once("packet",y=>{if(!a)if(y.type==="pong"&&y.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Da.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{a||this.readyState!=="closed"&&(m(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const k=new Error("probe error");k.transport=n.name,this.emitReserved("upgradeError",k)}}))};function s(){a||(a=!0,m(),n.close(),n=null)}const c=y=>{const k=new Error("probe error: "+y);k.transport=n.name,s(),this.emitReserved("upgradeError",k)};function u(){c("transport closed")}function h(){c("socket closed")}function f(y){n&&y.name!==n.name&&s()}const m=()=>{n.removeListener("open",o),n.removeListener("error",c),n.removeListener("close",u),this.off("close",h),this.off("upgrading",f)};n.once("open",o),n.once("error",c),n.once("close",u),this.once("close",h),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{a||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let a=0;a<t.length;a++)~this.transports.indexOf(t[a])&&n.push(t[a]);return n}}let YA=class extends qA{constructor(t,n={}){const a=typeof t=="object"?t:n;(!a.transports||a.transports&&typeof a.transports[0]=="string")&&(a.transports=(a.transports||["polling","websocket","webtransport"]).map(o=>$A[o]).filter(o=>!!o)),super(t,a)}};function ZA(e,t="",n){let a=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),a=gf(e)),a.port||(/^(http|ws)$/.test(a.protocol)?a.port="80":/^(http|ws)s$/.test(a.protocol)&&(a.port="443")),a.path=a.path||"/";const s=a.host.indexOf(":")!==-1?"["+a.host+"]":a.host;return a.id=a.protocol+"://"+s+":"+a.port+t,a.href=a.protocol+"://"+s+(n&&n.port===a.port?"":":"+a.port),a}const XA=typeof ArrayBuffer=="function",QA=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Hb=Object.prototype.toString,JA=typeof Blob=="function"||typeof Blob<"u"&&Hb.call(Blob)==="[object BlobConstructor]",eR=typeof File=="function"||typeof File<"u"&&Hb.call(File)==="[object FileConstructor]";function _p(e){return XA&&(e instanceof ArrayBuffer||QA(e))||JA&&e instanceof Blob||eR&&e instanceof File}function Mc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,a=e.length;n<a;n++)if(Mc(e[n]))return!0;return!1}if(_p(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Mc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Mc(e[n]))return!0;return!1}function tR(e){const t=[],n=e.data,a=e;return a.data=vf(n,t),a.attachments=t.length,{packet:a,buffers:t}}function vf(e,t){if(!e)return e;if(_p(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let a=0;a<e.length;a++)n[a]=vf(e[a],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=vf(e[a],t));return n}return e}function nR(e,t){return e.data=kf(e.data,t),delete e.attachments,e}function kf(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=kf(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=kf(e[n],t));return e}const rR=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var tt;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(tt||(tt={}));class aR{constructor(t){this.replacer=t}encode(t){return(t.type===tt.EVENT||t.type===tt.ACK)&&Mc(t)?this.encodeAsBinary({type:t.type===tt.EVENT?tt.BINARY_EVENT:tt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===tt.BINARY_EVENT||t.type===tt.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=tR(t),a=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(a),o}}class bp extends Dt{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const a=n.type===tt.BINARY_EVENT;a||n.type===tt.BINARY_ACK?(n.type=a?tt.EVENT:tt.ACK,this.reconstructor=new iR(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(_p(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const a={type:Number(t.charAt(0))};if(tt[a.type]===void 0)throw new Error("unknown packet type "+a.type);if(a.type===tt.BINARY_EVENT||a.type===tt.BINARY_ACK){const s=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const c=t.substring(s,n);if(c!=Number(c)||t.charAt(n)!=="-")throw new Error("Illegal attachments");const u=Number(c);if(!oR(u)||u<0)throw new Error("Illegal attachments");if(u>this.opts.maxAttachments)throw new Error("too many attachments");a.attachments=u}if(t.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););a.nsp=t.substring(s,n)}else a.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const s=n+1;for(;++n;){const c=t.charAt(n);if(c==null||Number(c)!=c){--n;break}if(n===t.length)break}a.id=Number(t.substring(s,n+1))}if(t.charAt(++n)){const s=this.tryParse(t.substr(n));if(bp.isPayloadValid(a.type,s))a.data=s;else throw new Error("invalid payload")}return a}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case tt.CONNECT:return $v(n);case tt.DISCONNECT:return n===void 0;case tt.CONNECT_ERROR:return typeof n=="string"||$v(n);case tt.EVENT:case tt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&rR.indexOf(n[0])===-1);case tt.ACK:case tt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class iR{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=nR(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const oR=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function $v(e){return Object.prototype.toString.call(e)==="[object Object]"}const sR=Object.freeze(Object.defineProperty({__proto__:null,Decoder:bp,Encoder:aR,get PacketType(){return tt}},Symbol.toStringTag,{value:"Module"}));function rr(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const lR=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Wb extends Dt{constructor(t,n,a){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,a&&a.auth&&(this.auth=a.auth),this._opts=Object.assign({},a),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[rr(t,"open",this.onopen.bind(this)),rr(t,"packet",this.onpacket.bind(this)),rr(t,"error",this.onerror.bind(this)),rr(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var a,o,s;if(lR.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const c={type:tt.EVENT,data:n};if(c.options={},c.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const m=this.ids++,y=n.pop();this._registerAckCallback(m,y),c.id=m}const u=(o=(a=this.io.engine)===null||a===void 0?void 0:a.transport)===null||o===void 0?void 0:o.writable,h=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!u||(h?(this.notifyOutgoingListeners(c),this.packet(c)):this.sendBuffer.push(c)),this.flags={},this}_registerAckCallback(t,n){var a;const o=(a=this.flags.timeout)!==null&&a!==void 0?a:this._opts.ackTimeout;if(o===void 0){this.acks[t]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let u=0;u<this.sendBuffer.length;u++)this.sendBuffer[u].id===t&&this.sendBuffer.splice(u,1);n.call(this,new Error("operation has timed out"))},o),c=(...u)=>{this.io.clearTimeoutFn(s),n.apply(this,u)};c.withError=!0,this.acks[t]=c}emitWithAck(t,...n){return new Promise((a,o)=>{const s=(c,u)=>c?o(c):a(u);s.withError=!0,n.push(s),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const a={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...s)=>(this._queue[0],o!==null?a.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...s)),a.pending=!1,this._drainQueue())),this._queue.push(a),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:tt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(a=>String(a.id)===t)){const a=this.acks[t];delete this.acks[t],a.withError&&a.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case tt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case tt.EVENT:case tt.BINARY_EVENT:this.onevent(t);break;case tt.ACK:case tt.BINARY_ACK:this.onack(t);break;case tt.DISCONNECT:this.ondisconnect();break;case tt.CONNECT_ERROR:this.destroy();const a=new Error(t.data.message);a.data=t.data.data,this.emitReserved("connect_error",a);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const a of n)a.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let a=!1;return function(...o){a||(a=!0,n.packet({type:tt.ACK,id:t,data:o}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:tt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let a=0;a<n.length;a++)if(t===n[a])return n.splice(a,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let a=0;a<n.length;a++)if(t===n[a])return n.splice(a,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const a of n)a.apply(this,t.data)}}}function ko(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}ko.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};ko.prototype.reset=function(){this.attempts=0};ko.prototype.setMin=function(e){this.ms=e};ko.prototype.setMax=function(e){this.max=e};ko.prototype.setJitter=function(e){this.jitter=e};class _f extends Dt{constructor(t,n){var a;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Eu(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((a=n.randomizationFactor)!==null&&a!==void 0?a:.5),this.backoff=new ko({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||sR;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new YA(this.uri,this.opts);const n=this.engine,a=this;this._readyState="opening",this.skipReconnect=!1;const o=rr(n,"open",function(){a.onopen(),t&&t()}),s=u=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",u),t?t(u):this.maybeReconnectOnOpen()},c=rr(n,"error",s);if(this._timeout!==!1){const u=this._timeout,h=this.setTimeoutFn(()=>{o(),s(new Error("timeout")),n.close()},u);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(o),this.subs.push(c),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(rr(t,"ping",this.onping.bind(this)),rr(t,"data",this.ondata.bind(this)),rr(t,"error",this.onerror.bind(this)),rr(t,"close",this.onclose.bind(this)),rr(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Tu(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let a=this.nsps[t];return a?this._autoConnect&&!a.active&&a.connect():(a=new Wb(this,t,n),this.nsps[t]=a),a}_destroy(t){const n=Object.keys(this.nsps);for(const a of n)if(this.nsps[a].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let a=0;a<n.length;a++)this.engine.write(n[a],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var a;this.cleanup(),(a=this.engine)===null||a===void 0||a.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const a=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},n);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const fs={};function Ic(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=ZA(e,t.path||"/socket.io"),a=n.source,o=n.id,s=n.path,c=fs[o]&&s in fs[o].nsps,u=t.forceNew||t["force new connection"]||t.multiplex===!1||c;let h;return u?h=new _f(a,t):(fs[o]||(fs[o]=new _f(a,t)),h=fs[o]),n.query&&!t.query&&(t.query=n.queryKey),h.socket(n.path,t)}Object.assign(Ic,{Manager:_f,Socket:Wb,io:Ic,connect:Ic});var We=class Kb extends Error{constructor(t,n,a,o){super(t),this.name="InsForgeError",this.statusCode=n,this.error=a,this.nextActions=o}static fromApiError(t){return new Kb(t.message,t.statusCode,t.error,t.nextActions)}},cR=["authorization","x-api-key","cookie","set-cookie"],uR=["password","token","accesstoken","refreshtoken","authorization","secret","apikey","api_key","email","ssn","creditcard","credit_card"];function dR(e){const t={};for(const[n,a]of Object.entries(e))cR.includes(n.toLowerCase())?t[n]="***REDACTED***":t[n]=a;return t}function ws(e){if(e==null)return e;if(typeof e=="string")try{const t=JSON.parse(e);return ws(t)}catch{return e}if(Array.isArray(e))return e.map(ws);if(typeof e=="object"){const t={};for(const[n,a]of Object.entries(e))uR.includes(n.toLowerCase().replace(/[-_]/g,""))?t[n]="***REDACTED***":t[n]=ws(a);return t}return e}function Hv(e){if(e==null)return"";if(typeof e=="string")try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}if(typeof FormData<"u"&&e instanceof FormData)return"[FormData]";try{return JSON.stringify(e,null,2)}catch{return"[Unserializable body]"}}var Gb=class{constructor(e){typeof e=="function"?(this.enabled=!0,this.customLog=e):(this.enabled=!!e,this.customLog=null)}log(e,...t){if(!this.enabled)return;const n=`[InsForge Debug] ${e}`;this.customLog?this.customLog(n,...t):console.log(n,...t)}warn(e,...t){if(!this.enabled)return;const n=`[InsForge Debug] ${e}`;this.customLog?this.customLog(n,...t):console.warn(n,...t)}error(e,...t){if(!this.enabled)return;const n=`[InsForge Debug] ${e}`;this.customLog?this.customLog(n,...t):console.error(n,...t)}logRequest(e,t,n,a){if(!this.enabled)return;const o=[`→ ${e} ${t}`];n&&Object.keys(n).length>0&&o.push(` Headers: ${JSON.stringify(dR(n))}`);const s=Hv(ws(a));if(s){const c=s.length>1e3?s.slice(0,1e3)+"... [truncated]":s;o.push(` Body: ${c}`)}this.log(o.join(`
39
+ `))}logResponse(e,t,n,a,o){if(!this.enabled)return;const s=[`← ${e} ${t} ${n} (${a}ms)`],c=Hv(ws(o));if(c){const u=c.length>1e3?c.slice(0,1e3)+"... [truncated]":c;s.push(` Body: ${u}`)}n>=400?this.error(s.join(`
40
+ `)):this.log(s.join(`
41
+ `))}},wp="insforge_csrf_token";function qb(){if(typeof document>"u")return null;const e=document.cookie.split(";").find(t=>t.trim().startsWith(`${wp}=`));return e&&e.split("=")[1]||null}function Yb(e){if(typeof document>"u")return;const t=10080*60,n=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=`${wp}=${encodeURIComponent(e)}; path=/; max-age=${t}; SameSite=Lax${n}`}function Zb(){if(typeof document>"u")return;const e=typeof window<"u"&&window.location.protocol==="https:"?"; Secure":"";document.cookie=`${wp}=; path=/; max-age=0; SameSite=Lax${e}`}var Xb=class{constructor(){this.accessToken=null,this.user=null,this.onTokenChange=null}saveSession(e){const t=e.accessToken!==this.accessToken;this.accessToken=e.accessToken,this.user=e.user,t&&this.onTokenChange&&this.onTokenChange()}getSession(){return!this.accessToken||!this.user?null:{accessToken:this.accessToken,user:this.user}}getAccessToken(){return this.accessToken}setAccessToken(e){const t=e!==this.accessToken;this.accessToken=e,t&&this.onTokenChange&&this.onTokenChange()}getUser(){return this.user}setUser(e){this.user=e}clearSession(){const e=this.accessToken!==null;this.accessToken=null,this.user=null,e&&this.onTokenChange&&this.onTokenChange()}},hR=new Set([500,502,503,504]),fR=new Set(["GET","HEAD","PUT","DELETE","OPTIONS"]),pR=class{constructor(e,t,n){if(this.userToken=null,this.autoRefreshToken=!0,this.isRefreshing=!1,this.refreshPromise=null,this.refreshToken=null,this.baseUrl=e.baseUrl||"http://localhost:7130",this.autoRefreshToken=e.autoRefreshToken??!0,this.fetch=e.fetch||(globalThis.fetch?globalThis.fetch.bind(globalThis):void 0),this.anonKey=e.anonKey,this.defaultHeaders={...e.headers},this.tokenManager=t??new Xb,this.logger=n||new Gb(!1),this.timeout=e.timeout??3e4,this.retryCount=e.retryCount??3,this.retryDelay=e.retryDelay??500,!this.fetch)throw new Error("Fetch is not available. Please provide a fetch implementation in the config.")}buildUrl(e,t){const n=new URL(e,this.baseUrl);return t&&Object.entries(t).forEach(([a,o])=>{if(a==="select"){let s=o.replace(/\s+/g," ").trim();s=s.replace(/\s*\(\s*/g,"(").replace(/\s*\)\s*/g,")").replace(/\(\s+/g,"(").replace(/\s+\)/g,")").replace(/,\s+(?=[^()]*\))/g,","),n.searchParams.append(a,s)}else n.searchParams.append(a,o)}),n.toString()}isRetryableStatus(e){return hR.has(e)}computeRetryDelay(e){const n=this.retryDelay*Math.pow(2,e-1)*(.85+Math.random()*.3);return Math.round(n)}async handleRequest(e,t,n={}){const{params:a,headers:o={},body:s,signal:c,...u}=n,h=this.buildUrl(t,a),f=Date.now(),y=fR.has(e.toUpperCase())||n.idempotent===!0?this.retryCount:0,k={...this.defaultHeaders},w=this.userToken||this.anonKey;w&&(k.Authorization=`Bearer ${w}`);let x;s!==void 0&&(typeof FormData<"u"&&s instanceof FormData?x=s:(e!=="GET"&&(k["Content-Type"]="application/json;charset=UTF-8"),x=JSON.stringify(s))),o instanceof Headers?o.forEach((S,D)=>{k[D]=S}):Array.isArray(o)?o.forEach(([S,D])=>{k[S]=D}):Object.assign(k,o),this.logger.logRequest(e,h,k,x);let C;for(let S=0;S<=y;S++){if(S>0){const R=this.computeRetryDelay(S);if(this.logger.warn(`Retry ${S}/${y} for ${e} ${h} in ${R}ms`),c?.aborted)throw c.reason;await new Promise((O,G)=>{const W=()=>{clearTimeout(z),G(c.reason)},z=setTimeout(()=>{c&&c.removeEventListener("abort",W),O()},R);c&&c.addEventListener("abort",W,{once:!0})})}let D,L;if((this.timeout>0||c)&&(D=new AbortController,this.timeout>0&&(L=setTimeout(()=>D.abort(),this.timeout)),c))if(c.aborted)D.abort(c.reason);else{const R=()=>D.abort(c.reason);c.addEventListener("abort",R,{once:!0}),D.signal.addEventListener("abort",()=>{c.removeEventListener("abort",R)},{once:!0})}try{const R=await this.fetch(h,{method:e,headers:k,body:x,...u,...D?{signal:D.signal}:{}});if(this.isRetryableStatus(R.status)&&S<y){L!==void 0&&clearTimeout(L),await R.body?.cancel(),C=new We(`Server error: ${R.status} ${R.statusText}`,R.status,"SERVER_ERROR");continue}if(R.status===204){L!==void 0&&clearTimeout(L);return}let O;const G=R.headers.get("content-type");try{G?.includes("json")?O=await R.json():O=await R.text()}catch(W){throw L!==void 0&&clearTimeout(L),new We(`Failed to parse response body: ${W?.message||"Unknown error"}`,R.status,R.ok?"PARSE_ERROR":"REQUEST_FAILED")}if(L!==void 0&&clearTimeout(L),!R.ok){if(this.logger.logResponse(e,h,R.status,Date.now()-f,O),O&&typeof O=="object"&&"error"in O){!O.statusCode&&!O.status&&(O.statusCode=R.status);const W=We.fromApiError(O);throw Object.keys(O).forEach(z=>{z!=="error"&&z!=="message"&&z!=="statusCode"&&(W[z]=O[z])}),W}throw new We(`Request failed: ${R.statusText}`,R.status,"REQUEST_FAILED")}return this.logger.logResponse(e,h,R.status,Date.now()-f,O),O}catch(R){if(L!==void 0&&clearTimeout(L),R?.name==="AbortError")throw D&&D.signal.aborted&&this.timeout>0&&!c?.aborted?new We(`Request timed out after ${this.timeout}ms`,408,"REQUEST_TIMEOUT"):R;if(R instanceof We)throw R;if(S<y){C=R;continue}throw new We(`Network request failed: ${R?.message||"Unknown error"}`,0,"NETWORK_ERROR")}}throw C||new We("Request failed after all retry attempts",0,"NETWORK_ERROR")}async request(e,t,n={}){try{return await this.handleRequest(e,t,{...n})}catch(a){if(a instanceof We&&a.statusCode===401&&a.error==="INVALID_TOKEN"&&this.autoRefreshToken)try{const o=await this.handleTokenRefresh();return this.setAuthToken(o.accessToken),this.tokenManager.saveSession(o),o.csrfToken&&Yb(o.csrfToken),o.refreshToken&&this.setRefreshToken(o.refreshToken),await this.handleRequest(e,t,{...n})}catch(o){throw this.tokenManager.clearSession(),this.userToken=null,this.refreshToken=null,Zb(),o}throw a}}get(e,t){return this.request("GET",e,t)}post(e,t,n){return this.request("POST",e,{...n,body:t})}put(e,t,n){return this.request("PUT",e,{...n,body:t})}patch(e,t,n){return this.request("PATCH",e,{...n,body:t})}delete(e,t){return this.request("DELETE",e,t)}setAuthToken(e){this.userToken=e}setRefreshToken(e){this.refreshToken=e}getHeaders(){const e={...this.defaultHeaders},t=this.userToken||this.anonKey;return t&&(e.Authorization=`Bearer ${t}`),e}async handleTokenRefresh(){return this.isRefreshing?this.refreshPromise:(this.isRefreshing=!0,this.refreshPromise=(async()=>{try{const e=qb(),t=this.refreshToken?{refreshToken:this.refreshToken}:void 0;return await this.handleRequest("POST","/api/auth/sessions/current",{body:t,headers:e?{"X-CSRF-Token":e}:{},credentials:"include"})}finally{this.isRefreshing=!1,this.refreshPromise=null}})(),this.refreshPromise)}},bf="insforge_pkce_verifier";function Qb(e){return btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function mR(){const e=new Uint8Array(32);return crypto.getRandomValues(e),Qb(e)}async function gR(e){const n=new TextEncoder().encode(e),a=await crypto.subtle.digest("SHA-256",n);return Qb(new Uint8Array(a))}function yR(e){typeof sessionStorage<"u"&&sessionStorage.setItem(bf,e)}function vR(){if(typeof sessionStorage>"u")return null;const e=sessionStorage.getItem(bf);return e&&sessionStorage.removeItem(bf),e}function wn(e,t){return e instanceof We?{data:null,error:e}:{data:null,error:new We(e instanceof Error?e.message:t,500,"UNEXPECTED_ERROR")}}function Wv(...e){if(typeof window>"u")return;const t=new URL(window.location.href);e.forEach(n=>t.searchParams.delete(n)),window.history.replaceState({},document.title,t.toString())}var kR=class{constructor(e,t,n={}){this.http=e,this.tokenManager=t,this.options=n,this.authCallbackHandled=this.detectAuthCallback()}isServerMode(){return!!this.options.isServerMode}saveSessionFromResponse(e){if(!e.accessToken||!e.user)return!1;const t={accessToken:e.accessToken,user:e.user};return!this.isServerMode()&&e.csrfToken&&Yb(e.csrfToken),this.isServerMode()||this.tokenManager.saveSession(t),this.http.setAuthToken(e.accessToken),this.http.setRefreshToken(e.refreshToken??null),!0}async detectAuthCallback(){if(!(this.isServerMode()||typeof window>"u"))try{const e=new URLSearchParams(window.location.search),t=e.get("error");if(t){Wv("error"),console.debug("OAuth callback error:",t);return}const n=e.get("insforge_code");if(n){Wv("insforge_code");const{error:a}=await this.exchangeOAuthCode(n);a&&console.debug("OAuth code exchange failed:",a.message);return}}catch(e){console.debug("OAuth callback detection skipped:",e)}}async signUp(e){try{const t=await this.http.post(this.isServerMode()?"/api/auth/users?client_type=mobile":"/api/auth/users",e,{credentials:"include"});return t.accessToken&&t.user&&this.saveSessionFromResponse(t),t.refreshToken&&this.http.setRefreshToken(t.refreshToken),{data:t,error:null}}catch(t){return wn(t,"An unexpected error occurred during sign up")}}async signInWithPassword(e){try{const t=await this.http.post(this.isServerMode()?"/api/auth/sessions?client_type=mobile":"/api/auth/sessions",e,{credentials:"include"});return this.saveSessionFromResponse(t),t.refreshToken&&this.http.setRefreshToken(t.refreshToken),{data:t,error:null}}catch(t){return wn(t,"An unexpected error occurred during sign in")}}async signOut(){try{try{await this.http.post(this.isServerMode()?"/api/auth/logout?client_type=mobile":"/api/auth/logout",void 0,{credentials:"include"})}catch{}return this.tokenManager.clearSession(),this.http.setAuthToken(null),this.http.setRefreshToken(null),this.isServerMode()||Zb(),{error:null}}catch{return{error:new We("Failed to sign out",500,"SIGNOUT_ERROR")}}}async signInWithOAuth(e){try{const{provider:t,redirectTo:n,skipBrowserRedirect:a}=e,o=encodeURIComponent(t.toLowerCase()),s=mR(),c=await gR(s);yR(s);const u={code_challenge:c};n&&(u.redirect_uri=n);const f=Cu.options.includes(o)?`/api/auth/oauth/${o}`:`/api/auth/oauth/custom/${o}`,m=await this.http.get(f,{params:u});return!this.isServerMode()&&typeof window<"u"&&!a?(window.location.href=m.authUrl,{data:{},error:null}):{data:{url:m.authUrl,provider:o,codeVerifier:s},error:null}}catch(t){return t instanceof We?{data:{},error:t}:{data:{},error:new We("An unexpected error occurred during OAuth initialization",500,"UNEXPECTED_ERROR")}}}async exchangeOAuthCode(e,t){try{const n=t??vR();if(!n)return{data:null,error:new We("PKCE code verifier not found. Ensure signInWithOAuth was called in the same browser session.",400,"PKCE_VERIFIER_MISSING")};const a={code:e,code_verifier:n},o=await this.http.post(this.isServerMode()?"/api/auth/oauth/exchange?client_type=mobile":"/api/auth/oauth/exchange",a,{credentials:"include"});return this.saveSessionFromResponse(o),{data:o,error:null}}catch(n){return wn(n,"An unexpected error occurred during OAuth code exchange")}}async signInWithIdToken(e){try{const{provider:t,token:n}=e,a=await this.http.post("/api/auth/id-token?client_type=mobile",{provider:t,token:n},{credentials:"include"});return this.saveSessionFromResponse(a),a.refreshToken&&this.http.setRefreshToken(a.refreshToken),{data:a,error:null}}catch(t){return wn(t,"An unexpected error occurred during ID token sign in")}}async refreshSession(e){try{if(this.isServerMode()&&!e?.refreshToken)return{data:null,error:new We("refreshToken is required when refreshing session in server mode",400,"REFRESH_TOKEN_REQUIRED")};const t=this.isServerMode()?null:qb(),n=await this.http.post(this.isServerMode()?"/api/auth/refresh?client_type=mobile":"/api/auth/refresh",this.isServerMode()?{refresh_token:e?.refreshToken}:void 0,{headers:t?{"X-CSRF-Token":t}:{},credentials:"include"});return n.accessToken&&this.saveSessionFromResponse(n),{data:n,error:null}}catch(t){return wn(t,"An unexpected error occurred during session refresh")}}async getCurrentUser(){await this.authCallbackHandled;try{if(this.isServerMode()){const t=this.tokenManager.getAccessToken();return t?(this.http.setAuthToken(t),{data:{user:(await this.http.get("/api/auth/sessions/current")).user??null},error:null}):{data:{user:null},error:null}}const e=this.tokenManager.getSession();if(e)return this.http.setAuthToken(e.accessToken),{data:{user:e.user},error:null};if(typeof window<"u"){const{data:t,error:n}=await this.refreshSession();if(n)return{data:{user:null},error:n};if(t?.accessToken)return{data:{user:t.user??null},error:null}}return{data:{user:null},error:null}}catch(e){return e instanceof We?{data:{user:null},error:e}:{data:{user:null},error:new We("An unexpected error occurred while getting user",500,"UNEXPECTED_ERROR")}}}async getProfile(e){try{return{data:await this.http.get(`/api/auth/profiles/${e}`),error:null}}catch(t){return wn(t,"An unexpected error occurred while fetching user profile")}}async setProfile(e){try{const t=await this.http.patch("/api/auth/profiles/current",{profile:e}),n=this.tokenManager.getUser();return!this.isServerMode()&&n&&t.profile!==void 0&&this.tokenManager.setUser({...n,profile:t.profile}),{data:t,error:null}}catch(t){return wn(t,"An unexpected error occurred while updating user profile")}}async resendVerificationEmail(e){try{return{data:await this.http.post("/api/auth/email/send-verification",e),error:null}}catch(t){return wn(t,"An unexpected error occurred while sending verification email")}}async verifyEmail(e){try{const t=await this.http.post(this.isServerMode()?"/api/auth/email/verify?client_type=mobile":"/api/auth/email/verify",e,{credentials:"include"});return this.saveSessionFromResponse(t),t.refreshToken&&this.http.setRefreshToken(t.refreshToken),{data:t,error:null}}catch(t){return wn(t,"An unexpected error occurred while verifying email")}}async sendResetPasswordEmail(e){try{return{data:await this.http.post("/api/auth/email/send-reset-password",e),error:null}}catch(t){return wn(t,"An unexpected error occurred while sending password reset email")}}async exchangeResetPasswordToken(e){try{return{data:await this.http.post("/api/auth/email/exchange-reset-password-token",e),error:null}}catch(t){return wn(t,"An unexpected error occurred while verifying reset code")}}async resetPassword(e){try{return{data:await this.http.post("/api/auth/email/reset-password",e),error:null}}catch(t){return wn(t,"An unexpected error occurred while resetting password")}}async getPublicAuthConfig(){try{return{data:await this.http.get("/api/auth/public-config"),error:null}}catch(e){return wn(e,"An unexpected error occurred while fetching auth configuration")}}};function _R(e,t){return async(n,a)=>{const o=typeof n=="string"?n:n.toString(),s=new URL(o),c=s.pathname.slice(1),u=c.match(/^rpc\/(.+)$/),h=u?`/api/database/rpc/${u[1]}`:`/api/database/records/${c}`,f=`${e.baseUrl}${h}${s.search}`,m=t.getAccessToken(),y=e.getHeaders(),k=m||y.Authorization?.replace("Bearer ",""),w=new Headers(a?.headers);return k&&!w.has("Authorization")&&w.set("Authorization",`Bearer ${k}`),await fetch(f,{...a,headers:w})}}var bR=class{constructor(e,t){this.postgrest=new mA("http://dummy",{fetch:_R(e,t),headers:{}})}from(e){return this.postgrest.from(e)}rpc(e,t,n){return this.postgrest.rpc(e,t,n)}},wR=class{constructor(e,t){this.bucketName=e,this.http=t}async upload(e,t){try{const n=await this.http.post(`/api/storage/buckets/${this.bucketName}/upload-strategy`,{filename:e,contentType:t.type||"application/octet-stream",size:t.size});if(n.method==="presigned")return await this.uploadWithPresignedUrl(n,t);if(n.method==="direct"){const a=new FormData;return a.append("file",t),{data:await this.http.request("PUT",`/api/storage/buckets/${this.bucketName}/objects/${encodeURIComponent(e)}`,{body:a,headers:{}}),error:null}}throw new We(`Unsupported upload method: ${n.method}`,500,"STORAGE_ERROR")}catch(n){return{data:null,error:n instanceof We?n:new We("Upload failed",500,"STORAGE_ERROR")}}}async uploadAuto(e){try{const t=e instanceof File?e.name:"file",n=await this.http.post(`/api/storage/buckets/${this.bucketName}/upload-strategy`,{filename:t,contentType:e.type||"application/octet-stream",size:e.size});if(n.method==="presigned")return await this.uploadWithPresignedUrl(n,e);if(n.method==="direct"){const a=new FormData;return a.append("file",e),{data:await this.http.request("POST",`/api/storage/buckets/${this.bucketName}/objects`,{body:a,headers:{}}),error:null}}throw new We(`Unsupported upload method: ${n.method}`,500,"STORAGE_ERROR")}catch(t){return{data:null,error:t instanceof We?t:new We("Upload failed",500,"STORAGE_ERROR")}}}async uploadWithPresignedUrl(e,t){try{const n=new FormData;e.fields&&Object.entries(e.fields).forEach(([o,s])=>{n.append(o,s)}),n.append("file",t);const a=await fetch(e.uploadUrl,{method:"POST",body:n});if(!a.ok)throw new We(`Upload to storage failed: ${a.statusText}`,a.status,"STORAGE_ERROR");return e.confirmRequired&&e.confirmUrl?{data:await this.http.post(e.confirmUrl,{size:t.size,contentType:t.type||"application/octet-stream"}),error:null}:{data:{key:e.key,bucket:this.bucketName,size:t.size,mimeType:t.type||"application/octet-stream",uploadedAt:new Date().toISOString(),url:this.getPublicUrl(e.key)},error:null}}catch(n){throw n instanceof We?n:new We("Presigned upload failed",500,"STORAGE_ERROR")}}async download(e){try{const t=await this.http.post(`/api/storage/buckets/${this.bucketName}/objects/${encodeURIComponent(e)}/download-strategy`,{expiresIn:3600}),n=t.url,a={};t.method==="direct"&&Object.assign(a,this.http.getHeaders());const o=await fetch(n,{method:"GET",headers:a});if(!o.ok)try{const c=await o.json();throw We.fromApiError(c)}catch{throw new We(`Download failed: ${o.statusText}`,o.status,"STORAGE_ERROR")}return{data:await o.blob(),error:null}}catch(t){return{data:null,error:t instanceof We?t:new We("Download failed",500,"STORAGE_ERROR")}}}getPublicUrl(e){return`${this.http.baseUrl}/api/storage/buckets/${this.bucketName}/objects/${encodeURIComponent(e)}`}async list(e){try{const t={};return e?.prefix&&(t.prefix=e.prefix),e?.search&&(t.search=e.search),e?.limit&&(t.limit=e.limit.toString()),e?.offset&&(t.offset=e.offset.toString()),{data:await this.http.get(`/api/storage/buckets/${this.bucketName}/objects`,{params:t}),error:null}}catch(t){return{data:null,error:t instanceof We?t:new We("List failed",500,"STORAGE_ERROR")}}}async remove(e){try{return{data:await this.http.delete(`/api/storage/buckets/${this.bucketName}/objects/${encodeURIComponent(e)}`),error:null}}catch(t){return{data:null,error:t instanceof We?t:new We("Delete failed",500,"STORAGE_ERROR")}}}},xR=class{constructor(e){this.http=e}from(e){return new wR(e,this.http)}},PR=class{constructor(e){this.http=e,this.chat=new SR(e),this.images=new ER(e),this.embeddings=new TR(e)}},SR=class{constructor(e){this.completions=new CR(e)}},CR=class{constructor(e){this.http=e}async create(e){const t={model:e.model,messages:e.messages,temperature:e.temperature,maxTokens:e.maxTokens,topP:e.topP,stream:e.stream,webSearch:e.webSearch,fileParser:e.fileParser,thinking:e.thinking,tools:e.tools,toolChoice:e.toolChoice,parallelToolCalls:e.parallelToolCalls};if(e.stream){const o=this.http.getHeaders();o["Content-Type"]="application/json";const s=await this.http.fetch(`${this.http.baseUrl}/api/ai/chat/completion`,{method:"POST",headers:o,body:JSON.stringify(t)});if(!s.ok){const c=await s.json();throw new Error(c.error||"Stream request failed")}return this.parseSSEStream(s,e.model)}const n=await this.http.post("/api/ai/chat/completion",t),a=n.text||"";return{id:`chatcmpl-${Date.now()}`,object:"chat.completion",created:Math.floor(Date.now()/1e3),model:n.metadata?.model,choices:[{index:0,message:{role:"assistant",content:a,...n.tool_calls?.length&&{tool_calls:n.tool_calls},...n.annotations?.length&&{annotations:n.annotations}},finish_reason:n.tool_calls?.length?"tool_calls":"stop"}],usage:n.metadata?.usage||{prompt_tokens:0,completion_tokens:0,total_tokens:0}}}async*parseSSEStream(e,t){const n=e.body.getReader(),a=new TextDecoder;let o="";try{for(;;){const{done:s,value:c}=await n.read();if(s)break;o+=a.decode(c,{stream:!0});const u=o.split(`
42
+ `);o=u.pop()||"";for(const h of u)if(h.startsWith("data: ")){const f=h.slice(6).trim();if(f)try{const m=JSON.parse(f);if((m.chunk||m.content)&&(yield{id:`chatcmpl-${Date.now()}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:t,choices:[{index:0,delta:{content:m.chunk||m.content},finish_reason:null}]}),m.tool_calls?.length&&(yield{id:`chatcmpl-${Date.now()}`,object:"chat.completion.chunk",created:Math.floor(Date.now()/1e3),model:t,choices:[{index:0,delta:{tool_calls:m.tool_calls},finish_reason:"tool_calls"}]}),m.done){n.releaseLock();return}}catch{console.warn("Failed to parse SSE data:",f)}}}}finally{n.releaseLock()}}},TR=class{constructor(e){this.http=e}async create(e){const t=await this.http.post("/api/ai/embeddings",e);return{object:t.object,data:t.data,model:t.metadata?.model,usage:t.metadata?.usage?{prompt_tokens:t.metadata.usage.promptTokens||0,total_tokens:t.metadata.usage.totalTokens||0}:{prompt_tokens:0,total_tokens:0}}}},ER=class{constructor(e){this.http=e}async generate(e){const t=await this.http.post("/api/ai/image/generation",e);let n=[];return t.images&&t.images.length>0?n=t.images.map(a=>({b64_json:a.imageUrl.replace(/^data:image\/\w+;base64,/,""),content:t.text})):t.text&&(n=[{content:t.text}]),{created:Math.floor(Date.now()/1e3),data:n,...t.metadata?.usage&&{usage:{total_tokens:t.metadata.usage.totalTokens||0,input_tokens:t.metadata.usage.promptTokens||0,output_tokens:t.metadata.usage.completionTokens||0}}}}},AR=class Jb{constructor(t,n){this.http=t,this.functionsUrl=n||Jb.deriveSubhostingUrl(t.baseUrl)}static deriveSubhostingUrl(t){try{const{hostname:n}=new URL(t);return n.endsWith(".insforge.app")?`https://${n.split(".")[0]}.functions.insforge.app`:void 0}catch{return}}async invoke(t,n={}){const{method:a="POST",body:o,headers:s={}}=n;if(this.functionsUrl)try{return{data:await this.http.request(a,`${this.functionsUrl}/${t}`,{body:o,headers:s}),error:null}}catch(c){if(c instanceof Error&&c.name==="AbortError")throw c;if(!(c instanceof We&&c.statusCode===404))return{data:null,error:c instanceof We?c:new We(c instanceof Error?c.message:"Function invocation failed",500,"FUNCTION_ERROR")}}try{const c=`/functions/${t}`;return{data:await this.http.request(a,c,{body:o,headers:s}),error:null}}catch(c){if(c instanceof Error&&c.name==="AbortError")throw c;return{data:null,error:c instanceof We?c:new We(c instanceof Error?c.message:"Function invocation failed",500,"FUNCTION_ERROR")}}}},Kv=1e4,RR=class{constructor(e,t,n){this.socket=null,this.connectPromise=null,this.subscribedChannels=new Set,this.eventListeners=new Map,this.baseUrl=e,this.tokenManager=t,this.anonKey=n,this.tokenManager.onTokenChange=()=>this.onTokenChange()}notifyListeners(e,t){const n=this.eventListeners.get(e);if(n)for(const a of n)try{a(t)}catch(o){console.error(`Error in ${e} callback:`,o)}}connect(){return this.socket?.connected?Promise.resolve():this.connectPromise?this.connectPromise:(this.connectPromise=new Promise((e,t)=>{const n=this.tokenManager.getAccessToken()??this.anonKey;this.socket=Ic(this.baseUrl,{transports:["websocket"],auth:n?{token:n}:void 0});let a=!0,o=null;const s=()=>{o&&(clearTimeout(o),o=null)};o=setTimeout(()=>{a&&(a=!1,this.connectPromise=null,this.socket?.disconnect(),this.socket=null,t(new Error(`Connection timeout after ${Kv}ms`)))},Kv),this.socket.on("connect",()=>{s();for(const c of this.subscribedChannels)this.socket.emit("realtime:subscribe",{channel:c});this.notifyListeners("connect"),a&&(a=!1,this.connectPromise=null,e())}),this.socket.on("connect_error",c=>{s(),this.notifyListeners("connect_error",c),a&&(a=!1,this.connectPromise=null,t(c))}),this.socket.on("disconnect",c=>{this.notifyListeners("disconnect",c)}),this.socket.on("realtime:error",c=>{this.notifyListeners("error",c)}),this.socket.onAny((c,u)=>{c!=="realtime:error"&&this.notifyListeners(c,u)})}),this.connectPromise)}disconnect(){this.socket&&(this.socket.disconnect(),this.socket=null),this.subscribedChannels.clear()}onTokenChange(){const e=this.tokenManager.getAccessToken()??this.anonKey;this.socket&&(this.socket.auth=e?{token:e}:{}),this.socket&&(this.socket.connected||this.connectPromise)&&(this.socket.disconnect(),this.socket.connect())}get isConnected(){return this.socket?.connected??!1}get connectionState(){return this.socket?this.socket.connected?"connected":"connecting":"disconnected"}get socketId(){return this.socket?.id}async subscribe(e){if(this.subscribedChannels.has(e))return{ok:!0,channel:e};if(!this.socket?.connected)try{await this.connect()}catch(t){const n=t instanceof Error?t.message:"Connection failed";return{ok:!1,channel:e,error:{code:"CONNECTION_FAILED",message:n}}}return new Promise(t=>{this.socket.emit("realtime:subscribe",{channel:e},n=>{n.ok&&this.subscribedChannels.add(e),t(n)})})}unsubscribe(e){this.subscribedChannels.delete(e),this.socket?.connected&&this.socket.emit("realtime:unsubscribe",{channel:e})}async publish(e,t,n){if(!this.socket?.connected)throw new Error("Not connected to realtime server. Call connect() first.");this.socket.emit("realtime:publish",{channel:e,event:t,payload:n})}on(e,t){this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e).add(t)}off(e,t){const n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}once(e,t){const n=a=>{this.off(e,n),t(a)};this.on(e,n)}getSubscribedChannels(){return Array.from(this.subscribedChannels)}},LR=class{constructor(e){this.http=e}async send(e){try{return{data:await this.http.post("/api/email/send-raw",e),error:null}}catch(t){if(t instanceof Error&&t.name==="AbortError")throw t;return{data:null,error:t instanceof We?t:new We(t instanceof Error?t.message:"Email send failed",500,"EMAIL_ERROR")}}}},DR=class{constructor(e={}){const t=new Gb(e.debug);this.tokenManager=new Xb,this.http=new pR(e,this.tokenManager,t),e.edgeFunctionToken&&(this.http.setAuthToken(e.edgeFunctionToken),this.tokenManager.setAccessToken(e.edgeFunctionToken)),this.auth=new kR(this.http,this.tokenManager,{isServerMode:e.isServerMode??!1}),this.database=new bR(this.http,this.tokenManager),this.storage=new xR(this.http),this.ai=new PR(this.http),this.functions=new AR(this.http,e.functionsUrl),this.realtime=new RR(this.http.baseUrl,this.tokenManager,e.anonKey),this.emails=new LR(this.http)}getHttpClient(){return this.http}};function MR(e){return new DR(e)}const xp={VITE_INSFORGE_ANON_KEY:"ik_9f35735991b684f7cf57fa00bb4d0487",VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"},e0="https://srctyff5.us-east.insforge.app",IR="ik_9f35735991b684f7cf57fa00bb4d0487";function Wr(){const e=typeof import.meta<"u"?xp:void 0;return(e?.VITE_INSFORGE_BASE_URL||e?.VITE_TOKENTRACKER_BACKEND_BASE_URL||e0).trim()}function t0(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return window.location.origin;const t=typeof import.meta<"u"?xp:void 0;return(t?.VITE_INSFORGE_BASE_URL||t?.VITE_TOKENTRACKER_BACKEND_BASE_URL||e0).trim()}function Ks(){const e=typeof import.meta<"u"?xp:void 0;return(e?.VITE_INSFORGE_ANON_KEY||e?.VITE_TOKENTRACKER_BACKEND_ANON_KEY||IR).trim()}function wf(){return!!t0()}let Dh=null;function NR(){return wf()?(Dh||(Dh=MR({baseUrl:t0(),anonKey:Ks()||void 0,autoRefreshToken:!0})),Dh):null}const n0="tokentracker_cloud_sync_enabled",OR="tokentracker_cloud_device_session_v1",Pp="tokentracker_cloud_last_sync_ts";let Sp=null;function Cp(){try{localStorage.removeItem(OR)}catch{}}function jR(){if(typeof window>"u")return!1;const e=window.location.hostname;return e==="localhost"||e==="127.0.0.1"}function UR(){try{const e=localStorage.getItem(n0);return e===null||e===""?!1:e==="1"||e==="true"}catch{return!1}}function d4(e){try{localStorage.setItem(n0,e?"1":"0")}catch{}}function r0(){return Cp(),Sp}function BR(e){Sp=e,Cp()}function a0(){Sp=null;try{localStorage.removeItem(Pp)}catch{}Cp()}function FR(){try{const e=Number(localStorage.getItem(Pp));return Number.isFinite(e)?e:0}catch{return 0}}function i0(e){try{localStorage.setItem(Pp,String(e))}catch{}}function Aa(e){if(typeof e!="string")return null;const t=e.trim();return t.length>0?t:null}function VR(e){const t=Aa(e);if(!t)return null;const n=t.split(".");if(n.length<2)return null;const a=n[1];try{const o=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),s=typeof atob=="function"?atob(o):Buffer.from(o,"base64").toString("utf8"),u=JSON.parse(s)?.exp;return typeof u!="number"||!Number.isFinite(u)||u<=0?null:Math.floor(u*1e3)}catch{return null}}function o0(e){const t=Aa(e);if(!t)return!1;const n=t.split(".");if(n.length!==3)return!1;try{for(let a=0;a<2;a++){const o=n[a];if(!/^[A-Za-z0-9_-]+$/.test(o))return!1;const s=o.replace(/-/g,"+").replace(/_/g,"/").padEnd(o.length+(4-o.length%4)%4,"="),c=typeof atob=="function"?atob(s):Buffer.from(s,"base64").toString("utf8");a===1&&JSON.parse(c)}return!0}catch{return!1}}function zR(e,t=3e4){const n=VR(e);return n?n<=Date.now()+Math.max(0,Number(t)||0):!1}async function $R(e){if(!e)return null;if(typeof e=="string")return Aa(e);if(typeof e=="function")try{const t=await e();return Aa(t)}catch{return null}if(typeof e=="object"){if(typeof e.getAccessToken=="function"){try{const t=await e.getAccessToken(),n=Aa(t);if(n)return n}catch{}return Aa(e.accessToken)}return null}return Aa(e)}async function h4(e,t={}){const n=Math.max(1,Math.min(12,Math.floor(Number(t.maxAttempts)||8))),a=Math.max(20,Math.floor(Number(t.baseDelayMs)||50));for(let o=0;o<n;o++){const s=await $R(e);if(s)return s;o<n-1&&await new Promise(c=>setTimeout(c,a*(o+1)))}return null}function f4(e){return typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1")||typeof e=="function"||e&&typeof e=="object"&&typeof e.getAccessToken=="function"?!0:!!Aa(e)}function p4(){if(typeof Intl>"u"||!Intl.DateTimeFormat)return null;try{return Intl.DateTimeFormat().resolvedOptions().timeZone||null}catch{return null}}function m4(e=new Date){const t=e instanceof Date?e:new Date(e);if(!Number.isFinite(t.getTime()))return 0;const n=t.getTimezoneOffset();return Number.isFinite(n)?-n:0}function s0(e){if(!Number.isFinite(e)||e===0)return"UTC";const t=e>=0?"+":"-",n=Math.abs(e),a=String(Math.floor(n/60)).padStart(2,"0"),o=String(n%60).padStart(2,"0");return`UTC${t}${a}:${o}`}function g4({timeZone:e,offsetMinutes:t}={}){const n=s0(t);return e&&e!=="UTC"?`${e} (${n})`:n}function y4({timeZone:e,offsetMinutes:t}={}){return Number.isFinite(t)?s0(t):e||"UTC"}function v4({timeZone:e,offsetMinutes:t,date:n=new Date}={}){const a=n instanceof Date?n:new Date(n);if(!Number.isFinite(a.getTime()))return"";if(e&&typeof Intl<"u"&&Intl.DateTimeFormat)try{const c=new Intl.DateTimeFormat("en-CA",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(a).reduce((m,y)=>(y.type&&y.value&&(m[y.type]=y.value),m),{}),u=c.year,h=c.month,f=c.day;if(u&&h&&f)return`${u}-${h}-${f}`}catch{}if(typeof t=="number"&&Number.isFinite(t)){const o=new Date(a.getTime()+t*6e4);return WR(o)}return KR(a)}function HR({timeZone:e,offsetMinutes:t,date:n=new Date}={}){const a=n instanceof Date?n:new Date(n);if(!Number.isFinite(a.getTime()))return null;if(e&&typeof Intl<"u"&&Intl.DateTimeFormat)try{const c=new Intl.DateTimeFormat("en-CA",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(a).reduce((m,y)=>(y.type&&y.value&&(m[y.type]=y.value),m),{}),u=Number(c.year),h=Number(c.month),f=Number(c.day);if(Number.isFinite(u)&&Number.isFinite(h)&&Number.isFinite(f))return{year:u,month:h,day:f}}catch{}if(typeof t=="number"&&Number.isFinite(t)){const o=new Date(a.getTime()+t*6e4);return{year:o.getUTCFullYear(),month:o.getUTCMonth()+1,day:o.getUTCDate()}}return{year:a.getFullYear(),month:a.getMonth()+1,day:a.getDate()}}function k4({timeZone:e,offsetMinutes:t}={}){return e?`tz:${e}`:typeof t=="number"&&Number.isFinite(t)?`offset:${Math.trunc(t)}`:"utc"}function WR(e){const t=e.getUTCFullYear(),n=String(e.getUTCMonth()+1).padStart(2,"0"),a=String(e.getUTCDate()).padStart(2,"0");return`${t}-${n}-${a}`}function KR(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${a}`}function yt(e){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())).toISOString().slice(0,10)}function Pr(e){const t=e instanceof Date?e:new Date(e);if(!Number.isFinite(t.getTime()))return"";const n=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0");return`${n}-${a}-${o}`}function GR(e){if(!e)return null;const t=String(e).trim(),n=t.split("-");if(n.length!==3)return null;const a=Number(n[0]),o=Number(n[1])-1,s=Number(n[2]);if(!Number.isFinite(a)||!Number.isFinite(o)||!Number.isFinite(s))return null;const c=new Date(Date.UTC(a,o,s));return Number.isFinite(c.getTime())&&yt(c)===t?c:null}function qR(e){if(!e)return"";const t=e.year,n=String(e.month).padStart(2,"0"),a=String(e.day).padStart(2,"0");return!t||!n||!a?"":`${t}-${n}-${a}`}function YR(e,{timeZone:t,offsetMinutes:n,now:a}={}){const o=a instanceof Date&&Number.isFinite(a.getTime())?a:new Date,s=HR({timeZone:t,offsetMinutes:n,date:o});if(!s){const h=Pr(new Date);return{from:h,to:h}}const c=qR(s),u=GR(c);if(!u)return{from:c,to:c};if(e==="day")return{from:c,to:c};if(e==="week"){const h=new Date(u),m=(h.getUTCDay()+6)%7;h.setUTCDate(h.getUTCDate()-m);const y=new Date(h);return y.setUTCDate(y.getUTCDate()+6),{from:yt(h),to:yt(y)}}if(e==="month"){const h=new Date(Date.UTC(u.getUTCFullYear(),u.getUTCMonth(),1)),f=new Date(Date.UTC(u.getUTCFullYear(),u.getUTCMonth()+1,0));return{from:yt(h),to:yt(f)}}if(e==="total"){const h=new Date(Date.UTC(u.getUTCFullYear(),u.getUTCMonth()-23,1));return{from:yt(h),to:c}}return YR("week")}function l0(){return typeof window>"u"?null:window.localStorage||null}function c0(){return typeof navigator>"u"?null:navigator.clipboard||null}function ZR(){return typeof window>"u"?null:window.ClipboardItem||null}function xs(e,{storage:t}={}){const n=t??l0();if(!n||typeof n.getItem!="function")return null;try{return n.getItem(e)}catch{return null}}function Ps(e,t,{storage:n}={}){const a=n??l0();if(!a||typeof a.setItem!="function")return!1;try{return a.setItem(e,t),!0}catch{return!1}}async function _4(e,{clipboard:t}={}){const n=t??c0();if(!n||typeof n.writeText!="function")return!1;try{return await n.writeText(e),!0}catch{return!1}}async function b4(e,{clipboard:t}={}){const n=t??c0(),a=ZR();if(!e||!n||typeof n.write!="function"||!a)return!1;try{const o=e.type||"image/png",s=e.type&&e.type!==o?e.slice(0,e.size,o):e.type?e:e.slice(0,e.size,o),c=new a({[o]:s});return await n.write([c]),!0}catch{return!1}}const Ns="USD",Tp=["USD","EUR","GBP","CNY","JPY","HKD"],u0={USD:{symbol:"$",labelKey:"settings.appearance.currency.opt.usd"},EUR:{symbol:"€",labelKey:"settings.appearance.currency.opt.eur"},GBP:{symbol:"£",labelKey:"settings.appearance.currency.opt.gbp"},CNY:{symbol:"¥",labelKey:"settings.appearance.currency.opt.cny"},JPY:{symbol:"¥",labelKey:"settings.appearance.currency.opt.jpy"},HKD:{symbol:"HK$",labelKey:"settings.appearance.currency.opt.hkd"}},Ep={USD:1,EUR:.92,GBP:.79,CNY:7.2,JPY:155,HKD:7.8},d0="tokentracker-currency",h0="tokentracker-exchange-rates",f0="tokentracker-exchange-rate-source",p0="tokentracker-exchange-rate-fetched-at";function ru(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Ap(e){if(typeof e!="string")return Ns;const t=e.trim().toUpperCase();return Tp.includes(t)?t:Ns}function Nc(e){const t=typeof e=="string"?e.trim().toUpperCase():Ns;return u0[t]?.symbol??"$"}function w4(){return Tp.map(e=>({code:e,...u0[e]}))}function XR(){return Ap(xs(d0))}function QR(e){return Ps(d0,Ap(e))}function m0(e){return e==="fetched"?"fetched":"default"}function JR(e){if(e==null)return null;try{const t=JSON.parse(String(e));if(!t||typeof t!="object")return null;const n={};for(const[a,o]of Object.entries(t)){const s=Number(o);Number.isFinite(s)&&s>0&&(n[a.toUpperCase()]=s)}return n}catch{return null}}function eL(){const e=JR(xs(h0)),t=xs(p0),n=t==null?NaN:Number(t),a=Number.isFinite(n)&&n>0?n:null,o=xs(f0),s=m0(o);return e&&Object.keys(e).length>0?{rates:{USD:1,...e},source:s,fetchedAt:a}:{rates:{...Ep},source:"default",fetchedAt:null}}function tL(e){const{rates:t,source:n,fetchedAt:a}=e;if(!t||typeof t!="object")return!1;const o=Ps(h0,JSON.stringify(t)),s=Ps(f0,m0(n)),c=a?Ps(p0,String(a)):!0;return o&&s&&c}function Mh(e,t){if(t===Ns)return 1;const n=e?.[t];if(ru(n))return n;const a=Ep[t];return ru(a)?a:1}function x4(e){if(e==null)return"-";try{if(typeof e=="bigint")return new Intl.NumberFormat().format(e);if(typeof e=="number")return new Intl.NumberFormat().format(e);const t=String(e).trim();return/^[0-9]+$/.test(t)?new Intl.NumberFormat().format(BigInt(t)):t}catch{return String(e)}}function P4(e,{thousandSuffix:t="K",millionSuffix:n="M",billionSuffix:a="B",decimals:o=1}={}){const s=Number(String(e));if(!Number.isFinite(s))return"-";const c=s<0?"-":"",u=Math.abs(s),h=Math.max(0,Math.min(6,Math.floor(o)));if(u<1e3)return`${c}${String(u)}`;const f=(w,x)=>{const C=w.toFixed(h),S=Number(C).toString();return`${c}${S}${x}`},m=(w,x,C)=>{const S=w.toFixed(h),D=Number(S);return C&&D>=1e3?f(D/1e3,C):`${c}${D.toString()}${x}`};if(u>=1e9)return f(u/1e9,a);if(u>=1e6)return m(u/1e6,n,a);const y=u/1e3,k=Number(y.toFixed(h));return k>=1e3?f(k/1e3,n):f(k,t)}function g0(e){const t=Number(String(e));return Number.isFinite(t)?t:null}function S4(e,t={}){const{decimals:n=2,currency:a="USD",rate:o=1}=t;if(e==null||typeof e=="string"&&e.trim()==="")return"-";let s;if(typeof e=="number")s=e;else if(typeof e=="bigint")s=Number(e);else{const S=String(e).trim(),D=Number(S);if(!Number.isFinite(D))return S;s=D}if(!Number.isFinite(s))return String(e);const c=Nc(a);a!=="USD"&&typeof o=="number"&&Number.isFinite(o)&&o>0&&(s=s*o);const h=s.toFixed(6).match(/^(-?\d+)(?:\.(\d+))?$/);if(!h)return`${c}${String(s)}`;const f=h[1],m=h[2]||"";let y=f;try{y=new Intl.NumberFormat().format(BigInt(f))}catch{y=f}const k=Math.max(0,Math.min(6,Math.floor(n))),w=k?m.slice(0,k).padEnd(k,"0"):"",x=f.startsWith("-")?"-":"",C=k?`${y.replace("-","")}.${w}`:y.replace("-","");return`${x}${c}${C}`}function au(e){if(typeof e!="string")return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());if(!t)return null;const n=Number(t[1]),a=Number(t[2])-1,o=Number(t[3]),s=new Date(Date.UTC(n,a,o));return Number.isFinite(s.getTime())&&yt(s)===e.trim()?s:null}function ri(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+t))}function nL(e,t){const n=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())-Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate());return Math.floor(n/864e5)}function Ih(e,t){if(!Array.isArray(e)||e.length===0)return 0;const n=e.length,a=(n-1)*t,o=Math.floor(a),s=a-o,c=e[o]??e[n-1],u=e[Math.min(n-1,o+1)]??e[n-1];return Math.round(c+(u-c)*s)}function rL(e){return e<=0?0:e>=4?4:e}function y0({weeks:e=52,now:t,weekStartsOn:n="sun"}={}){const a=t instanceof Date&&Number.isFinite(t.getTime())?t:new Date,o=Pr(a),s=au(o)||new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate())),c=n==="mon"?1:0,u=s.getUTCDay(),h=ri(s,-((u-c+7)%7)),f=ri(h,-7*(Math.max(1,e)-1));return{from:yt(f),to:o}}function aL({dailyRows:e,weeks:t=52,to:n,weekStartsOn:a="sun"}={}){const o=au(n)||new Date(Date.UTC(new Date().getFullYear(),new Date().getMonth(),new Date().getDate())),{from:s}=y0({weeks:t,now:o,weekStartsOn:a}),c=au(s)||ri(o,-(t*7-1)),u=(()=>{const O=(c.getUTCDay()-(a==="mon"?1:0)+7)%7;return ri(c,-O)})(),h=new Map;for(const L of Array.isArray(e)?e:[]){const R=typeof L?.day=="string"?L.day:null;if(!R)continue;const O=g0(L?.billable_total_tokens??L?.total_tokens)??0;h.set(R,{value:Math.max(0,O),models:L?.models||null})}const f=nL(u,o)+1,m=Math.ceil(f/7),y=[];for(let L=0;L<f;L++){const R=ri(u,L),O=yt(R),G=h.get(O),W=G?G.value:0;W>0&&y.push(W)}y.sort((L,R)=>L-R);const k=Ih(y,.5),w=Ih(y,.75),x=Ih(y,.9);function C(L){return!L||L<=0?0:L<=k?1:L<=w?2:L<=x?3:4}const S=[];for(let L=0;L<m;L++){const R=[];for(let O=0;O<7;O++){const G=L*7+O,W=ri(u,G);if(W.getTime()>o.getTime()){R.push(null);continue}const z=yt(W),P=h.get(z),Y=P?P.value:0,X=P?P.models:null;R.push({day:z,value:Y,level:rL(C(Y)),models:X})}S.push(R)}const D=S.length>t?S.slice(S.length-t):S;return{from:s,to:yt(o),weeks:D,thresholds:{t1:k,t2:w,t3:x}}}function iL({dailyRows:e,to:t}={}){const n=au(t)||new Date(Date.UTC(new Date().getFullYear(),new Date().getMonth(),new Date().getDate())),a=new Map;for(const s of Array.isArray(e)?e:[]){const c=typeof s?.day=="string"?s.day:null;if(!c)continue;const u=g0(s?.billable_total_tokens??s?.total_tokens)??0;a.set(c,Math.max(0,u))}let o=0;for(let s=0;s<370;s++){const c=yt(ri(n,-s));if((a.get(c)??0)>0){o+=1;continue}break}return o}const Au={},v0="tokentracker",oL=["tokentracker/tokentracker","spacedriveapp/spacedrive","acme/alpha","acme/beta","neo/nebula","signal/flux","matrix/terminal","orbit/atlas","lumen/core","delta/horizon"],Gv=["NEO","TRINITY","MORPHEUS","ORACLE","CYPHER","SWITCH","APOC","TANK","SMITH","SERAPH","NIOBE","MOUSE","DOZER","LINK","BLADE"];function Sn(){if(typeof window<"u"){const e=new URLSearchParams(window.location.search),t=String(e.get("mock")||"").toLowerCase();if(t==="0"||t==="false"||t==="off"||t==="no")return!1;if(t==="1"||t==="true"||t==="on"||t==="yes")return!0}if(typeof import.meta<"u"&&Au){const e="".toLowerCase();if(e==="1"||e==="true")return!0}return!1}function sL(){if(typeof import.meta<"u"&&Au){const e="".trim();if(e)return e;const t="".trim();if(t)return t}if(typeof window<"u"){const e=new URLSearchParams(window.location.search),t=String(e.get("mock_now")||"").trim();if(t)return t;const n=String(e.get("mock_today")||"").trim();if(n)return n}return""}function lL(e){if(!e)return null;const t=String(e).trim();if(!t)return null;if(/^\d{4}-\d{2}-\d{2}$/.test(t)){const[a,o,s]=t.split("-").map(Number);if(!Number.isFinite(a)||!Number.isFinite(o)||!Number.isFinite(s))return null;const c=new Date(a,o-1,s,12,0,0);return Number.isFinite(c.getTime())?c:null}const n=new Date(t);return Number.isFinite(n.getTime())?n:null}function C4(){return Sn()?lL(sL()):null}function cL(){if(typeof import.meta<"u"&&Au){const e="".trim();if(e)return e}if(typeof window<"u"){const e=new URLSearchParams(window.location.search),t=String(e.get("mock_seed")||"").trim();if(t)return t}return v0}function uL(){if(typeof import.meta<"u"&&Au){const e="".trim(),t=Number(e);if(Number.isFinite(t)&&t>0)return Math.floor(t)}if(typeof window<"u"){const e=new URLSearchParams(window.location.search),t=String(e.get("mock_missing")||"").trim(),n=Number(t);if(Number.isFinite(n)&&n>0)return Math.floor(n)}return 0}function Gs(e){return(e==null?cL():String(e)).trim()||v0}function qs(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function cn(e){if(typeof e!="string")return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());if(!t)return null;const n=Number(t[1]),a=Number(t[2])-1,o=Number(t[3]),s=new Date(Date.UTC(n,a,o));return Number.isFinite(s.getTime())&&yt(s)===e.trim()?s:null}function Os(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+t))}function k0(e,t){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+t,1))}function dL(e){return`${e.getUTCFullYear()}-${String(e.getUTCMonth()+1).padStart(2,"0")}`}function po({from:e,to:t,seed:n}){const a=cn(Pr(new Date))||new Date,o=cn(e)||a,s=cn(t)||o,c=[],u=Gs(n),h=Math.floor((Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate())-Date.UTC(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()))/864e5)+1;for(let f=0;f<h;f+=1){const m=Os(o,f),y=yt(m),k=qs(`${u}:${y}`),w=k%1e3/1e3,x=.6+.4*Math.sin(f/6*Math.PI*.5),C=m.getUTCDay()===0||m.getUTCDay()===6?.65:1,S=18e3+Math.round(12e3*w),D=Math.max(0,Math.round(S*x*C)),L=Math.round(D*.46),R=Math.round(D*.34),O=Math.round(D*.14),G=Math.max(0,D-L-R-O),W={};if(D>0){const z=["gpt-4o","claude-3.5-sonnet","gemini-1.5-pro","deepseek-coder"],P=1+k%3;let Y=D;for(let X=0;X<P;X++){const de=z[(k+X)%z.length];if(X===P-1)W[de]=Y;else{const se=Math.round(Y*(.3+.4*((k+X*17)%10)/10));W[de]=se,Y-=se}}}c.push({day:y,total_tokens:D,billable_total_tokens:D,input_tokens:L,output_tokens:R,cached_input_tokens:O,reasoning_output_tokens:G,conversation_count:1+k%5,models:W})}return c}function hL({day:e,seed:t}){const n=cn(e)||cn(Pr(new Date))||new Date,a=yt(n),o=Gs(t),s=Array.from({length:48},(u,h)=>{const f=Math.floor(h/2),m=h%2===0?0:30,y=qs(`${o}:${a}:${f}:${m}`),k=y%1e3/1e3,w=(f+m/60)/24,x=.4+.6*Math.sin(w*Math.PI*2),C=900+Math.round(700*k),S=Math.max(0,Math.round(C*x)),D=Math.round(S*.46),L=Math.round(S*.34),R=Math.round(S*.14),O=Math.max(0,S-D-L-R),G={};if(S>0){const W=["gpt-4o","claude-3.5-sonnet","gemini-1.5-pro","deepseek-coder"],z=1+y%2;let P=S;for(let Y=0;Y<z;Y++){const X=W[(y+Y)%W.length];if(Y===z-1)G[X]=P;else{const de=Math.round(P*(.3+.4*((y+Y*17)%10)/10));G[X]=de,P-=de}}}return{hour:`${a}T${String(f).padStart(2,"0")}:${String(m).padStart(2,"0")}:00`,total_tokens:S,billable_total_tokens:S,input_tokens:D,output_tokens:L,cached_input_tokens:R,reasoning_output_tokens:O,models:G}}),c=Math.max(0,Math.min(48,uL()));if(c>0){const u=Date.now(),h=s.map((y,k)=>{const w=Date.parse(y.hour);return Number.isFinite(w)&&w<=u?{index:k,ts:w}:null}).filter(Boolean),f=Math.max(0,h.length-c),m=h.slice(f);for(const y of m){const k=s[y.index];k&&(s[y.index]={...k,missing:!0})}}return s}function fL({months:e=24,to:t,seed:n}){const a=cn(t)||cn(Pr(new Date))||new Date,o=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1)),s=Gs(n),c=[];for(let u=e-1;u>=0;u-=1){const h=k0(o,-u),f=dL(h),m=qs(`${s}:${f}`),y=m%1e3/1e3,k=.7+.3*Math.sin(c.length/6*Math.PI*.5),w=36e4+Math.round(2e5*y),x=Math.max(0,Math.round(w*k)),C=Math.round(x*.46),S=Math.round(x*.34),D=Math.round(x*.14),L=Math.max(0,x-C-S-D),R={};if(x>0){const O=["gpt-4o","claude-3.5-sonnet","gemini-1.5-pro","deepseek-coder"],G=1+m%3;let W=x;for(let z=0;z<G;z++){const P=O[(m+z)%O.length];if(z===G-1)R[P]=W;else{const Y=Math.round(W*(.3+.4*((m+z*17)%10)/10));R[P]=Y,W-=Y}}}c.push({month:f,total_tokens:x,billable_total_tokens:x,input_tokens:C,output_tokens:S,cached_input_tokens:D,reasoning_output_tokens:L,models:R})}return c}function Rp(e){return e.reduce((t,n)=>(t.total_tokens+=Number(n.total_tokens||0),t.billable_total_tokens+=Number(n.billable_total_tokens||n.total_tokens||0),t.input_tokens+=Number(n.input_tokens||0),t.output_tokens+=Number(n.output_tokens||0),t.cached_input_tokens+=Number(n.cached_input_tokens||0),t.reasoning_output_tokens+=Number(n.reasoning_output_tokens||0),t.conversation_count+=Number(n.conversation_count||0),t),{total_tokens:0,billable_total_tokens:0,input_tokens:0,output_tokens:0,cached_input_tokens:0,reasoning_output_tokens:0,conversation_count:0})}function pL(e,t=1.75){const n=Number(e||0);return!Number.isFinite(n)||n<=0?"0.000000":(n*t/1e6).toFixed(6)}function qv(e,t){const n=Number.isFinite(t)?t:0;return{total_tokens:Math.max(0,Math.round(e.total_tokens*n)),billable_total_tokens:Math.max(0,Math.round((e.billable_total_tokens??e.total_tokens)*n)),input_tokens:Math.max(0,Math.round(e.input_tokens*n)),output_tokens:Math.max(0,Math.round(e.output_tokens*n)),cached_input_tokens:Math.max(0,Math.round(e.cached_input_tokens*n)),reasoning_output_tokens:Math.max(0,Math.round(e.reasoning_output_tokens*n))}}function xf(e){return{...e,total_cost_usd:pL(e.total_tokens)}}function mL({from:e,to:t,seed:n}={}){const a=po({from:e,to:t,seed:n});return{from:e,to:t,data:a}}function gL({day:e,seed:t}={}){const n=cn(e)||new Date,a=yt(n),o=hL({day:a,seed:t});return{day:a,data:o}}function yL({months:e=24,to:t,seed:n}={}){const a=cn(t)||cn(Pr(new Date))||new Date,o=yt(a),s=fL({months:e,to:o,seed:n}),c=k0(new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1)),-(e-1));return{from:yt(c),to:o,months:e,data:s}}function vL({from:e,to:t,seed:n,rolling:a=!0}={}){const o=po({from:e,to:t,seed:n}),s=Rp(o),c=xf(s),u=a?kL({to:t,seed:n}):null;return{from:e,to:t,days:o.length,totals:c,...u?{rolling:u}:{}}}function kL({to:e,seed:t}={}){const n=cn(e)||cn(Pr(new Date))||new Date,a=yt(n),o=yt(Os(n,-6)),s=yt(Os(n,-29)),c=po({from:o,to:a,seed:t}),u=po({from:s,to:a,seed:t});return{last_7d:Yv({rows:c,from:o,to:a}),last_30d:Yv({rows:u,from:s,to:a})}}function Yv({rows:e,from:t,to:n}={}){const a=Rp(e||[]),o=(e||[]).filter(c=>Number(c.billable_total_tokens??c.total_tokens)>0).length,s=o>0?Math.floor(a.billable_total_tokens/o):0;return{from:t,to:n,totals:{billable_total_tokens:a.billable_total_tokens,conversation_count:a.conversation_count},active_days:o,avg_per_active_day:s}}function _L({seed:e,limit:t=3}={}){const n=Gs(e),a=oL.map((o,s)=>{const u=12e4+qs(`${n}:${o}`)%9e5,h=s%4*4200,f=Math.max(0,u+h),m=Math.max(0,Math.round(f*.96));return{project_key:o,project_ref:`https://github.com/${o}`,total_tokens:String(f),billable_total_tokens:String(m)}}).sort((o,s)=>Number(s.billable_total_tokens)-Number(o.billable_total_tokens)).slice(0,Math.max(1,Math.min(10,Math.floor(Number(t)||3))));return{generated_at:new Date().toISOString(),entries:a}}function bL(e){const t=cn(Pr(new Date))||new Date,n=String(e).trim().toLowerCase()||"week";if(n==="total")return{from:"1970-01-01",to:"9999-12-31"};if(n==="month"){const c=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),1)),u=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,0));return{from:yt(c),to:yt(u)}}const a=t.getUTCDay(),o=yt(Os(t,-a)),s=yt(Os(t,-a+6));return{from:o,to:s}}function _0({seed:e,period:t,metric:n,limit:a=20,offset:o=0}={}){const s=Gs(e),c=Math.max(1,Math.min(100,Math.floor(Number(a)||20))),u=Math.max(0,Math.min(1e4,Math.floor(Number(o)||0))),h=String(n||"all").trim().toLowerCase()||"all",f=String(t||"week").trim().toLowerCase()||"week",m=f==="month"||f==="total"||f==="week"?f:"week",{from:y,to:k}=bL(m),w=250,x=w>0?Math.ceil(w/c):0,C=Math.floor(u/c)+1,S=Array.from({length:w},(z,P)=>{const Y=P+1,X=`00000000-0000-0000-0000-${String(Y).padStart(12,"0")}`,de=Gv[Y%Gv.length],Ae=18e4+qs(`${s}:${de}:${Y}`)%9e5,fe=Math.max(0,Ae+Y*1200),le=Math.floor(fe*.28),pe=Math.floor(fe*.18),Ne=Math.floor(fe*.1),K=Math.floor(fe*.1),Z=Math.floor(fe*.08),H=Math.floor(fe*.03),I=Math.floor(fe*.02),q=Math.floor(fe*.04),xe=Math.floor(fe*.03),Re=Math.max(0,fe-le-pe-Ne-K-Z-H-I-q-xe),Pe=Y%7!==0;return{id:Y,user_id:X,is_public:Pe,is_me:!1,display_name:Pe?de:"Anonymous",avatar_url:null,gpt_tokens:le,claude_tokens:pe,gemini_tokens:Ne,cursor_tokens:K,opencode_tokens:Z,openclaw_tokens:Re,hermes_tokens:H,kiro_tokens:I,copilot_tokens:q,kimi_tokens:xe,other_tokens:0,total_tokens:fe}}),D=Math.max(0,Math.min(w-1,Math.floor(w*.8)));S[D]&&(S[D].is_me=!0);const L=h==="gpt"||h==="codex"?"gpt_tokens":h==="claude"?"claude_tokens":h==="gemini"?"gemini_tokens":h==="cursor"?"cursor_tokens":h==="opencode"?"opencode_tokens":h==="openclaw"?"openclaw_tokens":h==="hermes"?"hermes_tokens":h==="kiro"?"kiro_tokens":h==="copilot"?"copilot_tokens":h==="kimi"?"kimi_tokens":"total_tokens",R=S.slice().sort((z,P)=>Number(P[L])-Number(z[L])||z.id-P.id).map((z,P)=>({user_id:z.is_public?z.user_id:null,rank:P+1,is_me:!!z.is_me,display_name:z.display_name,avatar_url:z.avatar_url,gpt_tokens:String(z.gpt_tokens),claude_tokens:String(z.claude_tokens),gemini_tokens:String(z.gemini_tokens),cursor_tokens:String(z.cursor_tokens),opencode_tokens:String(z.opencode_tokens),openclaw_tokens:String(z.openclaw_tokens),hermes_tokens:String(z.hermes_tokens??0),kiro_tokens:String(z.kiro_tokens??0),copilot_tokens:String(z.copilot_tokens??0),kimi_tokens:String(z.kimi_tokens??0),other_tokens:String(z.other_tokens??0),total_tokens:String(z.total_tokens),is_public:!!z.is_public})),O=R.find(z=>z?.is_me)||null,G=O?{rank:O.rank,gpt_tokens:O.gpt_tokens,claude_tokens:O.claude_tokens,gemini_tokens:O.gemini_tokens,cursor_tokens:O.cursor_tokens,opencode_tokens:O.opencode_tokens,openclaw_tokens:O.openclaw_tokens,hermes_tokens:O.hermes_tokens,kiro_tokens:O.kiro_tokens,copilot_tokens:O.copilot_tokens,kimi_tokens:O.kimi_tokens,other_tokens:O.other_tokens,total_tokens:O.total_tokens}:{rank:null,gpt_tokens:"0",claude_tokens:"0",gemini_tokens:"0",cursor_tokens:"0",opencode_tokens:"0",openclaw_tokens:"0",hermes_tokens:"0",kiro_tokens:"0",copilot_tokens:"0",kimi_tokens:"0",other_tokens:"0",total_tokens:"0"},W=R.slice(u,u+c);return{period:m,metric:h,from:y,to:k,generated_at:new Date().toISOString(),page:C,limit:c,offset:u,total_entries:w,total_pages:x,entries:W,me:G}}function wL({weeks:e=52,to:t,weekStartsOn:n="sun",seed:a}={}){const o=y0({weeks:e,now:cn(t)||cn(Pr(new Date))||new Date,weekStartsOn:n}),s=po({from:o.from,to:o.to,seed:a});return{...aL({dailyRows:s,weeks:e,to:o.to,weekStartsOn:n}),week_starts_on:n,active_days:s.filter(u=>Number(u.billable_total_tokens??u.total_tokens)>0).length,streak_days:iL({dailyRows:s,to:o.to})}}function xL({from:e,to:t,seed:n}={}){const a=po({from:e,to:t,seed:n}),o=Rp(a),c=[{source:"codex",weight:.7,models:[{model:"gpt-5.2-codex",model_id:"gpt-5.2-codex",weight:.2},{model:"unknown",model_id:"unknown",weight:.8}]},{source:"claude",weight:.2,models:[{model:"claude-3.5",model_id:"claude-3.5",weight:.3},{model:"unknown",model_id:"unknown",weight:.7}]},{source:"every-code",weight:.1,models:[{model:"unknown",model_id:"unknown",weight:1}]}].map(u=>{const h=qv(o,u.weight),f=u.models.map(m=>{const y=qv(h,m.weight);return{model:m.model,model_id:m.model_id||m.model,totals:xf(y)}});return{source:u.source,totals:xf(h),models:f}});return{from:e,to:t,days:a.length,sources:c,pricing:{model:"mock",pricing_mode:"add",source:"mock",effective_from:Pr(new Date),rates_per_million_usd:{input:"1.750000",cached_input:"0.175000",output:"14.000000",reasoning_output:"14.000000"}}}}function PL({from:e,to:t,source:n="claude"}={}){if(n==="codex")return{from:e,to:t,source:"codex",scope:"supported",totals:{input_tokens:142e4,cached_input_tokens:588e4,cache_creation_input_tokens:92e4,output_tokens:256e4,reasoning_output_tokens:61e4,total_tokens:1078e4},session_count:188,message_count:5436,tool_calls_breakdown:{categories:[{name:"Execution",calls:742,totals:{input_tokens:32e4,cached_input_tokens:104e4,cache_creation_input_tokens:11e4,output_tokens:46e4,reasoning_output_tokens:12e4,total_tokens:193e4},tools:[{name:"exec_command",calls:510,totals:{input_tokens:25e4,cached_input_tokens:82e4,cache_creation_input_tokens:8e4,output_tokens:37e4,reasoning_output_tokens:9e4,total_tokens:152e4}},{name:"write_stdin",calls:232,totals:{input_tokens:7e4,cached_input_tokens:22e4,cache_creation_input_tokens:3e4,output_tokens:9e4,reasoning_output_tokens:3e4,total_tokens:41e4}}]},{name:"Browser",calls:406,totals:{input_tokens:21e4,cached_input_tokens:88e4,cache_creation_input_tokens:9e4,output_tokens:42e4,reasoning_output_tokens:1e5,total_tokens:17e5},tools:[{name:"take_snapshot",calls:180,totals:{input_tokens:1e5,cached_input_tokens:4e5,cache_creation_input_tokens:4e4,output_tokens:18e4,reasoning_output_tokens:4e4,total_tokens:76e4}},{name:"click",calls:126,totals:{input_tokens:6e4,cached_input_tokens:25e4,cache_creation_input_tokens:3e4,output_tokens:12e4,reasoning_output_tokens:35e3,total_tokens:495e3}},{name:"evaluate_script",calls:100,totals:{input_tokens:5e4,cached_input_tokens:23e4,cache_creation_input_tokens:2e4,output_tokens:12e4,reasoning_output_tokens:25e3,total_tokens:445e3}}]}],tools_total:363e4,privacy:{includes_inputs:!1,note:"Aggregated tool names only; no tool arguments or outputs are included."}},exec_command_breakdown:{by_type:[{name:"test",calls:168,failures:14,duration_ms:482e3,max_duration_ms:18400,output_chars:45e4,output_lines:8600,totals:{input_tokens:9e4,cached_input_tokens:32e4,output_tokens:16e4,reasoning_output_tokens:42e3,total_tokens:612e3}},{name:"build",calls:116,failures:9,duration_ms:392e3,max_duration_ms:22100,output_chars:31e4,output_lines:5200,totals:{input_tokens:7e4,cached_input_tokens:24e4,output_tokens:13e4,reasoning_output_tokens:3e4,total_tokens:47e4}}],by_exit:[{name:"completed:0",calls:438,failures:0,duration_ms:104e4,max_duration_ms:22100,output_chars:83e4,output_lines:13100,totals:{input_tokens:22e4,cached_input_tokens:78e4,output_tokens:35e4,reasoning_output_tokens:82e3,total_tokens:1432e3}},{name:"completed:1",calls:72,failures:72,duration_ms:155e3,max_duration_ms:11800,output_chars:12e4,output_lines:2300,totals:{input_tokens:3e4,cached_input_tokens:11e4,output_tokens:55e3,reasoning_output_tokens:8e3,total_tokens:195e3}}]}};if(n!=="claude")return{from:e,to:t,source:n,scope:"unsupported",totals:{input_tokens:0,cached_input_tokens:0,cache_creation_input_tokens:0,output_tokens:0,reasoning_output_tokens:0,total_tokens:0},categories:["system_prefix","conversation_history","user_input","tool_calls","subagents","reasoning","assistant_response"].map(c=>({key:c,totals:{input_tokens:0,cached_input_tokens:0,cache_creation_input_tokens:0,output_tokens:0,reasoning_output_tokens:0,total_tokens:0},percent:0})),session_count:0,message_count:0};const a=[{key:"system_prefix",total:12896539},{key:"conversation_history",total:320207200},{key:"user_input",total:998025},{key:"tool_calls",total:4808739},{key:"subagents",total:1022828},{key:"reasoning",total:11073118},{key:"assistant_response",total:1289174}],o=a.reduce((c,u)=>c+u.total,0),s=a.map(({key:c,total:u})=>({key:c,totals:{input_tokens:c==="user_input"?u:0,cached_input_tokens:c==="conversation_history"?Math.round(u*.95):0,cache_creation_input_tokens:c==="system_prefix"?u:c==="conversation_history"?Math.round(u*.05):0,output_tokens:["tool_calls","subagents","reasoning","assistant_response"].includes(c)?u:0,reasoning_output_tokens:c==="reasoning"?u:0,total_tokens:u},percent:Number((u/o*100).toFixed(2))}));return{from:e,to:t,source:"claude",scope:"supported",totals:{input_tokens:998025,cached_input_tokens:Math.round(320207200*.95),cache_creation_input_tokens:12896539+Math.round(320207200*.05),output_tokens:18193859,reasoning_output_tokens:11073118,total_tokens:o},categories:s,session_count:312,message_count:12046}}let Oc=null;function SL(){Oc=null}async function CL(e=fetch){if(Oc)return Oc;const t=await e("/api/local-auth",{method:"GET",headers:{Accept:"application/json"},cache:"no-store"});if(!t.ok)throw new Error(`Local auth request failed with HTTP ${t.status}`);const n=await t.json().catch(()=>null),a=typeof n?.token=="string"?n.token.trim():"";if(!a)throw new Error("Local auth token missing from response");return Oc=a,a}async function Lp(e=fetch){return{"x-tokentracker-local-auth":await CL(e)}}const sr={usageSummary:"tokentracker-usage-summary",usageDaily:"tokentracker-usage-daily",usageHourly:"tokentracker-usage-hourly",usageMonthly:"tokentracker-usage-monthly",usageHeatmap:"tokentracker-usage-heatmap",usageModelBreakdown:"tokentracker-usage-model-breakdown",usageCategoryBreakdown:"tokentracker-usage-category-breakdown",projectUsageSummary:"tokentracker-project-usage-summary",userStatus:"tokentracker-user-status",localSync:"tokentracker-local-sync",usageLimits:"tokentracker-usage-limits"},TL={"tokentracker-usage-summary":"tokentracker-account-summary","tokentracker-usage-daily":"tokentracker-account-daily","tokentracker-usage-hourly":"tokentracker-account-hourly","tokentracker-usage-monthly":"tokentracker-account-monthly","tokentracker-usage-heatmap":"tokentracker-account-heatmap","tokentracker-usage-model-breakdown":"tokentracker-account-model-breakdown"};function EL(){return typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1")}async function Sr(e,t,n){const a=n?.accessToken,o=TL[e];if(!EL()&&a&&o){const f=Wr().replace(/\/$/,""),m=new URL(`${f}/functions/${o}`);if(t)for(const[x,C]of Object.entries(t))C!=null&&C!==""&&m.searchParams.set(x,String(C));const y={Accept:"application/json"},k=Ks();k&&(y.apikey=k),o0(a)&&(y.Authorization=`Bearer ${a}`);const w=await fetch(m.toString(),{headers:y,cache:"no-store"});if(!w.ok){const x=new Error(`Request failed with HTTP ${w.status}`);throw x.status=w.status,x}return w.json()}const s=new URL(`/functions/${e}`,window.location.origin);if(t)for(const[f,m]of Object.entries(t))m!=null&&m!==""&&s.searchParams.set(f,String(m));const{accessToken:c,...u}=n||{},h=await fetch(s.toString(),{headers:{Accept:"application/json"},cache:"no-store",...u});if(!h.ok){const f=new Error(`Request failed with HTTP ${h.status}`);throw f.status=h.status,f}return h.json()}function Oa({timeZone:e,tzOffsetMinutes:t}={}){const n={},a=typeof e=="string"?e.trim():"";return a&&(n.tz=a),Number.isFinite(t)&&(n.tz_offset_minutes=String(Math.trunc(t))),n}function mi({source:e,model:t}={}){const n={},a=typeof e=="string"?e.trim().toLowerCase():"";a&&(n.source=a);const o=typeof t=="string"?t.trim():"";return o&&(n.model=o),n}async function T4({from:e,to:t,source:n,model:a,timeZone:o,tzOffsetMinutes:s,rolling:c=!1,accessToken:u}={}){if(Sn())return vL({from:e,to:t,seed:u,rolling:c});const h=Oa({timeZone:o,tzOffsetMinutes:s}),f=mi({source:n,model:a}),m=c?{rolling:"1"}:{};return Sr(sr.usageSummary,{from:e,to:t,...f,...h,...m},{accessToken:u})}async function E4({from:e,to:t,source:n,limit:a,timeZone:o,tzOffsetMinutes:s,accessToken:c}={}){if(Sn())return _L({seed:c,limit:a});const u=Oa({timeZone:o,tzOffsetMinutes:s}),f={...mi({source:n}),...u};return e&&(f.from=e),t&&(f.to=t),a!=null&&(f.limit=String(a)),Sr(sr.projectUsageSummary,f)}async function Ys(e,t={}){const n=Wr();if(!n)throw new Error("InsForge base URL not configured");const a=n.replace(/\/$/,""),o=new URL(`${a}/functions/${e}`);if(t.params)for(const[h,f]of Object.entries(t.params))f!=null&&f!==""&&o.searchParams.set(h,String(f));const s={Accept:"application/json","Content-Type":"application/json"},c=Ks();c&&(s.apikey=c),t.accessToken&&o0(t.accessToken)&&(s.Authorization=`Bearer ${t.accessToken}`);const u=await fetch(o.toString(),{method:t.method||"GET",headers:s,...t.body!=null?{body:JSON.stringify(t.body)}:{}});if(!u.ok){const h=new Error(`Request failed with HTTP ${u.status}`);throw h.status=u.status,h}return u.json()}async function A4({accessToken:e,userId:t,period:n,metric:a,limit:o,offset:s}={}){return Sn()?_0({seed:e||t,period:n,metric:a,limit:o,offset:s}):Ys("tokentracker-leaderboard",{params:{period:n,limit:o,offset:s,user_id:t}})}async function Zv({accessToken:e}={}){return Ys("tokentracker-public-visibility",{accessToken:e,method:"GET"})}async function R4({accessToken:e,enabled:t,anonymous:n,display_name:a,github_url:o,show_github_url:s}={}){const c={};return t!==void 0&&(c.enabled=!!t),n!==void 0&&(c.anonymous=!!n),a!==void 0&&(c.display_name=String(a)),o!==void 0&&(c.github_url=o===null?null:String(o)),s!==void 0&&(c.show_github_url=!!s),Ys("tokentracker-public-visibility",{accessToken:e,method:"POST",body:c})}async function L4({accessToken:e,period:t,source:n}={}){const a={};return t&&(a.period=t),typeof n=="string"&&n.trim()&&(a.source=n.trim()),Ys("tokentracker-leaderboard-refresh",{accessToken:e,method:"POST",body:a})}async function D4({accessToken:e,userId:t,period:n}={}){if(Sn()){const a=_0({seed:e,period:n,metric:"all",limit:250,offset:0}),o=Array.isArray(a?.entries)?a.entries:[],s=o.find(m=>m?.user_id===t)||o[0]||null,c=Number(s?.total_tokens)||0,u=new Date,h=Array.from({length:365}).map((m,y)=>{const k=new Date(u);return k.setUTCDate(k.getUTCDate()-(364-y)),{date:k.toISOString().slice(0,10),total_tokens:y%7===0?Math.floor(c/365):0}}),f=h.slice(-7);return{user:{user_id:t,display_name:s?.display_name||"Mock User",avatar_url:s?.avatar_url||null,github_url:s?.github_url||null,is_anonymous:!1,rank:s?.rank??null},period:{kind:n||"week",from:a?.from??null,to:a?.to??null,generated_at:a?.generated_at??new Date().toISOString()},totals:{total_tokens:c,estimated_cost_usd:Number(s?.estimated_cost_usd)||0,active_days:53,avg_per_day_usd:0},streak:{current_days:3,longest_days:12},best_day:c?{date:u.toISOString().slice(0,10),total_tokens:Math.floor(c/30),estimated_cost_usd:0}:null,models:{count:5,favorite:{model_name:"claude-opus-4-7",total_tokens:Math.floor(c/2)}},by_provider:[],heatmap:h,daily_trend:f}}return Ys("tokentracker-leaderboard-profile",{accessToken:e,params:{user_id:t,period:n}})}async function M4(e={}){if(Sn()){const t=new Date().toISOString();return{user_id:"local-user",created_at:t,pro:{active:!1,sources:[],expires_at:null,partial:!1,as_of:t},subscriptions:{partial:!1,as_of:t,items:[]},install:{partial:!1,as_of:t,has_active_device_token:!1,has_active_device:!1,active_device_tokens:0,active_devices:0,latest_token_activity_at:null,latest_device_seen_at:null}}}return Sr(sr.userStatus)}async function I4({signal:e}={}){const t=await Lp(),n=await fetch(`/functions/${sr.localSync}`,{method:"POST",headers:{Accept:"application/json",...t},cache:"no-store",signal:e}),a=await n.json().catch(()=>({ok:!1,error:`Local sync request failed with HTTP ${n.status}`}));if(!n.ok||a?.ok===!1){const o=a?.error||a?.message||`Local sync request failed with HTTP ${n.status}`,s=new Error(o);throw s.status=n.status,s}return a}async function N4({from:e,to:t,source:n,timeZone:a,tzOffsetMinutes:o,accessToken:s}={}){if(Sn())return xL({from:e,to:t,seed:s});const c=Oa({timeZone:a,tzOffsetMinutes:o}),u=mi({source:n});return Sr(sr.usageModelBreakdown,{from:e,to:t,...u,...c},{accessToken:s})}async function O4({from:e,to:t,source:n="claude",timeZone:a,tzOffsetMinutes:o}={}){if(Sn())return PL({from:e,to:t,source:n});const s=Oa({timeZone:a,tzOffsetMinutes:o});return Sr(sr.usageCategoryBreakdown,{from:e,to:t,source:n,...s})}async function j4({from:e,to:t,source:n,model:a,timeZone:o,tzOffsetMinutes:s,accessToken:c}={}){if(Sn())return mL({from:e,to:t,seed:c});const u=Oa({timeZone:o,tzOffsetMinutes:s}),h=mi({source:n,model:a});return Sr(sr.usageDaily,{from:e,to:t,...h,...u},{accessToken:c})}async function U4({day:e,source:t,model:n,timeZone:a,tzOffsetMinutes:o,accessToken:s}={}){if(Sn())return gL({day:e,seed:s});const c=Oa({timeZone:a,tzOffsetMinutes:o}),u=mi({source:t,model:n}),h=e?{day:e,...u,...c}:{...u,...c};return Sr(sr.usageHourly,h,{accessToken:s})}async function B4({months:e,to:t,source:n,model:a,timeZone:o,tzOffsetMinutes:s,accessToken:c}={}){if(Sn())return yL({months:e,to:t,seed:c});const u=Oa({timeZone:o,tzOffsetMinutes:s}),h=mi({source:n,model:a});return Sr(sr.usageMonthly,{...e?{months:String(e)}:{},...t?{to:t}:{},...h,...u},{accessToken:c})}async function F4(e={}){const t=e?.refresh?{refresh:"1"}:void 0;return Sr(sr.usageLimits,t)}async function V4({weeks:e,to:t,weekStartsOn:n,source:a,model:o,timeZone:s,tzOffsetMinutes:c,accessToken:u}={}){if(Sn())return wL({weeks:e,to:t,weekStartsOn:n,seed:u});const h=Oa({timeZone:s,tzOffsetMinutes:c}),f=mi({source:a,model:o});return Sr(sr.usageHeatmap,{weeks:String(e),to:t,week_starts_on:n,...f,...h},{accessToken:u})}const b0=b.createContext(null);function AL(e){if(!e||typeof e!="object")return"";const t=e.user_metadata&&typeof e.user_metadata=="object"?e.user_metadata:{},n=e.profile&&typeof e.profile=="object"?e.profile:{},a=t.full_name||t.name||n.name||t.user_name||t.preferred_username;return typeof a=="string"&&a.trim()?a.trim():typeof e.email=="string"&&e.email.includes("@")?e.email.split("@")[0].trim()||e.email.trim():typeof e.email=="string"?e.email.trim():""}function Xv(e){if(!e||typeof e!="object")return null;const t=e,n=t.session&&typeof t.session=="object"?t.session:null,a=typeof t.accessToken=="string"&&t.accessToken||typeof t.access_token=="string"&&t.access_token||n&&typeof n.accessToken=="string"&&n.accessToken||n&&typeof n.access_token=="string"&&n.access_token||null;return a&&a.length>0?a:null}async function Nh(e,t={}){if(!e)return null;const n=Math.max(0,Math.floor(Number(t.skewMs)||6e4)),a=e.tokenManager,o=()=>a?.getAccessToken?.()??a?.getSession?.()?.accessToken??null;let s=o();if(!s||zR(s,n)){const{data:c}=await e.auth.refreshSession();if(s=o()??Xv(c)??null,!s&&typeof e.auth.getCurrentUser=="function")try{await e.auth.getCurrentUser(),s=o()??Xv(c)??null}catch{}}return s||null}function RL({children:e}){const[t,n]=b.useState(null),[a,o]=b.useState(null),[s,c]=b.useState(!0);b.useEffect(()=>{if(!wf()){n(null),o(null),c(!1);return}n(NR())},[]),b.useEffect(()=>{if(!t)return;let W=!0;return c(!0),(async()=>{try{let{data:z,error:P}=await t.auth.getCurrentUser();if(!W)return;if(!P&&!z?.user){if(await new Promise(X=>setTimeout(X,150)),!W)return;const Y=await t.auth.getCurrentUser();z=Y.data,P=Y.error}if(P){o(null);return}o(z?.user??null)}catch{W&&o(null)}finally{W&&c(!1)}})(),()=>{W=!1}},[t]);const u=b.useCallback(async()=>{if(t)try{let{data:W,error:z}=await t.auth.getCurrentUser();if(!z&&!W?.user){await new Promise(Y=>setTimeout(Y,150));const P=await t.auth.getCurrentUser();W=P.data,z=P.error}if(z){o(null);return}o(W?.user??null)}catch{o(null)}},[t]),h=b.useCallback(async(W,z)=>{if(!t)return{error:new Error("InsForge client not configured")};const P=typeof window<"u"&&window.webkit?.messageHandlers?.nativeOAuth;if(P){const de=typeof z=="string"&&z.trim()?z.trim():`${window.location.origin}/auth/callback`,se=await t.auth.signInWithOAuth({provider:W,redirectTo:de,skipBrowserRedirect:!0});if(se.data?.url){try{const Ae=await Lp();await fetch("/api/auth-bridge/verifier",{method:"PUT",headers:{"Content-Type":"application/json",...Ae},body:JSON.stringify({native:!0})})}catch{}P.postMessage(se.data.url)}return se}const Y=typeof z=="string"&&z.trim()?z.trim():typeof window<"u"?`${window.location.origin}/dashboard`:void 0;return await t.auth.signInWithOAuth({provider:W,redirectTo:Y})},[t]),f=b.useCallback(async W=>{if(!t)return{data:null,error:new Error("InsForge client not configured")};const{data:z,error:P}=await t.auth.signInWithPassword(W);return z?.user&&o(z.user),{data:z,error:P}},[t]),m=b.useCallback(async W=>{if(!t)return{data:null,error:new Error("InsForge client not configured")};const{data:z,error:P}=await t.auth.signUp(W);return z?.user&&z?.accessToken&&o(z.user),{data:z,error:P}},[t]),y=b.useCallback(async()=>t?t.auth.getPublicAuthConfig():{data:null,error:new Error("InsForge client not configured")},[t]),k=b.useCallback(async()=>{t&&(await t.auth.signOut(),a0(),SL(),o(null))},[t]),w=b.useCallback(async()=>Nh(t),[t]),[x,C]=b.useState(null),[S,D]=b.useState(!1),L=b.useMemo(()=>AL(a),[a]);b.useEffect(()=>{if(!a||!t){C(null),D(!1);return}let W=!0;return(async()=>{try{const z=await Nh(t);if(!W||!z){W&&D(!0);return}const P=await Zv({accessToken:z});W&&P?.display_name&&C(P.display_name)}catch{}W&&D(!0)})(),()=>{W=!1}},[a,t]);const R=S?x||L:"",O=b.useCallback(async()=>{if(t)try{const W=await Nh(t);if(!W)return;const z=await Zv({accessToken:W});z?.display_name&&C(z.display_name)}catch{}},[t]),G=b.useMemo(()=>!wf()||!t?{enabled:!1,client:null,user:null,signedIn:!1,loading:!1,displayName:"",refreshUser:async()=>{},refreshDisplayName:async()=>{},signInWithOAuth:async()=>({error:new Error("InsForge not configured")}),signInWithPassword:async()=>({data:null,error:new Error("InsForge not configured")}),signUp:async()=>({data:null,error:new Error("InsForge not configured")}),getPublicAuthConfig:async()=>({data:null,error:new Error("InsForge not configured")}),signOut:async()=>{},getAccessToken:async()=>null}:{enabled:!0,client:t,user:a,signedIn:!!a,loading:s,displayName:R,refreshUser:u,refreshDisplayName:O,signInWithOAuth:h,signInWithPassword:f,signUp:m,getPublicAuthConfig:y,signOut:k,getAccessToken:w},[t,a,s,R,u,O,h,f,m,y,k,w]);return N.jsx(b0.Provider,{value:G,children:e})}function Zs(){return b.useContext(b0)}const LL=`key,module,page,component,slot,text,notes,status
43
43
  header.auth.sign_in_aria,shared,*,InsforgeUserHeaderControls,sign_in_aria,"Sign in",,active
44
44
  login.back_home,shared,LoginPage,LoginPage,back_home,"Back to home",,active
45
45
  login.cloud_only,shared,LoginPage,LoginPage,cloud_only,"Cloud sign-in is not configured. Use the local dashboard on localhost.",,active
@@ -824,9 +824,14 @@ leaderboard.profile_modal.models.none,dashboard,LeaderboardProfileModal,Models,n
824
824
  leaderboard.profile_modal.heatmap.title,dashboard,LeaderboardProfileModal,Heatmap,title,"Activity (last 365 days)",,active
825
825
  leaderboard.profile_modal.providers.title,dashboard,LeaderboardProfileModal,Providers,title,"By provider",,active
826
826
  leaderboard.profile_modal.providers.none,dashboard,LeaderboardProfileModal,Providers,none,"No usage this period.",,active
827
- `,EL={"header.auth.sign_in_aria":"登录","login.back_home":"返回首页","login.cloud_only":"未配置云端登录。请使用 localhost 上的本地仪表盘。","login.title":"登录","login.subtitle":"选择邮箱或已连接账号。","login.dismiss":"关闭","login.verify_email_success":"邮箱已验证。你现在可以登录。","login.verify_email_pending":"请先在邮箱中完成验证,然后再登录。","login.oauth.continue":"使用 {{provider}} 继续","login.divider":"或","login.tab.sign_in":"登录","login.tab.sign_up":"创建账户","login.field.name":"显示名称","login.field.name_placeholder":"可选","login.field.email":"电子邮件","login.field.password":"密码","login.password_hint":"至少 {{min}} 个字符。","login.submit.sign_in":"使用邮箱登录","login.submit.sign_up":"创建账号","auth.callback.processing":"处理中…","auth.callback.success":"登录成功","auth.callback.redirecting":"正在返回 TokenTracker…","auth.callback.failed":"登录未完成,请重试。","auth.callback.close":"关闭此页","login_modal.subtitle":"登录以加入排行榜","login_modal.continue_email":"使用邮箱继续","login_modal.divider_email":"邮箱","shared.placeholder.short":"--","shared.unit.percent":"%","shared.unit.thousand_abbrev":"K","shared.unit.million_abbrev":"M","shared.unit.billion_abbrev":"B","shared.data_source":"数据来源:{{source}}","shared.error.prefix":"错误:{{error}}","shared.status.unsynced":"—","shared.time.now":"刚刚","error.boundary.title":"出了点问题","error.boundary.subtitle":"这个视图渲染失败了","error.boundary.hint":"打开控制台,然后重新加载页面","error.boundary.no_details":"没有错误详细信息","error.boundary.action.reload":"重新加载","identity_card.rank_label":"排名","identity_card.streak_label":"活跃天数","identity_card.rank_placeholder":"—","identity_card.streak_value":"{{days}} 天","usage.summary.total":"Token 总数","usage.period.day":"日","usage.period.week":"周","usage.period.month":"月","usage.period.total":"总计","usage.period.custom":"自定义","usage.metric.total":"总计","usage.metric.input":"输入","usage.metric.output":"输出","usage.metric.cached_input":"缓存输入","usage.metric.reasoning_output":"推理输出","usage.button.refresh":"刷新","usage.overview.tablist_aria":"时间范围","usage.overview.cost_breakdown_aria":"查看成本明细","usage.overview.distribution_aria":"来源占比:{{items}}","usage.overview.distribution_item":"{{label}} {{percent}}%","usage.overview.provider_card_aria":"{{provider}}:{{percent}}%,{{tokens}} Token,{{cost}}。点击{{action}}详情","usage.overview.expand":"展开","usage.overview.collapse":"收起","usage.overview.model_count":"{{count}} 个模型","usage.overview.model_details_aria":"{{provider}} 模型详情","widgets.page.title":"组件","widgets.cta.open_gallery":"打开小组件库","widgets.cta.download":"下载 Mac 应用","widgets.cta.macos_only":"仅限 macOS","widgets.menubar.section.title":"菜单栏","widgets.gallery.section.title":"桌面小组件","widgets.summary.name":"使用概览","widgets.summary.description":"今天和近 7 天的用量,以及紧凑趋势线。","widgets.heatmap.name":"热力图","widgets.heatmap.description":"像 GitHub 一样,一眼看清活跃和空闲的日子。","widgets.topModels.name":"热门模型","widgets.topModels.description":"你最常用的模型,按 Token 占比排序。","widgets.limits.name":"使用限制","widgets.limits.description":"Claude、Codex、Cursor、Gemini 等的实时速率限制进度。","daily.sort.date.label":"日期","daily.sort.date.title":"按日期排序","daily.sort.total.label":"总计","daily.sort.total.title":"按总计排序","daily.sort.input.label":"输入","daily.sort.input.title":"按输入排序","daily.sort.output.label":"输出","daily.sort.output.title":"按输出排序","daily.sort.cached.label":"缓存","daily.sort.cached.title":"按缓存输入排序","daily.sort.reasoning.label":"推理","daily.sort.reasoning.title":"按推理输出排序","daily.sort.conversations.label":"对话数","daily.sort.conversations.title":"按对话排序","details.pagination.prev":"上一页","details.pagination.next":"下一页","limits.copilot.otelHint.title":"跟踪 Copilot Token 使用情况","limits.copilot.otelHint.body":"限额信息通过你的 GitHub OAuth 令牌读取。如果还想记录逐 Token 用量,请启用 Copilot 的 OpenTelemetry 导出,把下面这段加到你的 shell 配置文件(~/.zshrc 或 ~/.bashrc):","limits.copilot.otelHint.copy":"复制","limits.copilot.otelHint.copied":"已复制","limits.panel.title":"使用限制","limits.label.cursor_plan":"套餐","limits.label.cursor_auto":"自动","limits.label.cursor_api":"API","limits.label.kiro_month":"月度","limits.label.kiro_bonus":"奖励","limits.label.kimi_weekly":"周","limits.label.kimi_5h":"5h","limits.label.kimi_total":"总量","limits.label.kimi_parallel":"并发:{{count}}","limits.label.copilot_premium":"高级","limits.label.copilot_chat":"对话","limits.status.not_connected":"未连接","limits.status.no_data":"未返回实时限额数据","limits.status.all_hidden":"所有限额提供商都已隐藏。请打开显示设置重新显示。","nav.usage":"用量","nav.limits":"限额","nav.widgets":"小组件","nav.skills":"Skills","nav.leaderboard":"排行榜","nav.collapse":"折叠侧边栏","nav.expand":"展开侧边栏","nav.menu":"打开导航菜单","nav.close_menu":"关闭导航菜单","nav.aside_label":"主导航","nav.nav_label":"导航","limits.page.subtitle":"AI 工具的速率限制和配额使用情况。","limits.settings.toggle_visible":"切换可见性","limits.page.openSettings":"显示设置","nav.group.general":"常规","nav.group.tools":"工具","nav.group.account":"账户","nav.settings":"设置","header.auth.open_settings":"打开设置","settings.page.title":"设置","settings.page.subtitle":"管理你的账户、外观和显示偏好。","settings.section.appearance":"外观","settings.section.account":"账户","settings.section.limits":"限制显示","settings.appearance.theme.label":"主题","settings.appearance.theme.hint":"选择 Token Tracker 在仪表盘中的显示方式。","settings.appearance.theme.light":"浅色","settings.appearance.theme.dark":"深色","settings.appearance.theme.system":"系统","settings.account.displayName":"显示名称","settings.account.edit":"编辑","settings.account.save":"保存","settings.account.saving":"保存...","settings.account.cancel":"取消","settings.account.userId":"用户 ID","settings.account.copyUserId":"复制用户 ID","settings.account.copy":"复制","settings.account.copied":"已复制","settings.account.cloudSync":"云同步","settings.account.cloudSyncHint":"将本地用量上传到你的 Token Tracker 云端账号。","settings.account.publicProfile":"公开主页","settings.account.publicProfileHint":"在公开排行榜中展示你的用量。","settings.account.displayNameAnonymousHint":"匿名状态下,排行榜会隐藏你的名字和头像","settings.account.displayNameDisabledWhileAnon":"请先关闭匿名,再编辑名字","settings.account.githubUrl":"GitHub 主页","settings.account.githubUrlHint":"在排行榜名字旁显示 GitHub 链接。","settings.account.githubUrlPlaceholder":"用户名或 https://github.com/用户名","settings.account.githubUrlInvalid":"请输入 GitHub 用户名,或 https://github.com/用户名","leaderboard.github.aria":"打开 GitHub 主页","leaderboard.github.tooltipAction":"点击查看 GitHub 主页","leaderboard.github.tooltipPrefix":"可在","leaderboard.github.tooltipSettingsLink":"设置","leaderboard.github.tooltipSuffix":"中配置你的主页","settings.account.signOut":"退出登录","settings.account.signIn":"登录","settings.account.signedOutHint":"登录后可管理云同步和排行榜偏好。","settings.section.menubar":"菜单栏应用","settings.menubar.showStats":"在菜单栏中显示统计信息","settings.menubar.showStatsHint":"在菜单栏图标旁边显示今天的Token 数量和成本。","settings.menubar.animatedIcon":"动画图标","settings.menubar.animatedIconHint":"闪烁 Clawd 角色并在菜单栏中播放同步动画。","settings.menubar.launchAtLogin":"登录时启动","settings.menubar.launchAtLoginHint":"登录 macOS 时自动启动 TokenTrackerBar。","settings.menubar.syncNow":"立即同步","settings.menubar.syncNowHint":"触发本地AI工具日志立即解析并上传。","settings.menubar.syncing":"正在同步...","settings.menubar.updates":"更新","settings.menubar.checkUpdates":"检查更新","menubar.slot.primary":"第一个位置","menubar.slot.secondary":"第二个位置","menubar.native_only":"打开 macOS 版 TokenTrackerBar 后可编辑菜单栏显示。","menubar.metric.today_tokens":"今日 Token","menubar.metric.today_cost":"今日成本","menubar.metric.last_7d_tokens":"近 7 天 Token","menubar.metric.total_tokens":"总 Token","menubar.metric.total_cost":"总成本","menubar.metric.claude_5h":"Claude 5 小时限额","menubar.metric.claude_7d":"Claude 7 天限额","menubar.metric.codex_5h":"Codex 5 小时限额","menubar.metric.codex_7d":"Codex 7 天限额","nav.ip_check":"Claude IP 检查","skills.page.title":"Skills","skills.tab.my":"我的","skills.tab.browse":"发现","skills.action.refresh":"刷新","skills.action.install":"安装","skills.action.choose_targets":"选择目标","skills.target.menu_label":"安装到","skills.target.none":"未选目标","skills.toast.installed":"已把 {{name}} 安装到 {{targets}}。","skills.action.remove":"移除","skills.action.search":"搜索","skills.action.search_aria":"搜索 skills","skills.target.synced_summary":"已同步到 {{targets}}","skills.target.synced_none":"尚未同步到任何 agent","skills.row.open_details":"查看 {{name}} 详情","skills.detail.close":"关闭详情","skills.detail.sync_section_title":"同步到","skills.detail.remove_button":"从所有 agent 移除","skills.detail.remove_confirm_hint":"这会从每个 agent 取消同步并删除本地副本。","skills.filter.agent_label":"Agent","skills.filter.agent_all":"全部 agent","skills.filter.clear":"清除筛选","skills.filter.result_count":"{{filtered}} / {{total}} 个 skill","skills.filter.result_count_browse":"{{count}} 个结果","skills.empty.no_match":"当前筛选下没有匹配的 skill。","hint.dismiss":"关闭提示","hint.dismissible_aria":"可关闭的提示","skills.card.installed":"已安装","skills.card.targets_prefix":"将安装到:","skills.card.targets_change":"更改","skills.card.installs":"{{count}} 次安装","skills.source.label":"来源","skills.source.all":"全部仓库","skills.mode.repo":"仓库","skills.mode.skillssh":"skills.sh","skills.browse.placeholder_all":"在已启用的仓库里搜索…","skills.browse.placeholder_repo":"在 {{repo}} 中搜索…","skills.browse.placeholder_skillssh":"在 skills.sh 仓库中搜索…","skills.browse.empty_sources":"添加一个 GitHub 仓库以开始浏览技能。","skills.browse.add_repo_hint":"想要更多 skill?添加一个 GitHub 仓库。","skills.browse.manage_sources":"管理来源","skills.browse.hint_skillssh":"至少输入 2 个字符以搜索 skills.sh。","skills.browse.loading_hint":"正在从 GitHub 拉取 skill 信息,首次加载可能需要一分钟,结果会缓存。","skills.error.generic":"Skill 操作失败。","skills.confirm.remove_title":"要移除 {{name}} 吗?","skills.confirm.remove_managed":"这个 skill 将从所有已连接的 AI 工具中移除,几秒内可以撤销。","skills.confirm.remove_local":"将从所有 AI 工具目录中删除该 skill 文件夹。此操作无法撤销。","skills.toast.removed":"已移除 {{name}}。","shared.action.undo":"撤销","shared.action.cancel":"取消","skills.empty.my":"还没有 skill。去「发现」搜索或安装。","skills.empty.my_cta":"去发现","skills.empty.browse":"这个来源下没有找到技能。","skills.empty.search":"没有结果,换个关键词试试。","skills.repo.placeholder":"owner/repository","skills.repo.add":"添加仓库","skills.repo.invalid":"请输入 owner/repository 或 GitHub 仓库 URL。","skills.repo.remove":"移除仓库","settings.appearance.language.label":"语言","settings.appearance.language.hint":"使用“系统”时会默认跟随本机语言。","settings.appearance.language.system":"系统","settings.appearance.language.english":"英语","settings.appearance.language.chinese":"简体中文","settings.appearance.currency.label":"货币","settings.appearance.currency.hint":"选择用量成本的显示币种。","settings.appearance.currency.opt.usd":"美元 ($)","settings.appearance.currency.opt.eur":"欧元 (€)","settings.appearance.currency.opt.gbp":"英镑 (£)","settings.appearance.currency.opt.cny":"人民币 (¥)","settings.appearance.currency.opt.jpy":"日元 (¥)","settings.appearance.currency.opt.hkd":"港币 (HK$)","settings.appearance.currency.rate_source.default":"内置默认汇率","settings.appearance.currency.rate_source.fetched":"数据源:open.er-api.com","settings.appearance.currency.rate_updated":"更新于 {{when}}","settings.appearance.currency.rate_never":"尚未刷新"},AL={"usage.overview.antigravity_notice_title":"Token 为估算值","usage.overview.antigravity_notice_body":"Antigravity 的本地日志没有真实用量字段,这里的数字是按字符长度(约 4 字符/Token)估算出来的,也没有扣除 Gemini 的 prompt cache 折扣。请把它当作上限估算,不要直接对账账单。","stats.period.today":"今日","stats.period.week":"本周","stats.period.month":"本月","stats.period.all":"全部","stats.period.convs":"对话","dashboard.core_index.collapse_label":"▾","dashboard.core_index.expand_label":"▸","dashboard.core_index.collapse_aria":"折叠模型分解","dashboard.core_index.expand_aria":"展开模型细分","dashboard.rolling.title":"最近的活动","dashboard.rolling.last_7d":"过去 7 天","dashboard.rolling.last_30d":"过去 30 天","dashboard.rolling.avg_active_day":"日平均","dashboard.projects.title":"项目用量","dashboard.projects.tokens_label":"Token","dashboard.projects.stars_label":"星标","dashboard.projects.limit_label":"展示","dashboard.projects.limit_aria":"选择仓库显示数量","dashboard.projects.limit_top_3":"前 3 名","dashboard.projects.limit_top_6":"前 6 名","dashboard.projects.limit_top_10":"前 10 名","dashboard.projects.empty":"没有公开仓库","dashboard.widgets.title":"桌面小组件","dashboard.widgets.hint":"右键点按桌面 → 编辑小组件 → 搜索“TokenTracker”","dashboard.widgets.dismiss_aria":"关闭小组件介绍","dashboard.cost_breakdown.title":"成本明细","dashboard.cost_breakdown.total_label":"预计总成本","dashboard.cost_breakdown.close":"关闭","trend.monitor.label":"使用趋势","heatmap.title":"热力图","heatmap.empty":"尚无活动数据。","heatmap.legend.less":"少","heatmap.legend.more":"多","heatmap.legend.utc":"UTC","heatmap.tooltip":"{{day}} • {{value}} {{unit}} • {{tz}}","heatmap.unit.tokens":"Token","heatmap.month.jan":"1月","heatmap.month.feb":"2月","heatmap.month.mar":"3月","heatmap.month.apr":"4月","heatmap.month.may":"5月","heatmap.month.jun":"6月","heatmap.month.jul":"7月","heatmap.month.aug":"8月","heatmap.month.sep":"9月","heatmap.month.oct":"10月","heatmap.month.nov":"11月","heatmap.month.dec":"12月","heatmap.day.sun":"日","heatmap.day.mon":"一","heatmap.day.tue":"二","heatmap.day.wed":"三","heatmap.day.thu":"四","heatmap.day.fri":"五","heatmap.day.sat":"六","dashboard.session_expired.copy_label":"运行 npx --yes tokentracker-cli init","dashboard.session_expired.copied":"已复制","dashboard.install.prompt":"安装 Node.js 18+ 然后运行:","dashboard.install.cmd.init":"npx --yes tokentracker-cli init","dashboard.install.cmd.init_link_code":"npx --yes tokentracker-cli init --link-code {{link_code}}","dashboard.install.copy":"复制安装命令","dashboard.install.copy_base":"复制初始化命令","dashboard.install.copied":"已复制到剪贴板","dashboard.install.link_code.loading":"正在生成专属代码...","dashboard.install.link_code.failed":"专属代码不可用","dashboard.install.cmd.sync":"npx --yes tokentracker-cli sync","dashboard.daily.title":"每日细目","dashboard.daily.empty":"还没有数据。先使用 AI CLI,再运行 {{cmd}}。","dashboard.identity.title":"你的个人资料","dashboard.identity.subtitle":"记录你的编码之旅","dashboard.identity.fallback":"匿名用户","dashboard.screenshot.title_line1":"AI 编程助手","dashboard.screenshot.title_line2":"2025 年度回顾","dashboard.screenshot.twitter_button":"分享到 X","dashboard.screenshot.twitter_label":"分享到 X","dashboard.screenshot.twitter_hint":"自动将图像复制到剪贴板","dashboard.screenshot.twitter_text":"记录中的 {{total_tokens}} Token。\\n{{model_name}} 以 {{model_percent}}% 领先。\\n\\n我的 AI 使用情况,未经审计 →\\ntokentracker.cc","heatmap.3d.hover_tip":"点击进入 3D 全屏旋转分析模式","heatmap.3d.modal.title":"Token 三维透视","heatmap.3d.modal.desc":"按住左键拖拽可任意旋转,悬浮感知每日活跃数据与多维统计。","heatmap.3d.modal.stats.total_tokens":"年度 Token 总量","heatmap.3d.modal.stats.precision_total_tokens":"精准年消耗量","heatmap.3d.modal.stats.estimated_cost":"年度估算费用","heatmap.3d.modal.stats.active_rate_days":"活跃占比 / 天数","heatmap.3d.modal.stats.max_streak":"最长连续活跃","heatmap.3d.modal.stats.days_suffix":"天","heatmap.3d.modal.stats.peak_day":"单日峰值暴击","heatmap.3d.modal.stats.precision_peak_value":"精确单日峰值","heatmap.3d.modal.stats.no_data":"无数据","heatmap.3d.modal.legend.title":"活跃度层级","heatmap.3d.modal.palette.emerald":"翡翠之城","heatmap.3d.modal.palette.ocean":"深海浩瀚","heatmap.3d.modal.palette.neon":"赛博霓虹","heatmap.3d.modal.palette.amber":"烈焰余晖","heatmap.3d.modal.control.play":"启动慢速自转","heatmap.3d.modal.control.pause":"暂停自动旋转","heatmap.3d.modal.control.reset":"重置 3D 视角","heatmap.3d.modal.footer.tip":"双指缩放 / 滚轮缩放 / 鼠标拖拽旋转 3D 图表","heatmap.3d.modal.ai.title.default":"持之以恒的行者","heatmap.3d.modal.ai.eval.default":"在技术的长河中持之以恒。也许日常的编码并不总是波澜壮阔,但每一个微小的活跃点都在记录着您的思考与探索。星火成留,终将汇聚成属于您的数字海洋。","heatmap.3d.modal.ai.title.peak":"极限活跃级贡献者","heatmap.3d.modal.ai.eval.peak":"这一年中,您的 Token 产出表现出极高的工程密度。如此规模 of 开发量相当于深度参与了中大型系统底座的重构,每一次击键都在将复杂的逻辑收敛为确定性的代码。这是极度专注与纯粹工程热爱的最好印证。","heatmap.3d.modal.ai.title.heavy":"高频产出级开发者","heatmap.3d.modal.ai.eval.heavy":"卓越的持续输出。您的 Token 累积量已达数百万字,相当于数十部中篇技术巨著的体量。高饱和度的编码节奏表明您正在以极高的执行力构建属于您的数字资产,展现了卓越的创造力。","heatmap.3d.modal.ai.title.core":"核心生产力专家","heatmap.3d.modal.ai.eval.core":"极具韧性的长期投入。在过去的一年中,您在较长周期内稳定保持着高强度的开发节奏。您用扎实的代码行数与 Token 产出,默默筑起了项目的核心架构,是当之无愧的工程支柱。","heatmap.3d.modal.ai.title.steady":"稳健成长型工程师","heatmap.3d.modal.ai.eval.steady":"踏实而坚定的技术积累。每一次 Token 的递增,都是您在坚实地砌下通往未来的代码基石。这种细水长流的稳健节奏,往往是一个优秀开发者通往工程大师的必经之路。","heatmap.3d.voxel.joke.1":"🔥 极度疯狂!产出 {{value}} tokens!你是在疯狂训练大模型,还是手撸了一个编译器?","heatmap.3d.voxel.joke.2":"🚀 史诗级输出!共 {{value}} tokens。今日产出可绕地球一圈,AI 都在为你惊叹!","heatmap.3d.voxel.joke.3":"⚡ 爆击日!{{value}} tokens。代码如泉涌,键盘已经开始冒烟了!","heatmap.3d.voxel.level3":"⚡ 生产力大爆发({{value}} tokens)!高效专注的黄金时刻,继续保持这个巅峰状态!","heatmap.3d.voxel.level2":"🌱 渐入佳境({{value}} tokens)!稳步产出,每一次敲击键盘都是在为大厦添砖加瓦。","heatmap.3d.voxel.level1":"🍃 聚沙成塔({{value}} tokens)。微小的提交也是对未来的投资,保持复利的力量!","heatmap.3d.voxel.level0":"💤 养精蓄锐。在不写代码的日子里,灵感也在悄悄生长。","ipcheck.page.title":"Claude IP 检测","ipcheck.page.subtitle":"查看当前访问 Claude 的出口 IP、纯净度、地理与风险信号,识别可能影响登录或触发风控的因素。","ipcheck.mask.toggle":"隐藏 IP","ipcheck.ipv6.warn":"当前为 IPv6 环境,不建议用 IPv6 访问 Claude Code,部分检测结果可能不完整。","ipcheck.ip.cn":"中国出口 IPv4","ipcheck.ip.cloudflare":"Cloudflare 出口","ipcheck.ip.claude":"Claude 出口","ipcheck.ip.failed":"获取失败","ipcheck.ip.loading":"加载中...","ipcheck.trust.title":"信任评分","ipcheck.trust.subtitle":"Claude 风控视角下的 IP 纯净度","ipcheck.trust.no_data":"无数据","ipcheck.trust.no_ip":"未获取到 Claude 出口 IP,无法评分","ipcheck.trust.no_score":"该 IP 暂无评分数据","ipcheck.trust.gauge.low":"0 高危","ipcheck.trust.gauge.high":"100 可信","ipcheck.trust.label.pristine":"极度纯净","ipcheck.trust.label.clean":"纯净","ipcheck.trust.label.good":"良好","ipcheck.trust.label.neutral":"中性","ipcheck.trust.label.suspicious":"可疑","ipcheck.trust.label.unreachable":"不可访问","ipcheck.trust.text.excellent":"该 IP 信誉极好","ipcheck.trust.text.great":"该 IP 信誉优异","ipcheck.trust.text.minor":"该 IP 存在轻微风险","ipcheck.trust.text.moderate":"该 IP 存在一定风险","ipcheck.trust.text.severe":"该 IP 风险极高","ipcheck.trust.text.restricted":"处于不可访问区域,Claude 会严格风控","ipcheck.trust.region_warn.title":"Claude 出口 IP 位于 {{region}}","ipcheck.trust.region_warn.body":"不建议登录 Claude,容易触发封号风控。","ipcheck.trust.region_support":"Claude 支持地区","ipcheck.trust.region.accessible":"可访问","ipcheck.common.unknown":"未知","ipcheck.props.title":"IP 属性","ipcheck.props.region":"地区","ipcheck.props.city":"城市","ipcheck.props.type":"类型","ipcheck.props.asn":"ASN","ipcheck.props.org":"运营商","ipcheck.props.residential":"家庭住宅","ipcheck.props.datacenter":"机房","ipcheck.security.title":"安全检测","ipcheck.security.vpn":"VPN","ipcheck.security.proxy":"代理 (Proxy)","ipcheck.security.tor":"Tor","ipcheck.security.crawler":"机器人 (Crawler)","ipcheck.security.abuser":"滥用记录","ipcheck.security.proxy_flag":"代理","ipcheck.security.crawler_yes":"是","ipcheck.security.crawler_no":"否","ipcheck.security.abuser_yes":"有记录","ipcheck.security.abuser_no":"无记录","ipcheck.security.clean":"未检测到","ipcheck.avail.title":"Claude 可用性","ipcheck.avail.tooltip":"Claude 服务器在美国,从亚洲访问延迟超过 100ms 属于正常情况。","ipcheck.avail.refresh":"刷新","ipcheck.avail.svc_row":"服务状态","ipcheck.avail.latency.normal":"正常","ipcheck.avail.latency.good":"良好","ipcheck.avail.latency.slow":"较慢","ipcheck.avail.latency.unreachable":"不可访问","ipcheck.avail.svc.none":"全部正常","ipcheck.avail.svc.minor":"轻微故障","ipcheck.avail.svc.major":"重大故障","ipcheck.avail.svc.critical":"严重故障","ipcheck.avail.svc.maintenance":"维护中","ipcheck.avail.svc.other":"服务异常","ipcheck.dns.title":"DNS 泄露检测","ipcheck.dns.status":"状态","ipcheck.dns.outlet":"DNS 出口","ipcheck.dns.outlet_ip":"DNS 出口 IP","ipcheck.dns.isp":"服务商","ipcheck.dns.leaked":"可能泄露","ipcheck.dns.no_leak":"未检测到泄露","ipcheck.dns.encrypted":"DNS 加密或未暴露","ipcheck.dns.cn_tag":"中国 DNS","ipcheck.udp.title":"WebRTC UDP 泄露","ipcheck.udp.status":"状态","ipcheck.udp.outlet":"UDP 出口","ipcheck.udp.outlet_ip":"UDP 出口 IP","ipcheck.udp.origin":"归属地","ipcheck.udp.disabled":"WebRTC 已禁用","ipcheck.udp.no_leak":"未检测到泄露","ipcheck.udp.leaked":"可能泄露","ipcheck.udp.anomaly":"异常","ipcheck.device.title":"设备信息","ipcheck.device.tz":"时区","ipcheck.device.lang":"语言","ipcheck.device.os":"操作系统 / 浏览器","ipcheck.device.touch":"触屏","ipcheck.device.net":"网络类型","ipcheck.device.dnt":"Do Not Track","ipcheck.device.webgl_render":"WebGL 渲染器","ipcheck.device.canvas_fp":"Canvas 指纹","ipcheck.device.webgl_fp":"WebGL 指纹","ipcheck.device.match":"一致","ipcheck.device.mismatch":"不一致","ipcheck.device.local":"本地","ipcheck.device.estimate_suffix":"(估算)","ipcheck.device.diff_equal":"偏移略有差异","ipcheck.device.diff_ahead":"Claude 快 {{h}} 小时","ipcheck.device.diff_behind":"Claude 慢 {{h}} 小时","ipcheck.device.lang_expected":"Claude 出口常用","ipcheck.device.touch_yes":"是","ipcheck.device.touch_no":"否","ipcheck.device.dnt_on":"已开启","ipcheck.device.dnt_off":"已关闭","ipcheck.device.dnt_unset":"未设置","ipcheck.device.net_unsupported":"不支持检测","ipcheck.device.unsupported":"不支持","ipcheck.history.title":"Claude 出口 IP 历史","ipcheck.history.subtitle":"仅本地存储于浏览器,最多保留 6 条","ipcheck.history.clear":"清除","ipcheck.history.empty":"暂无历史记录","ipcheck.history.current":"当前","ipcheck.region.CN":"中国大陆","ipcheck.region.HK":"香港","ipcheck.region.MO":"澳门","ipcheck.region.RU":"俄罗斯","ipcheck.region.KP":"朝鲜","ipcheck.region.IR":"伊朗","ipcheck.region.SY":"叙利亚","ipcheck.region.CU":"古巴","ipcheck.region.BY":"白俄罗斯","ipcheck.region.VE":"委内瑞拉","leaderboard.profile_modal.close":"关闭","leaderboard.profile_modal.loading":"正在加载用户资料…","leaderboard.profile_modal.error":"加载用户资料失败。","leaderboard.profile_modal.empty":"这个用户的资料未公开。","leaderboard.profile_modal.row_aria":"查看 {{name}} 的资料","leaderboard.profile_modal.rank":"#{{rank}}","leaderboard.profile_modal.hero.total_tokens":"总 Token","leaderboard.profile_modal.hero.total_cost":"总花费","leaderboard.profile_modal.hero.github":"GitHub 主页","leaderboard.profile_modal.stat.total_cost":"总花费","leaderboard.profile_modal.stat.total_tokens":"总 Token","leaderboard.profile_modal.stat.active_days":"活跃天数","leaderboard.profile_modal.stat.avg_per_day":"日均花费","leaderboard.profile_modal.streak.current":"当前连续","leaderboard.profile_modal.streak.longest":"最长连续","leaderboard.profile_modal.streak.days":"{{count}} 天","leaderboard.profile_modal.best_day.title":"最佳日","leaderboard.profile_modal.best_day.none":"—","leaderboard.profile_modal.models.count":"使用了 {{count}} 个模型","leaderboard.profile_modal.models.favorite":"最爱模型","leaderboard.profile_modal.models.none":"暂无模型记录","leaderboard.profile_modal.heatmap.title":"活跃度(最近 365 天)","leaderboard.profile_modal.providers.title":"按 Provider 分布","leaderboard.profile_modal.providers.none":"本周期无使用数据。"},RL={"landing.handle.default":"VIBE_USER","landing.handle.special":"伏特","landing.screenshot.alt":"TokenTracker 仪表板截图","landing.nav.login":"登录","landing.nav.signup":"注册","landing.install.command":"npx --yes tokentracker-cli","landing.install.action.copy":"复制命令","landing.install.action.copied":"已复制","landing.meta.title":"Token Tracker —— AI Coding CLI 的 Token 用量追踪器","landing.meta.description":"自动监控 Claude Code、Cursor、Codex 等工具的 Token 用量。本地优先、注重隐私、零配置。","landing.meta.og_site_name":"Token Tracker","landing.meta.og_type":"website","landing.meta.og_image":"https://www.tokentracker.cc/og-image.jpg","landing.meta.og_url":"https://www.tokentracker.cc/","landing.meta.twitter_card":"summary_large_image","share.meta.title":"Token Tracker 分享","share.meta.description":"分享你的 Token Tracker 仪表板快照,包含跨模型、项目和时间窗口的用量洞察。","share.meta.og_site_name":"Token Tracker","share.meta.og_type":"website","share.meta.og_image":"https://www.tokentracker.cc/share-dashboard.jpg","share.meta.og_url":"https://www.tokentracker.cc/share","share.meta.twitter_card":"summary_large_image","landing.handle.placeholder":"试试 “{{handle}}”","landing.rank.expectation":"预期排名:{{rank}}","landing.rank.singularity":"登顶","landing.rank.unranked":"未上榜","landing.cta.primary":"进入仪表板","landing.cta.secondary":"查看 GitHub 源码","landing.v2.hero.title_line1":"追踪你所有的","landing.v2.hero.title_line2":"AI Token","landing.v2.install.mac_cta":"Mac 应用 (DMG)","landing.v2.models.title":"支持的 AI CLI 工具","landing.v2.compare.kicker":"无缝追踪","landing.v2.compare.title":"别再瞎猜你的 AI 用量。","landing.v2.compare.subtitle":"AI CLI 把用量数据藏在零散的本地文件里。TokenTracker 把它们实时聚合到一个清晰的仪表板里。","landing.v2.distill.body":"100% 本地处理,不上传任何 prompt 或代码。","landing.v2.compare.with.title":"用 Token Tracker","landing.v2.compare.with.p1":"集中式用量仪表板","landing.v2.compare.with.p2":"实时 Token 指标","landing.v2.compare.with.p3":"100% 本地,隐私无忧","landing.v2.compare.without.title":"不用","landing.v2.compare.without.p1":"散落的 JSON 日志文件","landing.v2.compare.without.p2":"对 Token 消耗一无所知","landing.v2.compare.without.p3":"突如其来的 API 账单","landing.v2.footer.line":"Token Tracker —— 开发者打造,服务开发者。","landing.v2.nav.github":"GitHub","landing.v2.models.agent.codex":"Codex","landing.v2.models.agent.claude_code":"Claude Code","landing.v2.models.agent.cursor":"Cursor","landing.v2.models.agent.gemini":"Gemini","landing.v2.models.agent.opencode":"OpenCode","landing.v2.models.agent.openclaw":"OpenClaw","landing.v2.cta.primary":"进入仪表板","landing.v2.hero.subtagline":"自动监控 Claude Code、Cursor、Codex 等工具的 Token 用量。本地优先、注重隐私、零配置。","leaderboard.profile.nav.back":"$ 排行榜","leaderboard.title":"排行榜","leaderboard.range":"UTC {{period}} · {{from}} – {{to}}","leaderboard.range_loading":"UTC {{period}} · …","leaderboard.range.total":"全部时间","leaderboard.generated_at":"更新于 {{ts}}","leaderboard.period.week":"周","leaderboard.period.month":"月","leaderboard.period.total":"全部","leaderboard.me_label":"你","leaderboard.anon_label":"匿名","leaderboard.error.unknown":"未知错误","leaderboard.loading":"加载中…","leaderboard.empty":"暂无数据","leaderboard.column.rank":"排名","leaderboard.column.user":"用户","leaderboard.column.total":"总计","leaderboard.column.codex":"Codex","leaderboard.column.claude":"Claude","leaderboard.column.gemini":"Gemini","leaderboard.column.cursor":"Cursor","leaderboard.column.opencode":"OpenCode","leaderboard.column.openclaw":"OpenClaw","leaderboard.column.hermes":"Hermes","leaderboard.column.kiro":"Kiro","leaderboard.column.copilot":"Copilot","leaderboard.column.kimi":"Kimi","leaderboard.column.supplemental":"其他","leaderboard.column.est_cost":"预估花费","leaderboard.signin_prompt":"登录后即可上榜","leaderboard.signin_button":"登录","leaderboard.sync_prompt":"开启云同步即可参与排名","leaderboard.sync_button.idle":"开启并同步","leaderboard.sync_button.busy":"同步中…","leaderboard.pagination.page_size_label":"每页显示","leaderboard.pagination.prev":"上一页","leaderboard.pagination.next":"下一页","leaderboard.pagination.ellipsis":"……","leaderboard.pagination.page_unknown":"第 {{page}} 页","share.modal.title":"分享你的数据","share.modal.subtitle":"生成海报卡片,随处分享。","share.modal.close":"关闭","share.modal.action.x":"分享到 X","share.modal.action.download":"下载","share.modal.action.copy":"复制图片","share.modal.hint.x":"把图片粘贴到推文里","share.modal.hint.copy":"到剪贴板","share.modal.name_label":"显示名称","share.modal.name_placeholder":"输入你的名字","share.modal.style_label":"样式","share.modal.footer":"数据始终保留在本地——图片在你的浏览器内生成,绝不上传。","share.button.label":"分享","share.button.aria":"打开分享卡片","share.toast.copied":"图片已复制到剪贴板","share.toast.downloaded":"图片已保存","share.toast.failed":"图片生成失败","share.toast.working":"生成中…","share.variant.neon":"霓虹","share.variant.broadsheet":"特刊","share.date.month_year":"{{year}} 年 {{month}}","share.issue.all_time":"总计","share.month_short.jan":"1 月","share.month_short.feb":"2 月","share.month_short.mar":"3 月","share.month_short.apr":"4 月","share.month_short.may":"5 月","share.month_short.jun":"6 月","share.month_short.jul":"7 月","share.month_short.aug":"8 月","share.month_short.sep":"9 月","share.month_short.oct":"10 月","share.month_short.nov":"11 月","share.month_short.dec":"12 月","share.hook.top_loyal":"{{name}} 占了 {{percent}}% 的用量。","share.hook.days_record":"共记录 {{days}} 天。","share.hook.top_led":"{{name}} 领跑,占比 {{percent}}%。","share.hook.multi_models":"{{days}} 天里用了 {{count}} 个模型。","share.hook.days_with_model":"{{name}} 陪你跑了 {{days}} 天。","share.hook.new_chapter":"新的记录,从这里开始。","share.card.broadsheet.issue":"期号","share.card.broadsheet.by":"分享者","share.card.broadsheet.tracked_since":"追踪起始","share.card.broadsheet.total_tokens":"总 Token 数","share.card.broadsheet.estimated_spend":"预估花费","share.card.broadsheet.billable_days":"{{days}} 个活跃日","share.card.broadsheet.heatmap_title":"年度热图","share.card.broadsheet.heatmap_days_on_record":"{{active}} / {{total}} 天有记录","share.card.broadsheet.roster_title":"模型榜","share.card.broadsheet.roster_subtitle":"常用模型轮换","share.card.broadsheet.empty":"这一周很安静,还没有模型数据。","share.card.broadsheet.global_rank":"全站排名","share.card.broadsheet.active_days":"活跃","share.card.broadsheet.days_count":"{{days}} 天","share.card.broadsheet.track_yours":"追踪你自己的","share.card.annual.report_title":"用量报告","share.card.annual.less":"少","share.card.annual.more":"多","share.card.annual.heatmap_title":"Token 热图","share.card.annual.total_tokens":"总 Token 数","share.card.annual.estimated_cost":"预估成本","share.card.annual.longest_streak":"最长连击","share.card.annual.days_count":"{{days}} 天","share.card.annual.top_model":"热门模型"},_0="tokentracker-locale",ps="system",au="en",Dp="zh-CN";function b0(e){return typeof e!="string"?au:/^zh(?:[-_]|$)/i.test(e.trim())?Dp:au}function Ru(e){return e===ps?ps:b0(e)}function LL(){return typeof navigator>"u"?[]:Array.isArray(navigator.languages)&&navigator.languages.length?navigator.languages.filter(e=>typeof e=="string"):typeof navigator.language=="string"?[navigator.language]:[]}function iu(e,t=LL()){const n=Ru(e);if(n!==ps)return n;const a=t.map(s=>typeof s=="string"?s.trim():"").find(s=>s.length>0);return a&&/^zh(?:[-_]|$)/i.test(a)?Dp:au}function Mp(){return Ru(xo(_0)||ps)}function DL(e){return Po(_0,Ru(e))}const ML=["key","module","page","component","slot","text"],IL={[Dp]:{...EL,...AL,...RL}};let Oh=null,w0=iu(Mp());function NL(e){const t=[];let n=[],a="",s=!1;for(let o=0;o<e.length;o+=1){const c=e[o];if(s){c==='"'?e[o+1]==='"'?(a+='"',o+=1):s=!1:a+=c;continue}if(c==='"'){s=!0;continue}if(c===","){n.push(a),a="";continue}if(c===`
828
- `){n.push(a),a="",n.every(u=>u.trim()==="")||t.push(n),n=[];continue}c!=="\r"&&(a+=c)}return n.push(a),n.every(o=>o.trim()==="")||t.push(n),t}function OL(e){const t=NL(e);if(!t.length)return{map:new Map,rows:[]};const n=t[0].map(u=>String(u).trim());if(ML.filter(u=>!n.includes(u)).length)return{map:new Map,rows:[]};const s=Object.fromEntries(n.map((u,h)=>[u,h])),o=[],c=new Map;return t.slice(1).forEach((u,h)=>{const f={key:String(u[s.key]||"").trim(),module:String(u[s.module]||"").trim(),page:String(u[s.page]||"").trim(),component:String(u[s.component]||"").trim(),slot:String(u[s.slot]||"").trim(),text:String(u[s.text]??"").trim()};f.key&&(c.has(f.key),c.set(f.key,f),o.push(f))}),{map:c,rows:o}}function jL(){return Oh||(Oh=OL(TL)),Oh}function UL(){return IL[w0]||{}}function BL(e){const t=UL()[String(e)];return typeof t=="string"&&t.trim()?t:null}function FL(e,t){return t?e.replace(/\{\{(\w+)\}\}/g,(n,a)=>t[a]==null?n:String(t[a])):e}function VL(e){return String(e).replace(/\\n/g,`
829
- `)}function zL(e,t){return BL(t)||e?.text||t}function $L(e){w0=b0(e)}function Fe(e,t){const a=jL().map.get(e);return FL(VL(zL(a,e)),t)}const Qv="tokentracker_native_app";let x0=null;const Pf=new Set;typeof window<"u"&&window.addEventListener("native:systemAppearanceChanged",e=>{const t=e?.detail?.isDark;if(typeof t=="boolean"){x0=t;try{const n=document.documentElement;t?n.classList.add("dark"):n.classList.remove("dark")}catch{}Pf.forEach(n=>{try{n(t)}catch{}})}});function Jv(){return x0}function HL(e){return Pf.add(e),()=>Pf.delete(e)}function Ip(){if(typeof window>"u")return!1;try{if(new URLSearchParams(window.location.search).get("app")==="1"){try{window.localStorage.setItem(Qv,"1")}catch{}return!0}return window.localStorage.getItem(Qv)==="1"}catch{return!1}}function rr(){return typeof window>"u"?!1:!!window.webkit?.messageHandlers?.nativeBridge}function P0(){return typeof window>"u"?null:window.webkit?.messageHandlers?.nativeBridge??null}function j4(){return!!P0()}function Zo(e){const t=P0();if(!t)return!1;try{return t.postMessage(e),!0}catch(n){return console.warn("[tokentracker] nativeBridge post failed:",n),!1}}function U4(){return Zo({type:"getSettings"})}function So(e,t){return Zo({type:"setSetting",key:e,value:t})}function B4(e){return Zo({type:"action",name:e})}function WL(){return Zo({type:"getSystemAppearance"})}function KL(e,t){if(!rr())return;Zo({type:"setChromeAppearance",isDark:e==="dark",theme:t??"system"})}function F4(e){if(typeof window>"u")return()=>{};const t=n=>{n&&n.detail&&typeof n.detail=="object"&&e(n.detail)};return window.addEventListener("native:settings",t),()=>window.removeEventListener("native:settings",t)}const S0=b.createContext(null);function GL(){return iu(Mp())}function qL(e){typeof document>"u"||(document.documentElement.lang=e)}function ek(e,t){$L(e),t(n=>n===e?n:e)}function YL({children:e}){const[t,n]=b.useState(Mp),[a,s]=b.useState(GL);b.useLayoutEffect(()=>{qL(a)},[a]),b.useLayoutEffect(()=>{rr()&&So("locale",t)},[t]),b.useLayoutEffect(()=>{if(t!==ps||typeof window>"u")return;const u=()=>ek(iu(ps),s);return window.addEventListener("languagechange",u),()=>window.removeEventListener("languagechange",u)},[t]);const o=b.useCallback(u=>{const h=Ru(u);ek(iu(h),s),n(h),DL(h),rr()&&So("locale",h)},[]),c=b.useMemo(()=>({locale:t,setLocale:o,resolvedLocale:a}),[t,a,o]);return N.jsx(S0.Provider,{value:c,children:e})}const ZL="https://open.er-api.com/v6/latest/USD",XL=1440*60*1e3,QL=5e3;function JL(e,t=XL,n=Date.now()){return!e||!Number.isFinite(e)?!0:n-e>t}async function eD(e={}){const{timeoutMs:t=QL,fetchImpl:n,url:a=ZL,codes:s=Tp}=e,o=n??(typeof fetch<"u"?fetch:null);if(!o)throw new Error("fetch is not available");const c=typeof AbortController<"u"?new AbortController:null,u=c?setTimeout(()=>c.abort(),t):null;try{const h=await o(a,c?{signal:c.signal}:void 0);if(!h||!h.ok)throw new Error(`exchange rate fetch failed: ${h?.status??"no-response"}`);const m=(await h.json())?.rates;if(!m||typeof m!="object")throw new Error("exchange rate response missing rates");const y={USD:1};for(const k of s){if(k==="USD")continue;const w=m[k];nu(w)&&(y[k]=w)}if(Object.keys(y).length<=1)throw new Error("no supported currency rates in response");return{rates:y,fetchedAt:Date.now()}}finally{u&&clearTimeout(u)}}const tD=b.createContext(null);function tk(e,t,n){rr()&&(So("currency",e),So("currencySymbol",n),nu(t)&&So("exchangeRate",t))}function nD({children:e}){const[t,n]=b.useState(YR),a=b.useMemo(()=>QR(),[]),[s,o]=b.useState(a.rates),[c,u]=b.useState(a.source),[h,f]=b.useState(a.fetchedAt),m=b.useRef(!1),y=b.useRef(!1),k=b.useCallback((L,R,O)=>{o(L),u(R),f(O),JR({rates:L,source:R,fetchedAt:O})},[]),w=b.useCallback(async()=>{if(!m.current){m.current=!0;try{const{rates:L,fetchedAt:R}=await eD();k({...Ep,...L},"fetched",R)}catch{}finally{m.current=!1}}},[k]),P=b.useCallback(L=>{const R=Ap(L);n(R),ZR(R);const O=Mh(s,R),W=Ic(R);tk(R,O,W)},[s]);b.useEffect(()=>{y.current||t!==No&&JL(h)&&(y.current=!0,w())},[t,h,w]),b.useEffect(()=>{const L=Mh(s,t),R=Ic(t);tk(t,L,R)},[t,s]);const C=b.useMemo(()=>Mh(s,t),[s,t]),S=b.useMemo(()=>Ic(t),[t]),D=b.useMemo(()=>({currency:t,rate:C,symbol:S,rates:s,rateSource:c,rateFetchedAt:h,setCurrency:P}),[t,C,S,s,c,h,P]);return N.jsx(tD.Provider,{value:D,children:e})}const rD="modulepreload",aD=function(e){return"/"+e},nk={},or=function(t,n,a){let s=Promise.resolve();if(n&&n.length>0){let h=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=c?.nonce||c?.getAttribute("nonce");s=h(n.map(f=>{if(f=aD(f),f in nk)return;nk[f]=!0;const m=f.endsWith(".css"),y=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${y}`))return;const k=document.createElement("link");if(k.rel=m?"stylesheet":rD,m||(k.as="script"),k.crossOrigin="",k.href=f,u&&k.setAttribute("nonce",u),document.head.appendChild(k),m)return new Promise((w,P)=>{k.addEventListener("load",w),k.addEventListener("error",()=>P(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return s.then(c=>{for(const u of c||[])u.status==="rejected"&&o(u.reason);return t().catch(o)})};var su={},iD=()=>{window.va||(window.va=function(...t){window.vaq||(window.vaq=[]),window.vaq.push(t)})},sD="@vercel/analytics",oD="2.0.1";function C0(){return typeof window<"u"}function T0(){try{const e="production"}catch{}return"production"}function lD(e="auto"){if(e==="auto"){window.vam=T0();return}window.vam=e}function cD(){return(C0()?window.vam:T0())||"production"}function Np(){return cD()==="development"}function uD(e){return e.scriptSrc?rs(e.scriptSrc):Np()?"https://va.vercel-scripts.com/v1/script.debug.js":e.basePath?rs(`${e.basePath}/insights/script.js`):"/_vercel/insights/script.js"}function dD(e,t){var n;let a=e;if(t)try{a={...(n=JSON.parse(t))==null?void 0:n.analytics,...e}}catch{}lD(a.mode);const s={sdkn:sD+(a.framework?`/${a.framework}`:""),sdkv:oD};return a.disableAutoTrack&&(s.disableAutoTrack="1"),a.viewEndpoint&&(s.viewEndpoint=rs(a.viewEndpoint)),a.eventEndpoint&&(s.eventEndpoint=rs(a.eventEndpoint)),a.sessionEndpoint&&(s.sessionEndpoint=rs(a.sessionEndpoint)),Np()&&a.debug===!1&&(s.debug="false"),a.dsn&&(s.dsn=a.dsn),a.endpoint?s.endpoint=a.endpoint:a.basePath&&(s.endpoint=rs(`${a.basePath}/insights`)),{beforeSend:a.beforeSend,src:uD(a),dataset:s}}function rs(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e}`}function hD(e={debug:!0},t){var n;if(!C0())return;const{beforeSend:a,src:s,dataset:o}=dD(e,t);if(iD(),a&&((n=window.va)==null||n.call(window,"beforeSend",a)),document.head.querySelector(`script[src*="${s}"]`))return;const c=document.createElement("script");c.src=s;for(const[u,h]of Object.entries(o))c.dataset[u]=h;c.defer=!0,c.onerror=()=>{const u=Np()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log(`[Vercel Web Analytics] Failed to load script from ${s}. ${u}`)},document.head.appendChild(c)}function fD({route:e,path:t}){var n;(n=window.va)==null||n.call(window,"pageview",{route:e,path:t})}function pD(){if(!(typeof process>"u"||typeof su>"u"))return su.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function mD(){if(!(typeof process>"u"||typeof su>"u"))return su.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function gD(e){return b.useEffect(()=>{var t;e.beforeSend&&((t=window.va)==null||t.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]),b.useEffect(()=>{hD({framework:e.framework||"react",basePath:e.basePath??pD(),...e.route!==void 0&&{disableAutoTrack:!0},...e},e.configString??mD())},[]),b.useEffect(()=>{e.route&&e.path&&fD({route:e.route,path:e.path})},[e.route,e.path]),null}var ou={},yD=()=>{window.si||(window.si=function(...t){window.siq=window.siq||[],window.siq.push(t)})},vD="@vercel/speed-insights",kD="2.0.0";function _D(){return typeof window<"u"}function bD(){try{const e="production"}catch{}return"production"}function E0(){return bD()==="development"}function wD(e){return e.scriptSrc?lu(e.scriptSrc):E0()?"https://va.vercel-scripts.com/v1/speed-insights/script.debug.js":e.dsn?"https://va.vercel-scripts.com/v1/speed-insights/script.js":e.basePath?lu(`${e.basePath}/speed-insights/script.js`):"/_vercel/speed-insights/script.js"}function xD(e,t){var n;let a=e;if(t)try{a={...(n=JSON.parse(t))==null?void 0:n.speedInsights,...e}}catch{}const s={sdkn:vD+(a.framework?`/${a.framework}`:""),sdkv:kD};return a.sampleRate&&(s.sampleRate=a.sampleRate.toString()),a.route&&(s.route=a.route),E0()&&a.debug===!1&&(s.debug="false"),a.dsn&&(s.dsn=a.dsn),a.endpoint?s.endpoint=lu(a.endpoint):a.basePath&&(s.endpoint=lu(`${a.basePath}/speed-insights/vitals`)),{src:wD(a),beforeSend:a.beforeSend,dataset:s}}function lu(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e}`}function PD(e={},t){var n;if(!_D()||e.route===null)return null;yD();const{beforeSend:a,src:s,dataset:o}=xD(e,t);if(document.head.querySelector(`script[src*="${s}"]`))return null;a&&((n=window.si)==null||n.call(window,"beforeSend",a));const c=document.createElement("script");c.src=s,c.defer=!0;for(const[u,h]of Object.entries(o))c.dataset[u]=h;return c.onerror=()=>{console.log(`[Vercel Speed Insights] Failed to load script from ${s}. Please check if any content blockers are enabled and try again.`)},document.head.appendChild(c),{setRoute:u=>{c.dataset.route=u??void 0}}}function SD(){if(!(typeof process>"u"||typeof ou>"u"))return ou.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function CD(){if(!(typeof process>"u"||typeof ou>"u"))return ou.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function TD(e){b.useEffect(()=>{var n;e.beforeSend&&((n=window.si)==null||n.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]);const t=b.useRef(null);return b.useEffect(()=>{if(!t.current){const n=PD({framework:e.framework??"react",basePath:e.basePath??SD(),...e},e.configString??CD());n&&(t.current=n.setRoute)}},[e]),b.useEffect(()=>{t.current&&e.route&&t.current(e.route)},[e.route]),null}const A0=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();const ED=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const AD=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());const rk=e=>{const t=AD(e);return t.charAt(0).toUpperCase()+t.slice(1)};var jh={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const RD=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},LD=b.createContext({}),DD=()=>b.useContext(LD),MD=b.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:a,className:s="",children:o,iconNode:c,...u},h)=>{const{size:f=24,strokeWidth:m=2,absoluteStrokeWidth:y=!1,color:k="currentColor",className:w=""}=DD()??{},P=a??y?Number(n??m)*24/Number(t??f):n??m;return b.createElement("svg",{ref:h,...jh,width:t??f??jh.width,height:t??f??jh.height,stroke:e??k,strokeWidth:P,className:A0("lucide",w,s),...!o&&!RD(u)&&{"aria-hidden":"true"},...u},[...c.map(([C,S])=>b.createElement(C,S)),...Array.isArray(o)?o:[o]])});const dn=(e,t)=>{const n=b.forwardRef(({className:a,...s},o)=>b.createElement(MD,{ref:o,iconNode:t,className:A0(`lucide-${ED(rk(e))}`,`lucide-${e}`,a),...s}));return n.displayName=rk(e),n};const ID=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],ND=dn("chart-column",ID);const OD=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],jD=dn("gauge",OD);const UD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],BD=dn("globe",UD);const FD=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],VD=dn("layout-grid",FD);const zD=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],$D=dn("mail",zD);const HD=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],WD=dn("menu",HD);const KD=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],GD=dn("monitor",KD);const qD=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],R0=dn("moon",qD);const YD=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],ZD=dn("puzzle",YD);const XD=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],QD=dn("refresh-cw",XD);const JD=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],eM=dn("settings",JD);const tM=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],L0=dn("sun",tM);const nM=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],rM=dn("triangle-alert",nM);const aM=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],iM=dn("trophy",aM);const sM=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],D0=dn("x",sM);function oM({children:e,variant:t="primary",size:n="md",onClick:a,disabled:s=!1,className:o="",as:c="button",...u}){const h="inline-flex items-center justify-center font-medium transition-all duration-200 rounded-md focus:outline-none focus:ring-2 focus:ring-oai-blue/30 active:scale-[0.98] active:duration-100",f={primary:"bg-oai-black dark:bg-oai-white text-white dark:text-oai-black border border-transparent hover:bg-oai-gray-800 dark:hover:bg-oai-gray-200 active:bg-oai-gray-900 dark:active:bg-oai-gray-300 disabled:bg-oai-gray-300 dark:disabled:bg-oai-gray-700 disabled:text-oai-gray-500 dark:disabled:text-oai-gray-400 focus:ring-oai-brand/30 transition-colors duration-200",secondary:"bg-oai-white dark:bg-oai-gray-900 text-oai-black dark:text-oai-white border border-oai-gray-300 dark:border-oai-gray-700 hover:border-oai-brand hover:text-oai-brand active:bg-oai-gray-50 dark:active:bg-oai-gray-800 active:border-oai-brand-dark disabled:text-oai-gray-400 dark:disabled:text-oai-gray-500 disabled:border-oai-gray-200 dark:disabled:border-oai-gray-700 focus:ring-oai-brand/30 transition-colors duration-200",ghost:"bg-transparent text-oai-gray-600 dark:text-oai-gray-300 border border-transparent hover:text-oai-brand hover:bg-oai-brand-50/50 dark:hover:bg-oai-brand-950/30 active:bg-oai-brand-50 dark:active:bg-oai-brand-900/50 disabled:text-oai-gray-400 dark:disabled:text-oai-gray-500 focus:ring-oai-brand/30 transition-colors duration-200"},m={sm:"h-8 px-3 text-sm",md:"h-10 px-4 text-sm",lg:"h-12 px-6 text-base"},y=s?"cursor-not-allowed opacity-60":"cursor-pointer",k=`${h} ${f[t]} ${m[n]} ${y} ${o}`;return N.jsx(c,{className:k,onClick:a,disabled:s,...u,children:e})}class lM extends Ro.Component{constructor(t){super(t),this.state={error:null},this.handleReload=this.handleReload.bind(this)}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("ErrorBoundary caught an error:",t)}handleReload(){typeof window>"u"||window.location.reload()}render(){const{error:t}=this.state;if(!t)return this.props.children;const n=String(t?.message||t||""),a=n?Fe("shared.error.prefix",{error:n}):Fe("error.boundary.no_details");return N.jsx("div",{className:"flex min-h-screen items-center justify-center bg-oai-white p-6 font-oai text-oai-black antialiased dark:bg-oai-gray-950 dark:text-oai-white",children:N.jsxs("div",{className:"w-full max-w-lg rounded-xl border border-oai-gray-200 bg-white p-6 text-center shadow-sm dark:border-oai-gray-800 dark:bg-oai-gray-900",children:[N.jsx("div",{className:"mx-auto flex h-10 w-10 items-center justify-center rounded-full bg-amber-50 text-amber-600 dark:bg-amber-950/30 dark:text-amber-300",children:N.jsx(rM,{className:"h-5 w-5","aria-hidden":!0})}),N.jsx("div",{className:"mt-4 text-xs font-medium uppercase text-oai-gray-500 dark:text-oai-gray-400",children:Fe("error.boundary.title")}),N.jsx("h1",{className:"mt-2 text-xl font-semibold text-oai-black dark:text-white",children:Fe("error.boundary.subtitle")}),N.jsx("p",{className:"mt-2 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:Fe("error.boundary.hint")}),N.jsx("div",{className:"mt-4 max-h-32 overflow-auto rounded-lg border border-oai-gray-200 bg-oai-gray-50 px-3 py-2 text-left text-xs leading-5 text-oai-gray-600 dark:border-oai-gray-800 dark:bg-oai-gray-950 dark:text-oai-gray-300",children:a}),N.jsxs(oM,{type:"button",size:"md",onClick:this.handleReload,className:"mt-5",children:[N.jsx(QD,{className:"mr-2 h-4 w-4","aria-hidden":!0}),Fe("error.boundary.action.reload")]})]})})}}function Xo(){const e=b.useContext(S0);if(e===null)throw new Error("useLocale must be used within a LocaleProvider");return e}const Sf="tokentracker-theme",M0=b.createContext(null);function cM(){if(typeof window>"u")return"system";try{const e=localStorage.getItem(Sf);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}function gc(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function uM(e){if(typeof document>"u")return;const t=document.documentElement;e==="dark"?t.classList.add("dark"):t.classList.remove("dark")}function dM({children:e}){const[t,n]=b.useState(cM),[a,s]=b.useState(()=>{if(t!=="system")return t;if(rr()){const f=Jv();if(typeof f=="boolean")return f?"dark":"light"}return gc()}),o=b.useRef(t);b.useEffect(()=>{o.current=t},[t]),b.useEffect(()=>{uM(a)},[a]),b.useLayoutEffect(()=>{if(t==="system"){if(rr()){const f=Jv();s(typeof f=="boolean"?f?"dark":"light":gc()),WL();return}s(gc())}else s(t)},[t]),b.useEffect(()=>rr()?HL(m=>{o.current==="system"&&s(m?"dark":"light")}):void 0,[]),b.useEffect(()=>{if(typeof window>"u"||t!=="system"||rr())return;const f=window.matchMedia("(prefers-color-scheme: dark)"),m=y=>{const k=y.matches?"dark":"light";s(k)};return f.addEventListener?(f.addEventListener("change",m),()=>f.removeEventListener("change",m)):(f.addListener(m),()=>f.removeListener(m))},[t]),b.useEffect(()=>{const f=t==="system"&&!rr()?gc():a;KL(f,t)},[a,t]);const c=b.useCallback(f=>{if(n(f),typeof window<"u")try{localStorage.setItem(Sf,f)}catch{}},[]),u=b.useCallback(()=>{c(f=>{const m=f==="dark"?"light":"dark";if(typeof window<"u")try{localStorage.setItem(Sf,m)}catch{}return m})},[]),h=b.useMemo(()=>({theme:t,setTheme:c,toggleTheme:u,resolvedTheme:a}),[t,c,u,a]);return N.jsx(M0.Provider,{value:h,children:e})}const I0=b.createContext({isOpen:!1,openLoginModal:()=>{},closeLoginModal:()=>{}});function hM({children:e}){const[t,n]=b.useState(!1),a=b.useCallback(()=>n(!0),[]),s=b.useCallback(()=>n(!1),[]);return N.jsx(I0.Provider,{value:{isOpen:t,openLoginModal:a,closeLoginModal:s},children:e})}function N0(){return b.useContext(I0)}const Op=b.createContext({});function jp(e){const t=b.useRef(null);return t.current===null&&(t.current=e()),t.current}const fM=typeof window<"u",O0=fM?b.useLayoutEffect:b.useEffect,Lu=b.createContext(null);function Up(e,t){e.indexOf(t)===-1&&e.push(t)}function cu(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const xr=(e,t,n)=>n>t?t:n<e?e:n;let Bp=()=>{};const Ma={},j0=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function U0(e){return typeof e=="object"&&e!==null}const B0=e=>/^0[^.\s]+$/u.test(e);function F0(e){let t;return()=>(t===void 0&&(t=e()),t)}const jn=e=>e,pM=(e,t)=>n=>t(e(n)),Qo=(...e)=>e.reduce(pM),jo=(e,t,n)=>{const a=t-e;return a===0?1:(n-e)/a};class Fp{constructor(){this.subscriptions=[]}add(t){return Up(this.subscriptions,t),()=>cu(this.subscriptions,t)}notify(t,n,a){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,a);else for(let o=0;o<s;o++){const c=this.subscriptions[o];c&&c(t,n,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Pn=e=>e*1e3,On=e=>e/1e3;function V0(e,t){return t?e*(1e3/t):0}const z0=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,mM=1e-7,gM=12;function yM(e,t,n,a,s){let o,c,u=0;do c=t+(n-t)/2,o=z0(c,a,s)-e,o>0?n=c:t=c;while(Math.abs(o)>mM&&++u<gM);return c}function Jo(e,t,n,a){if(e===t&&n===a)return jn;const s=o=>yM(o,0,1,e,n);return o=>o===0||o===1?o:z0(s(o),t,a)}const $0=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,H0=e=>t=>1-e(1-t),W0=Jo(.33,1.53,.69,.99),Vp=H0(W0),K0=$0(Vp),G0=e=>e>=1?1:(e*=2)<1?.5*Vp(e):.5*(2-Math.pow(2,-10*(e-1))),zp=e=>1-Math.sin(Math.acos(e)),q0=H0(zp),Y0=$0(zp),vM=Jo(.42,0,1,1),kM=Jo(0,0,.58,1),Z0=Jo(.42,0,.58,1),_M=e=>Array.isArray(e)&&typeof e[0]!="number",X0=e=>Array.isArray(e)&&typeof e[0]=="number",bM={linear:jn,easeIn:vM,easeInOut:Z0,easeOut:kM,circIn:zp,circInOut:Y0,circOut:q0,backIn:Vp,backInOut:K0,backOut:W0,anticipate:G0},wM=e=>typeof e=="string",ak=e=>{if(X0(e)){Bp(e.length===4);const[t,n,a,s]=e;return Jo(t,n,a,s)}else if(wM(e))return bM[e];return e},yc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function xM(e,t){let n=new Set,a=new Set,s=!1,o=!1;const c=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function h(m){c.has(m)&&(f.schedule(m),e()),m(u)}const f={schedule:(m,y=!1,k=!1)=>{const P=k&&s?n:a;return y&&c.add(m),P.add(m),m},cancel:m=>{a.delete(m),c.delete(m)},process:m=>{if(u=m,s){o=!0;return}s=!0;const y=n;n=a,a=y,n.forEach(h),n.clear(),s=!1,o&&(o=!1,f.process(m))}};return f}const PM=40;function Q0(e,t){let n=!1,a=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,c=yc.reduce((R,O)=>(R[O]=xM(o),R),{}),{setup:u,read:h,resolveKeyframes:f,preUpdate:m,update:y,preRender:k,render:w,postRender:P}=c,C=()=>{const R=Ma.useManualTiming,O=R?s.timestamp:performance.now();n=!1,R||(s.delta=a?1e3/60:Math.max(Math.min(O-s.timestamp,PM),1)),s.timestamp=O,s.isProcessing=!0,u.process(s),h.process(s),f.process(s),m.process(s),y.process(s),k.process(s),w.process(s),P.process(s),s.isProcessing=!1,n&&t&&(a=!1,e(C))},S=()=>{n=!0,a=!0,s.isProcessing||e(C)};return{schedule:yc.reduce((R,O)=>{const W=c[O];return R[O]=(K,$=!1,x=!1)=>(n||S(),W.schedule(K,$,x)),R},{}),cancel:R=>{for(let O=0;O<yc.length;O++)c[yc[O]].cancel(R)},state:s,steps:c}}const{schedule:dt,cancel:Ia,state:Kt,steps:Uh}=Q0(typeof requestAnimationFrame<"u"?requestAnimationFrame:jn,!0);let Oc;function SM(){Oc=void 0}const on={now:()=>(Oc===void 0&&on.set(Kt.isProcessing||Ma.useManualTiming?Kt.timestamp:performance.now()),Oc),set:e=>{Oc=e,queueMicrotask(SM)}},J0=e=>t=>typeof t=="string"&&t.startsWith(e),ew=J0("--"),CM=J0("var(--"),$p=e=>CM(e)?TM.test(e.split("/*")[0].trim()):!1,TM=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ik(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const ks={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Uo={...ks,transform:e=>xr(0,1,e)},vc={...ks,default:1},Co=e=>Math.round(e*1e5)/1e5,Hp=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function EM(e){return e==null}const AM=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Wp=(e,t)=>n=>!!(typeof n=="string"&&AM.test(n)&&n.startsWith(e)||t&&!EM(n)&&Object.prototype.hasOwnProperty.call(n,t)),tw=(e,t,n)=>a=>{if(typeof a!="string")return a;const[s,o,c,u]=a.match(Hp);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(c),alpha:u!==void 0?parseFloat(u):1}},RM=e=>xr(0,255,e),Bh={...ks,transform:e=>Math.round(RM(e))},ri={test:Wp("rgb","red"),parse:tw("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:a=1})=>"rgba("+Bh.transform(e)+", "+Bh.transform(t)+", "+Bh.transform(n)+", "+Co(Uo.transform(a))+")"};function LM(e){let t="",n="",a="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),a=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),a=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,a+=a,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(a,16),alpha:s?parseInt(s,16)/255:1}}const Cf={test:Wp("#"),parse:LM,transform:ri.transform},el=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Pa=el("deg"),vr=el("%"),_e=el("px"),DM=el("vh"),MM=el("vw"),sk={...vr,parse:e=>vr.parse(e)/100,transform:e=>vr.transform(e*100)},as={test:Wp("hsl","hue"),parse:tw("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:a=1})=>"hsla("+Math.round(e)+", "+vr.transform(Co(t))+", "+vr.transform(Co(n))+", "+Co(Uo.transform(a))+")"},Lt={test:e=>ri.test(e)||Cf.test(e)||as.test(e),parse:e=>ri.test(e)?ri.parse(e):as.test(e)?as.parse(e):Cf.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ri.transform(e):as.transform(e),getAnimatableNone:e=>{const t=Lt.parse(e);return t.alpha=0,Lt.transform(t)}},IM=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function NM(e){return isNaN(e)&&typeof e=="string"&&(e.match(Hp)?.length||0)+(e.match(IM)?.length||0)>0}const nw="number",rw="color",OM="var",jM="var(",ok="${}",UM=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ms(e){const t=e.toString(),n=[],a={color:[],number:[],var:[]},s=[];let o=0;const u=t.replace(UM,h=>(Lt.test(h)?(a.color.push(o),s.push(rw),n.push(Lt.parse(h))):h.startsWith(jM)?(a.var.push(o),s.push(OM),n.push(h)):(a.number.push(o),s.push(nw),n.push(parseFloat(h))),++o,ok)).split(ok);return{values:n,split:u,indexes:a,types:s}}function BM(e){return ms(e).values}function aw({split:e,types:t}){const n=e.length;return a=>{let s="";for(let o=0;o<n;o++)if(s+=e[o],a[o]!==void 0){const c=t[o];c===nw?s+=Co(a[o]):c===rw?s+=Lt.transform(a[o]):s+=a[o]}return s}}function FM(e){return aw(ms(e))}const VM=e=>typeof e=="number"?0:Lt.test(e)?Lt.getAnimatableNone(e):e,zM=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:VM(e);function $M(e){const t=ms(e);return aw(t)(t.values.map((a,s)=>zM(a,t.split[s])))}const ir={test:NM,parse:BM,createTransformer:FM,getAnimatableNone:$M};function Fh(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function HM({hue:e,saturation:t,lightness:n,alpha:a}){e/=360,t/=100,n/=100;let s=0,o=0,c=0;if(!t)s=o=c=n;else{const u=n<.5?n*(1+t):n+t-n*t,h=2*n-u;s=Fh(h,u,e+1/3),o=Fh(h,u,e),c=Fh(h,u,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(c*255),alpha:a}}function uu(e,t){return n=>n>0?t:e}const vt=(e,t,n)=>e+(t-e)*n,Vh=(e,t,n)=>{const a=e*e,s=n*(t*t-a)+a;return s<0?0:Math.sqrt(s)},WM=[Cf,ri,as],KM=e=>WM.find(t=>t.test(e));function lk(e){const t=KM(e);if(!t)return!1;let n=t.parse(e);return t===as&&(n=HM(n)),n}const ck=(e,t)=>{const n=lk(e),a=lk(t);if(!n||!a)return uu(e,t);const s={...n};return o=>(s.red=Vh(n.red,a.red,o),s.green=Vh(n.green,a.green,o),s.blue=Vh(n.blue,a.blue,o),s.alpha=vt(n.alpha,a.alpha,o),ri.transform(s))},Tf=new Set(["none","hidden"]);function GM(e,t){return Tf.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function qM(e,t){return n=>vt(e,t,n)}function Kp(e){return typeof e=="number"?qM:typeof e=="string"?$p(e)?uu:Lt.test(e)?ck:XM:Array.isArray(e)?iw:typeof e=="object"?Lt.test(e)?ck:YM:uu}function iw(e,t){const n=[...e],a=n.length,s=e.map((o,c)=>Kp(o)(o,t[c]));return o=>{for(let c=0;c<a;c++)n[c]=s[c](o);return n}}function YM(e,t){const n={...e,...t},a={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(a[s]=Kp(e[s])(e[s],t[s]));return s=>{for(const o in a)n[o]=a[o](s);return n}}function ZM(e,t){const n=[],a={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],c=e.indexes[o][a[o]],u=e.values[c]??0;n[s]=u,a[o]++}return n}const XM=(e,t)=>{const n=ir.createTransformer(t),a=ms(e),s=ms(t);return a.indexes.var.length===s.indexes.var.length&&a.indexes.color.length===s.indexes.color.length&&a.indexes.number.length>=s.indexes.number.length?Tf.has(e)&&!s.values.length||Tf.has(t)&&!a.values.length?GM(e,t):Qo(iw(ZM(a,s),s.values),n):uu(e,t)};function sw(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?vt(e,t,n):Kp(e)(e,t)}const QM=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>dt.update(t,n),stop:()=>Ia(t),now:()=>Kt.isProcessing?Kt.timestamp:on.now()}},ow=(e,t,n=10)=>{let a="";const s=Math.max(Math.round(t/n),2);for(let o=0;o<s;o++)a+=Math.round(e(o/(s-1))*1e4)/1e4+", ";return`linear(${a.substring(0,a.length-2)})`},du=2e4;function Gp(e){let t=0;const n=50;let a=e.next(t);for(;!a.done&&t<du;)t+=n,a=e.next(t);return t>=du?1/0:t}function JM(e,t=100,n){const a=n({...e,keyframes:[0,t]}),s=Math.min(Gp(a),du);return{type:"keyframes",ease:o=>a.next(s*o).value/t,duration:On(s)}}const Pt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Ef(e,t){return e*Math.sqrt(1-t*t)}const e2=12;function t2(e,t,n){let a=n;for(let s=1;s<e2;s++)a=a-e(a)/t(a);return a}const zh=.001;function n2({duration:e=Pt.duration,bounce:t=Pt.bounce,velocity:n=Pt.velocity,mass:a=Pt.mass}){let s,o,c=1-t;c=xr(Pt.minDamping,Pt.maxDamping,c),e=xr(Pt.minDuration,Pt.maxDuration,On(e)),c<1?(s=f=>{const m=f*c,y=m*e,k=m-n,w=Ef(f,c),P=Math.exp(-y);return zh-k/w*P},o=f=>{const y=f*c*e,k=y*n+n,w=Math.pow(c,2)*Math.pow(f,2)*e,P=Math.exp(-y),C=Ef(Math.pow(f,2),c);return(-s(f)+zh>0?-1:1)*((k-w)*P)/C}):(s=f=>{const m=Math.exp(-f*e),y=(f-n)*e+1;return-zh+m*y},o=f=>{const m=Math.exp(-f*e),y=(n-f)*(e*e);return m*y});const u=5/e,h=t2(s,o,u);if(e=Pn(e),isNaN(h))return{stiffness:Pt.stiffness,damping:Pt.damping,duration:e};{const f=Math.pow(h,2)*a;return{stiffness:f,damping:c*2*Math.sqrt(a*f),duration:e}}}const r2=["duration","bounce"],a2=["stiffness","damping","mass"];function uk(e,t){return t.some(n=>e[n]!==void 0)}function i2(e){let t={velocity:Pt.velocity,stiffness:Pt.stiffness,damping:Pt.damping,mass:Pt.mass,isResolvedFromDuration:!1,...e};if(!uk(e,a2)&&uk(e,r2))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,a=2*Math.PI/(n*1.2),s=a*a,o=2*xr(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Pt.mass,stiffness:s,damping:o}}else{const n=n2({...e,velocity:0});t={...t,...n,mass:Pt.mass},t.isResolvedFromDuration=!0}return t}function hu(e=Pt.visualDuration,t=Pt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:a,restDelta:s}=n;const o=n.keyframes[0],c=n.keyframes[n.keyframes.length-1],u={done:!1,value:o},{stiffness:h,damping:f,mass:m,duration:y,velocity:k,isResolvedFromDuration:w}=i2({...n,velocity:-On(n.velocity||0)}),P=k||0,C=f/(2*Math.sqrt(h*m)),S=c-o,D=On(Math.sqrt(h/m)),L=Math.abs(S)<5;a||(a=L?Pt.restSpeed.granular:Pt.restSpeed.default),s||(s=L?Pt.restDelta.granular:Pt.restDelta.default);let R,O,W,K,$,x;if(C<1)W=Ef(D,C),K=(P+C*D*S)/W,R=X=>{const le=Math.exp(-C*D*X);return c-le*(K*Math.sin(W*X)+S*Math.cos(W*X))},$=C*D*K+S*W,x=C*D*S-K*W,O=X=>Math.exp(-C*D*X)*($*Math.sin(W*X)+x*Math.cos(W*X));else if(C===1){R=le=>c-Math.exp(-D*le)*(S+(P+D*S)*le);const X=P+D*S;O=le=>Math.exp(-D*le)*(D*X*le-P)}else{const X=D*Math.sqrt(C*C-1);R=de=>{const fe=Math.exp(-C*D*de),ye=Math.min(X*de,300);return c-fe*((P+C*D*S)*Math.sinh(ye)+X*S*Math.cosh(ye))/X};const le=(P+C*D*S)/X,oe=C*D*le-S*X,Ae=C*D*S-le*X;O=de=>{const fe=Math.exp(-C*D*de),ye=Math.min(X*de,300);return fe*(oe*Math.sinh(ye)+Ae*Math.cosh(ye))}}const Y={calculatedDuration:w&&y||null,velocity:X=>Pn(O(X)),next:X=>{if(!w&&C<1){const oe=Math.exp(-C*D*X),Ae=Math.sin(W*X),de=Math.cos(W*X),fe=c-oe*(K*Ae+S*de),ye=Pn(oe*($*Ae+x*de));return u.done=Math.abs(ye)<=a&&Math.abs(c-fe)<=s,u.value=u.done?c:fe,u}const le=R(X);if(w)u.done=X>=y;else{const oe=Pn(O(X));u.done=Math.abs(oe)<=a&&Math.abs(c-le)<=s}return u.value=u.done?c:le,u},toString:()=>{const X=Math.min(Gp(Y),du),le=ow(oe=>Y.next(X*oe).value,X,30);return X+"ms "+le},toTransition:()=>{}};return Y}hu.applyToOptions=e=>{const t=JM(e,100,hu);return e.ease=t.ease,e.duration=Pn(t.duration),e.type="keyframes",e};const s2=5;function lw(e,t,n){const a=Math.max(t-s2,0);return V0(n-e(a),t-a)}function Af({keyframes:e,velocity:t=0,power:n=.8,timeConstant:a=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:c,min:u,max:h,restDelta:f=.5,restSpeed:m}){const y=e[0],k={done:!1,value:y},w=x=>u!==void 0&&x<u||h!==void 0&&x>h,P=x=>u===void 0?h:h===void 0||Math.abs(u-x)<Math.abs(h-x)?u:h;let C=n*t;const S=y+C,D=c===void 0?S:c(S);D!==S&&(C=D-y);const L=x=>-C*Math.exp(-x/a),R=x=>D+L(x),O=x=>{const Y=L(x),X=R(x);k.done=Math.abs(Y)<=f,k.value=k.done?D:X};let W,K;const $=x=>{w(k.value)&&(W=x,K=hu({keyframes:[k.value,P(k.value)],velocity:lw(R,x,k.value),damping:s,stiffness:o,restDelta:f,restSpeed:m}))};return $(0),{calculatedDuration:null,next:x=>{let Y=!1;return!K&&W===void 0&&(Y=!0,O(x),$(x)),W!==void 0&&x>=W?K.next(x-W):(!Y&&O(x),k)}}}function o2(e,t,n){const a=[],s=n||Ma.mix||sw,o=e.length-1;for(let c=0;c<o;c++){let u=s(e[c],e[c+1]);if(t){const h=Array.isArray(t)?t[c]||jn:t;u=Qo(h,u)}a.push(u)}return a}function l2(e,t,{clamp:n=!0,ease:a,mixer:s}={}){const o=e.length;if(Bp(o===t.length),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const c=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const u=o2(t,a,s),h=u.length,f=m=>{if(c&&m<e[0])return t[0];let y=0;if(h>1)for(;y<e.length-2&&!(m<e[y+1]);y++);const k=jo(e[y],e[y+1],m);return u[y](k)};return n?m=>f(xr(e[0],e[o-1],m)):f}function c2(e,t){const n=e[e.length-1];for(let a=1;a<=t;a++){const s=jo(0,t,a);e.push(vt(n,1,s))}}function u2(e){const t=[0];return c2(t,e.length-1),t}function d2(e,t){return e.map(n=>n*t)}function h2(e,t){return e.map(()=>t||Z0).splice(0,e.length-1)}function To({duration:e=300,keyframes:t,times:n,ease:a="easeInOut"}){const s=_M(a)?a.map(ak):ak(a),o={done:!1,value:t[0]},c=d2(n&&n.length===t.length?n:u2(t),e),u=l2(c,t,{ease:Array.isArray(s)?s:h2(t,s)});return{calculatedDuration:e,next:h=>(o.value=u(h),o.done=h>=e,o)}}const f2=e=>e!==null;function Du(e,{repeat:t,repeatType:n="loop"},a,s=1){const o=e.filter(f2),u=s<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!u||a===void 0?o[u]:a}const p2={decay:Af,inertia:Af,tween:To,keyframes:To,spring:hu};function cw(e){typeof e.type=="string"&&(e.type=p2[e.type])}class qp{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const m2=e=>e/100;class fu extends qp{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==on.now()&&this.tick(on.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;cw(t);const{type:n=To,repeat:a=0,repeatDelay:s=0,repeatType:o,velocity:c=0}=t;let{keyframes:u}=t;const h=n||To;h!==To&&typeof u[0]!="number"&&(this.mixKeyframes=Qo(m2,sw(u[0],u[1])),u=[0,100]);const f=h({...t,keyframes:u});o==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...u].reverse(),velocity:-c})),f.calculatedDuration===null&&(f.calculatedDuration=Gp(f));const{calculatedDuration:m}=f;this.calculatedDuration=m,this.resolvedDuration=m+s,this.totalDuration=this.resolvedDuration*(a+1)-s,this.generator=f}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:a,totalDuration:s,mixKeyframes:o,mirroredGenerator:c,resolvedDuration:u,calculatedDuration:h}=this;if(this.startTime===null)return a.next(0);const{delay:f=0,keyframes:m,repeat:y,repeatType:k,repeatDelay:w,type:P,onUpdate:C,finalKeyframe:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const D=this.currentTime-f*(this.playbackSpeed>=0?1:-1),L=this.playbackSpeed>=0?D<0:D>s;this.currentTime=Math.max(D,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let R=this.currentTime,O=a;if(y){const x=Math.min(this.currentTime,s)/u;let Y=Math.floor(x),X=x%1;!X&&x>=1&&(X=1),X===1&&Y--,Y=Math.min(Y,y+1),Y%2&&(k==="reverse"?(X=1-X,w&&(X-=w/u)):k==="mirror"&&(O=c)),R=xr(0,1,X)*u}let W;L?(this.delayState.value=m[0],W=this.delayState):W=O.next(R),o&&!L&&(W.value=o(W.value));let{done:K}=W;!L&&h!==null&&(K=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const $=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&K);return $&&P!==Af&&(W.value=Du(m,this.options,S,this.speed)),C&&C(W.value),$&&this.finish(),W}then(t,n){return this.finished.then(t,n)}get duration(){return On(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+On(t)}get time(){return On(this.currentTime)}set time(t){t=Pn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return lw(a=>this.generator.next(a).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(on.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=On(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=QM,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),this.options.onPlay?.();const a=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=a):this.holdTime!==null?this.startTime=a-this.holdTime:this.startTime||(this.startTime=n??a),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(on.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function g2(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ai=e=>e*180/Math.PI,Rf=e=>{const t=ai(Math.atan2(e[1],e[0]));return Lf(t)},y2={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Rf,rotateZ:Rf,skewX:e=>ai(Math.atan(e[1])),skewY:e=>ai(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Lf=e=>(e=e%360,e<0&&(e+=360),e),dk=Rf,hk=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),fk=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),v2={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:hk,scaleY:fk,scale:e=>(hk(e)+fk(e))/2,rotateX:e=>Lf(ai(Math.atan2(e[6],e[5]))),rotateY:e=>Lf(ai(Math.atan2(-e[2],e[0]))),rotateZ:dk,rotate:dk,skewX:e=>ai(Math.atan(e[4])),skewY:e=>ai(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Df(e){return e.includes("scale")?1:0}function Mf(e,t){if(!e||e==="none")return Df(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,s;if(n)a=v2,s=n;else{const u=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=y2,s=u}if(!s)return Df(t);const o=a[t],c=s[1].split(",").map(_2);return typeof o=="function"?o(c):c[o]}const k2=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Mf(n,t)};function _2(e){return parseFloat(e.trim())}const _s=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],bs=new Set(_s),pk=e=>e===ks||e===_e,b2=new Set(["x","y","z"]),w2=_s.filter(e=>!b2.has(e));function x2(e){const t=[];return w2.forEach(n=>{const a=e.getValue(n);a!==void 0&&(t.push([n,a.get()]),a.set(n.startsWith("scale")?1:0))}),t}const Ra={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:a})=>{const s=e.max-e.min;return a==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:a})=>{const s=e.max-e.min;return a==="border-box"?s:s-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Mf(t,"x"),y:(e,{transform:t})=>Mf(t,"y")};Ra.translateX=Ra.x;Ra.translateY=Ra.y;const ii=new Set;let If=!1,Nf=!1,Of=!1;function uw(){if(Nf){const e=Array.from(ii).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),n=new Map;t.forEach(a=>{const s=x2(a);s.length&&(n.set(a,s),a.render())}),e.forEach(a=>a.measureInitialState()),t.forEach(a=>{a.render();const s=n.get(a);s&&s.forEach(([o,c])=>{a.getValue(o)?.set(c)})}),e.forEach(a=>a.measureEndState()),e.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}Nf=!1,If=!1,ii.forEach(e=>e.complete(Of)),ii.clear()}function dw(){ii.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Nf=!0)})}function P2(){Of=!0,dw(),uw(),Of=!1}class Yp{constructor(t,n,a,s,o,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=a,this.motionValue=s,this.element=o,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(ii.add(this),If||(If=!0,dt.read(dw),dt.resolveKeyframes(uw))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:a,motionValue:s}=this;if(t[0]===null){const o=s?.get(),c=t[t.length-1];if(o!==void 0)t[0]=o;else if(a&&n){const u=a.readValue(n,c);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=c),s&&o===void 0&&s.set(t[0])}g2(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ii.delete(this)}cancel(){this.state==="scheduled"&&(ii.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const S2=e=>e.startsWith("--");function hw(e,t,n){S2(t)?e.style.setProperty(t,n):e.style[t]=n}const C2={};function fw(e,t){const n=F0(e);return()=>C2[t]??n()}const T2=fw(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),pw=fw(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),_o=([e,t,n,a])=>`cubic-bezier(${e}, ${t}, ${n}, ${a})`,mk={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:_o([0,.65,.55,1]),circOut:_o([.55,0,1,.45]),backIn:_o([.31,.01,.66,-.59]),backOut:_o([.33,1.53,.69,.99])};function mw(e,t){if(e)return typeof e=="function"?pw()?ow(e,t):"ease-out":X0(e)?_o(e):Array.isArray(e)?e.map(n=>mw(n,t)||mk.easeOut):mk[e]}function E2(e,t,n,{delay:a=0,duration:s=300,repeat:o=0,repeatType:c="loop",ease:u="easeOut",times:h}={},f=void 0){const m={[t]:n};h&&(m.offset=h);const y=mw(u,s);Array.isArray(y)&&(m.easing=y);const k={delay:a,duration:s,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:o+1,direction:c==="reverse"?"alternate":"normal"};return f&&(k.pseudoElement=f),e.animate(m,k)}function gw(e){return typeof e=="function"&&"applyToOptions"in e}function A2({type:e,...t}){return gw(e)&&pw()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class yw extends qp{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:a,keyframes:s,pseudoElement:o,allowFlatten:c=!1,finalKeyframe:u,onComplete:h}=t;this.isPseudoElement=!!o,this.allowFlatten=c,this.options=t,Bp(typeof t.type!="string");const f=A2(t);this.animation=E2(n,a,s,f,o),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const m=Du(s,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(m),hw(n,a,m),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return On(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+On(t)}get time(){return On(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Pn(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:a,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&T2()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),a&&(this.animation.rangeEnd=a),jn):s(this)}}const vw={anticipate:G0,backInOut:K0,circInOut:Y0};function R2(e){return e in vw}function L2(e){typeof e.ease=="string"&&R2(e.ease)&&(e.ease=vw[e.ease])}const $h=10;class D2 extends yw{constructor(t){L2(t),cw(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:a,onComplete:s,element:o,...c}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const u=new fu({...c,autoplay:!1}),h=Math.max($h,on.now()-this.startTime),f=xr(0,$h,h-$h),m=u.sample(h).value,{name:y}=this.options;o&&y&&hw(o,y,m),n.setWithVelocity(u.sample(Math.max(0,h-f)).value,m,f),u.stop()}}const gk=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ir.test(e)||e==="0")&&!e.startsWith("url("));function M2(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function I2(e,t,n,a){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],c=gk(s,t),u=gk(o,t);return!c||!u?!1:M2(e)||(n==="spring"||gw(n))&&a}function jf(e){e.duration=0,e.type="keyframes"}const kw=new Set(["opacity","clipPath","filter","transform"]),N2=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function O2(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&N2.test(e[t]))return!0;return!1}const j2=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),U2=F0(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function B2(e){const{motionValue:t,name:n,repeatDelay:a,repeatType:s,damping:o,type:c,keyframes:u}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:m}=t.owner.getProps();return U2()&&n&&(kw.has(n)||j2.has(n)&&O2(u))&&(n!=="transform"||!m)&&!f&&!a&&s!=="mirror"&&o!==0&&c!=="inertia"}const F2=40;class V2 extends qp{constructor({autoplay:t=!0,delay:n=0,type:a="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:c="loop",keyframes:u,name:h,motionValue:f,element:m,...y}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=on.now();const k={autoplay:t,delay:n,type:a,repeat:s,repeatDelay:o,repeatType:c,name:h,motionValue:f,element:m,...y},w=m?.KeyframeResolver||Yp;this.keyframeResolver=new w(u,(P,C,S)=>this.onKeyframesResolved(P,C,k,!S),h,f,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,a,s){this.keyframeResolver=void 0;const{name:o,type:c,velocity:u,delay:h,isHandoff:f,onUpdate:m}=a;this.resolvedAt=on.now();let y=!0;I2(t,o,c,u)||(y=!1,(Ma.instantAnimations||!h)&&m?.(Du(t,a,n)),t[0]=t[t.length-1],jf(a),a.repeat=0);const w={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>F2?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...a,keyframes:t},P=y&&!f&&B2(w),C=w.motionValue?.owner?.current;let S;if(P)try{S=new D2({...w,element:C})}catch{S=new fu(w)}else S=new fu(w);S.finished.then(()=>{this.notifyFinished()}).catch(jn),this.pendingTimeline&&(this.stopTimeline=S.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=S}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),P2()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function _w(e,t,n,a=0,s=1){const o=Array.from(e).sort((f,m)=>f.sortNodePosition(m)).indexOf(t),c=e.size,u=(c-1)*a;return typeof n=="function"?n(o,c):s===1?o*a:u-o*a}const z2=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function $2(e){const t=z2.exec(e);if(!t)return[,];const[,n,a,s]=t;return[`--${n??a}`,s]}function bw(e,t,n=1){const[a,s]=$2(e);if(!a)return;const o=window.getComputedStyle(t).getPropertyValue(a);if(o){const c=o.trim();return j0(c)?parseFloat(c):c}return $p(s)?bw(s,t,n+1):s}const H2={type:"spring",stiffness:500,damping:25,restSpeed:10},W2=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),K2={type:"keyframes",duration:.8},G2={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},q2=(e,{keyframes:t})=>t.length>2?K2:bs.has(e)?e.startsWith("scale")?W2(t[1]):H2:G2;function ww(e,t){if(e?.inherit&&t){const{inherit:n,...a}=e;return{...t,...a}}return e}function Zp(e,t){const n=e?.[t]??e?.default??e;return n!==e?ww(n,e):n}const Y2=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Z2(e){for(const t in e)if(!Y2.has(t))return!0;return!1}const Xp=(e,t,n,a={},s,o)=>c=>{const u=Zp(a,e)||{},h=u.delay||a.delay||0;let{elapsed:f=0}=a;f=f-Pn(h);const m={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-f,onUpdate:k=>{t.set(k),u.onUpdate&&u.onUpdate(k)},onComplete:()=>{c(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:o?void 0:s};Z2(u)||Object.assign(m,q2(e,m)),m.duration&&(m.duration=Pn(m.duration)),m.repeatDelay&&(m.repeatDelay=Pn(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let y=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(jf(m),m.delay===0&&(y=!0)),(Ma.instantAnimations||Ma.skipAnimations||s?.shouldSkipAnimations)&&(y=!0,jf(m),m.delay=0),m.allowFlatten=!u.type&&!u.ease,y&&!o&&t.get()!==void 0){const k=Du(m.keyframes,u);if(k!==void 0){dt.update(()=>{m.onUpdate(k),m.onComplete()});return}}return u.isSync?new fu(m):new V2(m)};function yk(e){const t=[{},{}];return e?.values.forEach((n,a)=>{t[0][a]=n.get(),t[1][a]=n.getVelocity()}),t}function Qp(e,t,n,a){if(typeof t=="function"){const[s,o]=yk(a);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=yk(a);t=t(n!==void 0?n:e.custom,s,o)}return t}function si(e,t,n){const a=e.getProps();return Qp(a,t,n!==void 0?n:a.custom,e)}const xw=new Set(["width","height","top","left","right","bottom",..._s]),vk=30,X2=e=>!isNaN(parseFloat(e)),kk={current:void 0};class Q2{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const s=on.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=on.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=X2(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Fp);const a=this.events[t].add(n);return t==="change"?()=>{a(),dt.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,a){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-a}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return kk.current&&kk.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=on.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>vk)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,vk);return V0(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function gs(e,t){return new Q2(e,t)}const Uf=e=>Array.isArray(e);function J2(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,gs(n))}function eI(e){return Uf(e)?e[e.length-1]||0:e}function tI(e,t){const n=si(e,t);let{transitionEnd:a={},transition:s={},...o}=n||{};o={...o,...a};for(const c in o){const u=eI(o[c]);J2(e,c,u)}}const Gt=e=>!!(e&&e.getVelocity);function nI(e){return!!(Gt(e)&&e.add)}function Bf(e,t){const n=e.getValue("willChange");if(nI(n))return n.add(t);if(!n&&Ma.WillChange){const a=new Ma.WillChange("auto");e.addValue("willChange",a),a.add(t)}}function Jp(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const rI="framerAppearId",Pw="data-"+Jp(rI);function Sw(e){return e.props[Pw]}function aI({protectedKeys:e,needsAnimating:t},n){const a=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,a}function Cw(e,t,{delay:n=0,transitionOverride:a,type:s}={}){let{transition:o,transitionEnd:c,...u}=t;const h=e.getDefaultTransition();o=o?ww(o,h):h;const f=o?.reduceMotion;a&&(o=a);const m=[],y=s&&e.animationState&&e.animationState.getState()[s];for(const k in u){const w=e.getValue(k,e.latestValues[k]??null),P=u[k];if(P===void 0||y&&aI(y,k))continue;const C={delay:n,...Zp(o||{},k)},S=w.get();if(S!==void 0&&!w.isAnimating()&&!Array.isArray(P)&&P===S&&!C.velocity){dt.update(()=>w.set(P));continue}let D=!1;if(window.MotionHandoffAnimation){const O=Sw(e);if(O){const W=window.MotionHandoffAnimation(O,k,dt);W!==null&&(C.startTime=W,D=!0)}}Bf(e,k);const L=f??e.shouldReduceMotion;w.start(Xp(k,w,P,L&&xw.has(k)?{type:!1}:C,e,D));const R=w.animation;R&&m.push(R)}if(c){const k=()=>dt.update(()=>{c&&tI(e,c)});m.length?Promise.all(m).then(k):k()}return m}function Ff(e,t,n={}){const a=si(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=a||{};n.transitionOverride&&(s=n.transitionOverride);const o=a?()=>Promise.all(Cw(e,a,n)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:f=0,staggerChildren:m,staggerDirection:y}=s;return iI(e,t,h,f,m,y,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[h,f]=u==="beforeChildren"?[o,c]:[c,o];return h().then(()=>f())}else return Promise.all([o(),c(n.delay)])}function iI(e,t,n=0,a=0,s=0,o=1,c){const u=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),u.push(Ff(h,t,{...c,delay:n+(typeof a=="function"?0:a)+_w(e.variantChildren,h,a,s,o)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(u)}function sI(e,t,n={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){const s=t.map(o=>Ff(e,o,n));a=Promise.all(s)}else if(typeof t=="string")a=Ff(e,t,n);else{const s=typeof t=="function"?si(e,t,n.custom):t;a=Promise.all(Cw(e,s,n))}return a.then(()=>{e.notify("AnimationComplete",t)})}const oI={test:e=>e==="auto",parse:e=>e},Tw=e=>t=>t.test(e),Ew=[ks,_e,vr,Pa,MM,DM,oI],_k=e=>Ew.find(Tw(e));function lI(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||B0(e):!0}const cI=new Set(["brightness","contrast","saturate","opacity"]);function uI(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[a]=n.match(Hp)||[];if(!a)return e;const s=n.replace(a,"");let o=cI.has(t)?1:0;return a!==n&&(o*=100),t+"("+o+s+")"}const dI=/\b([a-z-]*)\(.*?\)/gu,Vf={...ir,getAnimatableNone:e=>{const t=e.match(dI);return t?t.map(uI).join(" "):e}},zf={...ir,getAnimatableNone:e=>{const t=ir.parse(e);return ir.createTransformer(e)(t.map(a=>typeof a=="number"?0:typeof a=="object"?{...a,alpha:1}:a))}},bk={...ks,transform:Math.round},hI={rotate:Pa,rotateX:Pa,rotateY:Pa,rotateZ:Pa,scale:vc,scaleX:vc,scaleY:vc,scaleZ:vc,skew:Pa,skewX:Pa,skewY:Pa,distance:_e,translateX:_e,translateY:_e,translateZ:_e,x:_e,y:_e,z:_e,perspective:_e,transformPerspective:_e,opacity:Uo,originX:sk,originY:sk,originZ:_e},em={borderWidth:_e,borderTopWidth:_e,borderRightWidth:_e,borderBottomWidth:_e,borderLeftWidth:_e,borderRadius:_e,borderTopLeftRadius:_e,borderTopRightRadius:_e,borderBottomRightRadius:_e,borderBottomLeftRadius:_e,width:_e,maxWidth:_e,height:_e,maxHeight:_e,top:_e,right:_e,bottom:_e,left:_e,inset:_e,insetBlock:_e,insetBlockStart:_e,insetBlockEnd:_e,insetInline:_e,insetInlineStart:_e,insetInlineEnd:_e,padding:_e,paddingTop:_e,paddingRight:_e,paddingBottom:_e,paddingLeft:_e,paddingBlock:_e,paddingBlockStart:_e,paddingBlockEnd:_e,paddingInline:_e,paddingInlineStart:_e,paddingInlineEnd:_e,margin:_e,marginTop:_e,marginRight:_e,marginBottom:_e,marginLeft:_e,marginBlock:_e,marginBlockStart:_e,marginBlockEnd:_e,marginInline:_e,marginInlineStart:_e,marginInlineEnd:_e,fontSize:_e,backgroundPositionX:_e,backgroundPositionY:_e,...hI,zIndex:bk,fillOpacity:Uo,strokeOpacity:Uo,numOctaves:bk},fI={...em,color:Lt,backgroundColor:Lt,outlineColor:Lt,fill:Lt,stroke:Lt,borderColor:Lt,borderTopColor:Lt,borderRightColor:Lt,borderBottomColor:Lt,borderLeftColor:Lt,filter:Vf,WebkitFilter:Vf,mask:zf,WebkitMask:zf},Aw=e=>fI[e],pI=new Set([Vf,zf]);function Rw(e,t){let n=Aw(e);return pI.has(n)||(n=ir),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const mI=new Set(["auto","none","0"]);function gI(e,t,n){let a=0,s;for(;a<e.length&&!s;){const o=e[a];typeof o=="string"&&!mI.has(o)&&ms(o).values.length&&(s=e[a]),a++}if(s&&n)for(const o of t)e[o]=Rw(n,s)}class yI extends Yp{constructor(t,n,a,s,o){super(t,n,a,s,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:a}=this;if(!n||!n.current)return;super.readKeyframes();for(let m=0;m<t.length;m++){let y=t[m];if(typeof y=="string"&&(y=y.trim(),$p(y))){const k=bw(y,n.current);k!==void 0&&(t[m]=k),m===t.length-1&&(this.finalKeyframe=y)}}if(this.resolveNoneKeyframes(),!xw.has(a)||t.length!==2)return;const[s,o]=t,c=_k(s),u=_k(o),h=ik(s),f=ik(o);if(h!==f&&Ra[a]){this.needsMeasurement=!0;return}if(c!==u)if(pk(c)&&pk(u))for(let m=0;m<t.length;m++){const y=t[m];typeof y=="string"&&(t[m]=parseFloat(y))}else Ra[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,a=[];for(let s=0;s<t.length;s++)(t[s]===null||lI(t[s]))&&a.push(s);a.length&&gI(t,a,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:a}=this;if(!t||!t.current)return;a==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ra[a](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(a,s).jump(s,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:a}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=a.length-1,c=a[o];a[o]=Ra[n](t.measureViewportBox(),window.getComputedStyle(t.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),this.removedTransforms?.length&&this.removedTransforms.forEach(([u,h])=>{t.getValue(u).set(h)}),this.resolveNoneKeyframes()}}function Lw(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let a=document;const s=n?.[e]??a.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(a=>a!=null)}const Dw=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function jc(e){return U0(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:tm}=Q0(queueMicrotask,!1),tr={x:!1,y:!1};function Mw(){return tr.x||tr.y}function vI(e){return e==="x"||e==="y"?tr[e]?null:(tr[e]=!0,()=>{tr[e]=!1}):tr.x||tr.y?null:(tr.x=tr.y=!0,()=>{tr.x=tr.y=!1})}function Iw(e,t){const n=Lw(e),a=new AbortController,s={passive:!0,...t,signal:a.signal};return[n,s,()=>a.abort()]}function kI(e){return!(e.pointerType==="touch"||Mw())}function _I(e,t,n={}){const[a,s,o]=Iw(e,n);return a.forEach(c=>{let u=!1,h=!1,f;const m=()=>{c.removeEventListener("pointerleave",P)},y=S=>{f&&(f(S),f=void 0),m()},k=S=>{u=!1,window.removeEventListener("pointerup",k),window.removeEventListener("pointercancel",k),h&&(h=!1,y(S))},w=()=>{u=!0,window.addEventListener("pointerup",k,s),window.addEventListener("pointercancel",k,s)},P=S=>{if(S.pointerType!=="touch"){if(u){h=!0;return}y(S)}},C=S=>{if(!kI(S))return;h=!1;const D=t(c,S);typeof D=="function"&&(f=D,c.addEventListener("pointerleave",P,s))};c.addEventListener("pointerenter",C,s),c.addEventListener("pointerdown",w,s)}),o}const Nw=(e,t)=>t?e===t?!0:Nw(e,t.parentElement):!1,nm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,bI=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function wI(e){return bI.has(e.tagName)||e.isContentEditable===!0}const xI=new Set(["INPUT","SELECT","TEXTAREA"]);function PI(e){return xI.has(e.tagName)||e.isContentEditable===!0}const Uc=new WeakSet;function wk(e){return t=>{t.key==="Enter"&&e(t)}}function Hh(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const SI=(e,t)=>{const n=e.currentTarget;if(!n)return;const a=wk(()=>{if(Uc.has(n))return;Hh(n,"down");const s=wk(()=>{Hh(n,"up")}),o=()=>Hh(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",a,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",a),t)};function xk(e){return nm(e)&&!Mw()}const Pk=new WeakSet;function CI(e,t,n={}){const[a,s,o]=Iw(e,n),c=u=>{const h=u.currentTarget;if(!xk(u)||Pk.has(u))return;Uc.add(h),n.stopPropagation&&Pk.add(u);const f=t(h,u),m=(w,P)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",k),Uc.has(h)&&Uc.delete(h),xk(w)&&typeof f=="function"&&f(w,{success:P})},y=w=>{m(w,h===window||h===document||n.useGlobalTarget||Nw(h,w.target))},k=w=>{m(w,!1)};window.addEventListener("pointerup",y,s),window.addEventListener("pointercancel",k,s)};return a.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",c,s),jc(u)&&(u.addEventListener("focus",f=>SI(f,s)),!wI(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),o}function rm(e){return U0(e)&&"ownerSVGElement"in e}const Bc=new WeakMap;let Fc;const Ow=(e,t,n)=>(a,s)=>s&&s[0]?s[0][e+"Size"]:rm(a)&&"getBBox"in a?a.getBBox()[t]:a[n],TI=Ow("inline","width","offsetWidth"),EI=Ow("block","height","offsetHeight");function AI({target:e,borderBoxSize:t}){Bc.get(e)?.forEach(n=>{n(e,{get width(){return TI(e,t)},get height(){return EI(e,t)}})})}function RI(e){e.forEach(AI)}function LI(){typeof ResizeObserver>"u"||(Fc=new ResizeObserver(RI))}function DI(e,t){Fc||LI();const n=Lw(e);return n.forEach(a=>{let s=Bc.get(a);s||(s=new Set,Bc.set(a,s)),s.add(t),Fc?.observe(a)}),()=>{n.forEach(a=>{const s=Bc.get(a);s?.delete(t),s?.size||Fc?.unobserve(a)})}}const Vc=new Set;let is;function MI(){is=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Vc.forEach(t=>t(e))},window.addEventListener("resize",is)}function II(e){return Vc.add(e),is||MI(),()=>{Vc.delete(e),!Vc.size&&typeof is=="function"&&(window.removeEventListener("resize",is),is=void 0)}}function Sk(e,t){return typeof e=="function"?II(e):DI(e,t)}function NI(e){return rm(e)&&e.tagName==="svg"}const OI=[...Ew,Lt,ir],jI=e=>OI.find(Tw(e)),Ck=()=>({translate:0,scale:1,origin:0,originPoint:0}),ss=()=>({x:Ck(),y:Ck()}),Tk=()=>({min:0,max:0}),Ot=()=>({x:Tk(),y:Tk()}),UI=new WeakMap;function Mu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Bo(e){return typeof e=="string"||Array.isArray(e)}const am=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],im=["initial",...am];function Iu(e){return Mu(e.animate)||im.some(t=>Bo(e[t]))}function jw(e){return!!(Iu(e)||e.variants)}function BI(e,t,n){for(const a in t){const s=t[a],o=n[a];if(Gt(s))e.addValue(a,s);else if(Gt(o))e.addValue(a,gs(s,{owner:e}));else if(o!==s)if(e.hasValue(a)){const c=e.getValue(a);c.liveStyle===!0?c.jump(s):c.hasAnimated||c.set(s)}else{const c=e.getStaticValue(a);e.addValue(a,gs(c!==void 0?c:s,{owner:e}))}}for(const a in n)t[a]===void 0&&e.removeValue(a);return t}const $f={current:null},Uw={current:!1},FI=typeof window<"u";function VI(){if(Uw.current=!0,!!FI)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>$f.current=e.matches;e.addEventListener("change",t),t()}else $f.current=!1}const Ek=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let pu={};function Bw(e){pu=e}function zI(){return pu}class $I{scrapeMotionValuesFromProps(t,n,a){return{}}constructor({parent:t,props:n,presenceContext:a,reducedMotionConfig:s,skipAnimations:o,blockInitialAnimation:c,visualState:u},h={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Yp,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const w=on.now();this.renderScheduledAt<w&&(this.renderScheduledAt=w,dt.render(this.render,!1,!0))};const{latestValues:f,renderState:m}=u;this.latestValues=f,this.baseTarget={...f},this.initialValues=n.initial?{...f}:{},this.renderState=m,this.parent=t,this.props=n,this.presenceContext=a,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=o,this.options=h,this.blockInitialAnimation=!!c,this.isControllingVariants=Iu(n),this.isVariantNode=jw(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:y,...k}=this.scrapeMotionValuesFromProps(n,{},this);for(const w in k){const P=k[w];f[w]!==void 0&&Gt(P)&&P.set(f[w])}}mount(t){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,UI.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,a)=>this.bindToMotionValue(a,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Uw.current||VI(),this.shouldReduceMotion=$f.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Ia(this.notifyUpdate),Ia(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&kw.has(t)&&this.current instanceof HTMLElement){const{factory:c,keyframes:u,times:h,ease:f,duration:m}=n.accelerate,y=new yw({element:this.current,name:t,keyframes:u,times:h,ease:f,duration:Pn(m)}),k=c(y);this.valueSubscriptions.set(t,()=>{k(),y.cancel()});return}const a=bs.has(t);a&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",c=>{this.latestValues[t]=c,this.props.onUpdate&&dt.preRender(this.notifyUpdate),a&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in pu){const n=pu[t];if(!n)continue;const{isEnabled:a,Feature:s}=n;if(!this.features[t]&&s&&a(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ot()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let a=0;a<Ek.length;a++){const s=Ek[a];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,c=t[o];c&&(this.propEventSubscriptions[s]=this.on(s,c))}this.prevMotionValues=BI(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const a=this.values.get(t);n!==a&&(a&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let a=this.values.get(t);return a===void 0&&n!==void 0&&(a=gs(n===null?void 0:n,{owner:this}),this.addValue(t,a)),a}readValue(t,n){let a=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return a!=null&&(typeof a=="string"&&(j0(a)||B0(a))?a=parseFloat(a):!jI(a)&&ir.test(n)&&(a=Rw(t,n)),this.setBaseTarget(t,Gt(a)?a.get():a)),Gt(a)?a.get():a}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let a;if(typeof n=="string"||typeof n=="object"){const o=Qp(this.props,n,this.presenceContext?.custom);o&&(a=o[t])}if(n&&a!==void 0)return a;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Gt(s)?s:this.initialValues[t]!==void 0&&a===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Fp),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){tm.render(this.render)}}class Fw extends $I{constructor(){super(...arguments),this.KeyframeResolver=yI}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const a=t.style;return a?a[n]:void 0}removeValueFromRenderState(t,{vars:n,style:a}){delete n[t],delete a[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Gt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Oa{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Vw({top:e,left:t,right:n,bottom:a}){return{x:{min:t,max:n},y:{min:e,max:a}}}function HI({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function WI(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),a=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:a.y,right:a.x}}function Wh(e){return e===void 0||e===1}function Hf({scale:e,scaleX:t,scaleY:n}){return!Wh(e)||!Wh(t)||!Wh(n)}function ei(e){return Hf(e)||zw(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function zw(e){return Ak(e.x)||Ak(e.y)}function Ak(e){return e&&e!=="0%"}function mu(e,t,n){const a=e-n,s=t*a;return n+s}function Rk(e,t,n,a,s){return s!==void 0&&(e=mu(e,s,a)),mu(e,n,a)+t}function Wf(e,t=0,n=1,a,s){e.min=Rk(e.min,t,n,a,s),e.max=Rk(e.max,t,n,a,s)}function $w(e,{x:t,y:n}){Wf(e.x,t.translate,t.scale,t.originPoint),Wf(e.y,n.translate,n.scale,n.originPoint)}const Lk=.999999999999,Dk=1.0000000000001;function KI(e,t,n,a=!1){const s=n.length;if(!s)return;t.x=t.y=1;let o,c;for(let u=0;u<s;u++){o=n[u],c=o.projectionDelta;const{visualElement:h}=o.options;h&&h.props.style&&h.props.style.display==="contents"||(a&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(mr(e.x,-o.scroll.offset.x),mr(e.y,-o.scroll.offset.y)),c&&(t.x*=c.x.scale,t.y*=c.y.scale,$w(e,c)),a&&ei(o.latestValues)&&zc(e,o.latestValues,o.layout?.layoutBox))}t.x<Dk&&t.x>Lk&&(t.x=1),t.y<Dk&&t.y>Lk&&(t.y=1)}function mr(e,t){e.min+=t,e.max+=t}function Mk(e,t,n,a,s=.5){const o=vt(e.min,e.max,s);Wf(e,t,n,o,a)}function Ik(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function zc(e,t,n){const a=n??e;Mk(e.x,Ik(t.x,a.x),t.scaleX,t.scale,t.originX),Mk(e.y,Ik(t.y,a.y),t.scaleY,t.scale,t.originY)}function Hw(e,t){return Vw(WI(e.getBoundingClientRect(),t))}function GI(e,t,n){const a=Hw(e,n),{scroll:s}=t;return s&&(mr(a.x,s.offset.x),mr(a.y,s.offset.y)),a}const qI={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},YI=_s.length;function ZI(e,t,n){let a="",s=!0;for(let o=0;o<YI;o++){const c=_s[o],u=e[c];if(u===void 0)continue;let h=!0;if(typeof u=="number")h=u===(c.startsWith("scale")?1:0);else{const f=parseFloat(u);h=c.startsWith("scale")?f===1:f===0}if(!h||n){const f=Dw(u,em[c]);if(!h){s=!1;const m=qI[c]||c;a+=`${m}(${f}) `}n&&(t[c]=f)}}return a=a.trim(),n?a=n(t,s?"":a):s&&(a="none"),a}function sm(e,t,n){const{style:a,vars:s,transformOrigin:o}=e;let c=!1,u=!1;for(const h in t){const f=t[h];if(bs.has(h)){c=!0;continue}else if(ew(h)){s[h]=f;continue}else{const m=Dw(f,em[h]);h.startsWith("origin")?(u=!0,o[h]=m):a[h]=m}}if(t.transform||(c||n?a.transform=ZI(t,e.transform,n):a.transform&&(a.transform="none")),u){const{originX:h="50%",originY:f="50%",originZ:m=0}=o;a.transformOrigin=`${h} ${f} ${m}`}}function Ww(e,{style:t,vars:n},a,s){const o=e.style;let c;for(c in t)o[c]=t[c];s?.applyProjectionStyles(o,a);for(c in n)o.setProperty(c,n[c])}function Nk(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const po={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_e.test(e))e=parseFloat(e);else return e;const n=Nk(e,t.target.x),a=Nk(e,t.target.y);return`${n}% ${a}%`}},XI={correct:(e,{treeScale:t,projectionDelta:n})=>{const a=e,s=ir.parse(e);if(s.length>5)return a;const o=ir.createTransformer(e),c=typeof s[0]!="number"?1:0,u=n.x.scale*t.x,h=n.y.scale*t.y;s[0+c]/=u,s[1+c]/=h;const f=vt(u,h,.5);return typeof s[2+c]=="number"&&(s[2+c]/=f),typeof s[3+c]=="number"&&(s[3+c]/=f),o(s)}},Kf={borderRadius:{...po,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:po,borderTopRightRadius:po,borderBottomLeftRadius:po,borderBottomRightRadius:po,boxShadow:XI};function Kw(e,{layout:t,layoutId:n}){return bs.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Kf[e]||e==="opacity")}function om(e,t,n){const a=e.style,s=t?.style,o={};if(!a)return o;for(const c in a)(Gt(a[c])||s&&Gt(s[c])||Kw(c,e)||n?.getValue(c)?.liveStyle!==void 0)&&(o[c]=a[c]);return o}function QI(e){return window.getComputedStyle(e)}class JI extends Fw{constructor(){super(...arguments),this.type="html",this.renderInstance=Ww}readValueFromInstance(t,n){if(bs.has(n))return this.projection?.isProjecting?Df(n):k2(t,n);{const a=QI(t),s=(ew(n)?a.getPropertyValue(n):a[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Hw(t,n)}build(t,n,a){sm(t,n,a.transformTemplate)}scrapeMotionValuesFromProps(t,n,a){return om(t,n,a)}}const eN={offset:"stroke-dashoffset",array:"stroke-dasharray"},tN={offset:"strokeDashoffset",array:"strokeDasharray"};function nN(e,t,n=1,a=0,s=!0){e.pathLength=1;const o=s?eN:tN;e[o.offset]=`${-a}`,e[o.array]=`${t} ${n}`}const rN=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Gw(e,{attrX:t,attrY:n,attrScale:a,pathLength:s,pathSpacing:o=1,pathOffset:c=0,...u},h,f,m){if(sm(e,u,f),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:y,style:k}=e;y.transform&&(k.transform=y.transform,delete y.transform),(k.transform||y.transformOrigin)&&(k.transformOrigin=y.transformOrigin??"50% 50%",delete y.transformOrigin),k.transform&&(k.transformBox=m?.transformBox??"fill-box",delete y.transformBox);for(const w of rN)y[w]!==void 0&&(k[w]=y[w],delete y[w]);t!==void 0&&(y.x=t),n!==void 0&&(y.y=n),a!==void 0&&(y.scale=a),s!==void 0&&nN(y,s,o,c,!1)}const qw=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Yw=e=>typeof e=="string"&&e.toLowerCase()==="svg";function aN(e,t,n,a){Ww(e,t,void 0,a);for(const s in t.attrs)e.setAttribute(qw.has(s)?s:Jp(s),t.attrs[s])}function Zw(e,t,n){const a=om(e,t,n);for(const s in e)if(Gt(e[s])||Gt(t[s])){const o=_s.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;a[o]=e[s]}return a}class iN extends Fw{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ot}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(bs.has(n)){const a=Aw(n);return a&&a.default||0}return n=qw.has(n)?n:Jp(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,a){return Zw(t,n,a)}build(t,n,a){Gw(t,n,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(t,n,a,s){aN(t,n,a,s)}mount(t){this.isSVGTag=Yw(t.tagName),super.mount(t)}}const sN=im.length;function Xw(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Xw(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<sN;n++){const a=im[n],s=e.props[a];(Bo(s)||s===!1)&&(t[a]=s)}return t}function Qw(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let a=0;a<n;a++)if(t[a]!==e[a])return!1;return!0}const oN=[...am].reverse(),lN=am.length;function cN(e){return t=>Promise.all(t.map(({animation:n,options:a})=>sI(e,n,a)))}function uN(e){let t=cN(e),n=Ok(),a=!0,s=!1;const o=f=>(m,y)=>{const k=si(e,y,f==="exit"?e.presenceContext?.custom:void 0);if(k){const{transition:w,transitionEnd:P,...C}=k;m={...m,...C,...P}}return m};function c(f){t=f(e)}function u(f){const{props:m}=e,y=Xw(e.parent)||{},k=[],w=new Set;let P={},C=1/0;for(let D=0;D<lN;D++){const L=oN[D],R=n[L],O=m[L]!==void 0?m[L]:y[L],W=Bo(O),K=L===f?R.isActive:null;K===!1&&(C=D);let $=O===y[L]&&O!==m[L]&&W;if($&&(a||s)&&e.manuallyAnimateOnMount&&($=!1),R.protectedKeys={...P},!R.isActive&&K===null||!O&&!R.prevProp||Mu(O)||typeof O=="boolean")continue;if(L==="exit"&&R.isActive&&K!==!0){R.prevResolvedValues&&(P={...P,...R.prevResolvedValues});continue}const x=dN(R.prevProp,O);let Y=x||L===f&&R.isActive&&!$&&W||D>C&&W,X=!1;const le=Array.isArray(O)?O:[O];let oe=le.reduce(o(L),{});K===!1&&(oe={});const{prevResolvedValues:Ae={}}=R,de={...Ae,...oe},fe=G=>{Y=!0,w.has(G)&&(X=!0,w.delete(G)),R.needsAnimating[G]=!0;const Z=e.getValue(G);Z&&(Z.liveStyle=!1)};for(const G in de){const Z=oe[G],H=Ae[G];if(P.hasOwnProperty(G))continue;let I=!1;Uf(Z)&&Uf(H)?I=!Qw(Z,H):I=Z!==H,I?Z!=null?fe(G):w.add(G):Z!==void 0&&w.has(G)?fe(G):R.protectedKeys[G]=!0}R.prevProp=O,R.prevResolvedValues=oe,R.isActive&&(P={...P,...oe}),(a||s)&&e.blockInitialAnimation&&(Y=!1);const ye=$&&x;Y&&(!ye||X)&&k.push(...le.map(G=>{const Z={type:L};if(typeof G=="string"&&(a||s)&&!ye&&e.manuallyAnimateOnMount&&e.parent){const{parent:H}=e,I=si(H,G);if(H.enteringChildren&&I){const{delayChildren:q}=I.transition||{};Z.delay=_w(H.enteringChildren,e,q)}}return{animation:G,options:Z}}))}if(w.size){const D={};if(typeof m.initial!="boolean"){const L=si(e,Array.isArray(m.initial)?m.initial[0]:m.initial);L&&L.transition&&(D.transition=L.transition)}w.forEach(L=>{const R=e.getBaseTarget(L),O=e.getValue(L);O&&(O.liveStyle=!0),D[L]=R??null}),k.push({animation:D})}let S=!!k.length;return a&&(m.initial===!1||m.initial===m.animate)&&!e.manuallyAnimateOnMount&&(S=!1),a=!1,s=!1,S?t(k):Promise.resolve()}function h(f,m){if(n[f].isActive===m)return Promise.resolve();e.variantChildren?.forEach(k=>k.animationState?.setActive(f,m)),n[f].isActive=m;const y=u(f);for(const k in n)n[k].protectedKeys={};return y}return{animateChanges:u,setActive:h,setAnimateFunction:c,getState:()=>n,reset:()=>{n=Ok(),s=!0}}}function dN(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Qw(t,e):!1}function Qa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ok(){return{animate:Qa(!0),whileInView:Qa(),whileHover:Qa(),whileTap:Qa(),whileDrag:Qa(),whileFocus:Qa(),exit:Qa()}}function Gf(e,t){e.min=t.min,e.max=t.max}function er(e,t){Gf(e.x,t.x),Gf(e.y,t.y)}function jk(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Jw=1e-4,hN=1-Jw,fN=1+Jw,ex=.01,pN=0-ex,mN=0+ex;function ln(e){return e.max-e.min}function gN(e,t,n){return Math.abs(e-t)<=n}function Uk(e,t,n,a=.5){e.origin=a,e.originPoint=vt(t.min,t.max,e.origin),e.scale=ln(n)/ln(t),e.translate=vt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=hN&&e.scale<=fN||isNaN(e.scale))&&(e.scale=1),(e.translate>=pN&&e.translate<=mN||isNaN(e.translate))&&(e.translate=0)}function Eo(e,t,n,a){Uk(e.x,t.x,n.x,a?a.originX:void 0),Uk(e.y,t.y,n.y,a?a.originY:void 0)}function Bk(e,t,n,a=0){const s=a?vt(n.min,n.max,a):n.min;e.min=s+t.min,e.max=e.min+ln(t)}function yN(e,t,n,a){Bk(e.x,t.x,n.x,a?.x),Bk(e.y,t.y,n.y,a?.y)}function Fk(e,t,n,a=0){const s=a?vt(n.min,n.max,a):n.min;e.min=t.min-s,e.max=e.min+ln(t)}function gu(e,t,n,a){Fk(e.x,t.x,n.x,a?.x),Fk(e.y,t.y,n.y,a?.y)}function Vk(e,t,n,a,s){return e-=t,e=mu(e,1/n,a),s!==void 0&&(e=mu(e,1/s,a)),e}function vN(e,t=0,n=1,a=.5,s,o=e,c=e){if(vr.test(t)&&(t=parseFloat(t),t=vt(c.min,c.max,t/100)-c.min),typeof t!="number")return;let u=vt(o.min,o.max,a);e===o&&(u-=t),e.min=Vk(e.min,t,n,u,s),e.max=Vk(e.max,t,n,u,s)}function zk(e,t,[n,a,s],o,c){vN(e,t[n],t[a],t[s],t.scale,o,c)}const kN=["x","scaleX","originX"],_N=["y","scaleY","originY"];function $k(e,t,n,a){zk(e.x,t,kN,n?n.x:void 0,a?a.x:void 0),zk(e.y,t,_N,n?n.y:void 0,a?a.y:void 0)}function Hk(e){return e.translate===0&&e.scale===1}function tx(e){return Hk(e.x)&&Hk(e.y)}function Wk(e,t){return e.min===t.min&&e.max===t.max}function bN(e,t){return Wk(e.x,t.x)&&Wk(e.y,t.y)}function Kk(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function nx(e,t){return Kk(e.x,t.x)&&Kk(e.y,t.y)}function Gk(e){return ln(e.x)/ln(e.y)}function qk(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function pr(e){return[e("x"),e("y")]}function wN(e,t,n){let a="";const s=e.x.translate/t.x,o=e.y.translate/t.y,c=n?.z||0;if((s||o||c)&&(a=`translate3d(${s}px, ${o}px, ${c}px) `),(t.x!==1||t.y!==1)&&(a+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:f,rotate:m,rotateX:y,rotateY:k,skewX:w,skewY:P}=n;f&&(a=`perspective(${f}px) ${a}`),m&&(a+=`rotate(${m}deg) `),y&&(a+=`rotateX(${y}deg) `),k&&(a+=`rotateY(${k}deg) `),w&&(a+=`skewX(${w}deg) `),P&&(a+=`skewY(${P}deg) `)}const u=e.x.scale*t.x,h=e.y.scale*t.y;return(u!==1||h!==1)&&(a+=`scale(${u}, ${h})`),a||"none"}const rx=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],xN=rx.length,Yk=e=>typeof e=="string"?parseFloat(e):e,Zk=e=>typeof e=="number"||_e.test(e);function PN(e,t,n,a,s,o){s?(e.opacity=vt(0,n.opacity??1,SN(a)),e.opacityExit=vt(t.opacity??1,0,CN(a))):o&&(e.opacity=vt(t.opacity??1,n.opacity??1,a));for(let c=0;c<xN;c++){const u=rx[c];let h=Xk(t,u),f=Xk(n,u);if(h===void 0&&f===void 0)continue;h||(h=0),f||(f=0),h===0||f===0||Zk(h)===Zk(f)?(e[u]=Math.max(vt(Yk(h),Yk(f),a),0),(vr.test(f)||vr.test(h))&&(e[u]+="%")):e[u]=f}(t.rotate||n.rotate)&&(e.rotate=vt(t.rotate||0,n.rotate||0,a))}function Xk(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const SN=ax(0,.5,q0),CN=ax(.5,.95,jn);function ax(e,t,n){return a=>a<e?0:a>t?1:n(jo(e,t,a))}function TN(e,t,n){const a=Gt(e)?e:gs(e);return a.start(Xp("",a,t,n)),a.animation}function Fo(e,t,n,a={passive:!0}){return e.addEventListener(t,n,a),()=>e.removeEventListener(t,n)}const EN=(e,t)=>e.depth-t.depth;class AN{constructor(){this.children=[],this.isDirty=!1}add(t){Up(this.children,t),this.isDirty=!0}remove(t){cu(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(EN),this.isDirty=!1,this.children.forEach(t)}}function RN(e,t){const n=on.now(),a=({timestamp:s})=>{const o=s-n;o>=t&&(Ia(a),e(o-t))};return dt.setup(a,!0),()=>Ia(a)}function $c(e){return Gt(e)?e.get():e}class LN{constructor(){this.members=[]}add(t){Up(this.members,t);for(let n=this.members.length-1;n>=0;n--){const a=this.members[n];if(a===t||a===this.lead||a===this.prevLead)continue;const s=a.instance;(!s||s.isConnected===!1)&&!a.snapshot&&(cu(this.members,a),a.unmount())}t.scheduleRender()}remove(t){if(cu(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){for(let n=this.members.indexOf(t)-1;n>=0;n--){const a=this.members[n];if(a.isPresent!==!1&&a.instance?.isConnected!==!1)return this.promote(a),!0}return!1}promote(t,n){const a=this.lead;if(t!==a&&(this.prevLead=a,this.lead=t,t.show(),a)){a.updateSnapshot(),t.scheduleRender();const{layoutDependency:s}=a.options,{layoutDependency:o}=t.options;(s===void 0||s!==o)&&(t.resumeFrom=a,n&&(a.preserveOpacity=!0),a.snapshot&&(t.snapshot=a.snapshot,t.snapshot.latestValues=a.animationValues||a.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&a.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Hc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Kh=["","X","Y","Z"],DN=1e3;let MN=0;function Gh(e,t,n,a){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),a&&(a[e]=0))}function ix(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Sw(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",dt,!(s||o))}const{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&ix(a)}function sx({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:a,resetTransform:s}){return class{constructor(c={},u=t?.()){this.id=MN++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(ON),this.nodes.forEach(zN),this.nodes.forEach($N),this.nodes.forEach(jN)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new AN)}addEventListener(c,u){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new Fp),this.eventHandlers.get(c).add(u)}notifyListeners(c,...u){const h=this.eventHandlers.get(c);h&&h.notify(...u)}hasListeners(c){return this.eventHandlers.has(c)}mount(c){if(this.instance)return;this.isSVG=rm(c)&&!NI(c),this.instance=c;const{layoutId:u,layout:h,visualElement:f}=this.options;if(f&&!f.current&&f.mount(c),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||u)&&(this.isLayoutDirty=!0),e){let m,y=0;const k=()=>this.root.updateBlockedByResize=!1;dt.read(()=>{y=window.innerWidth}),e(c,()=>{const w=window.innerWidth;w!==y&&(y=w,this.root.updateBlockedByResize=!0,m&&m(),m=RN(k,250),Hc.hasAnimatedSinceResize&&(Hc.hasAnimatedSinceResize=!1,this.nodes.forEach(e_)))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&f&&(u||h)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:y,hasRelativeLayoutChanged:k,layout:w})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const P=this.options.transition||f.getDefaultTransition()||qN,{onLayoutAnimationStart:C,onLayoutAnimationComplete:S}=f.getProps(),D=!this.targetLayout||!nx(this.targetLayout,w),L=!y&&k;if(this.options.layoutRoot||this.resumeFrom||L||y&&(D||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const R={...Zp(P,"layout"),onPlay:C,onComplete:S};(f.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R),this.setAnimationOrigin(m,L)}else y||e_(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=w})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const c=this.getStack();c&&c.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ia(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(HN),this.animationId++)}getTransformTemplate(){const{visualElement:c}=this.options;return c&&c.getProps().transformTemplate}willUpdate(c=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ix(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m<this.path.length;m++){const y=this.path[m];y.shouldResetTransform=!0,(typeof y.latestValues.x=="string"||typeof y.latestValues.y=="string")&&(y.isLayoutDirty=!0),y.updateScroll("snapshot"),y.options.layoutRoot&&y.willUpdate(!1)}const{layoutId:u,layout:h}=this.options;if(u===void 0&&!h)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),c&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const h=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),h&&this.nodes.forEach(BN),this.nodes.forEach(Qk);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Jk);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(FN),this.nodes.forEach(VN),this.nodes.forEach(IN),this.nodes.forEach(NN)):this.nodes.forEach(Jk),this.clearAllSnapshots();const u=on.now();Kt.delta=xr(0,1e3/60,u-Kt.timestamp),Kt.timestamp=u,Kt.isProcessing=!0,Uh.update.process(Kt),Uh.preRender.process(Kt),Uh.render.process(Kt),Kt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,tm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(UN),this.sharedNodes.forEach(WN)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,dt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){dt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ln(this.snapshot.measuredBox.x)&&!ln(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let h=0;h<this.path.length;h++)this.path[h].updateScroll();const c=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Ot()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:u}=this.options;u&&u.notify("LayoutMeasure",this.layout.layoutBox,c?c.layoutBox:void 0)}updateScroll(c="measure"){let u=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===c&&(u=!1),u&&this.instance){const h=a(this.instance);this.scroll={animationId:this.root.animationId,phase:c,isRoot:h,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!s)return;const c=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,u=this.projectionDelta&&!tx(this.projectionDelta),h=this.getTransformTemplate(),f=h?h(this.latestValues,""):void 0,m=f!==this.prevTransformTemplateValue;c&&this.instance&&(u||ei(this.latestValues)||m)&&(s(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(c=!0){const u=this.measurePageBox();let h=this.removeElementScroll(u);return c&&(h=this.removeTransform(h)),YN(h),{animationId:this.root.animationId,measuredBox:u,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:c}=this.options;if(!c)return Ot();const u=c.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(ZN))){const{scroll:f}=this.root;f&&(mr(u.x,f.offset.x),mr(u.y,f.offset.y))}return u}removeElementScroll(c){const u=Ot();if(er(u,c),this.scroll?.wasRoot)return u;for(let h=0;h<this.path.length;h++){const f=this.path[h],{scroll:m,options:y}=f;f!==this.root&&m&&y.layoutScroll&&(m.wasRoot&&er(u,c),mr(u.x,m.offset.x),mr(u.y,m.offset.y))}return u}applyTransform(c,u=!1,h){const f=h||Ot();er(f,c);for(let m=0;m<this.path.length;m++){const y=this.path[m];!u&&y.options.layoutScroll&&y.scroll&&y!==y.root&&(mr(f.x,-y.scroll.offset.x),mr(f.y,-y.scroll.offset.y)),ei(y.latestValues)&&zc(f,y.latestValues,y.layout?.layoutBox)}return ei(this.latestValues)&&zc(f,this.latestValues,this.layout?.layoutBox),f}removeTransform(c){const u=Ot();er(u,c);for(let h=0;h<this.path.length;h++){const f=this.path[h];if(!ei(f.latestValues))continue;let m;f.instance&&(Hf(f.latestValues)&&f.updateSnapshot(),m=Ot(),er(m,f.measurePageBox())),$k(u,f.latestValues,f.snapshot?.layoutBox,m)}return ei(this.latestValues)&&$k(u,this.latestValues),u}setTargetDelta(c){this.targetDelta=c,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(c){this.options={...this.options,...c,crossfade:c.crossfade!==void 0?c.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Kt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(c=!1){const u=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=u.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=u.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=u.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==u;if(!(c||h&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:y}=this.options;if(!this.layout||!(m||y))return;this.resolvedRelativeTargetAt=Kt.timestamp;const k=this.getClosestProjectingParent();k&&this.linkedParentVersion!==k.layoutVersion&&!k.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&k&&k.layout?this.createRelativeTarget(k,this.layout.layoutBox,k.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ot(),this.targetWithTransforms=Ot()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),yN(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):er(this.target,this.layout.layoutBox),$w(this.target,this.targetDelta)):er(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&k&&!!k.resumingFrom==!!this.resumingFrom&&!k.options.layoutScroll&&k.target&&this.animationProgress!==1?this.createRelativeTarget(k,this.target,k.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Hf(this.parent.latestValues)||zw(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(c,u,h){this.relativeParent=c,this.linkedParentVersion=c.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ot(),this.relativeTargetOrigin=Ot(),gu(this.relativeTargetOrigin,u,h,this.options.layoutAnchor||void 0),er(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const c=this.getLead(),u=!!this.resumingFrom||this!==c;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),u&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===Kt.timestamp&&(h=!1),h)return;const{layout:f,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||m))return;er(this.layoutCorrected,this.layout.layoutBox);const y=this.treeScale.x,k=this.treeScale.y;KI(this.layoutCorrected,this.treeScale,this.path,u),c.layout&&!c.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(c.target=c.layout.layoutBox,c.targetWithTransforms=Ot());const{target:w}=c;if(!w){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(jk(this.prevProjectionDelta.x,this.projectionDelta.x),jk(this.prevProjectionDelta.y,this.projectionDelta.y)),Eo(this.projectionDelta,this.layoutCorrected,w,this.latestValues),(this.treeScale.x!==y||this.treeScale.y!==k||!qk(this.projectionDelta.x,this.prevProjectionDelta.x)||!qk(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",w))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(c=!0){if(this.options.visualElement?.scheduleRender(),c){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ss(),this.projectionDelta=ss(),this.projectionDeltaWithTransform=ss()}setAnimationOrigin(c,u=!1){const h=this.snapshot,f=h?h.latestValues:{},m={...this.latestValues},y=ss();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const k=Ot(),w=h?h.source:void 0,P=this.layout?this.layout.source:void 0,C=w!==P,S=this.getStack(),D=!S||S.members.length<=1,L=!!(C&&!D&&this.options.crossfade===!0&&!this.path.some(GN));this.animationProgress=0;let R;this.mixTargetDelta=O=>{const W=O/1e3;t_(y.x,c.x,W),t_(y.y,c.y,W),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gu(k,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),KN(this.relativeTarget,this.relativeTargetOrigin,k,W),R&&bN(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=Ot()),er(R,this.relativeTarget)),C&&(this.animationValues=m,PN(m,f,this.latestValues,W,L,D)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=W},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Ia(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=dt.update(()=>{Hc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=gs(0)),this.motionValue.jump(0,!1),this.currentAnimation=TN(this.motionValue,[0,1e3],{...c,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),c.onUpdate&&c.onUpdate(u)},onStop:()=>{},onComplete:()=>{c.onComplete&&c.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const c=this.getStack();c&&c.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(DN),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:u,target:h,layout:f,latestValues:m}=c;if(!(!u||!h||!f)){if(this!==c&&this.layout&&f&&ox(this.options.animationType,this.layout.layoutBox,f.layoutBox)){h=this.target||Ot();const y=ln(this.layout.layoutBox.x);h.x.min=c.target.x.min,h.x.max=h.x.min+y;const k=ln(this.layout.layoutBox.y);h.y.min=c.target.y.min,h.y.max=h.y.min+k}er(u,h),zc(u,m),Eo(this.projectionDeltaWithTransform,this.layoutCorrected,u,m)}}registerSharedNode(c,u){this.sharedNodes.has(c)||this.sharedNodes.set(c,new LN),this.sharedNodes.get(c).add(u);const f=u.options.initialPromotionConfig;u.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(u):void 0})}isLead(){const c=this.getStack();return c?c.lead===this:!0}getLead(){const{layoutId:c}=this.options;return c?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:c}=this.options;return c?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:c}=this.options;if(c)return this.root.sharedNodes.get(c)}promote({needsReset:c,transition:u,preserveFollowOpacity:h}={}){const f=this.getStack();f&&f.promote(this,h),c&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let u=!1;const{latestValues:h}=c;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(u=!0),!u)return;const f={};h.z&&Gh("z",c,f,this.animationValues);for(let m=0;m<Kh.length;m++)Gh(`rotate${Kh[m]}`,c,f,this.animationValues),Gh(`skew${Kh[m]}`,c,f,this.animationValues);c.render();for(const m in f)c.setStaticValue(m,f[m]),this.animationValues&&(this.animationValues[m]=f[m]);c.scheduleRender()}applyProjectionStyles(c,u){if(!this.instance||this.isSVG)return;if(!this.isVisible){c.visibility="hidden";return}const h=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,c.visibility="",c.opacity="",c.pointerEvents=$c(u?.pointerEvents)||"",c.transform=h?h(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(c.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,c.pointerEvents=$c(u?.pointerEvents)||""),this.hasProjected&&!ei(this.latestValues)&&(c.transform=h?h({},""):"none",this.hasProjected=!1);return}c.visibility="";const m=f.animationValues||f.latestValues;this.applyTransformsToTarget();let y=wN(this.projectionDeltaWithTransform,this.treeScale,m);h&&(y=h(m,y)),c.transform=y;const{x:k,y:w}=this.projectionDelta;c.transformOrigin=`${k.origin*100}% ${w.origin*100}% 0`,f.animationValues?c.opacity=f===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:c.opacity=f===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const P in Kf){if(m[P]===void 0)continue;const{correct:C,applyTo:S,isCSSVariable:D}=Kf[P],L=y==="none"?m[P]:C(m[P],f);if(S){const R=S.length;for(let O=0;O<R;O++)c[S[O]]=L}else D?this.options.visualElement.renderState.vars[P]=L:c[P]=L}this.options.layoutId&&(c.pointerEvents=f===this?$c(u?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>c.currentAnimation?.stop()),this.root.nodes.forEach(Qk),this.root.sharedNodes.clear()}}}function IN(e){e.updateLayout()}function NN(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:a}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;if(s==="size")pr(m=>{const y=o?t.measuredBox[m]:t.layoutBox[m],k=ln(y);y.min=n[m].min,y.max=y.min+k});else if(s==="x"||s==="y"){const m=s==="x"?"y":"x";Gf(o?t.measuredBox[m]:t.layoutBox[m],n[m])}else ox(s,t.layoutBox,n)&&pr(m=>{const y=o?t.measuredBox[m]:t.layoutBox[m],k=ln(n[m]);y.max=y.min+k,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+k)});const c=ss();Eo(c,n,t.layoutBox);const u=ss();o?Eo(u,e.applyTransform(a,!0),t.measuredBox):Eo(u,n,t.layoutBox);const h=!tx(c);let f=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:y,layout:k}=m;if(y&&k){const w=e.options.layoutAnchor||void 0,P=Ot();gu(P,t.layoutBox,y.layoutBox,w);const C=Ot();gu(C,n,k.layoutBox,w),nx(P,C)||(f=!0),m.options.layoutRoot&&(e.relativeTarget=C,e.relativeTargetOrigin=P,e.relativeParent=m)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:u,layoutDelta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:f})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function ON(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function jN(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function UN(e){e.clearSnapshot()}function Qk(e){e.clearMeasurements()}function BN(e){e.isLayoutDirty=!0,e.updateLayout()}function Jk(e){e.isLayoutDirty=!1}function FN(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function VN(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function e_(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function zN(e){e.resolveTargetDelta()}function $N(e){e.calcProjection()}function HN(e){e.resetSkewAndRotation()}function WN(e){e.removeLeadSnapshot()}function t_(e,t,n){e.translate=vt(t.translate,0,n),e.scale=vt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function n_(e,t,n,a){e.min=vt(t.min,n.min,a),e.max=vt(t.max,n.max,a)}function KN(e,t,n,a){n_(e.x,t.x,n.x,a),n_(e.y,t.y,n.y,a)}function GN(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const qN={duration:.45,ease:[.4,0,.1,1]},r_=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),a_=r_("applewebkit/")&&!r_("chrome/")?Math.round:jn;function i_(e){e.min=a_(e.min),e.max=a_(e.max)}function YN(e){i_(e.x),i_(e.y)}function ox(e,t,n){return e==="position"||e==="preserve-aspect"&&!gN(Gk(t),Gk(n),.2)}function ZN(e){return e!==e.root&&e.scroll?.wasRoot}const XN=sx({attachResizeListener:(e,t)=>Fo(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),qh={current:void 0},lx=sx({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!qh.current){const e=new XN({});e.mount(window),e.setOptions({layoutScroll:!0}),qh.current=e}return qh.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),lm=b.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function s_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function QN(...e){return t=>{let n=!1;const a=e.map(s=>{const o=s_(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<a.length;s++){const o=a[s];typeof o=="function"?o():s_(e[s],null)}}}}function JN(...e){return b.useCallback(QN(...e),e)}class eO extends b.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(jc(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const a=n.offsetParent,s=jc(a)&&a.offsetWidth||0,o=jc(a)&&a.offsetHeight||0,c=getComputedStyle(n),u=this.props.sizeRef.current;u.height=parseFloat(c.height),u.width=parseFloat(c.width),u.top=n.offsetTop,u.left=n.offsetLeft,u.right=s-u.width-u.left,u.bottom=o-u.height-u.top}return null}componentDidUpdate(){}render(){return this.props.children}}function tO({children:e,isPresent:t,anchorX:n,anchorY:a,root:s,pop:o}){const c=b.useId(),u=b.useRef(null),h=b.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:f}=b.useContext(lm),m=e.props?.ref??e?.ref,y=JN(u,m);return b.useInsertionEffect(()=>{const{width:k,height:w,top:P,left:C,right:S,bottom:D}=h.current;if(t||o===!1||!u.current||!k||!w)return;const L=n==="left"?`left: ${C}`:`right: ${S}`,R=a==="bottom"?`bottom: ${D}`:`top: ${P}`;u.current.dataset.motionPopId=c;const O=document.createElement("style");f&&(O.nonce=f);const W=s??document.head;return W.appendChild(O),O.sheet&&O.sheet.insertRule(`
827
+ leaderboard.profile_modal.view_full,dashboard,LeaderboardProfileModal,Footer,view_full,"View full profile",,active
828
+ local_only.title,dashboard,LocalOnlyNotice,LocalOnlyNotice,title,"Available in the app",,active
829
+ local_only.body,dashboard,LocalOnlyNotice,LocalOnlyNotice,body,"This page reads data from your own machine, so it only works in the Mac app or the CLI dashboard.",,active
830
+ local_only.open_app,dashboard,LocalOnlyNotice,LocalOnlyNotice,open_app,"Open in Mac app",,active
831
+ local_only.download,dashboard,LocalOnlyNotice,LocalOnlyNotice,download,"Get the Mac app",,active
832
+ `,DL={"header.auth.sign_in_aria":"登录","login.back_home":"返回首页","login.cloud_only":"未配置云端登录。请使用 localhost 上的本地仪表盘。","login.title":"登录","login.subtitle":"选择邮箱或已连接账号。","login.dismiss":"关闭","login.verify_email_success":"邮箱已验证。你现在可以登录。","login.verify_email_pending":"请先在邮箱中完成验证,然后再登录。","login.oauth.continue":"使用 {{provider}} 继续","login.divider":"或","login.tab.sign_in":"登录","login.tab.sign_up":"创建账户","login.field.name":"显示名称","login.field.name_placeholder":"可选","login.field.email":"电子邮件","login.field.password":"密码","login.password_hint":"至少 {{min}} 个字符。","login.submit.sign_in":"使用邮箱登录","login.submit.sign_up":"创建账号","auth.callback.processing":"处理中…","auth.callback.success":"登录成功","auth.callback.redirecting":"正在返回 TokenTracker…","auth.callback.failed":"登录未完成,请重试。","auth.callback.close":"关闭此页","login_modal.subtitle":"登录以加入排行榜","login_modal.continue_email":"使用邮箱继续","login_modal.divider_email":"邮箱","shared.placeholder.short":"--","shared.unit.percent":"%","shared.unit.thousand_abbrev":"K","shared.unit.million_abbrev":"M","shared.unit.billion_abbrev":"B","shared.data_source":"数据来源:{{source}}","shared.error.prefix":"错误:{{error}}","shared.status.unsynced":"—","shared.time.now":"刚刚","error.boundary.title":"出了点问题","error.boundary.subtitle":"这个视图渲染失败了","error.boundary.hint":"打开控制台,然后重新加载页面","error.boundary.no_details":"没有错误详细信息","error.boundary.action.reload":"重新加载","identity_card.rank_label":"排名","identity_card.streak_label":"活跃天数","identity_card.rank_placeholder":"—","identity_card.streak_value":"{{days}} 天","usage.summary.total":"Token 总数","usage.period.day":"日","usage.period.week":"周","usage.period.month":"月","usage.period.total":"总计","usage.period.custom":"自定义","usage.metric.total":"总计","usage.metric.input":"输入","usage.metric.output":"输出","usage.metric.cached_input":"缓存输入","usage.metric.reasoning_output":"推理输出","usage.button.refresh":"刷新","usage.overview.tablist_aria":"时间范围","usage.overview.cost_breakdown_aria":"查看成本明细","usage.overview.distribution_aria":"来源占比:{{items}}","usage.overview.distribution_item":"{{label}} {{percent}}%","usage.overview.provider_card_aria":"{{provider}}:{{percent}}%,{{tokens}} Token,{{cost}}。点击{{action}}详情","usage.overview.expand":"展开","usage.overview.collapse":"收起","usage.overview.model_count":"{{count}} 个模型","usage.overview.model_details_aria":"{{provider}} 模型详情","widgets.page.title":"组件","widgets.cta.open_gallery":"打开小组件库","widgets.cta.download":"下载 Mac 应用","widgets.cta.macos_only":"仅限 macOS","widgets.menubar.section.title":"菜单栏","widgets.gallery.section.title":"桌面小组件","widgets.summary.name":"使用概览","widgets.summary.description":"今天和近 7 天的用量,以及紧凑趋势线。","widgets.heatmap.name":"热力图","widgets.heatmap.description":"像 GitHub 一样,一眼看清活跃和空闲的日子。","widgets.topModels.name":"热门模型","widgets.topModels.description":"你最常用的模型,按 Token 占比排序。","widgets.limits.name":"使用限制","widgets.limits.description":"Claude、Codex、Cursor、Gemini 等的实时速率限制进度。","daily.sort.date.label":"日期","daily.sort.date.title":"按日期排序","daily.sort.total.label":"总计","daily.sort.total.title":"按总计排序","daily.sort.input.label":"输入","daily.sort.input.title":"按输入排序","daily.sort.output.label":"输出","daily.sort.output.title":"按输出排序","daily.sort.cached.label":"缓存","daily.sort.cached.title":"按缓存输入排序","daily.sort.reasoning.label":"推理","daily.sort.reasoning.title":"按推理输出排序","daily.sort.conversations.label":"对话数","daily.sort.conversations.title":"按对话排序","details.pagination.prev":"上一页","details.pagination.next":"下一页","limits.copilot.otelHint.title":"跟踪 Copilot Token 使用情况","limits.copilot.otelHint.body":"限额信息通过你的 GitHub OAuth 令牌读取。如果还想记录逐 Token 用量,请启用 Copilot 的 OpenTelemetry 导出,把下面这段加到你的 shell 配置文件(~/.zshrc 或 ~/.bashrc):","limits.copilot.otelHint.copy":"复制","limits.copilot.otelHint.copied":"已复制","limits.panel.title":"使用限制","limits.label.cursor_plan":"套餐","limits.label.cursor_auto":"自动","limits.label.cursor_api":"API","limits.label.kiro_month":"月度","limits.label.kiro_bonus":"奖励","limits.label.kimi_weekly":"周","limits.label.kimi_5h":"5h","limits.label.kimi_total":"总量","limits.label.kimi_parallel":"并发:{{count}}","limits.label.copilot_premium":"高级","limits.label.copilot_chat":"对话","limits.status.not_connected":"未连接","limits.status.no_data":"未返回实时限额数据","limits.status.all_hidden":"所有限额提供商都已隐藏。请打开显示设置重新显示。","nav.usage":"用量","nav.limits":"限额","nav.widgets":"小组件","nav.skills":"Skills","nav.leaderboard":"排行榜","nav.collapse":"折叠侧边栏","nav.expand":"展开侧边栏","nav.menu":"打开导航菜单","nav.close_menu":"关闭导航菜单","nav.aside_label":"主导航","nav.nav_label":"导航","limits.page.subtitle":"AI 工具的速率限制和配额使用情况。","limits.settings.toggle_visible":"切换可见性","limits.page.openSettings":"显示设置","nav.group.general":"常规","nav.group.tools":"工具","nav.group.account":"账户","nav.settings":"设置","header.auth.open_settings":"打开设置","settings.page.title":"设置","settings.page.subtitle":"管理你的账户、外观和显示偏好。","settings.section.appearance":"外观","settings.section.account":"账户","settings.section.limits":"限制显示","settings.appearance.theme.label":"主题","settings.appearance.theme.hint":"选择 Token Tracker 在仪表盘中的显示方式。","settings.appearance.theme.light":"浅色","settings.appearance.theme.dark":"深色","settings.appearance.theme.system":"系统","settings.account.displayName":"显示名称","settings.account.edit":"编辑","settings.account.save":"保存","settings.account.saving":"保存...","settings.account.cancel":"取消","settings.account.userId":"用户 ID","settings.account.copyUserId":"复制用户 ID","settings.account.copy":"复制","settings.account.copied":"已复制","settings.account.cloudSync":"云同步","settings.account.cloudSyncHint":"将本地用量上传到你的 Token Tracker 云端账号。","settings.account.publicProfile":"公开主页","settings.account.publicProfileHint":"在公开排行榜中展示你的用量。","settings.account.displayNameAnonymousHint":"匿名状态下,排行榜会隐藏你的名字和头像","settings.account.displayNameDisabledWhileAnon":"请先关闭匿名,再编辑名字","settings.account.githubUrl":"GitHub 主页","settings.account.githubUrlHint":"在排行榜名字旁显示 GitHub 链接。","settings.account.githubUrlPlaceholder":"用户名或 https://github.com/用户名","settings.account.githubUrlInvalid":"请输入 GitHub 用户名,或 https://github.com/用户名","leaderboard.github.aria":"打开 GitHub 主页","leaderboard.github.tooltipAction":"点击查看 GitHub 主页","leaderboard.github.tooltipPrefix":"可在","leaderboard.github.tooltipSettingsLink":"设置","leaderboard.github.tooltipSuffix":"中配置你的主页","settings.account.signOut":"退出登录","settings.account.signIn":"登录","settings.account.signedOutHint":"登录后可管理云同步和排行榜偏好。","settings.section.menubar":"菜单栏应用","settings.menubar.showStats":"在菜单栏中显示统计信息","settings.menubar.showStatsHint":"在菜单栏图标旁边显示今天的Token 数量和成本。","settings.menubar.animatedIcon":"动画图标","settings.menubar.animatedIconHint":"闪烁 Clawd 角色并在菜单栏中播放同步动画。","settings.menubar.launchAtLogin":"登录时启动","settings.menubar.launchAtLoginHint":"登录 macOS 时自动启动 TokenTrackerBar。","settings.menubar.syncNow":"立即同步","settings.menubar.syncNowHint":"触发本地AI工具日志立即解析并上传。","settings.menubar.syncing":"正在同步...","settings.menubar.updates":"更新","settings.menubar.checkUpdates":"检查更新","menubar.slot.primary":"第一个位置","menubar.slot.secondary":"第二个位置","menubar.native_only":"打开 macOS 版 TokenTrackerBar 后可编辑菜单栏显示。","menubar.metric.today_tokens":"今日 Token","menubar.metric.today_cost":"今日成本","menubar.metric.last_7d_tokens":"近 7 天 Token","menubar.metric.total_tokens":"总 Token","menubar.metric.total_cost":"总成本","menubar.metric.claude_5h":"Claude 5 小时限额","menubar.metric.claude_7d":"Claude 7 天限额","menubar.metric.codex_5h":"Codex 5 小时限额","menubar.metric.codex_7d":"Codex 7 天限额","nav.ip_check":"Claude IP 检查","skills.page.title":"Skills","skills.tab.my":"我的","skills.tab.browse":"发现","skills.action.refresh":"刷新","skills.action.install":"安装","skills.action.choose_targets":"选择目标","skills.target.menu_label":"安装到","skills.target.none":"未选目标","skills.toast.installed":"已把 {{name}} 安装到 {{targets}}。","skills.action.remove":"移除","skills.action.search":"搜索","skills.action.search_aria":"搜索 skills","skills.target.synced_summary":"已同步到 {{targets}}","skills.target.synced_none":"尚未同步到任何 agent","skills.row.open_details":"查看 {{name}} 详情","skills.detail.close":"关闭详情","skills.detail.sync_section_title":"同步到","skills.detail.remove_button":"从所有 agent 移除","skills.detail.remove_confirm_hint":"这会从每个 agent 取消同步并删除本地副本。","skills.filter.agent_label":"Agent","skills.filter.agent_all":"全部 agent","skills.filter.clear":"清除筛选","skills.filter.result_count":"{{filtered}} / {{total}} 个 skill","skills.filter.result_count_browse":"{{count}} 个结果","skills.empty.no_match":"当前筛选下没有匹配的 skill。","hint.dismiss":"关闭提示","hint.dismissible_aria":"可关闭的提示","skills.card.installed":"已安装","skills.card.targets_prefix":"将安装到:","skills.card.targets_change":"更改","skills.card.installs":"{{count}} 次安装","skills.source.label":"来源","skills.source.all":"全部仓库","skills.mode.repo":"仓库","skills.mode.skillssh":"skills.sh","skills.browse.placeholder_all":"在已启用的仓库里搜索…","skills.browse.placeholder_repo":"在 {{repo}} 中搜索…","skills.browse.placeholder_skillssh":"在 skills.sh 仓库中搜索…","skills.browse.empty_sources":"添加一个 GitHub 仓库以开始浏览技能。","skills.browse.add_repo_hint":"想要更多 skill?添加一个 GitHub 仓库。","skills.browse.manage_sources":"管理来源","skills.browse.hint_skillssh":"至少输入 2 个字符以搜索 skills.sh。","skills.browse.loading_hint":"正在从 GitHub 拉取 skill 信息,首次加载可能需要一分钟,结果会缓存。","skills.error.generic":"Skill 操作失败。","skills.confirm.remove_title":"要移除 {{name}} 吗?","skills.confirm.remove_managed":"这个 skill 将从所有已连接的 AI 工具中移除,几秒内可以撤销。","skills.confirm.remove_local":"将从所有 AI 工具目录中删除该 skill 文件夹。此操作无法撤销。","skills.toast.removed":"已移除 {{name}}。","shared.action.undo":"撤销","shared.action.cancel":"取消","skills.empty.my":"还没有 skill。去「发现」搜索或安装。","skills.empty.my_cta":"去发现","skills.empty.browse":"这个来源下没有找到技能。","skills.empty.search":"没有结果,换个关键词试试。","skills.repo.placeholder":"owner/repository","skills.repo.add":"添加仓库","skills.repo.invalid":"请输入 owner/repository 或 GitHub 仓库 URL。","skills.repo.remove":"移除仓库","settings.appearance.language.label":"语言","settings.appearance.language.hint":"使用“系统”时会默认跟随本机语言。","settings.appearance.language.system":"系统","settings.appearance.language.english":"英语","settings.appearance.language.chinese":"简体中文","settings.appearance.currency.label":"货币","settings.appearance.currency.hint":"选择用量成本的显示币种。","settings.appearance.currency.opt.usd":"美元 ($)","settings.appearance.currency.opt.eur":"欧元 (€)","settings.appearance.currency.opt.gbp":"英镑 (£)","settings.appearance.currency.opt.cny":"人民币 (¥)","settings.appearance.currency.opt.jpy":"日元 (¥)","settings.appearance.currency.opt.hkd":"港币 (HK$)","settings.appearance.currency.rate_source.default":"内置默认汇率","settings.appearance.currency.rate_source.fetched":"数据源:open.er-api.com","settings.appearance.currency.rate_updated":"更新于 {{when}}","settings.appearance.currency.rate_never":"尚未刷新"},ML={"usage.overview.antigravity_notice_title":"Token 为估算值","usage.overview.antigravity_notice_body":"Antigravity 的本地日志没有真实用量字段,这里的数字是按字符长度(约 4 字符/Token)估算出来的,也没有扣除 Gemini 的 prompt cache 折扣。请把它当作上限估算,不要直接对账账单。","stats.period.today":"今日","stats.period.week":"本周","stats.period.month":"本月","stats.period.all":"全部","stats.period.convs":"对话","dashboard.core_index.collapse_label":"▾","dashboard.core_index.expand_label":"▸","dashboard.core_index.collapse_aria":"折叠模型分解","dashboard.core_index.expand_aria":"展开模型细分","dashboard.rolling.title":"最近的活动","dashboard.rolling.last_7d":"过去 7 天","dashboard.rolling.last_30d":"过去 30 天","dashboard.rolling.avg_active_day":"日平均","dashboard.projects.title":"项目用量","dashboard.projects.tokens_label":"Token","dashboard.projects.stars_label":"星标","dashboard.projects.limit_label":"展示","dashboard.projects.limit_aria":"选择仓库显示数量","dashboard.projects.limit_top_3":"前 3 名","dashboard.projects.limit_top_6":"前 6 名","dashboard.projects.limit_top_10":"前 10 名","dashboard.projects.empty":"没有公开仓库","dashboard.widgets.title":"桌面小组件","dashboard.widgets.hint":"右键点按桌面 → 编辑小组件 → 搜索“TokenTracker”","dashboard.widgets.dismiss_aria":"关闭小组件介绍","dashboard.cost_breakdown.title":"成本明细","dashboard.cost_breakdown.total_label":"预计总成本","dashboard.cost_breakdown.close":"关闭","trend.monitor.label":"使用趋势","heatmap.title":"热力图","heatmap.empty":"尚无活动数据。","heatmap.legend.less":"少","heatmap.legend.more":"多","heatmap.legend.utc":"UTC","heatmap.tooltip":"{{day}} • {{value}} {{unit}} • {{tz}}","heatmap.unit.tokens":"Token","heatmap.month.jan":"1月","heatmap.month.feb":"2月","heatmap.month.mar":"3月","heatmap.month.apr":"4月","heatmap.month.may":"5月","heatmap.month.jun":"6月","heatmap.month.jul":"7月","heatmap.month.aug":"8月","heatmap.month.sep":"9月","heatmap.month.oct":"10月","heatmap.month.nov":"11月","heatmap.month.dec":"12月","heatmap.day.sun":"日","heatmap.day.mon":"一","heatmap.day.tue":"二","heatmap.day.wed":"三","heatmap.day.thu":"四","heatmap.day.fri":"五","heatmap.day.sat":"六","dashboard.session_expired.copy_label":"运行 npx --yes tokentracker-cli init","dashboard.session_expired.copied":"已复制","dashboard.install.prompt":"安装 Node.js 18+ 然后运行:","dashboard.install.cmd.init":"npx --yes tokentracker-cli init","dashboard.install.cmd.init_link_code":"npx --yes tokentracker-cli init --link-code {{link_code}}","dashboard.install.copy":"复制安装命令","dashboard.install.copy_base":"复制初始化命令","dashboard.install.copied":"已复制到剪贴板","dashboard.install.link_code.loading":"正在生成专属代码...","dashboard.install.link_code.failed":"专属代码不可用","dashboard.install.cmd.sync":"npx --yes tokentracker-cli sync","dashboard.daily.title":"每日细目","dashboard.daily.empty":"还没有数据。先使用 AI CLI,再运行 {{cmd}}。","dashboard.identity.title":"你的个人资料","dashboard.identity.subtitle":"记录你的编码之旅","dashboard.identity.fallback":"匿名用户","dashboard.screenshot.title_line1":"AI 编程助手","dashboard.screenshot.title_line2":"2025 年度回顾","dashboard.screenshot.twitter_button":"分享到 X","dashboard.screenshot.twitter_label":"分享到 X","dashboard.screenshot.twitter_hint":"自动将图像复制到剪贴板","dashboard.screenshot.twitter_text":"记录中的 {{total_tokens}} Token。\\n{{model_name}} 以 {{model_percent}}% 领先。\\n\\n我的 AI 使用情况,未经审计 →\\ntokentracker.cc","heatmap.3d.hover_tip":"点击进入 3D 全屏旋转分析模式","heatmap.3d.modal.title":"Token 三维透视","heatmap.3d.modal.desc":"按住左键拖拽可任意旋转,悬浮感知每日活跃数据与多维统计。","heatmap.3d.modal.stats.total_tokens":"年度 Token 总量","heatmap.3d.modal.stats.precision_total_tokens":"精准年消耗量","heatmap.3d.modal.stats.estimated_cost":"年度估算费用","heatmap.3d.modal.stats.active_rate_days":"活跃占比 / 天数","heatmap.3d.modal.stats.max_streak":"最长连续活跃","heatmap.3d.modal.stats.days_suffix":"天","heatmap.3d.modal.stats.peak_day":"单日峰值暴击","heatmap.3d.modal.stats.precision_peak_value":"精确单日峰值","heatmap.3d.modal.stats.no_data":"无数据","heatmap.3d.modal.legend.title":"活跃度层级","heatmap.3d.modal.palette.emerald":"翡翠之城","heatmap.3d.modal.palette.ocean":"深海浩瀚","heatmap.3d.modal.palette.neon":"赛博霓虹","heatmap.3d.modal.palette.amber":"烈焰余晖","heatmap.3d.modal.control.play":"启动慢速自转","heatmap.3d.modal.control.pause":"暂停自动旋转","heatmap.3d.modal.control.reset":"重置 3D 视角","heatmap.3d.modal.footer.tip":"双指缩放 / 滚轮缩放 / 鼠标拖拽旋转 3D 图表","heatmap.3d.modal.ai.title.default":"持之以恒的行者","heatmap.3d.modal.ai.eval.default":"在技术的长河中持之以恒。也许日常的编码并不总是波澜壮阔,但每一个微小的活跃点都在记录着您的思考与探索。星火成留,终将汇聚成属于您的数字海洋。","heatmap.3d.modal.ai.title.peak":"极限活跃级贡献者","heatmap.3d.modal.ai.eval.peak":"这一年中,您的 Token 产出表现出极高的工程密度。如此规模 of 开发量相当于深度参与了中大型系统底座的重构,每一次击键都在将复杂的逻辑收敛为确定性的代码。这是极度专注与纯粹工程热爱的最好印证。","heatmap.3d.modal.ai.title.heavy":"高频产出级开发者","heatmap.3d.modal.ai.eval.heavy":"卓越的持续输出。您的 Token 累积量已达数百万字,相当于数十部中篇技术巨著的体量。高饱和度的编码节奏表明您正在以极高的执行力构建属于您的数字资产,展现了卓越的创造力。","heatmap.3d.modal.ai.title.core":"核心生产力专家","heatmap.3d.modal.ai.eval.core":"极具韧性的长期投入。在过去的一年中,您在较长周期内稳定保持着高强度的开发节奏。您用扎实的代码行数与 Token 产出,默默筑起了项目的核心架构,是当之无愧的工程支柱。","heatmap.3d.modal.ai.title.steady":"稳健成长型工程师","heatmap.3d.modal.ai.eval.steady":"踏实而坚定的技术积累。每一次 Token 的递增,都是您在坚实地砌下通往未来的代码基石。这种细水长流的稳健节奏,往往是一个优秀开发者通往工程大师的必经之路。","heatmap.3d.voxel.joke.1":"🔥 极度疯狂!产出 {{value}} tokens!你是在疯狂训练大模型,还是手撸了一个编译器?","heatmap.3d.voxel.joke.2":"🚀 史诗级输出!共 {{value}} tokens。今日产出可绕地球一圈,AI 都在为你惊叹!","heatmap.3d.voxel.joke.3":"⚡ 爆击日!{{value}} tokens。代码如泉涌,键盘已经开始冒烟了!","heatmap.3d.voxel.level3":"⚡ 生产力大爆发({{value}} tokens)!高效专注的黄金时刻,继续保持这个巅峰状态!","heatmap.3d.voxel.level2":"🌱 渐入佳境({{value}} tokens)!稳步产出,每一次敲击键盘都是在为大厦添砖加瓦。","heatmap.3d.voxel.level1":"🍃 聚沙成塔({{value}} tokens)。微小的提交也是对未来的投资,保持复利的力量!","heatmap.3d.voxel.level0":"💤 养精蓄锐。在不写代码的日子里,灵感也在悄悄生长。","ipcheck.page.title":"Claude IP 检测","ipcheck.page.subtitle":"查看当前访问 Claude 的出口 IP、纯净度、地理与风险信号,识别可能影响登录或触发风控的因素。","ipcheck.mask.toggle":"隐藏 IP","ipcheck.ipv6.warn":"当前为 IPv6 环境,不建议用 IPv6 访问 Claude Code,部分检测结果可能不完整。","ipcheck.ip.cn":"中国出口 IPv4","ipcheck.ip.cloudflare":"Cloudflare 出口","ipcheck.ip.claude":"Claude 出口","ipcheck.ip.failed":"获取失败","ipcheck.ip.loading":"加载中...","ipcheck.trust.title":"信任评分","ipcheck.trust.subtitle":"Claude 风控视角下的 IP 纯净度","ipcheck.trust.no_data":"无数据","ipcheck.trust.no_ip":"未获取到 Claude 出口 IP,无法评分","ipcheck.trust.no_score":"该 IP 暂无评分数据","ipcheck.trust.gauge.low":"0 高危","ipcheck.trust.gauge.high":"100 可信","ipcheck.trust.label.pristine":"极度纯净","ipcheck.trust.label.clean":"纯净","ipcheck.trust.label.good":"良好","ipcheck.trust.label.neutral":"中性","ipcheck.trust.label.suspicious":"可疑","ipcheck.trust.label.unreachable":"不可访问","ipcheck.trust.text.excellent":"该 IP 信誉极好","ipcheck.trust.text.great":"该 IP 信誉优异","ipcheck.trust.text.minor":"该 IP 存在轻微风险","ipcheck.trust.text.moderate":"该 IP 存在一定风险","ipcheck.trust.text.severe":"该 IP 风险极高","ipcheck.trust.text.restricted":"处于不可访问区域,Claude 会严格风控","ipcheck.trust.region_warn.title":"Claude 出口 IP 位于 {{region}}","ipcheck.trust.region_warn.body":"不建议登录 Claude,容易触发封号风控。","ipcheck.trust.region_support":"Claude 支持地区","ipcheck.trust.region.accessible":"可访问","ipcheck.common.unknown":"未知","ipcheck.props.title":"IP 属性","ipcheck.props.region":"地区","ipcheck.props.city":"城市","ipcheck.props.type":"类型","ipcheck.props.asn":"ASN","ipcheck.props.org":"运营商","ipcheck.props.residential":"家庭住宅","ipcheck.props.datacenter":"机房","ipcheck.security.title":"安全检测","ipcheck.security.vpn":"VPN","ipcheck.security.proxy":"代理 (Proxy)","ipcheck.security.tor":"Tor","ipcheck.security.crawler":"机器人 (Crawler)","ipcheck.security.abuser":"滥用记录","ipcheck.security.proxy_flag":"代理","ipcheck.security.crawler_yes":"是","ipcheck.security.crawler_no":"否","ipcheck.security.abuser_yes":"有记录","ipcheck.security.abuser_no":"无记录","ipcheck.security.clean":"未检测到","ipcheck.avail.title":"Claude 可用性","ipcheck.avail.tooltip":"Claude 服务器在美国,从亚洲访问延迟超过 100ms 属于正常情况。","ipcheck.avail.refresh":"刷新","ipcheck.avail.svc_row":"服务状态","ipcheck.avail.latency.normal":"正常","ipcheck.avail.latency.good":"良好","ipcheck.avail.latency.slow":"较慢","ipcheck.avail.latency.unreachable":"不可访问","ipcheck.avail.svc.none":"全部正常","ipcheck.avail.svc.minor":"轻微故障","ipcheck.avail.svc.major":"重大故障","ipcheck.avail.svc.critical":"严重故障","ipcheck.avail.svc.maintenance":"维护中","ipcheck.avail.svc.other":"服务异常","ipcheck.dns.title":"DNS 泄露检测","ipcheck.dns.status":"状态","ipcheck.dns.outlet":"DNS 出口","ipcheck.dns.outlet_ip":"DNS 出口 IP","ipcheck.dns.isp":"服务商","ipcheck.dns.leaked":"可能泄露","ipcheck.dns.no_leak":"未检测到泄露","ipcheck.dns.encrypted":"DNS 加密或未暴露","ipcheck.dns.cn_tag":"中国 DNS","ipcheck.udp.title":"WebRTC UDP 泄露","ipcheck.udp.status":"状态","ipcheck.udp.outlet":"UDP 出口","ipcheck.udp.outlet_ip":"UDP 出口 IP","ipcheck.udp.origin":"归属地","ipcheck.udp.disabled":"WebRTC 已禁用","ipcheck.udp.no_leak":"未检测到泄露","ipcheck.udp.leaked":"可能泄露","ipcheck.udp.anomaly":"异常","ipcheck.device.title":"设备信息","ipcheck.device.tz":"时区","ipcheck.device.lang":"语言","ipcheck.device.os":"操作系统 / 浏览器","ipcheck.device.touch":"触屏","ipcheck.device.net":"网络类型","ipcheck.device.dnt":"Do Not Track","ipcheck.device.webgl_render":"WebGL 渲染器","ipcheck.device.canvas_fp":"Canvas 指纹","ipcheck.device.webgl_fp":"WebGL 指纹","ipcheck.device.match":"一致","ipcheck.device.mismatch":"不一致","ipcheck.device.local":"本地","ipcheck.device.estimate_suffix":"(估算)","ipcheck.device.diff_equal":"偏移略有差异","ipcheck.device.diff_ahead":"Claude 快 {{h}} 小时","ipcheck.device.diff_behind":"Claude 慢 {{h}} 小时","ipcheck.device.lang_expected":"Claude 出口常用","ipcheck.device.touch_yes":"是","ipcheck.device.touch_no":"否","ipcheck.device.dnt_on":"已开启","ipcheck.device.dnt_off":"已关闭","ipcheck.device.dnt_unset":"未设置","ipcheck.device.net_unsupported":"不支持检测","ipcheck.device.unsupported":"不支持","ipcheck.history.title":"Claude 出口 IP 历史","ipcheck.history.subtitle":"仅本地存储于浏览器,最多保留 6 条","ipcheck.history.clear":"清除","ipcheck.history.empty":"暂无历史记录","ipcheck.history.current":"当前","ipcheck.region.CN":"中国大陆","ipcheck.region.HK":"香港","ipcheck.region.MO":"澳门","ipcheck.region.RU":"俄罗斯","ipcheck.region.KP":"朝鲜","ipcheck.region.IR":"伊朗","ipcheck.region.SY":"叙利亚","ipcheck.region.CU":"古巴","ipcheck.region.BY":"白俄罗斯","ipcheck.region.VE":"委内瑞拉","leaderboard.profile_modal.close":"关闭","leaderboard.profile_modal.loading":"正在加载用户资料…","leaderboard.profile_modal.error":"加载用户资料失败。","leaderboard.profile_modal.empty":"这个用户的资料未公开。","leaderboard.profile_modal.row_aria":"查看 {{name}} 的资料","leaderboard.profile_modal.rank":"#{{rank}}","leaderboard.profile_modal.hero.total_tokens":"总 Token","leaderboard.profile_modal.hero.total_cost":"总花费","leaderboard.profile_modal.hero.github":"GitHub 主页","leaderboard.profile_modal.stat.total_cost":"总花费","leaderboard.profile_modal.stat.total_tokens":"总 Token","leaderboard.profile_modal.stat.active_days":"活跃天数","leaderboard.profile_modal.stat.avg_per_day":"日均花费","leaderboard.profile_modal.streak.current":"当前连续","leaderboard.profile_modal.streak.longest":"最长连续","leaderboard.profile_modal.streak.days":"{{count}} 天","leaderboard.profile_modal.best_day.title":"最佳日","leaderboard.profile_modal.best_day.none":"—","leaderboard.profile_modal.models.count":"使用了 {{count}} 个模型","leaderboard.profile_modal.models.favorite":"最爱模型","leaderboard.profile_modal.models.none":"暂无模型记录","leaderboard.profile_modal.heatmap.title":"活跃度(最近 365 天)","leaderboard.profile_modal.providers.title":"按 Provider 分布","leaderboard.profile_modal.providers.none":"本周期无使用数据。","leaderboard.profile_modal.view_full":"查看完整主页","local_only.title":"请在客户端内使用","local_only.body":"这个页面读取的是你本机上的数据,所以只能在 Mac app 或命令行 dashboard 里查看。","local_only.open_app":"在 Mac app 内打开","local_only.download":"下载 Mac app"},IL={"landing.handle.default":"VIBE_USER","landing.handle.special":"伏特","landing.screenshot.alt":"TokenTracker 仪表板截图","landing.nav.login":"登录","landing.nav.signup":"注册","landing.install.command":"npx --yes tokentracker-cli","landing.install.action.copy":"复制命令","landing.install.action.copied":"已复制","landing.meta.title":"Token Tracker —— AI Coding CLI 的 Token 用量追踪器","landing.meta.description":"自动监控 Claude Code、Cursor、Codex 等工具的 Token 用量。本地优先、注重隐私、零配置。","landing.meta.og_site_name":"Token Tracker","landing.meta.og_type":"website","landing.meta.og_image":"https://www.tokentracker.cc/og-image.jpg","landing.meta.og_url":"https://www.tokentracker.cc/","landing.meta.twitter_card":"summary_large_image","share.meta.title":"Token Tracker 分享","share.meta.description":"分享你的 Token Tracker 仪表板快照,包含跨模型、项目和时间窗口的用量洞察。","share.meta.og_site_name":"Token Tracker","share.meta.og_type":"website","share.meta.og_image":"https://www.tokentracker.cc/share-dashboard.jpg","share.meta.og_url":"https://www.tokentracker.cc/share","share.meta.twitter_card":"summary_large_image","landing.handle.placeholder":"试试 “{{handle}}”","landing.rank.expectation":"预期排名:{{rank}}","landing.rank.singularity":"登顶","landing.rank.unranked":"未上榜","landing.cta.primary":"进入仪表板","landing.cta.secondary":"查看 GitHub 源码","landing.v2.hero.title_line1":"追踪你所有的","landing.v2.hero.title_line2":"AI Token","landing.v2.install.mac_cta":"Mac 应用 (DMG)","landing.v2.models.title":"支持的 AI CLI 工具","landing.v2.compare.kicker":"无缝追踪","landing.v2.compare.title":"别再瞎猜你的 AI 用量。","landing.v2.compare.subtitle":"AI CLI 把用量数据藏在零散的本地文件里。TokenTracker 把它们实时聚合到一个清晰的仪表板里。","landing.v2.distill.body":"100% 本地处理,不上传任何 prompt 或代码。","landing.v2.compare.with.title":"用 Token Tracker","landing.v2.compare.with.p1":"集中式用量仪表板","landing.v2.compare.with.p2":"实时 Token 指标","landing.v2.compare.with.p3":"100% 本地,隐私无忧","landing.v2.compare.without.title":"不用","landing.v2.compare.without.p1":"散落的 JSON 日志文件","landing.v2.compare.without.p2":"对 Token 消耗一无所知","landing.v2.compare.without.p3":"突如其来的 API 账单","landing.v2.footer.line":"Token Tracker —— 开发者打造,服务开发者。","landing.v2.nav.github":"GitHub","landing.v2.models.agent.codex":"Codex","landing.v2.models.agent.claude_code":"Claude Code","landing.v2.models.agent.cursor":"Cursor","landing.v2.models.agent.gemini":"Gemini","landing.v2.models.agent.opencode":"OpenCode","landing.v2.models.agent.openclaw":"OpenClaw","landing.v2.cta.primary":"进入仪表板","landing.v2.hero.subtagline":"自动监控 Claude Code、Cursor、Codex 等工具的 Token 用量。本地优先、注重隐私、零配置。","leaderboard.profile.nav.back":"$ 排行榜","leaderboard.title":"排行榜","leaderboard.range":"UTC {{period}} · {{from}} – {{to}}","leaderboard.range_loading":"UTC {{period}} · …","leaderboard.range.total":"全部时间","leaderboard.generated_at":"更新于 {{ts}}","leaderboard.period.week":"周","leaderboard.period.month":"月","leaderboard.period.total":"全部","leaderboard.me_label":"你","leaderboard.anon_label":"匿名","leaderboard.error.unknown":"未知错误","leaderboard.loading":"加载中…","leaderboard.empty":"暂无数据","leaderboard.column.rank":"排名","leaderboard.column.user":"用户","leaderboard.column.total":"总计","leaderboard.column.codex":"Codex","leaderboard.column.claude":"Claude","leaderboard.column.gemini":"Gemini","leaderboard.column.cursor":"Cursor","leaderboard.column.opencode":"OpenCode","leaderboard.column.openclaw":"OpenClaw","leaderboard.column.hermes":"Hermes","leaderboard.column.kiro":"Kiro","leaderboard.column.copilot":"Copilot","leaderboard.column.kimi":"Kimi","leaderboard.column.supplemental":"其他","leaderboard.column.est_cost":"预估花费","leaderboard.signin_prompt":"登录后即可上榜","leaderboard.signin_button":"登录","leaderboard.sync_prompt":"开启云同步即可参与排名","leaderboard.sync_button.idle":"开启并同步","leaderboard.sync_button.busy":"同步中…","leaderboard.pagination.page_size_label":"每页显示","leaderboard.pagination.prev":"上一页","leaderboard.pagination.next":"下一页","leaderboard.pagination.ellipsis":"……","leaderboard.pagination.page_unknown":"第 {{page}} 页","share.modal.title":"分享你的数据","share.modal.subtitle":"生成海报卡片,随处分享。","share.modal.close":"关闭","share.modal.action.x":"分享到 X","share.modal.action.download":"下载","share.modal.action.copy":"复制图片","share.modal.hint.x":"把图片粘贴到推文里","share.modal.hint.copy":"到剪贴板","share.modal.name_label":"显示名称","share.modal.name_placeholder":"输入你的名字","share.modal.style_label":"样式","share.modal.footer":"数据始终保留在本地——图片在你的浏览器内生成,绝不上传。","share.button.label":"分享","share.button.aria":"打开分享卡片","share.toast.copied":"图片已复制到剪贴板","share.toast.downloaded":"图片已保存","share.toast.failed":"图片生成失败","share.toast.working":"生成中…","share.variant.neon":"霓虹","share.variant.broadsheet":"特刊","share.date.month_year":"{{year}} 年 {{month}}","share.issue.all_time":"总计","share.month_short.jan":"1 月","share.month_short.feb":"2 月","share.month_short.mar":"3 月","share.month_short.apr":"4 月","share.month_short.may":"5 月","share.month_short.jun":"6 月","share.month_short.jul":"7 月","share.month_short.aug":"8 月","share.month_short.sep":"9 月","share.month_short.oct":"10 月","share.month_short.nov":"11 月","share.month_short.dec":"12 月","share.hook.top_loyal":"{{name}} 占了 {{percent}}% 的用量。","share.hook.days_record":"共记录 {{days}} 天。","share.hook.top_led":"{{name}} 领跑,占比 {{percent}}%。","share.hook.multi_models":"{{days}} 天里用了 {{count}} 个模型。","share.hook.days_with_model":"{{name}} 陪你跑了 {{days}} 天。","share.hook.new_chapter":"新的记录,从这里开始。","share.card.broadsheet.issue":"期号","share.card.broadsheet.by":"分享者","share.card.broadsheet.tracked_since":"追踪起始","share.card.broadsheet.total_tokens":"总 Token 数","share.card.broadsheet.estimated_spend":"预估花费","share.card.broadsheet.billable_days":"{{days}} 个活跃日","share.card.broadsheet.heatmap_title":"年度热图","share.card.broadsheet.heatmap_days_on_record":"{{active}} / {{total}} 天有记录","share.card.broadsheet.roster_title":"模型榜","share.card.broadsheet.roster_subtitle":"常用模型轮换","share.card.broadsheet.empty":"这一周很安静,还没有模型数据。","share.card.broadsheet.global_rank":"全站排名","share.card.broadsheet.active_days":"活跃","share.card.broadsheet.days_count":"{{days}} 天","share.card.broadsheet.track_yours":"追踪你自己的","share.card.annual.report_title":"用量报告","share.card.annual.less":"少","share.card.annual.more":"多","share.card.annual.heatmap_title":"Token 热图","share.card.annual.total_tokens":"总 Token 数","share.card.annual.estimated_cost":"预估成本","share.card.annual.longest_streak":"最长连击","share.card.annual.days_count":"{{days}} 天","share.card.annual.top_model":"热门模型"},w0="tokentracker-locale",mo="system",iu="en",Dp="zh-CN";function x0(e){return typeof e!="string"?iu:/^zh(?:[-_]|$)/i.test(e.trim())?Dp:iu}function Ru(e){return e===mo?mo:x0(e)}function NL(){return typeof navigator>"u"?[]:Array.isArray(navigator.languages)&&navigator.languages.length?navigator.languages.filter(e=>typeof e=="string"):typeof navigator.language=="string"?[navigator.language]:[]}function ou(e,t=NL()){const n=Ru(e);if(n!==mo)return n;const a=t.map(o=>typeof o=="string"?o.trim():"").find(o=>o.length>0);return a&&/^zh(?:[-_]|$)/i.test(a)?Dp:iu}function Mp(){return Ru(xs(w0)||mo)}function OL(e){return Ps(w0,Ru(e))}const jL=["key","module","page","component","slot","text"],UL={[Dp]:{...DL,...ML,...IL}};let Oh=null,P0=ou(Mp());function BL(e){const t=[];let n=[],a="",o=!1;for(let s=0;s<e.length;s+=1){const c=e[s];if(o){c==='"'?e[s+1]==='"'?(a+='"',s+=1):o=!1:a+=c;continue}if(c==='"'){o=!0;continue}if(c===","){n.push(a),a="";continue}if(c===`
833
+ `){n.push(a),a="",n.every(u=>u.trim()==="")||t.push(n),n=[];continue}c!=="\r"&&(a+=c)}return n.push(a),n.every(s=>s.trim()==="")||t.push(n),t}function FL(e){const t=BL(e);if(!t.length)return{map:new Map,rows:[]};const n=t[0].map(u=>String(u).trim());if(jL.filter(u=>!n.includes(u)).length)return{map:new Map,rows:[]};const o=Object.fromEntries(n.map((u,h)=>[u,h])),s=[],c=new Map;return t.slice(1).forEach((u,h)=>{const f={key:String(u[o.key]||"").trim(),module:String(u[o.module]||"").trim(),page:String(u[o.page]||"").trim(),component:String(u[o.component]||"").trim(),slot:String(u[o.slot]||"").trim(),text:String(u[o.text]??"").trim()};f.key&&(c.has(f.key),c.set(f.key,f),s.push(f))}),{map:c,rows:s}}function VL(){return Oh||(Oh=FL(LL)),Oh}function zL(){return UL[P0]||{}}function $L(e){const t=zL()[String(e)];return typeof t=="string"&&t.trim()?t:null}function HL(e,t){return t?e.replace(/\{\{(\w+)\}\}/g,(n,a)=>t[a]==null?n:String(t[a])):e}function WL(e){return String(e).replace(/\\n/g,`
834
+ `)}function KL(e,t){return $L(t)||e?.text||t}function GL(e){P0=x0(e)}function Fe(e,t){const a=VL().map.get(e);return HL(WL(KL(a,e)),t)}const Qv="tokentracker_native_app";let S0=null;const Pf=new Set;typeof window<"u"&&window.addEventListener("native:systemAppearanceChanged",e=>{const t=e?.detail?.isDark;if(typeof t=="boolean"){S0=t;try{const n=document.documentElement;t?n.classList.add("dark"):n.classList.remove("dark")}catch{}Pf.forEach(n=>{try{n(t)}catch{}})}});function Jv(){return S0}function qL(e){return Pf.add(e),()=>Pf.delete(e)}function Ip(){if(typeof window>"u")return!1;try{if(new URLSearchParams(window.location.search).get("app")==="1"){try{window.localStorage.setItem(Qv,"1")}catch{}return!0}return window.localStorage.getItem(Qv)==="1"}catch{return!1}}function ar(){return typeof window>"u"?!1:!!window.webkit?.messageHandlers?.nativeBridge}function C0(){return typeof window>"u"?null:window.webkit?.messageHandlers?.nativeBridge??null}function z4(){return!!C0()}function Xs(e){const t=C0();if(!t)return!1;try{return t.postMessage(e),!0}catch(n){return console.warn("[tokentracker] nativeBridge post failed:",n),!1}}function $4(){return Xs({type:"getSettings"})}function Ss(e,t){return Xs({type:"setSetting",key:e,value:t})}function H4(e){return Xs({type:"action",name:e})}function YL(){return Xs({type:"getSystemAppearance"})}function ZL(e,t){if(!ar())return;Xs({type:"setChromeAppearance",isDark:e==="dark",theme:t??"system"})}function W4(e){if(typeof window>"u")return()=>{};const t=n=>{n&&n.detail&&typeof n.detail=="object"&&e(n.detail)};return window.addEventListener("native:settings",t),()=>window.removeEventListener("native:settings",t)}const T0=b.createContext(null);function XL(){return ou(Mp())}function QL(e){typeof document>"u"||(document.documentElement.lang=e)}function ek(e,t){GL(e),t(n=>n===e?n:e)}function JL({children:e}){const[t,n]=b.useState(Mp),[a,o]=b.useState(XL);b.useLayoutEffect(()=>{QL(a)},[a]),b.useLayoutEffect(()=>{ar()&&Ss("locale",t)},[t]),b.useLayoutEffect(()=>{if(t!==mo||typeof window>"u")return;const u=()=>ek(ou(mo),o);return window.addEventListener("languagechange",u),()=>window.removeEventListener("languagechange",u)},[t]);const s=b.useCallback(u=>{const h=Ru(u);ek(ou(h),o),n(h),OL(h),ar()&&Ss("locale",h)},[]),c=b.useMemo(()=>({locale:t,setLocale:s,resolvedLocale:a}),[t,a,s]);return N.jsx(T0.Provider,{value:c,children:e})}const eD="https://open.er-api.com/v6/latest/USD",tD=1440*60*1e3,nD=5e3;function rD(e,t=tD,n=Date.now()){return!e||!Number.isFinite(e)?!0:n-e>t}async function aD(e={}){const{timeoutMs:t=nD,fetchImpl:n,url:a=eD,codes:o=Tp}=e,s=n??(typeof fetch<"u"?fetch:null);if(!s)throw new Error("fetch is not available");const c=typeof AbortController<"u"?new AbortController:null,u=c?setTimeout(()=>c.abort(),t):null;try{const h=await s(a,c?{signal:c.signal}:void 0);if(!h||!h.ok)throw new Error(`exchange rate fetch failed: ${h?.status??"no-response"}`);const m=(await h.json())?.rates;if(!m||typeof m!="object")throw new Error("exchange rate response missing rates");const y={USD:1};for(const k of o){if(k==="USD")continue;const w=m[k];ru(w)&&(y[k]=w)}if(Object.keys(y).length<=1)throw new Error("no supported currency rates in response");return{rates:y,fetchedAt:Date.now()}}finally{u&&clearTimeout(u)}}const iD=b.createContext(null);function tk(e,t,n){ar()&&(Ss("currency",e),Ss("currencySymbol",n),ru(t)&&Ss("exchangeRate",t))}function oD({children:e}){const[t,n]=b.useState(XR),a=b.useMemo(()=>eL(),[]),[o,s]=b.useState(a.rates),[c,u]=b.useState(a.source),[h,f]=b.useState(a.fetchedAt),m=b.useRef(!1),y=b.useRef(!1),k=b.useCallback((L,R,O)=>{s(L),u(R),f(O),tL({rates:L,source:R,fetchedAt:O})},[]),w=b.useCallback(async()=>{if(!m.current){m.current=!0;try{const{rates:L,fetchedAt:R}=await aD();k({...Ep,...L},"fetched",R)}catch{}finally{m.current=!1}}},[k]),x=b.useCallback(L=>{const R=Ap(L);n(R),QR(R);const O=Mh(o,R),G=Nc(R);tk(R,O,G)},[o]);b.useEffect(()=>{y.current||t!==Ns&&rD(h)&&(y.current=!0,w())},[t,h,w]),b.useEffect(()=>{const L=Mh(o,t),R=Nc(t);tk(t,L,R)},[t,o]);const C=b.useMemo(()=>Mh(o,t),[o,t]),S=b.useMemo(()=>Nc(t),[t]),D=b.useMemo(()=>({currency:t,rate:C,symbol:S,rates:o,rateSource:c,rateFetchedAt:h,setCurrency:x}),[t,C,S,o,c,h,x]);return N.jsx(iD.Provider,{value:D,children:e})}const sD="modulepreload",lD=function(e){return"/"+e},nk={},$n=function(t,n,a){let o=Promise.resolve();if(n&&n.length>0){let h=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=c?.nonce||c?.getAttribute("nonce");o=h(n.map(f=>{if(f=lD(f),f in nk)return;nk[f]=!0;const m=f.endsWith(".css"),y=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${y}`))return;const k=document.createElement("link");if(k.rel=m?"stylesheet":sD,m||(k.as="script"),k.crossOrigin="",k.href=f,u&&k.setAttribute("nonce",u),document.head.appendChild(k),m)return new Promise((w,x)=>{k.addEventListener("load",w),k.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return o.then(c=>{for(const u of c||[])u.status==="rejected"&&s(u.reason);return t().catch(s)})};var su={},cD=()=>{window.va||(window.va=function(...t){window.vaq||(window.vaq=[]),window.vaq.push(t)})},uD="@vercel/analytics",dD="2.0.1";function E0(){return typeof window<"u"}function A0(){try{const e="production"}catch{}return"production"}function hD(e="auto"){if(e==="auto"){window.vam=A0();return}window.vam=e}function fD(){return(E0()?window.vam:A0())||"production"}function Np(){return fD()==="development"}function pD(e){return e.scriptSrc?ro(e.scriptSrc):Np()?"https://va.vercel-scripts.com/v1/script.debug.js":e.basePath?ro(`${e.basePath}/insights/script.js`):"/_vercel/insights/script.js"}function mD(e,t){var n;let a=e;if(t)try{a={...(n=JSON.parse(t))==null?void 0:n.analytics,...e}}catch{}hD(a.mode);const o={sdkn:uD+(a.framework?`/${a.framework}`:""),sdkv:dD};return a.disableAutoTrack&&(o.disableAutoTrack="1"),a.viewEndpoint&&(o.viewEndpoint=ro(a.viewEndpoint)),a.eventEndpoint&&(o.eventEndpoint=ro(a.eventEndpoint)),a.sessionEndpoint&&(o.sessionEndpoint=ro(a.sessionEndpoint)),Np()&&a.debug===!1&&(o.debug="false"),a.dsn&&(o.dsn=a.dsn),a.endpoint?o.endpoint=a.endpoint:a.basePath&&(o.endpoint=ro(`${a.basePath}/insights`)),{beforeSend:a.beforeSend,src:pD(a),dataset:o}}function ro(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e}`}function gD(e={debug:!0},t){var n;if(!E0())return;const{beforeSend:a,src:o,dataset:s}=mD(e,t);if(cD(),a&&((n=window.va)==null||n.call(window,"beforeSend",a)),document.head.querySelector(`script[src*="${o}"]`))return;const c=document.createElement("script");c.src=o;for(const[u,h]of Object.entries(s))c.dataset[u]=h;c.defer=!0,c.onerror=()=>{const u=Np()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log(`[Vercel Web Analytics] Failed to load script from ${o}. ${u}`)},document.head.appendChild(c)}function yD({route:e,path:t}){var n;(n=window.va)==null||n.call(window,"pageview",{route:e,path:t})}function vD(){if(!(typeof process>"u"||typeof su>"u"))return su.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function kD(){if(!(typeof process>"u"||typeof su>"u"))return su.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function _D(e){return b.useEffect(()=>{var t;e.beforeSend&&((t=window.va)==null||t.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]),b.useEffect(()=>{gD({framework:e.framework||"react",basePath:e.basePath??vD(),...e.route!==void 0&&{disableAutoTrack:!0},...e},e.configString??kD())},[]),b.useEffect(()=>{e.route&&e.path&&yD({route:e.route,path:e.path})},[e.route,e.path]),null}var lu={},bD=()=>{window.si||(window.si=function(...t){window.siq=window.siq||[],window.siq.push(t)})},wD="@vercel/speed-insights",xD="2.0.0";function PD(){return typeof window<"u"}function SD(){try{const e="production"}catch{}return"production"}function R0(){return SD()==="development"}function CD(e){return e.scriptSrc?cu(e.scriptSrc):R0()?"https://va.vercel-scripts.com/v1/speed-insights/script.debug.js":e.dsn?"https://va.vercel-scripts.com/v1/speed-insights/script.js":e.basePath?cu(`${e.basePath}/speed-insights/script.js`):"/_vercel/speed-insights/script.js"}function TD(e,t){var n;let a=e;if(t)try{a={...(n=JSON.parse(t))==null?void 0:n.speedInsights,...e}}catch{}const o={sdkn:wD+(a.framework?`/${a.framework}`:""),sdkv:xD};return a.sampleRate&&(o.sampleRate=a.sampleRate.toString()),a.route&&(o.route=a.route),R0()&&a.debug===!1&&(o.debug="false"),a.dsn&&(o.dsn=a.dsn),a.endpoint?o.endpoint=cu(a.endpoint):a.basePath&&(o.endpoint=cu(`${a.basePath}/speed-insights/vitals`)),{src:CD(a),beforeSend:a.beforeSend,dataset:o}}function cu(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e}`}function ED(e={},t){var n;if(!PD()||e.route===null)return null;bD();const{beforeSend:a,src:o,dataset:s}=TD(e,t);if(document.head.querySelector(`script[src*="${o}"]`))return null;a&&((n=window.si)==null||n.call(window,"beforeSend",a));const c=document.createElement("script");c.src=o,c.defer=!0;for(const[u,h]of Object.entries(s))c.dataset[u]=h;return c.onerror=()=>{console.log(`[Vercel Speed Insights] Failed to load script from ${o}. Please check if any content blockers are enabled and try again.`)},document.head.appendChild(c),{setRoute:u=>{c.dataset.route=u??void 0}}}function AD(){if(!(typeof process>"u"||typeof lu>"u"))return lu.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function RD(){if(!(typeof process>"u"||typeof lu>"u"))return lu.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}function LD(e){b.useEffect(()=>{var n;e.beforeSend&&((n=window.si)==null||n.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]);const t=b.useRef(null);return b.useEffect(()=>{if(!t.current){const n=ED({framework:e.framework??"react",basePath:e.basePath??AD(),...e},e.configString??RD());n&&(t.current=n.setRoute)}},[e]),b.useEffect(()=>{t.current&&e.route&&t.current(e.route)},[e.route]),null}const L0=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();const DD=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const MD=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());const rk=e=>{const t=MD(e);return t.charAt(0).toUpperCase()+t.slice(1)};var jh={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ID=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},ND=b.createContext({}),OD=()=>b.useContext(ND),jD=b.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:a,className:o="",children:s,iconNode:c,...u},h)=>{const{size:f=24,strokeWidth:m=2,absoluteStrokeWidth:y=!1,color:k="currentColor",className:w=""}=OD()??{},x=a??y?Number(n??m)*24/Number(t??f):n??m;return b.createElement("svg",{ref:h,...jh,width:t??f??jh.width,height:t??f??jh.height,stroke:e??k,strokeWidth:x,className:L0("lucide",w,o),...!s&&!ID(u)&&{"aria-hidden":"true"},...u},[...c.map(([C,S])=>b.createElement(C,S)),...Array.isArray(s)?s:[s]])});const dn=(e,t)=>{const n=b.forwardRef(({className:a,...o},s)=>b.createElement(jD,{ref:s,iconNode:t,className:L0(`lucide-${DD(rk(e))}`,`lucide-${e}`,a),...o}));return n.displayName=rk(e),n};const UD=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],BD=dn("chart-column",UD);const FD=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],VD=dn("gauge",FD);const zD=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],$D=dn("globe",zD);const HD=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],WD=dn("layout-grid",HD);const KD=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],GD=dn("mail",KD);const qD=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],YD=dn("menu",qD);const ZD=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],XD=dn("monitor",ZD);const QD=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],D0=dn("moon",QD);const JD=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],eM=dn("puzzle",JD);const tM=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],nM=dn("refresh-cw",tM);const rM=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],aM=dn("settings",rM);const iM=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],M0=dn("sun",iM);const oM=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],sM=dn("triangle-alert",oM);const lM=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],cM=dn("trophy",lM);const uM=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],I0=dn("x",uM);function dM({children:e,variant:t="primary",size:n="md",onClick:a,disabled:o=!1,className:s="",as:c="button",...u}){const h="inline-flex items-center justify-center font-medium transition-all duration-200 rounded-md focus:outline-none focus:ring-2 focus:ring-oai-blue/30 active:scale-[0.98] active:duration-100",f={primary:"bg-oai-black dark:bg-oai-white text-white dark:text-oai-black border border-transparent hover:bg-oai-gray-800 dark:hover:bg-oai-gray-200 active:bg-oai-gray-900 dark:active:bg-oai-gray-300 disabled:bg-oai-gray-300 dark:disabled:bg-oai-gray-700 disabled:text-oai-gray-500 dark:disabled:text-oai-gray-400 focus:ring-oai-brand/30 transition-colors duration-200",secondary:"bg-oai-white dark:bg-oai-gray-900 text-oai-black dark:text-oai-white border border-oai-gray-300 dark:border-oai-gray-700 hover:border-oai-brand hover:text-oai-brand active:bg-oai-gray-50 dark:active:bg-oai-gray-800 active:border-oai-brand-dark disabled:text-oai-gray-400 dark:disabled:text-oai-gray-500 disabled:border-oai-gray-200 dark:disabled:border-oai-gray-700 focus:ring-oai-brand/30 transition-colors duration-200",ghost:"bg-transparent text-oai-gray-600 dark:text-oai-gray-300 border border-transparent hover:text-oai-brand hover:bg-oai-brand-50/50 dark:hover:bg-oai-brand-950/30 active:bg-oai-brand-50 dark:active:bg-oai-brand-900/50 disabled:text-oai-gray-400 dark:disabled:text-oai-gray-500 focus:ring-oai-brand/30 transition-colors duration-200"},m={sm:"h-8 px-3 text-sm",md:"h-10 px-4 text-sm",lg:"h-12 px-6 text-base"},y=o?"cursor-not-allowed opacity-60":"cursor-pointer",k=`${h} ${f[t]} ${m[n]} ${y} ${s}`;return N.jsx(c,{className:k,onClick:a,disabled:o,...u,children:e})}class hM extends Rs.Component{constructor(t){super(t),this.state={error:null},this.handleReload=this.handleReload.bind(this)}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("ErrorBoundary caught an error:",t)}handleReload(){typeof window>"u"||window.location.reload()}render(){const{error:t}=this.state;if(!t)return this.props.children;const n=String(t?.message||t||""),a=n?Fe("shared.error.prefix",{error:n}):Fe("error.boundary.no_details");return N.jsx("div",{className:"flex min-h-screen items-center justify-center bg-oai-white p-6 font-oai text-oai-black antialiased dark:bg-oai-gray-950 dark:text-oai-white",children:N.jsxs("div",{className:"w-full max-w-lg rounded-xl border border-oai-gray-200 bg-white p-6 text-center shadow-sm dark:border-oai-gray-800 dark:bg-oai-gray-900",children:[N.jsx("div",{className:"mx-auto flex h-10 w-10 items-center justify-center rounded-full bg-amber-50 text-amber-600 dark:bg-amber-950/30 dark:text-amber-300",children:N.jsx(sM,{className:"h-5 w-5","aria-hidden":!0})}),N.jsx("div",{className:"mt-4 text-xs font-medium uppercase text-oai-gray-500 dark:text-oai-gray-400",children:Fe("error.boundary.title")}),N.jsx("h1",{className:"mt-2 text-xl font-semibold text-oai-black dark:text-white",children:Fe("error.boundary.subtitle")}),N.jsx("p",{className:"mt-2 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:Fe("error.boundary.hint")}),N.jsx("div",{className:"mt-4 max-h-32 overflow-auto rounded-lg border border-oai-gray-200 bg-oai-gray-50 px-3 py-2 text-left text-xs leading-5 text-oai-gray-600 dark:border-oai-gray-800 dark:bg-oai-gray-950 dark:text-oai-gray-300",children:a}),N.jsxs(dM,{type:"button",size:"md",onClick:this.handleReload,className:"mt-5",children:[N.jsx(nM,{className:"mr-2 h-4 w-4","aria-hidden":!0}),Fe("error.boundary.action.reload")]})]})})}}function Qs(){const e=b.useContext(T0);if(e===null)throw new Error("useLocale must be used within a LocaleProvider");return e}const Sf="tokentracker-theme",N0=b.createContext(null);function fM(){if(typeof window>"u")return"system";try{const e=localStorage.getItem(Sf);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}function yc(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function pM(e){if(typeof document>"u")return;const t=document.documentElement;e==="dark"?t.classList.add("dark"):t.classList.remove("dark")}function mM({children:e}){const[t,n]=b.useState(fM),[a,o]=b.useState(()=>{if(t!=="system")return t;if(ar()){const f=Jv();if(typeof f=="boolean")return f?"dark":"light"}return yc()}),s=b.useRef(t);b.useEffect(()=>{s.current=t},[t]),b.useEffect(()=>{pM(a)},[a]),b.useLayoutEffect(()=>{if(t==="system"){if(ar()){const f=Jv();o(typeof f=="boolean"?f?"dark":"light":yc()),YL();return}o(yc())}else o(t)},[t]),b.useEffect(()=>ar()?qL(m=>{s.current==="system"&&o(m?"dark":"light")}):void 0,[]),b.useEffect(()=>{if(typeof window>"u"||t!=="system"||ar())return;const f=window.matchMedia("(prefers-color-scheme: dark)"),m=y=>{const k=y.matches?"dark":"light";o(k)};return f.addEventListener?(f.addEventListener("change",m),()=>f.removeEventListener("change",m)):(f.addListener(m),()=>f.removeListener(m))},[t]),b.useEffect(()=>{const f=t==="system"&&!ar()?yc():a;ZL(f,t)},[a,t]);const c=b.useCallback(f=>{if(n(f),typeof window<"u")try{localStorage.setItem(Sf,f)}catch{}},[]),u=b.useCallback(()=>{c(f=>{const m=f==="dark"?"light":"dark";if(typeof window<"u")try{localStorage.setItem(Sf,m)}catch{}return m})},[]),h=b.useMemo(()=>({theme:t,setTheme:c,toggleTheme:u,resolvedTheme:a}),[t,c,u,a]);return N.jsx(N0.Provider,{value:h,children:e})}const O0=b.createContext({isOpen:!1,openLoginModal:()=>{},closeLoginModal:()=>{}});function gM({children:e}){const[t,n]=b.useState(!1),a=b.useCallback(()=>n(!0),[]),o=b.useCallback(()=>n(!1),[]);return N.jsx(O0.Provider,{value:{isOpen:t,openLoginModal:a,closeLoginModal:o},children:e})}function j0(){return b.useContext(O0)}const Op=b.createContext({});function jp(e){const t=b.useRef(null);return t.current===null&&(t.current=e()),t.current}const yM=typeof window<"u",U0=yM?b.useLayoutEffect:b.useEffect,Lu=b.createContext(null);function Up(e,t){e.indexOf(t)===-1&&e.push(t)}function uu(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const xr=(e,t,n)=>n>t?t:n<e?e:n;let Bp=()=>{};const Ia={},B0=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function F0(e){return typeof e=="object"&&e!==null}const V0=e=>/^0[^.\s]+$/u.test(e);function z0(e){let t;return()=>(t===void 0&&(t=e()),t)}const jn=e=>e,vM=(e,t)=>n=>t(e(n)),Js=(...e)=>e.reduce(vM),js=(e,t,n)=>{const a=t-e;return a===0?1:(n-e)/a};class Fp{constructor(){this.subscriptions=[]}add(t){return Up(this.subscriptions,t),()=>uu(this.subscriptions,t)}notify(t,n,a){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,a);else for(let s=0;s<o;s++){const c=this.subscriptions[s];c&&c(t,n,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Pn=e=>e*1e3,On=e=>e/1e3;function $0(e,t){return t?e*(1e3/t):0}const H0=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,kM=1e-7,_M=12;function bM(e,t,n,a,o){let s,c,u=0;do c=t+(n-t)/2,s=H0(c,a,o)-e,s>0?n=c:t=c;while(Math.abs(s)>kM&&++u<_M);return c}function el(e,t,n,a){if(e===t&&n===a)return jn;const o=s=>bM(s,0,1,e,n);return s=>s===0||s===1?s:H0(o(s),t,a)}const W0=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,K0=e=>t=>1-e(1-t),G0=el(.33,1.53,.69,.99),Vp=K0(G0),q0=W0(Vp),Y0=e=>e>=1?1:(e*=2)<1?.5*Vp(e):.5*(2-Math.pow(2,-10*(e-1))),zp=e=>1-Math.sin(Math.acos(e)),Z0=K0(zp),X0=W0(zp),wM=el(.42,0,1,1),xM=el(0,0,.58,1),Q0=el(.42,0,.58,1),PM=e=>Array.isArray(e)&&typeof e[0]!="number",J0=e=>Array.isArray(e)&&typeof e[0]=="number",SM={linear:jn,easeIn:wM,easeInOut:Q0,easeOut:xM,circIn:zp,circInOut:X0,circOut:Z0,backIn:Vp,backInOut:q0,backOut:G0,anticipate:Y0},CM=e=>typeof e=="string",ak=e=>{if(J0(e)){Bp(e.length===4);const[t,n,a,o]=e;return el(t,n,a,o)}else if(CM(e))return SM[e];return e},vc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function TM(e,t){let n=new Set,a=new Set,o=!1,s=!1;const c=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function h(m){c.has(m)&&(f.schedule(m),e()),m(u)}const f={schedule:(m,y=!1,k=!1)=>{const x=k&&o?n:a;return y&&c.add(m),x.add(m),m},cancel:m=>{a.delete(m),c.delete(m)},process:m=>{if(u=m,o){s=!0;return}o=!0;const y=n;n=a,a=y,n.forEach(h),n.clear(),o=!1,s&&(s=!1,f.process(m))}};return f}const EM=40;function ew(e,t){let n=!1,a=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,c=vc.reduce((R,O)=>(R[O]=TM(s),R),{}),{setup:u,read:h,resolveKeyframes:f,preUpdate:m,update:y,preRender:k,render:w,postRender:x}=c,C=()=>{const R=Ia.useManualTiming,O=R?o.timestamp:performance.now();n=!1,R||(o.delta=a?1e3/60:Math.max(Math.min(O-o.timestamp,EM),1)),o.timestamp=O,o.isProcessing=!0,u.process(o),h.process(o),f.process(o),m.process(o),y.process(o),k.process(o),w.process(o),x.process(o),o.isProcessing=!1,n&&t&&(a=!1,e(C))},S=()=>{n=!0,a=!0,o.isProcessing||e(C)};return{schedule:vc.reduce((R,O)=>{const G=c[O];return R[O]=(W,z=!1,P=!1)=>(n||S(),G.schedule(W,z,P)),R},{}),cancel:R=>{for(let O=0;O<vc.length;O++)c[vc[O]].cancel(R)},state:o,steps:c}}const{schedule:dt,cancel:Na,state:Kt,steps:Uh}=ew(typeof requestAnimationFrame<"u"?requestAnimationFrame:jn,!0);let jc;function AM(){jc=void 0}const sn={now:()=>(jc===void 0&&sn.set(Kt.isProcessing||Ia.useManualTiming?Kt.timestamp:performance.now()),jc),set:e=>{jc=e,queueMicrotask(AM)}},tw=e=>t=>typeof t=="string"&&t.startsWith(e),nw=tw("--"),RM=tw("var(--"),$p=e=>RM(e)?LM.test(e.split("/*")[0].trim()):!1,LM=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ik(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const _o={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Us={..._o,transform:e=>xr(0,1,e)},kc={..._o,default:1},Cs=e=>Math.round(e*1e5)/1e5,Hp=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function DM(e){return e==null}const MM=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Wp=(e,t)=>n=>!!(typeof n=="string"&&MM.test(n)&&n.startsWith(e)||t&&!DM(n)&&Object.prototype.hasOwnProperty.call(n,t)),rw=(e,t,n)=>a=>{if(typeof a!="string")return a;const[o,s,c,u]=a.match(Hp);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(c),alpha:u!==void 0?parseFloat(u):1}},IM=e=>xr(0,255,e),Bh={..._o,transform:e=>Math.round(IM(e))},ai={test:Wp("rgb","red"),parse:rw("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:a=1})=>"rgba("+Bh.transform(e)+", "+Bh.transform(t)+", "+Bh.transform(n)+", "+Cs(Us.transform(a))+")"};function NM(e){let t="",n="",a="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),a=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),a=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,a+=a,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(a,16),alpha:o?parseInt(o,16)/255:1}}const Cf={test:Wp("#"),parse:NM,transform:ai.transform},tl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Sa=tl("deg"),vr=tl("%"),_e=tl("px"),OM=tl("vh"),jM=tl("vw"),ok={...vr,parse:e=>vr.parse(e)/100,transform:e=>vr.transform(e*100)},ao={test:Wp("hsl","hue"),parse:rw("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:a=1})=>"hsla("+Math.round(e)+", "+vr.transform(Cs(t))+", "+vr.transform(Cs(n))+", "+Cs(Us.transform(a))+")"},Lt={test:e=>ai.test(e)||Cf.test(e)||ao.test(e),parse:e=>ai.test(e)?ai.parse(e):ao.test(e)?ao.parse(e):Cf.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ai.transform(e):ao.transform(e),getAnimatableNone:e=>{const t=Lt.parse(e);return t.alpha=0,Lt.transform(t)}},UM=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function BM(e){return isNaN(e)&&typeof e=="string"&&(e.match(Hp)?.length||0)+(e.match(UM)?.length||0)>0}const aw="number",iw="color",FM="var",VM="var(",sk="${}",zM=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function go(e){const t=e.toString(),n=[],a={color:[],number:[],var:[]},o=[];let s=0;const u=t.replace(zM,h=>(Lt.test(h)?(a.color.push(s),o.push(iw),n.push(Lt.parse(h))):h.startsWith(VM)?(a.var.push(s),o.push(FM),n.push(h)):(a.number.push(s),o.push(aw),n.push(parseFloat(h))),++s,sk)).split(sk);return{values:n,split:u,indexes:a,types:o}}function $M(e){return go(e).values}function ow({split:e,types:t}){const n=e.length;return a=>{let o="";for(let s=0;s<n;s++)if(o+=e[s],a[s]!==void 0){const c=t[s];c===aw?o+=Cs(a[s]):c===iw?o+=Lt.transform(a[s]):o+=a[s]}return o}}function HM(e){return ow(go(e))}const WM=e=>typeof e=="number"?0:Lt.test(e)?Lt.getAnimatableNone(e):e,KM=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:WM(e);function GM(e){const t=go(e);return ow(t)(t.values.map((a,o)=>KM(a,t.split[o])))}const or={test:BM,parse:$M,createTransformer:HM,getAnimatableNone:GM};function Fh(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function qM({hue:e,saturation:t,lightness:n,alpha:a}){e/=360,t/=100,n/=100;let o=0,s=0,c=0;if(!t)o=s=c=n;else{const u=n<.5?n*(1+t):n+t-n*t,h=2*n-u;o=Fh(h,u,e+1/3),s=Fh(h,u,e),c=Fh(h,u,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(c*255),alpha:a}}function du(e,t){return n=>n>0?t:e}const vt=(e,t,n)=>e+(t-e)*n,Vh=(e,t,n)=>{const a=e*e,o=n*(t*t-a)+a;return o<0?0:Math.sqrt(o)},YM=[Cf,ai,ao],ZM=e=>YM.find(t=>t.test(e));function lk(e){const t=ZM(e);if(!t)return!1;let n=t.parse(e);return t===ao&&(n=qM(n)),n}const ck=(e,t)=>{const n=lk(e),a=lk(t);if(!n||!a)return du(e,t);const o={...n};return s=>(o.red=Vh(n.red,a.red,s),o.green=Vh(n.green,a.green,s),o.blue=Vh(n.blue,a.blue,s),o.alpha=vt(n.alpha,a.alpha,s),ai.transform(o))},Tf=new Set(["none","hidden"]);function XM(e,t){return Tf.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function QM(e,t){return n=>vt(e,t,n)}function Kp(e){return typeof e=="number"?QM:typeof e=="string"?$p(e)?du:Lt.test(e)?ck:t2:Array.isArray(e)?sw:typeof e=="object"?Lt.test(e)?ck:JM:du}function sw(e,t){const n=[...e],a=n.length,o=e.map((s,c)=>Kp(s)(s,t[c]));return s=>{for(let c=0;c<a;c++)n[c]=o[c](s);return n}}function JM(e,t){const n={...e,...t},a={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(a[o]=Kp(e[o])(e[o],t[o]));return o=>{for(const s in a)n[s]=a[s](o);return n}}function e2(e,t){const n=[],a={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],c=e.indexes[s][a[s]],u=e.values[c]??0;n[o]=u,a[s]++}return n}const t2=(e,t)=>{const n=or.createTransformer(t),a=go(e),o=go(t);return a.indexes.var.length===o.indexes.var.length&&a.indexes.color.length===o.indexes.color.length&&a.indexes.number.length>=o.indexes.number.length?Tf.has(e)&&!o.values.length||Tf.has(t)&&!a.values.length?XM(e,t):Js(sw(e2(a,o),o.values),n):du(e,t)};function lw(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?vt(e,t,n):Kp(e)(e,t)}const n2=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>dt.update(t,n),stop:()=>Na(t),now:()=>Kt.isProcessing?Kt.timestamp:sn.now()}},cw=(e,t,n=10)=>{let a="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)a+=Math.round(e(s/(o-1))*1e4)/1e4+", ";return`linear(${a.substring(0,a.length-2)})`},hu=2e4;function Gp(e){let t=0;const n=50;let a=e.next(t);for(;!a.done&&t<hu;)t+=n,a=e.next(t);return t>=hu?1/0:t}function r2(e,t=100,n){const a=n({...e,keyframes:[0,t]}),o=Math.min(Gp(a),hu);return{type:"keyframes",ease:s=>a.next(o*s).value/t,duration:On(o)}}const Pt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Ef(e,t){return e*Math.sqrt(1-t*t)}const a2=12;function i2(e,t,n){let a=n;for(let o=1;o<a2;o++)a=a-e(a)/t(a);return a}const zh=.001;function o2({duration:e=Pt.duration,bounce:t=Pt.bounce,velocity:n=Pt.velocity,mass:a=Pt.mass}){let o,s,c=1-t;c=xr(Pt.minDamping,Pt.maxDamping,c),e=xr(Pt.minDuration,Pt.maxDuration,On(e)),c<1?(o=f=>{const m=f*c,y=m*e,k=m-n,w=Ef(f,c),x=Math.exp(-y);return zh-k/w*x},s=f=>{const y=f*c*e,k=y*n+n,w=Math.pow(c,2)*Math.pow(f,2)*e,x=Math.exp(-y),C=Ef(Math.pow(f,2),c);return(-o(f)+zh>0?-1:1)*((k-w)*x)/C}):(o=f=>{const m=Math.exp(-f*e),y=(f-n)*e+1;return-zh+m*y},s=f=>{const m=Math.exp(-f*e),y=(n-f)*(e*e);return m*y});const u=5/e,h=i2(o,s,u);if(e=Pn(e),isNaN(h))return{stiffness:Pt.stiffness,damping:Pt.damping,duration:e};{const f=Math.pow(h,2)*a;return{stiffness:f,damping:c*2*Math.sqrt(a*f),duration:e}}}const s2=["duration","bounce"],l2=["stiffness","damping","mass"];function uk(e,t){return t.some(n=>e[n]!==void 0)}function c2(e){let t={velocity:Pt.velocity,stiffness:Pt.stiffness,damping:Pt.damping,mass:Pt.mass,isResolvedFromDuration:!1,...e};if(!uk(e,l2)&&uk(e,s2))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,a=2*Math.PI/(n*1.2),o=a*a,s=2*xr(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Pt.mass,stiffness:o,damping:s}}else{const n=o2({...e,velocity:0});t={...t,...n,mass:Pt.mass},t.isResolvedFromDuration=!0}return t}function fu(e=Pt.visualDuration,t=Pt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:a,restDelta:o}=n;const s=n.keyframes[0],c=n.keyframes[n.keyframes.length-1],u={done:!1,value:s},{stiffness:h,damping:f,mass:m,duration:y,velocity:k,isResolvedFromDuration:w}=c2({...n,velocity:-On(n.velocity||0)}),x=k||0,C=f/(2*Math.sqrt(h*m)),S=c-s,D=On(Math.sqrt(h/m)),L=Math.abs(S)<5;a||(a=L?Pt.restSpeed.granular:Pt.restSpeed.default),o||(o=L?Pt.restDelta.granular:Pt.restDelta.default);let R,O,G,W,z,P;if(C<1)G=Ef(D,C),W=(x+C*D*S)/G,R=X=>{const de=Math.exp(-C*D*X);return c-de*(W*Math.sin(G*X)+S*Math.cos(G*X))},z=C*D*W+S*G,P=C*D*S-W*G,O=X=>Math.exp(-C*D*X)*(z*Math.sin(G*X)+P*Math.cos(G*X));else if(C===1){R=de=>c-Math.exp(-D*de)*(S+(x+D*S)*de);const X=x+D*S;O=de=>Math.exp(-D*de)*(D*X*de-x)}else{const X=D*Math.sqrt(C*C-1);R=fe=>{const le=Math.exp(-C*D*fe),pe=Math.min(X*fe,300);return c-le*((x+C*D*S)*Math.sinh(pe)+X*S*Math.cosh(pe))/X};const de=(x+C*D*S)/X,se=C*D*de-S*X,Ae=C*D*S-de*X;O=fe=>{const le=Math.exp(-C*D*fe),pe=Math.min(X*fe,300);return le*(se*Math.sinh(pe)+Ae*Math.cosh(pe))}}const Y={calculatedDuration:w&&y||null,velocity:X=>Pn(O(X)),next:X=>{if(!w&&C<1){const se=Math.exp(-C*D*X),Ae=Math.sin(G*X),fe=Math.cos(G*X),le=c-se*(W*Ae+S*fe),pe=Pn(se*(z*Ae+P*fe));return u.done=Math.abs(pe)<=a&&Math.abs(c-le)<=o,u.value=u.done?c:le,u}const de=R(X);if(w)u.done=X>=y;else{const se=Pn(O(X));u.done=Math.abs(se)<=a&&Math.abs(c-de)<=o}return u.value=u.done?c:de,u},toString:()=>{const X=Math.min(Gp(Y),hu),de=cw(se=>Y.next(X*se).value,X,30);return X+"ms "+de},toTransition:()=>{}};return Y}fu.applyToOptions=e=>{const t=r2(e,100,fu);return e.ease=t.ease,e.duration=Pn(t.duration),e.type="keyframes",e};const u2=5;function uw(e,t,n){const a=Math.max(t-u2,0);return $0(n-e(a),t-a)}function Af({keyframes:e,velocity:t=0,power:n=.8,timeConstant:a=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:c,min:u,max:h,restDelta:f=.5,restSpeed:m}){const y=e[0],k={done:!1,value:y},w=P=>u!==void 0&&P<u||h!==void 0&&P>h,x=P=>u===void 0?h:h===void 0||Math.abs(u-P)<Math.abs(h-P)?u:h;let C=n*t;const S=y+C,D=c===void 0?S:c(S);D!==S&&(C=D-y);const L=P=>-C*Math.exp(-P/a),R=P=>D+L(P),O=P=>{const Y=L(P),X=R(P);k.done=Math.abs(Y)<=f,k.value=k.done?D:X};let G,W;const z=P=>{w(k.value)&&(G=P,W=fu({keyframes:[k.value,x(k.value)],velocity:uw(R,P,k.value),damping:o,stiffness:s,restDelta:f,restSpeed:m}))};return z(0),{calculatedDuration:null,next:P=>{let Y=!1;return!W&&G===void 0&&(Y=!0,O(P),z(P)),G!==void 0&&P>=G?W.next(P-G):(!Y&&O(P),k)}}}function d2(e,t,n){const a=[],o=n||Ia.mix||lw,s=e.length-1;for(let c=0;c<s;c++){let u=o(e[c],e[c+1]);if(t){const h=Array.isArray(t)?t[c]||jn:t;u=Js(h,u)}a.push(u)}return a}function h2(e,t,{clamp:n=!0,ease:a,mixer:o}={}){const s=e.length;if(Bp(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const c=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const u=d2(t,a,o),h=u.length,f=m=>{if(c&&m<e[0])return t[0];let y=0;if(h>1)for(;y<e.length-2&&!(m<e[y+1]);y++);const k=js(e[y],e[y+1],m);return u[y](k)};return n?m=>f(xr(e[0],e[s-1],m)):f}function f2(e,t){const n=e[e.length-1];for(let a=1;a<=t;a++){const o=js(0,t,a);e.push(vt(n,1,o))}}function p2(e){const t=[0];return f2(t,e.length-1),t}function m2(e,t){return e.map(n=>n*t)}function g2(e,t){return e.map(()=>t||Q0).splice(0,e.length-1)}function Ts({duration:e=300,keyframes:t,times:n,ease:a="easeInOut"}){const o=PM(a)?a.map(ak):ak(a),s={done:!1,value:t[0]},c=m2(n&&n.length===t.length?n:p2(t),e),u=h2(c,t,{ease:Array.isArray(o)?o:g2(t,o)});return{calculatedDuration:e,next:h=>(s.value=u(h),s.done=h>=e,s)}}const y2=e=>e!==null;function Du(e,{repeat:t,repeatType:n="loop"},a,o=1){const s=e.filter(y2),u=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!u||a===void 0?s[u]:a}const v2={decay:Af,inertia:Af,tween:Ts,keyframes:Ts,spring:fu};function dw(e){typeof e.type=="string"&&(e.type=v2[e.type])}class qp{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const k2=e=>e/100;class pu extends qp{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==sn.now()&&this.tick(sn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;dw(t);const{type:n=Ts,repeat:a=0,repeatDelay:o=0,repeatType:s,velocity:c=0}=t;let{keyframes:u}=t;const h=n||Ts;h!==Ts&&typeof u[0]!="number"&&(this.mixKeyframes=Js(k2,lw(u[0],u[1])),u=[0,100]);const f=h({...t,keyframes:u});s==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...u].reverse(),velocity:-c})),f.calculatedDuration===null&&(f.calculatedDuration=Gp(f));const{calculatedDuration:m}=f;this.calculatedDuration=m,this.resolvedDuration=m+o,this.totalDuration=this.resolvedDuration*(a+1)-o,this.generator=f}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:a,totalDuration:o,mixKeyframes:s,mirroredGenerator:c,resolvedDuration:u,calculatedDuration:h}=this;if(this.startTime===null)return a.next(0);const{delay:f=0,keyframes:m,repeat:y,repeatType:k,repeatDelay:w,type:x,onUpdate:C,finalKeyframe:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const D=this.currentTime-f*(this.playbackSpeed>=0?1:-1),L=this.playbackSpeed>=0?D<0:D>o;this.currentTime=Math.max(D,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let R=this.currentTime,O=a;if(y){const P=Math.min(this.currentTime,o)/u;let Y=Math.floor(P),X=P%1;!X&&P>=1&&(X=1),X===1&&Y--,Y=Math.min(Y,y+1),Y%2&&(k==="reverse"?(X=1-X,w&&(X-=w/u)):k==="mirror"&&(O=c)),R=xr(0,1,X)*u}let G;L?(this.delayState.value=m[0],G=this.delayState):G=O.next(R),s&&!L&&(G.value=s(G.value));let{done:W}=G;!L&&h!==null&&(W=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const z=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&W);return z&&x!==Af&&(G.value=Du(m,this.options,S,this.speed)),C&&C(G.value),z&&this.finish(),G}then(t,n){return this.finished.then(t,n)}get duration(){return On(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+On(t)}get time(){return On(this.currentTime)}set time(t){t=Pn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return uw(a=>this.generator.next(a).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(sn.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=On(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=n2,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();const a=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=a):this.holdTime!==null?this.startTime=a-this.holdTime:this.startTime||(this.startTime=n??a),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(sn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function _2(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ii=e=>e*180/Math.PI,Rf=e=>{const t=ii(Math.atan2(e[1],e[0]));return Lf(t)},b2={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Rf,rotateZ:Rf,skewX:e=>ii(Math.atan(e[1])),skewY:e=>ii(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Lf=e=>(e=e%360,e<0&&(e+=360),e),dk=Rf,hk=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),fk=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),w2={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:hk,scaleY:fk,scale:e=>(hk(e)+fk(e))/2,rotateX:e=>Lf(ii(Math.atan2(e[6],e[5]))),rotateY:e=>Lf(ii(Math.atan2(-e[2],e[0]))),rotateZ:dk,rotate:dk,skewX:e=>ii(Math.atan(e[4])),skewY:e=>ii(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Df(e){return e.includes("scale")?1:0}function Mf(e,t){if(!e||e==="none")return Df(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,o;if(n)a=w2,o=n;else{const u=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=b2,o=u}if(!o)return Df(t);const s=a[t],c=o[1].split(",").map(P2);return typeof s=="function"?s(c):c[s]}const x2=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Mf(n,t)};function P2(e){return parseFloat(e.trim())}const bo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],wo=new Set(bo),pk=e=>e===_o||e===_e,S2=new Set(["x","y","z"]),C2=bo.filter(e=>!S2.has(e));function T2(e){const t=[];return C2.forEach(n=>{const a=e.getValue(n);a!==void 0&&(t.push([n,a.get()]),a.set(n.startsWith("scale")?1:0))}),t}const La={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:a})=>{const o=e.max-e.min;return a==="border-box"?o:o-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:a})=>{const o=e.max-e.min;return a==="border-box"?o:o-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Mf(t,"x"),y:(e,{transform:t})=>Mf(t,"y")};La.translateX=La.x;La.translateY=La.y;const oi=new Set;let If=!1,Nf=!1,Of=!1;function hw(){if(Nf){const e=Array.from(oi).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),n=new Map;t.forEach(a=>{const o=T2(a);o.length&&(n.set(a,o),a.render())}),e.forEach(a=>a.measureInitialState()),t.forEach(a=>{a.render();const o=n.get(a);o&&o.forEach(([s,c])=>{a.getValue(s)?.set(c)})}),e.forEach(a=>a.measureEndState()),e.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}Nf=!1,If=!1,oi.forEach(e=>e.complete(Of)),oi.clear()}function fw(){oi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Nf=!0)})}function E2(){Of=!0,fw(),hw(),Of=!1}class Yp{constructor(t,n,a,o,s,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=a,this.motionValue=o,this.element=s,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(oi.add(this),If||(If=!0,dt.read(fw),dt.resolveKeyframes(hw))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:a,motionValue:o}=this;if(t[0]===null){const s=o?.get(),c=t[t.length-1];if(s!==void 0)t[0]=s;else if(a&&n){const u=a.readValue(n,c);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=c),o&&s===void 0&&o.set(t[0])}_2(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),oi.delete(this)}cancel(){this.state==="scheduled"&&(oi.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const A2=e=>e.startsWith("--");function pw(e,t,n){A2(t)?e.style.setProperty(t,n):e.style[t]=n}const R2={};function mw(e,t){const n=z0(e);return()=>R2[t]??n()}const L2=mw(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),gw=mw(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),_s=([e,t,n,a])=>`cubic-bezier(${e}, ${t}, ${n}, ${a})`,mk={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:_s([0,.65,.55,1]),circOut:_s([.55,0,1,.45]),backIn:_s([.31,.01,.66,-.59]),backOut:_s([.33,1.53,.69,.99])};function yw(e,t){if(e)return typeof e=="function"?gw()?cw(e,t):"ease-out":J0(e)?_s(e):Array.isArray(e)?e.map(n=>yw(n,t)||mk.easeOut):mk[e]}function D2(e,t,n,{delay:a=0,duration:o=300,repeat:s=0,repeatType:c="loop",ease:u="easeOut",times:h}={},f=void 0){const m={[t]:n};h&&(m.offset=h);const y=yw(u,o);Array.isArray(y)&&(m.easing=y);const k={delay:a,duration:o,easing:Array.isArray(y)?"linear":y,fill:"both",iterations:s+1,direction:c==="reverse"?"alternate":"normal"};return f&&(k.pseudoElement=f),e.animate(m,k)}function vw(e){return typeof e=="function"&&"applyToOptions"in e}function M2({type:e,...t}){return vw(e)&&gw()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class kw extends qp{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:a,keyframes:o,pseudoElement:s,allowFlatten:c=!1,finalKeyframe:u,onComplete:h}=t;this.isPseudoElement=!!s,this.allowFlatten=c,this.options=t,Bp(typeof t.type!="string");const f=M2(t);this.animation=D2(n,a,o,f,s),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const m=Du(o,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(m),pw(n,a,m),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return On(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+On(t)}get time(){return On(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Pn(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:a,observe:o}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&L2()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),a&&(this.animation.rangeEnd=a),jn):o(this)}}const _w={anticipate:Y0,backInOut:q0,circInOut:X0};function I2(e){return e in _w}function N2(e){typeof e.ease=="string"&&I2(e.ease)&&(e.ease=_w[e.ease])}const $h=10;class O2 extends kw{constructor(t){N2(t),dw(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:a,onComplete:o,element:s,...c}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const u=new pu({...c,autoplay:!1}),h=Math.max($h,sn.now()-this.startTime),f=xr(0,$h,h-$h),m=u.sample(h).value,{name:y}=this.options;s&&y&&pw(s,y,m),n.setWithVelocity(u.sample(Math.max(0,h-f)).value,m,f),u.stop()}}const gk=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(or.test(e)||e==="0")&&!e.startsWith("url("));function j2(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function U2(e,t,n,a){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],c=gk(o,t),u=gk(s,t);return!c||!u?!1:j2(e)||(n==="spring"||vw(n))&&a}function jf(e){e.duration=0,e.type="keyframes"}const bw=new Set(["opacity","clipPath","filter","transform"]),B2=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function F2(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&B2.test(e[t]))return!0;return!1}const V2=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),z2=z0(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function $2(e){const{motionValue:t,name:n,repeatDelay:a,repeatType:o,damping:s,type:c,keyframes:u}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:m}=t.owner.getProps();return z2()&&n&&(bw.has(n)||V2.has(n)&&F2(u))&&(n!=="transform"||!m)&&!f&&!a&&o!=="mirror"&&s!==0&&c!=="inertia"}const H2=40;class W2 extends qp{constructor({autoplay:t=!0,delay:n=0,type:a="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:c="loop",keyframes:u,name:h,motionValue:f,element:m,...y}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=sn.now();const k={autoplay:t,delay:n,type:a,repeat:o,repeatDelay:s,repeatType:c,name:h,motionValue:f,element:m,...y},w=m?.KeyframeResolver||Yp;this.keyframeResolver=new w(u,(x,C,S)=>this.onKeyframesResolved(x,C,k,!S),h,f,m),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,a,o){this.keyframeResolver=void 0;const{name:s,type:c,velocity:u,delay:h,isHandoff:f,onUpdate:m}=a;this.resolvedAt=sn.now();let y=!0;U2(t,s,c,u)||(y=!1,(Ia.instantAnimations||!h)&&m?.(Du(t,a,n)),t[0]=t[t.length-1],jf(a),a.repeat=0);const w={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>H2?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...a,keyframes:t},x=y&&!f&&$2(w),C=w.motionValue?.owner?.current;let S;if(x)try{S=new O2({...w,element:C})}catch{S=new pu(w)}else S=new pu(w);S.finished.then(()=>{this.notifyFinished()}).catch(jn),this.pendingTimeline&&(this.stopTimeline=S.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=S}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),E2()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function ww(e,t,n,a=0,o=1){const s=Array.from(e).sort((f,m)=>f.sortNodePosition(m)).indexOf(t),c=e.size,u=(c-1)*a;return typeof n=="function"?n(s,c):o===1?s*a:u-s*a}const K2=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function G2(e){const t=K2.exec(e);if(!t)return[,];const[,n,a,o]=t;return[`--${n??a}`,o]}function xw(e,t,n=1){const[a,o]=G2(e);if(!a)return;const s=window.getComputedStyle(t).getPropertyValue(a);if(s){const c=s.trim();return B0(c)?parseFloat(c):c}return $p(o)?xw(o,t,n+1):o}const q2={type:"spring",stiffness:500,damping:25,restSpeed:10},Y2=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Z2={type:"keyframes",duration:.8},X2={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Q2=(e,{keyframes:t})=>t.length>2?Z2:wo.has(e)?e.startsWith("scale")?Y2(t[1]):q2:X2;function Pw(e,t){if(e?.inherit&&t){const{inherit:n,...a}=e;return{...t,...a}}return e}function Zp(e,t){const n=e?.[t]??e?.default??e;return n!==e?Pw(n,e):n}const J2=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function eI(e){for(const t in e)if(!J2.has(t))return!0;return!1}const Xp=(e,t,n,a={},o,s)=>c=>{const u=Zp(a,e)||{},h=u.delay||a.delay||0;let{elapsed:f=0}=a;f=f-Pn(h);const m={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-f,onUpdate:k=>{t.set(k),u.onUpdate&&u.onUpdate(k)},onComplete:()=>{c(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:s?void 0:o};eI(u)||Object.assign(m,Q2(e,m)),m.duration&&(m.duration=Pn(m.duration)),m.repeatDelay&&(m.repeatDelay=Pn(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let y=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(jf(m),m.delay===0&&(y=!0)),(Ia.instantAnimations||Ia.skipAnimations||o?.shouldSkipAnimations)&&(y=!0,jf(m),m.delay=0),m.allowFlatten=!u.type&&!u.ease,y&&!s&&t.get()!==void 0){const k=Du(m.keyframes,u);if(k!==void 0){dt.update(()=>{m.onUpdate(k),m.onComplete()});return}}return u.isSync?new pu(m):new W2(m)};function yk(e){const t=[{},{}];return e?.values.forEach((n,a)=>{t[0][a]=n.get(),t[1][a]=n.getVelocity()}),t}function Qp(e,t,n,a){if(typeof t=="function"){const[o,s]=yk(a);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=yk(a);t=t(n!==void 0?n:e.custom,o,s)}return t}function si(e,t,n){const a=e.getProps();return Qp(a,t,n!==void 0?n:a.custom,e)}const Sw=new Set(["width","height","top","left","right","bottom",...bo]),vk=30,tI=e=>!isNaN(parseFloat(e)),kk={current:void 0};class nI{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const o=sn.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=sn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=tI(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Fp);const a=this.events[t].add(n);return t==="change"?()=>{a(),dt.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,a){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-a}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return kk.current&&kk.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=sn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>vk)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,vk);return $0(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function yo(e,t){return new nI(e,t)}const Uf=e=>Array.isArray(e);function rI(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,yo(n))}function aI(e){return Uf(e)?e[e.length-1]||0:e}function iI(e,t){const n=si(e,t);let{transitionEnd:a={},transition:o={},...s}=n||{};s={...s,...a};for(const c in s){const u=aI(s[c]);rI(e,c,u)}}const Gt=e=>!!(e&&e.getVelocity);function oI(e){return!!(Gt(e)&&e.add)}function Bf(e,t){const n=e.getValue("willChange");if(oI(n))return n.add(t);if(!n&&Ia.WillChange){const a=new Ia.WillChange("auto");e.addValue("willChange",a),a.add(t)}}function Jp(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const sI="framerAppearId",Cw="data-"+Jp(sI);function Tw(e){return e.props[Cw]}function lI({protectedKeys:e,needsAnimating:t},n){const a=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,a}function Ew(e,t,{delay:n=0,transitionOverride:a,type:o}={}){let{transition:s,transitionEnd:c,...u}=t;const h=e.getDefaultTransition();s=s?Pw(s,h):h;const f=s?.reduceMotion;a&&(s=a);const m=[],y=o&&e.animationState&&e.animationState.getState()[o];for(const k in u){const w=e.getValue(k,e.latestValues[k]??null),x=u[k];if(x===void 0||y&&lI(y,k))continue;const C={delay:n,...Zp(s||{},k)},S=w.get();if(S!==void 0&&!w.isAnimating()&&!Array.isArray(x)&&x===S&&!C.velocity){dt.update(()=>w.set(x));continue}let D=!1;if(window.MotionHandoffAnimation){const O=Tw(e);if(O){const G=window.MotionHandoffAnimation(O,k,dt);G!==null&&(C.startTime=G,D=!0)}}Bf(e,k);const L=f??e.shouldReduceMotion;w.start(Xp(k,w,x,L&&Sw.has(k)?{type:!1}:C,e,D));const R=w.animation;R&&m.push(R)}if(c){const k=()=>dt.update(()=>{c&&iI(e,c)});m.length?Promise.all(m).then(k):k()}return m}function Ff(e,t,n={}){const a=si(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=a||{};n.transitionOverride&&(o=n.transitionOverride);const s=a?()=>Promise.all(Ew(e,a,n)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:f=0,staggerChildren:m,staggerDirection:y}=o;return cI(e,t,h,f,m,y,n)}:()=>Promise.resolve(),{when:u}=o;if(u){const[h,f]=u==="beforeChildren"?[s,c]:[c,s];return h().then(()=>f())}else return Promise.all([s(),c(n.delay)])}function cI(e,t,n=0,a=0,o=0,s=1,c){const u=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),u.push(Ff(h,t,{...c,delay:n+(typeof a=="function"?0:a)+ww(e.variantChildren,h,a,o,s)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(u)}function uI(e,t,n={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){const o=t.map(s=>Ff(e,s,n));a=Promise.all(o)}else if(typeof t=="string")a=Ff(e,t,n);else{const o=typeof t=="function"?si(e,t,n.custom):t;a=Promise.all(Ew(e,o,n))}return a.then(()=>{e.notify("AnimationComplete",t)})}const dI={test:e=>e==="auto",parse:e=>e},Aw=e=>t=>t.test(e),Rw=[_o,_e,vr,Sa,jM,OM,dI],_k=e=>Rw.find(Aw(e));function hI(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||V0(e):!0}const fI=new Set(["brightness","contrast","saturate","opacity"]);function pI(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[a]=n.match(Hp)||[];if(!a)return e;const o=n.replace(a,"");let s=fI.has(t)?1:0;return a!==n&&(s*=100),t+"("+s+o+")"}const mI=/\b([a-z-]*)\(.*?\)/gu,Vf={...or,getAnimatableNone:e=>{const t=e.match(mI);return t?t.map(pI).join(" "):e}},zf={...or,getAnimatableNone:e=>{const t=or.parse(e);return or.createTransformer(e)(t.map(a=>typeof a=="number"?0:typeof a=="object"?{...a,alpha:1}:a))}},bk={..._o,transform:Math.round},gI={rotate:Sa,rotateX:Sa,rotateY:Sa,rotateZ:Sa,scale:kc,scaleX:kc,scaleY:kc,scaleZ:kc,skew:Sa,skewX:Sa,skewY:Sa,distance:_e,translateX:_e,translateY:_e,translateZ:_e,x:_e,y:_e,z:_e,perspective:_e,transformPerspective:_e,opacity:Us,originX:ok,originY:ok,originZ:_e},em={borderWidth:_e,borderTopWidth:_e,borderRightWidth:_e,borderBottomWidth:_e,borderLeftWidth:_e,borderRadius:_e,borderTopLeftRadius:_e,borderTopRightRadius:_e,borderBottomRightRadius:_e,borderBottomLeftRadius:_e,width:_e,maxWidth:_e,height:_e,maxHeight:_e,top:_e,right:_e,bottom:_e,left:_e,inset:_e,insetBlock:_e,insetBlockStart:_e,insetBlockEnd:_e,insetInline:_e,insetInlineStart:_e,insetInlineEnd:_e,padding:_e,paddingTop:_e,paddingRight:_e,paddingBottom:_e,paddingLeft:_e,paddingBlock:_e,paddingBlockStart:_e,paddingBlockEnd:_e,paddingInline:_e,paddingInlineStart:_e,paddingInlineEnd:_e,margin:_e,marginTop:_e,marginRight:_e,marginBottom:_e,marginLeft:_e,marginBlock:_e,marginBlockStart:_e,marginBlockEnd:_e,marginInline:_e,marginInlineStart:_e,marginInlineEnd:_e,fontSize:_e,backgroundPositionX:_e,backgroundPositionY:_e,...gI,zIndex:bk,fillOpacity:Us,strokeOpacity:Us,numOctaves:bk},yI={...em,color:Lt,backgroundColor:Lt,outlineColor:Lt,fill:Lt,stroke:Lt,borderColor:Lt,borderTopColor:Lt,borderRightColor:Lt,borderBottomColor:Lt,borderLeftColor:Lt,filter:Vf,WebkitFilter:Vf,mask:zf,WebkitMask:zf},Lw=e=>yI[e],vI=new Set([Vf,zf]);function Dw(e,t){let n=Lw(e);return vI.has(n)||(n=or),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const kI=new Set(["auto","none","0"]);function _I(e,t,n){let a=0,o;for(;a<e.length&&!o;){const s=e[a];typeof s=="string"&&!kI.has(s)&&go(s).values.length&&(o=e[a]),a++}if(o&&n)for(const s of t)e[s]=Dw(n,o)}class bI extends Yp{constructor(t,n,a,o,s){super(t,n,a,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:a}=this;if(!n||!n.current)return;super.readKeyframes();for(let m=0;m<t.length;m++){let y=t[m];if(typeof y=="string"&&(y=y.trim(),$p(y))){const k=xw(y,n.current);k!==void 0&&(t[m]=k),m===t.length-1&&(this.finalKeyframe=y)}}if(this.resolveNoneKeyframes(),!Sw.has(a)||t.length!==2)return;const[o,s]=t,c=_k(o),u=_k(s),h=ik(o),f=ik(s);if(h!==f&&La[a]){this.needsMeasurement=!0;return}if(c!==u)if(pk(c)&&pk(u))for(let m=0;m<t.length;m++){const y=t[m];typeof y=="string"&&(t[m]=parseFloat(y))}else La[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,a=[];for(let o=0;o<t.length;o++)(t[o]===null||hI(t[o]))&&a.push(o);a.length&&_I(t,a,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:a}=this;if(!t||!t.current)return;a==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=La[a](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(a,o).jump(o,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:a}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=a.length-1,c=a[s];a[s]=La[n](t.measureViewportBox(),window.getComputedStyle(t.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),this.removedTransforms?.length&&this.removedTransforms.forEach(([u,h])=>{t.getValue(u).set(h)}),this.resolveNoneKeyframes()}}function Mw(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let a=document;const o=n?.[e]??a.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(a=>a!=null)}const Iw=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Uc(e){return F0(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:tm}=ew(queueMicrotask,!1),nr={x:!1,y:!1};function Nw(){return nr.x||nr.y}function wI(e){return e==="x"||e==="y"?nr[e]?null:(nr[e]=!0,()=>{nr[e]=!1}):nr.x||nr.y?null:(nr.x=nr.y=!0,()=>{nr.x=nr.y=!1})}function Ow(e,t){const n=Mw(e),a=new AbortController,o={passive:!0,...t,signal:a.signal};return[n,o,()=>a.abort()]}function xI(e){return!(e.pointerType==="touch"||Nw())}function PI(e,t,n={}){const[a,o,s]=Ow(e,n);return a.forEach(c=>{let u=!1,h=!1,f;const m=()=>{c.removeEventListener("pointerleave",x)},y=S=>{f&&(f(S),f=void 0),m()},k=S=>{u=!1,window.removeEventListener("pointerup",k),window.removeEventListener("pointercancel",k),h&&(h=!1,y(S))},w=()=>{u=!0,window.addEventListener("pointerup",k,o),window.addEventListener("pointercancel",k,o)},x=S=>{if(S.pointerType!=="touch"){if(u){h=!0;return}y(S)}},C=S=>{if(!xI(S))return;h=!1;const D=t(c,S);typeof D=="function"&&(f=D,c.addEventListener("pointerleave",x,o))};c.addEventListener("pointerenter",C,o),c.addEventListener("pointerdown",w,o)}),s}const jw=(e,t)=>t?e===t?!0:jw(e,t.parentElement):!1,nm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,SI=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function CI(e){return SI.has(e.tagName)||e.isContentEditable===!0}const TI=new Set(["INPUT","SELECT","TEXTAREA"]);function EI(e){return TI.has(e.tagName)||e.isContentEditable===!0}const Bc=new WeakSet;function wk(e){return t=>{t.key==="Enter"&&e(t)}}function Hh(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const AI=(e,t)=>{const n=e.currentTarget;if(!n)return;const a=wk(()=>{if(Bc.has(n))return;Hh(n,"down");const o=wk(()=>{Hh(n,"up")}),s=()=>Hh(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",a,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",a),t)};function xk(e){return nm(e)&&!Nw()}const Pk=new WeakSet;function RI(e,t,n={}){const[a,o,s]=Ow(e,n),c=u=>{const h=u.currentTarget;if(!xk(u)||Pk.has(u))return;Bc.add(h),n.stopPropagation&&Pk.add(u);const f=t(h,u),m=(w,x)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",k),Bc.has(h)&&Bc.delete(h),xk(w)&&typeof f=="function"&&f(w,{success:x})},y=w=>{m(w,h===window||h===document||n.useGlobalTarget||jw(h,w.target))},k=w=>{m(w,!1)};window.addEventListener("pointerup",y,o),window.addEventListener("pointercancel",k,o)};return a.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",c,o),Uc(u)&&(u.addEventListener("focus",f=>AI(f,o)),!CI(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),s}function rm(e){return F0(e)&&"ownerSVGElement"in e}const Fc=new WeakMap;let Vc;const Uw=(e,t,n)=>(a,o)=>o&&o[0]?o[0][e+"Size"]:rm(a)&&"getBBox"in a?a.getBBox()[t]:a[n],LI=Uw("inline","width","offsetWidth"),DI=Uw("block","height","offsetHeight");function MI({target:e,borderBoxSize:t}){Fc.get(e)?.forEach(n=>{n(e,{get width(){return LI(e,t)},get height(){return DI(e,t)}})})}function II(e){e.forEach(MI)}function NI(){typeof ResizeObserver>"u"||(Vc=new ResizeObserver(II))}function OI(e,t){Vc||NI();const n=Mw(e);return n.forEach(a=>{let o=Fc.get(a);o||(o=new Set,Fc.set(a,o)),o.add(t),Vc?.observe(a)}),()=>{n.forEach(a=>{const o=Fc.get(a);o?.delete(t),o?.size||Vc?.unobserve(a)})}}const zc=new Set;let io;function jI(){io=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};zc.forEach(t=>t(e))},window.addEventListener("resize",io)}function UI(e){return zc.add(e),io||jI(),()=>{zc.delete(e),!zc.size&&typeof io=="function"&&(window.removeEventListener("resize",io),io=void 0)}}function Sk(e,t){return typeof e=="function"?UI(e):OI(e,t)}function BI(e){return rm(e)&&e.tagName==="svg"}const FI=[...Rw,Lt,or],VI=e=>FI.find(Aw(e)),Ck=()=>({translate:0,scale:1,origin:0,originPoint:0}),oo=()=>({x:Ck(),y:Ck()}),Tk=()=>({min:0,max:0}),Ot=()=>({x:Tk(),y:Tk()}),zI=new WeakMap;function Mu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Bs(e){return typeof e=="string"||Array.isArray(e)}const am=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],im=["initial",...am];function Iu(e){return Mu(e.animate)||im.some(t=>Bs(e[t]))}function Bw(e){return!!(Iu(e)||e.variants)}function $I(e,t,n){for(const a in t){const o=t[a],s=n[a];if(Gt(o))e.addValue(a,o);else if(Gt(s))e.addValue(a,yo(o,{owner:e}));else if(s!==o)if(e.hasValue(a)){const c=e.getValue(a);c.liveStyle===!0?c.jump(o):c.hasAnimated||c.set(o)}else{const c=e.getStaticValue(a);e.addValue(a,yo(c!==void 0?c:o,{owner:e}))}}for(const a in n)t[a]===void 0&&e.removeValue(a);return t}const $f={current:null},Fw={current:!1},HI=typeof window<"u";function WI(){if(Fw.current=!0,!!HI)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>$f.current=e.matches;e.addEventListener("change",t),t()}else $f.current=!1}const Ek=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let mu={};function Vw(e){mu=e}function KI(){return mu}class GI{scrapeMotionValuesFromProps(t,n,a){return{}}constructor({parent:t,props:n,presenceContext:a,reducedMotionConfig:o,skipAnimations:s,blockInitialAnimation:c,visualState:u},h={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Yp,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const w=sn.now();this.renderScheduledAt<w&&(this.renderScheduledAt=w,dt.render(this.render,!1,!0))};const{latestValues:f,renderState:m}=u;this.latestValues=f,this.baseTarget={...f},this.initialValues=n.initial?{...f}:{},this.renderState=m,this.parent=t,this.props=n,this.presenceContext=a,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=s,this.options=h,this.blockInitialAnimation=!!c,this.isControllingVariants=Iu(n),this.isVariantNode=Bw(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:y,...k}=this.scrapeMotionValuesFromProps(n,{},this);for(const w in k){const x=k[w];f[w]!==void 0&&Gt(x)&&x.set(f[w])}}mount(t){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,zI.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,a)=>this.bindToMotionValue(a,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Fw.current||WI(),this.shouldReduceMotion=$f.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Na(this.notifyUpdate),Na(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&bw.has(t)&&this.current instanceof HTMLElement){const{factory:c,keyframes:u,times:h,ease:f,duration:m}=n.accelerate,y=new kw({element:this.current,name:t,keyframes:u,times:h,ease:f,duration:Pn(m)}),k=c(y);this.valueSubscriptions.set(t,()=>{k(),y.cancel()});return}const a=wo.has(t);a&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",c=>{this.latestValues[t]=c,this.props.onUpdate&&dt.preRender(this.notifyUpdate),a&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in mu){const n=mu[t];if(!n)continue;const{isEnabled:a,Feature:o}=n;if(!this.features[t]&&o&&a(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ot()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let a=0;a<Ek.length;a++){const o=Ek[a];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,c=t[s];c&&(this.propEventSubscriptions[o]=this.on(o,c))}this.prevMotionValues=$I(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const a=this.values.get(t);n!==a&&(a&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let a=this.values.get(t);return a===void 0&&n!==void 0&&(a=yo(n===null?void 0:n,{owner:this}),this.addValue(t,a)),a}readValue(t,n){let a=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return a!=null&&(typeof a=="string"&&(B0(a)||V0(a))?a=parseFloat(a):!VI(a)&&or.test(n)&&(a=Dw(t,n)),this.setBaseTarget(t,Gt(a)?a.get():a)),Gt(a)?a.get():a}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let a;if(typeof n=="string"||typeof n=="object"){const s=Qp(this.props,n,this.presenceContext?.custom);s&&(a=s[t])}if(n&&a!==void 0)return a;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Gt(o)?o:this.initialValues[t]!==void 0&&a===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Fp),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){tm.render(this.render)}}class zw extends GI{constructor(){super(...arguments),this.KeyframeResolver=bI}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const a=t.style;return a?a[n]:void 0}removeValueFromRenderState(t,{vars:n,style:a}){delete n[t],delete a[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Gt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ja{constructor(t){this.isMounted=!1,this.node=t}update(){}}function $w({top:e,left:t,right:n,bottom:a}){return{x:{min:t,max:n},y:{min:e,max:a}}}function qI({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function YI(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),a=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:a.y,right:a.x}}function Wh(e){return e===void 0||e===1}function Hf({scale:e,scaleX:t,scaleY:n}){return!Wh(e)||!Wh(t)||!Wh(n)}function ti(e){return Hf(e)||Hw(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Hw(e){return Ak(e.x)||Ak(e.y)}function Ak(e){return e&&e!=="0%"}function gu(e,t,n){const a=e-n,o=t*a;return n+o}function Rk(e,t,n,a,o){return o!==void 0&&(e=gu(e,o,a)),gu(e,n,a)+t}function Wf(e,t=0,n=1,a,o){e.min=Rk(e.min,t,n,a,o),e.max=Rk(e.max,t,n,a,o)}function Ww(e,{x:t,y:n}){Wf(e.x,t.translate,t.scale,t.originPoint),Wf(e.y,n.translate,n.scale,n.originPoint)}const Lk=.999999999999,Dk=1.0000000000001;function ZI(e,t,n,a=!1){const o=n.length;if(!o)return;t.x=t.y=1;let s,c;for(let u=0;u<o;u++){s=n[u],c=s.projectionDelta;const{visualElement:h}=s.options;h&&h.props.style&&h.props.style.display==="contents"||(a&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(mr(e.x,-s.scroll.offset.x),mr(e.y,-s.scroll.offset.y)),c&&(t.x*=c.x.scale,t.y*=c.y.scale,Ww(e,c)),a&&ti(s.latestValues)&&$c(e,s.latestValues,s.layout?.layoutBox))}t.x<Dk&&t.x>Lk&&(t.x=1),t.y<Dk&&t.y>Lk&&(t.y=1)}function mr(e,t){e.min+=t,e.max+=t}function Mk(e,t,n,a,o=.5){const s=vt(e.min,e.max,o);Wf(e,t,n,s,a)}function Ik(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function $c(e,t,n){const a=n??e;Mk(e.x,Ik(t.x,a.x),t.scaleX,t.scale,t.originX),Mk(e.y,Ik(t.y,a.y),t.scaleY,t.scale,t.originY)}function Kw(e,t){return $w(YI(e.getBoundingClientRect(),t))}function XI(e,t,n){const a=Kw(e,n),{scroll:o}=t;return o&&(mr(a.x,o.offset.x),mr(a.y,o.offset.y)),a}const QI={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},JI=bo.length;function eN(e,t,n){let a="",o=!0;for(let s=0;s<JI;s++){const c=bo[s],u=e[c];if(u===void 0)continue;let h=!0;if(typeof u=="number")h=u===(c.startsWith("scale")?1:0);else{const f=parseFloat(u);h=c.startsWith("scale")?f===1:f===0}if(!h||n){const f=Iw(u,em[c]);if(!h){o=!1;const m=QI[c]||c;a+=`${m}(${f}) `}n&&(t[c]=f)}}return a=a.trim(),n?a=n(t,o?"":a):o&&(a="none"),a}function om(e,t,n){const{style:a,vars:o,transformOrigin:s}=e;let c=!1,u=!1;for(const h in t){const f=t[h];if(wo.has(h)){c=!0;continue}else if(nw(h)){o[h]=f;continue}else{const m=Iw(f,em[h]);h.startsWith("origin")?(u=!0,s[h]=m):a[h]=m}}if(t.transform||(c||n?a.transform=eN(t,e.transform,n):a.transform&&(a.transform="none")),u){const{originX:h="50%",originY:f="50%",originZ:m=0}=s;a.transformOrigin=`${h} ${f} ${m}`}}function Gw(e,{style:t,vars:n},a,o){const s=e.style;let c;for(c in t)s[c]=t[c];o?.applyProjectionStyles(s,a);for(c in n)s.setProperty(c,n[c])}function Nk(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ps={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_e.test(e))e=parseFloat(e);else return e;const n=Nk(e,t.target.x),a=Nk(e,t.target.y);return`${n}% ${a}%`}},tN={correct:(e,{treeScale:t,projectionDelta:n})=>{const a=e,o=or.parse(e);if(o.length>5)return a;const s=or.createTransformer(e),c=typeof o[0]!="number"?1:0,u=n.x.scale*t.x,h=n.y.scale*t.y;o[0+c]/=u,o[1+c]/=h;const f=vt(u,h,.5);return typeof o[2+c]=="number"&&(o[2+c]/=f),typeof o[3+c]=="number"&&(o[3+c]/=f),s(o)}},Kf={borderRadius:{...ps,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ps,borderTopRightRadius:ps,borderBottomLeftRadius:ps,borderBottomRightRadius:ps,boxShadow:tN};function qw(e,{layout:t,layoutId:n}){return wo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Kf[e]||e==="opacity")}function sm(e,t,n){const a=e.style,o=t?.style,s={};if(!a)return s;for(const c in a)(Gt(a[c])||o&&Gt(o[c])||qw(c,e)||n?.getValue(c)?.liveStyle!==void 0)&&(s[c]=a[c]);return s}function nN(e){return window.getComputedStyle(e)}class rN extends zw{constructor(){super(...arguments),this.type="html",this.renderInstance=Gw}readValueFromInstance(t,n){if(wo.has(n))return this.projection?.isProjecting?Df(n):x2(t,n);{const a=nN(t),o=(nw(n)?a.getPropertyValue(n):a[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Kw(t,n)}build(t,n,a){om(t,n,a.transformTemplate)}scrapeMotionValuesFromProps(t,n,a){return sm(t,n,a)}}const aN={offset:"stroke-dashoffset",array:"stroke-dasharray"},iN={offset:"strokeDashoffset",array:"strokeDasharray"};function oN(e,t,n=1,a=0,o=!0){e.pathLength=1;const s=o?aN:iN;e[s.offset]=`${-a}`,e[s.array]=`${t} ${n}`}const sN=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Yw(e,{attrX:t,attrY:n,attrScale:a,pathLength:o,pathSpacing:s=1,pathOffset:c=0,...u},h,f,m){if(om(e,u,f),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:y,style:k}=e;y.transform&&(k.transform=y.transform,delete y.transform),(k.transform||y.transformOrigin)&&(k.transformOrigin=y.transformOrigin??"50% 50%",delete y.transformOrigin),k.transform&&(k.transformBox=m?.transformBox??"fill-box",delete y.transformBox);for(const w of sN)y[w]!==void 0&&(k[w]=y[w],delete y[w]);t!==void 0&&(y.x=t),n!==void 0&&(y.y=n),a!==void 0&&(y.scale=a),o!==void 0&&oN(y,o,s,c,!1)}const Zw=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Xw=e=>typeof e=="string"&&e.toLowerCase()==="svg";function lN(e,t,n,a){Gw(e,t,void 0,a);for(const o in t.attrs)e.setAttribute(Zw.has(o)?o:Jp(o),t.attrs[o])}function Qw(e,t,n){const a=sm(e,t,n);for(const o in e)if(Gt(e[o])||Gt(t[o])){const s=bo.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;a[s]=e[o]}return a}class cN extends zw{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ot}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(wo.has(n)){const a=Lw(n);return a&&a.default||0}return n=Zw.has(n)?n:Jp(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,a){return Qw(t,n,a)}build(t,n,a){Yw(t,n,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(t,n,a,o){lN(t,n,a,o)}mount(t){this.isSVGTag=Xw(t.tagName),super.mount(t)}}const uN=im.length;function Jw(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Jw(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<uN;n++){const a=im[n],o=e.props[a];(Bs(o)||o===!1)&&(t[a]=o)}return t}function ex(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let a=0;a<n;a++)if(t[a]!==e[a])return!1;return!0}const dN=[...am].reverse(),hN=am.length;function fN(e){return t=>Promise.all(t.map(({animation:n,options:a})=>uI(e,n,a)))}function pN(e){let t=fN(e),n=Ok(),a=!0,o=!1;const s=f=>(m,y)=>{const k=si(e,y,f==="exit"?e.presenceContext?.custom:void 0);if(k){const{transition:w,transitionEnd:x,...C}=k;m={...m,...C,...x}}return m};function c(f){t=f(e)}function u(f){const{props:m}=e,y=Jw(e.parent)||{},k=[],w=new Set;let x={},C=1/0;for(let D=0;D<hN;D++){const L=dN[D],R=n[L],O=m[L]!==void 0?m[L]:y[L],G=Bs(O),W=L===f?R.isActive:null;W===!1&&(C=D);let z=O===y[L]&&O!==m[L]&&G;if(z&&(a||o)&&e.manuallyAnimateOnMount&&(z=!1),R.protectedKeys={...x},!R.isActive&&W===null||!O&&!R.prevProp||Mu(O)||typeof O=="boolean")continue;if(L==="exit"&&R.isActive&&W!==!0){R.prevResolvedValues&&(x={...x,...R.prevResolvedValues});continue}const P=mN(R.prevProp,O);let Y=P||L===f&&R.isActive&&!z&&G||D>C&&G,X=!1;const de=Array.isArray(O)?O:[O];let se=de.reduce(s(L),{});W===!1&&(se={});const{prevResolvedValues:Ae={}}=R,fe={...Ae,...se},le=K=>{Y=!0,w.has(K)&&(X=!0,w.delete(K)),R.needsAnimating[K]=!0;const Z=e.getValue(K);Z&&(Z.liveStyle=!1)};for(const K in fe){const Z=se[K],H=Ae[K];if(x.hasOwnProperty(K))continue;let I=!1;Uf(Z)&&Uf(H)?I=!ex(Z,H):I=Z!==H,I?Z!=null?le(K):w.add(K):Z!==void 0&&w.has(K)?le(K):R.protectedKeys[K]=!0}R.prevProp=O,R.prevResolvedValues=se,R.isActive&&(x={...x,...se}),(a||o)&&e.blockInitialAnimation&&(Y=!1);const pe=z&&P;Y&&(!pe||X)&&k.push(...de.map(K=>{const Z={type:L};if(typeof K=="string"&&(a||o)&&!pe&&e.manuallyAnimateOnMount&&e.parent){const{parent:H}=e,I=si(H,K);if(H.enteringChildren&&I){const{delayChildren:q}=I.transition||{};Z.delay=ww(H.enteringChildren,e,q)}}return{animation:K,options:Z}}))}if(w.size){const D={};if(typeof m.initial!="boolean"){const L=si(e,Array.isArray(m.initial)?m.initial[0]:m.initial);L&&L.transition&&(D.transition=L.transition)}w.forEach(L=>{const R=e.getBaseTarget(L),O=e.getValue(L);O&&(O.liveStyle=!0),D[L]=R??null}),k.push({animation:D})}let S=!!k.length;return a&&(m.initial===!1||m.initial===m.animate)&&!e.manuallyAnimateOnMount&&(S=!1),a=!1,o=!1,S?t(k):Promise.resolve()}function h(f,m){if(n[f].isActive===m)return Promise.resolve();e.variantChildren?.forEach(k=>k.animationState?.setActive(f,m)),n[f].isActive=m;const y=u(f);for(const k in n)n[k].protectedKeys={};return y}return{animateChanges:u,setActive:h,setAnimateFunction:c,getState:()=>n,reset:()=>{n=Ok(),o=!0}}}function mN(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!ex(t,e):!1}function Ja(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ok(){return{animate:Ja(!0),whileInView:Ja(),whileHover:Ja(),whileTap:Ja(),whileDrag:Ja(),whileFocus:Ja(),exit:Ja()}}function Gf(e,t){e.min=t.min,e.max=t.max}function tr(e,t){Gf(e.x,t.x),Gf(e.y,t.y)}function jk(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const tx=1e-4,gN=1-tx,yN=1+tx,nx=.01,vN=0-nx,kN=0+nx;function ln(e){return e.max-e.min}function _N(e,t,n){return Math.abs(e-t)<=n}function Uk(e,t,n,a=.5){e.origin=a,e.originPoint=vt(t.min,t.max,e.origin),e.scale=ln(n)/ln(t),e.translate=vt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=gN&&e.scale<=yN||isNaN(e.scale))&&(e.scale=1),(e.translate>=vN&&e.translate<=kN||isNaN(e.translate))&&(e.translate=0)}function Es(e,t,n,a){Uk(e.x,t.x,n.x,a?a.originX:void 0),Uk(e.y,t.y,n.y,a?a.originY:void 0)}function Bk(e,t,n,a=0){const o=a?vt(n.min,n.max,a):n.min;e.min=o+t.min,e.max=e.min+ln(t)}function bN(e,t,n,a){Bk(e.x,t.x,n.x,a?.x),Bk(e.y,t.y,n.y,a?.y)}function Fk(e,t,n,a=0){const o=a?vt(n.min,n.max,a):n.min;e.min=t.min-o,e.max=e.min+ln(t)}function yu(e,t,n,a){Fk(e.x,t.x,n.x,a?.x),Fk(e.y,t.y,n.y,a?.y)}function Vk(e,t,n,a,o){return e-=t,e=gu(e,1/n,a),o!==void 0&&(e=gu(e,1/o,a)),e}function wN(e,t=0,n=1,a=.5,o,s=e,c=e){if(vr.test(t)&&(t=parseFloat(t),t=vt(c.min,c.max,t/100)-c.min),typeof t!="number")return;let u=vt(s.min,s.max,a);e===s&&(u-=t),e.min=Vk(e.min,t,n,u,o),e.max=Vk(e.max,t,n,u,o)}function zk(e,t,[n,a,o],s,c){wN(e,t[n],t[a],t[o],t.scale,s,c)}const xN=["x","scaleX","originX"],PN=["y","scaleY","originY"];function $k(e,t,n,a){zk(e.x,t,xN,n?n.x:void 0,a?a.x:void 0),zk(e.y,t,PN,n?n.y:void 0,a?a.y:void 0)}function Hk(e){return e.translate===0&&e.scale===1}function rx(e){return Hk(e.x)&&Hk(e.y)}function Wk(e,t){return e.min===t.min&&e.max===t.max}function SN(e,t){return Wk(e.x,t.x)&&Wk(e.y,t.y)}function Kk(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ax(e,t){return Kk(e.x,t.x)&&Kk(e.y,t.y)}function Gk(e){return ln(e.x)/ln(e.y)}function qk(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function pr(e){return[e("x"),e("y")]}function CN(e,t,n){let a="";const o=e.x.translate/t.x,s=e.y.translate/t.y,c=n?.z||0;if((o||s||c)&&(a=`translate3d(${o}px, ${s}px, ${c}px) `),(t.x!==1||t.y!==1)&&(a+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:f,rotate:m,rotateX:y,rotateY:k,skewX:w,skewY:x}=n;f&&(a=`perspective(${f}px) ${a}`),m&&(a+=`rotate(${m}deg) `),y&&(a+=`rotateX(${y}deg) `),k&&(a+=`rotateY(${k}deg) `),w&&(a+=`skewX(${w}deg) `),x&&(a+=`skewY(${x}deg) `)}const u=e.x.scale*t.x,h=e.y.scale*t.y;return(u!==1||h!==1)&&(a+=`scale(${u}, ${h})`),a||"none"}const ix=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],TN=ix.length,Yk=e=>typeof e=="string"?parseFloat(e):e,Zk=e=>typeof e=="number"||_e.test(e);function EN(e,t,n,a,o,s){o?(e.opacity=vt(0,n.opacity??1,AN(a)),e.opacityExit=vt(t.opacity??1,0,RN(a))):s&&(e.opacity=vt(t.opacity??1,n.opacity??1,a));for(let c=0;c<TN;c++){const u=ix[c];let h=Xk(t,u),f=Xk(n,u);if(h===void 0&&f===void 0)continue;h||(h=0),f||(f=0),h===0||f===0||Zk(h)===Zk(f)?(e[u]=Math.max(vt(Yk(h),Yk(f),a),0),(vr.test(f)||vr.test(h))&&(e[u]+="%")):e[u]=f}(t.rotate||n.rotate)&&(e.rotate=vt(t.rotate||0,n.rotate||0,a))}function Xk(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const AN=ox(0,.5,Z0),RN=ox(.5,.95,jn);function ox(e,t,n){return a=>a<e?0:a>t?1:n(js(e,t,a))}function LN(e,t,n){const a=Gt(e)?e:yo(e);return a.start(Xp("",a,t,n)),a.animation}function Fs(e,t,n,a={passive:!0}){return e.addEventListener(t,n,a),()=>e.removeEventListener(t,n)}const DN=(e,t)=>e.depth-t.depth;class MN{constructor(){this.children=[],this.isDirty=!1}add(t){Up(this.children,t),this.isDirty=!0}remove(t){uu(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(DN),this.isDirty=!1,this.children.forEach(t)}}function IN(e,t){const n=sn.now(),a=({timestamp:o})=>{const s=o-n;s>=t&&(Na(a),e(s-t))};return dt.setup(a,!0),()=>Na(a)}function Hc(e){return Gt(e)?e.get():e}class NN{constructor(){this.members=[]}add(t){Up(this.members,t);for(let n=this.members.length-1;n>=0;n--){const a=this.members[n];if(a===t||a===this.lead||a===this.prevLead)continue;const o=a.instance;(!o||o.isConnected===!1)&&!a.snapshot&&(uu(this.members,a),a.unmount())}t.scheduleRender()}remove(t){if(uu(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){for(let n=this.members.indexOf(t)-1;n>=0;n--){const a=this.members[n];if(a.isPresent!==!1&&a.instance?.isConnected!==!1)return this.promote(a),!0}return!1}promote(t,n){const a=this.lead;if(t!==a&&(this.prevLead=a,this.lead=t,t.show(),a)){a.updateSnapshot(),t.scheduleRender();const{layoutDependency:o}=a.options,{layoutDependency:s}=t.options;(o===void 0||o!==s)&&(t.resumeFrom=a,n&&(a.preserveOpacity=!0),a.snapshot&&(t.snapshot=a.snapshot,t.snapshot.latestValues=a.animationValues||a.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&a.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Wc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Kh=["","X","Y","Z"],ON=1e3;let jN=0;function Gh(e,t,n,a){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),a&&(a[e]=0))}function sx(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Tw(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",dt,!(o||s))}const{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&sx(a)}function lx({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:a,resetTransform:o}){return class{constructor(c={},u=t?.()){this.id=jN++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(FN),this.nodes.forEach(KN),this.nodes.forEach(GN),this.nodes.forEach(VN)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new MN)}addEventListener(c,u){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new Fp),this.eventHandlers.get(c).add(u)}notifyListeners(c,...u){const h=this.eventHandlers.get(c);h&&h.notify(...u)}hasListeners(c){return this.eventHandlers.has(c)}mount(c){if(this.instance)return;this.isSVG=rm(c)&&!BI(c),this.instance=c;const{layoutId:u,layout:h,visualElement:f}=this.options;if(f&&!f.current&&f.mount(c),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||u)&&(this.isLayoutDirty=!0),e){let m,y=0;const k=()=>this.root.updateBlockedByResize=!1;dt.read(()=>{y=window.innerWidth}),e(c,()=>{const w=window.innerWidth;w!==y&&(y=w,this.root.updateBlockedByResize=!0,m&&m(),m=IN(k,250),Wc.hasAnimatedSinceResize&&(Wc.hasAnimatedSinceResize=!1,this.nodes.forEach(e_)))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&f&&(u||h)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:y,hasRelativeLayoutChanged:k,layout:w})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||f.getDefaultTransition()||QN,{onLayoutAnimationStart:C,onLayoutAnimationComplete:S}=f.getProps(),D=!this.targetLayout||!ax(this.targetLayout,w),L=!y&&k;if(this.options.layoutRoot||this.resumeFrom||L||y&&(D||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const R={...Zp(x,"layout"),onPlay:C,onComplete:S};(f.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R),this.setAnimationOrigin(m,L)}else y||e_(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=w})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const c=this.getStack();c&&c.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Na(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(qN),this.animationId++)}getTransformTemplate(){const{visualElement:c}=this.options;return c&&c.getProps().transformTemplate}willUpdate(c=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&sx(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m<this.path.length;m++){const y=this.path[m];y.shouldResetTransform=!0,(typeof y.latestValues.x=="string"||typeof y.latestValues.y=="string")&&(y.isLayoutDirty=!0),y.updateScroll("snapshot"),y.options.layoutRoot&&y.willUpdate(!1)}const{layoutId:u,layout:h}=this.options;if(u===void 0&&!h)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),c&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const h=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),h&&this.nodes.forEach($N),this.nodes.forEach(Qk);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Jk);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(HN),this.nodes.forEach(WN),this.nodes.forEach(UN),this.nodes.forEach(BN)):this.nodes.forEach(Jk),this.clearAllSnapshots();const u=sn.now();Kt.delta=xr(0,1e3/60,u-Kt.timestamp),Kt.timestamp=u,Kt.isProcessing=!0,Uh.update.process(Kt),Uh.preRender.process(Kt),Uh.render.process(Kt),Kt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,tm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(zN),this.sharedNodes.forEach(YN)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,dt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){dt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ln(this.snapshot.measuredBox.x)&&!ln(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let h=0;h<this.path.length;h++)this.path[h].updateScroll();const c=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Ot()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:u}=this.options;u&&u.notify("LayoutMeasure",this.layout.layoutBox,c?c.layoutBox:void 0)}updateScroll(c="measure"){let u=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===c&&(u=!1),u&&this.instance){const h=a(this.instance);this.scroll={animationId:this.root.animationId,phase:c,isRoot:h,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!o)return;const c=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,u=this.projectionDelta&&!rx(this.projectionDelta),h=this.getTransformTemplate(),f=h?h(this.latestValues,""):void 0,m=f!==this.prevTransformTemplateValue;c&&this.instance&&(u||ti(this.latestValues)||m)&&(o(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(c=!0){const u=this.measurePageBox();let h=this.removeElementScroll(u);return c&&(h=this.removeTransform(h)),JN(h),{animationId:this.root.animationId,measuredBox:u,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:c}=this.options;if(!c)return Ot();const u=c.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(eO))){const{scroll:f}=this.root;f&&(mr(u.x,f.offset.x),mr(u.y,f.offset.y))}return u}removeElementScroll(c){const u=Ot();if(tr(u,c),this.scroll?.wasRoot)return u;for(let h=0;h<this.path.length;h++){const f=this.path[h],{scroll:m,options:y}=f;f!==this.root&&m&&y.layoutScroll&&(m.wasRoot&&tr(u,c),mr(u.x,m.offset.x),mr(u.y,m.offset.y))}return u}applyTransform(c,u=!1,h){const f=h||Ot();tr(f,c);for(let m=0;m<this.path.length;m++){const y=this.path[m];!u&&y.options.layoutScroll&&y.scroll&&y!==y.root&&(mr(f.x,-y.scroll.offset.x),mr(f.y,-y.scroll.offset.y)),ti(y.latestValues)&&$c(f,y.latestValues,y.layout?.layoutBox)}return ti(this.latestValues)&&$c(f,this.latestValues,this.layout?.layoutBox),f}removeTransform(c){const u=Ot();tr(u,c);for(let h=0;h<this.path.length;h++){const f=this.path[h];if(!ti(f.latestValues))continue;let m;f.instance&&(Hf(f.latestValues)&&f.updateSnapshot(),m=Ot(),tr(m,f.measurePageBox())),$k(u,f.latestValues,f.snapshot?.layoutBox,m)}return ti(this.latestValues)&&$k(u,this.latestValues),u}setTargetDelta(c){this.targetDelta=c,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(c){this.options={...this.options,...c,crossfade:c.crossfade!==void 0?c.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Kt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(c=!1){const u=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=u.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=u.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=u.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==u;if(!(c||h&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:y}=this.options;if(!this.layout||!(m||y))return;this.resolvedRelativeTargetAt=Kt.timestamp;const k=this.getClosestProjectingParent();k&&this.linkedParentVersion!==k.layoutVersion&&!k.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&k&&k.layout?this.createRelativeTarget(k,this.layout.layoutBox,k.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ot(),this.targetWithTransforms=Ot()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),bN(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):tr(this.target,this.layout.layoutBox),Ww(this.target,this.targetDelta)):tr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&k&&!!k.resumingFrom==!!this.resumingFrom&&!k.options.layoutScroll&&k.target&&this.animationProgress!==1?this.createRelativeTarget(k,this.target,k.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Hf(this.parent.latestValues)||Hw(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(c,u,h){this.relativeParent=c,this.linkedParentVersion=c.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ot(),this.relativeTargetOrigin=Ot(),yu(this.relativeTargetOrigin,u,h,this.options.layoutAnchor||void 0),tr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const c=this.getLead(),u=!!this.resumingFrom||this!==c;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),u&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===Kt.timestamp&&(h=!1),h)return;const{layout:f,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||m))return;tr(this.layoutCorrected,this.layout.layoutBox);const y=this.treeScale.x,k=this.treeScale.y;ZI(this.layoutCorrected,this.treeScale,this.path,u),c.layout&&!c.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(c.target=c.layout.layoutBox,c.targetWithTransforms=Ot());const{target:w}=c;if(!w){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(jk(this.prevProjectionDelta.x,this.projectionDelta.x),jk(this.prevProjectionDelta.y,this.projectionDelta.y)),Es(this.projectionDelta,this.layoutCorrected,w,this.latestValues),(this.treeScale.x!==y||this.treeScale.y!==k||!qk(this.projectionDelta.x,this.prevProjectionDelta.x)||!qk(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",w))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(c=!0){if(this.options.visualElement?.scheduleRender(),c){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=oo(),this.projectionDelta=oo(),this.projectionDeltaWithTransform=oo()}setAnimationOrigin(c,u=!1){const h=this.snapshot,f=h?h.latestValues:{},m={...this.latestValues},y=oo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const k=Ot(),w=h?h.source:void 0,x=this.layout?this.layout.source:void 0,C=w!==x,S=this.getStack(),D=!S||S.members.length<=1,L=!!(C&&!D&&this.options.crossfade===!0&&!this.path.some(XN));this.animationProgress=0;let R;this.mixTargetDelta=O=>{const G=O/1e3;t_(y.x,c.x,G),t_(y.y,c.y,G),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(yu(k,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),ZN(this.relativeTarget,this.relativeTargetOrigin,k,G),R&&SN(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=Ot()),tr(R,this.relativeTarget)),C&&(this.animationValues=m,EN(m,f,this.latestValues,G,L,D)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=G},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Na(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=dt.update(()=>{Wc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=yo(0)),this.motionValue.jump(0,!1),this.currentAnimation=LN(this.motionValue,[0,1e3],{...c,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),c.onUpdate&&c.onUpdate(u)},onStop:()=>{},onComplete:()=>{c.onComplete&&c.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const c=this.getStack();c&&c.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ON),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:u,target:h,layout:f,latestValues:m}=c;if(!(!u||!h||!f)){if(this!==c&&this.layout&&f&&cx(this.options.animationType,this.layout.layoutBox,f.layoutBox)){h=this.target||Ot();const y=ln(this.layout.layoutBox.x);h.x.min=c.target.x.min,h.x.max=h.x.min+y;const k=ln(this.layout.layoutBox.y);h.y.min=c.target.y.min,h.y.max=h.y.min+k}tr(u,h),$c(u,m),Es(this.projectionDeltaWithTransform,this.layoutCorrected,u,m)}}registerSharedNode(c,u){this.sharedNodes.has(c)||this.sharedNodes.set(c,new NN),this.sharedNodes.get(c).add(u);const f=u.options.initialPromotionConfig;u.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(u):void 0})}isLead(){const c=this.getStack();return c?c.lead===this:!0}getLead(){const{layoutId:c}=this.options;return c?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:c}=this.options;return c?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:c}=this.options;if(c)return this.root.sharedNodes.get(c)}promote({needsReset:c,transition:u,preserveFollowOpacity:h}={}){const f=this.getStack();f&&f.promote(this,h),c&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let u=!1;const{latestValues:h}=c;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(u=!0),!u)return;const f={};h.z&&Gh("z",c,f,this.animationValues);for(let m=0;m<Kh.length;m++)Gh(`rotate${Kh[m]}`,c,f,this.animationValues),Gh(`skew${Kh[m]}`,c,f,this.animationValues);c.render();for(const m in f)c.setStaticValue(m,f[m]),this.animationValues&&(this.animationValues[m]=f[m]);c.scheduleRender()}applyProjectionStyles(c,u){if(!this.instance||this.isSVG)return;if(!this.isVisible){c.visibility="hidden";return}const h=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,c.visibility="",c.opacity="",c.pointerEvents=Hc(u?.pointerEvents)||"",c.transform=h?h(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(c.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,c.pointerEvents=Hc(u?.pointerEvents)||""),this.hasProjected&&!ti(this.latestValues)&&(c.transform=h?h({},""):"none",this.hasProjected=!1);return}c.visibility="";const m=f.animationValues||f.latestValues;this.applyTransformsToTarget();let y=CN(this.projectionDeltaWithTransform,this.treeScale,m);h&&(y=h(m,y)),c.transform=y;const{x:k,y:w}=this.projectionDelta;c.transformOrigin=`${k.origin*100}% ${w.origin*100}% 0`,f.animationValues?c.opacity=f===this?m.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:c.opacity=f===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const x in Kf){if(m[x]===void 0)continue;const{correct:C,applyTo:S,isCSSVariable:D}=Kf[x],L=y==="none"?m[x]:C(m[x],f);if(S){const R=S.length;for(let O=0;O<R;O++)c[S[O]]=L}else D?this.options.visualElement.renderState.vars[x]=L:c[x]=L}this.options.layoutId&&(c.pointerEvents=f===this?Hc(u?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>c.currentAnimation?.stop()),this.root.nodes.forEach(Qk),this.root.sharedNodes.clear()}}}function UN(e){e.updateLayout()}function BN(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:a}=e.layout,{animationType:o}=e.options,s=t.source!==e.layout.source;if(o==="size")pr(m=>{const y=s?t.measuredBox[m]:t.layoutBox[m],k=ln(y);y.min=n[m].min,y.max=y.min+k});else if(o==="x"||o==="y"){const m=o==="x"?"y":"x";Gf(s?t.measuredBox[m]:t.layoutBox[m],n[m])}else cx(o,t.layoutBox,n)&&pr(m=>{const y=s?t.measuredBox[m]:t.layoutBox[m],k=ln(n[m]);y.max=y.min+k,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+k)});const c=oo();Es(c,n,t.layoutBox);const u=oo();s?Es(u,e.applyTransform(a,!0),t.measuredBox):Es(u,n,t.layoutBox);const h=!rx(c);let f=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:y,layout:k}=m;if(y&&k){const w=e.options.layoutAnchor||void 0,x=Ot();yu(x,t.layoutBox,y.layoutBox,w);const C=Ot();yu(C,n,k.layoutBox,w),ax(x,C)||(f=!0),m.options.layoutRoot&&(e.relativeTarget=C,e.relativeTargetOrigin=x,e.relativeParent=m)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:u,layoutDelta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:f})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function FN(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function VN(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function zN(e){e.clearSnapshot()}function Qk(e){e.clearMeasurements()}function $N(e){e.isLayoutDirty=!0,e.updateLayout()}function Jk(e){e.isLayoutDirty=!1}function HN(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function WN(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function e_(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function KN(e){e.resolveTargetDelta()}function GN(e){e.calcProjection()}function qN(e){e.resetSkewAndRotation()}function YN(e){e.removeLeadSnapshot()}function t_(e,t,n){e.translate=vt(t.translate,0,n),e.scale=vt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function n_(e,t,n,a){e.min=vt(t.min,n.min,a),e.max=vt(t.max,n.max,a)}function ZN(e,t,n,a){n_(e.x,t.x,n.x,a),n_(e.y,t.y,n.y,a)}function XN(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const QN={duration:.45,ease:[.4,0,.1,1]},r_=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),a_=r_("applewebkit/")&&!r_("chrome/")?Math.round:jn;function i_(e){e.min=a_(e.min),e.max=a_(e.max)}function JN(e){i_(e.x),i_(e.y)}function cx(e,t,n){return e==="position"||e==="preserve-aspect"&&!_N(Gk(t),Gk(n),.2)}function eO(e){return e!==e.root&&e.scroll?.wasRoot}const tO=lx({attachResizeListener:(e,t)=>Fs(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),qh={current:void 0},ux=lx({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!qh.current){const e=new tO({});e.mount(window),e.setOptions({layoutScroll:!0}),qh.current=e}return qh.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),lm=b.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function o_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function nO(...e){return t=>{let n=!1;const a=e.map(o=>{const s=o_(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<a.length;o++){const s=a[o];typeof s=="function"?s():o_(e[o],null)}}}}function rO(...e){return b.useCallback(nO(...e),e)}class aO extends b.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Uc(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const a=n.offsetParent,o=Uc(a)&&a.offsetWidth||0,s=Uc(a)&&a.offsetHeight||0,c=getComputedStyle(n),u=this.props.sizeRef.current;u.height=parseFloat(c.height),u.width=parseFloat(c.width),u.top=n.offsetTop,u.left=n.offsetLeft,u.right=o-u.width-u.left,u.bottom=s-u.height-u.top}return null}componentDidUpdate(){}render(){return this.props.children}}function iO({children:e,isPresent:t,anchorX:n,anchorY:a,root:o,pop:s}){const c=b.useId(),u=b.useRef(null),h=b.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:f}=b.useContext(lm),m=e.props?.ref??e?.ref,y=rO(u,m);return b.useInsertionEffect(()=>{const{width:k,height:w,top:x,left:C,right:S,bottom:D}=h.current;if(t||s===!1||!u.current||!k||!w)return;const L=n==="left"?`left: ${C}`:`right: ${S}`,R=a==="bottom"?`bottom: ${D}`:`top: ${x}`;u.current.dataset.motionPopId=c;const O=document.createElement("style");f&&(O.nonce=f);const G=o??document.head;return G.appendChild(O),O.sheet&&O.sheet.insertRule(`
830
835
  [data-motion-pop-id="${c}"] {
831
836
  position: absolute !important;
832
837
  width: ${k}px !important;
@@ -834,4 +839,4 @@ leaderboard.profile_modal.providers.none,dashboard,LeaderboardProfileModal,Provi
834
839
  ${L}px !important;
835
840
  ${R}px !important;
836
841
  }
837
- `),()=>{u.current?.removeAttribute("data-motion-pop-id"),W.contains(O)&&W.removeChild(O)}},[t]),N.jsx(eO,{isPresent:t,childRef:u,sizeRef:h,pop:o,children:o===!1?e:b.cloneElement(e,{ref:y})})}const nO=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:s,presenceAffectsLayout:o,mode:c,anchorX:u,anchorY:h,root:f})=>{const m=jp(rO),y=b.useId();let k=!0,w=b.useMemo(()=>(k=!1,{id:y,initial:t,isPresent:n,custom:s,onExitComplete:P=>{m.set(P,!0);for(const C of m.values())if(!C)return;a&&a()},register:P=>(m.set(P,!1),()=>m.delete(P))}),[n,m,a]);return o&&k&&(w={...w}),b.useMemo(()=>{m.forEach((P,C)=>m.set(C,!1))},[n]),b.useEffect(()=>{!n&&!m.size&&a&&a()},[n]),e=N.jsx(tO,{pop:c==="popLayout",isPresent:n,anchorX:u,anchorY:h,root:f,children:e}),N.jsx(Lu.Provider,{value:w,children:e})};function rO(){return new Map}function cx(e=!0){const t=b.useContext(Lu);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:s}=t,o=b.useId();b.useEffect(()=>{if(e)return s(o)},[e]);const c=b.useCallback(()=>e&&a&&a(o),[o,a,e]);return!n&&a?[!1,c]:[!0]}const kc=e=>e.key||"";function o_(e){const t=[];return b.Children.forEach(e,n=>{b.isValidElement(n)&&t.push(n)}),t}const aO=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:s=!0,mode:o="sync",propagate:c=!1,anchorX:u="left",anchorY:h="top",root:f})=>{const[m,y]=cx(c),k=b.useMemo(()=>o_(e),[e]),w=c&&!m?[]:k.map(kc),P=b.useRef(!0),C=b.useRef(k),S=jp(()=>new Map),D=b.useRef(new Set),[L,R]=b.useState(k),[O,W]=b.useState(k);O0(()=>{P.current=!1,C.current=k;for(let x=0;x<O.length;x++){const Y=kc(O[x]);w.includes(Y)?(S.delete(Y),D.current.delete(Y)):S.get(Y)!==!0&&S.set(Y,!1)}},[O,w.length,w.join("-")]);const K=[];if(k!==L){let x=[...k];for(let Y=0;Y<O.length;Y++){const X=O[Y],le=kc(X);w.includes(le)||(x.splice(Y,0,X),K.push(X))}return o==="wait"&&K.length&&(x=K),W(o_(x)),R(k),null}const{forceRender:$}=b.useContext(Op);return N.jsx(N.Fragment,{children:O.map(x=>{const Y=kc(x),X=c&&!m?!1:k===O||w.includes(Y),le=()=>{if(D.current.has(Y))return;if(S.has(Y))D.current.add(Y),S.set(Y,!0);else return;let oe=!0;S.forEach(Ae=>{Ae||(oe=!1)}),oe&&($?.(),W(C.current),c&&y?.(),a&&a())};return N.jsx(nO,{isPresent:X,initial:!P.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:f,onExitComplete:X?void 0:le,anchorX:u,anchorY:h,children:x},Y)})})},ux=b.createContext({strict:!1}),l_={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let c_=!1;function iO(){if(c_)return;const e={};for(const t in l_)e[t]={isEnabled:n=>l_[t].some(a=>!!n[a])};Bw(e),c_=!0}function dx(){return iO(),zI()}function sO(e){const t=dx();for(const n in e)t[n]={...t[n],...e[n]};Bw(t)}const oO=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function yu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||oO.has(e)}let hx=e=>!yu(e);function lO(e){typeof e=="function"&&(hx=t=>t.startsWith("on")?!yu(t):e(t))}try{lO(require("@emotion/is-prop-valid").default)}catch{}function cO(e,t,n){const a={};for(const s in e)s==="values"&&typeof e.values=="object"||Gt(e[s])||(hx(s)||n===!0&&yu(s)||!t&&!yu(s)||e.draggable&&s.startsWith("onDrag"))&&(a[s]=e[s]);return a}const Nu=b.createContext({});function uO(e,t){if(Iu(e)){const{initial:n,animate:a}=e;return{initial:n===!1||Bo(n)?n:void 0,animate:Bo(a)?a:void 0}}return e.inherit!==!1?t:{}}function dO(e){const{initial:t,animate:n}=uO(e,b.useContext(Nu));return b.useMemo(()=>({initial:t,animate:n}),[u_(t),u_(n)])}function u_(e){return Array.isArray(e)?e.join(" "):e}const cm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function fx(e,t,n){for(const a in t)!Gt(t[a])&&!Kw(a,n)&&(e[a]=t[a])}function hO({transformTemplate:e},t){return b.useMemo(()=>{const n=cm();return sm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function fO(e,t){const n=e.style||{},a={};return fx(a,n,e),Object.assign(a,hO(e,t)),a}function pO(e,t){const n={},a=fO(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=a,n}const px=()=>({...cm(),attrs:{}});function mO(e,t,n,a){const s=b.useMemo(()=>{const o=px();return Gw(o,t,Yw(a),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};fx(o,e.style,e),s.style={...o,...s.style}}return s}const gO=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function um(e){return typeof e!="string"||e.includes("-")?!1:!!(gO.indexOf(e)>-1||/[A-Z]/u.test(e))}function yO(e,t,n,{latestValues:a},s,o=!1,c){const h=(c??um(e)?mO:pO)(t,a,s,e),f=cO(t,typeof e=="string",o),m=e!==b.Fragment?{...f,...h,ref:n}:{},{children:y}=t,k=b.useMemo(()=>Gt(y)?y.get():y,[y]);return b.createElement(e,{...m,children:k})}function vO({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,s){return{latestValues:kO(n,a,s,e),renderState:t()}}function kO(e,t,n,a){const s={},o=a(e,{});for(const k in o)s[k]=$c(o[k]);let{initial:c,animate:u}=e;const h=Iu(e),f=jw(e);t&&f&&!h&&e.inherit!==!1&&(c===void 0&&(c=t.initial),u===void 0&&(u=t.animate));let m=n?n.initial===!1:!1;m=m||c===!1;const y=m?u:c;if(y&&typeof y!="boolean"&&!Mu(y)){const k=Array.isArray(y)?y:[y];for(let w=0;w<k.length;w++){const P=Qp(e,k[w]);if(P){const{transitionEnd:C,transition:S,...D}=P;for(const L in D){let R=D[L];if(Array.isArray(R)){const O=m?R.length-1:0;R=R[O]}R!==null&&(s[L]=R)}for(const L in C)s[L]=C[L]}}}return s}const mx=e=>(t,n)=>{const a=b.useContext(Nu),s=b.useContext(Lu),o=()=>vO(e,t,a,s);return n?o():jp(o)},_O=mx({scrapeMotionValuesFromProps:om,createRenderState:cm}),bO=mx({scrapeMotionValuesFromProps:Zw,createRenderState:px}),wO=Symbol.for("motionComponentSymbol");function xO(e,t,n){const a=b.useRef(n);b.useInsertionEffect(()=>{a.current=n});const s=b.useRef(null);return b.useCallback(o=>{o&&e.onMount?.(o);const c=a.current;if(typeof c=="function")if(o){const u=c(o);typeof u=="function"&&(s.current=u)}else s.current?(s.current(),s.current=null):c(o);else c&&(c.current=o);t&&(o?t.mount(o):t.unmount())},[t])}const gx=b.createContext({});function ts(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function PO(e,t,n,a,s,o){const{visualElement:c}=b.useContext(Nu),u=b.useContext(ux),h=b.useContext(Lu),f=b.useContext(lm),m=f.reducedMotion,y=f.skipAnimations,k=b.useRef(null),w=b.useRef(!1);a=a||u.renderer,!k.current&&a&&(k.current=a(e,{visualState:t,parent:c,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:m,skipAnimations:y,isSVG:o}),w.current&&k.current&&(k.current.manuallyAnimateOnMount=!0));const P=k.current,C=b.useContext(gx);P&&!P.projection&&s&&(P.type==="html"||P.type==="svg")&&SO(k.current,n,s,C);const S=b.useRef(!1);b.useInsertionEffect(()=>{P&&S.current&&P.update(n,h)});const D=n[Pw],L=b.useRef(!!D&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(D)&&window.MotionHasOptimisedAnimation?.(D));return O0(()=>{w.current=!0,P&&(S.current=!0,window.MotionIsMounted=!0,P.updateFeatures(),P.scheduleRenderMicrotask(),L.current&&P.animationState&&P.animationState.animateChanges())}),b.useEffect(()=>{P&&(!L.current&&P.animationState&&P.animationState.animateChanges(),L.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(D)}),L.current=!1),P.enteringChildren=void 0)}),P}function SO(e,t,n,a){const{layoutId:s,layout:o,drag:c,dragConstraints:u,layoutScroll:h,layoutRoot:f,layoutAnchor:m,layoutCrossfade:y}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:yx(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!c||u&&ts(u),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:a,crossfade:y,layoutScroll:h,layoutRoot:f,layoutAnchor:m})}function yx(e){if(e)return e.options.allowProjection!==!1?e.projection:yx(e.parent)}function Yh(e,{forwardMotionProps:t=!1,type:n}={},a,s){a&&sO(a);const o=n?n==="svg":um(e),c=o?bO:_O;function u(f,m){let y;const k={...b.useContext(lm),...f,layoutId:CO(f)},{isStatic:w}=k,P=dO(f),C=c(f,w);if(!w&&typeof window<"u"){TO();const S=EO(k);y=S.MeasureLayout,P.visualElement=PO(e,C,k,s,S.ProjectionNode,o)}return N.jsxs(Nu.Provider,{value:P,children:[y&&P.visualElement?N.jsx(y,{visualElement:P.visualElement,...k}):null,yO(e,f,xO(C,P.visualElement,m),C,w,t,o)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=b.forwardRef(u);return h[wO]=e,h}function CO({layoutId:e}){const t=b.useContext(Op).id;return t&&e!==void 0?t+"-"+e:e}function TO(e,t){b.useContext(ux).strict}function EO(e){const t=dx(),{drag:n,layout:a}=t;if(!n&&!a)return{};const s={...n,...a};return{MeasureLayout:n?.isEnabled(e)||a?.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function AO(e,t){if(typeof Proxy>"u")return Yh;const n=new Map,a=(o,c)=>Yh(o,c,e,t),s=(o,c)=>a(o,c);return new Proxy(s,{get:(o,c)=>c==="create"?a:(n.has(c)||n.set(c,Yh(c,void 0,e,t)),n.get(c))})}const RO=(e,t)=>t.isSVG??um(e)?new iN(t):new JI(t,{allowProjection:e!==b.Fragment});class LO extends Oa{constructor(t){super(t),t.animationState||(t.animationState=uN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Mu(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let DO=0;class MO extends Oa{constructor(){super(...arguments),this.id=DO++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;if(t&&a===!1){if(this.isExitComplete){const{initial:o,custom:c}=this.node.getProps();if(typeof o=="string"){const u=si(this.node,o,c);if(u){const{transition:h,transitionEnd:f,...m}=u;for(const y in m)this.node.getValue(y)?.jump(m[y])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const IO={animation:{Feature:LO},exit:{Feature:MO}};function tl(e){return{point:{x:e.pageX,y:e.pageY}}}const NO=e=>t=>nm(t)&&e(t,tl(t));function Ao(e,t,n,a){return Fo(e,t,NO(n),a)}const vx=({current:e})=>e?e.ownerDocument.defaultView:null,d_=(e,t)=>Math.abs(e-t);function OO(e,t){const n=d_(e.x,t.x),a=d_(e.y,t.y);return Math.sqrt(n**2+a**2)}const h_=new Set(["auto","scroll"]);class kx{constructor(t,n,{transformPagePoint:a,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:c=3,element:u}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=w=>{this.handleScroll(w.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=_c(this.lastRawMoveEventInfo,this.transformPagePoint));const w=Zh(this.lastMoveEventInfo,this.history),P=this.startEvent!==null,C=OO(w.offset,{x:0,y:0})>=this.distanceThreshold;if(!P&&!C)return;const{point:S}=w,{timestamp:D}=Kt;this.history.push({...S,timestamp:D});const{onStart:L,onMove:R}=this.handlers;P||(L&&L(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),R&&R(this.lastMoveEvent,w)},this.handlePointerMove=(w,P)=>{this.lastMoveEvent=w,this.lastRawMoveEventInfo=P,this.lastMoveEventInfo=_c(P,this.transformPagePoint),dt.update(this.updatePoint,!0)},this.handlePointerUp=(w,P)=>{this.end();const{onEnd:C,onSessionEnd:S,resumeAnimation:D}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&D&&D(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const L=Zh(w.type==="pointercancel"?this.lastMoveEventInfo:_c(P,this.transformPagePoint),this.history);this.startEvent&&C&&C(w,L),S&&S(w,L)},!nm(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=c,this.contextWindow=s||window;const h=tl(t),f=_c(h,this.transformPagePoint),{point:m}=f,{timestamp:y}=Kt;this.history=[{...m,timestamp:y}];const{onSessionStart:k}=n;k&&k(t,Zh(f,this.history)),this.removeListeners=Qo(Ao(this.contextWindow,"pointermove",this.handlePointerMove),Ao(this.contextWindow,"pointerup",this.handlePointerUp),Ao(this.contextWindow,"pointercancel",this.handlePointerUp)),u&&this.startScrollTracking(u)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(h_.has(a.overflowX)||h_.has(a.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const a=t===window,s=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:s.x-n.x,y:s.y-n.y};o.x===0&&o.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,s),dt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ia(this.updatePoint)}}function _c(e,t){return t?{point:t(e.point)}:e}function f_(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Zh({point:e},t){return{point:e,delta:f_(e,_x(t)),offset:f_(e,jO(t)),velocity:UO(t,.1)}}function jO(e){return e[0]}function _x(e){return e[e.length-1]}function UO(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const s=_x(e);for(;n>=0&&(a=e[n],!(s.timestamp-a.timestamp>Pn(t)));)n--;if(!a)return{x:0,y:0};a===e[0]&&e.length>2&&s.timestamp-a.timestamp>Pn(t)*2&&(a=e[1]);const o=On(s.timestamp-a.timestamp);if(o===0)return{x:0,y:0};const c={x:(s.x-a.x)/o,y:(s.y-a.y)/o};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function BO(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?vt(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?vt(n,e,a.max):Math.min(e,n)),e}function p_(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function FO(e,{top:t,left:n,bottom:a,right:s}){return{x:p_(e.x,n,s),y:p_(e.y,t,a)}}function m_(e,t){let n=t.min-e.min,a=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,a]=[a,n]),{min:n,max:a}}function VO(e,t){return{x:m_(e.x,t.x),y:m_(e.y,t.y)}}function zO(e,t){let n=.5;const a=ln(e),s=ln(t);return s>a?n=jo(t.min,t.max-a,e.min):a>s&&(n=jo(e.min,e.max-s,t.min)),xr(0,1,n)}function $O(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const qf=.35;function HO(e=qf){return e===!1?e=0:e===!0&&(e=qf),{x:g_(e,"left","right"),y:g_(e,"top","bottom")}}function g_(e,t,n){return{min:y_(e,t),max:y_(e,n)}}function y_(e,t){return typeof e=="number"?e:e[t]||0}const WO=new WeakMap;class KO{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ot(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=y=>{n&&this.snapToCursor(tl(y).point),this.stopAnimation()},c=(y,k)=>{const{drag:w,dragPropagation:P,onDragStart:C}=this.getProps();if(w&&!P&&(this.openDragLock&&this.openDragLock(),this.openDragLock=vI(w),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=k,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),pr(D=>{let L=this.getAxisMotionValue(D).get()||0;if(vr.test(L)){const{projection:R}=this.visualElement;if(R&&R.layout){const O=R.layout.layoutBox[D];O&&(L=ln(O)*(parseFloat(L)/100))}}this.originPoint[D]=L}),C&&dt.update(()=>C(y,k),!1,!0),Bf(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},u=(y,k)=>{this.latestPointerEvent=y,this.latestPanInfo=k;const{dragPropagation:w,dragDirectionLock:P,onDirectionLock:C,onDrag:S}=this.getProps();if(!w&&!this.openDragLock)return;const{offset:D}=k;if(P&&this.currentDirection===null){this.currentDirection=qO(D),this.currentDirection!==null&&C&&C(this.currentDirection);return}this.updateAxis("x",k.point,D),this.updateAxis("y",k.point,D),this.visualElement.render(),S&&dt.update(()=>S(y,k),!1,!0)},h=(y,k)=>{this.latestPointerEvent=y,this.latestPanInfo=k,this.stop(y,k),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:y}=this.getProps();(y||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new kx(t,{onSessionStart:o,onStart:c,onMove:u,onSessionEnd:h,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:a,contextWindow:vx(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,s=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!a)return;const{velocity:c}=s;this.startAnimation(c);const{onDragEnd:u}=this.getProps();u&&dt.postRender(()=>u(a,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,a){const{drag:s}=this.getProps();if(!a||!bc(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let c=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(c=BO(c,this.constraints[t],this.elastic[t])),o.set(c)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;t&&ts(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=FO(a.layoutBox,t):this.constraints=!1,this.elastic=HO(n),s!==this.constraints&&!ts(t)&&a&&this.constraints&&!this.hasMutatedConstraints&&pr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=$O(a.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ts(t))return!1;const a=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=GI(a,s.root,this.visualElement.getTransformPagePoint());let c=VO(s.layout.layoutBox,o);if(n){const u=n(HI(c));this.hasMutatedConstraints=!!u,u&&(c=Vw(u))}return c}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:s,dragTransition:o,dragSnapToOrigin:c,onDragTransitionEnd:u}=this.getProps(),h=this.constraints||{},f=pr(m=>{if(!bc(m,n,this.currentDirection))return;let y=h&&h[m]||{};(c===!0||c===m)&&(y={min:0,max:0});const k=s?200:1e6,w=s?40:1e7,P={type:"inertia",velocity:a?t[m]:0,bounceStiffness:k,bounceDamping:w,timeConstant:750,restDelta:1,restSpeed:10,...o,...y};return this.startAxisValueAnimation(m,P)});return Promise.all(f).then(u)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return Bf(this.visualElement,t),a.start(Xp(t,a,0,n,this.visualElement,!1))}stopAnimation(){pr(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps(),s=a[n];return s||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){pr(n=>{const{drag:a}=this.getProps();if(!bc(n,a,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:c,max:u}=s.layout.layoutBox[n],h=o.get()||0;o.set(t[n]-vt(c,u,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!ts(n)||!a||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};pr(c=>{const u=this.getAxisMotionValue(c);if(u&&this.constraints!==!1){const h=u.get();s[c]=zO({min:h,max:h},this.constraints[c])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),pr(c=>{if(!bc(c,t,null))return;const u=this.getAxisMotionValue(c),{min:h,max:f}=this.constraints[c];u.set(vt(h,f,s[c]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;WO.set(this.visualElement,this);const t=this.visualElement.current,n=Ao(t,"pointerdown",f=>{const{drag:m,dragListener:y=!0}=this.getProps(),k=f.target,w=k!==t&&PI(k);m&&y&&!w&&this.start(f)});let a;const s=()=>{const{dragConstraints:f}=this.getProps();ts(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),a||(a=GO(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,c=o.addEventListener("measure",s);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),dt.read(s);const u=Fo(window,"resize",()=>this.scalePositionWithinConstraints()),h=o.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:m})=>{this.isDragging&&m&&(pr(y=>{const k=this.getAxisMotionValue(y);k&&(this.originPoint[y]+=f[y].translate,k.set(k.get()+f[y].translate))}),this.visualElement.render())}));return()=>{u(),n(),c(),h&&h(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:c=qf,dragMomentum:u=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:s,dragConstraints:o,dragElastic:c,dragMomentum:u}}}function v_(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function GO(e,t,n){const a=Sk(e,v_(n)),s=Sk(t,v_(n));return()=>{a(),s()}}function bc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function qO(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class YO extends Oa{constructor(t){super(t),this.removeGroupControls=jn,this.removeListeners=jn,this.controls=new KO(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||jn}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Xh=e=>(t,n)=>{e&&dt.update(()=>e(t,n),!1,!0)};class ZO extends Oa{constructor(){super(...arguments),this.removePointerDownListener=jn}onPointerDown(t){this.session=new kx(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:vx(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:s}=this.node.getProps();return{onSessionStart:Xh(t),onStart:Xh(n),onMove:Xh(a),onEnd:(o,c)=>{delete this.session,s&&dt.postRender(()=>s(o,c))}}}mount(){this.removePointerDownListener=Ao(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Qh=!1;class XO extends b.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:s}=this.props,{projection:o}=t;o&&(n.group&&n.group.add(o),a&&a.register&&s&&a.register(o),Qh&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Hc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:s,isPresent:o}=this.props,{projection:c}=a;return c&&(c.isPresent=o,t.layoutDependency!==n&&c.setOptions({...c.options,layoutDependency:n}),Qh=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==o?c.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?c.promote():c.relegate()||dt.postRender(()=>{const u=c.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:a}=t;a&&(a.options.layoutAnchor=n,a.root.didUpdate(),tm.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:s}=t;Qh=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),a&&a.deregister&&a.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function bx(e){const[t,n]=cx(),a=b.useContext(Op);return N.jsx(XO,{...e,layoutGroup:a,switchLayoutGroup:b.useContext(gx),isPresent:t,safeToRemove:n})}const QO={pan:{Feature:ZO},drag:{Feature:YO,ProjectionNode:lx,MeasureLayout:bx}};function k_(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=a[s];o&&dt.postRender(()=>o(t,tl(t)))}class JO extends Oa{mount(){const{current:t}=this.node;t&&(this.unmount=_I(t,(n,a)=>(k_(this.node,a,"Start"),s=>k_(this.node,s,"End"))))}unmount(){}}class e3 extends Oa{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Qo(Fo(this.node.current,"focus",()=>this.onFocus()),Fo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function __(e,t,n){const{props:a}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=a[s];o&&dt.postRender(()=>o(t,tl(t)))}class t3 extends Oa{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:a}=this.node.props;this.unmount=CI(t,(s,o)=>(__(this.node,o,"Start"),(c,{success:u})=>__(this.node,c,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:a?.tap===!1})}unmount(){}}const Yf=new WeakMap,Jh=new WeakMap,n3=e=>{const t=Yf.get(e.target);t&&t(e)},r3=e=>{e.forEach(n3)};function a3({root:e,...t}){const n=e||document;Jh.has(n)||Jh.set(n,{});const a=Jh.get(n),s=JSON.stringify(t);return a[s]||(a[s]=new IntersectionObserver(r3,{root:e,...t})),a[s]}function i3(e,t,n){const a=a3(t);return Yf.set(e,n),a.observe(e),()=>{Yf.delete(e),a.unobserve(e)}}const s3={some:0,all:1};class o3 extends Oa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:a,amount:s="some",once:o}=t,c={root:n?n.current:void 0,rootMargin:a,threshold:typeof s=="number"?s:s3[s]},u=h=>{const{isIntersecting:f}=h;if(this.isInView===f||(this.isInView=f,o&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:m,onViewportLeave:y}=this.node.getProps(),k=f?m:y;k&&k(h)};this.stopObserver=i3(this.node.current,c,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(l3(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function l3({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const c3={inView:{Feature:o3},tap:{Feature:t3},focus:{Feature:e3},hover:{Feature:JO}},u3={layout:{ProjectionNode:lx,MeasureLayout:bx}},d3={...IO,...c3,...QO,...u3},ef=AO(d3,RO);function wx(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=wx(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function h3(){for(var e,t,n=0,a="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=wx(e))&&(a&&(a+=" "),a+=t);return a}const f3=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},p3=(e,t)=>({classGroupId:e,validator:t}),xx=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),vu="-",b_=[],m3="arbitrary..",g3=e=>{const t=v3(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return y3(c);const u=c.split(vu),h=u[0]===""&&u.length>1?1:0;return Px(u,h,t)},getConflictingClassGroupIds:(c,u)=>{if(u){const h=a[c],f=n[c];return h?f?f3(f,h):h:f||b_}return n[c]||b_}}},Px=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],o=n.nextPart.get(s);if(o){const f=Px(e,t+1,o);if(f)return f}const c=n.validators;if(c===null)return;const u=t===0?e.join(vu):e.slice(t).join(vu),h=c.length;for(let f=0;f<h;f++){const m=c[f];if(m.validator(u))return m.classGroupId}},y3=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?m3+a:void 0})(),v3=e=>{const{theme:t,classGroups:n}=e;return k3(n,t)},k3=(e,t)=>{const n=xx();for(const a in e){const s=e[a];dm(s,n,a,t)}return n},dm=(e,t,n,a)=>{const s=e.length;for(let o=0;o<s;o++){const c=e[o];_3(c,t,n,a)}},_3=(e,t,n,a)=>{if(typeof e=="string"){b3(e,t,n);return}if(typeof e=="function"){w3(e,t,n,a);return}x3(e,t,n,a)},b3=(e,t,n)=>{const a=e===""?t:Sx(t,e);a.classGroupId=n},w3=(e,t,n,a)=>{if(P3(e)){dm(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(p3(n,e))},x3=(e,t,n,a)=>{const s=Object.entries(e),o=s.length;for(let c=0;c<o;c++){const[u,h]=s[c];dm(h,Sx(t,u),n,a)}},Sx=(e,t)=>{let n=e;const a=t.split(vu),s=a.length;for(let o=0;o<s;o++){const c=a[o];let u=n.nextPart.get(c);u||(u=xx(),n.nextPart.set(c,u)),n=u}return n},P3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,S3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const s=(o,c)=>{n[o]=c,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(o){let c=n[o];if(c!==void 0)return c;if((c=a[o])!==void 0)return s(o,c),c},set(o,c){o in n?n[o]=c:s(o,c)}}},Zf="!",w_=":",C3=[],x_=(e,t,n,a,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:s}),T3=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=s=>{const o=[];let c=0,u=0,h=0,f;const m=s.length;for(let C=0;C<m;C++){const S=s[C];if(c===0&&u===0){if(S===w_){o.push(s.slice(h,C)),h=C+1;continue}if(S==="/"){f=C;continue}}S==="["?c++:S==="]"?c--:S==="("?u++:S===")"&&u--}const y=o.length===0?s:s.slice(h);let k=y,w=!1;y.endsWith(Zf)?(k=y.slice(0,-1),w=!0):y.startsWith(Zf)&&(k=y.slice(1),w=!0);const P=f&&f>h?f-h:void 0;return x_(o,w,k,P)};if(t){const s=t+w_,o=a;a=c=>c.startsWith(s)?o(c.slice(s.length)):x_(C3,!1,c,void 0,!0)}if(n){const s=a;a=o=>n({className:o,parseClassName:s})}return a},E3=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let s=[];for(let o=0;o<n.length;o++){const c=n[o],u=c[0]==="[",h=t.has(c);u||h?(s.length>0&&(s.sort(),a.push(...s),s=[]),a.push(c)):s.push(c)}return s.length>0&&(s.sort(),a.push(...s)),a}},A3=e=>({cache:S3(e.cacheSize),parseClassName:T3(e),sortModifiers:E3(e),...g3(e)}),R3=/\s+/,L3=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:o}=t,c=[],u=e.trim().split(R3);let h="";for(let f=u.length-1;f>=0;f-=1){const m=u[f],{isExternal:y,modifiers:k,hasImportantModifier:w,baseClassName:P,maybePostfixModifierPosition:C}=n(m);if(y){h=m+(h.length>0?" "+h:h);continue}let S=!!C,D=a(S?P.substring(0,C):P);if(!D){if(!S){h=m+(h.length>0?" "+h:h);continue}if(D=a(P),!D){h=m+(h.length>0?" "+h:h);continue}S=!1}const L=k.length===0?"":k.length===1?k[0]:o(k).join(":"),R=w?L+Zf:L,O=R+D;if(c.indexOf(O)>-1)continue;c.push(O);const W=s(D,S);for(let K=0;K<W.length;++K){const $=W[K];c.push(R+$)}h=m+(h.length>0?" "+h:h)}return h},D3=(...e)=>{let t=0,n,a,s="";for(;t<e.length;)(n=e[t++])&&(a=Cx(n))&&(s&&(s+=" "),s+=a);return s},Cx=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=Cx(e[a]))&&(n&&(n+=" "),n+=t);return n},M3=(e,...t)=>{let n,a,s,o;const c=h=>{const f=t.reduce((m,y)=>y(m),e());return n=A3(f),a=n.cache.get,s=n.cache.set,o=u,u(h)},u=h=>{const f=a(h);if(f)return f;const m=L3(h,n);return s(h,m),m};return o=c,(...h)=>o(D3(...h))},I3=[],Nt=e=>{const t=n=>n[e]||I3;return t.isThemeGetter=!0,t},Tx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ex=/^\((?:(\w[\w-]*):)?(.+)\)$/i,N3=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,O3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,j3=/\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$/,U3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,B3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,F3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wa=e=>N3.test(e),qe=e=>!!e&&!Number.isNaN(Number(e)),xa=e=>!!e&&Number.isInteger(Number(e)),tf=e=>e.endsWith("%")&&qe(e.slice(0,-1)),Fr=e=>O3.test(e),Ax=()=>!0,V3=e=>j3.test(e)&&!U3.test(e),hm=()=>!1,z3=e=>B3.test(e),$3=e=>F3.test(e),H3=e=>!ke(e)&&!be(e),W3=e=>ja(e,Dx,hm),ke=e=>Tx.test(e),Ja=e=>ja(e,Mx,V3),P_=e=>ja(e,J3,qe),K3=e=>ja(e,Nx,Ax),G3=e=>ja(e,Ix,hm),S_=e=>ja(e,Rx,hm),q3=e=>ja(e,Lx,$3),wc=e=>ja(e,Ox,z3),be=e=>Ex.test(e),mo=e=>gi(e,Mx),Y3=e=>gi(e,Ix),C_=e=>gi(e,Rx),Z3=e=>gi(e,Dx),X3=e=>gi(e,Lx),xc=e=>gi(e,Ox,!0),Q3=e=>gi(e,Nx,!0),ja=(e,t,n)=>{const a=Tx.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},gi=(e,t,n=!1)=>{const a=Ex.exec(e);return a?a[1]?t(a[1]):n:!1},Rx=e=>e==="position"||e==="percentage",Lx=e=>e==="image"||e==="url",Dx=e=>e==="length"||e==="size"||e==="bg-size",Mx=e=>e==="length",J3=e=>e==="number",Ix=e=>e==="family-name",Nx=e=>e==="number"||e==="weight",Ox=e=>e==="shadow",ej=()=>{const e=Nt("color"),t=Nt("font"),n=Nt("text"),a=Nt("font-weight"),s=Nt("tracking"),o=Nt("leading"),c=Nt("breakpoint"),u=Nt("container"),h=Nt("spacing"),f=Nt("radius"),m=Nt("shadow"),y=Nt("inset-shadow"),k=Nt("text-shadow"),w=Nt("drop-shadow"),P=Nt("blur"),C=Nt("perspective"),S=Nt("aspect"),D=Nt("ease"),L=Nt("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],W=()=>[...O(),be,ke],K=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],x=()=>[be,ke,h],Y=()=>[wa,"full","auto",...x()],X=()=>[xa,"none","subgrid",be,ke],le=()=>["auto",{span:["full",xa,be,ke]},xa,be,ke],oe=()=>[xa,"auto",be,ke],Ae=()=>["auto","min","max","fr",be,ke],de=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],fe=()=>["start","end","center","stretch","center-safe","end-safe"],ye=()=>["auto",...x()],Ne=()=>[wa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],G=()=>[wa,"screen","full","dvw","lvw","svw","min","max","fit",...x()],Z=()=>[wa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...x()],H=()=>[e,be,ke],I=()=>[...O(),C_,S_,{position:[be,ke]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],xe=()=>["auto","cover","contain",Z3,W3,{size:[be,ke]}],Re=()=>[tf,mo,Ja],Pe=()=>["","none","full",f,be,ke],Te=()=>["",qe,mo,Ja],Ge=()=>["solid","dashed","dotted","double"],Qe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ue=()=>[qe,tf,C_,S_],jt=()=>["","none",P,be,ke],$n=()=>["none",qe,be,ke],Cr=()=>["none",qe,be,ke],pt=()=>[qe,be,ke],en=()=>[wa,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fr],breakpoint:[Fr],color:[Ax],container:[Fr],"drop-shadow":[Fr],ease:["in","out","in-out"],font:[H3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fr],shadow:[Fr],spacing:["px",qe],text:[Fr],"text-shadow":[Fr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wa,ke,be,S]}],container:["container"],columns:[{columns:[qe,ke,be,u]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:W()}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{"inset-s":Y(),start:Y()}],end:[{"inset-e":Y(),end:Y()}],"inset-bs":[{"inset-bs":Y()}],"inset-be":[{"inset-be":Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[xa,"auto",be,ke]}],basis:[{basis:[wa,"full","auto",u,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,wa,"auto","initial","none",ke]}],grow:[{grow:["",qe,be,ke]}],shrink:[{shrink:["",qe,be,ke]}],order:[{order:[xa,"first","last","none",be,ke]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:le()}],"col-start":[{"col-start":oe()}],"col-end":[{"col-end":oe()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:le()}],"row-start":[{"row-start":oe()}],"row-end":[{"row-end":oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ae()}],"auto-rows":[{"auto-rows":Ae()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:[...de(),"normal"]}],"justify-items":[{"justify-items":[...fe(),"normal"]}],"justify-self":[{"justify-self":["auto",...fe()]}],"align-content":[{content:["normal",...de()]}],"align-items":[{items:[...fe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...fe(),{baseline:["","last"]}]}],"place-content":[{"place-content":de()}],"place-items":[{"place-items":[...fe(),"baseline"]}],"place-self":[{"place-self":["auto",...fe()]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pbs:[{pbs:x()}],pbe:[{pbe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:ye()}],mx:[{mx:ye()}],my:[{my:ye()}],ms:[{ms:ye()}],me:[{me:ye()}],mbs:[{mbs:ye()}],mbe:[{mbe:ye()}],mt:[{mt:ye()}],mr:[{mr:ye()}],mb:[{mb:ye()}],ml:[{ml:ye()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:Ne()}],"inline-size":[{inline:["auto",...G()]}],"min-inline-size":[{"min-inline":["auto",...G()]}],"max-inline-size":[{"max-inline":["none",...G()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[u,"screen",...Ne()]}],"min-w":[{"min-w":[u,"screen","none",...Ne()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[c]},...Ne()]}],h:[{h:["screen","lh",...Ne()]}],"min-h":[{"min-h":["screen","lh","none",...Ne()]}],"max-h":[{"max-h":["screen","lh",...Ne()]}],"font-size":[{text:["base",n,mo,Ja]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Q3,K3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tf,ke]}],"font-family":[{font:[Y3,G3,t]}],"font-features":[{"font-features":[ke]}],"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:[s,be,ke]}],"line-clamp":[{"line-clamp":[qe,"none",be,P_]}],leading:[{leading:[o,...x()]}],"list-image":[{"list-image":["none",be,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",be,Ja]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[qe,"auto",be,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,ke]}],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",be,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:xe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xa,be,ke],radial:["",be,ke],conic:[xa,be,ke]},X3,q3]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:Re()}],"gradient-via-pos":[{via:Re()}],"gradient-to-pos":[{to:Re()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:Pe()}],"rounded-s":[{"rounded-s":Pe()}],"rounded-e":[{"rounded-e":Pe()}],"rounded-t":[{"rounded-t":Pe()}],"rounded-r":[{"rounded-r":Pe()}],"rounded-b":[{"rounded-b":Pe()}],"rounded-l":[{"rounded-l":Pe()}],"rounded-ss":[{"rounded-ss":Pe()}],"rounded-se":[{"rounded-se":Pe()}],"rounded-ee":[{"rounded-ee":Pe()}],"rounded-es":[{"rounded-es":Pe()}],"rounded-tl":[{"rounded-tl":Pe()}],"rounded-tr":[{"rounded-tr":Pe()}],"rounded-br":[{"rounded-br":Pe()}],"rounded-bl":[{"rounded-bl":Pe()}],"border-w":[{border:Te()}],"border-w-x":[{"border-x":Te()}],"border-w-y":[{"border-y":Te()}],"border-w-s":[{"border-s":Te()}],"border-w-e":[{"border-e":Te()}],"border-w-bs":[{"border-bs":Te()}],"border-w-be":[{"border-be":Te()}],"border-w-t":[{"border-t":Te()}],"border-w-r":[{"border-r":Te()}],"border-w-b":[{"border-b":Te()}],"border-w-l":[{"border-l":Te()}],"divide-x":[{"divide-x":Te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ge(),"hidden","none"]}],"divide-style":[{divide:[...Ge(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-bs":[{"border-bs":H()}],"border-color-be":[{"border-be":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...Ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,be,ke]}],"outline-w":[{outline:["",qe,mo,Ja]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",m,xc,wc]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",y,xc,wc]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:Te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[qe,Ja]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":Te()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",k,xc,wc]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[qe,be,ke]}],"mix-blend":[{"mix-blend":[...Qe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Qe()}],"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":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ue()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":Ue()}],"mask-image-t-to-pos":[{"mask-t-to":Ue()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":Ue()}],"mask-image-r-to-pos":[{"mask-r-to":Ue()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":Ue()}],"mask-image-b-to-pos":[{"mask-b-to":Ue()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":Ue()}],"mask-image-l-to-pos":[{"mask-l-to":Ue()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":Ue()}],"mask-image-x-to-pos":[{"mask-x-to":Ue()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":Ue()}],"mask-image-y-to-pos":[{"mask-y-to":Ue()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[be,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ue()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"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":O()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ue()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:xe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,ke]}],filter:[{filter:["","none",be,ke]}],blur:[{blur:jt()}],brightness:[{brightness:[qe,be,ke]}],contrast:[{contrast:[qe,be,ke]}],"drop-shadow":[{"drop-shadow":["","none",w,xc,wc]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",qe,be,ke]}],"hue-rotate":[{"hue-rotate":[qe,be,ke]}],invert:[{invert:["",qe,be,ke]}],saturate:[{saturate:[qe,be,ke]}],sepia:[{sepia:["",qe,be,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",be,ke]}],"backdrop-blur":[{"backdrop-blur":jt()}],"backdrop-brightness":[{"backdrop-brightness":[qe,be,ke]}],"backdrop-contrast":[{"backdrop-contrast":[qe,be,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,be,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,be,ke]}],"backdrop-invert":[{"backdrop-invert":["",qe,be,ke]}],"backdrop-opacity":[{"backdrop-opacity":[qe,be,ke]}],"backdrop-saturate":[{"backdrop-saturate":[qe,be,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,be,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",be,ke]}],ease:[{ease:["linear","initial",D,be,ke]}],delay:[{delay:[qe,be,ke]}],animate:[{animate:["none",L,be,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,be,ke]}],"perspective-origin":[{"perspective-origin":W()}],rotate:[{rotate:$n()}],"rotate-x":[{"rotate-x":$n()}],"rotate-y":[{"rotate-y":$n()}],"rotate-z":[{"rotate-z":$n()}],scale:[{scale:Cr()}],"scale-x":[{"scale-x":Cr()}],"scale-y":[{"scale-y":Cr()}],"scale-z":[{"scale-z":Cr()}],"scale-3d":["scale-3d"],skew:[{skew:pt()}],"skew-x":[{"skew-x":pt()}],"skew-y":[{"skew-y":pt()}],transform:[{transform:[be,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:W()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:en()}],"translate-x":[{"translate-x":en()}],"translate-y":[{"translate-y":en()}],"translate-z":[{"translate-z":en()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"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",be,ke]}],"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":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mbs":[{"scroll-mbs":x()}],"scroll-mbe":[{"scroll-mbe":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pbs":[{"scroll-pbs":x()}],"scroll-pbe":[{"scroll-pbe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"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",be,ke]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[qe,mo,Ja,P_]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-bs","border-w-be","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-bs","border-color-be","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-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]}},tj=M3(ej);function Tt(...e){return tj(h3(e))}const nj=N.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[N.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1Z",fill:"#4285F4"}),N.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23Z",fill:"#34A853"}),N.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18A10.96 10.96 0 0 0 1 12c0 1.77.42 3.44 1.18 4.93l3.66-2.84Z",fill:"#FBBC05"}),N.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53Z",fill:"#EA4335"})]}),rj=N.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:N.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12Z"})}),aj={google:nj,github:rj},ij={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",apple:"Apple"};function sj(e){return ij[e]||String(e||"").replace(/-/g," ")}function oj(){Xo();const{isOpen:e,closeLoginModal:t}=N0(),{enabled:n,signedIn:a,refreshUser:s,signInWithPassword:o,signUp:c,signInWithOAuth:u,getPublicAuthConfig:h}=Yo(),[f,m]=b.useState("signin"),[y,k]=b.useState(""),[w,P]=b.useState(""),[C,S]=b.useState(""),[D,L]=b.useState(!1),[R,O]=b.useState(null),[W,K]=b.useState(null),[$,x]=b.useState(!1),[Y,X]=b.useState(!0),[le,oe]=b.useState([]),[Ae,de]=b.useState(8);b.useEffect(()=>{e&&(O(null),K(null),m("signin"),k(""),P(""),S(""),x(!1))},[e]),b.useEffect(()=>{if(!e||!n){X(!1);return}let G=!0;return(async()=>{const{data:Z,error:H}=await h();if(G){if(H||!Z)oe(["google","github"]);else{const I=Array.isArray(Z.oAuthProviders)?Z.oAuthProviders:[],q=Array.isArray(Z.customOAuthProviders)?Z.customOAuthProviders:[];oe([...I,...q]),typeof Z.passwordMinLength=="number"&&Z.passwordMinLength>0&&de(Z.passwordMinLength)}X(!1)}})(),()=>{G=!1}},[e,n,h]),b.useEffect(()=>{e&&a&&t()},[e,a,t]);const fe=b.useMemo(()=>typeof window>"u"?"":!!window.webkit?.messageHandlers?.nativeOAuth?`${window.location.origin}/auth/callback`:`${window.location.origin}/`,[]),ye=b.useCallback(async G=>{O(null),L(!0);try{const{error:Z}=await u(G,fe);Z&&O(Z.message||String(Z))}finally{L(!1)}},[u,fe]),Ne=b.useCallback(async G=>{G.preventDefault(),O(null),L(!0);try{if(f==="signup"){const{data:H,error:I}=await c({email:y.trim(),password:w,name:C.trim()||void 0});if(I){O(I.message||String(I));return}if(H?.requireEmailVerification){K(Fe("login.verify_email_pending")),m("signin");return}await s();return}const{error:Z}=await o({email:y.trim(),password:w});if(Z){O(Z.message||String(Z));return}await s()}finally{L(!1)}},[f,y,w,C,c,o,s]);return b.useEffect(()=>{if(!e)return;const G=Z=>{Z.key==="Escape"&&t()};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[e,t]),n?N.jsx(aO,{children:e&&N.jsxs(ef.div,{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[N.jsx(ef.div,{className:"absolute inset-0 bg-black/40 dark:bg-black/60 ",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),N.jsxs(ef.div,{className:"relative w-full max-w-[420px] rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 p-6 shadow-2xl",initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.2},onClick:G=>G.stopPropagation(),children:[N.jsx("button",{type:"button",onClick:t,className:"absolute right-4 top-4 text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:N.jsx(D0,{className:"h-5 w-5"})}),N.jsxs("div",{className:"text-center mb-6",children:[N.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[N.jsx("img",{src:"/app-icon.png",alt:"",width:28,height:28,className:"rounded-md"}),N.jsx("span",{className:"text-lg font-semibold text-oai-black dark:text-white",children:"Token Tracker"})]}),N.jsx("p",{className:"text-sm text-oai-gray-500",children:Fe("login_modal.subtitle")})]}),W&&N.jsx("div",{className:"mb-4 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900/50 px-3 py-2 text-xs text-oai-gray-700 dark:text-oai-gray-300",children:W}),R&&N.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",role:"alert",children:R}),N.jsx("div",{className:"space-y-2.5 mb-5",children:Y?N.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900 animate-pulse"}):le.map(G=>N.jsxs("button",{type:"button",disabled:D,onClick:()=>ye(G),className:Tt("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors disabled:opacity-50","flex items-center justify-center gap-2.5"),children:[aj[G]||null,Fe("login.oauth.continue",{provider:sj(G)})]},G))}),$?N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"relative mb-5",children:[N.jsx("div",{className:"absolute inset-0 flex items-center",children:N.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),N.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:N.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login_modal.divider_email")})})]}),N.jsxs("div",{className:"flex rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 p-0.5 bg-oai-gray-50 dark:bg-oai-gray-900/50 mb-4",children:[N.jsx("button",{type:"button",className:Tt("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="signin"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{m("signin"),O(null)},children:Fe("login.tab.sign_in")}),N.jsx("button",{type:"button",className:Tt("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="signup"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{m("signup"),O(null)},children:Fe("login.tab.sign_up")})]}),N.jsxs("form",{onSubmit:Ne,className:"space-y-3",children:[f==="signup"&&N.jsxs("div",{children:[N.jsx("label",{htmlFor:"modal-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.name")}),N.jsx("input",{id:"modal-name",type:"text",autoComplete:"name",value:C,onChange:G=>S(G.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:Fe("login.field.name_placeholder")})]}),N.jsxs("div",{children:[N.jsx("label",{htmlFor:"modal-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.email")}),N.jsx("input",{id:"modal-email",type:"email",autoComplete:"email",required:!0,value:y,onChange:G=>k(G.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),N.jsxs("div",{children:[N.jsx("label",{htmlFor:"modal-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.password")}),N.jsx("input",{id:"modal-password",type:"password",autoComplete:f==="signup"?"new-password":"current-password",required:!0,minLength:f==="signup"?Ae:void 0,value:w,onChange:G=>P(G.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),f==="signup"&&N.jsx("p",{className:"mt-1 text-xs text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login.password_hint",{min:String(Ae)})})]}),N.jsx("button",{type:"submit",disabled:D,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:Fe(f==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]}):N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"relative mb-5",children:[N.jsx("div",{className:"absolute inset-0 flex items-center",children:N.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),N.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:N.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login.divider")})})]}),N.jsxs("button",{type:"button",onClick:()=>x(!0),className:Tt("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors","flex items-center justify-center gap-2.5"),children:[N.jsx($D,{className:"h-[18px] w-[18px] text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75}),Fe("login_modal.continue_email")]})]})]})]})}):null}const lj={VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"};function cj(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return"";const t=typeof import.meta<"u"?lj:void 0;return(t?.VITE_TOKENTRACKER_BACKEND_BASE_URL||t?.VITE_INSFORGE_BASE_URL||"").trim()}function z4(){return fi()}function uj(e=""){if(typeof e!="string"||e.length===0)return!1;const t=new URLSearchParams(e),n=String(t.get("screenshot")||"").toLowerCase();return n==="1"||n==="true"}const dj=300*1e3,hj=720*60*1e3;function fm(e){return typeof e=="string"&&/^https?:\/\//i.test(e.trim())}function fj(e,t=Date.now()){if(!e?.token||!e?.deviceId||!e?.issuedAt)return!0;const n=Date.parse(e.issuedAt);return Number.isFinite(n)?n+hj<=t:!0}async function jx(e,t){const n=fi();if(!fm(n)||!e)return;const a=n.replace(/\/$/,""),s=Eu(),o={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};s&&(o.apikey=s);try{await fetch(`${a}/functions/tokentracker-leaderboard-refresh`,{method:"POST",headers:o,body:JSON.stringify({period:"week",source:t})})}catch{}}async function pj(e){const t=fi();if(!fm(t)||!e)return null;const n=t.replace(/\/$/,""),a=Eu(),s={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};a&&(s.apikey=a);const o=typeof navigator<"u"&&typeof navigator.platform=="string"?navigator.platform:"web",c=await fetch(`${n}/functions/tokentracker-device-token-issue`,{method:"POST",headers:s,body:JSON.stringify({device_name:"Token Tracker (dashboard)",platform:o})});if(!c.ok)return null;const u=await c.json().catch(()=>null),h=typeof u?.token=="string"?u.token:null,f=typeof u?.device_id=="string"?u.device_id:null;return!h||!f?null:{token:h,deviceId:f,issuedAt:typeof u?.created_at=="string"?u.created_at:new Date().toISOString()}}async function T_(e){const{deviceToken:t,insforgeBaseUrl:n}=e,a={deviceToken:t},s=n||fi();fm(s)&&(a.insforgeBaseUrl=s.trim());const o=await Lp(),c=await fetch("/functions/tokentracker-local-sync",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...o},body:JSON.stringify(a)}),u=await c.json().catch(()=>({}));if(!c.ok){const h=typeof u.error=="string"?u.error:`HTTP ${c.status}`;throw new Error(h)}return u}async function E_(e){const t=await e();if(!t)return null;const n=n0();if(n&&!fj(n))return n;const a=await pj(t);return a?(OR(a),a):null}async function Ux(e){let t=await e();if(!t)return null;let n=await E_(async()=>t);if(!n)return t;try{return await T_({deviceToken:n.token,insforgeBaseUrl:fi()}),t}catch(a){if(!n0()||(r0(),t=await e(),!t)||(n=await E_(async()=>t),!n))throw a;return await T_({deviceToken:n.token,insforgeBaseUrl:fi()}),t}}async function mj(e){const t=jR();if(Date.now()-t<dj)return;const n=await Ux(e);n&&(a0(Date.now()),await jx(n,"cloud-sync-auto"))}async function $4(e){const t=await Ux(e);t&&(a0(Date.now()),await jx(t,"cloud-sync-now"))}function gj(e){const t=e.replace(/\/+$/,"")||"/";return t==="/share"||t==="/share.html"||t.startsWith("/share/")}function yj(e){const t=e.replace(/\/+$/,"")||"/";return t==="/login"||t==="/landing"||gj(t)?!1:t==="/"||t==="/dashboard"||t.startsWith("/leaderboard")}function vj(){const e=Fn(),t=Yo(),n=b.useRef(!1);b.useEffect(()=>{if(!IR()||!yj(e.pathname||"/")||!t.enabled||!t.signedIn||t.loading||!NR())return;let a=!1;const s=window.setTimeout(()=>{(async()=>{if(!(a||n.current)){n.current=!0;try{await mj(()=>t.getAccessToken())}catch(o){console.warn("[tokentracker] cloud usage sync:",o)}finally{n.current=!1}}})()},2500);return()=>{a=!0,window.clearTimeout(s)}},[e.pathname,t.enabled,t.signedIn,t.loading,t.getAccessToken])}function kj(){const e=b.useContext(M0);if(e===null)throw new Error("useTheme must be used within a ThemeProvider");return e}function _j({prefersReducedMotion:e,screenshotCapture:t}){return!(t||e)}function bj(e){if(!e||typeof e!="object")return null;const t=e.user_metadata&&typeof e.user_metadata=="object"?e.user_metadata:{},n=e.profile&&typeof e.profile=="object"?e.profile:{},a=t.avatar_url||t.picture||n.avatar_url||e.avatar_url;return typeof a=="string"&&a.trim()?a.trim():null}function wj(e){return e?Ip()?`/api/avatar-proxy?url=${encodeURIComponent(e)}`:e:null}function Pc(e){const t=String(e||"").trim();if(!t)return"?";const n=t.split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():t.slice(0,2).toUpperCase()}function A_({className:e,variant:t="header",collapsed:n=!1,onAfterAction:a}){Xo();const s=t==="sidebar",{enabled:o,loading:c,signedIn:u,user:h,displayName:f}=Yo(),{openLoginModal:m}=N0(),y=bu(),k=b.useMemo(()=>bj(h),[h]),w=b.useMemo(()=>wj(k),[k]),[P,C]=Ro.useState(!1);if(Ro.useEffect(()=>{C(!1)},[w]),!o)return null;if(c)return N.jsx("div",{className:Tt("h-9 w-9 shrink-0 rounded-full bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse",e),"aria-hidden":!0});if(!u)return s?N.jsxs("button",{type:"button",onClick:()=>{m(),a?.()},className:Tt("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] font-medium text-oai-gray-700 dark:text-oai-gray-300 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 min-w-0",n?"h-8 w-8 justify-center px-0":"w-full",e),"aria-label":Fe("header.auth.sign_in_aria"),title:n?Fe("header.auth.sign_in_aria"):void 0,children:[N.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:N.jsx("img",{src:"/app-icon.png",alt:"",width:18,height:18,className:"h-[18px] w-[18px] rounded"})}),!n&&N.jsx("span",{className:"truncate flex-1 text-left",children:Fe("header.auth.sign_in_aria")})]}):N.jsx("button",{type:"button",onClick:m,className:Tt("shrink-0 inline-flex h-9 items-center justify-center gap-1.5 rounded-full px-5 text-sm font-medium transition-colors duration-200 ease-out shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",e),"aria-label":Fe("header.auth.sign_in_aria"),children:Fe("header.auth.sign_in_aria")});const S=()=>{y("/settings"),a?.()};return N.jsx("div",{className:Tt(s?"relative flex w-full shrink-0 items-center":"relative flex shrink-0 items-center",e),children:N.jsxs("button",{type:"button",onClick:S,className:Tt(s?Tt("flex w-full items-center gap-2 rounded-md px-2 py-1.5 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 transition-colors min-w-0",n&&"justify-center px-0 py-0 h-9 w-9"):"flex items-center gap-2 rounded-full pl-1 pr-2 py-1 border border-transparent hover:bg-oai-gray-100 dark:hover:bg-oai-gray-900/80 hover:border-oai-gray-200 dark:hover:border-oai-gray-800 transition-colors"),"aria-label":Fe("header.auth.open_settings"),title:s&&n?f:void 0,children:[s?N.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:w&&!P?N.jsx("img",{src:w,alt:"",width:20,height:20,className:"h-5 w-5 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700",referrerPolicy:"no-referrer",onError:()=>C(!0)}):Pc(f)==="?"?N.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:N.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-3 h-3 opacity-80",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):N.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600 text-[9px] font-semibold text-white ring-1 ring-oai-brand-500/50",children:Pc(f)})}):w&&!P?N.jsx("img",{src:w,alt:"",width:32,height:32,className:"h-8 w-8 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700 shrink-0",referrerPolicy:"no-referrer",onError:()=>C(!0)}):Pc(f)==="?"?N.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:N.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-4 h-4 opacity-80",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):N.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600 text-xs font-semibold text-white ring-1 ring-oai-brand-500/50",children:Pc(f)}),s?!n&&N.jsx("span",{className:"truncate text-[13px] font-medium text-oai-gray-900 dark:text-oai-gray-200 flex-1 text-left min-w-0",children:f}):N.jsx("span",{className:"hidden sm:inline truncate text-sm font-medium text-oai-gray-900 dark:text-oai-gray-200 max-w-[120px]",children:f})]})})}const Xf="tt.sidebarCollapsed";function xj(){return[{id:"general",label:Fe("nav.group.general"),items:[{id:"usage",to:"/dashboard",icon:ND,label:Fe("nav.usage")},{id:"limits",to:"/limits",icon:jD,label:Fe("nav.limits")},{id:"leaderboard",to:"/leaderboard",icon:iM,label:Fe("nav.leaderboard")}]},{id:"tools",label:Fe("nav.group.tools"),items:[{id:"widgets",to:"/widgets",icon:VD,label:Fe("nav.widgets")},{id:"skills",to:"/skills",icon:ZD,label:Fe("nav.skills")},{id:"ip-check",to:"/ip-check",icon:BD,label:Fe("nav.ip_check")}]},{id:"account",label:Fe("nav.group.account"),items:[{id:"settings",to:"/settings",icon:eM,label:Fe("nav.settings")}]}]}function Pj(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Xf)==="1"}catch{return!1}}function Sj(){const[e,t]=b.useState(Pj),n=b.useCallback(()=>{t(a=>{const s=!a;try{typeof window<"u"&&window.localStorage.setItem(Xf,s?"1":"0")}catch{}return s})},[]);return b.useEffect(()=>{if(typeof window>"u")return;const a=s=>{s.key===Xf&&t(s.newValue==="1")};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[]),{collapsed:e,toggle:n}}function Cj(e,t){const n=e.replace(/\/+$/,"")||"/";return t==="/dashboard"?n==="/dashboard"||n==="/":t==="/leaderboard"?n==="/leaderboard"||n.startsWith("/leaderboard/"):n===t}function Tj({label:e,collapsed:t,first:n}){return t?n?null:N.jsx("div",{className:"mx-2 my-2 h-px bg-oai-gray-200/70 dark:bg-oai-gray-800/70","aria-hidden":!0}):N.jsx("div",{className:Tt("px-3 pb-1 text-[10px] uppercase tracking-wider text-oai-gray-500 dark:text-oai-gray-500",n?"pt-2":"pt-4"),children:e})}function Ej({item:e,collapsed:t,active:n,onClick:a}){const s=e.icon;return N.jsxs(xu,{to:e.to,onClick:a,title:t?e.label:void 0,"aria-current":n?"page":void 0,className:Tt("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] no-underline transition-colors",t&&"justify-center px-0 py-2",n?"bg-oai-gray-200/70 text-oai-black font-medium dark:bg-oai-gray-800 dark:text-white":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/50 hover:text-oai-black dark:hover:bg-oai-gray-800/60 dark:hover:text-white"),children:[N.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:N.jsx(s,{className:"h-[15px] w-[15px]","aria-hidden":!0})}),!t&&N.jsx("span",{className:"truncate",children:e.label})]})}function Aj({as:e="button",title:t,onClick:n,href:a,children:s,className:o,...c}){const u=Tt("flex h-10 w-10 items-center justify-center rounded-lg text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",o);return e==="a"?N.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",title:t,"aria-label":t,className:u,...c,children:s}):N.jsx("button",{type:"button",title:t,"aria-label":t,onClick:n,className:u,...c,children:s})}function Rj({repo:e="mm7894215/TokenTracker",glassChrome:t=!1}){const[n,a]=b.useState(null);return b.useEffect(()=>{if(typeof window>"u")return;const s=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;_j({prefersReducedMotion:s,screenshotCapture:!1})&&fetch(`https://api.github.com/repos/${e}`).then(o=>o.json()).then(o=>{o&&typeof o.stargazers_count=="number"&&a(o.stargazers_count)}).catch(()=>{})},[e]),N.jsxs("a",{href:`https://github.com/${e}`,target:"_blank",rel:"noopener noreferrer","aria-label":n!==null?`Star on GitHub (${n})`:"Star on GitHub",className:Tt("inline-flex h-7 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",t?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:[N.jsx("svg",{height:"12",viewBox:"0 0 16 16",width:"12",className:"shrink-0 fill-current",children:N.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),N.jsx("span",{children:"Star"}),n!==null&&N.jsx("span",{className:"text-[10px] text-oai-gray-500 dark:text-oai-gray-500 tabular-nums",children:n})]})}const Lj=[{value:"light",label:"Light",Icon:L0},{value:"dark",label:"Dark",Icon:R0},{value:"system",label:"System",Icon:GD}];function Dj({theme:e,resolvedTheme:t,onSetTheme:n,glassChrome:a=!1}){const[s,o]=b.useState(!1),c=b.useRef(null),u=t==="dark"?R0:L0;return b.useEffect(()=>{if(!s)return;const h=m=>{c.current&&!c.current.contains(m.target)&&o(!1)},f=m=>{m.key==="Escape"&&o(!1)};return document.addEventListener("mousedown",h),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",f)}},[s]),N.jsxs("div",{ref:c,className:"relative",children:[N.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":s,"aria-haspopup":"menu",title:"Theme",onClick:()=>o(h=>!h),className:Tt("inline-flex h-7 w-7 items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",a?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:N.jsx(u,{className:"h-3.5 w-3.5","aria-hidden":!0})}),s&&N.jsx("div",{role:"menu",className:"absolute bottom-full left-0 mb-2 z-50 min-w-[140px] py-1 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 shadow-lg",children:Lj.map(({value:h,label:f,Icon:m})=>{const y=e===h;return N.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{n(h),o(!1)},className:Tt("flex w-full items-center gap-2.5 px-3 py-1.5 text-[13px] transition-colors",y?"text-oai-black dark:text-white bg-oai-gray-100 dark:bg-oai-gray-800":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/60 hover:text-oai-black dark:hover:text-white"),children:[N.jsx(m,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),N.jsx("span",{children:f})]},h)})})]})}function Bx({collapsed:e,onToggleCollapsed:t,onItemClick:n,showCloseButton:a=!1,onClose:s,glassChrome:o=!1}){const u=Fn()?.pathname||"/",{theme:h,resolvedTheme:f,setTheme:m}=kj(),{resolvedLocale:y}=Xo(),k=b.useMemo(()=>xj(),[y]);return N.jsxs(N.Fragment,{children:[N.jsx("div",{className:Tt("px-2 pt-2 pb-2",e&&"flex justify-center"),children:a?N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx("div",{className:"flex-1 min-w-0",children:N.jsx(A_,{variant:"sidebar",collapsed:e,onAfterAction:n})}),N.jsx("button",{type:"button",onClick:s,"aria-label":Fe("nav.close_menu"),title:Fe("nav.close_menu"),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-oai-gray-500 dark:text-oai-gray-500 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-gray-900 dark:hover:text-oai-gray-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:N.jsx(D0,{className:"h-4 w-4",strokeWidth:1.75,"aria-hidden":!0})})]}):N.jsx(A_,{variant:"sidebar",collapsed:e,onAfterAction:n})}),N.jsx("nav",{"aria-label":Fe("nav.nav_label"),className:"flex-1 px-2 pb-2 flex flex-col overflow-y-auto",children:k.map((w,P)=>N.jsxs("div",{className:"flex flex-col",children:[N.jsx(Tj,{label:w.label,collapsed:e,first:P===0}),N.jsx("div",{className:"flex flex-col gap-0.5",children:w.items.map(C=>N.jsx(Ej,{item:C,collapsed:e,active:Cj(u,C.to),onClick:n},C.id))})]},w.id))}),N.jsxs("div",{className:Tt("flex items-center px-2 py-3",e?"flex-col justify-center gap-2":"justify-between gap-2"),children:[N.jsx(Dj,{theme:h,resolvedTheme:f,onSetTheme:m,glassChrome:o}),N.jsx("div",{className:"flex items-center gap-1.5",children:!e&&N.jsx(Rj,{glassChrome:o})})]})]})}function Mj({collapsed:e,onToggleCollapsed:t}){const n=b.useMemo(()=>typeof window>"u"?!1:rr()||Ip(),[]);return N.jsx("aside",{"aria-label":Fe("nav.aside_label"),className:Tt("hidden lg:flex flex-col shrink-0 h-full min-h-0 transition-[width] duration-200",e?"w-[72px]":"w-[220px]"),children:N.jsx(Bx,{collapsed:e,onToggleCollapsed:t,glassChrome:n})})}function Ij({open:e,onClose:t}){return b.useEffect(()=>{if(!e)return;const n=a=>{a.key==="Escape"&&t()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,t]),b.useEffect(()=>{if(!e)return;const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}},[e]),e?N.jsxs("div",{className:"lg:hidden fixed inset-0 z-[80] flex",children:[N.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:t,"aria-hidden":!0}),N.jsx("aside",{"aria-label":Fe("nav.aside_label"),className:"relative w-[260px] max-w-[80vw] flex flex-col bg-oai-white dark:bg-oai-gray-900 border-r border-oai-gray-200 dark:border-oai-gray-800 shadow-2xl",children:N.jsx(Bx,{collapsed:!1,showCloseButton:!0,onClose:t,onItemClick:t})})]}):null}function Nj({onOpenDrawer:e}){return N.jsxs("div",{className:"lg:hidden flex items-center justify-between gap-2 px-3 h-14 border-b border-oai-gray-200 dark:border-oai-gray-800",children:[N.jsx(Aj,{title:Fe("nav.menu"),onClick:e,children:N.jsx(WD,{className:"h-5 w-5","aria-hidden":!0})}),N.jsxs(xu,{to:"/landing",className:"flex items-center gap-2 no-underline hover:opacity-80 transition-opacity","aria-label":"Token Tracker",children:[N.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),N.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white",children:"Token Tracker"})]}),N.jsx("div",{className:"w-10 shrink-0","aria-hidden":!0})]})}function Oj({children:e}){const{collapsed:t,toggle:n}=Sj(),[a,s]=b.useState(!1),o=b.useCallback(()=>s(!0),[]),c=b.useCallback(()=>s(!1),[]),u=b.useMemo(()=>typeof window>"u"?!1:rr()||Ip(),[]);return N.jsxs("div",{className:Tt("fixed inset-0 flex flex-col text-oai-black dark:text-oai-white font-sans overflow-hidden",u?"bg-transparent":"bg-oai-gray-100 dark:bg-oai-gray-950"),children:[u&&N.jsx("div",{className:"h-7 shrink-0",style:{WebkitAppRegion:"drag"},"aria-hidden":!0}),N.jsxs("div",{className:"flex-1 min-h-0 flex",children:[N.jsx(Mj,{collapsed:t,onToggleCollapsed:n}),N.jsx(Ij,{open:a,onClose:c}),N.jsx("div",{className:"flex-1 min-w-0 min-h-0 p-2 lg:pl-0 lg:pr-3 lg:pb-3 flex flex-col",children:N.jsxs("div",{className:Tt("flex-1 min-h-0 flex flex-col bg-oai-white dark:bg-oai-gray-900 border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",u?"tt-native-main-card":"rounded-2xl",!u&&"shadow-sm"),children:[N.jsx(Nj,{onOpenDrawer:o}),N.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:e})]})})]})]})}const jj=typeof window<"u"?window.location.search:"",R_=new URLSearchParams(jj),Sc=R_.get("insforge_code")||R_.get("code")||null,Uj=typeof window<"u"&&!!window.webkit?.messageHandlers?.nativeOAuth;function Bj(){Xo();const{loading:e,signedIn:t}=Yo(),n=bu(),[a,s]=b.useState("processing"),[o,c]=b.useState(null),u=b.useRef(!1);b.useEffect(()=>{if(!(!Sc||u.current)){if(u.current=!0,Uj){c(!1);return}(async()=>{try{const m=await(await fetch("/api/auth-bridge/verifier")).json();c(!!m?.native)}catch{c(!1)}})()}},[]),b.useEffect(()=>{if(o!==!0||!Sc)return;s("redirecting");const f=setTimeout(()=>{window.location.href=`tokentracker://auth/callback?insforge_code=${encodeURIComponent(Sc)}`},200);return()=>clearTimeout(f)},[o]),b.useEffect(()=>{if(o!==!1||e)return;if(t){n("/dashboard",{replace:!0});return}const f=setTimeout(()=>{t||s("failed")},12e3);return()=>clearTimeout(f)},[o,e,t,n]),b.useEffect(()=>{if(!Sc&&o===null){const f=setTimeout(()=>s("failed"),3e3);return()=>clearTimeout(f)}},[o]);const h=()=>{n("/dashboard",{replace:!0})};return a==="processing"&&o!==!0&&(o===null||o===!1&&e)?N.jsx("div",{className:"min-h-screen bg-oai-gray-950"}):N.jsx("div",{className:"min-h-screen bg-oai-gray-950 text-white font-oai antialiased dark flex items-center justify-center",children:N.jsxs("div",{className:"text-center space-y-4 max-w-sm px-4",children:[a==="processing"&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"w-8 h-8 border-2 border-oai-gray-600 border-t-white rounded-full animate-spin mx-auto"}),N.jsx("p",{className:"text-oai-gray-400 text-sm",children:Fe("auth.callback.processing")})]}),a==="redirecting"&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-green-500/15 flex items-center justify-center",children:N.jsx("svg",{className:"w-6 h-6 text-green-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:N.jsx("path",{d:"M20 6 9 17l-5-5"})})}),N.jsx("p",{className:"text-white text-sm font-medium",children:Fe("auth.callback.success")}),N.jsx("p",{className:"text-oai-gray-500 text-xs",children:Fe("auth.callback.redirecting")})]}),a==="failed"&&N.jsxs("div",{className:"space-y-3",children:[N.jsx("p",{className:"text-oai-gray-300 text-sm",children:Fe("auth.callback.failed")}),N.jsx("button",{type:"button",onClick:h,className:"px-4 py-2 rounded-lg bg-oai-gray-800 text-sm text-white hover:bg-oai-gray-700 transition-colors",children:Fe("auth.callback.close")})]})]})})}const Fj=b.lazy(()=>or(()=>import("./DashboardPage-BwTkSsim.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(e=>({default:e.DashboardPage}))),Vj=b.lazy(()=>or(()=>import("./IpCheckPage-BcHkEcE7.js"),[])),zj=b.lazy(()=>or(()=>import("./LandingPage-Bnqs_k3p.js"),__vite__mapDeps([11,8])).then(e=>({default:e.LandingPage}))),$j=b.lazy(()=>or(()=>import("./LeaderboardPage-DV6K7KSV.js").then(e=>e.a),__vite__mapDeps([12,9,2,13])).then(e=>({default:e.LeaderboardPage}))),Hj=b.lazy(()=>or(()=>import("./LimitsPage-DO53157-.js"),__vite__mapDeps([14,1,15,7,10,8])).then(e=>({default:e.LimitsPage}))),Wj=b.lazy(()=>or(()=>import("./LoginPage-1M5RskQE.js"),[]).then(e=>({default:e.LoginPage}))),Kj=b.lazy(()=>or(()=>import("./DevicePage-DX8aCjtt.js"),[])),Gj=b.lazy(()=>or(()=>import("./WrappedPage-BxuVlF3C.js"),[])),qj=b.lazy(()=>or(()=>import("./SettingsPage-DjoUqFA-.js"),__vite__mapDeps([16,15,17,7,18,2,13,4,19])).then(e=>({default:e.SettingsPage}))),Yj=b.lazy(()=>or(()=>import("./SkillsPage-CvOf-_li.js"),__vite__mapDeps([20,7,5,4,9,18,6,8,13,19])).then(e=>({default:e.SkillsPage}))),Zj=b.lazy(()=>or(()=>import("./WidgetsPage-Cc5PRPDd.js"),__vite__mapDeps([21,17,7,10,8,19,13])).then(e=>({default:e.WidgetsPage})));function Xj(){const{resolvedLocale:e}=Xo(),t=Fn(),n=Yo();vj();const a=Sn(),s=b.useMemo(()=>typeof window>"u"?!1:uj(window.location.search),[]),o=t?.pathname||"/",c=new URL(window.location.href),u=c.pathname.replace(/\/+$/,"")||"/",f=u.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,m=c.searchParams.get("token")||null,y=f||m,k=u==="/share"||u==="/share.html"||u.startsWith("/share/"),w=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),P=o.replace(/\/+$/,"")||"/",C=P==="/leaderboard",S=!!(n.enabled&&n.signedIn),D=w||S,L=!1,R=cj(),O=b.useMemo(()=>!n.enabled||!S?null:{getAccessToken:()=>n.getAccessToken(),name:n.displayName||"",userId:n.user?.id||null},[S,n]);let W=w||a||s?"dashboard":"landing";P==="/landing"&&(W="landing"),P==="/dashboard"&&(W="dashboard"),C&&(W="dashboard");const K=P==="/limits",$=P==="/settings",x=P==="/skills",Y=P==="/widgets",X=P==="/ip-check";(K||$||x||Y||X)&&(W="dashboard");let le=Fj;P==="/leaderboard"?le=$j:K?le=Hj:$?le=qj:x?le=Yj:Y?le=Zj:X&&(le=Vj);const oe=!k&&(P==="/dashboard"||P==="/"||C||K||$||x||Y||X);let Ae=null;if(P==="/auth/callback"||P==="/auth/native-callback")Ae=N.jsx(Bj,{});else if(P==="/login")Ae=N.jsx(Wj,{});else if(P==="/device")Ae=N.jsx(Kj,{});else if(P==="/wrapped")Ae=N.jsx(Gj,{});else if(W==="landing")Ae=N.jsx(zj,{signInUrl:"/login",signUpUrl:"/login"});else{const de=N.jsx(le,{baseUrl:R,auth:O,signedIn:D,sessionSoftExpired:L,signOut:()=>n.enabled?n.signOut():Promise.resolve(),publicMode:k,publicToken:y,signInUrl:"/login",signUpUrl:"/login"},e);oe?Ae=N.jsx(Oj,{children:de}):Ae=de}return N.jsx(lM,{children:N.jsx(dM,{children:N.jsxs(hM,{children:[N.jsx(b.Suspense,{fallback:null,children:Ae}),N.jsx(oj,{}),N.jsx(gD,{}),N.jsx(TD,{})]})})})}const Qj=$1([{path:"*",element:N.jsx(Xj,{})}]);LS.createRoot(document.getElementById("root")).render(N.jsx(Ro.StrictMode,{children:N.jsx(YL,{children:N.jsx(nD,{children:N.jsx(CL,{children:N.jsx(nT,{router:Qj})})})})}));export{Ea as $,p0 as A,Fe as B,N as C,ef as D,Ic as E,_4 as F,k4 as G,No as H,oM as I,fu as J,L4 as K,xu as L,lm as M,u4 as N,c4 as O,aO as P,kj as Q,Ro as R,Tt as S,N0 as T,Yo as U,g4 as V,P4 as W,D0 as X,Xo as Y,uj as Z,or as _,Gt as a,E4 as a0,b4 as a1,GR as a2,d4 as a3,h4 as a4,A4 as a5,v4 as a6,m4 as a7,_j as a8,A_ as a9,Ep as aA,Lp as aB,B4 as aC,rr as aD,Ip as aE,j4 as aF,F4 as aG,U4 as aH,So as aI,Uw as aJ,VI as aK,$f as aL,T4 as aM,CS as aN,Qf as aO,tT as aa,Fn as ab,bu as ac,z4 as ad,NR as ae,s4 as af,$4 as ag,o4 as ah,C4 as ai,eM as aj,N4 as ak,Jj as al,DR as am,Op as an,IR as ao,Zv as ap,S4 as aq,L0 as ar,R0 as as,GD as at,ps as au,au as av,Dp as aw,y4 as ax,QD as ay,tD as az,O0 as b,dn as c,Ia as d,kk as e,dt as f,m0 as g,Sn as h,l2 as i,l4 as j,VR as k,O4 as l,gs as m,nL as n,rL as o,D4 as p,p4 as q,b as r,x4 as s,M4 as t,jp as u,I4 as v,f4 as w,yt as x,w4 as y,R4 as z};
842
+ `),()=>{u.current?.removeAttribute("data-motion-pop-id"),G.contains(O)&&G.removeChild(O)}},[t]),N.jsx(aO,{isPresent:t,childRef:u,sizeRef:h,pop:s,children:s===!1?e:b.cloneElement(e,{ref:y})})}const oO=({children:e,initial:t,isPresent:n,onExitComplete:a,custom:o,presenceAffectsLayout:s,mode:c,anchorX:u,anchorY:h,root:f})=>{const m=jp(sO),y=b.useId();let k=!0,w=b.useMemo(()=>(k=!1,{id:y,initial:t,isPresent:n,custom:o,onExitComplete:x=>{m.set(x,!0);for(const C of m.values())if(!C)return;a&&a()},register:x=>(m.set(x,!1),()=>m.delete(x))}),[n,m,a]);return s&&k&&(w={...w}),b.useMemo(()=>{m.forEach((x,C)=>m.set(C,!1))},[n]),b.useEffect(()=>{!n&&!m.size&&a&&a()},[n]),e=N.jsx(iO,{pop:c==="popLayout",isPresent:n,anchorX:u,anchorY:h,root:f,children:e}),N.jsx(Lu.Provider,{value:w,children:e})};function sO(){return new Map}function dx(e=!0){const t=b.useContext(Lu);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:o}=t,s=b.useId();b.useEffect(()=>{if(e)return o(s)},[e]);const c=b.useCallback(()=>e&&a&&a(s),[s,a,e]);return!n&&a?[!1,c]:[!0]}const _c=e=>e.key||"";function s_(e){const t=[];return b.Children.forEach(e,n=>{b.isValidElement(n)&&t.push(n)}),t}const lO=({children:e,custom:t,initial:n=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:s="sync",propagate:c=!1,anchorX:u="left",anchorY:h="top",root:f})=>{const[m,y]=dx(c),k=b.useMemo(()=>s_(e),[e]),w=c&&!m?[]:k.map(_c),x=b.useRef(!0),C=b.useRef(k),S=jp(()=>new Map),D=b.useRef(new Set),[L,R]=b.useState(k),[O,G]=b.useState(k);U0(()=>{x.current=!1,C.current=k;for(let P=0;P<O.length;P++){const Y=_c(O[P]);w.includes(Y)?(S.delete(Y),D.current.delete(Y)):S.get(Y)!==!0&&S.set(Y,!1)}},[O,w.length,w.join("-")]);const W=[];if(k!==L){let P=[...k];for(let Y=0;Y<O.length;Y++){const X=O[Y],de=_c(X);w.includes(de)||(P.splice(Y,0,X),W.push(X))}return s==="wait"&&W.length&&(P=W),G(s_(P)),R(k),null}const{forceRender:z}=b.useContext(Op);return N.jsx(N.Fragment,{children:O.map(P=>{const Y=_c(P),X=c&&!m?!1:k===O||w.includes(Y),de=()=>{if(D.current.has(Y))return;if(S.has(Y))D.current.add(Y),S.set(Y,!0);else return;let se=!0;S.forEach(Ae=>{Ae||(se=!1)}),se&&(z?.(),G(C.current),c&&y?.(),a&&a())};return N.jsx(oO,{isPresent:X,initial:!x.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:f,onExitComplete:X?void 0:de,anchorX:u,anchorY:h,children:P},Y)})})},hx=b.createContext({strict:!1}),l_={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let c_=!1;function cO(){if(c_)return;const e={};for(const t in l_)e[t]={isEnabled:n=>l_[t].some(a=>!!n[a])};Vw(e),c_=!0}function fx(){return cO(),KI()}function uO(e){const t=fx();for(const n in e)t[n]={...t[n],...e[n]};Vw(t)}const dO=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function vu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||dO.has(e)}let px=e=>!vu(e);function hO(e){typeof e=="function"&&(px=t=>t.startsWith("on")?!vu(t):e(t))}try{hO(require("@emotion/is-prop-valid").default)}catch{}function fO(e,t,n){const a={};for(const o in e)o==="values"&&typeof e.values=="object"||Gt(e[o])||(px(o)||n===!0&&vu(o)||!t&&!vu(o)||e.draggable&&o.startsWith("onDrag"))&&(a[o]=e[o]);return a}const Nu=b.createContext({});function pO(e,t){if(Iu(e)){const{initial:n,animate:a}=e;return{initial:n===!1||Bs(n)?n:void 0,animate:Bs(a)?a:void 0}}return e.inherit!==!1?t:{}}function mO(e){const{initial:t,animate:n}=pO(e,b.useContext(Nu));return b.useMemo(()=>({initial:t,animate:n}),[u_(t),u_(n)])}function u_(e){return Array.isArray(e)?e.join(" "):e}const cm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function mx(e,t,n){for(const a in t)!Gt(t[a])&&!qw(a,n)&&(e[a]=t[a])}function gO({transformTemplate:e},t){return b.useMemo(()=>{const n=cm();return om(n,t,e),Object.assign({},n.vars,n.style)},[t])}function yO(e,t){const n=e.style||{},a={};return mx(a,n,e),Object.assign(a,gO(e,t)),a}function vO(e,t){const n={},a=yO(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=a,n}const gx=()=>({...cm(),attrs:{}});function kO(e,t,n,a){const o=b.useMemo(()=>{const s=gx();return Yw(s,t,Xw(a),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};mx(s,e.style,e),o.style={...s,...o.style}}return o}const _O=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function um(e){return typeof e!="string"||e.includes("-")?!1:!!(_O.indexOf(e)>-1||/[A-Z]/u.test(e))}function bO(e,t,n,{latestValues:a},o,s=!1,c){const h=(c??um(e)?kO:vO)(t,a,o,e),f=fO(t,typeof e=="string",s),m=e!==b.Fragment?{...f,...h,ref:n}:{},{children:y}=t,k=b.useMemo(()=>Gt(y)?y.get():y,[y]);return b.createElement(e,{...m,children:k})}function wO({scrapeMotionValuesFromProps:e,createRenderState:t},n,a,o){return{latestValues:xO(n,a,o,e),renderState:t()}}function xO(e,t,n,a){const o={},s=a(e,{});for(const k in s)o[k]=Hc(s[k]);let{initial:c,animate:u}=e;const h=Iu(e),f=Bw(e);t&&f&&!h&&e.inherit!==!1&&(c===void 0&&(c=t.initial),u===void 0&&(u=t.animate));let m=n?n.initial===!1:!1;m=m||c===!1;const y=m?u:c;if(y&&typeof y!="boolean"&&!Mu(y)){const k=Array.isArray(y)?y:[y];for(let w=0;w<k.length;w++){const x=Qp(e,k[w]);if(x){const{transitionEnd:C,transition:S,...D}=x;for(const L in D){let R=D[L];if(Array.isArray(R)){const O=m?R.length-1:0;R=R[O]}R!==null&&(o[L]=R)}for(const L in C)o[L]=C[L]}}}return o}const yx=e=>(t,n)=>{const a=b.useContext(Nu),o=b.useContext(Lu),s=()=>wO(e,t,a,o);return n?s():jp(s)},PO=yx({scrapeMotionValuesFromProps:sm,createRenderState:cm}),SO=yx({scrapeMotionValuesFromProps:Qw,createRenderState:gx}),CO=Symbol.for("motionComponentSymbol");function TO(e,t,n){const a=b.useRef(n);b.useInsertionEffect(()=>{a.current=n});const o=b.useRef(null);return b.useCallback(s=>{s&&e.onMount?.(s);const c=a.current;if(typeof c=="function")if(s){const u=c(s);typeof u=="function"&&(o.current=u)}else o.current?(o.current(),o.current=null):c(s);else c&&(c.current=s);t&&(s?t.mount(s):t.unmount())},[t])}const vx=b.createContext({});function to(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function EO(e,t,n,a,o,s){const{visualElement:c}=b.useContext(Nu),u=b.useContext(hx),h=b.useContext(Lu),f=b.useContext(lm),m=f.reducedMotion,y=f.skipAnimations,k=b.useRef(null),w=b.useRef(!1);a=a||u.renderer,!k.current&&a&&(k.current=a(e,{visualState:t,parent:c,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:m,skipAnimations:y,isSVG:s}),w.current&&k.current&&(k.current.manuallyAnimateOnMount=!0));const x=k.current,C=b.useContext(vx);x&&!x.projection&&o&&(x.type==="html"||x.type==="svg")&&AO(k.current,n,o,C);const S=b.useRef(!1);b.useInsertionEffect(()=>{x&&S.current&&x.update(n,h)});const D=n[Cw],L=b.useRef(!!D&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(D)&&window.MotionHasOptimisedAnimation?.(D));return U0(()=>{w.current=!0,x&&(S.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),L.current&&x.animationState&&x.animationState.animateChanges())}),b.useEffect(()=>{x&&(!L.current&&x.animationState&&x.animationState.animateChanges(),L.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(D)}),L.current=!1),x.enteringChildren=void 0)}),x}function AO(e,t,n,a){const{layoutId:o,layout:s,drag:c,dragConstraints:u,layoutScroll:h,layoutRoot:f,layoutAnchor:m,layoutCrossfade:y}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:kx(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!c||u&&to(u),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:a,crossfade:y,layoutScroll:h,layoutRoot:f,layoutAnchor:m})}function kx(e){if(e)return e.options.allowProjection!==!1?e.projection:kx(e.parent)}function Yh(e,{forwardMotionProps:t=!1,type:n}={},a,o){a&&uO(a);const s=n?n==="svg":um(e),c=s?SO:PO;function u(f,m){let y;const k={...b.useContext(lm),...f,layoutId:RO(f)},{isStatic:w}=k,x=mO(f),C=c(f,w);if(!w&&typeof window<"u"){LO();const S=DO(k);y=S.MeasureLayout,x.visualElement=EO(e,C,k,o,S.ProjectionNode,s)}return N.jsxs(Nu.Provider,{value:x,children:[y&&x.visualElement?N.jsx(y,{visualElement:x.visualElement,...k}):null,bO(e,f,TO(C,x.visualElement,m),C,w,t,s)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=b.forwardRef(u);return h[CO]=e,h}function RO({layoutId:e}){const t=b.useContext(Op).id;return t&&e!==void 0?t+"-"+e:e}function LO(e,t){b.useContext(hx).strict}function DO(e){const t=fx(),{drag:n,layout:a}=t;if(!n&&!a)return{};const o={...n,...a};return{MeasureLayout:n?.isEnabled(e)||a?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function MO(e,t){if(typeof Proxy>"u")return Yh;const n=new Map,a=(s,c)=>Yh(s,c,e,t),o=(s,c)=>a(s,c);return new Proxy(o,{get:(s,c)=>c==="create"?a:(n.has(c)||n.set(c,Yh(c,void 0,e,t)),n.get(c))})}const IO=(e,t)=>t.isSVG??um(e)?new cN(t):new rN(t,{allowProjection:e!==b.Fragment});class NO extends ja{constructor(t){super(t),t.animationState||(t.animationState=pN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Mu(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let OO=0;class jO extends ja{constructor(){super(...arguments),this.id=OO++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;if(t&&a===!1){if(this.isExitComplete){const{initial:s,custom:c}=this.node.getProps();if(typeof s=="string"){const u=si(this.node,s,c);if(u){const{transition:h,transitionEnd:f,...m}=u;for(const y in m)this.node.getValue(y)?.jump(m[y])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const UO={animation:{Feature:NO},exit:{Feature:jO}};function nl(e){return{point:{x:e.pageX,y:e.pageY}}}const BO=e=>t=>nm(t)&&e(t,nl(t));function As(e,t,n,a){return Fs(e,t,BO(n),a)}const _x=({current:e})=>e?e.ownerDocument.defaultView:null,d_=(e,t)=>Math.abs(e-t);function FO(e,t){const n=d_(e.x,t.x),a=d_(e.y,t.y);return Math.sqrt(n**2+a**2)}const h_=new Set(["auto","scroll"]);class bx{constructor(t,n,{transformPagePoint:a,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:c=3,element:u}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=w=>{this.handleScroll(w.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=bc(this.lastRawMoveEventInfo,this.transformPagePoint));const w=Zh(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,C=FO(w.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!C)return;const{point:S}=w,{timestamp:D}=Kt;this.history.push({...S,timestamp:D});const{onStart:L,onMove:R}=this.handlers;x||(L&&L(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),R&&R(this.lastMoveEvent,w)},this.handlePointerMove=(w,x)=>{this.lastMoveEvent=w,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=bc(x,this.transformPagePoint),dt.update(this.updatePoint,!0)},this.handlePointerUp=(w,x)=>{this.end();const{onEnd:C,onSessionEnd:S,resumeAnimation:D}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&D&&D(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const L=Zh(w.type==="pointercancel"?this.lastMoveEventInfo:bc(x,this.transformPagePoint),this.history);this.startEvent&&C&&C(w,L),S&&S(w,L)},!nm(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=c,this.contextWindow=o||window;const h=nl(t),f=bc(h,this.transformPagePoint),{point:m}=f,{timestamp:y}=Kt;this.history=[{...m,timestamp:y}];const{onSessionStart:k}=n;k&&k(t,Zh(f,this.history)),this.removeListeners=Js(As(this.contextWindow,"pointermove",this.handlePointerMove),As(this.contextWindow,"pointerup",this.handlePointerUp),As(this.contextWindow,"pointercancel",this.handlePointerUp)),u&&this.startScrollTracking(u)}startScrollTracking(t){let n=t.parentElement;for(;n;){const a=getComputedStyle(n);(h_.has(a.overflowX)||h_.has(a.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const a=t===window,o=a?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:o.x-n.x,y:o.y-n.y};s.x===0&&s.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,o),dt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Na(this.updatePoint)}}function bc(e,t){return t?{point:t(e.point)}:e}function f_(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Zh({point:e},t){return{point:e,delta:f_(e,wx(t)),offset:f_(e,VO(t)),velocity:zO(t,.1)}}function VO(e){return e[0]}function wx(e){return e[e.length-1]}function zO(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,a=null;const o=wx(e);for(;n>=0&&(a=e[n],!(o.timestamp-a.timestamp>Pn(t)));)n--;if(!a)return{x:0,y:0};a===e[0]&&e.length>2&&o.timestamp-a.timestamp>Pn(t)*2&&(a=e[1]);const s=On(o.timestamp-a.timestamp);if(s===0)return{x:0,y:0};const c={x:(o.x-a.x)/s,y:(o.y-a.y)/s};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function $O(e,{min:t,max:n},a){return t!==void 0&&e<t?e=a?vt(t,e,a.min):Math.max(e,t):n!==void 0&&e>n&&(e=a?vt(n,e,a.max):Math.min(e,n)),e}function p_(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function HO(e,{top:t,left:n,bottom:a,right:o}){return{x:p_(e.x,n,o),y:p_(e.y,t,a)}}function m_(e,t){let n=t.min-e.min,a=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,a]=[a,n]),{min:n,max:a}}function WO(e,t){return{x:m_(e.x,t.x),y:m_(e.y,t.y)}}function KO(e,t){let n=.5;const a=ln(e),o=ln(t);return o>a?n=js(t.min,t.max-a,e.min):a>o&&(n=js(e.min,e.max-o,t.min)),xr(0,1,n)}function GO(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const qf=.35;function qO(e=qf){return e===!1?e=0:e===!0&&(e=qf),{x:g_(e,"left","right"),y:g_(e,"top","bottom")}}function g_(e,t,n){return{min:y_(e,t),max:y_(e,n)}}function y_(e,t){return typeof e=="number"?e:e[t]||0}const YO=new WeakMap;class ZO{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ot(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=y=>{n&&this.snapToCursor(nl(y).point),this.stopAnimation()},c=(y,k)=>{const{drag:w,dragPropagation:x,onDragStart:C}=this.getProps();if(w&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=wI(w),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=k,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),pr(D=>{let L=this.getAxisMotionValue(D).get()||0;if(vr.test(L)){const{projection:R}=this.visualElement;if(R&&R.layout){const O=R.layout.layoutBox[D];O&&(L=ln(O)*(parseFloat(L)/100))}}this.originPoint[D]=L}),C&&dt.update(()=>C(y,k),!1,!0),Bf(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},u=(y,k)=>{this.latestPointerEvent=y,this.latestPanInfo=k;const{dragPropagation:w,dragDirectionLock:x,onDirectionLock:C,onDrag:S}=this.getProps();if(!w&&!this.openDragLock)return;const{offset:D}=k;if(x&&this.currentDirection===null){this.currentDirection=QO(D),this.currentDirection!==null&&C&&C(this.currentDirection);return}this.updateAxis("x",k.point,D),this.updateAxis("y",k.point,D),this.visualElement.render(),S&&dt.update(()=>S(y,k),!1,!0)},h=(y,k)=>{this.latestPointerEvent=y,this.latestPanInfo=k,this.stop(y,k),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:y}=this.getProps();(y||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:m}=this.getProps();this.panSession=new bx(t,{onSessionStart:s,onStart:c,onMove:u,onSessionEnd:h,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,distanceThreshold:a,contextWindow:_x(this.visualElement),element:this.visualElement.current})}stop(t,n){const a=t||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!a)return;const{velocity:c}=o;this.startAnimation(c);const{onDragEnd:u}=this.getProps();u&&dt.postRender(()=>u(a,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,a){const{drag:o}=this.getProps();if(!a||!wc(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let c=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(c=$O(c,this.constraints[t],this.elastic[t])),s.set(c)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&to(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&a?this.constraints=HO(a.layoutBox,t):this.constraints=!1,this.elastic=qO(n),o!==this.constraints&&!to(t)&&a&&this.constraints&&!this.hasMutatedConstraints&&pr(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=GO(a.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!to(t))return!1;const a=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=XI(a,o.root,this.visualElement.getTransformPagePoint());let c=WO(o.layout.layoutBox,s);if(n){const u=n(qI(c));this.hasMutatedConstraints=!!u,u&&(c=$w(u))}return c}startAnimation(t){const{drag:n,dragMomentum:a,dragElastic:o,dragTransition:s,dragSnapToOrigin:c,onDragTransitionEnd:u}=this.getProps(),h=this.constraints||{},f=pr(m=>{if(!wc(m,n,this.currentDirection))return;let y=h&&h[m]||{};(c===!0||c===m)&&(y={min:0,max:0});const k=o?200:1e6,w=o?40:1e7,x={type:"inertia",velocity:a?t[m]:0,bounceStiffness:k,bounceDamping:w,timeConstant:750,restDelta:1,restSpeed:10,...s,...y};return this.startAxisValueAnimation(m,x)});return Promise.all(f).then(u)}startAxisValueAnimation(t,n){const a=this.getAxisMotionValue(t);return Bf(this.visualElement,t),a.start(Xp(t,a,0,n,this.visualElement,!1))}stopAnimation(){pr(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps(),o=a[n];return o||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){pr(n=>{const{drag:a}=this.getProps();if(!wc(n,a,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:c,max:u}=o.layout.layoutBox[n],h=s.get()||0;s.set(t[n]-vt(c,u,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!to(n)||!a||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};pr(c=>{const u=this.getAxisMotionValue(c);if(u&&this.constraints!==!1){const h=u.get();o[c]=KO({min:h,max:h},this.constraints[c])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),pr(c=>{if(!wc(c,t,null))return;const u=this.getAxisMotionValue(c),{min:h,max:f}=this.constraints[c];u.set(vt(h,f,o[c]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;YO.set(this.visualElement,this);const t=this.visualElement.current,n=As(t,"pointerdown",f=>{const{drag:m,dragListener:y=!0}=this.getProps(),k=f.target,w=k!==t&&EI(k);m&&y&&!w&&this.start(f)});let a;const o=()=>{const{dragConstraints:f}=this.getProps();to(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),a||(a=XO(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,c=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),dt.read(o);const u=Fs(window,"resize",()=>this.scalePositionWithinConstraints()),h=s.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:m})=>{this.isDragging&&m&&(pr(y=>{const k=this.getAxisMotionValue(y);k&&(this.originPoint[y]+=f[y].translate,k.set(k.get()+f[y].translate))}),this.visualElement.render())}));return()=>{u(),n(),c(),h&&h(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:c=qf,dragMomentum:u=!0}=t;return{...t,drag:n,dragDirectionLock:a,dragPropagation:o,dragConstraints:s,dragElastic:c,dragMomentum:u}}}function v_(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function XO(e,t,n){const a=Sk(e,v_(n)),o=Sk(t,v_(n));return()=>{a(),o()}}function wc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function QO(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class JO extends ja{constructor(t){super(t),this.removeGroupControls=jn,this.removeListeners=jn,this.controls=new ZO(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||jn}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Xh=e=>(t,n)=>{e&&dt.update(()=>e(t,n),!1,!0)};class e3 extends ja{constructor(){super(...arguments),this.removePointerDownListener=jn}onPointerDown(t){this.session=new bx(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:_x(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:a,onPanEnd:o}=this.node.getProps();return{onSessionStart:Xh(t),onStart:Xh(n),onMove:Xh(a),onEnd:(s,c)=>{delete this.session,o&&dt.postRender(()=>o(s,c))}}}mount(){this.removePointerDownListener=As(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Qh=!1;class t3 extends b.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a,layoutId:o}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),a&&a.register&&o&&a.register(s),Qh&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Wc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:a,drag:o,isPresent:s}=this.props,{projection:c}=a;return c&&(c.isPresent=s,t.layoutDependency!==n&&c.setOptions({...c.options,layoutDependency:n}),Qh=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?c.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?c.promote():c.relegate()||dt.postRender(()=>{const u=c.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:a}=t;a&&(a.options.layoutAnchor=n,a.root.didUpdate(),tm.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:o}=t;Qh=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),a&&a.deregister&&a.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function xx(e){const[t,n]=dx(),a=b.useContext(Op);return N.jsx(t3,{...e,layoutGroup:a,switchLayoutGroup:b.useContext(vx),isPresent:t,safeToRemove:n})}const n3={pan:{Feature:e3},drag:{Feature:JO,ProjectionNode:ux,MeasureLayout:xx}};function k_(e,t,n){const{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=a[o];s&&dt.postRender(()=>s(t,nl(t)))}class r3 extends ja{mount(){const{current:t}=this.node;t&&(this.unmount=PI(t,(n,a)=>(k_(this.node,a,"Start"),o=>k_(this.node,o,"End"))))}unmount(){}}class a3 extends ja{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Js(Fs(this.node.current,"focus",()=>this.onFocus()),Fs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function __(e,t,n){const{props:a}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=a[o];s&&dt.postRender(()=>s(t,nl(t)))}class i3 extends ja{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:a}=this.node.props;this.unmount=RI(t,(o,s)=>(__(this.node,s,"Start"),(c,{success:u})=>__(this.node,c,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:a?.tap===!1})}unmount(){}}const Yf=new WeakMap,Jh=new WeakMap,o3=e=>{const t=Yf.get(e.target);t&&t(e)},s3=e=>{e.forEach(o3)};function l3({root:e,...t}){const n=e||document;Jh.has(n)||Jh.set(n,{});const a=Jh.get(n),o=JSON.stringify(t);return a[o]||(a[o]=new IntersectionObserver(s3,{root:e,...t})),a[o]}function c3(e,t,n){const a=l3(t);return Yf.set(e,n),a.observe(e),()=>{Yf.delete(e),a.unobserve(e)}}const u3={some:0,all:1};class d3 extends ja{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:n,margin:a,amount:o="some",once:s}=t,c={root:n?n.current:void 0,rootMargin:a,threshold:typeof o=="number"?o:u3[o]},u=h=>{const{isIntersecting:f}=h;if(this.isInView===f||(this.isInView=f,s&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:m,onViewportLeave:y}=this.node.getProps(),k=f?m:y;k&&k(h)};this.stopObserver=c3(this.node.current,c,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(h3(t,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function h3({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const f3={inView:{Feature:d3},tap:{Feature:i3},focus:{Feature:a3},hover:{Feature:r3}},p3={layout:{ProjectionNode:ux,MeasureLayout:xx}},m3={...UO,...f3,...n3,...p3},ef=MO(m3,IO);function Px(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Px(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function g3(){for(var e,t,n=0,a="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Px(e))&&(a&&(a+=" "),a+=t);return a}const y3=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},v3=(e,t)=>({classGroupId:e,validator:t}),Sx=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ku="-",b_=[],k3="arbitrary..",_3=e=>{const t=w3(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return b3(c);const u=c.split(ku),h=u[0]===""&&u.length>1?1:0;return Cx(u,h,t)},getConflictingClassGroupIds:(c,u)=>{if(u){const h=a[c],f=n[c];return h?f?y3(f,h):h:f||b_}return n[c]||b_}}},Cx=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const f=Cx(e,t+1,s);if(f)return f}const c=n.validators;if(c===null)return;const u=t===0?e.join(ku):e.slice(t).join(ku),h=c.length;for(let f=0;f<h;f++){const m=c[f];if(m.validator(u))return m.classGroupId}},b3=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?k3+a:void 0})(),w3=e=>{const{theme:t,classGroups:n}=e;return x3(n,t)},x3=(e,t)=>{const n=Sx();for(const a in e){const o=e[a];dm(o,n,a,t)}return n},dm=(e,t,n,a)=>{const o=e.length;for(let s=0;s<o;s++){const c=e[s];P3(c,t,n,a)}},P3=(e,t,n,a)=>{if(typeof e=="string"){S3(e,t,n);return}if(typeof e=="function"){C3(e,t,n,a);return}T3(e,t,n,a)},S3=(e,t,n)=>{const a=e===""?t:Tx(t,e);a.classGroupId=n},C3=(e,t,n,a)=>{if(E3(e)){dm(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(v3(n,e))},T3=(e,t,n,a)=>{const o=Object.entries(e),s=o.length;for(let c=0;c<s;c++){const[u,h]=o[c];dm(h,Tx(t,u),n,a)}},Tx=(e,t)=>{let n=e;const a=t.split(ku),o=a.length;for(let s=0;s<o;s++){const c=a[s];let u=n.nextPart.get(c);u||(u=Sx(),n.nextPart.set(c,u)),n=u}return n},E3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,A3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const o=(s,c)=>{n[s]=c,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(s){let c=n[s];if(c!==void 0)return c;if((c=a[s])!==void 0)return o(s,c),c},set(s,c){s in n?n[s]=c:o(s,c)}}},Zf="!",w_=":",R3=[],x_=(e,t,n,a,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:o}),L3=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=o=>{const s=[];let c=0,u=0,h=0,f;const m=o.length;for(let C=0;C<m;C++){const S=o[C];if(c===0&&u===0){if(S===w_){s.push(o.slice(h,C)),h=C+1;continue}if(S==="/"){f=C;continue}}S==="["?c++:S==="]"?c--:S==="("?u++:S===")"&&u--}const y=s.length===0?o:o.slice(h);let k=y,w=!1;y.endsWith(Zf)?(k=y.slice(0,-1),w=!0):y.startsWith(Zf)&&(k=y.slice(1),w=!0);const x=f&&f>h?f-h:void 0;return x_(s,w,k,x)};if(t){const o=t+w_,s=a;a=c=>c.startsWith(o)?s(c.slice(o.length)):x_(R3,!1,c,void 0,!0)}if(n){const o=a;a=s=>n({className:s,parseClassName:o})}return a},D3=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let o=[];for(let s=0;s<n.length;s++){const c=n[s],u=c[0]==="[",h=t.has(c);u||h?(o.length>0&&(o.sort(),a.push(...o),o=[]),a.push(c)):o.push(c)}return o.length>0&&(o.sort(),a.push(...o)),a}},M3=e=>({cache:A3(e.cacheSize),parseClassName:L3(e),sortModifiers:D3(e),..._3(e)}),I3=/\s+/,N3=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:o,sortModifiers:s}=t,c=[],u=e.trim().split(I3);let h="";for(let f=u.length-1;f>=0;f-=1){const m=u[f],{isExternal:y,modifiers:k,hasImportantModifier:w,baseClassName:x,maybePostfixModifierPosition:C}=n(m);if(y){h=m+(h.length>0?" "+h:h);continue}let S=!!C,D=a(S?x.substring(0,C):x);if(!D){if(!S){h=m+(h.length>0?" "+h:h);continue}if(D=a(x),!D){h=m+(h.length>0?" "+h:h);continue}S=!1}const L=k.length===0?"":k.length===1?k[0]:s(k).join(":"),R=w?L+Zf:L,O=R+D;if(c.indexOf(O)>-1)continue;c.push(O);const G=o(D,S);for(let W=0;W<G.length;++W){const z=G[W];c.push(R+z)}h=m+(h.length>0?" "+h:h)}return h},O3=(...e)=>{let t=0,n,a,o="";for(;t<e.length;)(n=e[t++])&&(a=Ex(n))&&(o&&(o+=" "),o+=a);return o},Ex=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=Ex(e[a]))&&(n&&(n+=" "),n+=t);return n},j3=(e,...t)=>{let n,a,o,s;const c=h=>{const f=t.reduce((m,y)=>y(m),e());return n=M3(f),a=n.cache.get,o=n.cache.set,s=u,u(h)},u=h=>{const f=a(h);if(f)return f;const m=N3(h,n);return o(h,m),m};return s=c,(...h)=>s(O3(...h))},U3=[],Nt=e=>{const t=n=>n[e]||U3;return t.isThemeGetter=!0,t},Ax=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Rx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,B3=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,F3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,V3=/\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$/,z3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,H3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xa=e=>B3.test(e),qe=e=>!!e&&!Number.isNaN(Number(e)),Pa=e=>!!e&&Number.isInteger(Number(e)),tf=e=>e.endsWith("%")&&qe(e.slice(0,-1)),Fr=e=>F3.test(e),Lx=()=>!0,W3=e=>V3.test(e)&&!z3.test(e),hm=()=>!1,K3=e=>$3.test(e),G3=e=>H3.test(e),q3=e=>!ke(e)&&!be(e),Y3=e=>Ua(e,Ix,hm),ke=e=>Ax.test(e),ei=e=>Ua(e,Nx,W3),P_=e=>Ua(e,rj,qe),Z3=e=>Ua(e,jx,Lx),X3=e=>Ua(e,Ox,hm),S_=e=>Ua(e,Dx,hm),Q3=e=>Ua(e,Mx,G3),xc=e=>Ua(e,Ux,K3),be=e=>Rx.test(e),ms=e=>gi(e,Nx),J3=e=>gi(e,Ox),C_=e=>gi(e,Dx),ej=e=>gi(e,Ix),tj=e=>gi(e,Mx),Pc=e=>gi(e,Ux,!0),nj=e=>gi(e,jx,!0),Ua=(e,t,n)=>{const a=Ax.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},gi=(e,t,n=!1)=>{const a=Rx.exec(e);return a?a[1]?t(a[1]):n:!1},Dx=e=>e==="position"||e==="percentage",Mx=e=>e==="image"||e==="url",Ix=e=>e==="length"||e==="size"||e==="bg-size",Nx=e=>e==="length",rj=e=>e==="number",Ox=e=>e==="family-name",jx=e=>e==="number"||e==="weight",Ux=e=>e==="shadow",aj=()=>{const e=Nt("color"),t=Nt("font"),n=Nt("text"),a=Nt("font-weight"),o=Nt("tracking"),s=Nt("leading"),c=Nt("breakpoint"),u=Nt("container"),h=Nt("spacing"),f=Nt("radius"),m=Nt("shadow"),y=Nt("inset-shadow"),k=Nt("text-shadow"),w=Nt("drop-shadow"),x=Nt("blur"),C=Nt("perspective"),S=Nt("aspect"),D=Nt("ease"),L=Nt("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],G=()=>[...O(),be,ke],W=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],P=()=>[be,ke,h],Y=()=>[xa,"full","auto",...P()],X=()=>[Pa,"none","subgrid",be,ke],de=()=>["auto",{span:["full",Pa,be,ke]},Pa,be,ke],se=()=>[Pa,"auto",be,ke],Ae=()=>["auto","min","max","fr",be,ke],fe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],le=()=>["start","end","center","stretch","center-safe","end-safe"],pe=()=>["auto",...P()],Ne=()=>[xa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],K=()=>[xa,"screen","full","dvw","lvw","svw","min","max","fit",...P()],Z=()=>[xa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],H=()=>[e,be,ke],I=()=>[...O(),C_,S_,{position:[be,ke]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],xe=()=>["auto","cover","contain",ej,Y3,{size:[be,ke]}],Re=()=>[tf,ms,ei],Pe=()=>["","none","full",f,be,ke],Te=()=>["",qe,ms,ei],Ge=()=>["solid","dashed","dotted","double"],Qe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ue=()=>[qe,tf,C_,S_],jt=()=>["","none",x,be,ke],Hn=()=>["none",qe,be,ke],Cr=()=>["none",qe,be,ke],pt=()=>[qe,be,ke],en=()=>[xa,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fr],breakpoint:[Fr],color:[Lx],container:[Fr],"drop-shadow":[Fr],ease:["in","out","in-out"],font:[q3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fr],shadow:[Fr],spacing:["px",qe],text:[Fr],"text-shadow":[Fr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xa,ke,be,S]}],container:["container"],columns:[{columns:[qe,ke,be,u]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:G()}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{"inset-s":Y(),start:Y()}],end:[{"inset-e":Y(),end:Y()}],"inset-bs":[{"inset-bs":Y()}],"inset-be":[{"inset-be":Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[Pa,"auto",be,ke]}],basis:[{basis:[xa,"full","auto",u,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,xa,"auto","initial","none",ke]}],grow:[{grow:["",qe,be,ke]}],shrink:[{shrink:["",qe,be,ke]}],order:[{order:[Pa,"first","last","none",be,ke]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:de()}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:de()}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ae()}],"auto-rows":[{"auto-rows":Ae()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...fe(),"normal"]}],"justify-items":[{"justify-items":[...le(),"normal"]}],"justify-self":[{"justify-self":["auto",...le()]}],"align-content":[{content:["normal",...fe()]}],"align-items":[{items:[...le(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...le(),{baseline:["","last"]}]}],"place-content":[{"place-content":fe()}],"place-items":[{"place-items":[...le(),"baseline"]}],"place-self":[{"place-self":["auto",...le()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:pe()}],mx:[{mx:pe()}],my:[{my:pe()}],ms:[{ms:pe()}],me:[{me:pe()}],mbs:[{mbs:pe()}],mbe:[{mbe:pe()}],mt:[{mt:pe()}],mr:[{mr:pe()}],mb:[{mb:pe()}],ml:[{ml:pe()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:Ne()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[u,"screen",...Ne()]}],"min-w":[{"min-w":[u,"screen","none",...Ne()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[c]},...Ne()]}],h:[{h:["screen","lh",...Ne()]}],"min-h":[{"min-h":["screen","lh","none",...Ne()]}],"max-h":[{"max-h":["screen","lh",...Ne()]}],"font-size":[{text:["base",n,ms,ei]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,nj,Z3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tf,ke]}],"font-family":[{font:[J3,X3,t]}],"font-features":[{"font-features":[ke]}],"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:[o,be,ke]}],"line-clamp":[{"line-clamp":[qe,"none",be,P_]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",be,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",be,ei]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[qe,"auto",be,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,ke]}],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",be,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:xe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Pa,be,ke],radial:["",be,ke],conic:[Pa,be,ke]},tj,Q3]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:Re()}],"gradient-via-pos":[{via:Re()}],"gradient-to-pos":[{to:Re()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:Pe()}],"rounded-s":[{"rounded-s":Pe()}],"rounded-e":[{"rounded-e":Pe()}],"rounded-t":[{"rounded-t":Pe()}],"rounded-r":[{"rounded-r":Pe()}],"rounded-b":[{"rounded-b":Pe()}],"rounded-l":[{"rounded-l":Pe()}],"rounded-ss":[{"rounded-ss":Pe()}],"rounded-se":[{"rounded-se":Pe()}],"rounded-ee":[{"rounded-ee":Pe()}],"rounded-es":[{"rounded-es":Pe()}],"rounded-tl":[{"rounded-tl":Pe()}],"rounded-tr":[{"rounded-tr":Pe()}],"rounded-br":[{"rounded-br":Pe()}],"rounded-bl":[{"rounded-bl":Pe()}],"border-w":[{border:Te()}],"border-w-x":[{"border-x":Te()}],"border-w-y":[{"border-y":Te()}],"border-w-s":[{"border-s":Te()}],"border-w-e":[{"border-e":Te()}],"border-w-bs":[{"border-bs":Te()}],"border-w-be":[{"border-be":Te()}],"border-w-t":[{"border-t":Te()}],"border-w-r":[{"border-r":Te()}],"border-w-b":[{"border-b":Te()}],"border-w-l":[{"border-l":Te()}],"divide-x":[{"divide-x":Te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ge(),"hidden","none"]}],"divide-style":[{divide:[...Ge(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-bs":[{"border-bs":H()}],"border-color-be":[{"border-be":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...Ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,be,ke]}],"outline-w":[{outline:["",qe,ms,ei]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",m,Pc,xc]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",y,Pc,xc]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:Te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[qe,ei]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":Te()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",k,Pc,xc]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[qe,be,ke]}],"mix-blend":[{"mix-blend":[...Qe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Qe()}],"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":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ue()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":Ue()}],"mask-image-t-to-pos":[{"mask-t-to":Ue()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":Ue()}],"mask-image-r-to-pos":[{"mask-r-to":Ue()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":Ue()}],"mask-image-b-to-pos":[{"mask-b-to":Ue()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":Ue()}],"mask-image-l-to-pos":[{"mask-l-to":Ue()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":Ue()}],"mask-image-x-to-pos":[{"mask-x-to":Ue()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":Ue()}],"mask-image-y-to-pos":[{"mask-y-to":Ue()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[be,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ue()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"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":O()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ue()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:xe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,ke]}],filter:[{filter:["","none",be,ke]}],blur:[{blur:jt()}],brightness:[{brightness:[qe,be,ke]}],contrast:[{contrast:[qe,be,ke]}],"drop-shadow":[{"drop-shadow":["","none",w,Pc,xc]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",qe,be,ke]}],"hue-rotate":[{"hue-rotate":[qe,be,ke]}],invert:[{invert:["",qe,be,ke]}],saturate:[{saturate:[qe,be,ke]}],sepia:[{sepia:["",qe,be,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",be,ke]}],"backdrop-blur":[{"backdrop-blur":jt()}],"backdrop-brightness":[{"backdrop-brightness":[qe,be,ke]}],"backdrop-contrast":[{"backdrop-contrast":[qe,be,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,be,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,be,ke]}],"backdrop-invert":[{"backdrop-invert":["",qe,be,ke]}],"backdrop-opacity":[{"backdrop-opacity":[qe,be,ke]}],"backdrop-saturate":[{"backdrop-saturate":[qe,be,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,be,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",be,ke]}],ease:[{ease:["linear","initial",D,be,ke]}],delay:[{delay:[qe,be,ke]}],animate:[{animate:["none",L,be,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,be,ke]}],"perspective-origin":[{"perspective-origin":G()}],rotate:[{rotate:Hn()}],"rotate-x":[{"rotate-x":Hn()}],"rotate-y":[{"rotate-y":Hn()}],"rotate-z":[{"rotate-z":Hn()}],scale:[{scale:Cr()}],"scale-x":[{"scale-x":Cr()}],"scale-y":[{"scale-y":Cr()}],"scale-z":[{"scale-z":Cr()}],"scale-3d":["scale-3d"],skew:[{skew:pt()}],"skew-x":[{"skew-x":pt()}],"skew-y":[{"skew-y":pt()}],transform:[{transform:[be,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:G()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:en()}],"translate-x":[{"translate-x":en()}],"translate-y":[{"translate-y":en()}],"translate-z":[{"translate-z":en()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"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",be,ke]}],"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":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",be,ke]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[qe,ms,ei,P_]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-bs","border-w-be","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-bs","border-color-be","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-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]}},ij=j3(aj);function Tt(...e){return ij(g3(e))}const oj=N.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[N.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1Z",fill:"#4285F4"}),N.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23Z",fill:"#34A853"}),N.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18A10.96 10.96 0 0 0 1 12c0 1.77.42 3.44 1.18 4.93l3.66-2.84Z",fill:"#FBBC05"}),N.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53Z",fill:"#EA4335"})]}),sj=N.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:N.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12Z"})}),lj={google:oj,github:sj},cj={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",apple:"Apple"};function uj(e){return cj[e]||String(e||"").replace(/-/g," ")}function dj(){Qs();const{isOpen:e,closeLoginModal:t}=j0(),{enabled:n,signedIn:a,refreshUser:o,signInWithPassword:s,signUp:c,signInWithOAuth:u,getPublicAuthConfig:h}=Zs(),[f,m]=b.useState("signin"),[y,k]=b.useState(""),[w,x]=b.useState(""),[C,S]=b.useState(""),[D,L]=b.useState(!1),[R,O]=b.useState(null),[G,W]=b.useState(null),[z,P]=b.useState(!1),[Y,X]=b.useState(!0),[de,se]=b.useState([]),[Ae,fe]=b.useState(8);b.useEffect(()=>{e&&(O(null),W(null),m("signin"),k(""),x(""),S(""),P(!1))},[e]),b.useEffect(()=>{if(!e||!n){X(!1);return}let K=!0;return(async()=>{const{data:Z,error:H}=await h();if(K){if(H||!Z)se(["google","github"]);else{const I=Array.isArray(Z.oAuthProviders)?Z.oAuthProviders:[],q=Array.isArray(Z.customOAuthProviders)?Z.customOAuthProviders:[];se([...I,...q]),typeof Z.passwordMinLength=="number"&&Z.passwordMinLength>0&&fe(Z.passwordMinLength)}X(!1)}})(),()=>{K=!1}},[e,n,h]),b.useEffect(()=>{e&&a&&t()},[e,a,t]);const le=b.useMemo(()=>typeof window>"u"?"":!!window.webkit?.messageHandlers?.nativeOAuth?`${window.location.origin}/auth/callback`:`${window.location.origin}/`,[]),pe=b.useCallback(async K=>{O(null),L(!0);try{const{error:Z}=await u(K,le);Z&&O(Z.message||String(Z))}finally{L(!1)}},[u,le]),Ne=b.useCallback(async K=>{K.preventDefault(),O(null),L(!0);try{if(f==="signup"){const{data:H,error:I}=await c({email:y.trim(),password:w,name:C.trim()||void 0});if(I){O(I.message||String(I));return}if(H?.requireEmailVerification){W(Fe("login.verify_email_pending")),m("signin");return}await o();return}const{error:Z}=await s({email:y.trim(),password:w});if(Z){O(Z.message||String(Z));return}await o()}finally{L(!1)}},[f,y,w,C,c,s,o]);return b.useEffect(()=>{if(!e)return;const K=Z=>{Z.key==="Escape"&&t()};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[e,t]),n?N.jsx(lO,{children:e&&N.jsxs(ef.div,{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[N.jsx(ef.div,{className:"absolute inset-0 bg-black/40 dark:bg-black/60 ",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),N.jsxs(ef.div,{className:"relative w-full max-w-[420px] rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 p-6 shadow-2xl",initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.2},onClick:K=>K.stopPropagation(),children:[N.jsx("button",{type:"button",onClick:t,className:"absolute right-4 top-4 text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:N.jsx(I0,{className:"h-5 w-5"})}),N.jsxs("div",{className:"text-center mb-6",children:[N.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[N.jsx("img",{src:"/app-icon.png",alt:"",width:28,height:28,className:"rounded-md"}),N.jsx("span",{className:"text-lg font-semibold text-oai-black dark:text-white",children:"Token Tracker"})]}),N.jsx("p",{className:"text-sm text-oai-gray-500",children:Fe("login_modal.subtitle")})]}),G&&N.jsx("div",{className:"mb-4 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900/50 px-3 py-2 text-xs text-oai-gray-700 dark:text-oai-gray-300",children:G}),R&&N.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",role:"alert",children:R}),N.jsx("div",{className:"space-y-2.5 mb-5",children:Y?N.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900 animate-pulse"}):de.map(K=>N.jsxs("button",{type:"button",disabled:D,onClick:()=>pe(K),className:Tt("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors disabled:opacity-50","flex items-center justify-center gap-2.5"),children:[lj[K]||null,Fe("login.oauth.continue",{provider:uj(K)})]},K))}),z?N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"relative mb-5",children:[N.jsx("div",{className:"absolute inset-0 flex items-center",children:N.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),N.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:N.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login_modal.divider_email")})})]}),N.jsxs("div",{className:"flex rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 p-0.5 bg-oai-gray-50 dark:bg-oai-gray-900/50 mb-4",children:[N.jsx("button",{type:"button",className:Tt("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="signin"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{m("signin"),O(null)},children:Fe("login.tab.sign_in")}),N.jsx("button",{type:"button",className:Tt("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",f==="signup"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{m("signup"),O(null)},children:Fe("login.tab.sign_up")})]}),N.jsxs("form",{onSubmit:Ne,className:"space-y-3",children:[f==="signup"&&N.jsxs("div",{children:[N.jsx("label",{htmlFor:"modal-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.name")}),N.jsx("input",{id:"modal-name",type:"text",autoComplete:"name",value:C,onChange:K=>S(K.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:Fe("login.field.name_placeholder")})]}),N.jsxs("div",{children:[N.jsx("label",{htmlFor:"modal-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.email")}),N.jsx("input",{id:"modal-email",type:"email",autoComplete:"email",required:!0,value:y,onChange:K=>k(K.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),N.jsxs("div",{children:[N.jsx("label",{htmlFor:"modal-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:Fe("login.field.password")}),N.jsx("input",{id:"modal-password",type:"password",autoComplete:f==="signup"?"new-password":"current-password",required:!0,minLength:f==="signup"?Ae:void 0,value:w,onChange:K=>x(K.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),f==="signup"&&N.jsx("p",{className:"mt-1 text-xs text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login.password_hint",{min:String(Ae)})})]}),N.jsx("button",{type:"submit",disabled:D,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:Fe(f==="signup"?"login.submit.sign_up":"login.submit.sign_in")})]})]}):N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"relative mb-5",children:[N.jsx("div",{className:"absolute inset-0 flex items-center",children:N.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),N.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:N.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:Fe("login.divider")})})]}),N.jsxs("button",{type:"button",onClick:()=>P(!0),className:Tt("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors","flex items-center justify-center gap-2.5"),children:[N.jsx(GD,{className:"h-[18px] w-[18px] text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75}),Fe("login_modal.continue_email")]})]})]})]})}):null}const hj={VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app"};function fj(){if(typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"))return"";const t=typeof import.meta<"u"?hj:void 0;return(t?.VITE_TOKENTRACKER_BACKEND_BASE_URL||t?.VITE_INSFORGE_BASE_URL||Wr()).trim()}function G4(){return Wr()}function pj(e=""){if(typeof e!="string"||e.length===0)return!1;const t=new URLSearchParams(e),n=String(t.get("screenshot")||"").toLowerCase();return n==="1"||n==="true"}const mj=300*1e3,gj=720*60*1e3;function fm(e){return typeof e=="string"&&/^https?:\/\//i.test(e.trim())}function yj(e,t=Date.now()){if(!e?.token||!e?.deviceId||!e?.issuedAt)return!0;const n=Date.parse(e.issuedAt);return Number.isFinite(n)?n+gj<=t:!0}async function Bx(e,t){const n=Wr();if(!fm(n)||!e)return;const a=n.replace(/\/$/,""),o=Ks(),s={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};o&&(s.apikey=o);try{await fetch(`${a}/functions/tokentracker-leaderboard-refresh`,{method:"POST",headers:s,body:JSON.stringify({period:"week",source:t})})}catch{}}async function vj(e){const t=Wr();if(!fm(t)||!e)return null;const n=t.replace(/\/$/,""),a=Ks(),o={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${e}`};a&&(o.apikey=a);const s=typeof navigator<"u"&&typeof navigator.platform=="string"?navigator.platform:"web",c=await fetch(`${n}/functions/tokentracker-device-token-issue`,{method:"POST",headers:o,body:JSON.stringify({device_name:"Token Tracker (dashboard)",platform:s})});if(!c.ok)return null;const u=await c.json().catch(()=>null),h=typeof u?.token=="string"?u.token:null,f=typeof u?.device_id=="string"?u.device_id:null;return!h||!f?null:{token:h,deviceId:f,issuedAt:typeof u?.created_at=="string"?u.created_at:new Date().toISOString()}}async function T_(e){const{deviceToken:t,insforgeBaseUrl:n}=e,a={deviceToken:t},o=n||Wr();fm(o)&&(a.insforgeBaseUrl=o.trim());const s=await Lp(),c=await fetch("/functions/tokentracker-local-sync",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...s},body:JSON.stringify(a)}),u=await c.json().catch(()=>({}));if(!c.ok){const h=typeof u.error=="string"?u.error:`HTTP ${c.status}`;throw new Error(h)}return u}async function E_(e){const t=await e();if(!t)return null;const n=r0();if(n&&!yj(n))return n;const a=await vj(t);return a?(BR(a),a):null}async function Fx(e){let t=await e();if(!t)return null;let n=await E_(async()=>t);if(!n)return t;try{return await T_({deviceToken:n.token,insforgeBaseUrl:Wr()}),t}catch(a){if(!r0()||(a0(),t=await e(),!t)||(n=await E_(async()=>t),!n))throw a;return await T_({deviceToken:n.token,insforgeBaseUrl:Wr()}),t}}async function kj(e){const t=FR();if(Date.now()-t<mj)return;const n=await Fx(e);n&&(i0(Date.now()),await Bx(n,"cloud-sync-auto"))}async function q4(e){const t=await Fx(e);t&&(i0(Date.now()),await Bx(t,"cloud-sync-now"))}function _j(e){const t=e.replace(/\/+$/,"")||"/";return t==="/share"||t==="/share.html"||t.startsWith("/share/")}function bj(e){const t=e.replace(/\/+$/,"")||"/";return t==="/login"||t==="/landing"||_j(t)?!1:t==="/"||t==="/dashboard"||t.startsWith("/leaderboard")}function wj(){const e=Fn(),t=Zs(),n=b.useRef(!1);b.useEffect(()=>{if(!jR()||!bj(e.pathname||"/")||!t.enabled||!t.signedIn||t.loading||!UR())return;let a=!1;const o=window.setTimeout(()=>{(async()=>{if(!(a||n.current)){n.current=!0;try{await kj(()=>t.getAccessToken())}catch(s){console.warn("[tokentracker] cloud usage sync:",s)}finally{n.current=!1}}})()},2500);return()=>{a=!0,window.clearTimeout(o)}},[e.pathname,t.enabled,t.signedIn,t.loading,t.getAccessToken])}function xj(){const e=b.useContext(N0);if(e===null)throw new Error("useTheme must be used within a ThemeProvider");return e}function Pj({prefersReducedMotion:e,screenshotCapture:t}){return!(t||e)}function Sj(e){if(!e||typeof e!="object")return null;const t=e.user_metadata&&typeof e.user_metadata=="object"?e.user_metadata:{},n=e.profile&&typeof e.profile=="object"?e.profile:{},a=t.avatar_url||t.picture||n.avatar_url||e.avatar_url;return typeof a=="string"&&a.trim()?a.trim():null}function Cj(e){return e?Ip()?`/api/avatar-proxy?url=${encodeURIComponent(e)}`:e:null}function Sc(e){const t=String(e||"").trim();if(!t)return"?";const n=t.split(/\s+/).filter(Boolean);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():t.slice(0,2).toUpperCase()}function A_({className:e,variant:t="header",collapsed:n=!1,onAfterAction:a}){Qs();const o=t==="sidebar",{enabled:s,loading:c,signedIn:u,user:h,displayName:f}=Zs(),{openLoginModal:m}=j0(),y=wu(),k=b.useMemo(()=>Sj(h),[h]),w=b.useMemo(()=>Cj(k),[k]),[x,C]=Rs.useState(!1);if(Rs.useEffect(()=>{C(!1)},[w]),!s)return null;if(c)return N.jsx("div",{className:Tt("h-9 w-9 shrink-0 rounded-full bg-oai-gray-200 dark:bg-oai-gray-800 animate-pulse",e),"aria-hidden":!0});if(!u)return o?N.jsxs("button",{type:"button",onClick:()=>{m(),a?.()},className:Tt("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] font-medium text-oai-gray-700 dark:text-oai-gray-300 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 min-w-0",n?"h-8 w-8 justify-center px-0":"w-full",e),"aria-label":Fe("header.auth.sign_in_aria"),title:n?Fe("header.auth.sign_in_aria"):void 0,children:[N.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:N.jsx("img",{src:"/app-icon.png",alt:"",width:18,height:18,className:"h-[18px] w-[18px] rounded"})}),!n&&N.jsx("span",{className:"truncate flex-1 text-left",children:Fe("header.auth.sign_in_aria")})]}):N.jsx("button",{type:"button",onClick:m,className:Tt("shrink-0 inline-flex h-9 items-center justify-center gap-1.5 rounded-full px-5 text-sm font-medium transition-colors duration-200 ease-out shadow-sm ring-1 ring-oai-gray-200 dark:ring-white/10 bg-oai-gray-900 text-white hover:bg-oai-gray-800 active:bg-oai-gray-950 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 dark:active:bg-oai-gray-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-oai-gray-950",e),"aria-label":Fe("header.auth.sign_in_aria"),children:Fe("header.auth.sign_in_aria")});const S=()=>{y("/settings"),a?.()};return N.jsx("div",{className:Tt(o?"relative flex w-full shrink-0 items-center":"relative flex shrink-0 items-center",e),children:N.jsxs("button",{type:"button",onClick:S,className:Tt(o?Tt("flex w-full items-center gap-2 rounded-md px-2 py-1.5 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 transition-colors min-w-0",n&&"justify-center px-0 py-0 h-9 w-9"):"flex items-center gap-2 rounded-full pl-1 pr-2 py-1 border border-transparent hover:bg-oai-gray-100 dark:hover:bg-oai-gray-900/80 hover:border-oai-gray-200 dark:hover:border-oai-gray-800 transition-colors"),"aria-label":Fe("header.auth.open_settings"),title:o&&n?f:void 0,children:[o?N.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:w&&!x?N.jsx("img",{src:w,alt:"",width:20,height:20,className:"h-5 w-5 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700",referrerPolicy:"no-referrer",onError:()=>C(!0)}):Sc(f)==="?"?N.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:N.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-3 h-3 opacity-80",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):N.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-oai-brand-600 text-[9px] font-semibold text-white ring-1 ring-oai-brand-500/50",children:Sc(f)})}):w&&!x?N.jsx("img",{src:w,alt:"",width:32,height:32,className:"h-8 w-8 rounded-full object-cover ring-1 ring-oai-gray-300 dark:ring-oai-gray-700 shrink-0",referrerPolicy:"no-referrer",onError:()=>C(!0)}):Sc(f)==="?"?N.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600/30 text-white ring-1 ring-oai-brand-500/50",children:N.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"w-4 h-4 opacity-80",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})})}):N.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-oai-brand-600 text-xs font-semibold text-white ring-1 ring-oai-brand-500/50",children:Sc(f)}),o?!n&&N.jsx("span",{className:"truncate text-[13px] font-medium text-oai-gray-900 dark:text-oai-gray-200 flex-1 text-left min-w-0",children:f}):N.jsx("span",{className:"hidden sm:inline truncate text-sm font-medium text-oai-gray-900 dark:text-oai-gray-200 max-w-[120px]",children:f})]})})}const Xf="tt.sidebarCollapsed";function Tj(){return[{id:"general",label:Fe("nav.group.general"),items:[{id:"usage",to:"/dashboard",icon:BD,label:Fe("nav.usage")},{id:"limits",to:"/limits",icon:VD,label:Fe("nav.limits")},{id:"leaderboard",to:"/leaderboard",icon:cM,label:Fe("nav.leaderboard")}]},{id:"tools",label:Fe("nav.group.tools"),items:[{id:"widgets",to:"/widgets",icon:WD,label:Fe("nav.widgets")},{id:"skills",to:"/skills",icon:eM,label:Fe("nav.skills")},{id:"ip-check",to:"/ip-check",icon:$D,label:Fe("nav.ip_check")}]},{id:"account",label:Fe("nav.group.account"),items:[{id:"settings",to:"/settings",icon:aM,label:Fe("nav.settings")}]}]}function Ej(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Xf)==="1"}catch{return!1}}function Aj(){const[e,t]=b.useState(Ej),n=b.useCallback(()=>{t(a=>{const o=!a;try{typeof window<"u"&&window.localStorage.setItem(Xf,o?"1":"0")}catch{}return o})},[]);return b.useEffect(()=>{if(typeof window>"u")return;const a=o=>{o.key===Xf&&t(o.newValue==="1")};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)},[]),{collapsed:e,toggle:n}}function Rj(e,t){const n=e.replace(/\/+$/,"")||"/";return t==="/dashboard"?n==="/dashboard"||n==="/":t==="/leaderboard"?n==="/leaderboard"||n.startsWith("/leaderboard/"):n===t}function Lj({label:e,collapsed:t,first:n}){return t?n?null:N.jsx("div",{className:"mx-2 my-2 h-px bg-oai-gray-200/70 dark:bg-oai-gray-800/70","aria-hidden":!0}):N.jsx("div",{className:Tt("px-3 pb-1 text-[10px] uppercase tracking-wider text-oai-gray-500 dark:text-oai-gray-500",n?"pt-2":"pt-4"),children:e})}function Dj({item:e,collapsed:t,active:n,onClick:a}){const o=e.icon;return N.jsxs(Pu,{to:e.to,onClick:a,title:t?e.label:void 0,"aria-current":n?"page":void 0,className:Tt("flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] no-underline transition-colors",t&&"justify-center px-0 py-2",n?"bg-oai-gray-200/70 text-oai-black font-medium dark:bg-oai-gray-800 dark:text-white":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/50 hover:text-oai-black dark:hover:bg-oai-gray-800/60 dark:hover:text-white"),children:[N.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:N.jsx(o,{className:"h-[15px] w-[15px]","aria-hidden":!0})}),!t&&N.jsx("span",{className:"truncate",children:e.label})]})}function Mj({as:e="button",title:t,onClick:n,href:a,children:o,className:s,...c}){const u=Tt("flex h-10 w-10 items-center justify-center rounded-lg text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",s);return e==="a"?N.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",title:t,"aria-label":t,className:u,...c,children:o}):N.jsx("button",{type:"button",title:t,"aria-label":t,onClick:n,className:u,...c,children:o})}function Ij({repo:e="mm7894215/TokenTracker",glassChrome:t=!1}){const[n,a]=b.useState(null);return b.useEffect(()=>{if(typeof window>"u")return;const o=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;Pj({prefersReducedMotion:o,screenshotCapture:!1})&&fetch(`https://api.github.com/repos/${e}`).then(s=>s.json()).then(s=>{s&&typeof s.stargazers_count=="number"&&a(s.stargazers_count)}).catch(()=>{})},[e]),N.jsxs("a",{href:`https://github.com/${e}`,target:"_blank",rel:"noopener noreferrer","aria-label":n!==null?`Star on GitHub (${n})`:"Star on GitHub",className:Tt("inline-flex h-7 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",t?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:[N.jsx("svg",{height:"12",viewBox:"0 0 16 16",width:"12",className:"shrink-0 fill-current",children:N.jsx("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),N.jsx("span",{children:"Star"}),n!==null&&N.jsx("span",{className:"text-[10px] text-oai-gray-500 dark:text-oai-gray-500 tabular-nums",children:n})]})}const Nj=[{value:"light",label:"Light",Icon:M0},{value:"dark",label:"Dark",Icon:D0},{value:"system",label:"System",Icon:XD}];function Oj({theme:e,resolvedTheme:t,onSetTheme:n,glassChrome:a=!1}){const[o,s]=b.useState(!1),c=b.useRef(null),u=t==="dark"?D0:M0;return b.useEffect(()=>{if(!o)return;const h=m=>{c.current&&!c.current.contains(m.target)&&s(!1)},f=m=>{m.key==="Escape"&&s(!1)};return document.addEventListener("mousedown",h),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",f)}},[o]),N.jsxs("div",{ref:c,className:"relative",children:[N.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":o,"aria-haspopup":"menu",title:"Theme",onClick:()=>s(h=>!h),className:Tt("inline-flex h-7 w-7 items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",a?"border border-gray-500/20 dark:border-gray-500/30 bg-gray-500/[0.04] dark:bg-gray-500/[0.06] backdrop-blur-[2px] text-oai-gray-700 dark:text-oai-gray-300 hover:bg-gray-500/10 dark:hover:bg-gray-500/12 hover:border-gray-500/30 dark:hover:border-gray-500/40 hover:text-oai-black dark:hover:text-white":"border border-oai-gray-200 dark:border-oai-gray-700 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white hover:border-oai-gray-300 dark:hover:border-oai-gray-600"),children:N.jsx(u,{className:"h-3.5 w-3.5","aria-hidden":!0})}),o&&N.jsx("div",{role:"menu",className:"absolute bottom-full left-0 mb-2 z-50 min-w-[140px] py-1 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 shadow-lg",children:Nj.map(({value:h,label:f,Icon:m})=>{const y=e===h;return N.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{n(h),s(!1)},className:Tt("flex w-full items-center gap-2.5 px-3 py-1.5 text-[13px] transition-colors",y?"text-oai-black dark:text-white bg-oai-gray-100 dark:bg-oai-gray-800":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/60 hover:text-oai-black dark:hover:text-white"),children:[N.jsx(m,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":!0}),N.jsx("span",{children:f})]},h)})})]})}function Vx({collapsed:e,onToggleCollapsed:t,onItemClick:n,showCloseButton:a=!1,onClose:o,glassChrome:s=!1}){const u=Fn()?.pathname||"/",{theme:h,resolvedTheme:f,setTheme:m}=xj(),{resolvedLocale:y}=Qs(),k=b.useMemo(()=>Tj(),[y]);return N.jsxs(N.Fragment,{children:[N.jsx("div",{className:Tt("px-2 pt-2 pb-2",e&&"flex justify-center"),children:a?N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx("div",{className:"flex-1 min-w-0",children:N.jsx(A_,{variant:"sidebar",collapsed:e,onAfterAction:n})}),N.jsx("button",{type:"button",onClick:o,"aria-label":Fe("nav.close_menu"),title:Fe("nav.close_menu"),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-oai-gray-500 dark:text-oai-gray-500 hover:bg-oai-gray-200/60 dark:hover:bg-oai-gray-800 hover:text-oai-gray-900 dark:hover:text-oai-gray-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:N.jsx(I0,{className:"h-4 w-4",strokeWidth:1.75,"aria-hidden":!0})})]}):N.jsx(A_,{variant:"sidebar",collapsed:e,onAfterAction:n})}),N.jsx("nav",{"aria-label":Fe("nav.nav_label"),className:"flex-1 px-2 pb-2 flex flex-col overflow-y-auto",children:k.map((w,x)=>N.jsxs("div",{className:"flex flex-col",children:[N.jsx(Lj,{label:w.label,collapsed:e,first:x===0}),N.jsx("div",{className:"flex flex-col gap-0.5",children:w.items.map(C=>N.jsx(Dj,{item:C,collapsed:e,active:Rj(u,C.to),onClick:n},C.id))})]},w.id))}),N.jsxs("div",{className:Tt("flex items-center px-2 py-3",e?"flex-col justify-center gap-2":"justify-between gap-2"),children:[N.jsx(Oj,{theme:h,resolvedTheme:f,onSetTheme:m,glassChrome:s}),N.jsx("div",{className:"flex items-center gap-1.5",children:!e&&N.jsx(Ij,{glassChrome:s})})]})]})}function jj({collapsed:e,onToggleCollapsed:t}){const n=b.useMemo(()=>typeof window>"u"?!1:ar()||Ip(),[]);return N.jsx("aside",{"aria-label":Fe("nav.aside_label"),className:Tt("hidden lg:flex flex-col shrink-0 h-full min-h-0 transition-[width] duration-200",e?"w-[72px]":"w-[220px]"),children:N.jsx(Vx,{collapsed:e,onToggleCollapsed:t,glassChrome:n})})}function Uj({open:e,onClose:t}){return b.useEffect(()=>{if(!e)return;const n=a=>{a.key==="Escape"&&t()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,t]),b.useEffect(()=>{if(!e)return;const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}},[e]),e?N.jsxs("div",{className:"lg:hidden fixed inset-0 z-[80] flex",children:[N.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:t,"aria-hidden":!0}),N.jsx("aside",{"aria-label":Fe("nav.aside_label"),className:"relative w-[260px] max-w-[80vw] flex flex-col bg-oai-white dark:bg-oai-gray-900 border-r border-oai-gray-200 dark:border-oai-gray-800 shadow-2xl",children:N.jsx(Vx,{collapsed:!1,showCloseButton:!0,onClose:t,onItemClick:t})})]}):null}function Bj({onOpenDrawer:e}){return N.jsxs("div",{className:"lg:hidden flex items-center justify-between gap-2 px-3 h-14 border-b border-oai-gray-200 dark:border-oai-gray-800",children:[N.jsx(Mj,{title:Fe("nav.menu"),onClick:e,children:N.jsx(YD,{className:"h-5 w-5","aria-hidden":!0})}),N.jsxs(Pu,{to:"/landing",className:"flex items-center gap-2 no-underline hover:opacity-80 transition-opacity","aria-label":"Token Tracker",children:[N.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),N.jsx("span",{className:"text-sm font-semibold text-oai-black dark:text-oai-white",children:"Token Tracker"})]}),N.jsx("div",{className:"w-10 shrink-0","aria-hidden":!0})]})}function Fj({children:e}){const{collapsed:t,toggle:n}=Aj(),[a,o]=b.useState(!1),s=b.useCallback(()=>o(!0),[]),c=b.useCallback(()=>o(!1),[]),u=b.useMemo(()=>typeof window>"u"?!1:ar()||Ip(),[]);return N.jsxs("div",{className:Tt("fixed inset-0 flex flex-col text-oai-black dark:text-oai-white font-sans overflow-hidden",u?"bg-transparent":"bg-oai-gray-100 dark:bg-oai-gray-950"),children:[u&&N.jsx("div",{className:"h-7 shrink-0",style:{WebkitAppRegion:"drag"},"aria-hidden":!0}),N.jsxs("div",{className:"flex-1 min-h-0 flex",children:[N.jsx(jj,{collapsed:t,onToggleCollapsed:n}),N.jsx(Uj,{open:a,onClose:c}),N.jsx("div",{className:"flex-1 min-w-0 min-h-0 p-2 lg:pl-0 lg:pr-3 lg:pb-3 flex flex-col",children:N.jsxs("div",{className:Tt("flex-1 min-h-0 flex flex-col bg-oai-white dark:bg-oai-gray-900 border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",u?"tt-native-main-card":"rounded-2xl",!u&&"shadow-sm"),children:[N.jsx(Bj,{onOpenDrawer:s}),N.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:e})]})})]})]})}const Vj=typeof window<"u"?window.location.search:"",R_=new URLSearchParams(Vj),Cc=R_.get("insforge_code")||R_.get("code")||null,zj=typeof window<"u"&&!!window.webkit?.messageHandlers?.nativeOAuth;function $j(){Qs();const{loading:e,signedIn:t}=Zs(),n=wu(),[a,o]=b.useState("processing"),[s,c]=b.useState(null),u=b.useRef(!1);b.useEffect(()=>{if(!(!Cc||u.current)){if(u.current=!0,zj){c(!1);return}(async()=>{try{const m=await(await fetch("/api/auth-bridge/verifier")).json();c(!!m?.native)}catch{c(!1)}})()}},[]),b.useEffect(()=>{if(s!==!0||!Cc)return;o("redirecting");const f=setTimeout(()=>{window.location.href=`tokentracker://auth/callback?insforge_code=${encodeURIComponent(Cc)}`},200);return()=>clearTimeout(f)},[s]),b.useEffect(()=>{if(s!==!1||e)return;if(t){n("/dashboard",{replace:!0});return}const f=setTimeout(()=>{t||o("failed")},12e3);return()=>clearTimeout(f)},[s,e,t,n]),b.useEffect(()=>{if(!Cc&&s===null){const f=setTimeout(()=>o("failed"),3e3);return()=>clearTimeout(f)}},[s]);const h=()=>{n("/dashboard",{replace:!0})};return a==="processing"&&s!==!0&&(s===null||s===!1&&e)?N.jsx("div",{className:"min-h-screen bg-oai-gray-950"}):N.jsx("div",{className:"min-h-screen bg-oai-gray-950 text-white font-oai antialiased dark flex items-center justify-center",children:N.jsxs("div",{className:"text-center space-y-4 max-w-sm px-4",children:[a==="processing"&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"w-8 h-8 border-2 border-oai-gray-600 border-t-white rounded-full animate-spin mx-auto"}),N.jsx("p",{className:"text-oai-gray-400 text-sm",children:Fe("auth.callback.processing")})]}),a==="redirecting"&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-green-500/15 flex items-center justify-center",children:N.jsx("svg",{className:"w-6 h-6 text-green-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:N.jsx("path",{d:"M20 6 9 17l-5-5"})})}),N.jsx("p",{className:"text-white text-sm font-medium",children:Fe("auth.callback.success")}),N.jsx("p",{className:"text-oai-gray-500 text-xs",children:Fe("auth.callback.redirecting")})]}),a==="failed"&&N.jsxs("div",{className:"space-y-3",children:[N.jsx("p",{className:"text-oai-gray-300 text-sm",children:Fe("auth.callback.failed")}),N.jsx("button",{type:"button",onClick:h,className:"px-4 py-2 rounded-lg bg-oai-gray-800 text-sm text-white hover:bg-oai-gray-700 transition-colors",children:Fe("auth.callback.close")})]})]})})}const Hj=b.lazy(()=>$n(()=>import("./DashboardPage-u0vbeset.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])).then(e=>({default:e.DashboardPage}))),Wj=b.lazy(()=>$n(()=>import("./IpCheckPage-BAJ9oJk5.js"),[])),Kj=b.lazy(()=>$n(()=>import("./LandingPage-Bi7T_UG3.js"),__vite__mapDeps([11,12,8])).then(e=>({default:e.LandingPage}))),Gj=b.lazy(()=>$n(()=>import("./LeaderboardPage-BMLXmGUV.js"),__vite__mapDeps([13,9,2,14,15])).then(e=>({default:e.LeaderboardPage}))),qj=b.lazy(()=>$n(()=>import("./LeaderboardProfilePage-BoI-B3yY.js"),__vite__mapDeps([16,2,12,17,14,9,3,4,18,5])).then(e=>({default:e.LeaderboardProfilePage}))),Yj=b.lazy(()=>$n(()=>import("./LimitsPage-DFntRPF-.js"),__vite__mapDeps([19,1,20,7,10,8,21,18,22])).then(e=>({default:e.LimitsPage}))),Zj=b.lazy(()=>$n(()=>import("./LoginPage-J437b8fG.js"),[]).then(e=>({default:e.LoginPage}))),Xj=b.lazy(()=>$n(()=>import("./DevicePage-9mF2GYDM.js"),[])),Qj=b.lazy(()=>$n(()=>import("./WrappedPage-57yACpcn.js"),[])),Jj=b.lazy(()=>$n(()=>import("./SettingsPage-Ce-EIZCo.js"),__vite__mapDeps([23,20,24,7,25,2,15,4,22])).then(e=>({default:e.SettingsPage}))),e4=b.lazy(()=>$n(()=>import("./SkillsPage-BCg2tPe8.js"),__vite__mapDeps([26,21,18,22,7,5,4,9,25,6,8,15])).then(e=>({default:e.SkillsPage}))),t4=b.lazy(()=>$n(()=>import("./WidgetsPage-B8eoNh1B.js"),__vite__mapDeps([27,24,7,10,8,18,22,15])).then(e=>({default:e.WidgetsPage})));function n4(){const{resolvedLocale:e}=Qs(),t=Fn(),n=Zs();wj();const a=Sn(),o=b.useMemo(()=>typeof window>"u"?!1:pj(window.location.search),[]),s=t?.pathname||"/",c=new URL(window.location.href),u=c.pathname.replace(/\/+$/,"")||"/",f=u.match(/^\/share\/([^/?#]+)$/i)?.[1]||null,m=c.searchParams.get("token")||null,y=f||m,k=u==="/share"||u==="/share.html"||u.startsWith("/share/"),w=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),x=s.replace(/\/+$/,"")||"/",C=x==="/leaderboard",S=x.match(/^\/u\/([^/]+)$/i),D=S?S[1]:null,L=!!(n.enabled&&n.signedIn),R=w||L,O=!1,G=fj(),W=b.useMemo(()=>!n.enabled||!L?null:{getAccessToken:()=>n.getAccessToken(),name:n.displayName||"",userId:n.user?.id||null},[L,n]);let z=w||a||o?"dashboard":"landing";x==="/landing"&&(z="landing"),x==="/dashboard"&&(z="dashboard"),C&&(z="dashboard"),D&&(z="dashboard");const P=x==="/limits",Y=x==="/settings",X=x==="/skills",de=x==="/widgets",se=x==="/ip-check";(P||Y||X||de||se)&&(z="dashboard");let Ae=Hj;D?Ae=qj:x==="/leaderboard"?Ae=Gj:P?Ae=Yj:Y?Ae=Jj:X?Ae=e4:de?Ae=t4:se&&(Ae=Wj);const fe=!k&&(x==="/dashboard"||x==="/"||C||P||Y||X||de||se);let le=null;if(x==="/auth/callback"||x==="/auth/native-callback")le=N.jsx($j,{});else if(x==="/login")le=N.jsx(Zj,{});else if(x==="/device")le=N.jsx(Xj,{});else if(x==="/wrapped")le=N.jsx(Qj,{});else if(z==="landing")le=N.jsx(Kj,{signInUrl:"/login",signUpUrl:"/login"});else{const pe=N.jsx(Ae,{baseUrl:G,auth:W,signedIn:R,sessionSoftExpired:O,signOut:()=>n.enabled?n.signOut():Promise.resolve(),publicMode:k,publicToken:y,userId:D,signInUrl:"/login",signUpUrl:"/login"},e);fe?le=N.jsx(Fj,{children:pe}):le=pe}return N.jsx(hM,{children:N.jsx(mM,{children:N.jsxs(gM,{children:[N.jsx(b.Suspense,{fallback:null,children:le}),N.jsx(dj,{}),N.jsx(_D,{}),N.jsx(LD,{})]})})})}const r4=W1([{path:"*",element:N.jsx(n4,{})}]);MS.createRoot(document.getElementById("root")).render(N.jsx(Rs.StrictMode,{children:N.jsx(JL,{children:N.jsx(oD,{children:N.jsx(RL,{children:N.jsx(aT,{router:r4})})})})}));export{Aa as $,g0 as A,Fe as B,N as C,ef as D,Nc as E,S4 as F,P4 as G,Ns as H,dM as I,pu as J,O4 as K,Pu as L,lm as M,m4 as N,p4 as O,lO as P,xj as Q,Rs as R,Tt as S,j0 as T,Zs as U,b4 as V,A4 as W,I0 as X,Qs as Y,pj as Z,$n as _,Gt as a,M4 as a0,C4 as a1,YR as a2,g4 as a3,y4 as a4,I4 as a5,x4 as a6,_4 as a7,A_ as a8,rT as a9,Ep as aA,Lp as aB,H4 as aC,ar as aD,Ip as aE,z4 as aF,W4 as aG,$4 as aH,Ss as aI,Fw as aJ,WI as aK,$f as aL,D4 as aM,ES as aN,Qf as aO,Fn as aa,wu as ab,G4 as ac,UR as ad,d4 as ae,q4 as af,h4 as ag,L4 as ah,Pj as ai,aM as aj,F4 as ak,a4 as al,NR as am,Op as an,jR as ao,Zv as ap,R4 as aq,M0 as ar,D0 as as,XD as at,mo as au,iu as av,Dp as aw,w4 as ax,nM as ay,iD as az,U0 as b,dn as c,Na as d,kk as e,dt as f,y0 as g,Sn as h,h2 as i,f4 as j,$R as k,V4 as l,yo as m,aL as n,iL as o,j4 as p,k4 as q,b as r,E4 as s,U4 as t,jp as u,B4 as v,v4 as w,yt as x,T4 as y,N4 as z};