convex-cms 0.0.9-alpha.3 → 0.0.9-alpha.6

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 (76) hide show
  1. package/admin/src/embed/index.tsx +57 -67
  2. package/admin/src/embed/pages/Entry.tsx +4 -5
  3. package/admin/src/embed/pages/NewEntry.tsx +2 -1
  4. package/admin/src/embed/types.ts +0 -1
  5. package/admin-dist/nitro.json +1 -1
  6. package/admin-dist/public/assets/{CmsEmptyState-BM4e6N83.js → CmsEmptyState-la_kLGHv.js} +1 -1
  7. package/admin-dist/public/assets/{CmsPageHeader-uor3DPIk.js → CmsPageHeader-Cf0SafVG.js} +1 -1
  8. package/admin-dist/public/assets/{CmsStatusBadge-D8N18LJx.js → CmsStatusBadge-BovugIHH.js} +1 -1
  9. package/admin-dist/public/assets/{CmsSurface-BEcY-WpI.js → CmsSurface-Dp1TegU4.js} +1 -1
  10. package/admin-dist/public/assets/{CmsToolbar-DE-bu3W8.js → CmsToolbar-B1zdfMu0.js} +1 -1
  11. package/admin-dist/public/assets/{ContentEntryEditor-BdkIMCUk.js → ContentEntryEditor-CB--8SC3.js} +1 -1
  12. package/admin-dist/public/assets/{TaxonomyFilter-a1-O9DPs.js → TaxonomyFilter-fmZxxbdA.js} +1 -1
  13. package/admin-dist/public/assets/{_contentTypeId-XIkYOLyY.js → _contentTypeId-vT09P77i.js} +1 -1
  14. package/admin-dist/public/assets/{_entryId-DyP15QpI.js → _entryId-Dhq6ybYt.js} +1 -1
  15. package/admin-dist/public/assets/{alert-DHBQuuib.js → alert-DfdkD-ZZ.js} +1 -1
  16. package/admin-dist/public/assets/{badge-BOhWFWzb.js → badge-Cmc3T9vs.js} +1 -1
  17. package/admin-dist/public/assets/{circle-check-big-DjTNapen.js → circle-check-big-B8AJAcBi.js} +1 -1
  18. package/admin-dist/public/assets/{command-BIc5_8gL.js → command-BsmkQ6_j.js} +1 -1
  19. package/admin-dist/public/assets/{content-C3N8Ugra.js → content-DdQ1u7T4.js} +1 -1
  20. package/admin-dist/public/assets/{content-types-D0wh1eUF.js → content-types-QYcwm0Sy.js} +1 -1
  21. package/admin-dist/public/assets/{index-B-g3F_ri.js → index-kxLB3e43.js} +1 -1
  22. package/admin-dist/public/assets/main-BrFRroF1.js +107 -0
  23. package/admin-dist/public/assets/{media-8uh1MwDi.js → media-Cx9IyZvU.js} +1 -1
  24. package/admin-dist/public/assets/{new._contentTypeId-S96rFbgY.js → new._contentTypeId-2HsDwzy_.js} +1 -1
  25. package/admin-dist/public/assets/{pencil-DgaZav4e.js → pencil-PaJhpDeC.js} +1 -1
  26. package/admin-dist/public/assets/{refresh-cw-BBut4hAU.js → refresh-cw-D_KNzBUN.js} +1 -1
  27. package/admin-dist/public/assets/{rotate-ccw-DVCkojZZ.js → rotate-ccw-I3wzW1RQ.js} +1 -1
  28. package/admin-dist/public/assets/{scroll-area-DPC4uXzf.js → scroll-area-t72-FBB4.js} +1 -1
  29. package/admin-dist/public/assets/{search-CSyHHglh.js → search-BsuImjd-.js} +1 -1
  30. package/admin-dist/public/assets/{settings-cEqPsoJ0.js → settings-DB6TvceQ.js} +1 -1
  31. package/admin-dist/public/assets/{switch-O2BviO8Q.js → switch-DWN_fx2n.js} +1 -1
  32. package/admin-dist/public/assets/{tabs-p1MWhOqY.js → tabs-BG0vukFH.js} +1 -1
  33. package/admin-dist/public/assets/{tanstack-adapter-CDrxoPZD.js → tanstack-adapter-DHsy8Fjs.js} +1 -1
  34. package/admin-dist/public/assets/{taxonomies-DJ9UbjXW.js → taxonomies-WG8YV2pR.js} +1 -1
  35. package/admin-dist/public/assets/{trash-RnpP6lXF.js → trash-C3Lt5m9d.js} +1 -1
  36. package/admin-dist/public/assets/{useBreadcrumbLabel-zbIWXlkc.js → useBreadcrumbLabel-BC8wl3jQ.js} +1 -1
  37. package/admin-dist/public/assets/{usePermissions-4CTlK-vU.js → usePermissions-BM1Vv1YJ.js} +1 -1
  38. package/admin-dist/server/_libs/convex-helpers.mjs +37 -0
  39. package/admin-dist/server/_libs/convex.mjs +1357 -168
  40. package/admin-dist/server/_ssr/{CmsEmptyState-BA0Lc5xs.mjs → CmsEmptyState-NKmyUWD9.mjs} +1 -1
  41. package/admin-dist/server/_ssr/{CmsPageHeader-PMyecILZ.mjs → CmsPageHeader-CngxPIOg.mjs} +1 -1
  42. package/admin-dist/server/_ssr/{CmsStatusBadge-CInuN2bZ.mjs → CmsStatusBadge-D4fiHjJD.mjs} +2 -2
  43. package/admin-dist/server/_ssr/{CmsSurface-CH1PIfcS.mjs → CmsSurface-DN9I2iuX.mjs} +1 -1
  44. package/admin-dist/server/_ssr/{CmsToolbar-IuhSA7gR.mjs → CmsToolbar-ux-veU96.mjs} +1 -1
  45. package/admin-dist/server/_ssr/{ContentEntryEditor-Bzhir4fQ.mjs → ContentEntryEditor-BiY9bJr9.mjs} +9 -9
  46. package/admin-dist/server/_ssr/{TaxonomyFilter-r4izSMBh.mjs → TaxonomyFilter-BdtKJie2.mjs} +3 -3
  47. package/admin-dist/server/_ssr/{_contentTypeId-BWEbjqxY.mjs → _contentTypeId-CRo5WQVu.mjs} +12 -11
  48. package/admin-dist/server/_ssr/{_entryId-B5xoXoJf.mjs → _entryId-FnG3uc_Y.mjs} +12 -11
  49. package/admin-dist/server/_ssr/_tanstack-start-manifest_v-BbSNqRIw.mjs +4 -0
  50. package/admin-dist/server/_ssr/{badge-DXrjBRqZ.mjs → badge-D3SGS0Jp.mjs} +1 -1
  51. package/admin-dist/server/_ssr/{command-Cj90OdCX.mjs → command-2t7uTBKt.mjs} +1 -1
  52. package/admin-dist/server/_ssr/{content-DKRI-YqL.mjs → content-CCsSzXeb.mjs} +10 -9
  53. package/admin-dist/server/_ssr/{content-types-BzgRcS8K.mjs → content-types-CuVG3uSt.mjs} +7 -6
  54. package/admin-dist/server/_ssr/{index-BPf6_agY.mjs → index-CLwCLoco.mjs} +5 -4
  55. package/admin-dist/server/_ssr/index.mjs +2 -2
  56. package/admin-dist/server/_ssr/{media-MpjxOZL8.mjs → media-D3duVWkk.mjs} +11 -10
  57. package/admin-dist/server/_ssr/{new._contentTypeId-DSb4qR9j.mjs → new._contentTypeId-6uKYdgGO.mjs} +11 -10
  58. package/admin-dist/server/_ssr/router-D9Zk56-q.mjs +7979 -0
  59. package/admin-dist/server/_ssr/{scroll-area-JwVD_6MZ.mjs → scroll-area-vbjKsfFu.mjs} +1 -1
  60. package/admin-dist/server/_ssr/{settings-KVJNe0GM.mjs → settings-D7-vwjqD.mjs} +9 -8
  61. package/admin-dist/server/_ssr/{switch-DvREvRv4.mjs → switch-CbKuV4Qh.mjs} +1 -1
  62. package/admin-dist/server/_ssr/{tabs-B0h57pFf.mjs → tabs-C_IfqLiu.mjs} +2 -2
  63. package/admin-dist/server/_ssr/{tanstack-adapter-gmM64LnW.mjs → tanstack-adapter-yhyAcBi-.mjs} +1 -1
  64. package/admin-dist/server/_ssr/{taxonomies-BbBNx260.mjs → taxonomies-C15s_nvM.mjs} +9 -8
  65. package/admin-dist/server/_ssr/{trash-JAzYGh7A.mjs → trash-BPIjmAUh.mjs} +9 -8
  66. package/admin-dist/server/_ssr/{useBreadcrumbLabel-BWIujj97.mjs → useBreadcrumbLabel-BC7plG0L.mjs} +1 -1
  67. package/admin-dist/server/_ssr/{usePermissions-CcLDCSwa.mjs → usePermissions-DJ8a7bZU.mjs} +1 -1
  68. package/admin-dist/server/index.mjs +157 -157
  69. package/dist/client/index.d.ts +0 -1
  70. package/dist/client/index.d.ts.map +1 -1
  71. package/dist/client/index.js +6 -15
  72. package/dist/client/index.js.map +1 -1
  73. package/package.json +6 -1
  74. package/admin-dist/public/assets/main-BapBJgQD.js +0 -102
  75. package/admin-dist/server/_ssr/_tanstack-start-manifest_v-CBTan6ii.mjs +0 -4
  76. package/admin-dist/server/_ssr/router-Dk9ikPNc.mjs +0 -3055
@@ -0,0 +1,107 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/trash-C3Lt5m9d.js","assets/CmsPageHeader-Cf0SafVG.js","assets/CmsToolbar-B1zdfMu0.js","assets/search-BsuImjd-.js","assets/CmsEmptyState-la_kLGHv.js","assets/CmsSurface-Dp1TegU4.js","assets/badge-Cmc3T9vs.js","assets/alert-DfdkD-ZZ.js","assets/rotate-ccw-I3wzW1RQ.js","assets/tanstack-adapter-DHsy8Fjs.js","assets/taxonomies-WG8YV2pR.js","assets/pencil-PaJhpDeC.js","assets/scroll-area-t72-FBB4.js","assets/settings-DB6TvceQ.js","assets/usePermissions-BM1Vv1YJ.js","assets/switch-DWN_fx2n.js","assets/media-Cx9IyZvU.js","assets/tabs-BG0vukFH.js","assets/refresh-cw-D_KNzBUN.js","assets/TaxonomyFilter-fmZxxbdA.js","assets/command-BsmkQ6_j.js","assets/content-types-QYcwm0Sy.js","assets/content-DdQ1u7T4.js","assets/circle-check-big-B8AJAcBi.js","assets/CmsStatusBadge-BovugIHH.js","assets/index-kxLB3e43.js","assets/_entryId-Dhq6ybYt.js","assets/ContentEntryEditor-CB--8SC3.js","assets/useBreadcrumbLabel-BC8wl3jQ.js","assets/_contentTypeId-vT09P77i.js","assets/new._contentTypeId-2HsDwzy_.js"])))=>i.map(i=>d[i]);
2
+ function TO(e,t){for(var n=0;n<t.length;n++){const o=t[n];if(typeof o!="string"&&!Array.isArray(o)){for(const i in o)if(i!=="default"&&!(i in e)){const l=Object.getOwnPropertyDescriptor(o,i);l&&Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>o[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function L_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lp={exports:{}},wl={};var Gw;function CO(){if(Gw)return wl;Gw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(o,i,l){var u=null;if(l!==void 0&&(u=""+l),i.key!==void 0&&(u=""+i.key),"key"in i){l={};for(var f in i)f!=="key"&&(l[f]=i[f])}else l=i;return i=l.ref,{$$typeof:e,type:o,key:u,ref:i!==void 0?i:null,props:l}}return wl.Fragment=t,wl.jsx=n,wl.jsxs=n,wl}var Yw;function RO(){return Yw||(Yw=1,Lp.exports=CO()),Lp.exports}var b=RO(),Pp={exports:{}},Re={};var Kw;function AO(){if(Kw)return Re;Kw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),w=Symbol.iterator;function _(z){return z===null||typeof z!="object"?null:(z=w&&z[w]||z["@@iterator"],typeof z=="function"?z:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,C={};function N(z,G,re){this.props=z,this.context=G,this.refs=C,this.updater=re||R}N.prototype.isReactComponent={},N.prototype.setState=function(z,G){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,G,"setState")},N.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function k(){}k.prototype=N.prototype;function O(z,G,re){this.props=z,this.context=G,this.refs=C,this.updater=re||R}var M=O.prototype=new k;M.constructor=O,x(M,N.prototype),M.isPureReactComponent=!0;var $=Array.isArray;function V(){}var L={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function Y(z,G,re){var oe=re.ref;return{$$typeof:e,type:z,key:G,ref:oe!==void 0?oe:null,props:re}}function ie(z,G){return Y(z.type,G,z.props)}function le(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function se(z){var G={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(re){return G[re]})}var ue=/\/+/g;function ce(z,G){return typeof z=="object"&&z!==null&&z.key!=null?se(""+z.key):G.toString(36)}function ge(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(V,V):(z.status="pending",z.then(function(G){z.status==="pending"&&(z.status="fulfilled",z.value=G)},function(G){z.status==="pending"&&(z.status="rejected",z.reason=G)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function F(z,G,re,oe,de){var ve=typeof z;(ve==="undefined"||ve==="boolean")&&(z=null);var J=!1;if(z===null)J=!0;else switch(ve){case"bigint":case"string":case"number":J=!0;break;case"object":switch(z.$$typeof){case e:case t:J=!0;break;case y:return J=z._init,F(J(z._payload),G,re,oe,de)}}if(J)return de=de(z),J=oe===""?"."+ce(z,0):oe,$(de)?(re="",J!=null&&(re=J.replace(ue,"$&/")+"/"),F(de,G,re,"",function(Ce){return Ce})):de!=null&&(le(de)&&(de=ie(de,re+(de.key==null||z&&z.key===de.key?"":(""+de.key).replace(ue,"$&/")+"/")+J)),G.push(de)),1;J=0;var _e=oe===""?".":oe+":";if($(z))for(var Te=0;Te<z.length;Te++)oe=z[Te],ve=_e+ce(oe,Te),J+=F(oe,G,re,ve,de);else if(Te=_(z),typeof Te=="function")for(z=Te.call(z),Te=0;!(oe=z.next()).done;)oe=oe.value,ve=_e+ce(oe,Te++),J+=F(oe,G,re,ve,de);else if(ve==="object"){if(typeof z.then=="function")return F(ge(z),G,re,oe,de);throw G=String(z),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return J}function X(z,G,re){if(z==null)return z;var oe=[],de=0;return F(z,oe,"","",function(ve){return G.call(re,ve,de++)}),oe}function Z(z){if(z._status===-1){var G=z._result;G=G(),G.then(function(re){(z._status===0||z._status===-1)&&(z._status=1,z._result=re)},function(re){(z._status===0||z._status===-1)&&(z._status=2,z._result=re)}),z._status===-1&&(z._status=0,z._result=G)}if(z._status===1)return z._result.default;throw z._result}var ne=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},be={map:X,forEach:function(z,G,re){X(z,function(){G.apply(this,arguments)},re)},count:function(z){var G=0;return X(z,function(){G++}),G},toArray:function(z){return X(z,function(G){return G})||[]},only:function(z){if(!le(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return Re.Activity=v,Re.Children=be,Re.Component=N,Re.Fragment=n,Re.Profiler=i,Re.PureComponent=O,Re.StrictMode=o,Re.Suspense=h,Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,Re.__COMPILER_RUNTIME={__proto__:null,c:function(z){return L.H.useMemoCache(z)}},Re.cache=function(z){return function(){return z.apply(null,arguments)}},Re.cacheSignal=function(){return null},Re.cloneElement=function(z,G,re){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var oe=x({},z.props),de=z.key;if(G!=null)for(ve in G.key!==void 0&&(de=""+G.key),G)!D.call(G,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&G.ref===void 0||(oe[ve]=G[ve]);var ve=arguments.length-2;if(ve===1)oe.children=re;else if(1<ve){for(var J=Array(ve),_e=0;_e<ve;_e++)J[_e]=arguments[_e+2];oe.children=J}return Y(z.type,de,oe)},Re.createContext=function(z){return z={$$typeof:u,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:l,_context:z},z},Re.createElement=function(z,G,re){var oe,de={},ve=null;if(G!=null)for(oe in G.key!==void 0&&(ve=""+G.key),G)D.call(G,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(de[oe]=G[oe]);var J=arguments.length-2;if(J===1)de.children=re;else if(1<J){for(var _e=Array(J),Te=0;Te<J;Te++)_e[Te]=arguments[Te+2];de.children=_e}if(z&&z.defaultProps)for(oe in J=z.defaultProps,J)de[oe]===void 0&&(de[oe]=J[oe]);return Y(z,ve,de)},Re.createRef=function(){return{current:null}},Re.forwardRef=function(z){return{$$typeof:f,render:z}},Re.isValidElement=le,Re.lazy=function(z){return{$$typeof:y,_payload:{_status:-1,_result:z},_init:Z}},Re.memo=function(z,G){return{$$typeof:p,type:z,compare:G===void 0?null:G}},Re.startTransition=function(z){var G=L.T,re={};L.T=re;try{var oe=z(),de=L.S;de!==null&&de(re,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(V,ne)}catch(ve){ne(ve)}finally{G!==null&&re.types!==null&&(G.types=re.types),L.T=G}},Re.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},Re.use=function(z){return L.H.use(z)},Re.useActionState=function(z,G,re){return L.H.useActionState(z,G,re)},Re.useCallback=function(z,G){return L.H.useCallback(z,G)},Re.useContext=function(z){return L.H.useContext(z)},Re.useDebugValue=function(){},Re.useDeferredValue=function(z,G){return L.H.useDeferredValue(z,G)},Re.useEffect=function(z,G){return L.H.useEffect(z,G)},Re.useEffectEvent=function(z){return L.H.useEffectEvent(z)},Re.useId=function(){return L.H.useId()},Re.useImperativeHandle=function(z,G,re){return L.H.useImperativeHandle(z,G,re)},Re.useInsertionEffect=function(z,G){return L.H.useInsertionEffect(z,G)},Re.useLayoutEffect=function(z,G){return L.H.useLayoutEffect(z,G)},Re.useMemo=function(z,G){return L.H.useMemo(z,G)},Re.useOptimistic=function(z,G){return L.H.useOptimistic(z,G)},Re.useReducer=function(z,G,re){return L.H.useReducer(z,G,re)},Re.useRef=function(z){return L.H.useRef(z)},Re.useState=function(z){return L.H.useState(z)},Re.useSyncExternalStore=function(z,G,re){return L.H.useSyncExternalStore(z,G,re)},Re.useTransition=function(){return L.H.useTransition()},Re.version="19.2.4",Re}var Xw;function ec(){return Xw||(Xw=1,Pp.exports=AO()),Pp.exports}var S=ec();const tn=L_(S),$d=TO({__proto__:null,default:tn},[S]);var $p={exports:{}},xl={},Fp={exports:{}},Up={};var Jw;function NO(){return Jw||(Jw=1,(function(e){function t(F,X){var Z=F.length;F.push(X);e:for(;0<Z;){var ne=Z-1>>>1,be=F[ne];if(0<i(be,X))F[ne]=X,F[Z]=be,Z=ne;else break e}}function n(F){return F.length===0?null:F[0]}function o(F){if(F.length===0)return null;var X=F[0],Z=F.pop();if(Z!==X){F[0]=Z;e:for(var ne=0,be=F.length,z=be>>>1;ne<z;){var G=2*(ne+1)-1,re=F[G],oe=G+1,de=F[oe];if(0>i(re,Z))oe<be&&0>i(de,re)?(F[ne]=de,F[oe]=Z,ne=oe):(F[ne]=re,F[G]=Z,ne=G);else if(oe<be&&0>i(de,Z))F[ne]=de,F[oe]=Z,ne=oe;else break e}}return X}function i(F,X){var Z=F.sortIndex-X.sortIndex;return Z!==0?Z:F.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],p=[],y=1,v=null,w=3,_=!1,R=!1,x=!1,C=!1,N=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function M(F){for(var X=n(p);X!==null;){if(X.callback===null)o(p);else if(X.startTime<=F)o(p),X.sortIndex=X.expirationTime,t(h,X);else break;X=n(p)}}function $(F){if(x=!1,M(F),!R)if(n(h)!==null)R=!0,V||(V=!0,se());else{var X=n(p);X!==null&&ge($,X.startTime-F)}}var V=!1,L=-1,D=5,Y=-1;function ie(){return C?!0:!(e.unstable_now()-Y<D)}function le(){if(C=!1,V){var F=e.unstable_now();Y=F;var X=!0;try{e:{R=!1,x&&(x=!1,k(L),L=-1),_=!0;var Z=w;try{t:{for(M(F),v=n(h);v!==null&&!(v.expirationTime>F&&ie());){var ne=v.callback;if(typeof ne=="function"){v.callback=null,w=v.priorityLevel;var be=ne(v.expirationTime<=F);if(F=e.unstable_now(),typeof be=="function"){v.callback=be,M(F),X=!0;break t}v===n(h)&&o(h),M(F)}else o(h);v=n(h)}if(v!==null)X=!0;else{var z=n(p);z!==null&&ge($,z.startTime-F),X=!1}}break e}finally{v=null,w=Z,_=!1}X=void 0}}finally{X?se():V=!1}}}var se;if(typeof O=="function")se=function(){O(le)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,ce=ue.port2;ue.port1.onmessage=le,se=function(){ce.postMessage(null)}}else se=function(){N(le,0)};function ge(F,X){L=N(function(){F(e.unstable_now())},X)}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(F){F.callback=null},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_next=function(F){switch(w){case 1:case 2:case 3:var X=3;break;default:X=w}var Z=w;w=X;try{return F()}finally{w=Z}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(F,X){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var Z=w;w=F;try{return X()}finally{w=Z}},e.unstable_scheduleCallback=function(F,X,Z){var ne=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?ne+Z:ne):Z=ne,F){case 1:var be=-1;break;case 2:be=250;break;case 5:be=1073741823;break;case 4:be=1e4;break;default:be=5e3}return be=Z+be,F={id:y++,callback:X,priorityLevel:F,startTime:Z,expirationTime:be,sortIndex:-1},Z>ne?(F.sortIndex=Z,t(p,F),n(h)===null&&F===n(p)&&(x?(k(L),L=-1):x=!0,ge($,Z-ne))):(F.sortIndex=be,t(h,F),R||_||(R=!0,V||(V=!0,se()))),F},e.unstable_shouldYield=ie,e.unstable_wrapCallback=function(F){var X=w;return function(){var Z=w;w=X;try{return F.apply(this,arguments)}finally{w=Z}}}})(Up)),Up}var Ww;function OO(){return Ww||(Ww=1,Fp.exports=NO()),Fp.exports}var Bp={exports:{}},Wt={};var ex;function kO(){if(ex)return Wt;ex=1;var e=ec();function t(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var o={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function l(h,p,y){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:v==null?null:""+v,children:h,containerInfo:p,implementation:y}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Wt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Wt.createPortal=function(h,p){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return l(h,p,null,y)},Wt.flushSync=function(h){var p=u.T,y=o.p;try{if(u.T=null,o.p=2,h)return h()}finally{u.T=p,o.p=y,o.d.f()}},Wt.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,o.d.C(h,p))},Wt.prefetchDNS=function(h){typeof h=="string"&&o.d.D(h)},Wt.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var y=p.as,v=f(y,p.crossOrigin),w=typeof p.integrity=="string"?p.integrity:void 0,_=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?o.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:v,integrity:w,fetchPriority:_}):y==="script"&&o.d.X(h,{crossOrigin:v,integrity:w,fetchPriority:_,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Wt.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=f(p.as,p.crossOrigin);o.d.M(h,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&o.d.M(h)},Wt.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,v=f(y,p.crossOrigin);o.d.L(h,y,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Wt.preloadModule=function(h,p){if(typeof h=="string")if(p){var y=f(p.as,p.crossOrigin);o.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else o.d.m(h)},Wt.requestFormReset=function(h){o.d.r(h)},Wt.unstable_batchedUpdates=function(h,p){return h(p)},Wt.useFormState=function(h,p,y){return u.H.useFormState(h,p,y)},Wt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Wt.version="19.2.4",Wt}var tx;function P_(){if(tx)return Bp.exports;tx=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(),Bp.exports=kO(),Bp.exports}var nx;function MO(){if(nx)return xl;nx=1;var e=OO(),t=ec(),n=P_();function o(r){var s="https://react.dev/errors/"+r;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)s+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function l(r){var s=r,a=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(a=s.return),r=s.return;while(r)}return s.tag===3?a:null}function u(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function f(r){if(r.tag===31){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function h(r){if(l(r)!==r)throw Error(o(188))}function p(r){var s=r.alternate;if(!s){if(s=l(r),s===null)throw Error(o(188));return s!==r?null:r}for(var a=r,d=s;;){var m=a.return;if(m===null)break;var g=m.alternate;if(g===null){if(d=m.return,d!==null){a=d;continue}break}if(m.child===g.child){for(g=m.child;g;){if(g===a)return h(m),r;if(g===d)return h(m),s;g=g.sibling}throw Error(o(188))}if(a.return!==d.return)a=m,d=g;else{for(var E=!1,A=m.child;A;){if(A===a){E=!0,a=m,d=g;break}if(A===d){E=!0,d=m,a=g;break}A=A.sibling}if(!E){for(A=g.child;A;){if(A===a){E=!0,a=g,d=m;break}if(A===d){E=!0,d=g,a=m;break}A=A.sibling}if(!E)throw Error(o(189))}}if(a.alternate!==d)throw Error(o(190))}if(a.tag!==3)throw Error(o(188));return a.stateNode.current===a?r:s}function y(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r;for(r=r.child;r!==null;){if(s=y(r),s!==null)return s;r=r.sibling}return null}var v=Object.assign,w=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),O=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),ie=Symbol.for("react.memo_cache_sentinel"),le=Symbol.iterator;function se(r){return r===null||typeof r!="object"?null:(r=le&&r[le]||r["@@iterator"],typeof r=="function"?r:null)}var ue=Symbol.for("react.client.reference");function ce(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===ue?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case x:return"Fragment";case N:return"Profiler";case C:return"StrictMode";case $:return"Suspense";case V:return"SuspenseList";case Y:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case R:return"Portal";case O:return r.displayName||"Context";case k:return(r._context.displayName||"Context")+".Consumer";case M:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case L:return s=r.displayName||null,s!==null?s:ce(r.type)||"Memo";case D:s=r._payload,r=r._init;try{return ce(r(s))}catch{}}return null}var ge=Array.isArray,F=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},ne=[],be=-1;function z(r){return{current:r}}function G(r){0>be||(r.current=ne[be],ne[be]=null,be--)}function re(r,s){be++,ne[be]=r.current,r.current=s}var oe=z(null),de=z(null),ve=z(null),J=z(null);function _e(r,s){switch(re(ve,s),re(de,r),re(oe,null),s.nodeType){case 9:case 11:r=(r=s.documentElement)&&(r=r.namespaceURI)?yw(r):0;break;default:if(r=s.tagName,s=s.namespaceURI)s=yw(s),r=vw(s,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}G(oe),re(oe,r)}function Te(){G(oe),G(de),G(ve)}function Ce(r){r.memoizedState!==null&&re(J,r);var s=oe.current,a=vw(s,r.type);s!==a&&(re(de,r),re(oe,a))}function Oe(r){de.current===r&&(G(oe),G(de)),J.current===r&&(G(J),gl._currentValue=Z)}var je,ht;function It(r){if(je===void 0)try{throw Error()}catch(a){var s=a.stack.trim().match(/\n( *(at )?)/);je=s&&s[1]||"",ht=-1<a.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+je+r+ht}var An=!1;function qn(r,s){if(!r||An)return"";An=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(s){var te=function(){throw Error()};if(Object.defineProperty(te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(te,[])}catch(Q){var H=Q}Reflect.construct(r,[],te)}else{try{te.call()}catch(Q){H=Q}r.call(te.prototype)}}else{try{throw Error()}catch(Q){H=Q}(te=r())&&typeof te.catch=="function"&&te.catch(function(){})}}catch(Q){if(Q&&H&&typeof Q.stack=="string")return[Q.stack,H.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=d.DetermineComponentFrameRoot(),E=g[0],A=g[1];if(E&&A){var j=E.split(`
5
+ `),q=A.split(`
6
+ `);for(m=d=0;d<j.length&&!j[d].includes("DetermineComponentFrameRoot");)d++;for(;m<q.length&&!q[m].includes("DetermineComponentFrameRoot");)m++;if(d===j.length||m===q.length)for(d=j.length-1,m=q.length-1;1<=d&&0<=m&&j[d]!==q[m];)m--;for(;1<=d&&0<=m;d--,m--)if(j[d]!==q[m]){if(d!==1||m!==1)do if(d--,m--,0>m||j[d]!==q[m]){var K=`
7
+ `+j[d].replace(" at new "," at ");return r.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",r.displayName)),K}while(1<=d&&0<=m);break}}}finally{An=!1,Error.prepareStackTrace=a}return(a=r?r.displayName||r.name:"")?It(a):""}function Xt(r,s){switch(r.tag){case 26:case 27:case 5:return It(r.type);case 16:return It("Lazy");case 13:return r.child!==s&&s!==null?It("Suspense Fallback"):It("Suspense");case 19:return It("SuspenseList");case 0:case 15:return qn(r.type,!1);case 11:return qn(r.type.render,!1);case 1:return qn(r.type,!0);case 31:return It("Activity");default:return""}}function _t(r){try{var s="",a=null;do s+=Xt(r,a),a=r,r=r.return;while(r);return s}catch(d){return`
8
+ Error generating stack: `+d.message+`
9
+ `+d.stack}}var ae=Object.prototype.hasOwnProperty,ke=e.unstable_scheduleCallback,Ue=e.unstable_cancelCallback,ze=e.unstable_shouldYield,Ut=e.unstable_requestPaint,on=e.unstable_now,Ef=e.unstable_getCurrentPriorityLevel,ot=e.unstable_ImmediatePriority,Bt=e.unstable_UserBlockingPriority,Jt=e.unstable_NormalPriority,vc=e.unstable_LowPriority,Xy=e.unstable_IdlePriority,aN=e.log,lN=e.unstable_setDisableYieldValue,Aa=null,Nn=null;function go(r){if(typeof aN=="function"&&lN(r),Nn&&typeof Nn.setStrictMode=="function")try{Nn.setStrictMode(Aa,r)}catch{}}var On=Math.clz32?Math.clz32:dN,cN=Math.log,uN=Math.LN2;function dN(r){return r>>>=0,r===0?32:31-(cN(r)/uN|0)|0}var bc=256,wc=262144,xc=4194304;function fs(r){var s=r&42;if(s!==0)return s;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Sc(r,s,a){var d=r.pendingLanes;if(d===0)return 0;var m=0,g=r.suspendedLanes,E=r.pingedLanes;r=r.warmLanes;var A=d&134217727;return A!==0?(d=A&~g,d!==0?m=fs(d):(E&=A,E!==0?m=fs(E):a||(a=A&~r,a!==0&&(m=fs(a))))):(A=d&~g,A!==0?m=fs(A):E!==0?m=fs(E):a||(a=d&~r,a!==0&&(m=fs(a)))),m===0?0:s!==0&&s!==m&&(s&g)===0&&(g=m&-m,a=s&-s,g>=a||g===32&&(a&4194048)!==0)?s:m}function Na(r,s){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&s)===0}function fN(r,s){switch(r){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Jy(){var r=xc;return xc<<=1,(xc&62914560)===0&&(xc=4194304),r}function Tf(r){for(var s=[],a=0;31>a;a++)s.push(r);return s}function Oa(r,s){r.pendingLanes|=s,s!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function hN(r,s,a,d,m,g){var E=r.pendingLanes;r.pendingLanes=a,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=a,r.entangledLanes&=a,r.errorRecoveryDisabledLanes&=a,r.shellSuspendCounter=0;var A=r.entanglements,j=r.expirationTimes,q=r.hiddenUpdates;for(a=E&~a;0<a;){var K=31-On(a),te=1<<K;A[K]=0,j[K]=-1;var H=q[K];if(H!==null)for(q[K]=null,K=0;K<H.length;K++){var Q=H[K];Q!==null&&(Q.lane&=-536870913)}a&=~te}d!==0&&Wy(r,d,0),g!==0&&m===0&&r.tag!==0&&(r.suspendedLanes|=g&~(E&~s))}function Wy(r,s,a){r.pendingLanes|=s,r.suspendedLanes&=~s;var d=31-On(s);r.entangledLanes|=s,r.entanglements[d]=r.entanglements[d]|1073741824|a&261930}function ev(r,s){var a=r.entangledLanes|=s;for(r=r.entanglements;a;){var d=31-On(a),m=1<<d;m&s|r[d]&s&&(r[d]|=s),a&=~m}}function tv(r,s){var a=s&-s;return a=(a&42)!==0?1:Cf(a),(a&(r.suspendedLanes|s))!==0?0:a}function Cf(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Rf(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function nv(){var r=X.p;return r!==0?r:(r=window.event,r===void 0?32:Uw(r.type))}function rv(r,s){var a=X.p;try{return X.p=r,s()}finally{X.p=a}}var yo=Math.random().toString(36).slice(2),qt="__reactFiber$"+yo,hn="__reactProps$"+yo,ni="__reactContainer$"+yo,Af="__reactEvents$"+yo,pN="__reactListeners$"+yo,mN="__reactHandles$"+yo,ov="__reactResources$"+yo,ka="__reactMarker$"+yo;function Nf(r){delete r[qt],delete r[hn],delete r[Af],delete r[pN],delete r[mN]}function ri(r){var s=r[qt];if(s)return s;for(var a=r.parentNode;a;){if(s=a[ni]||a[qt]){if(a=s.alternate,s.child!==null||a!==null&&a.child!==null)for(r=Tw(r);r!==null;){if(a=r[qt])return a;r=Tw(r)}return s}r=a,a=r.parentNode}return null}function oi(r){if(r=r[qt]||r[ni]){var s=r.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return r}return null}function Ma(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r.stateNode;throw Error(o(33))}function si(r){var s=r[ov];return s||(s=r[ov]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function $t(r){r[ka]=!0}var sv=new Set,iv={};function hs(r,s){ii(r,s),ii(r+"Capture",s)}function ii(r,s){for(iv[r]=s,r=0;r<s.length;r++)sv.add(s[r])}var gN=RegExp("^[: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]*$"),av={},lv={};function yN(r){return ae.call(lv,r)?!0:ae.call(av,r)?!1:gN.test(r)?lv[r]=!0:(av[r]=!0,!1)}function _c(r,s,a){if(yN(s))if(a===null)r.removeAttribute(s);else{switch(typeof a){case"undefined":case"function":case"symbol":r.removeAttribute(s);return;case"boolean":var d=s.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(s);return}}r.setAttribute(s,""+a)}}function Ec(r,s,a){if(a===null)r.removeAttribute(s);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttribute(s,""+a)}}function Ur(r,s,a,d){if(d===null)r.removeAttribute(a);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(a);return}r.setAttributeNS(s,a,""+d)}}function Vn(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function cv(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function vN(r,s,a){var d=Object.getOwnPropertyDescriptor(r.constructor.prototype,s);if(!r.hasOwnProperty(s)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var m=d.get,g=d.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return m.call(this)},set:function(E){a=""+E,g.call(this,E)}}),Object.defineProperty(r,s,{enumerable:d.enumerable}),{getValue:function(){return a},setValue:function(E){a=""+E},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function Of(r){if(!r._valueTracker){var s=cv(r)?"checked":"value";r._valueTracker=vN(r,s,""+r[s])}}function uv(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var a=s.getValue(),d="";return r&&(d=cv(r)?r.checked?"true":"false":r.value),r=d,r!==a?(s.setValue(r),!0):!1}function Tc(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}}var bN=/[\n"\\]/g;function Hn(r){return r.replace(bN,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function kf(r,s,a,d,m,g,E,A){r.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?r.type=E:r.removeAttribute("type"),s!=null?E==="number"?(s===0&&r.value===""||r.value!=s)&&(r.value=""+Vn(s)):r.value!==""+Vn(s)&&(r.value=""+Vn(s)):E!=="submit"&&E!=="reset"||r.removeAttribute("value"),s!=null?Mf(r,E,Vn(s)):a!=null?Mf(r,E,Vn(a)):d!=null&&r.removeAttribute("value"),m==null&&g!=null&&(r.defaultChecked=!!g),m!=null&&(r.checked=m&&typeof m!="function"&&typeof m!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?r.name=""+Vn(A):r.removeAttribute("name")}function dv(r,s,a,d,m,g,E,A){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(r.type=g),s!=null||a!=null){if(!(g!=="submit"&&g!=="reset"||s!=null)){Of(r);return}a=a!=null?""+Vn(a):"",s=s!=null?""+Vn(s):a,A||s===r.value||(r.value=s),r.defaultValue=s}d=d??m,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=A?r.checked:!!d,r.defaultChecked=!!d,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(r.name=E),Of(r)}function Mf(r,s,a){s==="number"&&Tc(r.ownerDocument)===r||r.defaultValue===""+a||(r.defaultValue=""+a)}function ai(r,s,a,d){if(r=r.options,s){s={};for(var m=0;m<a.length;m++)s["$"+a[m]]=!0;for(a=0;a<r.length;a++)m=s.hasOwnProperty("$"+r[a].value),r[a].selected!==m&&(r[a].selected=m),m&&d&&(r[a].defaultSelected=!0)}else{for(a=""+Vn(a),s=null,m=0;m<r.length;m++){if(r[m].value===a){r[m].selected=!0,d&&(r[m].defaultSelected=!0);return}s!==null||r[m].disabled||(s=r[m])}s!==null&&(s.selected=!0)}}function fv(r,s,a){if(s!=null&&(s=""+Vn(s),s!==r.value&&(r.value=s),a==null)){r.defaultValue!==s&&(r.defaultValue=s);return}r.defaultValue=a!=null?""+Vn(a):""}function hv(r,s,a,d){if(s==null){if(d!=null){if(a!=null)throw Error(o(92));if(ge(d)){if(1<d.length)throw Error(o(93));d=d[0]}a=d}a==null&&(a=""),s=a}a=Vn(s),r.defaultValue=a,d=r.textContent,d===a&&d!==""&&d!==null&&(r.value=d),Of(r)}function li(r,s){if(s){var a=r.firstChild;if(a&&a===r.lastChild&&a.nodeType===3){a.nodeValue=s;return}}r.textContent=s}var wN=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function pv(r,s,a){var d=s.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?d?r.setProperty(s,""):s==="float"?r.cssFloat="":r[s]="":d?r.setProperty(s,a):typeof a!="number"||a===0||wN.has(s)?s==="float"?r.cssFloat=a:r[s]=(""+a).trim():r[s]=a+"px"}function mv(r,s,a){if(s!=null&&typeof s!="object")throw Error(o(62));if(r=r.style,a!=null){for(var d in a)!a.hasOwnProperty(d)||s!=null&&s.hasOwnProperty(d)||(d.indexOf("--")===0?r.setProperty(d,""):d==="float"?r.cssFloat="":r[d]="");for(var m in s)d=s[m],s.hasOwnProperty(m)&&a[m]!==d&&pv(r,m,d)}else for(var g in s)s.hasOwnProperty(g)&&pv(r,g,s[g])}function If(r){if(r.indexOf("-")===-1)return!1;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 xN=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),SN=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Cc(r){return SN.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Br(){}var Df=null;function jf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var ci=null,ui=null;function gv(r){var s=oi(r);if(s&&(r=s.stateNode)){var a=r[hn]||null;e:switch(r=s.stateNode,s.type){case"input":if(kf(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),s=a.name,a.type==="radio"&&s!=null){for(a=r;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Hn(""+s)+'"][type="radio"]'),s=0;s<a.length;s++){var d=a[s];if(d!==r&&d.form===r.form){var m=d[hn]||null;if(!m)throw Error(o(90));kf(d,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(s=0;s<a.length;s++)d=a[s],d.form===r.form&&uv(d)}break e;case"textarea":fv(r,a.value,a.defaultValue);break e;case"select":s=a.value,s!=null&&ai(r,!!a.multiple,s,!1)}}}var zf=!1;function yv(r,s,a){if(zf)return r(s,a);zf=!0;try{var d=r(s);return d}finally{if(zf=!1,(ci!==null||ui!==null)&&(hu(),ci&&(s=ci,r=ui,ui=ci=null,gv(s),r)))for(s=0;s<r.length;s++)gv(r[s])}}function Ia(r,s){var a=r.stateNode;if(a===null)return null;var d=a[hn]||null;if(d===null)return null;a=d[s];e:switch(s){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(a&&typeof a!="function")throw Error(o(231,s,typeof a));return a}var qr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lf=!1;if(qr)try{var Da={};Object.defineProperty(Da,"passive",{get:function(){Lf=!0}}),window.addEventListener("test",Da,Da),window.removeEventListener("test",Da,Da)}catch{Lf=!1}var vo=null,Pf=null,Rc=null;function vv(){if(Rc)return Rc;var r,s=Pf,a=s.length,d,m="value"in vo?vo.value:vo.textContent,g=m.length;for(r=0;r<a&&s[r]===m[r];r++);var E=a-r;for(d=1;d<=E&&s[a-d]===m[g-d];d++);return Rc=m.slice(r,1<d?1-d:void 0)}function Ac(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function Nc(){return!0}function bv(){return!1}function pn(r){function s(a,d,m,g,E){this._reactName=a,this._targetInst=m,this.type=d,this.nativeEvent=g,this.target=E,this.currentTarget=null;for(var A in r)r.hasOwnProperty(A)&&(a=r[A],this[A]=a?a(g):g[A]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Nc:bv,this.isPropagationStopped=bv,this}return v(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Nc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Nc)},persist:function(){},isPersistent:Nc}),s}var ps={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Oc=pn(ps),ja=v({},ps,{view:0,detail:0}),_N=pn(ja),$f,Ff,za,kc=v({},ja,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bf,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!==za&&(za&&r.type==="mousemove"?($f=r.screenX-za.screenX,Ff=r.screenY-za.screenY):Ff=$f=0,za=r),$f)},movementY:function(r){return"movementY"in r?r.movementY:Ff}}),wv=pn(kc),EN=v({},kc,{dataTransfer:0}),TN=pn(EN),CN=v({},ja,{relatedTarget:0}),Uf=pn(CN),RN=v({},ps,{animationName:0,elapsedTime:0,pseudoElement:0}),AN=pn(RN),NN=v({},ps,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),ON=pn(NN),kN=v({},ps,{data:0}),xv=pn(kN),MN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},IN={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"},DN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jN(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=DN[r])?!!s[r]:!1}function Bf(){return jN}var zN=v({},ja,{key:function(r){if(r.key){var s=MN[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=Ac(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?IN[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bf,charCode:function(r){return r.type==="keypress"?Ac(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Ac(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),LN=pn(zN),PN=v({},kc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sv=pn(PN),$N=v({},ja,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bf}),FN=pn($N),UN=v({},ps,{propertyName:0,elapsedTime:0,pseudoElement:0}),BN=pn(UN),qN=v({},kc,{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}),VN=pn(qN),HN=v({},ps,{newState:0,oldState:0}),ZN=pn(HN),QN=[9,13,27,32],qf=qr&&"CompositionEvent"in window,La=null;qr&&"documentMode"in document&&(La=document.documentMode);var GN=qr&&"TextEvent"in window&&!La,_v=qr&&(!qf||La&&8<La&&11>=La),Ev=" ",Tv=!1;function Cv(r,s){switch(r){case"keyup":return QN.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rv(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var di=!1;function YN(r,s){switch(r){case"compositionend":return Rv(s);case"keypress":return s.which!==32?null:(Tv=!0,Ev);case"textInput":return r=s.data,r===Ev&&Tv?null:r;default:return null}}function KN(r,s){if(di)return r==="compositionend"||!qf&&Cv(r,s)?(r=vv(),Rc=Pf=vo=null,di=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return _v&&s.locale!=="ko"?null:s.data;default:return null}}var XN={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 Av(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!XN[r.type]:s==="textarea"}function Nv(r,s,a,d){ci?ui?ui.push(d):ui=[d]:ci=d,s=wu(s,"onChange"),0<s.length&&(a=new Oc("onChange","change",null,a,d),r.push({event:a,listeners:s}))}var Pa=null,$a=null;function JN(r){dw(r,0)}function Mc(r){var s=Ma(r);if(uv(s))return r}function Ov(r,s){if(r==="change")return s}var kv=!1;if(qr){var Vf;if(qr){var Hf="oninput"in document;if(!Hf){var Mv=document.createElement("div");Mv.setAttribute("oninput","return;"),Hf=typeof Mv.oninput=="function"}Vf=Hf}else Vf=!1;kv=Vf&&(!document.documentMode||9<document.documentMode)}function Iv(){Pa&&(Pa.detachEvent("onpropertychange",Dv),$a=Pa=null)}function Dv(r){if(r.propertyName==="value"&&Mc($a)){var s=[];Nv(s,$a,r,jf(r)),yv(JN,s)}}function WN(r,s,a){r==="focusin"?(Iv(),Pa=s,$a=a,Pa.attachEvent("onpropertychange",Dv)):r==="focusout"&&Iv()}function e2(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Mc($a)}function t2(r,s){if(r==="click")return Mc(s)}function n2(r,s){if(r==="input"||r==="change")return Mc(s)}function r2(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var kn=typeof Object.is=="function"?Object.is:r2;function Fa(r,s){if(kn(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var a=Object.keys(r),d=Object.keys(s);if(a.length!==d.length)return!1;for(d=0;d<a.length;d++){var m=a[d];if(!ae.call(s,m)||!kn(r[m],s[m]))return!1}return!0}function jv(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function zv(r,s){var a=jv(r);r=0;for(var d;a;){if(a.nodeType===3){if(d=r+a.textContent.length,r<=s&&d>=s)return{node:a,offset:s-r};r=d}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=jv(a)}}function Lv(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?Lv(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function Pv(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var s=Tc(r.document);s instanceof r.HTMLIFrameElement;){try{var a=typeof s.contentWindow.location.href=="string"}catch{a=!1}if(a)r=s.contentWindow;else break;s=Tc(r.document)}return s}function Zf(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}var o2=qr&&"documentMode"in document&&11>=document.documentMode,fi=null,Qf=null,Ua=null,Gf=!1;function $v(r,s,a){var d=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Gf||fi==null||fi!==Tc(d)||(d=fi,"selectionStart"in d&&Zf(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}),Ua&&Fa(Ua,d)||(Ua=d,d=wu(Qf,"onSelect"),0<d.length&&(s=new Oc("onSelect","select",null,s,a),r.push({event:s,listeners:d}),s.target=fi)))}function ms(r,s){var a={};return a[r.toLowerCase()]=s.toLowerCase(),a["Webkit"+r]="webkit"+s,a["Moz"+r]="moz"+s,a}var hi={animationend:ms("Animation","AnimationEnd"),animationiteration:ms("Animation","AnimationIteration"),animationstart:ms("Animation","AnimationStart"),transitionrun:ms("Transition","TransitionRun"),transitionstart:ms("Transition","TransitionStart"),transitioncancel:ms("Transition","TransitionCancel"),transitionend:ms("Transition","TransitionEnd")},Yf={},Fv={};qr&&(Fv=document.createElement("div").style,"AnimationEvent"in window||(delete hi.animationend.animation,delete hi.animationiteration.animation,delete hi.animationstart.animation),"TransitionEvent"in window||delete hi.transitionend.transition);function gs(r){if(Yf[r])return Yf[r];if(!hi[r])return r;var s=hi[r],a;for(a in s)if(s.hasOwnProperty(a)&&a in Fv)return Yf[r]=s[a];return r}var Uv=gs("animationend"),Bv=gs("animationiteration"),qv=gs("animationstart"),s2=gs("transitionrun"),i2=gs("transitionstart"),a2=gs("transitioncancel"),Vv=gs("transitionend"),Hv=new Map,Kf="abort auxClick beforeToggle 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(" ");Kf.push("scrollEnd");function dr(r,s){Hv.set(r,s),hs(s,[r])}var Ic=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Zn=[],pi=0,Xf=0;function Dc(){for(var r=pi,s=Xf=pi=0;s<r;){var a=Zn[s];Zn[s++]=null;var d=Zn[s];Zn[s++]=null;var m=Zn[s];Zn[s++]=null;var g=Zn[s];if(Zn[s++]=null,d!==null&&m!==null){var E=d.pending;E===null?m.next=m:(m.next=E.next,E.next=m),d.pending=m}g!==0&&Zv(a,m,g)}}function jc(r,s,a,d){Zn[pi++]=r,Zn[pi++]=s,Zn[pi++]=a,Zn[pi++]=d,Xf|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function Jf(r,s,a,d){return jc(r,s,a,d),zc(r)}function ys(r,s){return jc(r,null,null,s),zc(r)}function Zv(r,s,a){r.lanes|=a;var d=r.alternate;d!==null&&(d.lanes|=a);for(var m=!1,g=r.return;g!==null;)g.childLanes|=a,d=g.alternate,d!==null&&(d.childLanes|=a),g.tag===22&&(r=g.stateNode,r===null||r._visibility&1||(m=!0)),r=g,g=g.return;return r.tag===3?(g=r.stateNode,m&&s!==null&&(m=31-On(a),r=g.hiddenUpdates,d=r[m],d===null?r[m]=[s]:d.push(s),s.lane=a|536870912),g):null}function zc(r){if(50<cl)throw cl=0,ap=null,Error(o(185));for(var s=r.return;s!==null;)r=s,s=r.return;return r.tag===3?r.stateNode:null}var mi={};function l2(r,s,a,d){this.tag=r,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,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,s,a,d){return new l2(r,s,a,d)}function Wf(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Vr(r,s){var a=r.alternate;return a===null?(a=Mn(r.tag,s,r.key,r.mode),a.elementType=r.elementType,a.type=r.type,a.stateNode=r.stateNode,a.alternate=r,r.alternate=a):(a.pendingProps=s,a.type=r.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=r.flags&65011712,a.childLanes=r.childLanes,a.lanes=r.lanes,a.child=r.child,a.memoizedProps=r.memoizedProps,a.memoizedState=r.memoizedState,a.updateQueue=r.updateQueue,s=r.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},a.sibling=r.sibling,a.index=r.index,a.ref=r.ref,a.refCleanup=r.refCleanup,a}function Qv(r,s){r.flags&=65011714;var a=r.alternate;return a===null?(r.childLanes=0,r.lanes=s,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=a.childLanes,r.lanes=a.lanes,r.child=a.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=a.memoizedProps,r.memoizedState=a.memoizedState,r.updateQueue=a.updateQueue,r.type=a.type,s=a.dependencies,r.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),r}function Lc(r,s,a,d,m,g){var E=0;if(d=r,typeof r=="function")Wf(r)&&(E=1);else if(typeof r=="string")E=hO(r,a,oe.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case Y:return r=Mn(31,a,s,m),r.elementType=Y,r.lanes=g,r;case x:return vs(a.children,m,g,s);case C:E=8,m|=24;break;case N:return r=Mn(12,a,s,m|2),r.elementType=N,r.lanes=g,r;case $:return r=Mn(13,a,s,m),r.elementType=$,r.lanes=g,r;case V:return r=Mn(19,a,s,m),r.elementType=V,r.lanes=g,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case O:E=10;break e;case k:E=9;break e;case M:E=11;break e;case L:E=14;break e;case D:E=16,d=null;break e}E=29,a=Error(o(130,r===null?"null":typeof r,"")),d=null}return s=Mn(E,a,s,m),s.elementType=r,s.type=d,s.lanes=g,s}function vs(r,s,a,d){return r=Mn(7,r,d,s),r.lanes=a,r}function eh(r,s,a){return r=Mn(6,r,null,s),r.lanes=a,r}function Gv(r){var s=Mn(18,null,null,0);return s.stateNode=r,s}function th(r,s,a){return s=Mn(4,r.children!==null?r.children:[],r.key,s),s.lanes=a,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}var Yv=new WeakMap;function Qn(r,s){if(typeof r=="object"&&r!==null){var a=Yv.get(r);return a!==void 0?a:(s={value:r,source:s,stack:_t(s)},Yv.set(r,s),s)}return{value:r,source:s,stack:_t(s)}}var gi=[],yi=0,Pc=null,Ba=0,Gn=[],Yn=0,bo=null,Sr=1,_r="";function Hr(r,s){gi[yi++]=Ba,gi[yi++]=Pc,Pc=r,Ba=s}function Kv(r,s,a){Gn[Yn++]=Sr,Gn[Yn++]=_r,Gn[Yn++]=bo,bo=r;var d=Sr;r=_r;var m=32-On(d)-1;d&=~(1<<m),a+=1;var g=32-On(s)+m;if(30<g){var E=m-m%5;g=(d&(1<<E)-1).toString(32),d>>=E,m-=E,Sr=1<<32-On(s)+m|a<<m|d,_r=g+r}else Sr=1<<g|a<<m|d,_r=r}function nh(r){r.return!==null&&(Hr(r,1),Kv(r,1,0))}function rh(r){for(;r===Pc;)Pc=gi[--yi],gi[yi]=null,Ba=gi[--yi],gi[yi]=null;for(;r===bo;)bo=Gn[--Yn],Gn[Yn]=null,_r=Gn[--Yn],Gn[Yn]=null,Sr=Gn[--Yn],Gn[Yn]=null}function Xv(r,s){Gn[Yn++]=Sr,Gn[Yn++]=_r,Gn[Yn++]=bo,Sr=s.id,_r=s.overflow,bo=r}var Vt=null,st=null,Be=!1,wo=null,Kn=!1,oh=Error(o(519));function xo(r){var s=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qa(Qn(s,r)),oh}function Jv(r){var s=r.stateNode,a=r.type,d=r.memoizedProps;switch(s[qt]=r,s[hn]=d,a){case"dialog":Pe("cancel",s),Pe("close",s);break;case"iframe":case"object":case"embed":Pe("load",s);break;case"video":case"audio":for(a=0;a<dl.length;a++)Pe(dl[a],s);break;case"source":Pe("error",s);break;case"img":case"image":case"link":Pe("error",s),Pe("load",s);break;case"details":Pe("toggle",s);break;case"input":Pe("invalid",s),dv(s,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Pe("invalid",s);break;case"textarea":Pe("invalid",s),hv(s,d.value,d.defaultValue,d.children)}a=d.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||s.textContent===""+a||d.suppressHydrationWarning===!0||mw(s.textContent,a)?(d.popover!=null&&(Pe("beforetoggle",s),Pe("toggle",s)),d.onScroll!=null&&Pe("scroll",s),d.onScrollEnd!=null&&Pe("scrollend",s),d.onClick!=null&&(s.onclick=Br),s=!0):s=!1,s||xo(r,!0)}function Wv(r){for(Vt=r.return;Vt;)switch(Vt.tag){case 5:case 31:case 13:Kn=!1;return;case 27:case 3:Kn=!0;return;default:Vt=Vt.return}}function vi(r){if(r!==Vt)return!1;if(!Be)return Wv(r),Be=!0,!1;var s=r.tag,a;if((a=s!==3&&s!==27)&&((a=s===5)&&(a=r.type,a=!(a!=="form"&&a!=="button")||Sp(r.type,r.memoizedProps)),a=!a),a&&st&&xo(r),Wv(r),s===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(o(317));st=Ew(r)}else if(s===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(o(317));st=Ew(r)}else s===27?(s=st,jo(r.type)?(r=Rp,Rp=null,st=r):st=s):st=Vt?Jn(r.stateNode.nextSibling):null;return!0}function bs(){st=Vt=null,Be=!1}function sh(){var r=wo;return r!==null&&(vn===null?vn=r:vn.push.apply(vn,r),wo=null),r}function qa(r){wo===null?wo=[r]:wo.push(r)}var ih=z(null),ws=null,Zr=null;function So(r,s,a){re(ih,s._currentValue),s._currentValue=a}function Qr(r){r._currentValue=ih.current,G(ih)}function ah(r,s,a){for(;r!==null;){var d=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,d!==null&&(d.childLanes|=s)):d!==null&&(d.childLanes&s)!==s&&(d.childLanes|=s),r===a)break;r=r.return}}function lh(r,s,a,d){var m=r.child;for(m!==null&&(m.return=r);m!==null;){var g=m.dependencies;if(g!==null){var E=m.child;g=g.firstContext;e:for(;g!==null;){var A=g;g=m;for(var j=0;j<s.length;j++)if(A.context===s[j]){g.lanes|=a,A=g.alternate,A!==null&&(A.lanes|=a),ah(g.return,a,r),d||(E=null);break e}g=A.next}}else if(m.tag===18){if(E=m.return,E===null)throw Error(o(341));E.lanes|=a,g=E.alternate,g!==null&&(g.lanes|=a),ah(E,a,r),E=null}else E=m.child;if(E!==null)E.return=m;else for(E=m;E!==null;){if(E===r){E=null;break}if(m=E.sibling,m!==null){m.return=E.return,E=m;break}E=E.return}m=E}}function bi(r,s,a,d){r=null;for(var m=s,g=!1;m!==null;){if(!g){if((m.flags&524288)!==0)g=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var E=m.alternate;if(E===null)throw Error(o(387));if(E=E.memoizedProps,E!==null){var A=m.type;kn(m.pendingProps.value,E.value)||(r!==null?r.push(A):r=[A])}}else if(m===J.current){if(E=m.alternate,E===null)throw Error(o(387));E.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(r!==null?r.push(gl):r=[gl])}m=m.return}r!==null&&lh(s,r,a,d),s.flags|=262144}function $c(r){for(r=r.firstContext;r!==null;){if(!kn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function xs(r){ws=r,Zr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Ht(r){return eb(ws,r)}function Fc(r,s){return ws===null&&xs(r),eb(r,s)}function eb(r,s){var a=s._currentValue;if(s={context:s,memoizedValue:a,next:null},Zr===null){if(r===null)throw Error(o(308));Zr=s,r.dependencies={lanes:0,firstContext:s},r.flags|=524288}else Zr=Zr.next=s;return a}var c2=typeof AbortController<"u"?AbortController:function(){var r=[],s=this.signal={aborted:!1,addEventListener:function(a,d){r.push(d)}};this.abort=function(){s.aborted=!0,r.forEach(function(a){return a()})}},u2=e.unstable_scheduleCallback,d2=e.unstable_NormalPriority,Et={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ch(){return{controller:new c2,data:new Map,refCount:0}}function Va(r){r.refCount--,r.refCount===0&&u2(d2,function(){r.controller.abort()})}var Ha=null,uh=0,wi=0,xi=null;function f2(r,s){if(Ha===null){var a=Ha=[];uh=0,wi=hp(),xi={status:"pending",value:void 0,then:function(d){a.push(d)}}}return uh++,s.then(tb,tb),s}function tb(){if(--uh===0&&Ha!==null){xi!==null&&(xi.status="fulfilled");var r=Ha;Ha=null,wi=0,xi=null;for(var s=0;s<r.length;s++)(0,r[s])()}}function h2(r,s){var a=[],d={status:"pending",value:null,reason:null,then:function(m){a.push(m)}};return r.then(function(){d.status="fulfilled",d.value=s;for(var m=0;m<a.length;m++)(0,a[m])(s)},function(m){for(d.status="rejected",d.reason=m,m=0;m<a.length;m++)(0,a[m])(void 0)}),d}var nb=F.S;F.S=function(r,s){$0=on(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&f2(r,s),nb!==null&&nb(r,s)};var Ss=z(null);function dh(){var r=Ss.current;return r!==null?r:tt.pooledCache}function Uc(r,s){s===null?re(Ss,Ss.current):re(Ss,s.pool)}function rb(){var r=dh();return r===null?null:{parent:Et._currentValue,pool:r}}var Si=Error(o(460)),fh=Error(o(474)),Bc=Error(o(542)),qc={then:function(){}};function ob(r){return r=r.status,r==="fulfilled"||r==="rejected"}function sb(r,s,a){switch(a=r[a],a===void 0?r.push(s):a!==s&&(s.then(Br,Br),s=a),s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,ab(r),r;default:if(typeof s.status=="string")s.then(Br,Br);else{if(r=tt,r!==null&&100<r.shellSuspendCounter)throw Error(o(482));r=s,r.status="pending",r.then(function(d){if(s.status==="pending"){var m=s;m.status="fulfilled",m.value=d}},function(d){if(s.status==="pending"){var m=s;m.status="rejected",m.reason=d}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,ab(r),r}throw Es=s,Si}}function _s(r){try{var s=r._init;return s(r._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Es=a,Si):a}}var Es=null;function ib(){if(Es===null)throw Error(o(459));var r=Es;return Es=null,r}function ab(r){if(r===Si||r===Bc)throw Error(o(483))}var _i=null,Za=0;function Vc(r){var s=Za;return Za+=1,_i===null&&(_i=[]),sb(_i,r,s)}function Qa(r,s){s=s.props.ref,r.ref=s!==void 0?s:null}function Hc(r,s){throw s.$$typeof===w?Error(o(525)):(r=Object.prototype.toString.call(s),Error(o(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r)))}function lb(r){function s(U,P){if(r){var B=U.deletions;B===null?(U.deletions=[P],U.flags|=16):B.push(P)}}function a(U,P){if(!r)return null;for(;P!==null;)s(U,P),P=P.sibling;return null}function d(U){for(var P=new Map;U!==null;)U.key!==null?P.set(U.key,U):P.set(U.index,U),U=U.sibling;return P}function m(U,P){return U=Vr(U,P),U.index=0,U.sibling=null,U}function g(U,P,B){return U.index=B,r?(B=U.alternate,B!==null?(B=B.index,B<P?(U.flags|=67108866,P):B):(U.flags|=67108866,P)):(U.flags|=1048576,P)}function E(U){return r&&U.alternate===null&&(U.flags|=67108866),U}function A(U,P,B,W){return P===null||P.tag!==6?(P=eh(B,U.mode,W),P.return=U,P):(P=m(P,B),P.return=U,P)}function j(U,P,B,W){var we=B.type;return we===x?K(U,P,B.props.children,W,B.key):P!==null&&(P.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===D&&_s(we)===P.type)?(P=m(P,B.props),Qa(P,B),P.return=U,P):(P=Lc(B.type,B.key,B.props,null,U.mode,W),Qa(P,B),P.return=U,P)}function q(U,P,B,W){return P===null||P.tag!==4||P.stateNode.containerInfo!==B.containerInfo||P.stateNode.implementation!==B.implementation?(P=th(B,U.mode,W),P.return=U,P):(P=m(P,B.children||[]),P.return=U,P)}function K(U,P,B,W,we){return P===null||P.tag!==7?(P=vs(B,U.mode,W,we),P.return=U,P):(P=m(P,B),P.return=U,P)}function te(U,P,B){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return P=eh(""+P,U.mode,B),P.return=U,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case _:return B=Lc(P.type,P.key,P.props,null,U.mode,B),Qa(B,P),B.return=U,B;case R:return P=th(P,U.mode,B),P.return=U,P;case D:return P=_s(P),te(U,P,B)}if(ge(P)||se(P))return P=vs(P,U.mode,B,null),P.return=U,P;if(typeof P.then=="function")return te(U,Vc(P),B);if(P.$$typeof===O)return te(U,Fc(U,P),B);Hc(U,P)}return null}function H(U,P,B,W){var we=P!==null?P.key:null;if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return we!==null?null:A(U,P,""+B,W);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case _:return B.key===we?j(U,P,B,W):null;case R:return B.key===we?q(U,P,B,W):null;case D:return B=_s(B),H(U,P,B,W)}if(ge(B)||se(B))return we!==null?null:K(U,P,B,W,null);if(typeof B.then=="function")return H(U,P,Vc(B),W);if(B.$$typeof===O)return H(U,P,Fc(U,B),W);Hc(U,B)}return null}function Q(U,P,B,W,we){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return U=U.get(B)||null,A(P,U,""+W,we);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case _:return U=U.get(W.key===null?B:W.key)||null,j(P,U,W,we);case R:return U=U.get(W.key===null?B:W.key)||null,q(P,U,W,we);case D:return W=_s(W),Q(U,P,B,W,we)}if(ge(W)||se(W))return U=U.get(B)||null,K(P,U,W,we,null);if(typeof W.then=="function")return Q(U,P,B,Vc(W),we);if(W.$$typeof===O)return Q(U,P,B,Fc(P,W),we);Hc(P,W)}return null}function fe(U,P,B,W){for(var we=null,Ve=null,ye=P,Me=P=0,Fe=null;ye!==null&&Me<B.length;Me++){ye.index>Me?(Fe=ye,ye=null):Fe=ye.sibling;var He=H(U,ye,B[Me],W);if(He===null){ye===null&&(ye=Fe);break}r&&ye&&He.alternate===null&&s(U,ye),P=g(He,P,Me),Ve===null?we=He:Ve.sibling=He,Ve=He,ye=Fe}if(Me===B.length)return a(U,ye),Be&&Hr(U,Me),we;if(ye===null){for(;Me<B.length;Me++)ye=te(U,B[Me],W),ye!==null&&(P=g(ye,P,Me),Ve===null?we=ye:Ve.sibling=ye,Ve=ye);return Be&&Hr(U,Me),we}for(ye=d(ye);Me<B.length;Me++)Fe=Q(ye,U,Me,B[Me],W),Fe!==null&&(r&&Fe.alternate!==null&&ye.delete(Fe.key===null?Me:Fe.key),P=g(Fe,P,Me),Ve===null?we=Fe:Ve.sibling=Fe,Ve=Fe);return r&&ye.forEach(function(Fo){return s(U,Fo)}),Be&&Hr(U,Me),we}function Ee(U,P,B,W){if(B==null)throw Error(o(151));for(var we=null,Ve=null,ye=P,Me=P=0,Fe=null,He=B.next();ye!==null&&!He.done;Me++,He=B.next()){ye.index>Me?(Fe=ye,ye=null):Fe=ye.sibling;var Fo=H(U,ye,He.value,W);if(Fo===null){ye===null&&(ye=Fe);break}r&&ye&&Fo.alternate===null&&s(U,ye),P=g(Fo,P,Me),Ve===null?we=Fo:Ve.sibling=Fo,Ve=Fo,ye=Fe}if(He.done)return a(U,ye),Be&&Hr(U,Me),we;if(ye===null){for(;!He.done;Me++,He=B.next())He=te(U,He.value,W),He!==null&&(P=g(He,P,Me),Ve===null?we=He:Ve.sibling=He,Ve=He);return Be&&Hr(U,Me),we}for(ye=d(ye);!He.done;Me++,He=B.next())He=Q(ye,U,Me,He.value,W),He!==null&&(r&&He.alternate!==null&&ye.delete(He.key===null?Me:He.key),P=g(He,P,Me),Ve===null?we=He:Ve.sibling=He,Ve=He);return r&&ye.forEach(function(EO){return s(U,EO)}),Be&&Hr(U,Me),we}function et(U,P,B,W){if(typeof B=="object"&&B!==null&&B.type===x&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case _:e:{for(var we=B.key;P!==null;){if(P.key===we){if(we=B.type,we===x){if(P.tag===7){a(U,P.sibling),W=m(P,B.props.children),W.return=U,U=W;break e}}else if(P.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===D&&_s(we)===P.type){a(U,P.sibling),W=m(P,B.props),Qa(W,B),W.return=U,U=W;break e}a(U,P);break}else s(U,P);P=P.sibling}B.type===x?(W=vs(B.props.children,U.mode,W,B.key),W.return=U,U=W):(W=Lc(B.type,B.key,B.props,null,U.mode,W),Qa(W,B),W.return=U,U=W)}return E(U);case R:e:{for(we=B.key;P!==null;){if(P.key===we)if(P.tag===4&&P.stateNode.containerInfo===B.containerInfo&&P.stateNode.implementation===B.implementation){a(U,P.sibling),W=m(P,B.children||[]),W.return=U,U=W;break e}else{a(U,P);break}else s(U,P);P=P.sibling}W=th(B,U.mode,W),W.return=U,U=W}return E(U);case D:return B=_s(B),et(U,P,B,W)}if(ge(B))return fe(U,P,B,W);if(se(B)){if(we=se(B),typeof we!="function")throw Error(o(150));return B=we.call(B),Ee(U,P,B,W)}if(typeof B.then=="function")return et(U,P,Vc(B),W);if(B.$$typeof===O)return et(U,P,Fc(U,B),W);Hc(U,B)}return typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint"?(B=""+B,P!==null&&P.tag===6?(a(U,P.sibling),W=m(P,B),W.return=U,U=W):(a(U,P),W=eh(B,U.mode,W),W.return=U,U=W),E(U)):a(U,P)}return function(U,P,B,W){try{Za=0;var we=et(U,P,B,W);return _i=null,we}catch(ye){if(ye===Si||ye===Bc)throw ye;var Ve=Mn(29,ye,null,U.mode);return Ve.lanes=W,Ve.return=U,Ve}}}var Ts=lb(!0),cb=lb(!1),_o=!1;function hh(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ph(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Eo(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function To(r,s,a){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(Ge&2)!==0){var m=d.pending;return m===null?s.next=s:(s.next=m.next,m.next=s),d.pending=s,s=zc(r),Zv(r,null,a),s}return jc(r,d,s,a),zc(r)}function Ga(r,s,a){if(s=s.updateQueue,s!==null&&(s=s.shared,(a&4194048)!==0)){var d=s.lanes;d&=r.pendingLanes,a|=d,s.lanes=a,ev(r,a)}}function mh(r,s){var a=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,a===d)){var m=null,g=null;if(a=a.firstBaseUpdate,a!==null){do{var E={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};g===null?m=g=E:g=g.next=E,a=a.next}while(a!==null);g===null?m=g=s:g=g.next=s}else m=g=s;a={baseState:d.baseState,firstBaseUpdate:m,lastBaseUpdate:g,shared:d.shared,callbacks:d.callbacks},r.updateQueue=a;return}r=a.lastBaseUpdate,r===null?a.firstBaseUpdate=s:r.next=s,a.lastBaseUpdate=s}var gh=!1;function Ya(){if(gh){var r=xi;if(r!==null)throw r}}function Ka(r,s,a,d){gh=!1;var m=r.updateQueue;_o=!1;var g=m.firstBaseUpdate,E=m.lastBaseUpdate,A=m.shared.pending;if(A!==null){m.shared.pending=null;var j=A,q=j.next;j.next=null,E===null?g=q:E.next=q,E=j;var K=r.alternate;K!==null&&(K=K.updateQueue,A=K.lastBaseUpdate,A!==E&&(A===null?K.firstBaseUpdate=q:A.next=q,K.lastBaseUpdate=j))}if(g!==null){var te=m.baseState;E=0,K=q=j=null,A=g;do{var H=A.lane&-536870913,Q=H!==A.lane;if(Q?($e&H)===H:(d&H)===H){H!==0&&H===wi&&(gh=!0),K!==null&&(K=K.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var fe=r,Ee=A;H=s;var et=a;switch(Ee.tag){case 1:if(fe=Ee.payload,typeof fe=="function"){te=fe.call(et,te,H);break e}te=fe;break e;case 3:fe.flags=fe.flags&-65537|128;case 0:if(fe=Ee.payload,H=typeof fe=="function"?fe.call(et,te,H):fe,H==null)break e;te=v({},te,H);break e;case 2:_o=!0}}H=A.callback,H!==null&&(r.flags|=64,Q&&(r.flags|=8192),Q=m.callbacks,Q===null?m.callbacks=[H]:Q.push(H))}else Q={lane:H,tag:A.tag,payload:A.payload,callback:A.callback,next:null},K===null?(q=K=Q,j=te):K=K.next=Q,E|=H;if(A=A.next,A===null){if(A=m.shared.pending,A===null)break;Q=A,A=Q.next,Q.next=null,m.lastBaseUpdate=Q,m.shared.pending=null}}while(!0);K===null&&(j=te),m.baseState=j,m.firstBaseUpdate=q,m.lastBaseUpdate=K,g===null&&(m.shared.lanes=0),Oo|=E,r.lanes=E,r.memoizedState=te}}function ub(r,s){if(typeof r!="function")throw Error(o(191,r));r.call(s)}function db(r,s){var a=r.callbacks;if(a!==null)for(r.callbacks=null,r=0;r<a.length;r++)ub(a[r],s)}var Ei=z(null),Zc=z(0);function fb(r,s){r=no,re(Zc,r),re(Ei,s),no=r|s.baseLanes}function yh(){re(Zc,no),re(Ei,Ei.current)}function vh(){no=Zc.current,G(Ei),G(Zc)}var In=z(null),Xn=null;function Co(r){var s=r.alternate;re(bt,bt.current&1),re(In,r),Xn===null&&(s===null||Ei.current!==null||s.memoizedState!==null)&&(Xn=r)}function bh(r){re(bt,bt.current),re(In,r),Xn===null&&(Xn=r)}function hb(r){r.tag===22?(re(bt,bt.current),re(In,r),Xn===null&&(Xn=r)):Ro()}function Ro(){re(bt,bt.current),re(In,In.current)}function Dn(r){G(In),Xn===r&&(Xn=null),G(bt)}var bt=z(0);function Qc(r){for(var s=r;s!==null;){if(s.tag===13){var a=s.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Tp(a)||Cp(a)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Gr=0,Ae=null,Je=null,Tt=null,Gc=!1,Ti=!1,Cs=!1,Yc=0,Xa=0,Ci=null,p2=0;function pt(){throw Error(o(321))}function wh(r,s){if(s===null)return!1;for(var a=0;a<s.length&&a<r.length;a++)if(!kn(r[a],s[a]))return!1;return!0}function xh(r,s,a,d,m,g){return Gr=g,Ae=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,F.H=r===null||r.memoizedState===null?Kb:zh,Cs=!1,g=a(d,m),Cs=!1,Ti&&(g=mb(s,a,d,m)),pb(r),g}function pb(r){F.H=el;var s=Je!==null&&Je.next!==null;if(Gr=0,Tt=Je=Ae=null,Gc=!1,Xa=0,Ci=null,s)throw Error(o(300));r===null||Ct||(r=r.dependencies,r!==null&&$c(r)&&(Ct=!0))}function mb(r,s,a,d){Ae=r;var m=0;do{if(Ti&&(Ci=null),Xa=0,Ti=!1,25<=m)throw Error(o(301));if(m+=1,Tt=Je=null,r.updateQueue!=null){var g=r.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}F.H=Xb,g=s(a,d)}while(Ti);return g}function m2(){var r=F.H,s=r.useState()[0];return s=typeof s.then=="function"?Ja(s):s,r=r.useState()[0],(Je!==null?Je.memoizedState:null)!==r&&(Ae.flags|=1024),s}function Sh(){var r=Yc!==0;return Yc=0,r}function _h(r,s,a){s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~a}function Eh(r){if(Gc){for(r=r.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Gc=!1}Gr=0,Tt=Je=Ae=null,Ti=!1,Xa=Yc=0,Ci=null}function sn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?Ae.memoizedState=Tt=r:Tt=Tt.next=r,Tt}function wt(){if(Je===null){var r=Ae.alternate;r=r!==null?r.memoizedState:null}else r=Je.next;var s=Tt===null?Ae.memoizedState:Tt.next;if(s!==null)Tt=s,Je=r;else{if(r===null)throw Ae.alternate===null?Error(o(467)):Error(o(310));Je=r,r={memoizedState:Je.memoizedState,baseState:Je.baseState,baseQueue:Je.baseQueue,queue:Je.queue,next:null},Tt===null?Ae.memoizedState=Tt=r:Tt=Tt.next=r}return Tt}function Kc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ja(r){var s=Xa;return Xa+=1,Ci===null&&(Ci=[]),r=sb(Ci,r,s),s=Ae,(Tt===null?s.memoizedState:Tt.next)===null&&(s=s.alternate,F.H=s===null||s.memoizedState===null?Kb:zh),r}function Xc(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Ja(r);if(r.$$typeof===O)return Ht(r)}throw Error(o(438,String(r)))}function Th(r){var s=null,a=Ae.updateQueue;if(a!==null&&(s=a.memoCache),s==null){var d=Ae.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(s={data:d.data.map(function(m){return m.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),a===null&&(a=Kc(),Ae.updateQueue=a),a.memoCache=s,a=s.data[s.index],a===void 0)for(a=s.data[s.index]=Array(r),d=0;d<r;d++)a[d]=ie;return s.index++,a}function Yr(r,s){return typeof s=="function"?s(r):s}function Jc(r){var s=wt();return Ch(s,Je,r)}function Ch(r,s,a){var d=r.queue;if(d===null)throw Error(o(311));d.lastRenderedReducer=a;var m=r.baseQueue,g=d.pending;if(g!==null){if(m!==null){var E=m.next;m.next=g.next,g.next=E}s.baseQueue=m=g,d.pending=null}if(g=r.baseState,m===null)r.memoizedState=g;else{s=m.next;var A=E=null,j=null,q=s,K=!1;do{var te=q.lane&-536870913;if(te!==q.lane?($e&te)===te:(Gr&te)===te){var H=q.revertLane;if(H===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),te===wi&&(K=!0);else if((Gr&H)===H){q=q.next,H===wi&&(K=!0);continue}else te={lane:0,revertLane:q.revertLane,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},j===null?(A=j=te,E=g):j=j.next=te,Ae.lanes|=H,Oo|=H;te=q.action,Cs&&a(g,te),g=q.hasEagerState?q.eagerState:a(g,te)}else H={lane:te,revertLane:q.revertLane,gesture:q.gesture,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},j===null?(A=j=H,E=g):j=j.next=H,Ae.lanes|=te,Oo|=te;q=q.next}while(q!==null&&q!==s);if(j===null?E=g:j.next=A,!kn(g,r.memoizedState)&&(Ct=!0,K&&(a=xi,a!==null)))throw a;r.memoizedState=g,r.baseState=E,r.baseQueue=j,d.lastRenderedState=g}return m===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function Rh(r){var s=wt(),a=s.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=r;var d=a.dispatch,m=a.pending,g=s.memoizedState;if(m!==null){a.pending=null;var E=m=m.next;do g=r(g,E.action),E=E.next;while(E!==m);kn(g,s.memoizedState)||(Ct=!0),s.memoizedState=g,s.baseQueue===null&&(s.baseState=g),a.lastRenderedState=g}return[g,d]}function gb(r,s,a){var d=Ae,m=wt(),g=Be;if(g){if(a===void 0)throw Error(o(407));a=a()}else a=s();var E=!kn((Je||m).memoizedState,a);if(E&&(m.memoizedState=a,Ct=!0),m=m.queue,Oh(bb.bind(null,d,m,r),[r]),m.getSnapshot!==s||E||Tt!==null&&Tt.memoizedState.tag&1){if(d.flags|=2048,Ri(9,{destroy:void 0},vb.bind(null,d,m,a,s),null),tt===null)throw Error(o(349));g||(Gr&127)!==0||yb(d,s,a)}return a}function yb(r,s,a){r.flags|=16384,r={getSnapshot:s,value:a},s=Ae.updateQueue,s===null?(s=Kc(),Ae.updateQueue=s,s.stores=[r]):(a=s.stores,a===null?s.stores=[r]:a.push(r))}function vb(r,s,a,d){s.value=a,s.getSnapshot=d,wb(s)&&xb(r)}function bb(r,s,a){return a(function(){wb(s)&&xb(r)})}function wb(r){var s=r.getSnapshot;r=r.value;try{var a=s();return!kn(r,a)}catch{return!0}}function xb(r){var s=ys(r,2);s!==null&&bn(s,r,2)}function Ah(r){var s=sn();if(typeof r=="function"){var a=r;if(r=a(),Cs){go(!0);try{a()}finally{go(!1)}}}return s.memoizedState=s.baseState=r,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yr,lastRenderedState:r},s}function Sb(r,s,a,d){return r.baseState=a,Ch(r,Je,typeof d=="function"?d:Yr)}function g2(r,s,a,d,m){if(tu(r))throw Error(o(485));if(r=s.action,r!==null){var g={payload:m,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){g.listeners.push(E)}};F.T!==null?a(!0):g.isTransition=!1,d(g),a=s.pending,a===null?(g.next=s.pending=g,_b(s,g)):(g.next=a.next,s.pending=a.next=g)}}function _b(r,s){var a=s.action,d=s.payload,m=r.state;if(s.isTransition){var g=F.T,E={};F.T=E;try{var A=a(m,d),j=F.S;j!==null&&j(E,A),Eb(r,s,A)}catch(q){Nh(r,s,q)}finally{g!==null&&E.types!==null&&(g.types=E.types),F.T=g}}else try{g=a(m,d),Eb(r,s,g)}catch(q){Nh(r,s,q)}}function Eb(r,s,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(d){Tb(r,s,d)},function(d){return Nh(r,s,d)}):Tb(r,s,a)}function Tb(r,s,a){s.status="fulfilled",s.value=a,Cb(s),r.state=a,s=r.pending,s!==null&&(a=s.next,a===s?r.pending=null:(a=a.next,s.next=a,_b(r,a)))}function Nh(r,s,a){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do s.status="rejected",s.reason=a,Cb(s),s=s.next;while(s!==d)}r.action=null}function Cb(r){r=r.listeners;for(var s=0;s<r.length;s++)(0,r[s])()}function Rb(r,s){return s}function Ab(r,s){if(Be){var a=tt.formState;if(a!==null){e:{var d=Ae;if(Be){if(st){t:{for(var m=st,g=Kn;m.nodeType!==8;){if(!g){m=null;break t}if(m=Jn(m.nextSibling),m===null){m=null;break t}}g=m.data,m=g==="F!"||g==="F"?m:null}if(m){st=Jn(m.nextSibling),d=m.data==="F!";break e}}xo(d)}d=!1}d&&(s=a[0])}}return a=sn(),a.memoizedState=a.baseState=s,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rb,lastRenderedState:s},a.queue=d,a=Qb.bind(null,Ae,d),d.dispatch=a,d=Ah(!1),g=jh.bind(null,Ae,!1,d.queue),d=sn(),m={state:s,dispatch:null,action:r,pending:null},d.queue=m,a=g2.bind(null,Ae,m,g,a),m.dispatch=a,d.memoizedState=r,[s,a,!1]}function Nb(r){var s=wt();return Ob(s,Je,r)}function Ob(r,s,a){if(s=Ch(r,s,Rb)[0],r=Jc(Yr)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var d=Ja(s)}catch(E){throw E===Si?Bc:E}else d=s;s=wt();var m=s.queue,g=m.dispatch;return a!==s.memoizedState&&(Ae.flags|=2048,Ri(9,{destroy:void 0},y2.bind(null,m,a),null)),[d,g,r]}function y2(r,s){r.action=s}function kb(r){var s=wt(),a=Je;if(a!==null)return Ob(s,a,r);wt(),s=s.memoizedState,a=wt();var d=a.queue.dispatch;return a.memoizedState=r,[s,d,!1]}function Ri(r,s,a,d){return r={tag:r,create:a,deps:d,inst:s,next:null},s=Ae.updateQueue,s===null&&(s=Kc(),Ae.updateQueue=s),a=s.lastEffect,a===null?s.lastEffect=r.next=r:(d=a.next,a.next=r,r.next=d,s.lastEffect=r),r}function Mb(){return wt().memoizedState}function Wc(r,s,a,d){var m=sn();Ae.flags|=r,m.memoizedState=Ri(1|s,{destroy:void 0},a,d===void 0?null:d)}function eu(r,s,a,d){var m=wt();d=d===void 0?null:d;var g=m.memoizedState.inst;Je!==null&&d!==null&&wh(d,Je.memoizedState.deps)?m.memoizedState=Ri(s,g,a,d):(Ae.flags|=r,m.memoizedState=Ri(1|s,g,a,d))}function Ib(r,s){Wc(8390656,8,r,s)}function Oh(r,s){eu(2048,8,r,s)}function v2(r){Ae.flags|=4;var s=Ae.updateQueue;if(s===null)s=Kc(),Ae.updateQueue=s,s.events=[r];else{var a=s.events;a===null?s.events=[r]:a.push(r)}}function Db(r){var s=wt().memoizedState;return v2({ref:s,nextImpl:r}),function(){if((Ge&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}function jb(r,s){return eu(4,2,r,s)}function zb(r,s){return eu(4,4,r,s)}function Lb(r,s){if(typeof s=="function"){r=r();var a=s(r);return function(){typeof a=="function"?a():s(null)}}if(s!=null)return r=r(),s.current=r,function(){s.current=null}}function Pb(r,s,a){a=a!=null?a.concat([r]):null,eu(4,4,Lb.bind(null,s,r),a)}function kh(){}function $b(r,s){var a=wt();s=s===void 0?null:s;var d=a.memoizedState;return s!==null&&wh(s,d[1])?d[0]:(a.memoizedState=[r,s],r)}function Fb(r,s){var a=wt();s=s===void 0?null:s;var d=a.memoizedState;if(s!==null&&wh(s,d[1]))return d[0];if(d=r(),Cs){go(!0);try{r()}finally{go(!1)}}return a.memoizedState=[d,s],d}function Mh(r,s,a){return a===void 0||(Gr&1073741824)!==0&&($e&261930)===0?r.memoizedState=s:(r.memoizedState=a,r=U0(),Ae.lanes|=r,Oo|=r,a)}function Ub(r,s,a,d){return kn(a,s)?a:Ei.current!==null?(r=Mh(r,a,d),kn(r,s)||(Ct=!0),r):(Gr&42)===0||(Gr&1073741824)!==0&&($e&261930)===0?(Ct=!0,r.memoizedState=a):(r=U0(),Ae.lanes|=r,Oo|=r,s)}function Bb(r,s,a,d,m){var g=X.p;X.p=g!==0&&8>g?g:8;var E=F.T,A={};F.T=A,jh(r,!1,s,a);try{var j=m(),q=F.S;if(q!==null&&q(A,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var K=h2(j,d);Wa(r,s,K,Ln(r))}else Wa(r,s,d,Ln(r))}catch(te){Wa(r,s,{then:function(){},status:"rejected",reason:te},Ln())}finally{X.p=g,E!==null&&A.types!==null&&(E.types=A.types),F.T=E}}function b2(){}function Ih(r,s,a,d){if(r.tag!==5)throw Error(o(476));var m=qb(r).queue;Bb(r,m,s,Z,a===null?b2:function(){return Vb(r),a(d)})}function qb(r){var s=r.memoizedState;if(s!==null)return s;s={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yr,lastRenderedState:Z},next:null};var a={};return s.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yr,lastRenderedState:a},next:null},r.memoizedState=s,r=r.alternate,r!==null&&(r.memoizedState=s),s}function Vb(r){var s=qb(r);s.next===null&&(s=r.alternate.memoizedState),Wa(r,s.next.queue,{},Ln())}function Dh(){return Ht(gl)}function Hb(){return wt().memoizedState}function Zb(){return wt().memoizedState}function w2(r){for(var s=r.return;s!==null;){switch(s.tag){case 24:case 3:var a=Ln();r=Eo(a);var d=To(s,r,a);d!==null&&(bn(d,s,a),Ga(d,s,a)),s={cache:ch()},r.payload=s;return}s=s.return}}function x2(r,s,a){var d=Ln();a={lane:d,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},tu(r)?Gb(s,a):(a=Jf(r,s,a,d),a!==null&&(bn(a,r,d),Yb(a,s,d)))}function Qb(r,s,a){var d=Ln();Wa(r,s,a,d)}function Wa(r,s,a,d){var m={lane:d,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(tu(r))Gb(s,m);else{var g=r.alternate;if(r.lanes===0&&(g===null||g.lanes===0)&&(g=s.lastRenderedReducer,g!==null))try{var E=s.lastRenderedState,A=g(E,a);if(m.hasEagerState=!0,m.eagerState=A,kn(A,E))return jc(r,s,m,0),tt===null&&Dc(),!1}catch{}if(a=Jf(r,s,m,d),a!==null)return bn(a,r,d),Yb(a,s,d),!0}return!1}function jh(r,s,a,d){if(d={lane:2,revertLane:hp(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},tu(r)){if(s)throw Error(o(479))}else s=Jf(r,a,d,2),s!==null&&bn(s,r,2)}function tu(r){var s=r.alternate;return r===Ae||s!==null&&s===Ae}function Gb(r,s){Ti=Gc=!0;var a=r.pending;a===null?s.next=s:(s.next=a.next,a.next=s),r.pending=s}function Yb(r,s,a){if((a&4194048)!==0){var d=s.lanes;d&=r.pendingLanes,a|=d,s.lanes=a,ev(r,a)}}var el={readContext:Ht,use:Xc,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useLayoutEffect:pt,useInsertionEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useSyncExternalStore:pt,useId:pt,useHostTransitionStatus:pt,useFormState:pt,useActionState:pt,useOptimistic:pt,useMemoCache:pt,useCacheRefresh:pt};el.useEffectEvent=pt;var Kb={readContext:Ht,use:Xc,useCallback:function(r,s){return sn().memoizedState=[r,s===void 0?null:s],r},useContext:Ht,useEffect:Ib,useImperativeHandle:function(r,s,a){a=a!=null?a.concat([r]):null,Wc(4194308,4,Lb.bind(null,s,r),a)},useLayoutEffect:function(r,s){return Wc(4194308,4,r,s)},useInsertionEffect:function(r,s){Wc(4,2,r,s)},useMemo:function(r,s){var a=sn();s=s===void 0?null:s;var d=r();if(Cs){go(!0);try{r()}finally{go(!1)}}return a.memoizedState=[d,s],d},useReducer:function(r,s,a){var d=sn();if(a!==void 0){var m=a(s);if(Cs){go(!0);try{a(s)}finally{go(!1)}}}else m=s;return d.memoizedState=d.baseState=m,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:m},d.queue=r,r=r.dispatch=x2.bind(null,Ae,r),[d.memoizedState,r]},useRef:function(r){var s=sn();return r={current:r},s.memoizedState=r},useState:function(r){r=Ah(r);var s=r.queue,a=Qb.bind(null,Ae,s);return s.dispatch=a,[r.memoizedState,a]},useDebugValue:kh,useDeferredValue:function(r,s){var a=sn();return Mh(a,r,s)},useTransition:function(){var r=Ah(!1);return r=Bb.bind(null,Ae,r.queue,!0,!1),sn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,s,a){var d=Ae,m=sn();if(Be){if(a===void 0)throw Error(o(407));a=a()}else{if(a=s(),tt===null)throw Error(o(349));($e&127)!==0||yb(d,s,a)}m.memoizedState=a;var g={value:a,getSnapshot:s};return m.queue=g,Ib(bb.bind(null,d,g,r),[r]),d.flags|=2048,Ri(9,{destroy:void 0},vb.bind(null,d,g,a,s),null),a},useId:function(){var r=sn(),s=tt.identifierPrefix;if(Be){var a=_r,d=Sr;a=(d&~(1<<32-On(d)-1)).toString(32)+a,s="_"+s+"R_"+a,a=Yc++,0<a&&(s+="H"+a.toString(32)),s+="_"}else a=p2++,s="_"+s+"r_"+a.toString(32)+"_";return r.memoizedState=s},useHostTransitionStatus:Dh,useFormState:Ab,useActionState:Ab,useOptimistic:function(r){var s=sn();s.memoizedState=s.baseState=r;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=a,s=jh.bind(null,Ae,!0,a),a.dispatch=s,[r,s]},useMemoCache:Th,useCacheRefresh:function(){return sn().memoizedState=w2.bind(null,Ae)},useEffectEvent:function(r){var s=sn(),a={impl:r};return s.memoizedState=a,function(){if((Ge&2)!==0)throw Error(o(440));return a.impl.apply(void 0,arguments)}}},zh={readContext:Ht,use:Xc,useCallback:$b,useContext:Ht,useEffect:Oh,useImperativeHandle:Pb,useInsertionEffect:jb,useLayoutEffect:zb,useMemo:Fb,useReducer:Jc,useRef:Mb,useState:function(){return Jc(Yr)},useDebugValue:kh,useDeferredValue:function(r,s){var a=wt();return Ub(a,Je.memoizedState,r,s)},useTransition:function(){var r=Jc(Yr)[0],s=wt().memoizedState;return[typeof r=="boolean"?r:Ja(r),s]},useSyncExternalStore:gb,useId:Hb,useHostTransitionStatus:Dh,useFormState:Nb,useActionState:Nb,useOptimistic:function(r,s){var a=wt();return Sb(a,Je,r,s)},useMemoCache:Th,useCacheRefresh:Zb};zh.useEffectEvent=Db;var Xb={readContext:Ht,use:Xc,useCallback:$b,useContext:Ht,useEffect:Oh,useImperativeHandle:Pb,useInsertionEffect:jb,useLayoutEffect:zb,useMemo:Fb,useReducer:Rh,useRef:Mb,useState:function(){return Rh(Yr)},useDebugValue:kh,useDeferredValue:function(r,s){var a=wt();return Je===null?Mh(a,r,s):Ub(a,Je.memoizedState,r,s)},useTransition:function(){var r=Rh(Yr)[0],s=wt().memoizedState;return[typeof r=="boolean"?r:Ja(r),s]},useSyncExternalStore:gb,useId:Hb,useHostTransitionStatus:Dh,useFormState:kb,useActionState:kb,useOptimistic:function(r,s){var a=wt();return Je!==null?Sb(a,Je,r,s):(a.baseState=r,[r,a.queue.dispatch])},useMemoCache:Th,useCacheRefresh:Zb};Xb.useEffectEvent=Db;function Lh(r,s,a,d){s=r.memoizedState,a=a(d,s),a=a==null?s:v({},s,a),r.memoizedState=a,r.lanes===0&&(r.updateQueue.baseState=a)}var Ph={enqueueSetState:function(r,s,a){r=r._reactInternals;var d=Ln(),m=Eo(d);m.payload=s,a!=null&&(m.callback=a),s=To(r,m,d),s!==null&&(bn(s,r,d),Ga(s,r,d))},enqueueReplaceState:function(r,s,a){r=r._reactInternals;var d=Ln(),m=Eo(d);m.tag=1,m.payload=s,a!=null&&(m.callback=a),s=To(r,m,d),s!==null&&(bn(s,r,d),Ga(s,r,d))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var a=Ln(),d=Eo(a);d.tag=2,s!=null&&(d.callback=s),s=To(r,d,a),s!==null&&(bn(s,r,a),Ga(s,r,a))}};function Jb(r,s,a,d,m,g,E){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,g,E):s.prototype&&s.prototype.isPureReactComponent?!Fa(a,d)||!Fa(m,g):!0}function Wb(r,s,a,d){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(a,d),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(a,d),s.state!==r&&Ph.enqueueReplaceState(s,s.state,null)}function Rs(r,s){var a=s;if("ref"in s){a={};for(var d in s)d!=="ref"&&(a[d]=s[d])}if(r=r.defaultProps){a===s&&(a=v({},a));for(var m in r)a[m]===void 0&&(a[m]=r[m])}return a}function e0(r){Ic(r)}function t0(r){console.error(r)}function n0(r){Ic(r)}function nu(r,s){try{var a=r.onUncaughtError;a(s.value,{componentStack:s.stack})}catch(d){setTimeout(function(){throw d})}}function r0(r,s,a){try{var d=r.onCaughtError;d(a.value,{componentStack:a.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function $h(r,s,a){return a=Eo(a),a.tag=3,a.payload={element:null},a.callback=function(){nu(r,s)},a}function o0(r){return r=Eo(r),r.tag=3,r}function s0(r,s,a,d){var m=a.type.getDerivedStateFromError;if(typeof m=="function"){var g=d.value;r.payload=function(){return m(g)},r.callback=function(){r0(s,a,d)}}var E=a.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(r.callback=function(){r0(s,a,d),typeof m!="function"&&(ko===null?ko=new Set([this]):ko.add(this));var A=d.stack;this.componentDidCatch(d.value,{componentStack:A!==null?A:""})})}function S2(r,s,a,d,m){if(a.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(s=a.alternate,s!==null&&bi(s,a,m,!0),a=In.current,a!==null){switch(a.tag){case 31:case 13:return Xn===null?pu():a.alternate===null&&mt===0&&(mt=3),a.flags&=-257,a.flags|=65536,a.lanes=m,d===qc?a.flags|=16384:(s=a.updateQueue,s===null?a.updateQueue=new Set([d]):s.add(d),up(r,d,m)),!1;case 22:return a.flags|=65536,d===qc?a.flags|=16384:(s=a.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([d])},a.updateQueue=s):(a=s.retryQueue,a===null?s.retryQueue=new Set([d]):a.add(d)),up(r,d,m)),!1}throw Error(o(435,a.tag))}return up(r,d,m),pu(),!1}if(Be)return s=In.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=m,d!==oh&&(r=Error(o(422),{cause:d}),qa(Qn(r,a)))):(d!==oh&&(s=Error(o(423),{cause:d}),qa(Qn(s,a))),r=r.current.alternate,r.flags|=65536,m&=-m,r.lanes|=m,d=Qn(d,a),m=$h(r.stateNode,d,m),mh(r,m),mt!==4&&(mt=2)),!1;var g=Error(o(520),{cause:d});if(g=Qn(g,a),ll===null?ll=[g]:ll.push(g),mt!==4&&(mt=2),s===null)return!0;d=Qn(d,a),a=s;do{switch(a.tag){case 3:return a.flags|=65536,r=m&-m,a.lanes|=r,r=$h(a.stateNode,d,r),mh(a,r),!1;case 1:if(s=a.type,g=a.stateNode,(a.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(ko===null||!ko.has(g))))return a.flags|=65536,m&=-m,a.lanes|=m,m=o0(m),s0(m,r,a,d),mh(a,m),!1}a=a.return}while(a!==null);return!1}var Fh=Error(o(461)),Ct=!1;function Zt(r,s,a,d){s.child=r===null?cb(s,null,a,d):Ts(s,r.child,a,d)}function i0(r,s,a,d,m){a=a.render;var g=s.ref;if("ref"in d){var E={};for(var A in d)A!=="ref"&&(E[A]=d[A])}else E=d;return xs(s),d=xh(r,s,a,E,g,m),A=Sh(),r!==null&&!Ct?(_h(r,s,m),Kr(r,s,m)):(Be&&A&&nh(s),s.flags|=1,Zt(r,s,d,m),s.child)}function a0(r,s,a,d,m){if(r===null){var g=a.type;return typeof g=="function"&&!Wf(g)&&g.defaultProps===void 0&&a.compare===null?(s.tag=15,s.type=g,l0(r,s,g,d,m)):(r=Lc(a.type,null,d,s,s.mode,m),r.ref=s.ref,r.return=s,s.child=r)}if(g=r.child,!Gh(r,m)){var E=g.memoizedProps;if(a=a.compare,a=a!==null?a:Fa,a(E,d)&&r.ref===s.ref)return Kr(r,s,m)}return s.flags|=1,r=Vr(g,d),r.ref=s.ref,r.return=s,s.child=r}function l0(r,s,a,d,m){if(r!==null){var g=r.memoizedProps;if(Fa(g,d)&&r.ref===s.ref)if(Ct=!1,s.pendingProps=d=g,Gh(r,m))(r.flags&131072)!==0&&(Ct=!0);else return s.lanes=r.lanes,Kr(r,s,m)}return Uh(r,s,a,d,m)}function c0(r,s,a,d){var m=d.children,g=r!==null?r.memoizedState:null;if(r===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((s.flags&128)!==0){if(g=g!==null?g.baseLanes|a:a,r!==null){for(d=s.child=r.child,m=0;d!==null;)m=m|d.lanes|d.childLanes,d=d.sibling;d=m&~g}else d=0,s.child=null;return u0(r,s,g,a,d)}if((a&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},r!==null&&Uc(s,g!==null?g.cachePool:null),g!==null?fb(s,g):yh(),hb(s);else return d=s.lanes=536870912,u0(r,s,g!==null?g.baseLanes|a:a,a,d)}else g!==null?(Uc(s,g.cachePool),fb(s,g),Ro(),s.memoizedState=null):(r!==null&&Uc(s,null),yh(),Ro());return Zt(r,s,m,a),s.child}function tl(r,s){return r!==null&&r.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function u0(r,s,a,d,m){var g=dh();return g=g===null?null:{parent:Et._currentValue,pool:g},s.memoizedState={baseLanes:a,cachePool:g},r!==null&&Uc(s,null),yh(),hb(s),r!==null&&bi(r,s,d,!0),s.childLanes=m,null}function ru(r,s){return s=su({mode:s.mode,children:s.children},r.mode),s.ref=r.ref,r.child=s,s.return=r,s}function d0(r,s,a){return Ts(s,r.child,null,a),r=ru(s,s.pendingProps),r.flags|=2,Dn(s),s.memoizedState=null,r}function _2(r,s,a){var d=s.pendingProps,m=(s.flags&128)!==0;if(s.flags&=-129,r===null){if(Be){if(d.mode==="hidden")return r=ru(s,d),s.lanes=536870912,tl(null,r);if(bh(s),(r=st)?(r=_w(r,Kn),r=r!==null&&r.data==="&"?r:null,r!==null&&(s.memoizedState={dehydrated:r,treeContext:bo!==null?{id:Sr,overflow:_r}:null,retryLane:536870912,hydrationErrors:null},a=Gv(r),a.return=s,s.child=a,Vt=s,st=null)):r=null,r===null)throw xo(s);return s.lanes=536870912,null}return ru(s,d)}var g=r.memoizedState;if(g!==null){var E=g.dehydrated;if(bh(s),m)if(s.flags&256)s.flags&=-257,s=d0(r,s,a);else if(s.memoizedState!==null)s.child=r.child,s.flags|=128,s=null;else throw Error(o(558));else if(Ct||bi(r,s,a,!1),m=(a&r.childLanes)!==0,Ct||m){if(d=tt,d!==null&&(E=tv(d,a),E!==0&&E!==g.retryLane))throw g.retryLane=E,ys(r,E),bn(d,r,E),Fh;pu(),s=d0(r,s,a)}else r=g.treeContext,st=Jn(E.nextSibling),Vt=s,Be=!0,wo=null,Kn=!1,r!==null&&Xv(s,r),s=ru(s,d),s.flags|=4096;return s}return r=Vr(r.child,{mode:d.mode,children:d.children}),r.ref=s.ref,s.child=r,r.return=s,r}function ou(r,s){var a=s.ref;if(a===null)r!==null&&r.ref!==null&&(s.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(o(284));(r===null||r.ref!==a)&&(s.flags|=4194816)}}function Uh(r,s,a,d,m){return xs(s),a=xh(r,s,a,d,void 0,m),d=Sh(),r!==null&&!Ct?(_h(r,s,m),Kr(r,s,m)):(Be&&d&&nh(s),s.flags|=1,Zt(r,s,a,m),s.child)}function f0(r,s,a,d,m,g){return xs(s),s.updateQueue=null,a=mb(s,d,a,m),pb(r),d=Sh(),r!==null&&!Ct?(_h(r,s,g),Kr(r,s,g)):(Be&&d&&nh(s),s.flags|=1,Zt(r,s,a,g),s.child)}function h0(r,s,a,d,m){if(xs(s),s.stateNode===null){var g=mi,E=a.contextType;typeof E=="object"&&E!==null&&(g=Ht(E)),g=new a(d,g),s.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Ph,s.stateNode=g,g._reactInternals=s,g=s.stateNode,g.props=d,g.state=s.memoizedState,g.refs={},hh(s),E=a.contextType,g.context=typeof E=="object"&&E!==null?Ht(E):mi,g.state=s.memoizedState,E=a.getDerivedStateFromProps,typeof E=="function"&&(Lh(s,a,E,d),g.state=s.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(E=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),E!==g.state&&Ph.enqueueReplaceState(g,g.state,null),Ka(s,d,g,m),Ya(),g.state=s.memoizedState),typeof g.componentDidMount=="function"&&(s.flags|=4194308),d=!0}else if(r===null){g=s.stateNode;var A=s.memoizedProps,j=Rs(a,A);g.props=j;var q=g.context,K=a.contextType;E=mi,typeof K=="object"&&K!==null&&(E=Ht(K));var te=a.getDerivedStateFromProps;K=typeof te=="function"||typeof g.getSnapshotBeforeUpdate=="function",A=s.pendingProps!==A,K||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(A||q!==E)&&Wb(s,g,d,E),_o=!1;var H=s.memoizedState;g.state=H,Ka(s,d,g,m),Ya(),q=s.memoizedState,A||H!==q||_o?(typeof te=="function"&&(Lh(s,a,te,d),q=s.memoizedState),(j=_o||Jb(s,a,j,d,H,q,E))?(K||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(s.flags|=4194308)):(typeof g.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=d,s.memoizedState=q),g.props=d,g.state=q,g.context=E,d=j):(typeof g.componentDidMount=="function"&&(s.flags|=4194308),d=!1)}else{g=s.stateNode,ph(r,s),E=s.memoizedProps,K=Rs(a,E),g.props=K,te=s.pendingProps,H=g.context,q=a.contextType,j=mi,typeof q=="object"&&q!==null&&(j=Ht(q)),A=a.getDerivedStateFromProps,(q=typeof A=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(E!==te||H!==j)&&Wb(s,g,d,j),_o=!1,H=s.memoizedState,g.state=H,Ka(s,d,g,m),Ya();var Q=s.memoizedState;E!==te||H!==Q||_o||r!==null&&r.dependencies!==null&&$c(r.dependencies)?(typeof A=="function"&&(Lh(s,a,A,d),Q=s.memoizedState),(K=_o||Jb(s,a,K,d,H,Q,j)||r!==null&&r.dependencies!==null&&$c(r.dependencies))?(q||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(d,Q,j),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(d,Q,j)),typeof g.componentDidUpdate=="function"&&(s.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof g.componentDidUpdate!="function"||E===r.memoizedProps&&H===r.memoizedState||(s.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&H===r.memoizedState||(s.flags|=1024),s.memoizedProps=d,s.memoizedState=Q),g.props=d,g.state=Q,g.context=j,d=K):(typeof g.componentDidUpdate!="function"||E===r.memoizedProps&&H===r.memoizedState||(s.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&H===r.memoizedState||(s.flags|=1024),d=!1)}return g=d,ou(r,s),d=(s.flags&128)!==0,g||d?(g=s.stateNode,a=d&&typeof a.getDerivedStateFromError!="function"?null:g.render(),s.flags|=1,r!==null&&d?(s.child=Ts(s,r.child,null,m),s.child=Ts(s,null,a,m)):Zt(r,s,a,m),s.memoizedState=g.state,r=s.child):r=Kr(r,s,m),r}function p0(r,s,a,d){return bs(),s.flags|=256,Zt(r,s,a,d),s.child}var Bh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qh(r){return{baseLanes:r,cachePool:rb()}}function Vh(r,s,a){return r=r!==null?r.childLanes&~a:0,s&&(r|=zn),r}function m0(r,s,a){var d=s.pendingProps,m=!1,g=(s.flags&128)!==0,E;if((E=g)||(E=r!==null&&r.memoizedState===null?!1:(bt.current&2)!==0),E&&(m=!0,s.flags&=-129),E=(s.flags&32)!==0,s.flags&=-33,r===null){if(Be){if(m?Co(s):Ro(),(r=st)?(r=_w(r,Kn),r=r!==null&&r.data!=="&"?r:null,r!==null&&(s.memoizedState={dehydrated:r,treeContext:bo!==null?{id:Sr,overflow:_r}:null,retryLane:536870912,hydrationErrors:null},a=Gv(r),a.return=s,s.child=a,Vt=s,st=null)):r=null,r===null)throw xo(s);return Cp(r)?s.lanes=32:s.lanes=536870912,null}var A=d.children;return d=d.fallback,m?(Ro(),m=s.mode,A=su({mode:"hidden",children:A},m),d=vs(d,m,a,null),A.return=s,d.return=s,A.sibling=d,s.child=A,d=s.child,d.memoizedState=qh(a),d.childLanes=Vh(r,E,a),s.memoizedState=Bh,tl(null,d)):(Co(s),Hh(s,A))}var j=r.memoizedState;if(j!==null&&(A=j.dehydrated,A!==null)){if(g)s.flags&256?(Co(s),s.flags&=-257,s=Zh(r,s,a)):s.memoizedState!==null?(Ro(),s.child=r.child,s.flags|=128,s=null):(Ro(),A=d.fallback,m=s.mode,d=su({mode:"visible",children:d.children},m),A=vs(A,m,a,null),A.flags|=2,d.return=s,A.return=s,d.sibling=A,s.child=d,Ts(s,r.child,null,a),d=s.child,d.memoizedState=qh(a),d.childLanes=Vh(r,E,a),s.memoizedState=Bh,s=tl(null,d));else if(Co(s),Cp(A)){if(E=A.nextSibling&&A.nextSibling.dataset,E)var q=E.dgst;E=q,d=Error(o(419)),d.stack="",d.digest=E,qa({value:d,source:null,stack:null}),s=Zh(r,s,a)}else if(Ct||bi(r,s,a,!1),E=(a&r.childLanes)!==0,Ct||E){if(E=tt,E!==null&&(d=tv(E,a),d!==0&&d!==j.retryLane))throw j.retryLane=d,ys(r,d),bn(E,r,d),Fh;Tp(A)||pu(),s=Zh(r,s,a)}else Tp(A)?(s.flags|=192,s.child=r.child,s=null):(r=j.treeContext,st=Jn(A.nextSibling),Vt=s,Be=!0,wo=null,Kn=!1,r!==null&&Xv(s,r),s=Hh(s,d.children),s.flags|=4096);return s}return m?(Ro(),A=d.fallback,m=s.mode,j=r.child,q=j.sibling,d=Vr(j,{mode:"hidden",children:d.children}),d.subtreeFlags=j.subtreeFlags&65011712,q!==null?A=Vr(q,A):(A=vs(A,m,a,null),A.flags|=2),A.return=s,d.return=s,d.sibling=A,s.child=d,tl(null,d),d=s.child,A=r.child.memoizedState,A===null?A=qh(a):(m=A.cachePool,m!==null?(j=Et._currentValue,m=m.parent!==j?{parent:j,pool:j}:m):m=rb(),A={baseLanes:A.baseLanes|a,cachePool:m}),d.memoizedState=A,d.childLanes=Vh(r,E,a),s.memoizedState=Bh,tl(r.child,d)):(Co(s),a=r.child,r=a.sibling,a=Vr(a,{mode:"visible",children:d.children}),a.return=s,a.sibling=null,r!==null&&(E=s.deletions,E===null?(s.deletions=[r],s.flags|=16):E.push(r)),s.child=a,s.memoizedState=null,a)}function Hh(r,s){return s=su({mode:"visible",children:s},r.mode),s.return=r,r.child=s}function su(r,s){return r=Mn(22,r,null,s),r.lanes=0,r}function Zh(r,s,a){return Ts(s,r.child,null,a),r=Hh(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function g0(r,s,a){r.lanes|=s;var d=r.alternate;d!==null&&(d.lanes|=s),ah(r.return,s,a)}function Qh(r,s,a,d,m,g){var E=r.memoizedState;E===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:d,tail:a,tailMode:m,treeForkCount:g}:(E.isBackwards=s,E.rendering=null,E.renderingStartTime=0,E.last=d,E.tail=a,E.tailMode=m,E.treeForkCount=g)}function y0(r,s,a){var d=s.pendingProps,m=d.revealOrder,g=d.tail;d=d.children;var E=bt.current,A=(E&2)!==0;if(A?(E=E&1|2,s.flags|=128):E&=1,re(bt,E),Zt(r,s,d,a),d=Be?Ba:0,!A&&r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&g0(r,a,s);else if(r.tag===19)g0(r,a,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(m){case"forwards":for(a=s.child,m=null;a!==null;)r=a.alternate,r!==null&&Qc(r)===null&&(m=a),a=a.sibling;a=m,a===null?(m=s.child,s.child=null):(m=a.sibling,a.sibling=null),Qh(s,!1,m,a,g,d);break;case"backwards":case"unstable_legacy-backwards":for(a=null,m=s.child,s.child=null;m!==null;){if(r=m.alternate,r!==null&&Qc(r)===null){s.child=m;break}r=m.sibling,m.sibling=a,a=m,m=r}Qh(s,!0,a,null,g,d);break;case"together":Qh(s,!1,null,null,void 0,d);break;default:s.memoizedState=null}return s.child}function Kr(r,s,a){if(r!==null&&(s.dependencies=r.dependencies),Oo|=s.lanes,(a&s.childLanes)===0)if(r!==null){if(bi(r,s,a,!1),(a&s.childLanes)===0)return null}else return null;if(r!==null&&s.child!==r.child)throw Error(o(153));if(s.child!==null){for(r=s.child,a=Vr(r,r.pendingProps),s.child=a,a.return=s;r.sibling!==null;)r=r.sibling,a=a.sibling=Vr(r,r.pendingProps),a.return=s;a.sibling=null}return s.child}function Gh(r,s){return(r.lanes&s)!==0?!0:(r=r.dependencies,!!(r!==null&&$c(r)))}function E2(r,s,a){switch(s.tag){case 3:_e(s,s.stateNode.containerInfo),So(s,Et,r.memoizedState.cache),bs();break;case 27:case 5:Ce(s);break;case 4:_e(s,s.stateNode.containerInfo);break;case 10:So(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,bh(s),null;break;case 13:var d=s.memoizedState;if(d!==null)return d.dehydrated!==null?(Co(s),s.flags|=128,null):(a&s.child.childLanes)!==0?m0(r,s,a):(Co(s),r=Kr(r,s,a),r!==null?r.sibling:null);Co(s);break;case 19:var m=(r.flags&128)!==0;if(d=(a&s.childLanes)!==0,d||(bi(r,s,a,!1),d=(a&s.childLanes)!==0),m){if(d)return y0(r,s,a);s.flags|=128}if(m=s.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),re(bt,bt.current),d)break;return null;case 22:return s.lanes=0,c0(r,s,a,s.pendingProps);case 24:So(s,Et,r.memoizedState.cache)}return Kr(r,s,a)}function v0(r,s,a){if(r!==null)if(r.memoizedProps!==s.pendingProps)Ct=!0;else{if(!Gh(r,a)&&(s.flags&128)===0)return Ct=!1,E2(r,s,a);Ct=(r.flags&131072)!==0}else Ct=!1,Be&&(s.flags&1048576)!==0&&Kv(s,Ba,s.index);switch(s.lanes=0,s.tag){case 16:e:{var d=s.pendingProps;if(r=_s(s.elementType),s.type=r,typeof r=="function")Wf(r)?(d=Rs(r,d),s.tag=1,s=h0(null,s,r,d,a)):(s.tag=0,s=Uh(null,s,r,d,a));else{if(r!=null){var m=r.$$typeof;if(m===M){s.tag=11,s=i0(null,s,r,d,a);break e}else if(m===L){s.tag=14,s=a0(null,s,r,d,a);break e}}throw s=ce(r)||r,Error(o(306,s,""))}}return s;case 0:return Uh(r,s,s.type,s.pendingProps,a);case 1:return d=s.type,m=Rs(d,s.pendingProps),h0(r,s,d,m,a);case 3:e:{if(_e(s,s.stateNode.containerInfo),r===null)throw Error(o(387));d=s.pendingProps;var g=s.memoizedState;m=g.element,ph(r,s),Ka(s,d,null,a);var E=s.memoizedState;if(d=E.cache,So(s,Et,d),d!==g.cache&&lh(s,[Et],a,!0),Ya(),d=E.element,g.isDehydrated)if(g={element:d,isDehydrated:!1,cache:E.cache},s.updateQueue.baseState=g,s.memoizedState=g,s.flags&256){s=p0(r,s,d,a);break e}else if(d!==m){m=Qn(Error(o(424)),s),qa(m),s=p0(r,s,d,a);break e}else for(r=s.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,st=Jn(r.firstChild),Vt=s,Be=!0,wo=null,Kn=!0,a=cb(s,null,d,a),s.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(bs(),d===m){s=Kr(r,s,a);break e}Zt(r,s,d,a)}s=s.child}return s;case 26:return ou(r,s),r===null?(a=Nw(s.type,null,s.pendingProps,null))?s.memoizedState=a:Be||(a=s.type,r=s.pendingProps,d=xu(ve.current).createElement(a),d[qt]=s,d[hn]=r,Qt(d,a,r),$t(d),s.stateNode=d):s.memoizedState=Nw(s.type,r.memoizedProps,s.pendingProps,r.memoizedState),null;case 27:return Ce(s),r===null&&Be&&(d=s.stateNode=Cw(s.type,s.pendingProps,ve.current),Vt=s,Kn=!0,m=st,jo(s.type)?(Rp=m,st=Jn(d.firstChild)):st=m),Zt(r,s,s.pendingProps.children,a),ou(r,s),r===null&&(s.flags|=4194304),s.child;case 5:return r===null&&Be&&((m=d=st)&&(d=eO(d,s.type,s.pendingProps,Kn),d!==null?(s.stateNode=d,Vt=s,st=Jn(d.firstChild),Kn=!1,m=!0):m=!1),m||xo(s)),Ce(s),m=s.type,g=s.pendingProps,E=r!==null?r.memoizedProps:null,d=g.children,Sp(m,g)?d=null:E!==null&&Sp(m,E)&&(s.flags|=32),s.memoizedState!==null&&(m=xh(r,s,m2,null,null,a),gl._currentValue=m),ou(r,s),Zt(r,s,d,a),s.child;case 6:return r===null&&Be&&((r=a=st)&&(a=tO(a,s.pendingProps,Kn),a!==null?(s.stateNode=a,Vt=s,st=null,r=!0):r=!1),r||xo(s)),null;case 13:return m0(r,s,a);case 4:return _e(s,s.stateNode.containerInfo),d=s.pendingProps,r===null?s.child=Ts(s,null,d,a):Zt(r,s,d,a),s.child;case 11:return i0(r,s,s.type,s.pendingProps,a);case 7:return Zt(r,s,s.pendingProps,a),s.child;case 8:return Zt(r,s,s.pendingProps.children,a),s.child;case 12:return Zt(r,s,s.pendingProps.children,a),s.child;case 10:return d=s.pendingProps,So(s,s.type,d.value),Zt(r,s,d.children,a),s.child;case 9:return m=s.type._context,d=s.pendingProps.children,xs(s),m=Ht(m),d=d(m),s.flags|=1,Zt(r,s,d,a),s.child;case 14:return a0(r,s,s.type,s.pendingProps,a);case 15:return l0(r,s,s.type,s.pendingProps,a);case 19:return y0(r,s,a);case 31:return _2(r,s,a);case 22:return c0(r,s,a,s.pendingProps);case 24:return xs(s),d=Ht(Et),r===null?(m=dh(),m===null&&(m=tt,g=ch(),m.pooledCache=g,g.refCount++,g!==null&&(m.pooledCacheLanes|=a),m=g),s.memoizedState={parent:d,cache:m},hh(s),So(s,Et,m)):((r.lanes&a)!==0&&(ph(r,s),Ka(s,null,null,a),Ya()),m=r.memoizedState,g=s.memoizedState,m.parent!==d?(m={parent:d,cache:d},s.memoizedState=m,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=m),So(s,Et,d)):(d=g.cache,So(s,Et,d),d!==m.cache&&lh(s,[Et],a,!0))),Zt(r,s,s.pendingProps.children,a),s.child;case 29:throw s.pendingProps}throw Error(o(156,s.tag))}function Xr(r){r.flags|=4}function Yh(r,s,a,d,m){if((s=(r.mode&32)!==0)&&(s=!1),s){if(r.flags|=16777216,(m&335544128)===m)if(r.stateNode.complete)r.flags|=8192;else if(H0())r.flags|=8192;else throw Es=qc,fh}else r.flags&=-16777217}function b0(r,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Dw(s))if(H0())r.flags|=8192;else throw Es=qc,fh}function iu(r,s){s!==null&&(r.flags|=4),r.flags&16384&&(s=r.tag!==22?Jy():536870912,r.lanes|=s,ki|=s)}function nl(r,s){if(!Be)switch(r.tailMode){case"hidden":s=r.tail;for(var a=null;s!==null;)s.alternate!==null&&(a=s),s=s.sibling;a===null?r.tail=null:a.sibling=null;break;case"collapsed":a=r.tail;for(var d=null;a!==null;)a.alternate!==null&&(d=a),a=a.sibling;d===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function it(r){var s=r.alternate!==null&&r.alternate.child===r.child,a=0,d=0;if(s)for(var m=r.child;m!==null;)a|=m.lanes|m.childLanes,d|=m.subtreeFlags&65011712,d|=m.flags&65011712,m.return=r,m=m.sibling;else for(m=r.child;m!==null;)a|=m.lanes|m.childLanes,d|=m.subtreeFlags,d|=m.flags,m.return=r,m=m.sibling;return r.subtreeFlags|=d,r.childLanes=a,s}function T2(r,s,a){var d=s.pendingProps;switch(rh(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(s),null;case 1:return it(s),null;case 3:return a=s.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),s.memoizedState.cache!==d&&(s.flags|=2048),Qr(Et),Te(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(r===null||r.child===null)&&(vi(s)?Xr(s):r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,sh())),it(s),null;case 26:var m=s.type,g=s.memoizedState;return r===null?(Xr(s),g!==null?(it(s),b0(s,g)):(it(s),Yh(s,m,null,d,a))):g?g!==r.memoizedState?(Xr(s),it(s),b0(s,g)):(it(s),s.flags&=-16777217):(r=r.memoizedProps,r!==d&&Xr(s),it(s),Yh(s,m,r,d,a)),null;case 27:if(Oe(s),a=ve.current,m=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==d&&Xr(s);else{if(!d){if(s.stateNode===null)throw Error(o(166));return it(s),null}r=oe.current,vi(s)?Jv(s):(r=Cw(m,d,a),s.stateNode=r,Xr(s))}return it(s),null;case 5:if(Oe(s),m=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==d&&Xr(s);else{if(!d){if(s.stateNode===null)throw Error(o(166));return it(s),null}if(g=oe.current,vi(s))Jv(s);else{var E=xu(ve.current);switch(g){case 1:g=E.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:g=E.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":g=E.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":g=E.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":g=E.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof d.is=="string"?E.createElement("select",{is:d.is}):E.createElement("select"),d.multiple?g.multiple=!0:d.size&&(g.size=d.size);break;default:g=typeof d.is=="string"?E.createElement(m,{is:d.is}):E.createElement(m)}}g[qt]=s,g[hn]=d;e:for(E=s.child;E!==null;){if(E.tag===5||E.tag===6)g.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===s)break e;for(;E.sibling===null;){if(E.return===null||E.return===s)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}s.stateNode=g;e:switch(Qt(g,m,d),m){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&Xr(s)}}return it(s),Yh(s,s.type,r===null?null:r.memoizedProps,s.pendingProps,a),null;case 6:if(r&&s.stateNode!=null)r.memoizedProps!==d&&Xr(s);else{if(typeof d!="string"&&s.stateNode===null)throw Error(o(166));if(r=ve.current,vi(s)){if(r=s.stateNode,a=s.memoizedProps,d=null,m=Vt,m!==null)switch(m.tag){case 27:case 5:d=m.memoizedProps}r[qt]=s,r=!!(r.nodeValue===a||d!==null&&d.suppressHydrationWarning===!0||mw(r.nodeValue,a)),r||xo(s,!0)}else r=xu(r).createTextNode(d),r[qt]=s,s.stateNode=r}return it(s),null;case 31:if(a=s.memoizedState,r===null||r.memoizedState!==null){if(d=vi(s),a!==null){if(r===null){if(!d)throw Error(o(318));if(r=s.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(o(557));r[qt]=s}else bs(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;it(s),r=!1}else a=sh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=a),r=!0;if(!r)return s.flags&256?(Dn(s),s):(Dn(s),null);if((s.flags&128)!==0)throw Error(o(558))}return it(s),null;case 13:if(d=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(m=vi(s),d!==null&&d.dehydrated!==null){if(r===null){if(!m)throw Error(o(318));if(m=s.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(o(317));m[qt]=s}else bs(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;it(s),m=!1}else m=sh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=m),m=!0;if(!m)return s.flags&256?(Dn(s),s):(Dn(s),null)}return Dn(s),(s.flags&128)!==0?(s.lanes=a,s):(a=d!==null,r=r!==null&&r.memoizedState!==null,a&&(d=s.child,m=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(m=d.alternate.memoizedState.cachePool.pool),g=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(g=d.memoizedState.cachePool.pool),g!==m&&(d.flags|=2048)),a!==r&&a&&(s.child.flags|=8192),iu(s,s.updateQueue),it(s),null);case 4:return Te(),r===null&&yp(s.stateNode.containerInfo),it(s),null;case 10:return Qr(s.type),it(s),null;case 19:if(G(bt),d=s.memoizedState,d===null)return it(s),null;if(m=(s.flags&128)!==0,g=d.rendering,g===null)if(m)nl(d,!1);else{if(mt!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(g=Qc(r),g!==null){for(s.flags|=128,nl(d,!1),r=g.updateQueue,s.updateQueue=r,iu(s,r),s.subtreeFlags=0,r=a,a=s.child;a!==null;)Qv(a,r),a=a.sibling;return re(bt,bt.current&1|2),Be&&Hr(s,d.treeForkCount),s.child}r=r.sibling}d.tail!==null&&on()>du&&(s.flags|=128,m=!0,nl(d,!1),s.lanes=4194304)}else{if(!m)if(r=Qc(g),r!==null){if(s.flags|=128,m=!0,r=r.updateQueue,s.updateQueue=r,iu(s,r),nl(d,!0),d.tail===null&&d.tailMode==="hidden"&&!g.alternate&&!Be)return it(s),null}else 2*on()-d.renderingStartTime>du&&a!==536870912&&(s.flags|=128,m=!0,nl(d,!1),s.lanes=4194304);d.isBackwards?(g.sibling=s.child,s.child=g):(r=d.last,r!==null?r.sibling=g:s.child=g,d.last=g)}return d.tail!==null?(r=d.tail,d.rendering=r,d.tail=r.sibling,d.renderingStartTime=on(),r.sibling=null,a=bt.current,re(bt,m?a&1|2:a&1),Be&&Hr(s,d.treeForkCount),r):(it(s),null);case 22:case 23:return Dn(s),vh(),d=s.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(s.flags|=8192):d&&(s.flags|=8192),d?(a&536870912)!==0&&(s.flags&128)===0&&(it(s),s.subtreeFlags&6&&(s.flags|=8192)):it(s),a=s.updateQueue,a!==null&&iu(s,a.retryQueue),a=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==a&&(s.flags|=2048),r!==null&&G(Ss),null;case 24:return a=null,r!==null&&(a=r.memoizedState.cache),s.memoizedState.cache!==a&&(s.flags|=2048),Qr(Et),it(s),null;case 25:return null;case 30:return null}throw Error(o(156,s.tag))}function C2(r,s){switch(rh(s),s.tag){case 1:return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return Qr(Et),Te(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 26:case 27:case 5:return Oe(s),null;case 31:if(s.memoizedState!==null){if(Dn(s),s.alternate===null)throw Error(o(340));bs()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 13:if(Dn(s),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(o(340));bs()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return G(bt),null;case 4:return Te(),null;case 10:return Qr(s.type),null;case 22:case 23:return Dn(s),vh(),r!==null&&G(Ss),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 24:return Qr(Et),null;case 25:return null;default:return null}}function w0(r,s){switch(rh(s),s.tag){case 3:Qr(Et),Te();break;case 26:case 27:case 5:Oe(s);break;case 4:Te();break;case 31:s.memoizedState!==null&&Dn(s);break;case 13:Dn(s);break;case 19:G(bt);break;case 10:Qr(s.type);break;case 22:case 23:Dn(s),vh(),r!==null&&G(Ss);break;case 24:Qr(Et)}}function rl(r,s){try{var a=s.updateQueue,d=a!==null?a.lastEffect:null;if(d!==null){var m=d.next;a=m;do{if((a.tag&r)===r){d=void 0;var g=a.create,E=a.inst;d=g(),E.destroy=d}a=a.next}while(a!==m)}}catch(A){Ke(s,s.return,A)}}function Ao(r,s,a){try{var d=s.updateQueue,m=d!==null?d.lastEffect:null;if(m!==null){var g=m.next;d=g;do{if((d.tag&r)===r){var E=d.inst,A=E.destroy;if(A!==void 0){E.destroy=void 0,m=s;var j=a,q=A;try{q()}catch(K){Ke(m,j,K)}}}d=d.next}while(d!==g)}}catch(K){Ke(s,s.return,K)}}function x0(r){var s=r.updateQueue;if(s!==null){var a=r.stateNode;try{db(s,a)}catch(d){Ke(r,r.return,d)}}}function S0(r,s,a){a.props=Rs(r.type,r.memoizedProps),a.state=r.memoizedState;try{a.componentWillUnmount()}catch(d){Ke(r,s,d)}}function ol(r,s){try{var a=r.ref;if(a!==null){switch(r.tag){case 26:case 27:case 5:var d=r.stateNode;break;case 30:d=r.stateNode;break;default:d=r.stateNode}typeof a=="function"?r.refCleanup=a(d):a.current=d}}catch(m){Ke(r,s,m)}}function Er(r,s){var a=r.ref,d=r.refCleanup;if(a!==null)if(typeof d=="function")try{d()}catch(m){Ke(r,s,m)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(m){Ke(r,s,m)}else a.current=null}function _0(r){var s=r.type,a=r.memoizedProps,d=r.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":a.autoFocus&&d.focus();break e;case"img":a.src?d.src=a.src:a.srcSet&&(d.srcset=a.srcSet)}}catch(m){Ke(r,r.return,m)}}function Kh(r,s,a){try{var d=r.stateNode;G2(d,r.type,a,s),d[hn]=s}catch(m){Ke(r,r.return,m)}}function E0(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&jo(r.type)||r.tag===4}function Xh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||E0(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.tag===27&&jo(r.type)||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 Jh(r,s,a){var d=r.tag;if(d===5||d===6)r=r.stateNode,s?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(r,s):(s=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,s.appendChild(r),a=a._reactRootContainer,a!=null||s.onclick!==null||(s.onclick=Br));else if(d!==4&&(d===27&&jo(r.type)&&(a=r.stateNode,s=null),r=r.child,r!==null))for(Jh(r,s,a),r=r.sibling;r!==null;)Jh(r,s,a),r=r.sibling}function au(r,s,a){var d=r.tag;if(d===5||d===6)r=r.stateNode,s?a.insertBefore(r,s):a.appendChild(r);else if(d!==4&&(d===27&&jo(r.type)&&(a=r.stateNode),r=r.child,r!==null))for(au(r,s,a),r=r.sibling;r!==null;)au(r,s,a),r=r.sibling}function T0(r){var s=r.stateNode,a=r.memoizedProps;try{for(var d=r.type,m=s.attributes;m.length;)s.removeAttributeNode(m[0]);Qt(s,d,a),s[qt]=r,s[hn]=a}catch(g){Ke(r,r.return,g)}}var Jr=!1,Rt=!1,Wh=!1,C0=typeof WeakSet=="function"?WeakSet:Set,Ft=null;function R2(r,s){if(r=r.containerInfo,wp=Au,r=Pv(r),Zf(r)){if("selectionStart"in r)var a={start:r.selectionStart,end:r.selectionEnd};else e:{a=(a=r.ownerDocument)&&a.defaultView||window;var d=a.getSelection&&a.getSelection();if(d&&d.rangeCount!==0){a=d.anchorNode;var m=d.anchorOffset,g=d.focusNode;d=d.focusOffset;try{a.nodeType,g.nodeType}catch{a=null;break e}var E=0,A=-1,j=-1,q=0,K=0,te=r,H=null;t:for(;;){for(var Q;te!==a||m!==0&&te.nodeType!==3||(A=E+m),te!==g||d!==0&&te.nodeType!==3||(j=E+d),te.nodeType===3&&(E+=te.nodeValue.length),(Q=te.firstChild)!==null;)H=te,te=Q;for(;;){if(te===r)break t;if(H===a&&++q===m&&(A=E),H===g&&++K===d&&(j=E),(Q=te.nextSibling)!==null)break;te=H,H=te.parentNode}te=Q}a=A===-1||j===-1?null:{start:A,end:j}}else a=null}a=a||{start:0,end:0}}else a=null;for(xp={focusedElem:r,selectionRange:a},Au=!1,Ft=s;Ft!==null;)if(s=Ft,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,Ft=r;else for(;Ft!==null;){switch(s=Ft,g=s.alternate,r=s.flags,s.tag){case 0:if((r&4)!==0&&(r=s.updateQueue,r=r!==null?r.events:null,r!==null))for(a=0;a<r.length;a++)m=r[a],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&g!==null){r=void 0,a=s,m=g.memoizedProps,g=g.memoizedState,d=a.stateNode;try{var fe=Rs(a.type,m);r=d.getSnapshotBeforeUpdate(fe,g),d.__reactInternalSnapshotBeforeUpdate=r}catch(Ee){Ke(a,a.return,Ee)}}break;case 3:if((r&1024)!==0){if(r=s.stateNode.containerInfo,a=r.nodeType,a===9)Ep(r);else if(a===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Ep(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(o(163))}if(r=s.sibling,r!==null){r.return=s.return,Ft=r;break}Ft=s.return}}function R0(r,s,a){var d=a.flags;switch(a.tag){case 0:case 11:case 15:eo(r,a),d&4&&rl(5,a);break;case 1:if(eo(r,a),d&4)if(r=a.stateNode,s===null)try{r.componentDidMount()}catch(E){Ke(a,a.return,E)}else{var m=Rs(a.type,s.memoizedProps);s=s.memoizedState;try{r.componentDidUpdate(m,s,r.__reactInternalSnapshotBeforeUpdate)}catch(E){Ke(a,a.return,E)}}d&64&&x0(a),d&512&&ol(a,a.return);break;case 3:if(eo(r,a),d&64&&(r=a.updateQueue,r!==null)){if(s=null,a.child!==null)switch(a.child.tag){case 27:case 5:s=a.child.stateNode;break;case 1:s=a.child.stateNode}try{db(r,s)}catch(E){Ke(a,a.return,E)}}break;case 27:s===null&&d&4&&T0(a);case 26:case 5:eo(r,a),s===null&&d&4&&_0(a),d&512&&ol(a,a.return);break;case 12:eo(r,a);break;case 31:eo(r,a),d&4&&O0(r,a);break;case 13:eo(r,a),d&4&&k0(r,a),d&64&&(r=a.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(a=z2.bind(null,a),nO(r,a))));break;case 22:if(d=a.memoizedState!==null||Jr,!d){s=s!==null&&s.memoizedState!==null||Rt,m=Jr;var g=Rt;Jr=d,(Rt=s)&&!g?to(r,a,(a.subtreeFlags&8772)!==0):eo(r,a),Jr=m,Rt=g}break;case 30:break;default:eo(r,a)}}function A0(r){var s=r.alternate;s!==null&&(r.alternate=null,A0(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&Nf(s)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var at=null,mn=!1;function Wr(r,s,a){for(a=a.child;a!==null;)N0(r,s,a),a=a.sibling}function N0(r,s,a){if(Nn&&typeof Nn.onCommitFiberUnmount=="function")try{Nn.onCommitFiberUnmount(Aa,a)}catch{}switch(a.tag){case 26:Rt||Er(a,s),Wr(r,s,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Rt||Er(a,s);var d=at,m=mn;jo(a.type)&&(at=a.stateNode,mn=!1),Wr(r,s,a),hl(a.stateNode),at=d,mn=m;break;case 5:Rt||Er(a,s);case 6:if(d=at,m=mn,at=null,Wr(r,s,a),at=d,mn=m,at!==null)if(mn)try{(at.nodeType===9?at.body:at.nodeName==="HTML"?at.ownerDocument.body:at).removeChild(a.stateNode)}catch(g){Ke(a,s,g)}else try{at.removeChild(a.stateNode)}catch(g){Ke(a,s,g)}break;case 18:at!==null&&(mn?(r=at,xw(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,a.stateNode),$i(r)):xw(at,a.stateNode));break;case 4:d=at,m=mn,at=a.stateNode.containerInfo,mn=!0,Wr(r,s,a),at=d,mn=m;break;case 0:case 11:case 14:case 15:Ao(2,a,s),Rt||Ao(4,a,s),Wr(r,s,a);break;case 1:Rt||(Er(a,s),d=a.stateNode,typeof d.componentWillUnmount=="function"&&S0(a,s,d)),Wr(r,s,a);break;case 21:Wr(r,s,a);break;case 22:Rt=(d=Rt)||a.memoizedState!==null,Wr(r,s,a),Rt=d;break;default:Wr(r,s,a)}}function O0(r,s){if(s.memoizedState===null&&(r=s.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{$i(r)}catch(a){Ke(s,s.return,a)}}}function k0(r,s){if(s.memoizedState===null&&(r=s.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{$i(r)}catch(a){Ke(s,s.return,a)}}function A2(r){switch(r.tag){case 31:case 13:case 19:var s=r.stateNode;return s===null&&(s=r.stateNode=new C0),s;case 22:return r=r.stateNode,s=r._retryCache,s===null&&(s=r._retryCache=new C0),s;default:throw Error(o(435,r.tag))}}function lu(r,s){var a=A2(r);s.forEach(function(d){if(!a.has(d)){a.add(d);var m=L2.bind(null,r,d);d.then(m,m)}})}function gn(r,s){var a=s.deletions;if(a!==null)for(var d=0;d<a.length;d++){var m=a[d],g=r,E=s,A=E;e:for(;A!==null;){switch(A.tag){case 27:if(jo(A.type)){at=A.stateNode,mn=!1;break e}break;case 5:at=A.stateNode,mn=!1;break e;case 3:case 4:at=A.stateNode.containerInfo,mn=!0;break e}A=A.return}if(at===null)throw Error(o(160));N0(g,E,m),at=null,mn=!1,g=m.alternate,g!==null&&(g.return=null),m.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)M0(s,r),s=s.sibling}var fr=null;function M0(r,s){var a=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:gn(s,r),yn(r),d&4&&(Ao(3,r,r.return),rl(3,r),Ao(5,r,r.return));break;case 1:gn(s,r),yn(r),d&512&&(Rt||a===null||Er(a,a.return)),d&64&&Jr&&(r=r.updateQueue,r!==null&&(d=r.callbacks,d!==null&&(a=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=a===null?d:a.concat(d))));break;case 26:var m=fr;if(gn(s,r),yn(r),d&512&&(Rt||a===null||Er(a,a.return)),d&4){var g=a!==null?a.memoizedState:null;if(d=r.memoizedState,a===null)if(d===null)if(r.stateNode===null){e:{d=r.type,a=r.memoizedProps,m=m.ownerDocument||m;t:switch(d){case"title":g=m.getElementsByTagName("title")[0],(!g||g[ka]||g[qt]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=m.createElement(d),m.head.insertBefore(g,m.querySelector("head > title"))),Qt(g,d,a),g[qt]=r,$t(g),d=g;break e;case"link":var E=Mw("link","href",m).get(d+(a.href||""));if(E){for(var A=0;A<E.length;A++)if(g=E[A],g.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&g.getAttribute("rel")===(a.rel==null?null:a.rel)&&g.getAttribute("title")===(a.title==null?null:a.title)&&g.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){E.splice(A,1);break t}}g=m.createElement(d),Qt(g,d,a),m.head.appendChild(g);break;case"meta":if(E=Mw("meta","content",m).get(d+(a.content||""))){for(A=0;A<E.length;A++)if(g=E[A],g.getAttribute("content")===(a.content==null?null:""+a.content)&&g.getAttribute("name")===(a.name==null?null:a.name)&&g.getAttribute("property")===(a.property==null?null:a.property)&&g.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&g.getAttribute("charset")===(a.charSet==null?null:a.charSet)){E.splice(A,1);break t}}g=m.createElement(d),Qt(g,d,a),m.head.appendChild(g);break;default:throw Error(o(468,d))}g[qt]=r,$t(g),d=g}r.stateNode=d}else Iw(m,r.type,r.stateNode);else r.stateNode=kw(m,d,r.memoizedProps);else g!==d?(g===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):g.count--,d===null?Iw(m,r.type,r.stateNode):kw(m,d,r.memoizedProps)):d===null&&r.stateNode!==null&&Kh(r,r.memoizedProps,a.memoizedProps)}break;case 27:gn(s,r),yn(r),d&512&&(Rt||a===null||Er(a,a.return)),a!==null&&d&4&&Kh(r,r.memoizedProps,a.memoizedProps);break;case 5:if(gn(s,r),yn(r),d&512&&(Rt||a===null||Er(a,a.return)),r.flags&32){m=r.stateNode;try{li(m,"")}catch(fe){Ke(r,r.return,fe)}}d&4&&r.stateNode!=null&&(m=r.memoizedProps,Kh(r,m,a!==null?a.memoizedProps:m)),d&1024&&(Wh=!0);break;case 6:if(gn(s,r),yn(r),d&4){if(r.stateNode===null)throw Error(o(162));d=r.memoizedProps,a=r.stateNode;try{a.nodeValue=d}catch(fe){Ke(r,r.return,fe)}}break;case 3:if(Eu=null,m=fr,fr=Su(s.containerInfo),gn(s,r),fr=m,yn(r),d&4&&a!==null&&a.memoizedState.isDehydrated)try{$i(s.containerInfo)}catch(fe){Ke(r,r.return,fe)}Wh&&(Wh=!1,I0(r));break;case 4:d=fr,fr=Su(r.stateNode.containerInfo),gn(s,r),yn(r),fr=d;break;case 12:gn(s,r),yn(r);break;case 31:gn(s,r),yn(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,lu(r,d)));break;case 13:gn(s,r),yn(r),r.child.flags&8192&&r.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(uu=on()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,lu(r,d)));break;case 22:m=r.memoizedState!==null;var j=a!==null&&a.memoizedState!==null,q=Jr,K=Rt;if(Jr=q||m,Rt=K||j,gn(s,r),Rt=K,Jr=q,yn(r),d&8192)e:for(s=r.stateNode,s._visibility=m?s._visibility&-2:s._visibility|1,m&&(a===null||j||Jr||Rt||As(r)),a=null,s=r;;){if(s.tag===5||s.tag===26){if(a===null){j=a=s;try{if(g=j.stateNode,m)E=g.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{A=j.stateNode;var te=j.memoizedProps.style,H=te!=null&&te.hasOwnProperty("display")?te.display:null;A.style.display=H==null||typeof H=="boolean"?"":(""+H).trim()}}catch(fe){Ke(j,j.return,fe)}}}else if(s.tag===6){if(a===null){j=s;try{j.stateNode.nodeValue=m?"":j.memoizedProps}catch(fe){Ke(j,j.return,fe)}}}else if(s.tag===18){if(a===null){j=s;try{var Q=j.stateNode;m?Sw(Q,!0):Sw(j.stateNode,!1)}catch(fe){Ke(j,j.return,fe)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===r)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break e;for(;s.sibling===null;){if(s.return===null||s.return===r)break e;a===s&&(a=null),s=s.return}a===s&&(a=null),s.sibling.return=s.return,s=s.sibling}d&4&&(d=r.updateQueue,d!==null&&(a=d.retryQueue,a!==null&&(d.retryQueue=null,lu(r,a))));break;case 19:gn(s,r),yn(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,lu(r,d)));break;case 30:break;case 21:break;default:gn(s,r),yn(r)}}function yn(r){var s=r.flags;if(s&2){try{for(var a,d=r.return;d!==null;){if(E0(d)){a=d;break}d=d.return}if(a==null)throw Error(o(160));switch(a.tag){case 27:var m=a.stateNode,g=Xh(r);au(r,g,m);break;case 5:var E=a.stateNode;a.flags&32&&(li(E,""),a.flags&=-33);var A=Xh(r);au(r,A,E);break;case 3:case 4:var j=a.stateNode.containerInfo,q=Xh(r);Jh(r,q,j);break;default:throw Error(o(161))}}catch(K){Ke(r,r.return,K)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function I0(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var s=r;I0(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),r=r.sibling}}function eo(r,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)R0(r,s.alternate,s),s=s.sibling}function As(r){for(r=r.child;r!==null;){var s=r;switch(s.tag){case 0:case 11:case 14:case 15:Ao(4,s,s.return),As(s);break;case 1:Er(s,s.return);var a=s.stateNode;typeof a.componentWillUnmount=="function"&&S0(s,s.return,a),As(s);break;case 27:hl(s.stateNode);case 26:case 5:Er(s,s.return),As(s);break;case 22:s.memoizedState===null&&As(s);break;case 30:As(s);break;default:As(s)}r=r.sibling}}function to(r,s,a){for(a=a&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var d=s.alternate,m=r,g=s,E=g.flags;switch(g.tag){case 0:case 11:case 15:to(m,g,a),rl(4,g);break;case 1:if(to(m,g,a),d=g,m=d.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(q){Ke(d,d.return,q)}if(d=g,m=d.updateQueue,m!==null){var A=d.stateNode;try{var j=m.shared.hiddenCallbacks;if(j!==null)for(m.shared.hiddenCallbacks=null,m=0;m<j.length;m++)ub(j[m],A)}catch(q){Ke(d,d.return,q)}}a&&E&64&&x0(g),ol(g,g.return);break;case 27:T0(g);case 26:case 5:to(m,g,a),a&&d===null&&E&4&&_0(g),ol(g,g.return);break;case 12:to(m,g,a);break;case 31:to(m,g,a),a&&E&4&&O0(m,g);break;case 13:to(m,g,a),a&&E&4&&k0(m,g);break;case 22:g.memoizedState===null&&to(m,g,a),ol(g,g.return);break;case 30:break;default:to(m,g,a)}s=s.sibling}}function ep(r,s){var a=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),r=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(r=s.memoizedState.cachePool.pool),r!==a&&(r!=null&&r.refCount++,a!=null&&Va(a))}function tp(r,s){r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&Va(r))}function hr(r,s,a,d){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)D0(r,s,a,d),s=s.sibling}function D0(r,s,a,d){var m=s.flags;switch(s.tag){case 0:case 11:case 15:hr(r,s,a,d),m&2048&&rl(9,s);break;case 1:hr(r,s,a,d);break;case 3:hr(r,s,a,d),m&2048&&(r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&Va(r)));break;case 12:if(m&2048){hr(r,s,a,d),r=s.stateNode;try{var g=s.memoizedProps,E=g.id,A=g.onPostCommit;typeof A=="function"&&A(E,s.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(j){Ke(s,s.return,j)}}else hr(r,s,a,d);break;case 31:hr(r,s,a,d);break;case 13:hr(r,s,a,d);break;case 23:break;case 22:g=s.stateNode,E=s.alternate,s.memoizedState!==null?g._visibility&2?hr(r,s,a,d):sl(r,s):g._visibility&2?hr(r,s,a,d):(g._visibility|=2,Ai(r,s,a,d,(s.subtreeFlags&10256)!==0||!1)),m&2048&&ep(E,s);break;case 24:hr(r,s,a,d),m&2048&&tp(s.alternate,s);break;default:hr(r,s,a,d)}}function Ai(r,s,a,d,m){for(m=m&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var g=r,E=s,A=a,j=d,q=E.flags;switch(E.tag){case 0:case 11:case 15:Ai(g,E,A,j,m),rl(8,E);break;case 23:break;case 22:var K=E.stateNode;E.memoizedState!==null?K._visibility&2?Ai(g,E,A,j,m):sl(g,E):(K._visibility|=2,Ai(g,E,A,j,m)),m&&q&2048&&ep(E.alternate,E);break;case 24:Ai(g,E,A,j,m),m&&q&2048&&tp(E.alternate,E);break;default:Ai(g,E,A,j,m)}s=s.sibling}}function sl(r,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var a=r,d=s,m=d.flags;switch(d.tag){case 22:sl(a,d),m&2048&&ep(d.alternate,d);break;case 24:sl(a,d),m&2048&&tp(d.alternate,d);break;default:sl(a,d)}s=s.sibling}}var il=8192;function Ni(r,s,a){if(r.subtreeFlags&il)for(r=r.child;r!==null;)j0(r,s,a),r=r.sibling}function j0(r,s,a){switch(r.tag){case 26:Ni(r,s,a),r.flags&il&&r.memoizedState!==null&&pO(a,fr,r.memoizedState,r.memoizedProps);break;case 5:Ni(r,s,a);break;case 3:case 4:var d=fr;fr=Su(r.stateNode.containerInfo),Ni(r,s,a),fr=d;break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=il,il=16777216,Ni(r,s,a),il=d):Ni(r,s,a));break;default:Ni(r,s,a)}}function z0(r){var s=r.alternate;if(s!==null&&(r=s.child,r!==null)){s.child=null;do s=r.sibling,r.sibling=null,r=s;while(r!==null)}}function al(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var a=0;a<s.length;a++){var d=s[a];Ft=d,P0(d,r)}z0(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)L0(r),r=r.sibling}function L0(r){switch(r.tag){case 0:case 11:case 15:al(r),r.flags&2048&&Ao(9,r,r.return);break;case 3:al(r);break;case 12:al(r);break;case 22:var s=r.stateNode;r.memoizedState!==null&&s._visibility&2&&(r.return===null||r.return.tag!==13)?(s._visibility&=-3,cu(r)):al(r);break;default:al(r)}}function cu(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var a=0;a<s.length;a++){var d=s[a];Ft=d,P0(d,r)}z0(r)}for(r=r.child;r!==null;){switch(s=r,s.tag){case 0:case 11:case 15:Ao(8,s,s.return),cu(s);break;case 22:a=s.stateNode,a._visibility&2&&(a._visibility&=-3,cu(s));break;default:cu(s)}r=r.sibling}}function P0(r,s){for(;Ft!==null;){var a=Ft;switch(a.tag){case 0:case 11:case 15:Ao(8,a,s);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var d=a.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:Va(a.memoizedState.cache)}if(d=a.child,d!==null)d.return=a,Ft=d;else e:for(a=r;Ft!==null;){d=Ft;var m=d.sibling,g=d.return;if(A0(d),d===a){Ft=null;break e}if(m!==null){m.return=g,Ft=m;break e}Ft=g}}}var N2={getCacheForType:function(r){var s=Ht(Et),a=s.data.get(r);return a===void 0&&(a=r(),s.data.set(r,a)),a},cacheSignal:function(){return Ht(Et).controller.signal}},O2=typeof WeakMap=="function"?WeakMap:Map,Ge=0,tt=null,Le=null,$e=0,Ye=0,jn=null,No=!1,Oi=!1,np=!1,no=0,mt=0,Oo=0,Ns=0,rp=0,zn=0,ki=0,ll=null,vn=null,op=!1,uu=0,$0=0,du=1/0,fu=null,ko=null,Dt=0,Mo=null,Mi=null,ro=0,sp=0,ip=null,F0=null,cl=0,ap=null;function Ln(){return(Ge&2)!==0&&$e!==0?$e&-$e:F.T!==null?hp():nv()}function U0(){if(zn===0)if(($e&536870912)===0||Be){var r=wc;wc<<=1,(wc&3932160)===0&&(wc=262144),zn=r}else zn=536870912;return r=In.current,r!==null&&(r.flags|=32),zn}function bn(r,s,a){(r===tt&&(Ye===2||Ye===9)||r.cancelPendingCommit!==null)&&(Ii(r,0),Io(r,$e,zn,!1)),Oa(r,a),((Ge&2)===0||r!==tt)&&(r===tt&&((Ge&2)===0&&(Ns|=a),mt===4&&Io(r,$e,zn,!1)),Tr(r))}function B0(r,s,a){if((Ge&6)!==0)throw Error(o(327));var d=!a&&(s&127)===0&&(s&r.expiredLanes)===0||Na(r,s),m=d?I2(r,s):cp(r,s,!0),g=d;do{if(m===0){Oi&&!d&&Io(r,s,0,!1);break}else{if(a=r.current.alternate,g&&!k2(a)){m=cp(r,s,!1),g=!1;continue}if(m===2){if(g=s,r.errorRecoveryDisabledLanes&g)var E=0;else E=r.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){s=E;e:{var A=r;m=ll;var j=A.current.memoizedState.isDehydrated;if(j&&(Ii(A,E).flags|=256),E=cp(A,E,!1),E!==2){if(np&&!j){A.errorRecoveryDisabledLanes|=g,Ns|=g,m=4;break e}g=vn,vn=m,g!==null&&(vn===null?vn=g:vn.push.apply(vn,g))}m=E}if(g=!1,m!==2)continue}}if(m===1){Ii(r,0),Io(r,s,0,!0);break}e:{switch(d=r,g=m,g){case 0:case 1:throw Error(o(345));case 4:if((s&4194048)!==s)break;case 6:Io(d,s,zn,!No);break e;case 2:vn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((s&62914560)===s&&(m=uu+300-on(),10<m)){if(Io(d,s,zn,!No),Sc(d,0,!0)!==0)break e;ro=s,d.timeoutHandle=bw(q0.bind(null,d,a,vn,fu,op,s,zn,Ns,ki,No,g,"Throttled",-0,0),m);break e}q0(d,a,vn,fu,op,s,zn,Ns,ki,No,g,null,-0,0)}}break}while(!0);Tr(r)}function q0(r,s,a,d,m,g,E,A,j,q,K,te,H,Q){if(r.timeoutHandle=-1,te=s.subtreeFlags,te&8192||(te&16785408)===16785408){te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Br},j0(s,g,te);var fe=(g&62914560)===g?uu-on():(g&4194048)===g?$0-on():0;if(fe=mO(te,fe),fe!==null){ro=g,r.cancelPendingCommit=fe(X0.bind(null,r,s,g,a,d,m,E,A,j,K,te,null,H,Q)),Io(r,g,E,!q);return}}X0(r,s,g,a,d,m,E,A,j)}function k2(r){for(var s=r;;){var a=s.tag;if((a===0||a===11||a===15)&&s.flags&16384&&(a=s.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var d=0;d<a.length;d++){var m=a[d],g=m.getSnapshot;m=m.value;try{if(!kn(g(),m))return!1}catch{return!1}}if(a=s.child,s.subtreeFlags&16384&&a!==null)a.return=s,s=a;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Io(r,s,a,d){s&=~rp,s&=~Ns,r.suspendedLanes|=s,r.pingedLanes&=~s,d&&(r.warmLanes|=s),d=r.expirationTimes;for(var m=s;0<m;){var g=31-On(m),E=1<<g;d[g]=-1,m&=~E}a!==0&&Wy(r,a,s)}function hu(){return(Ge&6)===0?(ul(0),!1):!0}function lp(){if(Le!==null){if(Ye===0)var r=Le.return;else r=Le,Zr=ws=null,Eh(r),_i=null,Za=0,r=Le;for(;r!==null;)w0(r.alternate,r),r=r.return;Le=null}}function Ii(r,s){var a=r.timeoutHandle;a!==-1&&(r.timeoutHandle=-1,X2(a)),a=r.cancelPendingCommit,a!==null&&(r.cancelPendingCommit=null,a()),ro=0,lp(),tt=r,Le=a=Vr(r.current,null),$e=s,Ye=0,jn=null,No=!1,Oi=Na(r,s),np=!1,ki=zn=rp=Ns=Oo=mt=0,vn=ll=null,op=!1,(s&8)!==0&&(s|=s&32);var d=r.entangledLanes;if(d!==0)for(r=r.entanglements,d&=s;0<d;){var m=31-On(d),g=1<<m;s|=r[m],d&=~g}return no=s,Dc(),a}function V0(r,s){Ae=null,F.H=el,s===Si||s===Bc?(s=ib(),Ye=3):s===fh?(s=ib(),Ye=4):Ye=s===Fh?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,jn=s,Le===null&&(mt=1,nu(r,Qn(s,r.current)))}function H0(){var r=In.current;return r===null?!0:($e&4194048)===$e?Xn===null:($e&62914560)===$e||($e&536870912)!==0?r===Xn:!1}function Z0(){var r=F.H;return F.H=el,r===null?el:r}function Q0(){var r=F.A;return F.A=N2,r}function pu(){mt=4,No||($e&4194048)!==$e&&In.current!==null||(Oi=!0),(Oo&134217727)===0&&(Ns&134217727)===0||tt===null||Io(tt,$e,zn,!1)}function cp(r,s,a){var d=Ge;Ge|=2;var m=Z0(),g=Q0();(tt!==r||$e!==s)&&(fu=null,Ii(r,s)),s=!1;var E=mt;e:do try{if(Ye!==0&&Le!==null){var A=Le,j=jn;switch(Ye){case 8:lp(),E=6;break e;case 3:case 2:case 9:case 6:In.current===null&&(s=!0);var q=Ye;if(Ye=0,jn=null,Di(r,A,j,q),a&&Oi){E=0;break e}break;default:q=Ye,Ye=0,jn=null,Di(r,A,j,q)}}M2(),E=mt;break}catch(K){V0(r,K)}while(!0);return s&&r.shellSuspendCounter++,Zr=ws=null,Ge=d,F.H=m,F.A=g,Le===null&&(tt=null,$e=0,Dc()),E}function M2(){for(;Le!==null;)G0(Le)}function I2(r,s){var a=Ge;Ge|=2;var d=Z0(),m=Q0();tt!==r||$e!==s?(fu=null,du=on()+500,Ii(r,s)):Oi=Na(r,s);e:do try{if(Ye!==0&&Le!==null){s=Le;var g=jn;t:switch(Ye){case 1:Ye=0,jn=null,Di(r,s,g,1);break;case 2:case 9:if(ob(g)){Ye=0,jn=null,Y0(s);break}s=function(){Ye!==2&&Ye!==9||tt!==r||(Ye=7),Tr(r)},g.then(s,s);break e;case 3:Ye=7;break e;case 4:Ye=5;break e;case 7:ob(g)?(Ye=0,jn=null,Y0(s)):(Ye=0,jn=null,Di(r,s,g,7));break;case 5:var E=null;switch(Le.tag){case 26:E=Le.memoizedState;case 5:case 27:var A=Le;if(E?Dw(E):A.stateNode.complete){Ye=0,jn=null;var j=A.sibling;if(j!==null)Le=j;else{var q=A.return;q!==null?(Le=q,mu(q)):Le=null}break t}}Ye=0,jn=null,Di(r,s,g,5);break;case 6:Ye=0,jn=null,Di(r,s,g,6);break;case 8:lp(),mt=6;break e;default:throw Error(o(462))}}D2();break}catch(K){V0(r,K)}while(!0);return Zr=ws=null,F.H=d,F.A=m,Ge=a,Le!==null?0:(tt=null,$e=0,Dc(),mt)}function D2(){for(;Le!==null&&!ze();)G0(Le)}function G0(r){var s=v0(r.alternate,r,no);r.memoizedProps=r.pendingProps,s===null?mu(r):Le=s}function Y0(r){var s=r,a=s.alternate;switch(s.tag){case 15:case 0:s=f0(a,s,s.pendingProps,s.type,void 0,$e);break;case 11:s=f0(a,s,s.pendingProps,s.type.render,s.ref,$e);break;case 5:Eh(s);default:w0(a,s),s=Le=Qv(s,no),s=v0(a,s,no)}r.memoizedProps=r.pendingProps,s===null?mu(r):Le=s}function Di(r,s,a,d){Zr=ws=null,Eh(s),_i=null,Za=0;var m=s.return;try{if(S2(r,m,s,a,$e)){mt=1,nu(r,Qn(a,r.current)),Le=null;return}}catch(g){if(m!==null)throw Le=m,g;mt=1,nu(r,Qn(a,r.current)),Le=null;return}s.flags&32768?(Be||d===1?r=!0:Oi||($e&536870912)!==0?r=!1:(No=r=!0,(d===2||d===9||d===3||d===6)&&(d=In.current,d!==null&&d.tag===13&&(d.flags|=16384))),K0(s,r)):mu(s)}function mu(r){var s=r;do{if((s.flags&32768)!==0){K0(s,No);return}r=s.return;var a=T2(s.alternate,s,no);if(a!==null){Le=a;return}if(s=s.sibling,s!==null){Le=s;return}Le=s=r}while(s!==null);mt===0&&(mt=5)}function K0(r,s){do{var a=C2(r.alternate,r);if(a!==null){a.flags&=32767,Le=a;return}if(a=r.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!s&&(r=r.sibling,r!==null)){Le=r;return}Le=r=a}while(r!==null);mt=6,Le=null}function X0(r,s,a,d,m,g,E,A,j){r.cancelPendingCommit=null;do gu();while(Dt!==0);if((Ge&6)!==0)throw Error(o(327));if(s!==null){if(s===r.current)throw Error(o(177));if(g=s.lanes|s.childLanes,g|=Xf,hN(r,a,g,E,A,j),r===tt&&(Le=tt=null,$e=0),Mi=s,Mo=r,ro=a,sp=g,ip=m,F0=d,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,P2(Jt,function(){return nw(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||d){d=F.T,F.T=null,m=X.p,X.p=2,E=Ge,Ge|=4;try{R2(r,s,a)}finally{Ge=E,X.p=m,F.T=d}}Dt=1,J0(),W0(),ew()}}function J0(){if(Dt===1){Dt=0;var r=Mo,s=Mi,a=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||a){a=F.T,F.T=null;var d=X.p;X.p=2;var m=Ge;Ge|=4;try{M0(s,r);var g=xp,E=Pv(r.containerInfo),A=g.focusedElem,j=g.selectionRange;if(E!==A&&A&&A.ownerDocument&&Lv(A.ownerDocument.documentElement,A)){if(j!==null&&Zf(A)){var q=j.start,K=j.end;if(K===void 0&&(K=q),"selectionStart"in A)A.selectionStart=q,A.selectionEnd=Math.min(K,A.value.length);else{var te=A.ownerDocument||document,H=te&&te.defaultView||window;if(H.getSelection){var Q=H.getSelection(),fe=A.textContent.length,Ee=Math.min(j.start,fe),et=j.end===void 0?Ee:Math.min(j.end,fe);!Q.extend&&Ee>et&&(E=et,et=Ee,Ee=E);var U=zv(A,Ee),P=zv(A,et);if(U&&P&&(Q.rangeCount!==1||Q.anchorNode!==U.node||Q.anchorOffset!==U.offset||Q.focusNode!==P.node||Q.focusOffset!==P.offset)){var B=te.createRange();B.setStart(U.node,U.offset),Q.removeAllRanges(),Ee>et?(Q.addRange(B),Q.extend(P.node,P.offset)):(B.setEnd(P.node,P.offset),Q.addRange(B))}}}}for(te=[],Q=A;Q=Q.parentNode;)Q.nodeType===1&&te.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<te.length;A++){var W=te[A];W.element.scrollLeft=W.left,W.element.scrollTop=W.top}}Au=!!wp,xp=wp=null}finally{Ge=m,X.p=d,F.T=a}}r.current=s,Dt=2}}function W0(){if(Dt===2){Dt=0;var r=Mo,s=Mi,a=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||a){a=F.T,F.T=null;var d=X.p;X.p=2;var m=Ge;Ge|=4;try{R0(r,s.alternate,s)}finally{Ge=m,X.p=d,F.T=a}}Dt=3}}function ew(){if(Dt===4||Dt===3){Dt=0,Ut();var r=Mo,s=Mi,a=ro,d=F0;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Dt=5:(Dt=0,Mi=Mo=null,tw(r,r.pendingLanes));var m=r.pendingLanes;if(m===0&&(ko=null),Rf(a),s=s.stateNode,Nn&&typeof Nn.onCommitFiberRoot=="function")try{Nn.onCommitFiberRoot(Aa,s,void 0,(s.current.flags&128)===128)}catch{}if(d!==null){s=F.T,m=X.p,X.p=2,F.T=null;try{for(var g=r.onRecoverableError,E=0;E<d.length;E++){var A=d[E];g(A.value,{componentStack:A.stack})}}finally{F.T=s,X.p=m}}(ro&3)!==0&&gu(),Tr(r),m=r.pendingLanes,(a&261930)!==0&&(m&42)!==0?r===ap?cl++:(cl=0,ap=r):cl=0,ul(0)}}function tw(r,s){(r.pooledCacheLanes&=s)===0&&(s=r.pooledCache,s!=null&&(r.pooledCache=null,Va(s)))}function gu(){return J0(),W0(),ew(),nw()}function nw(){if(Dt!==5)return!1;var r=Mo,s=sp;sp=0;var a=Rf(ro),d=F.T,m=X.p;try{X.p=32>a?32:a,F.T=null,a=ip,ip=null;var g=Mo,E=ro;if(Dt=0,Mi=Mo=null,ro=0,(Ge&6)!==0)throw Error(o(331));var A=Ge;if(Ge|=4,L0(g.current),D0(g,g.current,E,a),Ge=A,ul(0,!1),Nn&&typeof Nn.onPostCommitFiberRoot=="function")try{Nn.onPostCommitFiberRoot(Aa,g)}catch{}return!0}finally{X.p=m,F.T=d,tw(r,s)}}function rw(r,s,a){s=Qn(a,s),s=$h(r.stateNode,s,2),r=To(r,s,2),r!==null&&(Oa(r,2),Tr(r))}function Ke(r,s,a){if(r.tag===3)rw(r,r,a);else for(;s!==null;){if(s.tag===3){rw(s,r,a);break}else if(s.tag===1){var d=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(ko===null||!ko.has(d))){r=Qn(a,r),a=o0(2),d=To(s,a,2),d!==null&&(s0(a,d,s,r),Oa(d,2),Tr(d));break}}s=s.return}}function up(r,s,a){var d=r.pingCache;if(d===null){d=r.pingCache=new O2;var m=new Set;d.set(s,m)}else m=d.get(s),m===void 0&&(m=new Set,d.set(s,m));m.has(a)||(np=!0,m.add(a),r=j2.bind(null,r,s,a),s.then(r,r))}function j2(r,s,a){var d=r.pingCache;d!==null&&d.delete(s),r.pingedLanes|=r.suspendedLanes&a,r.warmLanes&=~a,tt===r&&($e&a)===a&&(mt===4||mt===3&&($e&62914560)===$e&&300>on()-uu?(Ge&2)===0&&Ii(r,0):rp|=a,ki===$e&&(ki=0)),Tr(r)}function ow(r,s){s===0&&(s=Jy()),r=ys(r,s),r!==null&&(Oa(r,s),Tr(r))}function z2(r){var s=r.memoizedState,a=0;s!==null&&(a=s.retryLane),ow(r,a)}function L2(r,s){var a=0;switch(r.tag){case 31:case 13:var d=r.stateNode,m=r.memoizedState;m!==null&&(a=m.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(o(314))}d!==null&&d.delete(s),ow(r,a)}function P2(r,s){return ke(r,s)}var yu=null,ji=null,dp=!1,vu=!1,fp=!1,Do=0;function Tr(r){r!==ji&&r.next===null&&(ji===null?yu=ji=r:ji=ji.next=r),vu=!0,dp||(dp=!0,F2())}function ul(r,s){if(!fp&&vu){fp=!0;do for(var a=!1,d=yu;d!==null;){if(r!==0){var m=d.pendingLanes;if(m===0)var g=0;else{var E=d.suspendedLanes,A=d.pingedLanes;g=(1<<31-On(42|r)+1)-1,g&=m&~(E&~A),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(a=!0,lw(d,g))}else g=$e,g=Sc(d,d===tt?g:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(g&3)===0||Na(d,g)||(a=!0,lw(d,g));d=d.next}while(a);fp=!1}}function $2(){sw()}function sw(){vu=dp=!1;var r=0;Do!==0&&K2()&&(r=Do);for(var s=on(),a=null,d=yu;d!==null;){var m=d.next,g=iw(d,s);g===0?(d.next=null,a===null?yu=m:a.next=m,m===null&&(ji=a)):(a=d,(r!==0||(g&3)!==0)&&(vu=!0)),d=m}Dt!==0&&Dt!==5||ul(r),Do!==0&&(Do=0)}function iw(r,s){for(var a=r.suspendedLanes,d=r.pingedLanes,m=r.expirationTimes,g=r.pendingLanes&-62914561;0<g;){var E=31-On(g),A=1<<E,j=m[E];j===-1?((A&a)===0||(A&d)!==0)&&(m[E]=fN(A,s)):j<=s&&(r.expiredLanes|=A),g&=~A}if(s=tt,a=$e,a=Sc(r,r===s?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,a===0||r===s&&(Ye===2||Ye===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&Ue(d),r.callbackNode=null,r.callbackPriority=0;if((a&3)===0||Na(r,a)){if(s=a&-a,s===r.callbackPriority)return s;switch(d!==null&&Ue(d),Rf(a)){case 2:case 8:a=Bt;break;case 32:a=Jt;break;case 268435456:a=Xy;break;default:a=Jt}return d=aw.bind(null,r),a=ke(a,d),r.callbackPriority=s,r.callbackNode=a,s}return d!==null&&d!==null&&Ue(d),r.callbackPriority=2,r.callbackNode=null,2}function aw(r,s){if(Dt!==0&&Dt!==5)return r.callbackNode=null,r.callbackPriority=0,null;var a=r.callbackNode;if(gu()&&r.callbackNode!==a)return null;var d=$e;return d=Sc(r,r===tt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:(B0(r,d,s),iw(r,on()),r.callbackNode!=null&&r.callbackNode===a?aw.bind(null,r):null)}function lw(r,s){if(gu())return null;B0(r,s,!0)}function F2(){J2(function(){(Ge&6)!==0?ke(ot,$2):sw()})}function hp(){if(Do===0){var r=wi;r===0&&(r=bc,bc<<=1,(bc&261888)===0&&(bc=256)),Do=r}return Do}function cw(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Cc(""+r)}function uw(r,s){var a=s.ownerDocument.createElement("input");return a.name=s.name,a.value=s.value,r.id&&a.setAttribute("form",r.id),s.parentNode.insertBefore(a,s),r=new FormData(r),a.parentNode.removeChild(a),r}function U2(r,s,a,d,m){if(s==="submit"&&a&&a.stateNode===m){var g=cw((m[hn]||null).action),E=d.submitter;E&&(s=(s=E[hn]||null)?cw(s.formAction):E.getAttribute("formAction"),s!==null&&(g=s,E=null));var A=new Oc("action","action",null,d,m);r.push({event:A,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Do!==0){var j=E?uw(m,E):new FormData(m);Ih(a,{pending:!0,data:j,method:m.method,action:g},null,j)}}else typeof g=="function"&&(A.preventDefault(),j=E?uw(m,E):new FormData(m),Ih(a,{pending:!0,data:j,method:m.method,action:g},g,j))},currentTarget:m}]})}}for(var pp=0;pp<Kf.length;pp++){var mp=Kf[pp],B2=mp.toLowerCase(),q2=mp[0].toUpperCase()+mp.slice(1);dr(B2,"on"+q2)}dr(Uv,"onAnimationEnd"),dr(Bv,"onAnimationIteration"),dr(qv,"onAnimationStart"),dr("dblclick","onDoubleClick"),dr("focusin","onFocus"),dr("focusout","onBlur"),dr(s2,"onTransitionRun"),dr(i2,"onTransitionStart"),dr(a2,"onTransitionCancel"),dr(Vv,"onTransitionEnd"),ii("onMouseEnter",["mouseout","mouseover"]),ii("onMouseLeave",["mouseout","mouseover"]),ii("onPointerEnter",["pointerout","pointerover"]),ii("onPointerLeave",["pointerout","pointerover"]),hs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),hs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),hs("onBeforeInput",["compositionend","keypress","textInput","paste"]),hs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),hs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),hs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var dl="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(" "),V2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(dl));function dw(r,s){s=(s&4)!==0;for(var a=0;a<r.length;a++){var d=r[a],m=d.event;d=d.listeners;e:{var g=void 0;if(s)for(var E=d.length-1;0<=E;E--){var A=d[E],j=A.instance,q=A.currentTarget;if(A=A.listener,j!==g&&m.isPropagationStopped())break e;g=A,m.currentTarget=q;try{g(m)}catch(K){Ic(K)}m.currentTarget=null,g=j}else for(E=0;E<d.length;E++){if(A=d[E],j=A.instance,q=A.currentTarget,A=A.listener,j!==g&&m.isPropagationStopped())break e;g=A,m.currentTarget=q;try{g(m)}catch(K){Ic(K)}m.currentTarget=null,g=j}}}}function Pe(r,s){var a=s[Af];a===void 0&&(a=s[Af]=new Set);var d=r+"__bubble";a.has(d)||(fw(s,r,2,!1),a.add(d))}function gp(r,s,a){var d=0;s&&(d|=4),fw(a,r,d,s)}var bu="_reactListening"+Math.random().toString(36).slice(2);function yp(r){if(!r[bu]){r[bu]=!0,sv.forEach(function(a){a!=="selectionchange"&&(V2.has(a)||gp(a,!1,r),gp(a,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[bu]||(s[bu]=!0,gp("selectionchange",!1,s))}}function fw(r,s,a,d){switch(Uw(s)){case 2:var m=vO;break;case 8:m=bO;break;default:m=Mp}a=m.bind(null,s,a,r),m=void 0,!Lf||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(m=!0),d?m!==void 0?r.addEventListener(s,a,{capture:!0,passive:m}):r.addEventListener(s,a,!0):m!==void 0?r.addEventListener(s,a,{passive:m}):r.addEventListener(s,a,!1)}function vp(r,s,a,d,m){var g=d;if((s&1)===0&&(s&2)===0&&d!==null)e:for(;;){if(d===null)return;var E=d.tag;if(E===3||E===4){var A=d.stateNode.containerInfo;if(A===m)break;if(E===4)for(E=d.return;E!==null;){var j=E.tag;if((j===3||j===4)&&E.stateNode.containerInfo===m)return;E=E.return}for(;A!==null;){if(E=ri(A),E===null)return;if(j=E.tag,j===5||j===6||j===26||j===27){d=g=E;continue e}A=A.parentNode}}d=d.return}yv(function(){var q=g,K=jf(a),te=[];e:{var H=Hv.get(r);if(H!==void 0){var Q=Oc,fe=r;switch(r){case"keypress":if(Ac(a)===0)break e;case"keydown":case"keyup":Q=LN;break;case"focusin":fe="focus",Q=Uf;break;case"focusout":fe="blur",Q=Uf;break;case"beforeblur":case"afterblur":Q=Uf;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=wv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=TN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=FN;break;case Uv:case Bv:case qv:Q=AN;break;case Vv:Q=BN;break;case"scroll":case"scrollend":Q=_N;break;case"wheel":Q=VN;break;case"copy":case"cut":case"paste":Q=ON;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=Sv;break;case"toggle":case"beforetoggle":Q=ZN}var Ee=(s&4)!==0,et=!Ee&&(r==="scroll"||r==="scrollend"),U=Ee?H!==null?H+"Capture":null:H;Ee=[];for(var P=q,B;P!==null;){var W=P;if(B=W.stateNode,W=W.tag,W!==5&&W!==26&&W!==27||B===null||U===null||(W=Ia(P,U),W!=null&&Ee.push(fl(P,W,B))),et)break;P=P.return}0<Ee.length&&(H=new Q(H,fe,null,a,K),te.push({event:H,listeners:Ee}))}}if((s&7)===0){e:{if(H=r==="mouseover"||r==="pointerover",Q=r==="mouseout"||r==="pointerout",H&&a!==Df&&(fe=a.relatedTarget||a.fromElement)&&(ri(fe)||fe[ni]))break e;if((Q||H)&&(H=K.window===K?K:(H=K.ownerDocument)?H.defaultView||H.parentWindow:window,Q?(fe=a.relatedTarget||a.toElement,Q=q,fe=fe?ri(fe):null,fe!==null&&(et=l(fe),Ee=fe.tag,fe!==et||Ee!==5&&Ee!==27&&Ee!==6)&&(fe=null)):(Q=null,fe=q),Q!==fe)){if(Ee=wv,W="onMouseLeave",U="onMouseEnter",P="mouse",(r==="pointerout"||r==="pointerover")&&(Ee=Sv,W="onPointerLeave",U="onPointerEnter",P="pointer"),et=Q==null?H:Ma(Q),B=fe==null?H:Ma(fe),H=new Ee(W,P+"leave",Q,a,K),H.target=et,H.relatedTarget=B,W=null,ri(K)===q&&(Ee=new Ee(U,P+"enter",fe,a,K),Ee.target=B,Ee.relatedTarget=et,W=Ee),et=W,Q&&fe)t:{for(Ee=H2,U=Q,P=fe,B=0,W=U;W;W=Ee(W))B++;W=0;for(var we=P;we;we=Ee(we))W++;for(;0<B-W;)U=Ee(U),B--;for(;0<W-B;)P=Ee(P),W--;for(;B--;){if(U===P||P!==null&&U===P.alternate){Ee=U;break t}U=Ee(U),P=Ee(P)}Ee=null}else Ee=null;Q!==null&&hw(te,H,Q,Ee,!1),fe!==null&&et!==null&&hw(te,et,fe,Ee,!0)}}e:{if(H=q?Ma(q):window,Q=H.nodeName&&H.nodeName.toLowerCase(),Q==="select"||Q==="input"&&H.type==="file")var Ve=Ov;else if(Av(H))if(kv)Ve=n2;else{Ve=e2;var ye=WN}else Q=H.nodeName,!Q||Q.toLowerCase()!=="input"||H.type!=="checkbox"&&H.type!=="radio"?q&&If(q.elementType)&&(Ve=Ov):Ve=t2;if(Ve&&(Ve=Ve(r,q))){Nv(te,Ve,a,K);break e}ye&&ye(r,H,q),r==="focusout"&&q&&H.type==="number"&&q.memoizedProps.value!=null&&Mf(H,"number",H.value)}switch(ye=q?Ma(q):window,r){case"focusin":(Av(ye)||ye.contentEditable==="true")&&(fi=ye,Qf=q,Ua=null);break;case"focusout":Ua=Qf=fi=null;break;case"mousedown":Gf=!0;break;case"contextmenu":case"mouseup":case"dragend":Gf=!1,$v(te,a,K);break;case"selectionchange":if(o2)break;case"keydown":case"keyup":$v(te,a,K)}var Me;if(qf)e:{switch(r){case"compositionstart":var Fe="onCompositionStart";break e;case"compositionend":Fe="onCompositionEnd";break e;case"compositionupdate":Fe="onCompositionUpdate";break e}Fe=void 0}else di?Cv(r,a)&&(Fe="onCompositionEnd"):r==="keydown"&&a.keyCode===229&&(Fe="onCompositionStart");Fe&&(_v&&a.locale!=="ko"&&(di||Fe!=="onCompositionStart"?Fe==="onCompositionEnd"&&di&&(Me=vv()):(vo=K,Pf="value"in vo?vo.value:vo.textContent,di=!0)),ye=wu(q,Fe),0<ye.length&&(Fe=new xv(Fe,r,null,a,K),te.push({event:Fe,listeners:ye}),Me?Fe.data=Me:(Me=Rv(a),Me!==null&&(Fe.data=Me)))),(Me=GN?YN(r,a):KN(r,a))&&(Fe=wu(q,"onBeforeInput"),0<Fe.length&&(ye=new xv("onBeforeInput","beforeinput",null,a,K),te.push({event:ye,listeners:Fe}),ye.data=Me)),U2(te,r,q,a,K)}dw(te,s)})}function fl(r,s,a){return{instance:r,listener:s,currentTarget:a}}function wu(r,s){for(var a=s+"Capture",d=[];r!==null;){var m=r,g=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||g===null||(m=Ia(r,a),m!=null&&d.unshift(fl(r,m,g)),m=Ia(r,s),m!=null&&d.push(fl(r,m,g))),r.tag===3)return d;r=r.return}return[]}function H2(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function hw(r,s,a,d,m){for(var g=s._reactName,E=[];a!==null&&a!==d;){var A=a,j=A.alternate,q=A.stateNode;if(A=A.tag,j!==null&&j===d)break;A!==5&&A!==26&&A!==27||q===null||(j=q,m?(q=Ia(a,g),q!=null&&E.unshift(fl(a,q,j))):m||(q=Ia(a,g),q!=null&&E.push(fl(a,q,j)))),a=a.return}E.length!==0&&r.push({event:s,listeners:E})}var Z2=/\r\n?/g,Q2=/\u0000|\uFFFD/g;function pw(r){return(typeof r=="string"?r:""+r).replace(Z2,`
10
+ `).replace(Q2,"")}function mw(r,s){return s=pw(s),pw(r)===s}function We(r,s,a,d,m,g){switch(a){case"children":typeof d=="string"?s==="body"||s==="textarea"&&d===""||li(r,d):(typeof d=="number"||typeof d=="bigint")&&s!=="body"&&li(r,""+d);break;case"className":Ec(r,"class",d);break;case"tabIndex":Ec(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":Ec(r,a,d);break;case"style":mv(r,d,g);break;case"data":if(s!=="object"){Ec(r,"data",d);break}case"src":case"href":if(d===""&&(s!=="a"||a!=="href")){r.removeAttribute(a);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(a);break}d=Cc(""+d),r.setAttribute(a,d);break;case"action":case"formAction":if(typeof d=="function"){r.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof g=="function"&&(a==="formAction"?(s!=="input"&&We(r,s,"name",m.name,m,null),We(r,s,"formEncType",m.formEncType,m,null),We(r,s,"formMethod",m.formMethod,m,null),We(r,s,"formTarget",m.formTarget,m,null)):(We(r,s,"encType",m.encType,m,null),We(r,s,"method",m.method,m,null),We(r,s,"target",m.target,m,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(a);break}d=Cc(""+d),r.setAttribute(a,d);break;case"onClick":d!=null&&(r.onclick=Br);break;case"onScroll":d!=null&&Pe("scroll",r);break;case"onScrollEnd":d!=null&&Pe("scrollend",r);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(o(61));if(a=d.__html,a!=null){if(m.children!=null)throw Error(o(60));r.innerHTML=a}}break;case"multiple":r.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":r.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){r.removeAttribute("xlink:href");break}a=Cc(""+d),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(a,""+d):r.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(a,""):r.removeAttribute(a);break;case"capture":case"download":d===!0?r.setAttribute(a,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(a,d):r.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?r.setAttribute(a,d):r.removeAttribute(a);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?r.removeAttribute(a):r.setAttribute(a,d);break;case"popover":Pe("beforetoggle",r),Pe("toggle",r),_c(r,"popover",d);break;case"xlinkActuate":Ur(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Ur(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Ur(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Ur(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Ur(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Ur(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Ur(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Ur(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Ur(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":_c(r,"is",d);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=xN.get(a)||a,_c(r,a,d))}}function bp(r,s,a,d,m,g){switch(a){case"style":mv(r,d,g);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(o(61));if(a=d.__html,a!=null){if(m.children!=null)throw Error(o(60));r.innerHTML=a}}break;case"children":typeof d=="string"?li(r,d):(typeof d=="number"||typeof d=="bigint")&&li(r,""+d);break;case"onScroll":d!=null&&Pe("scroll",r);break;case"onScrollEnd":d!=null&&Pe("scrollend",r);break;case"onClick":d!=null&&(r.onclick=Br);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!iv.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(m=a.endsWith("Capture"),s=a.slice(2,m?a.length-7:void 0),g=r[hn]||null,g=g!=null?g[a]:null,typeof g=="function"&&r.removeEventListener(s,g,m),typeof d=="function")){typeof g!="function"&&g!==null&&(a in r?r[a]=null:r.hasAttribute(a)&&r.removeAttribute(a)),r.addEventListener(s,d,m);break e}a in r?r[a]=d:d===!0?r.setAttribute(a,""):_c(r,a,d)}}}function Qt(r,s,a){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",r),Pe("load",r);var d=!1,m=!1,g;for(g in a)if(a.hasOwnProperty(g)){var E=a[g];if(E!=null)switch(g){case"src":d=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,s));default:We(r,s,g,E,a,null)}}m&&We(r,s,"srcSet",a.srcSet,a,null),d&&We(r,s,"src",a.src,a,null);return;case"input":Pe("invalid",r);var A=g=E=m=null,j=null,q=null;for(d in a)if(a.hasOwnProperty(d)){var K=a[d];if(K!=null)switch(d){case"name":m=K;break;case"type":E=K;break;case"checked":j=K;break;case"defaultChecked":q=K;break;case"value":g=K;break;case"defaultValue":A=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(o(137,s));break;default:We(r,s,d,K,a,null)}}dv(r,g,A,j,q,E,m,!1);return;case"select":Pe("invalid",r),d=E=g=null;for(m in a)if(a.hasOwnProperty(m)&&(A=a[m],A!=null))switch(m){case"value":g=A;break;case"defaultValue":E=A;break;case"multiple":d=A;default:We(r,s,m,A,a,null)}s=g,a=E,r.multiple=!!d,s!=null?ai(r,!!d,s,!1):a!=null&&ai(r,!!d,a,!0);return;case"textarea":Pe("invalid",r),g=m=d=null;for(E in a)if(a.hasOwnProperty(E)&&(A=a[E],A!=null))switch(E){case"value":d=A;break;case"defaultValue":m=A;break;case"children":g=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(o(91));break;default:We(r,s,E,A,a,null)}hv(r,d,m,g);return;case"option":for(j in a)a.hasOwnProperty(j)&&(d=a[j],d!=null)&&(j==="selected"?r.selected=d&&typeof d!="function"&&typeof d!="symbol":We(r,s,j,d,a,null));return;case"dialog":Pe("beforetoggle",r),Pe("toggle",r),Pe("cancel",r),Pe("close",r);break;case"iframe":case"object":Pe("load",r);break;case"video":case"audio":for(d=0;d<dl.length;d++)Pe(dl[d],r);break;case"image":Pe("error",r),Pe("load",r);break;case"details":Pe("toggle",r);break;case"embed":case"source":case"link":Pe("error",r),Pe("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(q in a)if(a.hasOwnProperty(q)&&(d=a[q],d!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,s));default:We(r,s,q,d,a,null)}return;default:if(If(s)){for(K in a)a.hasOwnProperty(K)&&(d=a[K],d!==void 0&&bp(r,s,K,d,a,void 0));return}}for(A in a)a.hasOwnProperty(A)&&(d=a[A],d!=null&&We(r,s,A,d,a,null))}function G2(r,s,a,d){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,g=null,E=null,A=null,j=null,q=null,K=null;for(Q in a){var te=a[Q];if(a.hasOwnProperty(Q)&&te!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":j=te;default:d.hasOwnProperty(Q)||We(r,s,Q,null,d,te)}}for(var H in d){var Q=d[H];if(te=a[H],d.hasOwnProperty(H)&&(Q!=null||te!=null))switch(H){case"type":g=Q;break;case"name":m=Q;break;case"checked":q=Q;break;case"defaultChecked":K=Q;break;case"value":E=Q;break;case"defaultValue":A=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(o(137,s));break;default:Q!==te&&We(r,s,H,Q,d,te)}}kf(r,E,A,j,q,K,g,m);return;case"select":Q=E=A=H=null;for(g in a)if(j=a[g],a.hasOwnProperty(g)&&j!=null)switch(g){case"value":break;case"multiple":Q=j;default:d.hasOwnProperty(g)||We(r,s,g,null,d,j)}for(m in d)if(g=d[m],j=a[m],d.hasOwnProperty(m)&&(g!=null||j!=null))switch(m){case"value":H=g;break;case"defaultValue":A=g;break;case"multiple":E=g;default:g!==j&&We(r,s,m,g,d,j)}s=A,a=E,d=Q,H!=null?ai(r,!!a,H,!1):!!d!=!!a&&(s!=null?ai(r,!!a,s,!0):ai(r,!!a,a?[]:"",!1));return;case"textarea":Q=H=null;for(A in a)if(m=a[A],a.hasOwnProperty(A)&&m!=null&&!d.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:We(r,s,A,null,d,m)}for(E in d)if(m=d[E],g=a[E],d.hasOwnProperty(E)&&(m!=null||g!=null))switch(E){case"value":H=m;break;case"defaultValue":Q=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(o(91));break;default:m!==g&&We(r,s,E,m,d,g)}fv(r,H,Q);return;case"option":for(var fe in a)H=a[fe],a.hasOwnProperty(fe)&&H!=null&&!d.hasOwnProperty(fe)&&(fe==="selected"?r.selected=!1:We(r,s,fe,null,d,H));for(j in d)H=d[j],Q=a[j],d.hasOwnProperty(j)&&H!==Q&&(H!=null||Q!=null)&&(j==="selected"?r.selected=H&&typeof H!="function"&&typeof H!="symbol":We(r,s,j,H,d,Q));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ee in a)H=a[Ee],a.hasOwnProperty(Ee)&&H!=null&&!d.hasOwnProperty(Ee)&&We(r,s,Ee,null,d,H);for(q in d)if(H=d[q],Q=a[q],d.hasOwnProperty(q)&&H!==Q&&(H!=null||Q!=null))switch(q){case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(o(137,s));break;default:We(r,s,q,H,d,Q)}return;default:if(If(s)){for(var et in a)H=a[et],a.hasOwnProperty(et)&&H!==void 0&&!d.hasOwnProperty(et)&&bp(r,s,et,void 0,d,H);for(K in d)H=d[K],Q=a[K],!d.hasOwnProperty(K)||H===Q||H===void 0&&Q===void 0||bp(r,s,K,H,d,Q);return}}for(var U in a)H=a[U],a.hasOwnProperty(U)&&H!=null&&!d.hasOwnProperty(U)&&We(r,s,U,null,d,H);for(te in d)H=d[te],Q=a[te],!d.hasOwnProperty(te)||H===Q||H==null&&Q==null||We(r,s,te,H,d,Q)}function gw(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Y2(){if(typeof performance.getEntriesByType=="function"){for(var r=0,s=0,a=performance.getEntriesByType("resource"),d=0;d<a.length;d++){var m=a[d],g=m.transferSize,E=m.initiatorType,A=m.duration;if(g&&A&&gw(E)){for(E=0,A=m.responseEnd,d+=1;d<a.length;d++){var j=a[d],q=j.startTime;if(q>A)break;var K=j.transferSize,te=j.initiatorType;K&&gw(te)&&(j=j.responseEnd,E+=K*(j<A?1:(A-q)/(j-q)))}if(--d,s+=8*(g+E)/(m.duration/1e3),r++,10<r)break}}if(0<r)return s/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var wp=null,xp=null;function xu(r){return r.nodeType===9?r:r.ownerDocument}function yw(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function vw(r,s){if(r===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&s==="foreignObject"?0:r}function Sp(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var _p=null;function K2(){var r=window.event;return r&&r.type==="popstate"?r===_p?!1:(_p=r,!0):(_p=null,!1)}var bw=typeof setTimeout=="function"?setTimeout:void 0,X2=typeof clearTimeout=="function"?clearTimeout:void 0,ww=typeof Promise=="function"?Promise:void 0,J2=typeof queueMicrotask=="function"?queueMicrotask:typeof ww<"u"?function(r){return ww.resolve(null).then(r).catch(W2)}:bw;function W2(r){setTimeout(function(){throw r})}function jo(r){return r==="head"}function xw(r,s){var a=s,d=0;do{var m=a.nextSibling;if(r.removeChild(a),m&&m.nodeType===8)if(a=m.data,a==="/$"||a==="/&"){if(d===0){r.removeChild(m),$i(s);return}d--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")d++;else if(a==="html")hl(r.ownerDocument.documentElement);else if(a==="head"){a=r.ownerDocument.head,hl(a);for(var g=a.firstChild;g;){var E=g.nextSibling,A=g.nodeName;g[ka]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&g.rel.toLowerCase()==="stylesheet"||a.removeChild(g),g=E}}else a==="body"&&hl(r.ownerDocument.body);a=m}while(a);$i(s)}function Sw(r,s){var a=r;r=0;do{var d=a.nextSibling;if(a.nodeType===1?s?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(s?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),d&&d.nodeType===8)if(a=d.data,a==="/$"){if(r===0)break;r--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||r++;a=d}while(a)}function Ep(r){var s=r.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var a=s;switch(s=s.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Ep(a),Nf(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}r.removeChild(a)}}function eO(r,s,a,d){for(;r.nodeType===1;){var m=a;if(r.nodeName.toLowerCase()!==s.toLowerCase()){if(!d&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(d){if(!r[ka])switch(s){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(g=r.getAttribute("rel"),g==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(g!==m.rel||r.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||r.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||r.getAttribute("title")!==(m.title==null?null:m.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(g=r.getAttribute("src"),(g!==(m.src==null?null:m.src)||r.getAttribute("type")!==(m.type==null?null:m.type)||r.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&g&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(s==="input"&&r.type==="hidden"){var g=m.name==null?null:""+m.name;if(m.type==="hidden"&&r.getAttribute("name")===g)return r}else return r;if(r=Jn(r.nextSibling),r===null)break}return null}function tO(r,s,a){if(s==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!a||(r=Jn(r.nextSibling),r===null))return null;return r}function _w(r,s){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=Jn(r.nextSibling),r===null))return null;return r}function Tp(r){return r.data==="$?"||r.data==="$~"}function Cp(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function nO(r,s){var a=r.ownerDocument;if(r.data==="$~")r._reactRetry=s;else if(r.data!=="$?"||a.readyState!=="loading")s();else{var d=function(){s(),a.removeEventListener("DOMContentLoaded",d)};a.addEventListener("DOMContentLoaded",d),r._reactRetry=d}}function Jn(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return r}var Rp=null;function Ew(r){r=r.nextSibling;for(var s=0;r;){if(r.nodeType===8){var a=r.data;if(a==="/$"||a==="/&"){if(s===0)return Jn(r.nextSibling);s--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||s++}r=r.nextSibling}return null}function Tw(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var a=r.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(s===0)return r;s--}else a!=="/$"&&a!=="/&"||s++}r=r.previousSibling}return null}function Cw(r,s,a){switch(s=xu(a),r){case"html":if(r=s.documentElement,!r)throw Error(o(452));return r;case"head":if(r=s.head,!r)throw Error(o(453));return r;case"body":if(r=s.body,!r)throw Error(o(454));return r;default:throw Error(o(451))}}function hl(r){for(var s=r.attributes;s.length;)r.removeAttributeNode(s[0]);Nf(r)}var Wn=new Map,Rw=new Set;function Su(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var oo=X.d;X.d={f:rO,r:oO,D:sO,C:iO,L:aO,m:lO,X:uO,S:cO,M:dO};function rO(){var r=oo.f(),s=hu();return r||s}function oO(r){var s=oi(r);s!==null&&s.tag===5&&s.type==="form"?Vb(s):oo.r(r)}var zi=typeof document>"u"?null:document;function Aw(r,s,a){var d=zi;if(d&&typeof s=="string"&&s){var m=Hn(s);m='link[rel="'+r+'"][href="'+m+'"]',typeof a=="string"&&(m+='[crossorigin="'+a+'"]'),Rw.has(m)||(Rw.add(m),r={rel:r,crossOrigin:a,href:s},d.querySelector(m)===null&&(s=d.createElement("link"),Qt(s,"link",r),$t(s),d.head.appendChild(s)))}}function sO(r){oo.D(r),Aw("dns-prefetch",r,null)}function iO(r,s){oo.C(r,s),Aw("preconnect",r,s)}function aO(r,s,a){oo.L(r,s,a);var d=zi;if(d&&r&&s){var m='link[rel="preload"][as="'+Hn(s)+'"]';s==="image"&&a&&a.imageSrcSet?(m+='[imagesrcset="'+Hn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(m+='[imagesizes="'+Hn(a.imageSizes)+'"]')):m+='[href="'+Hn(r)+'"]';var g=m;switch(s){case"style":g=Li(r);break;case"script":g=Pi(r)}Wn.has(g)||(r=v({rel:"preload",href:s==="image"&&a&&a.imageSrcSet?void 0:r,as:s},a),Wn.set(g,r),d.querySelector(m)!==null||s==="style"&&d.querySelector(pl(g))||s==="script"&&d.querySelector(ml(g))||(s=d.createElement("link"),Qt(s,"link",r),$t(s),d.head.appendChild(s)))}}function lO(r,s){oo.m(r,s);var a=zi;if(a&&r){var d=s&&typeof s.as=="string"?s.as:"script",m='link[rel="modulepreload"][as="'+Hn(d)+'"][href="'+Hn(r)+'"]',g=m;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=Pi(r)}if(!Wn.has(g)&&(r=v({rel:"modulepreload",href:r},s),Wn.set(g,r),a.querySelector(m)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(ml(g)))return}d=a.createElement("link"),Qt(d,"link",r),$t(d),a.head.appendChild(d)}}}function cO(r,s,a){oo.S(r,s,a);var d=zi;if(d&&r){var m=si(d).hoistableStyles,g=Li(r);s=s||"default";var E=m.get(g);if(!E){var A={loading:0,preload:null};if(E=d.querySelector(pl(g)))A.loading=5;else{r=v({rel:"stylesheet",href:r,"data-precedence":s},a),(a=Wn.get(g))&&Ap(r,a);var j=E=d.createElement("link");$t(j),Qt(j,"link",r),j._p=new Promise(function(q,K){j.onload=q,j.onerror=K}),j.addEventListener("load",function(){A.loading|=1}),j.addEventListener("error",function(){A.loading|=2}),A.loading|=4,_u(E,s,d)}E={type:"stylesheet",instance:E,count:1,state:A},m.set(g,E)}}}function uO(r,s){oo.X(r,s);var a=zi;if(a&&r){var d=si(a).hoistableScripts,m=Pi(r),g=d.get(m);g||(g=a.querySelector(ml(m)),g||(r=v({src:r,async:!0},s),(s=Wn.get(m))&&Np(r,s),g=a.createElement("script"),$t(g),Qt(g,"link",r),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},d.set(m,g))}}function dO(r,s){oo.M(r,s);var a=zi;if(a&&r){var d=si(a).hoistableScripts,m=Pi(r),g=d.get(m);g||(g=a.querySelector(ml(m)),g||(r=v({src:r,async:!0,type:"module"},s),(s=Wn.get(m))&&Np(r,s),g=a.createElement("script"),$t(g),Qt(g,"link",r),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},d.set(m,g))}}function Nw(r,s,a,d){var m=(m=ve.current)?Su(m):null;if(!m)throw Error(o(446));switch(r){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(s=Li(a.href),a=si(m).hoistableStyles,d=a.get(s),d||(d={type:"style",instance:null,count:0,state:null},a.set(s,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){r=Li(a.href);var g=si(m).hoistableStyles,E=g.get(r);if(E||(m=m.ownerDocument||m,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(r,E),(g=m.querySelector(pl(r)))&&!g._p&&(E.instance=g,E.state.loading=5),Wn.has(r)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Wn.set(r,a),g||fO(m,r,a,E.state))),s&&d===null)throw Error(o(528,""));return E}if(s&&d!==null)throw Error(o(529,""));return null;case"script":return s=a.async,a=a.src,typeof a=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Pi(a),a=si(m).hoistableScripts,d=a.get(s),d||(d={type:"script",instance:null,count:0,state:null},a.set(s,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,r))}}function Li(r){return'href="'+Hn(r)+'"'}function pl(r){return'link[rel="stylesheet"]['+r+"]"}function Ow(r){return v({},r,{"data-precedence":r.precedence,precedence:null})}function fO(r,s,a,d){r.querySelector('link[rel="preload"][as="style"]['+s+"]")?d.loading=1:(s=r.createElement("link"),d.preload=s,s.addEventListener("load",function(){return d.loading|=1}),s.addEventListener("error",function(){return d.loading|=2}),Qt(s,"link",a),$t(s),r.head.appendChild(s))}function Pi(r){return'[src="'+Hn(r)+'"]'}function ml(r){return"script[async]"+r}function kw(r,s,a){if(s.count++,s.instance===null)switch(s.type){case"style":var d=r.querySelector('style[data-href~="'+Hn(a.href)+'"]');if(d)return s.instance=d,$t(d),d;var m=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),$t(d),Qt(d,"style",m),_u(d,a.precedence,r),s.instance=d;case"stylesheet":m=Li(a.href);var g=r.querySelector(pl(m));if(g)return s.state.loading|=4,s.instance=g,$t(g),g;d=Ow(a),(m=Wn.get(m))&&Ap(d,m),g=(r.ownerDocument||r).createElement("link"),$t(g);var E=g;return E._p=new Promise(function(A,j){E.onload=A,E.onerror=j}),Qt(g,"link",d),s.state.loading|=4,_u(g,a.precedence,r),s.instance=g;case"script":return g=Pi(a.src),(m=r.querySelector(ml(g)))?(s.instance=m,$t(m),m):(d=a,(m=Wn.get(g))&&(d=v({},a),Np(d,m)),r=r.ownerDocument||r,m=r.createElement("script"),$t(m),Qt(m,"link",d),r.head.appendChild(m),s.instance=m);case"void":return null;default:throw Error(o(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(d=s.instance,s.state.loading|=4,_u(d,a.precedence,r));return s.instance}function _u(r,s,a){for(var d=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=d.length?d[d.length-1]:null,g=m,E=0;E<d.length;E++){var A=d[E];if(A.dataset.precedence===s)g=A;else if(g!==m)break}g?g.parentNode.insertBefore(r,g.nextSibling):(s=a.nodeType===9?a.head:a,s.insertBefore(r,s.firstChild))}function Ap(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.title==null&&(r.title=s.title)}function Np(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.integrity==null&&(r.integrity=s.integrity)}var Eu=null;function Mw(r,s,a){if(Eu===null){var d=new Map,m=Eu=new Map;m.set(a,d)}else m=Eu,d=m.get(a),d||(d=new Map,m.set(a,d));if(d.has(r))return d;for(d.set(r,null),a=a.getElementsByTagName(r),m=0;m<a.length;m++){var g=a[m];if(!(g[ka]||g[qt]||r==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var E=g.getAttribute(s)||"";E=r+E;var A=d.get(E);A?A.push(g):d.set(E,[g])}}return d}function Iw(r,s,a){r=r.ownerDocument||r,r.head.insertBefore(a,s==="title"?r.querySelector("head > title"):null)}function hO(r,s,a){if(a===1||s.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(r=s.disabled,typeof s.precedence=="string"&&r==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function Dw(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function pO(r,s,a,d){if(a.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var m=Li(d.href),g=s.querySelector(pl(m));if(g){s=g._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(r.count++,r=Tu.bind(r),s.then(r,r)),a.state.loading|=4,a.instance=g,$t(g);return}g=s.ownerDocument||s,d=Ow(d),(m=Wn.get(m))&&Ap(d,m),g=g.createElement("link"),$t(g);var E=g;E._p=new Promise(function(A,j){E.onload=A,E.onerror=j}),Qt(g,"link",d),a.instance=g}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(a,s),(s=a.state.preload)&&(a.state.loading&3)===0&&(r.count++,a=Tu.bind(r),s.addEventListener("load",a),s.addEventListener("error",a))}}var Op=0;function mO(r,s){return r.stylesheets&&r.count===0&&Ru(r,r.stylesheets),0<r.count||0<r.imgCount?function(a){var d=setTimeout(function(){if(r.stylesheets&&Ru(r,r.stylesheets),r.unsuspend){var g=r.unsuspend;r.unsuspend=null,g()}},6e4+s);0<r.imgBytes&&Op===0&&(Op=62500*Y2());var m=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Ru(r,r.stylesheets),r.unsuspend)){var g=r.unsuspend;r.unsuspend=null,g()}},(r.imgBytes>Op?50:800)+s);return r.unsuspend=a,function(){r.unsuspend=null,clearTimeout(d),clearTimeout(m)}}:null}function Tu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ru(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Cu=null;function Ru(r,s){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Cu=new Map,s.forEach(gO,r),Cu=null,Tu.call(r))}function gO(r,s){if(!(s.state.loading&4)){var a=Cu.get(r);if(a)var d=a.get(null);else{a=new Map,Cu.set(r,a);for(var m=r.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<m.length;g++){var E=m[g];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(a.set(E.dataset.precedence,E),d=E)}d&&a.set(null,d)}m=s.instance,E=m.getAttribute("data-precedence"),g=a.get(E)||d,g===d&&a.set(null,m),a.set(E,m),this.count++,d=Tu.bind(this),m.addEventListener("load",d),m.addEventListener("error",d),g?g.parentNode.insertBefore(m,g.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(m,r.firstChild)),s.state.loading|=4}}var gl={$$typeof:O,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function yO(r,s,a,d,m,g,E,A,j){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Tf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tf(0),this.hiddenUpdates=Tf(null),this.identifierPrefix=d,this.onUncaughtError=m,this.onCaughtError=g,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function jw(r,s,a,d,m,g,E,A,j,q,K,te){return r=new yO(r,s,a,E,j,q,K,te,A),s=1,g===!0&&(s|=24),g=Mn(3,null,null,s),r.current=g,g.stateNode=r,s=ch(),s.refCount++,r.pooledCache=s,s.refCount++,g.memoizedState={element:d,isDehydrated:a,cache:s},hh(g),r}function zw(r){return r?(r=mi,r):mi}function Lw(r,s,a,d,m,g){m=zw(m),d.context===null?d.context=m:d.pendingContext=m,d=Eo(s),d.payload={element:a},g=g===void 0?null:g,g!==null&&(d.callback=g),a=To(r,d,s),a!==null&&(bn(a,r,s),Ga(a,r,s))}function Pw(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var a=r.retryLane;r.retryLane=a!==0&&a<s?a:s}}function kp(r,s){Pw(r,s),(r=r.alternate)&&Pw(r,s)}function $w(r){if(r.tag===13||r.tag===31){var s=ys(r,67108864);s!==null&&bn(s,r,67108864),kp(r,67108864)}}function Fw(r){if(r.tag===13||r.tag===31){var s=Ln();s=Cf(s);var a=ys(r,s);a!==null&&bn(a,r,s),kp(r,s)}}var Au=!0;function vO(r,s,a,d){var m=F.T;F.T=null;var g=X.p;try{X.p=2,Mp(r,s,a,d)}finally{X.p=g,F.T=m}}function bO(r,s,a,d){var m=F.T;F.T=null;var g=X.p;try{X.p=8,Mp(r,s,a,d)}finally{X.p=g,F.T=m}}function Mp(r,s,a,d){if(Au){var m=Ip(d);if(m===null)vp(r,s,d,Nu,a),Bw(r,d);else if(xO(m,r,s,a,d))d.stopPropagation();else if(Bw(r,d),s&4&&-1<wO.indexOf(r)){for(;m!==null;){var g=oi(m);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var E=fs(g.pendingLanes);if(E!==0){var A=g;for(A.pendingLanes|=2,A.entangledLanes|=2;E;){var j=1<<31-On(E);A.entanglements[1]|=j,E&=~j}Tr(g),(Ge&6)===0&&(du=on()+500,ul(0))}}break;case 31:case 13:A=ys(g,2),A!==null&&bn(A,g,2),hu(),kp(g,2)}if(g=Ip(d),g===null&&vp(r,s,d,Nu,a),g===m)break;m=g}m!==null&&d.stopPropagation()}else vp(r,s,d,null,a)}}function Ip(r){return r=jf(r),Dp(r)}var Nu=null;function Dp(r){if(Nu=null,r=ri(r),r!==null){var s=l(r);if(s===null)r=null;else{var a=s.tag;if(a===13){if(r=u(s),r!==null)return r;r=null}else if(a===31){if(r=f(s),r!==null)return r;r=null}else if(a===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null)}}return Nu=r,null}function Uw(r){switch(r){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ef()){case ot:return 2;case Bt:return 8;case Jt:case vc:return 32;case Xy:return 268435456;default:return 32}default:return 32}}var jp=!1,zo=null,Lo=null,Po=null,yl=new Map,vl=new Map,$o=[],wO="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".split(" ");function Bw(r,s){switch(r){case"focusin":case"focusout":zo=null;break;case"dragenter":case"dragleave":Lo=null;break;case"mouseover":case"mouseout":Po=null;break;case"pointerover":case"pointerout":yl.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":vl.delete(s.pointerId)}}function bl(r,s,a,d,m,g){return r===null||r.nativeEvent!==g?(r={blockedOn:s,domEventName:a,eventSystemFlags:d,nativeEvent:g,targetContainers:[m]},s!==null&&(s=oi(s),s!==null&&$w(s)),r):(r.eventSystemFlags|=d,s=r.targetContainers,m!==null&&s.indexOf(m)===-1&&s.push(m),r)}function xO(r,s,a,d,m){switch(s){case"focusin":return zo=bl(zo,r,s,a,d,m),!0;case"dragenter":return Lo=bl(Lo,r,s,a,d,m),!0;case"mouseover":return Po=bl(Po,r,s,a,d,m),!0;case"pointerover":var g=m.pointerId;return yl.set(g,bl(yl.get(g)||null,r,s,a,d,m)),!0;case"gotpointercapture":return g=m.pointerId,vl.set(g,bl(vl.get(g)||null,r,s,a,d,m)),!0}return!1}function qw(r){var s=ri(r.target);if(s!==null){var a=l(s);if(a!==null){if(s=a.tag,s===13){if(s=u(a),s!==null){r.blockedOn=s,rv(r.priority,function(){Fw(a)});return}}else if(s===31){if(s=f(a),s!==null){r.blockedOn=s,rv(r.priority,function(){Fw(a)});return}}else if(s===3&&a.stateNode.current.memoizedState.isDehydrated){r.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Ou(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var a=Ip(r.nativeEvent);if(a===null){a=r.nativeEvent;var d=new a.constructor(a.type,a);Df=d,a.target.dispatchEvent(d),Df=null}else return s=oi(a),s!==null&&$w(s),r.blockedOn=a,!1;s.shift()}return!0}function Vw(r,s,a){Ou(r)&&a.delete(s)}function SO(){jp=!1,zo!==null&&Ou(zo)&&(zo=null),Lo!==null&&Ou(Lo)&&(Lo=null),Po!==null&&Ou(Po)&&(Po=null),yl.forEach(Vw),vl.forEach(Vw)}function ku(r,s){r.blockedOn===s&&(r.blockedOn=null,jp||(jp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,SO)))}var Mu=null;function Hw(r){Mu!==r&&(Mu=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Mu===r&&(Mu=null);for(var s=0;s<r.length;s+=3){var a=r[s],d=r[s+1],m=r[s+2];if(typeof d!="function"){if(Dp(d||a)===null)continue;break}var g=oi(a);g!==null&&(r.splice(s,3),s-=3,Ih(g,{pending:!0,data:m,method:a.method,action:d},d,m))}}))}function $i(r){function s(j){return ku(j,r)}zo!==null&&ku(zo,r),Lo!==null&&ku(Lo,r),Po!==null&&ku(Po,r),yl.forEach(s),vl.forEach(s);for(var a=0;a<$o.length;a++){var d=$o[a];d.blockedOn===r&&(d.blockedOn=null)}for(;0<$o.length&&(a=$o[0],a.blockedOn===null);)qw(a),a.blockedOn===null&&$o.shift();if(a=(r.ownerDocument||r).$$reactFormReplay,a!=null)for(d=0;d<a.length;d+=3){var m=a[d],g=a[d+1],E=m[hn]||null;if(typeof g=="function")E||Hw(a);else if(E){var A=null;if(g&&g.hasAttribute("formAction")){if(m=g,E=g[hn]||null)A=E.formAction;else if(Dp(m)!==null)continue}else A=E.action;typeof A=="function"?a[d+1]=A:(a.splice(d,3),d-=3),Hw(a)}}}function Zw(){function r(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(E){return m=E})},focusReset:"manual",scroll:"manual"})}function s(){m!==null&&(m(),m=null),d||setTimeout(a,20)}function a(){if(!d&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,m=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(a,100),function(){d=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),m!==null&&(m(),m=null)}}}function zp(r){this._internalRoot=r}Iu.prototype.render=zp.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(o(409));var a=s.current,d=Ln();Lw(a,d,r,s,null,null)},Iu.prototype.unmount=zp.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;Lw(r.current,2,null,r,null,null),hu(),s[ni]=null}};function Iu(r){this._internalRoot=r}Iu.prototype.unstable_scheduleHydration=function(r){if(r){var s=nv();r={blockedOn:null,target:r,priority:s};for(var a=0;a<$o.length&&s!==0&&s<$o[a].priority;a++);$o.splice(a,0,r),a===0&&qw(r)}};var Qw=t.version;if(Qw!=="19.2.4")throw Error(o(527,Qw,"19.2.4"));X.findDOMNode=function(r){var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(o(188)):(r=Object.keys(r).join(","),Error(o(268,r)));return r=p(s),r=r!==null?y(r):null,r=r===null?null:r.stateNode,r};var _O={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Du=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Du.isDisabled&&Du.supportsFiber)try{Aa=Du.inject(_O),Nn=Du}catch{}}return xl.createRoot=function(r,s){if(!i(r))throw Error(o(299));var a=!1,d="",m=e0,g=t0,E=n0;return s!=null&&(s.unstable_strictMode===!0&&(a=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onUncaughtError!==void 0&&(m=s.onUncaughtError),s.onCaughtError!==void 0&&(g=s.onCaughtError),s.onRecoverableError!==void 0&&(E=s.onRecoverableError)),s=jw(r,1,!1,null,null,a,d,null,m,g,E,Zw),r[ni]=s.current,yp(r),new zp(s)},xl.hydrateRoot=function(r,s,a){if(!i(r))throw Error(o(299));var d=!1,m="",g=e0,E=t0,A=n0,j=null;return a!=null&&(a.unstable_strictMode===!0&&(d=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onUncaughtError!==void 0&&(g=a.onUncaughtError),a.onCaughtError!==void 0&&(E=a.onCaughtError),a.onRecoverableError!==void 0&&(A=a.onRecoverableError),a.formState!==void 0&&(j=a.formState)),s=jw(r,1,!0,s,a??null,d,m,j,g,E,A,Zw),s.context=zw(null),a=s.current,d=Ln(),d=Cf(d),m=Eo(d),m.callback=null,To(a,m,d),a=d,s.current.lanes=a,Oa(s,a),Tr(s),r[ni]=s.current,yp(r),new Iu(s)},xl.version="19.2.4",xl}var rx;function IO(){if(rx)return $p.exports;rx=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(),$p.exports=MO(),$p.exports}var DO=IO();const Dm=new WeakMap,jO=new WeakMap,ad={current:[]};let qp=!1,jl=0;const Nl=new Set,ju=new Map;function $_(e){for(const t of e){if(ad.current.includes(t))continue;ad.current.push(t),t.recompute();const n=jO.get(t);if(n)for(const o of n){const i=Dm.get(o);i?.length&&$_(i)}}}function zO(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function LO(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function F_(e){if(jl>0&&!ju.has(e)&&ju.set(e,e.prevState),Nl.add(e),!(jl>0)&&!qp)try{for(qp=!0;Nl.size>0;){const t=Array.from(Nl);Nl.clear();for(const n of t){const o=ju.get(n)??n.prevState;n.prevState=o,zO(n)}for(const n of t){const o=Dm.get(n);o&&(ad.current.push(n),$_(o))}for(const n of t){const o=Dm.get(n);if(o)for(const i of o)LO(i)}}}finally{qp=!1,ad.current=[],ju.clear()}}function PO(e){jl++;try{e()}finally{if(jl--,jl===0){const t=Nl.values().next().value;t&&F_(t)}}}function $O(e){return typeof e=="function"}class FO{constructor(t,n){this.listeners=new Set,this.subscribe=o=>{var i,l;this.listeners.add(o);const u=(l=(i=this.options)==null?void 0:i.onSubscribe)==null?void 0:l.call(i,o,this);return()=>{this.listeners.delete(o),u?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,o,i;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):$O(t)?this.state=t(this.prevState):this.state=t,(i=(o=this.options)==null?void 0:o.onUpdate)==null||i.call(o),F_(this)}}const Go="__TSR_index",ox="popstate",sx="beforeunload";function UO(e){let t=e.getLocation();const n=new Set,o=u=>{t=e.getLocation(),n.forEach(f=>f({location:t,action:u}))},i=u=>{e.notifyOnIndexChange??!0?o(u):t=e.getLocation()},l=async({task:u,navigateOpts:f,...h})=>{if(f?.ignoreBlocker??!1){u();return}const y=e.getBlockers?.()??[],v=h.type==="PUSH"||h.type==="REPLACE";if(typeof document<"u"&&y.length&&v)for(const w of y){const _=ld(h.path,h.state);if(await w.blockerFn({currentLocation:t,nextLocation:_,action:h.type})){e.onBlocked?.();return}}u()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:u=>(n.add(u),()=>{n.delete(u)}),push:(u,f,h)=>{const p=t.state[Go];f=ix(p+1,f),l({task:()=>{e.pushState(u,f),o({type:"PUSH"})},navigateOpts:h,type:"PUSH",path:u,state:f})},replace:(u,f,h)=>{const p=t.state[Go];f=ix(p,f),l({task:()=>{e.replaceState(u,f),o({type:"REPLACE"})},navigateOpts:h,type:"REPLACE",path:u,state:f})},go:(u,f)=>{l({task:()=>{e.go(u),i({type:"GO",index:u})},navigateOpts:f,type:"GO"})},back:u=>{l({task:()=>{e.back(u?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:u,type:"BACK"})},forward:u=>{l({task:()=>{e.forward(u?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:u,type:"FORWARD"})},canGoBack:()=>t.state[Go]!==0,createHref:u=>e.createHref(u),block:u=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,u]),()=>{const h=e.getBlockers?.()??[];e.setBlockers?.(h.filter(p=>p!==u))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:o}}function ix(e,t){t||(t={});const n=yg();return{...t,key:n,__TSR_key:n,[Go]:e}}function BO(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,o=t.history.replaceState;let i=[];const l=()=>i,u=D=>i=D,f=(D=>D),h=(()=>ld(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const D=yg();t.history.replaceState({[Go]:0,key:D,__TSR_key:D},"")}let p=h(),y,v=!1,w=!1,_=!1,R=!1;const x=()=>p;let C,N;const k=()=>{C&&(L._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),L._ignoreSubscribers=!1,C=void 0,N=void 0,y=void 0)},O=(D,Y,ie)=>{const le=f(Y);N||(y=p),p=ld(Y,ie),C={href:le,state:ie,isPush:C?.isPush||D==="push"},N||(N=Promise.resolve().then(()=>k()))},M=D=>{p=h(),L.notify({type:D})},$=async()=>{if(w){w=!1;return}const D=h(),Y=D.state[Go]-p.state[Go],ie=Y===1,le=Y===-1,se=!ie&&!le||v;v=!1;const ue=se?"GO":le?"BACK":"FORWARD",ce=se?{type:"GO",index:Y}:{type:le?"BACK":"FORWARD"};if(_)_=!1;else{const ge=l();if(typeof document<"u"&&ge.length){for(const F of ge)if(await F.blockerFn({currentLocation:p,nextLocation:D,action:ue})){w=!0,t.history.go(1),L.notify(ce);return}}}p=h(),L.notify(ce)},V=D=>{if(R){R=!1;return}let Y=!1;const ie=l();if(typeof document<"u"&&ie.length)for(const le of ie){const se=le.enableBeforeUnload??!0;if(se===!0){Y=!0;break}if(typeof se=="function"&&se()===!0){Y=!0;break}}if(Y)return D.preventDefault(),D.returnValue=""},L=UO({getLocation:x,getLength:()=>t.history.length,pushState:(D,Y)=>O("push",D,Y),replaceState:(D,Y)=>O("replace",D,Y),back:D=>(D&&(_=!0),R=!0,t.history.back()),forward:D=>{D&&(_=!0),R=!0,t.history.forward()},go:D=>{v=!0,t.history.go(D)},createHref:D=>f(D),flush:k,destroy:()=>{t.history.pushState=n,t.history.replaceState=o,t.removeEventListener(sx,V,{capture:!0}),t.removeEventListener(ox,$)},onBlocked:()=>{y&&p!==y&&(p=y)},getBlockers:l,setBlockers:u,notifyOnIndexChange:!1});return t.addEventListener(sx,V,{capture:!0}),t.addEventListener(ox,$),t.history.pushState=function(...D){const Y=n.apply(t.history,D);return L._ignoreSubscribers||M("PUSH"),Y},t.history.replaceState=function(...D){const Y=o.apply(t.history,D);return L._ignoreSubscribers||M("REPLACE"),Y},L}function qO(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function ld(e,t){const n=qO(e),o=n.indexOf("#"),i=n.indexOf("?"),l=yg();return{href:n,pathname:n.substring(0,o>0?i>0?Math.min(o,i):o:i>0?i:n.length),hash:o>-1?n.substring(o):"",search:i>-1?n.slice(i,o===-1?void 0:o):"",state:t||{[Go]:0,key:l,__TSR_key:l}}}function yg(){return(Math.random()+1).toString(36).substring(7)}const VO=!1;function Ji(e){let t;return PO(()=>{t=e()}),t}function Bl(e){return e[e.length-1]}function HO(e){return typeof e=="function"}function Zo(e,t){return HO(e)?e(t):e}const ZO=Object.prototype.hasOwnProperty,ax=Object.prototype.propertyIsEnumerable;function wn(e,t,n=0){if(e===t)return e;if(n>500)return t;const o=t,i=ux(e)&&ux(o);if(!i&&!(cd(e)&&cd(o)))return o;const l=i?e:lx(e);if(!l)return o;const u=i?o:lx(o);if(!u)return o;const f=l.length,h=u.length,p=i?new Array(h):{};let y=0;for(let v=0;v<h;v++){const w=i?v:u[v],_=e[w],R=o[w];if(_===R){p[w]=_,(i?v<f:ZO.call(e,w))&&y++;continue}if(_===null||R===null||typeof _!="object"||typeof R!="object"){p[w]=R;continue}const x=wn(_,R,n+1);p[w]=x,x===_&&y++}return f===h&&y===f?e:p}function lx(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!ax.call(e,i))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const o=t;for(const i of n){if(!ax.call(e,i))return!1;o.push(i)}return o}function cd(e){if(!cx(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!cx(n)||!n.hasOwnProperty("isPrototypeOf"))}function cx(e){return Object.prototype.toString.call(e)==="[object Object]"}function ux(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ps(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let o=0,i=e.length;o<i;o++)if(!Ps(e[o],t[o],n))return!1;return!0}if(cd(e)&&cd(t)){const o=n?.ignoreUndefined??!0;if(n?.partial){for(const u in t)if((!o||t[u]!==void 0)&&!Ps(e[u],t[u],n))return!1;return!0}let i=0;if(!o)i=Object.keys(e).length;else for(const u in e)e[u]!==void 0&&i++;let l=0;for(const u in t)if((!o||t[u]!==void 0)&&(l++,l>i||!Ps(e[u],t[u],n)))return!1;return i===l}return!1}function Us(e){let t,n;const o=new Promise((i,l)=>{t=i,n=l});return o.status="pending",o.resolve=i=>{o.status="resolved",o.value=i,t(i),e?.(i)},o.reject=i=>{o.status="rejected",n(i)},o}function QO(e){return typeof e?.message!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}function Wi(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function GO(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function dx(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return GO(t)}const U_=["http:","https:","mailto:","tel:"];function ud(e){if(!e)return!1;try{const t=new URL(e);return!U_.includes(t.protocol)}catch{return!1}}const YO={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},KO=/[&><\u2028\u2029]/g;function XO(e){return e.replace(KO,t=>YO[t])}function Sl(e,t){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return e;const n=/%25|%5C/gi;let o=0,i="",l;for(;(l=n.exec(e))!==null;)i+=dx(e.slice(o,l.index))+l[0],o=n.lastIndex;return i=i+dx(o?e.slice(o):e),i.startsWith("//")&&(i="/"+i.replace(/^\/+/,"")),i}function JO(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var WO="Invariant failed";function _n(e,t){if(!e)throw new Error(WO)}function dd(e){const t=new Map;let n,o;const i=l=>{l.next&&(l.prev?(l.prev.next=l.next,l.next.prev=l.prev,l.next=void 0,o&&(o.next=l,l.prev=o)):(l.next.prev=void 0,n=l.next,l.next=void 0,o&&(l.prev=o,o.next=l)),o=l)};return{get(l){const u=t.get(l);if(u)return i(u),u.value},set(l,u){if(t.size>=e&&n){const h=n;t.delete(h.key),h.next&&(n=h.next,h.next.prev=void 0),h===o&&(o=void 0)}const f=t.get(l);if(f)f.value=u,i(f);else{const h={key:l,value:u,prev:o};o&&(o.next=h),o=h,n||(n=h),t.set(l,h)}},clear(){t.clear(),n=void 0,o=void 0}}}const ca=0,Bs=1,qs=2,ql=3,Ds=4,B_=5;function ek(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function vg(e,t,n=new Uint16Array(6)){const o=e.indexOf("/",t),i=o===-1?e.length:o,l=e.substring(t,i);if(!l||!l.includes("$"))return n[0]=ca,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(l==="$"){const f=e.length;return n[0]=qs,n[1]=t,n[2]=t,n[3]=f,n[4]=f,n[5]=f,n}if(l.charCodeAt(0)===36)return n[0]=Bs,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const u=ek(l);if(u){const[f,h]=u,p=l.charCodeAt(f+1);if(p===45){if(f+2<l.length&&l.charCodeAt(f+2)===36){const y=f+3,v=h;if(y<v)return n[0]=ql,n[1]=t+f,n[2]=t+y,n[3]=t+v,n[4]=t+h+1,n[5]=i,n}}else if(p===36){const y=f+1,v=f+2;return v===h?(n[0]=qs,n[1]=t+f,n[2]=t+y,n[3]=t+v,n[4]=t+h+1,n[5]=e.length,n):(n[0]=Bs,n[1]=t+f,n[2]=t+v,n[3]=t+h,n[4]=t+h+1,n[5]=i,n)}}return n[0]=ca,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Fd(e,t,n,o,i,l,u){u?.(n);let f=o;{const h=n.fullPath??n.from,p=h.length,y=n.options?.caseSensitive??e,v=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;f<p;){const _=vg(h,f,t);let R;const x=f,C=_[5];switch(f=C+1,l++,_[0]){case ca:{const k=h.substring(_[2],_[3]);if(y){const O=i.static?.get(k);if(O)R=O;else{i.static??=new Map;const M=js(n.fullPath??n.from);M.parent=i,M.depth=l,R=M,i.static.set(k,M)}}else{const O=k.toLowerCase(),M=i.staticInsensitive?.get(O);if(M)R=M;else{i.staticInsensitive??=new Map;const $=js(n.fullPath??n.from);$.parent=i,$.depth=l,R=$,i.staticInsensitive.set(O,$)}}break}case Bs:{const k=h.substring(x,_[1]),O=h.substring(_[4],C),M=y&&!!(k||O),$=k?M?k:k.toLowerCase():void 0,V=O?M?O:O.toLowerCase():void 0,L=!v&&i.dynamic?.find(D=>!D.skipOnParamError&&D.caseSensitive===M&&D.prefix===$&&D.suffix===V);if(L)R=L;else{const D=Hp(Bs,n.fullPath??n.from,M,$,V);R=D,D.depth=l,D.parent=i,i.dynamic??=[],i.dynamic.push(D)}break}case ql:{const k=h.substring(x,_[1]),O=h.substring(_[4],C),M=y&&!!(k||O),$=k?M?k:k.toLowerCase():void 0,V=O?M?O:O.toLowerCase():void 0,L=!v&&i.optional?.find(D=>!D.skipOnParamError&&D.caseSensitive===M&&D.prefix===$&&D.suffix===V);if(L)R=L;else{const D=Hp(ql,n.fullPath??n.from,M,$,V);R=D,D.parent=i,D.depth=l,i.optional??=[],i.optional.push(D)}break}case qs:{const k=h.substring(x,_[1]),O=h.substring(_[4],C),M=y&&!!(k||O),$=k?M?k:k.toLowerCase():void 0,V=O?M?O:O.toLowerCase():void 0,L=Hp(qs,n.fullPath??n.from,M,$,V);R=L,L.parent=i,L.depth=l,i.wildcard??=[],i.wildcard.push(L)}}i=R}if(v&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const _=js(n.fullPath??n.from);_.kind=B_,_.parent=i,l++,_.depth=l,i.pathless??=[],i.pathless.push(_),i=_}const w=(n.path||!n.children)&&!n.isRoot;if(w&&h.endsWith("/")){const _=js(n.fullPath??n.from);_.kind=Ds,_.parent=i,l++,_.depth=l,i.index=_,i=_}i.parse=n.options?.params?.parse??null,i.skipOnParamError=v,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,w&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const h of n.children)Fd(e,t,h,f,i,l,u)}function Vp(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function qo(e){if(e.pathless)for(const t of e.pathless)qo(t);if(e.static)for(const t of e.static.values())qo(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())qo(t);if(e.dynamic?.length){e.dynamic.sort(Vp);for(const t of e.dynamic)qo(t)}if(e.optional?.length){e.optional.sort(Vp);for(const t of e.optional)qo(t)}if(e.wildcard?.length){e.wildcard.sort(Vp);for(const t of e.wildcard)qo(t)}}function js(e){return{kind:ca,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Hp(e,t,n,o,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:o,suffix:i}}function tk(e,t){const n=js("/"),o=new Uint16Array(6);for(const i of e)Fd(!1,o,i,1,n,0);qo(n),t.masksTree=n,t.flatCache=dd(1e3)}function nk(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const o=bg(e,t.masksTree);return t.flatCache.set(e,o),o}function rk(e,t,n,o,i){e||="/",o||="/";const l=t?`case\0${e}`:e;let u=i.singleCache.get(l);if(!u){u=js("/");const f=new Uint16Array(6);Fd(t,f,{from:e},1,u,0),i.singleCache.set(l,u)}return bg(o,u,n)}function ok(e,t,n=!1){const o=n?e:`nofuzz\0${e}`,i=t.matchCache.get(o);if(i!==void 0)return i;e||="/";let l;try{l=bg(e,t.segmentTree,n)}catch(u){if(u instanceof URIError)l=null;else throw u}return l&&(l.branch=ak(l.route)),t.matchCache.set(o,l),l}function sk(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function ik(e,t=!1,n){const o=js(e.fullPath),i=new Uint16Array(6),l={},u={};let f=0;return Fd(t,i,e,1,o,0,p=>{if(n?.(p,f),_n(!(p.id in l),`Duplicate routes found with id: ${String(p.id)}`),l[p.id]=p,f!==0&&p.path){const y=sk(p.fullPath);(!u[y]||p.fullPath.endsWith("/"))&&(u[y]=p)}f++}),qo(o),{processedTree:{segmentTree:o,singleCache:dd(1e3),matchCache:dd(1e3),flatCache:null,masksTree:null},routesById:l,routesByPath:u}}function bg(e,t,n=!1){const o=e.split("/"),i=ck(e,o,t,n);if(!i)return null;const[l]=q_(e,o,i);return{route:i.node.route,rawParams:l,parsedParams:i.parsedParams}}function q_(e,t,n){const o=lk(n.node);let i=null;const l={};let u=n.extract?.part??0,f=n.extract?.node??0,h=n.extract?.path??0,p=n.extract?.segment??0;for(;f<o.length;u++,f++,h++,p++){const y=o[f];if(y.kind===Ds)break;if(y.kind===B_){p--,u--,h--;continue}const v=t[u],w=h;if(v&&(h+=v.length),y.kind===Bs){i??=n.node.fullPath.split("/");const _=i[p],R=y.prefix?.length??0;if(_.charCodeAt(R)===123){const C=y.suffix?.length??0,N=_.substring(R+2,_.length-C-1),k=v.substring(R,v.length-C);l[N]=decodeURIComponent(k)}else{const C=_.substring(1);l[C]=decodeURIComponent(v)}}else if(y.kind===ql){if(n.skipped&1<<f){u--,h=w-1;continue}i??=n.node.fullPath.split("/");const _=i[p],R=y.prefix?.length??0,x=y.suffix?.length??0,C=_.substring(R+3,_.length-x-1),N=y.suffix||y.prefix?v.substring(R,v.length-x):v;N&&(l[C]=decodeURIComponent(N))}else if(y.kind===qs){const _=y,R=e.substring(w+(_.prefix?.length??0),e.length-(_.suffix?.length??0)),x=decodeURIComponent(R);l["*"]=x,l._splat=x;break}}return n.rawParams&&Object.assign(l,n.rawParams),[l,{part:u,node:f,path:h,segment:p}]}function ak(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function lk(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function ck(e,t,n,o){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Bl(t),l=i&&e!=="/",u=t.length-(i?1:0),f=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let h=null,p=null,y=null;for(;f.length;){const v=f.pop(),{node:w,index:_,skipped:R,depth:x,statics:C,dynamics:N,optionals:k}=v;let{extract:O,rawParams:M,parsedParams:$}=v;if(w.skipOnParamError){if(!Zp(e,t,v))continue;M=v.rawParams,O=v.extract,$=v.parsedParams}o&&w.route&&w.kind!==Ds&&_l(p,v)&&(p=v);const V=_===u;if(V&&(w.route&&!l&&_l(y,v)&&(y=v),!w.optional&&!w.wildcard&&!w.index&&!w.pathless))continue;const L=V?void 0:t[_];let D;if(V&&w.index){const Y={node:w.index,index:_,skipped:R,depth:x+1,statics:C,dynamics:N,optionals:k,extract:O,rawParams:M,parsedParams:$};let ie=!0;if(w.index.skipOnParamError&&(Zp(e,t,Y)||(ie=!1)),ie){if(C===u&&!N&&!k&&!R)return Y;_l(y,Y)&&(y=Y)}}if(w.wildcard&&_l(h,v))for(const Y of w.wildcard){const{prefix:ie,suffix:le}=Y;if(ie&&(V||!(Y.caseSensitive?L:D??=L.toLowerCase()).startsWith(ie)))continue;if(le){if(V)continue;const ue=t.slice(_).join("/").slice(-le.length);if((Y.caseSensitive?ue:ue.toLowerCase())!==le)continue}const se={node:Y,index:u,skipped:R,depth:x,statics:C,dynamics:N,optionals:k,extract:O,rawParams:M,parsedParams:$};if(!(Y.skipOnParamError&&!Zp(e,t,se))){h=se;break}}if(w.optional){const Y=R|1<<x,ie=x+1;for(let le=w.optional.length-1;le>=0;le--){const se=w.optional[le];f.push({node:se,index:_,skipped:Y,depth:ie,statics:C,dynamics:N,optionals:k,extract:O,rawParams:M,parsedParams:$})}if(!V)for(let le=w.optional.length-1;le>=0;le--){const se=w.optional[le],{prefix:ue,suffix:ce}=se;if(ue||ce){const ge=se.caseSensitive?L:D??=L.toLowerCase();if(ue&&!ge.startsWith(ue)||ce&&!ge.endsWith(ce))continue}f.push({node:se,index:_+1,skipped:R,depth:ie,statics:C,dynamics:N,optionals:k+1,extract:O,rawParams:M,parsedParams:$})}}if(!V&&w.dynamic&&L)for(let Y=w.dynamic.length-1;Y>=0;Y--){const ie=w.dynamic[Y],{prefix:le,suffix:se}=ie;if(le||se){const ue=ie.caseSensitive?L:D??=L.toLowerCase();if(le&&!ue.startsWith(le)||se&&!ue.endsWith(se))continue}f.push({node:ie,index:_+1,skipped:R,depth:x+1,statics:C,dynamics:N+1,optionals:k,extract:O,rawParams:M,parsedParams:$})}if(!V&&w.staticInsensitive){const Y=w.staticInsensitive.get(D??=L.toLowerCase());Y&&f.push({node:Y,index:_+1,skipped:R,depth:x+1,statics:C+1,dynamics:N,optionals:k,extract:O,rawParams:M,parsedParams:$})}if(!V&&w.static){const Y=w.static.get(L);Y&&f.push({node:Y,index:_+1,skipped:R,depth:x+1,statics:C+1,dynamics:N,optionals:k,extract:O,rawParams:M,parsedParams:$})}if(w.pathless){const Y=x+1;for(let ie=w.pathless.length-1;ie>=0;ie--){const le=w.pathless[ie];f.push({node:le,index:_,skipped:R,depth:Y,statics:C,dynamics:N,optionals:k,extract:O,rawParams:M,parsedParams:$})}}}if(y&&h)return _l(h,y)?y:h;if(y)return y;if(h)return h;if(o&&p){let v=p.index;for(let _=0;_<p.index;_++)v+=t[_].length;const w=v===e.length?"/":e.slice(v);return p.rawParams??={},p.rawParams["**"]=decodeURIComponent(w),p}return null}function Zp(e,t,n){try{const[o,i]=q_(e,t,n);n.rawParams=o,n.extract=i;const l=n.node.parse(o);return n.parsedParams=Object.assign({},n.parsedParams,l),!0}catch{return null}}function _l(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Ds)>(e.node.kind===Ds)||t.node.kind===Ds==(e.node.kind===Ds)&&t.depth>e.depth))):!0}function Ju(e){return wg(e.filter(t=>t!==void 0).join("/"))}function wg(e){return e.replace(/\/{2,}/g,"/")}function V_(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function lo(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function H_(e){return lo(V_(e))}function fd(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function uk(e,t,n){return fd(e,n)===fd(t,n)}function dk({base:e,to:t,trailingSlash:n="never",cache:o}){const i=t.startsWith("/"),l=!i&&t===".";let u;if(o){u=i?t:l?e:e+"\0"+t;const v=o.get(u);if(v)return v}let f;if(l)f=e.split("/");else if(i)f=t.split("/");else{for(f=e.split("/");f.length>1&&Bl(f)==="";)f.pop();const v=t.split("/");for(let w=0,_=v.length;w<_;w++){const R=v[w];R===""?w?w===_-1&&f.push(R):f=[R]:R===".."?f.pop():R==="."||f.push(R)}}f.length>1&&(Bl(f)===""?n==="never"&&f.pop():n==="always"&&f.push(""));let h,p="";for(let v=0;v<f.length;v++){v>0&&(p+="/");const w=f[v];if(!w)continue;h=vg(w,0,h);const _=h[0];if(_===ca){p+=w;continue}const R=h[5],x=w.substring(0,h[1]),C=w.substring(h[4],R),N=w.substring(h[2],h[3]);_===Bs?p+=x||C?`${x}{$${N}}${C}`:`$${N}`:_===qs?p+=x||C?`${x}{$}${C}`:"$":p+=`${x}{-$${N}}${C}`}p=wg(p);const y=p||"/";return u&&o&&o.set(u,y),y}function fk(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),o=new RegExp(n,"g");return i=>i.replace(o,l=>t.get(l)??l)}function Qp(e,t,n){const o=t[e];return typeof o!="string"?o:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(o)?o:o.split("/").map(i=>fx(i,n)).join("/"):fx(o,n)}function Gp({path:e,params:t,decoder:n,server:o}){let i=!1;const l={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:l,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:l,isMissingParams:i};const u=e.length;let f=0,h,p="";for(;f<u;){const v=f;h=vg(e,v,h);const w=h[5];if(f=w+1,v===w)continue;const _=h[0];if(_===ca){p+="/"+e.substring(v,w);continue}if(_===qs){const R=t._splat;l._splat=R,l["*"]=R;const x=e.substring(v,h[1]),C=e.substring(h[4],w);if(!R){i=!0,(x||C)&&(p+="/"+x+C);continue}const N=Qp("_splat",t,n);p+="/"+x+N+C;continue}if(_===Bs){const R=e.substring(h[2],h[3]);!i&&!(R in t)&&(i=!0),l[R]=t[R];const x=e.substring(v,h[1]),C=e.substring(h[4],w),N=Qp(R,t,n)??"undefined";p+="/"+x+N+C;continue}if(_===ql){const R=e.substring(h[2],h[3]),x=t[R];if(x==null)continue;l[R]=x;const C=e.substring(v,h[1]),N=e.substring(h[4],w),k=Qp(R,t,n)??"";p+="/"+C+k+N;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:l,interpolatedPath:p||"/",isMissingParams:i}}function fx(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function ln(e){return!!e?.isNotFound}function hk(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const jm="tsr-scroll-restoration-v1_3",pk=(e,t)=>{let n;return(...o)=>{n||(n=setTimeout(()=>{e(...o),n=null},t))}};function mk(){const e=hk();if(!e)return null;const t=e.getItem(jm);let n=t?JSON.parse(t):{};return{state:n,set:o=>{n=Zo(o,n)||n;try{e.setItem(jm,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const zu=mk(),gk=e=>e.state.__TSR_key||e.href;function yk(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let hd=!1;function vk({storageKey:e,key:t,behavior:n,shouldScrollRestoration:o,scrollToTopSelectors:i,location:l}){let u;try{u=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(p){console.error(p);return}const f=t||window.history.state?.__TSR_key,h=u[f];hd=!0;e:{if(o&&h&&Object.keys(h).length>0){for(const v in h){const w=h[v];if(v==="window")window.scrollTo({top:w.scrollY,left:w.scrollX,behavior:n});else if(v){const _=document.querySelector(v);_&&(_.scrollLeft=w.scrollX,_.scrollTop=w.scrollY)}}break e}const p=(l??window.location).hash.split("#",2)[1];if(p){const v=window.history.state?.__hashScrollIntoViewOptions??!0;if(v){const w=document.getElementById(p);w&&w.scrollIntoView(v)}break e}const y={top:0,left:0,behavior:n};if(window.scrollTo(y),i)for(const v of i){if(v==="window")continue;const w=typeof v=="function"?v():document.querySelector(v);w&&w.scrollTo(y)}}hd=!1}function bk(e,t){if(!zu||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!zu))return;e.isScrollRestorationSetup=!0,hd=!1;const o=e.options.getScrollRestorationKey||gk;window.history.scrollRestoration="manual";const i=l=>{if(hd||!e.isScrollRestoring)return;let u="";if(l.target===document||l.target===window)u="window";else{const h=l.target.getAttribute("data-scroll-restoration-id");h?u=`[data-scroll-restoration-id="${h}"]`:u=yk(l.target)}const f=o(e.state.location);zu.set(h=>{const p=h[f]||={},y=p[u]||={};if(u==="window")y.scrollX=window.scrollX||0,y.scrollY=window.scrollY||0;else if(u){const v=document.querySelector(u);v&&(y.scrollX=v.scrollLeft||0,y.scrollY=v.scrollTop||0)}return h})};typeof document<"u"&&document.addEventListener("scroll",pk(i,100),!0),e.subscribe("onRendered",l=>{const u=o(l.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(vk({storageKey:jm,key:u,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&zu.set(f=>(f[u]||={},f)))})}function wk(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function Z_(e,t=String){const n=new URLSearchParams;for(const o in e){const i=e[o];i!==void 0&&n.set(o,t(i))}return n.toString()}function Yp(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function xk(e){const t=new URLSearchParams(e),n={};for(const[o,i]of t.entries()){const l=n[o];l==null?n[o]=Yp(i):Array.isArray(l)?l.push(Yp(i)):n[o]=[l,Yp(i)]}return n}const Sk=Ek(JSON.parse),_k=Tk(JSON.stringify,JSON.parse);function Ek(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=xk(t);for(const o in n){const i=n[o];if(typeof i=="string")try{n[o]=e(i)}catch{}}return n}}function Tk(e,t){const n=typeof t=="function";function o(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const l=Z_(i,o);return l?`?${l}`:""}}const rr="__root__";function Q_(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&typeof e.href=="string"&&ud(e.href))throw new Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${U_.join(", ")} protocols are allowed.`);if(!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function $n(e){return e instanceof Response&&!!e.options}function G_(e){if(e!==null&&typeof e=="object"&&e.isSerializedRedirect)return Q_(e)}const Wu=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Ud=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),ea=(e,t,n=!0)=>{const o={...e.router.options.context??{}},i=n?t:t-1;for(let l=0;l<=i;l++){const u=e.matches[l];if(!u)continue;const f=e.router.getMatch(u.id);f&&Object.assign(o,f.__routeContext,f.__beforeLoadContext)}return o},Y_=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),_n(n.options.notFoundComponent);const o=e.matches.find(i=>i.routeId===n.id);_n(o,"Could not find match for route: "+n.id),e.updateMatch(o.id,i=>({...i,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,Y_(e,t))},Qo=(e,t,n)=>{if(!(!$n(n)&&!ln(n))){if($n(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const o=$n(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,i=>({...i,status:o,context:ea(e,t.index),isFetching:!1,error:n})),ln(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw $n(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(Y_(e,n),n)}},K_=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,El=(e,t,n,o)=>{const{id:i,routeId:l}=e.matches[t],u=e.router.looseRoutesById[l];if(n instanceof Promise)throw n;n.routerCode=o,e.firstBadMatchIndex??=t,Qo(e,e.router.getMatch(i),n);try{u.options.onError?.(n)}catch(f){n=f,Qo(e,e.router.getMatch(i),n)}e.updateMatch(i,f=>(f._nonReactive.beforeLoadPromise?.resolve(),f._nonReactive.beforeLoadPromise=void 0,f._nonReactive.loadPromise?.resolve(),{...f,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},X_=(e,t,n,o)=>{if(o._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!Ud(e,t)&&(n.options.loader||n.options.beforeLoad||eE(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const u=setTimeout(()=>{Wu(e)},i);o._nonReactive.pendingTimeout=u}},Ck=(e,t,n)=>{const o=e.router.getMatch(t);if(!o._nonReactive.beforeLoadPromise&&!o._nonReactive.loaderPromise)return;X_(e,t,n,o);const i=()=>{const l=e.router.getMatch(t);l.preload&&(l.status==="redirected"||l.status==="notFound")&&Qo(e,l,l.error)};return o._nonReactive.beforeLoadPromise?o._nonReactive.beforeLoadPromise.then(i):i()},Rk=(e,t,n,o)=>{const i=e.router.getMatch(t),l=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Us(()=>{l?.resolve()});const{paramsError:u,searchError:f}=i;u&&El(e,n,u,"PARSE_PARAMS"),f&&El(e,n,f,"VALIDATE_SEARCH"),X_(e,t,o,i);const h=new AbortController;let p=!1;const y=()=>{p||(p=!0,e.updateMatch(t,M=>({...M,isFetching:"beforeLoad",fetchCount:M.fetchCount+1,abortController:h})))},v=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,M=>({...M,isFetching:!1}))};if(!o.options.beforeLoad){Ji(()=>{y(),v()});return}i._nonReactive.beforeLoadPromise=Us();const w={...ea(e,n,!1),...i.__routeContext},{search:_,params:R,cause:x}=i,C=Ud(e,t),N={search:_,abortController:h,params:R,preload:C,context:w,location:e.location,navigate:M=>e.router.navigate({...M,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:C?"preload":x,matches:e.matches,...e.router.options.additionalContext},k=M=>{if(M===void 0){Ji(()=>{y(),v()});return}($n(M)||ln(M))&&(y(),El(e,n,M,"BEFORE_LOAD")),Ji(()=>{y(),e.updateMatch(t,$=>({...$,__beforeLoadContext:M})),v()})};let O;try{if(O=o.options.beforeLoad(N),Wi(O))return y(),O.catch(M=>{El(e,n,M,"BEFORE_LOAD")}).then(k)}catch(M){y(),El(e,n,M,"BEFORE_LOAD")}k(O)},Ak=(e,t)=>{const{id:n,routeId:o}=e.matches[t],i=e.router.looseRoutesById[o],l=()=>f(),u=()=>Rk(e,n,t,i),f=()=>{if(K_(e,n))return;const h=Ck(e,n,i);return Wi(h)?h.then(u):u()};return l()},Nk=(e,t,n)=>{const o=e.router.getMatch(t);if(!o||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:o,params:o.params,loaderData:o.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([l,u,f])=>{const h=l?.meta,p=l?.links,y=l?.scripts,v=l?.styles;return{meta:h,links:p,headScripts:y,headers:f,scripts:u,styles:v}})},J_=(e,t,n,o)=>{const i=e.matchPromises[n-1],{params:l,loaderDeps:u,abortController:f,cause:h}=e.router.getMatch(t),p=ea(e,n),y=Ud(e,t);return{params:l,deps:u,preload:!!y,parentMatchPromise:i,abortController:f,context:p,location:e.location,navigate:v=>e.router.navigate({...v,_fromLocation:e.location}),cause:y?"preload":h,route:o,...e.router.options.additionalContext}},hx=async(e,t,n,o)=>{try{const i=e.router.getMatch(t);try{(!(VO??e.router.isServer)||i.ssr===!0)&&W_(o);const l=o.options.loader?.(J_(e,t,n,o)),u=o.options.loader&&Wi(l);if((u||o._lazyPromise||o._componentsPromise||o.options.head||o.options.scripts||o.options.headers||i._nonReactive.minPendingPromise)&&e.updateMatch(t,p=>({...p,isFetching:"loader"})),o.options.loader){const p=u?await l:l;Qo(e,e.router.getMatch(t),p),p!==void 0&&e.updateMatch(t,y=>({...y,loaderData:p}))}o._lazyPromise&&await o._lazyPromise;const h=i._nonReactive.minPendingPromise;h&&await h,o._componentsPromise&&await o._componentsPromise,e.updateMatch(t,p=>({...p,error:void 0,context:ea(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let u=l;if(u?.name==="AbortError"){e.updateMatch(t,h=>({...h,status:h.status==="pending"?"success":h.status,isFetching:!1,context:ea(e,n)}));return}const f=i._nonReactive.minPendingPromise;f&&await f,ln(l)&&await o.options.notFoundComponent?.preload?.(),Qo(e,e.router.getMatch(t),l);try{o.options.onError?.(l)}catch(h){u=h,Qo(e,e.router.getMatch(t),h)}e.updateMatch(t,h=>({...h,error:u,context:ea(e,n),status:"error",isFetching:!1}))}}catch(i){const l=e.router.getMatch(t);l&&(l._nonReactive.loaderPromise=void 0),Qo(e,l,i)}},Ok=async(e,t)=>{const{id:n,routeId:o}=e.matches[t];let i=!1,l=!1;const u=e.router.looseRoutesById[o];if(!K_(e,n)){const p=e.router.getMatch(n);if(p._nonReactive.loaderPromise){if(p.status==="success"&&!e.sync&&!p.preload)return p;await p._nonReactive.loaderPromise;const y=e.router.getMatch(n),v=y._nonReactive.error||y.error;v&&Qo(e,y,v)}else{const y=Date.now()-p.updatedAt,v=Ud(e,n),w=v?u.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:u.options.staleTime??e.router.options.defaultStaleTime??0,_=u.options.shouldReload,R=typeof _=="function"?_(J_(e,n,t,u)):_,x=!!v&&!e.router.state.matches.some(O=>O.id===n),C=e.router.getMatch(n);C._nonReactive.loaderPromise=Us(),x!==C.preload&&e.updateMatch(n,O=>({...O,preload:x}));const{status:N,invalid:k}=C;i=N==="success"&&(k||(R??y>w)),v&&u.options.preload===!1||(i&&!e.sync?(l=!0,(async()=>{try{await hx(e,n,t,u);const O=e.router.getMatch(n);O._nonReactive.loaderPromise?.resolve(),O._nonReactive.loadPromise?.resolve(),O._nonReactive.loaderPromise=void 0}catch(O){$n(O)&&await e.router.navigate(O.options)}})()):(N!=="success"||i&&e.sync)&&await hx(e,n,t,u))}}const f=e.router.getMatch(n);l||(f._nonReactive.loaderPromise?.resolve(),f._nonReactive.loadPromise?.resolve()),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,l||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0;const h=l?f.isFetching:!1;return h!==f.isFetching||f.invalid!==!1?(e.updateMatch(n,p=>({...p,isFetching:h,invalid:!1})),e.router.getMatch(n)):f};async function px(e){const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(n=>n._forcePending)&&Wu(t);try{for(let f=0;f<t.matches.length;f++){const h=Ak(t,f);Wi(h)&&await h}const n=t.firstBadMatchIndex??t.matches.length;for(let f=0;f<n;f++)t.matchPromises.push(Ok(t,f));const i=(await Promise.allSettled(t.matchPromises)).filter(f=>f.status==="rejected").map(f=>f.reason);let l;for(const f of i){if($n(f))throw f;!l&&ln(f)&&(l=f)}for(const f of t.matches){const{id:h,routeId:p}=f,y=t.router.looseRoutesById[p];try{const v=Nk(t,h,y);if(v){const w=await v;t.updateMatch(h,_=>({..._,...w}))}}catch(v){console.error(`Error executing head for route ${p}:`,v)}}if(l)throw l;const u=Wu(t);Wi(u)&&await u}catch(n){if(ln(n)&&!t.preload){const o=Wu(t);throw Wi(o)&&await o,n}if($n(n))throw n}return t.matches}async function W_(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...o}=t.options;Object.assign(e.options,o),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const o of tE){const i=e.options[o]?.preload;i&&n.push(i())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function eE(e){for(const t of tE)if(e.options[t]?.preload)return!0;return!1}const tE=["component","errorComponent","pendingComponent","notFoundComponent"];function kk(e){return{input:({url:t})=>{for(const n of e)t=zm(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=nE(e[n],t);return t}}}function Mk(e){const t=H_(e.basepath),n=`/${t}`,o=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),l=e.caseSensitive?o:o.toLowerCase();return{input:({url:u})=>{const f=e.caseSensitive?u.pathname:u.pathname.toLowerCase();return f===i?u.pathname="/":f.startsWith(l)&&(u.pathname=u.pathname.slice(n.length)),u},output:({url:u})=>(u.pathname=Ju(["/",t,u.pathname]),u)}}function zm(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function nE(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Ik(e){return e instanceof Error?{name:e.name,message:e.message}:{data:e}}function $s(e){const t=e.resolvedLocation,n=e.location,o=t?.pathname!==n.pathname,i=t?.href!==n.href,l=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:o,hrefChanged:i,hashChanged:l}}class Dk{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const o=this.options,i=this.basepath??o?.basepath??"/",l=this.basepath===void 0,u=o?.rewrite;if(this.options={...o,...n},this.isServer=this.options.isServer??typeof document>"u",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=fk(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=BO()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let w;this.resolvePathCache=dd(1e3),w=this.buildRouteTree(),this.setRoutes(w)}!this.__store&&this.latestLocation&&(this.__store=new FO(zk(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(w=>!["redirected"].includes(w.status))}}}),bk(this));let f=!1;const h=this.options.basepath??"/",p=this.options.rewrite;if(l||i!==h||u!==p){this.basepath=h;const w=[],_=H_(h);_&&_!=="/"&&w.push(Mk({basepath:h})),p&&w.push(p),this.rewrite=w.length===0?void 0:w.length===1?w[0]:kk(w),this.history&&this.updateLatestLocation(),f=!0}f&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=ik(this.routeTree,this.options.caseSensitive,(o,i)=>{o.init({originalIndex:i})});return this.options.routeMasks&&tk(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,o)=>{const i={eventType:n,fn:o};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(o=>{o.eventType===n.type&&o.fn(n)})},this.parseLocation=(n,o)=>{const i=({pathname:h,search:p,hash:y,href:v,state:w})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(h)){const k=this.options.parseSearch(p),O=this.options.stringifySearch(k);return{href:h+O+y,publicHref:v,pathname:Sl(h),external:!1,searchStr:O,search:wn(o?.search,k),hash:Sl(y.slice(1)),state:wn(o?.state,w)}}const _=new URL(v,this.origin),R=zm(this.rewrite,_),x=this.options.parseSearch(R.search),C=this.options.stringifySearch(x);return R.search=C,{href:R.href.replace(R.origin,""),publicHref:v,pathname:Sl(R.pathname),external:!!this.rewrite&&R.origin!==this.origin,searchStr:C,search:wn(o?.search,x),hash:Sl(R.hash.slice(1)),state:wn(o?.state,w)}},l=i(n),{__tempLocation:u,__tempKey:f}=l.state;if(u&&(!f||f===this.tempLocationKey)){const h=i(u);return h.state.key=l.state.key,h.state.__TSR_key=l.state.__TSR_key,delete h.state.__tempLocation,{...h,maskedLocation:l}}return l},this.resolvePathWithBase=(n,o)=>dk({base:n,to:wg(o),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,o,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:o},i):this.matchRoutesInternal(n,o),this.getMatchedRoutes=n=>Lk({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const o=this.getMatch(n);o&&(o.abortController.abort(),clearTimeout(o._nonReactive.pendingTimeout),o._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(l=>l.status==="pending"),o=this.state.matches.filter(l=>l.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...o]).forEach(l=>{this.cancelMatch(l.id)})},this.buildLocation=n=>{const o=(l={})=>{const u=l._fromLocation||this.pendingBuiltLocation||this.latestLocation,f=this.matchRoutesLightweight(u);l.from;const h=l.unsafeRelative==="path"?u.pathname:l.from??f.fullPath,p=this.resolvePathWithBase(h,"."),y=f.search,v={...f.params},w=l.to?this.resolvePathWithBase(p,`${l.to}`):this.resolvePathWithBase(p,"."),_=l.params===!1||l.params===null?{}:(l.params??!0)===!0?v:Object.assign(v,Zo(l.params,v)),R=Gp({path:w,params:_,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,x=this.getMatchedRoutes(R);let C=x.matchedRoutes;(x.foundRoute?x.foundRoute.path!=="/"&&x.routeParams["**"]:lo(R))&&this.options.notFoundRoute&&(C=[...C,this.options.notFoundRoute]);let k=!1;if(Object.keys(_).length>0)for(const ue of C){const ce=ue.options.params?.stringify??ue.options.stringifyParams;ce&&(k=!0,Object.assign(_,ce(_)))}const O=n.leaveParams?w:Sl(k?Gp({path:w,params:_,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:R);let M=y;if(n._includeValidateSearch&&this.options.search?.strict){const ue={};C.forEach(ce=>{if(ce.options.validateSearch)try{Object.assign(ue,ed(ce.options.validateSearch,{...ue,...M}))}catch{}}),M=ue}M=Pk({search:M,dest:l,destRoutes:C,_includeValidateSearch:n._includeValidateSearch}),M=wn(y,M);const $=this.options.stringifySearch(M),V=l.hash===!0?u.hash:l.hash?Zo(l.hash,u.hash):void 0,L=V?`#${V}`:"";let D=l.state===!0?u.state:l.state?Zo(l.state,u.state):{};D=wn(u.state,D);const Y=`${O}${$}${L}`;let ie,le,se=!1;if(this.rewrite){const ue=new URL(Y,this.origin),ce=nE(this.rewrite,ue);ie=ue.href.replace(ue.origin,""),ce.origin!==this.origin?(le=ce.href,se=!0):le=ce.pathname+ce.search+ce.hash}else ie=JO(Y),le=ie;return{publicHref:le,href:ie,pathname:O,search:M,searchStr:$,state:D,hash:V??"",external:se,unmaskOnReload:l.unmaskOnReload}},i=(l={},u)=>{const f=o(l);let h=u?o(u):void 0;if(!h){const p={};if(this.options.routeMasks){const y=nk(f.pathname,this.processedTree);if(y){Object.assign(p,y.rawParams);const{from:v,params:w,..._}=y.route,R=w===!1||w===null?{}:(w??!0)===!0?p:Object.assign(p,Zo(w,p));u={from:n.from,..._,params:R},h=o(u)}}}return h&&(f.maskedLocation=h),f};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:o,...i})=>{const l=()=>{const h=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];h.forEach(y=>{i.state[y]=this.latestLocation.state[y]});const p=Ps(i.state,this.latestLocation.state);return h.forEach(y=>{delete i.state[y]}),p},u=lo(this.latestLocation.href)===lo(i.href),f=this.commitLocationPromise;if(this.commitLocationPromise=Us(()=>{f?.resolve()}),u&&l())this.load();else{let{maskedLocation:h,hashScrollIntoView:p,...y}=i;h&&(y={...h,state:{...h.state,__tempKey:void 0,__tempLocation:{...y,search:y.searchStr,state:{...y.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(y.unmaskOnReload??this.options.unmaskOnReload??!1)&&(y.state.__tempKey=this.tempLocationKey)),y.state.__hashScrollIntoViewOptions=p??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[i.replace?"replace":"push"](y.publicHref,y.state,{ignoreBlocker:o})}return this.resetNextScroll=i.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:o,hashScrollIntoView:i,viewTransition:l,ignoreBlocker:u,href:f,...h}={})=>{if(f){const v=this.history.location.state.__TSR_index,w=ld(f,{__TSR_index:n?v:v+1}),_=new URL(w.pathname,this.origin),R=zm(this.rewrite,_);h.to=R.pathname,h.search=this.options.parseSearch(w.search),h.hash=w.hash.slice(1)}const p=this.buildLocation({...h,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const y=this.commitLocation({...p,viewTransition:l,replace:n,resetScroll:o,hashScrollIntoView:i,ignoreBlocker:u});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),y},this.navigate=async({to:n,reloadDocument:o,href:i,publicHref:l,...u})=>{let f=!1;if(i)try{new URL(`${i}`),f=!0}catch{}if(f&&!o&&(o=!0),o){if(n!==void 0||!i){const p=this.buildLocation({to:n,...u});i=i??p.publicHref,l=l??p.publicHref}const h=!f&&l?l:i;if(ud(h))return Promise.resolve();if(!u.ignoreBlocker){const y=this.history.getBlockers?.()??[];for(const v of y)if(v?.blockerFn&&await v.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return u.replace?window.location.replace(h):window.location.href=h,Promise.resolve()}return this.buildAndCommitLocation({...u,href:i,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(o=>({...o,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:o.cachedMatches.filter(i=>!n.some(l=>l.id===i.id))}))},this.load=async n=>{let o,i,l;for(l=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad();const h=this.latestLocation,p=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...$s({resolvedLocation:p,location:h})}),this.emit({type:"onBeforeLoad",...$s({resolvedLocation:p,location:h})}),await px({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:h,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let y=[],v=[],w=[];Ji(()=>{this.__store.setState(_=>{const R=_.matches,x=_.pendingMatches||_.matches;return y=R.filter(C=>!x.some(N=>N.id===C.id)),v=x.filter(C=>!R.some(N=>N.id===C.id)),w=x.filter(C=>R.some(N=>N.id===C.id)),{..._,isLoading:!1,loadedAt:Date.now(),matches:x,pendingMatches:void 0,cachedMatches:[..._.cachedMatches,...y.filter(C=>C.status!=="error"&&C.status!=="notFound")]}}),this.clearExpiredCache()}),[[y,"onLeave"],[v,"onEnter"],[w,"onStay"]].forEach(([_,R])=>{_.forEach(x=>{this.looseRoutesById[x.routeId].options[R]?.(x)})})})})}})}catch(h){$n(h)?(o=h,this.navigate({...o.options,replace:!0,ignoreBlocker:!0})):ln(h)&&(i=h),this.__store.setState(p=>({...p,statusCode:o?o.status:i?404:p.matches.some(y=>y.status==="error")?500:200,redirect:o}))}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let u;this.hasNotFoundMatch()?u=404:this.__store.state.matches.some(f=>f.status==="error")&&(u=500),u!==void 0&&this.__store.setState(f=>({...f,statusCode:u}))},this.startViewTransition=n=>{const o=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,o&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof o=="object"&&this.isViewTransitionTypesSupported){const l=this.latestLocation,u=this.state.resolvedLocation,f=typeof o.types=="function"?o.types($s({resolvedLocation:u,location:l})):o.types;if(f===!1){n();return}i={update:n,types:f}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,o)=>{this.startTransition(()=>{const i=this.state.pendingMatches?.some(l=>l.id===n)?"pendingMatches":this.state.matches.some(l=>l.id===n)?"matches":this.state.cachedMatches.some(l=>l.id===n)?"cachedMatches":"";i&&this.__store.setState(l=>({...l,[i]:l[i]?.map(u=>u.id===n?o(u):u)}))})},this.getMatch=n=>{const o=i=>i.id===n;return this.state.cachedMatches.find(o)??this.state.pendingMatches?.find(o)??this.state.matches.find(o)},this.invalidate=n=>{const o=i=>n?.filter?.(i)??!0?{...i,invalid:!0,...n?.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i;return this.__store.setState(i=>({...i,matches:i.matches.map(o),cachedMatches:i.cachedMatches.map(o),pendingMatches:i.pendingMatches?.map(o)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const o=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const i=n.options._builtLocation??this.buildLocation(n.options),l=this.getParsedLocationHref(i);n.options.href=l,n.headers.set("Location",l)}else if(o)try{const i=new URL(o);if(this.origin&&i.origin===this.origin){const l=i.pathname+i.search+i.hash;n.options.href=l,n.headers.set("Location",l)}}catch{}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const o=n?.filter;o!==void 0?this.__store.setState(i=>({...i,cachedMatches:i.cachedMatches.filter(l=>!o(l))})):this.__store.setState(i=>({...i,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=o=>{const i=this.looseRoutesById[o.routeId];if(!i.options.loader)return!0;const l=(o.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??300*1e3;return o.status==="error"?!0:Date.now()-o.updatedAt>=l};this.clearCache({filter:n})},this.loadRouteChunk=W_,this.preloadRoute=async n=>{const o=this.buildLocation(n);let i=this.matchRoutes(o,{throwOnError:!0,preload:!0,dest:n});const l=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(f=>f.id)),u=new Set([...l,...this.state.cachedMatches.map(f=>f.id)]);Ji(()=>{i.forEach(f=>{u.has(f.id)||this.__store.setState(h=>({...h,cachedMatches:[...h.cachedMatches,f]}))})});try{return i=await px({router:this,matches:i,location:o,preload:!0,updateMatch:(f,h)=>{l.has(f)?i=i.map(p=>p.id===f?h(p):p):this.updateMatch(f,h)}}),i}catch(f){if($n(f))return f.options.reloadDocument?void 0:await this.preloadRoute({...f.options,_fromLocation:o});ln(f)||console.error(f);return}},this.matchRoute=(n,o)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},l=this.buildLocation(i);if(o?.pending&&this.state.status!=="pending")return!1;const f=(o?.pending===void 0?!this.state.isLoading:o.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,h=rk(l.pathname,o?.caseSensitive??!1,o?.fuzzy??!1,f.pathname,this.processedTree);return!h||n.params&&!Ps(h.rawParams,n.params,{partial:!0})?!1:o?.includeSearch??!0?Ps(f.search,l.search,{partial:!0})?h.rawParams:!1:h.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??_k,parseSearch:t.parseSearch??Sk}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:o}){this.routesById=t,this.routesByPath=n,this.processedTree=o;const i=this.options.notFoundRoute;i&&(i.init({originalIndex:99999999999}),this.routesById[i.id]=i)}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const o=this.getMatchedRoutes(t.pathname),{foundRoute:i,routeParams:l,parsedParams:u}=o;let{matchedRoutes:f}=o,h=!1;(i?i.path!=="/"&&l["**"]:lo(t.pathname))&&(this.options.notFoundRoute?f=[...f,this.options.notFoundRoute]:h=!0);const p=h?Fk(this.options.notFoundMode,f):void 0,y=[],v=w=>w?.id?w.context??this.options.context??void 0:this.options.context??void 0;return f.forEach((w,_)=>{const R=y[_-1],[x,C,N]=(()=>{const ce=R?.search??t.search,ge=R?._strictSearch??void 0;try{const F=ed(w.options.validateSearch,{...ce})??void 0;return[{...ce,...F},{...ge,...F},void 0]}catch(F){let X=F;if(F instanceof pd||(X=new pd(F.message,{cause:F})),n?.throwOnError)throw X;return[ce,{},X]}})(),k=w.options.loaderDeps?.({search:x})??"",O=k?JSON.stringify(k):"",{interpolatedPath:M,usedParams:$}=Gp({path:w.fullPath,params:l,decoder:this.pathParamsDecoder,server:this.isServer}),V=w.id+M+O,L=this.getMatch(V),D=this.state.matches.find(ce=>ce.routeId===w.id),Y=L?._strictParams??$;let ie;if(!L)try{mx(w,$,u,Y)}catch(ce){if(ln(ce)||$n(ce)?ie=ce:ie=new jk(ce.message,{cause:ce}),n?.throwOnError)throw ie}Object.assign(l,Y);const le=D?"stay":"enter";let se;if(L)se={...L,cause:le,params:D?wn(D.params,l):l,_strictParams:Y,search:wn(D?D.search:L.search,x),_strictSearch:C};else{const ce=w.options.loader||w.options.beforeLoad||w.lazyFn||eE(w)?"pending":"success";se={id:V,ssr:w.options.ssr,index:_,routeId:w.id,params:D?wn(D.params,l):l,_strictParams:Y,pathname:M,updatedAt:Date.now(),search:D?wn(D.search,x):x,_strictSearch:C,searchError:void 0,status:ce,isFetching:!1,error:void 0,paramsError:ie,__routeContext:void 0,_nonReactive:{loadPromise:Us()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:le,loaderDeps:D?wn(D.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:w.options.staticData||{},fullPath:w.fullPath}}n?.preload||(se.globalNotFound=p===w.id),se.searchError=N;const ue=v(R);se.context={...ue,...se.__routeContext,...se.__beforeLoadContext},y.push(se)}),y.forEach((w,_)=>{const R=this.looseRoutesById[w.routeId];if(!this.getMatch(w.id)){const C=y[_-1],N=v(C);if(R.options.context){const k={deps:w.loaderDeps,params:w.params,context:N??{},location:t,navigate:O=>this.navigate({...O,_fromLocation:t}),buildLocation:this.buildLocation,cause:w.cause,abortController:w.abortController,preload:!!w.preload,matches:y};w.__routeContext=R.options.context(k)??void 0}w.context={...N,...w.__routeContext,...w.__beforeLoadContext}}}),y}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:o,parsedParams:i}=this.getMatchedRoutes(t.pathname),l=Bl(n),u={...t.search};for(const y of n)try{Object.assign(u,ed(y.options.validateSearch,u))}catch{}const f=Bl(this.state.matches),h=f&&f.routeId===l.id&&t.pathname===this.state.location.pathname;let p;if(h)p=f.params;else{const y={...o};for(const v of n)try{mx(v,o,i??{},y)}catch{}p=y}return{matchedRoutes:n,fullPath:l.fullPath,search:u,params:p}}}class pd extends Error{}class jk extends Error{}function zk(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function ed(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new pd("Async validation not supported");if(n.issues)throw new pd(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function Lk({pathname:e,routesById:t,processedTree:n}){const o={},i=lo(e);let l,u;const f=ok(i,n,!0);return f&&(l=f.route,Object.assign(o,f.rawParams),u=Object.assign({},f.parsedParams)),{matchedRoutes:f?.branch||[t[rr]],routeParams:o,foundRoute:l,parsedParams:u}}function Pk({search:e,dest:t,destRoutes:n,_includeValidateSearch:o}){return $k(n)(e,t,o??!1)}function $k(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const l=({search:u,next:f})=>{let h=u;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(h=i.options.preSearchFilters.reduce((y,v)=>v(y),u));const p=f(h);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((y,v)=>v(y),p):p};t.middlewares.push(l)}if(i.options.validateSearch){const l=({search:u,next:f})=>{const h=f(u);if(!t._includeValidateSearch)return h;try{return{...h,...ed(i.options.validateSearch,h)??void 0}}catch{return h}};t.middlewares.push(l)}}const n=({search:i})=>{const l=t.dest;return l.search?l.search===!0?i:Zo(l.search,i):{}};t.middlewares.push(n);const o=(i,l,u)=>{if(i>=u.length)return l;const f=u[i];return f({search:l,next:p=>o(i+1,p,u)})};return function(l,u,f){return t.dest=u,t._includeValidateSearch=f,o(0,l,t.middlewares)}}function Fk(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const o=t[n];if(o.children)return o.id}return rr}function mx(e,t,n,o){const i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(const l in t)l in n&&(o[l]=n[l]);else{const l=i(o);Object.assign(o,l)}}const Ar=Symbol.for("TSR_DEFERRED_PROMISE");function Uk(e,t){const n=e;return n[Ar]||(n[Ar]={status:"pending"},n.then(o=>{n[Ar].status="success",n[Ar].data=o}).catch(o=>{n[Ar].status="error",n[Ar].error={data:Ik(o),__isServerError:!0}})),n}const Bk="Error preloading route! ☝️";class rE{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const o=this.options,i=!o?.path&&!o?.id;this.parentRoute=this.options.getParentRoute?.(),i?this._path=rr:this.parentRoute||_n(!1);let l=i?rr:o?.path;l&&l!=="/"&&(l=V_(l));const u=o?.id||l;let f=i?rr:Ju([this.parentRoute.id===rr?"":this.parentRoute.id,u]);l===rr&&(l="/"),f!==rr&&(f=Ju(["/",f]));const h=f===rr?"/":Ju([this.parentRoute.fullPath,l]);this._path=l,this._id=f,this._fullPath=h,this._to=lo(h)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>Q_({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class qk extends rE{constructor(t){super(t)}}var Vk=(e=>(e[e.AggregateError=1]="AggregateError",e[e.ArrowFunction=2]="ArrowFunction",e[e.ErrorPrototypeStack=4]="ErrorPrototypeStack",e[e.ObjectAssign=8]="ObjectAssign",e[e.BigIntTypedArray=16]="BigIntTypedArray",e[e.RegExp=32]="RegExp",e))(Vk||{}),uo=Symbol.asyncIterator,oE=Symbol.hasInstance,ta=Symbol.isConcatSpreadable,fo=Symbol.iterator,sE=Symbol.match,iE=Symbol.matchAll,aE=Symbol.replace,lE=Symbol.search,cE=Symbol.species,uE=Symbol.split,dE=Symbol.toPrimitive,na=Symbol.toStringTag,fE=Symbol.unscopables,hE={[uo]:0,[oE]:1,[ta]:2,[fo]:3,[sE]:4,[iE]:5,[aE]:6,[lE]:7,[cE]:8,[uE]:9,[dE]:10,[na]:11,[fE]:12},Hk={0:uo,1:oE,2:ta,3:fo,4:sE,5:iE,6:aE,7:lE,8:cE,9:uE,10:dE,11:na,12:fE},I=void 0,Zk={2:!0,3:!1,1:I,0:null,4:-0,5:Number.POSITIVE_INFINITY,6:Number.NEGATIVE_INFINITY,7:Number.NaN},Qk={0:"Error",1:"EvalError",2:"RangeError",3:"ReferenceError",4:"SyntaxError",5:"TypeError",6:"URIError"},Gk={0:Error,1:EvalError,2:RangeError,3:ReferenceError,4:SyntaxError,5:TypeError,6:URIError};function Qe(e,t,n,o,i,l,u,f,h,p,y,v){return{t:e,i:t,s:n,c:o,m:i,p:l,e:u,a:f,f:h,b:p,o:y,l:v}}function rs(e){return Qe(2,I,e,I,I,I,I,I,I,I,I,I)}var pE=rs(2),mE=rs(3),Yk=rs(1),Kk=rs(0),Xk=rs(4),Jk=rs(5),Wk=rs(6),eM=rs(7);function tM(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case`
11
+ `:return"\\n";case"\r":return"\\r";case"\b":return"\\b";case" ":return"\\t";case"\f":return"\\f";case"<":return"\\x3C";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:return I}}function os(e){let t="",n=0,o;for(let i=0,l=e.length;i<l;i++)o=tM(e[i]),o&&(t+=e.slice(n,i)+o,n=i+1);return n===0?t=e:t+=e.slice(n),t}function nM(e){switch(e){case"\\\\":return"\\";case'\\"':return'"';case"\\n":return`
12
+ `;case"\\r":return"\r";case"\\b":return"\b";case"\\t":return" ";case"\\f":return"\f";case"\\x3C":return"<";case"\\u2028":return"\u2028";case"\\u2029":return"\u2029";default:return e}}function Ks(e){return e.replace(/(\\\\|\\"|\\n|\\r|\\b|\\t|\\f|\\u2028|\\u2029|\\x3C)/g,nM)}var Lu="__SEROVAL_REFS__",gE=new Map,Gi=new Map;function yE(e){return gE.has(e)}function rM(e){return Gi.has(e)}function oM(e){if(yE(e))return gE.get(e);throw new jM(e)}function sM(e){if(rM(e))return Gi.get(e);throw new zM(e)}typeof globalThis<"u"?Object.defineProperty(globalThis,Lu,{value:Gi,configurable:!0,writable:!1,enumerable:!1}):typeof window<"u"?Object.defineProperty(window,Lu,{value:Gi,configurable:!0,writable:!1,enumerable:!1}):typeof self<"u"?Object.defineProperty(self,Lu,{value:Gi,configurable:!0,writable:!1,enumerable:!1}):typeof global<"u"&&Object.defineProperty(global,Lu,{value:Gi,configurable:!0,writable:!1,enumerable:!1});function xg(e){return e instanceof EvalError?1:e instanceof RangeError?2:e instanceof ReferenceError?3:e instanceof SyntaxError?4:e instanceof TypeError?5:e instanceof URIError?6:0}function iM(e){let t=Qk[xg(e)];return e.name!==t?{name:e.name}:e.constructor.name!==t?{name:e.constructor.name}:{}}function vE(e,t){let n=iM(e),o=Object.getOwnPropertyNames(e);for(let i=0,l=o.length,u;i<l;i++)u=o[i],u!=="name"&&u!=="message"&&(u==="stack"?t&4&&(n=n||{},n[u]=e[u]):(n=n||{},n[u]=e[u]));return n}function bE(e){return Object.isFrozen(e)?3:Object.isSealed(e)?2:Object.isExtensible(e)?0:1}function aM(e){switch(e){case Number.POSITIVE_INFINITY:return Jk;case Number.NEGATIVE_INFINITY:return Wk}return e!==e?eM:Object.is(e,-0)?Xk:Qe(0,I,e,I,I,I,I,I,I,I,I,I)}function wE(e){return Qe(1,I,os(e),I,I,I,I,I,I,I,I,I)}function lM(e){return Qe(3,I,""+e,I,I,I,I,I,I,I,I,I)}function cM(e){return Qe(4,e,I,I,I,I,I,I,I,I,I,I)}function uM(e,t){let n=t.valueOf();return Qe(5,e,n!==n?"":t.toISOString(),I,I,I,I,I,I,I,I,I)}function dM(e,t){return Qe(6,e,I,os(t.source),t.flags,I,I,I,I,I,I,I)}function fM(e,t){return Qe(17,e,hE[t],I,I,I,I,I,I,I,I,I)}function hM(e,t){return Qe(18,e,os(oM(t)),I,I,I,I,I,I,I,I,I)}function pM(e,t,n){return Qe(25,e,n,os(t),I,I,I,I,I,I,I,I)}function mM(e,t,n){return Qe(9,e,I,I,I,I,I,n,I,I,bE(t),I)}function gM(e,t){return Qe(21,e,I,I,I,I,I,I,t,I,I,I)}function yM(e,t,n){return Qe(15,e,I,t.constructor.name,I,I,I,I,n,t.byteOffset,I,t.length)}function vM(e,t,n){return Qe(16,e,I,t.constructor.name,I,I,I,I,n,t.byteOffset,I,t.byteLength)}function bM(e,t,n){return Qe(20,e,I,I,I,I,I,I,n,t.byteOffset,I,t.byteLength)}function wM(e,t,n){return Qe(13,e,xg(t),I,os(t.message),n,I,I,I,I,I,I)}function xM(e,t,n){return Qe(14,e,xg(t),I,os(t.message),n,I,I,I,I,I,I)}function SM(e,t){return Qe(7,e,I,I,I,I,I,t,I,I,I,I)}function _M(e,t){return Qe(28,I,I,I,I,I,I,[e,t],I,I,I,I)}function EM(e,t){return Qe(30,I,I,I,I,I,I,[e,t],I,I,I,I)}function TM(e,t,n){return Qe(31,e,I,I,I,I,I,n,t,I,I,I)}function CM(e,t){return Qe(32,e,I,I,I,I,I,I,t,I,I,I)}function RM(e,t){return Qe(33,e,I,I,I,I,I,I,t,I,I,I)}function AM(e,t){return Qe(34,e,I,I,I,I,I,I,t,I,I,I)}function NM(e,t,n,o){return Qe(35,e,n,I,I,I,I,t,I,I,I,o)}var OM={parsing:1,serialization:2,deserialization:3};function kM(e){return`Seroval Error (step: ${OM[e]})`}var MM=(e,t)=>kM(e),xE=class extends Error{constructor(e,t){super(MM(e)),this.cause=t}},gx=class extends xE{constructor(e){super("parsing",e)}},IM=class extends xE{constructor(e){super("deserialization",e)}};function mo(e){return`Seroval Error (specific: ${e})`}var Bd=class extends Error{constructor(t){super(mo(1)),this.value=t}},SE=class extends Error{constructor(t){super(mo(2))}},DM=class extends Error{constructor(e){super(mo(3))}},tc=class extends Error{constructor(e){super(mo(4))}},jM=class extends Error{constructor(e){super(mo(5)),this.value=e}},zM=class extends Error{constructor(e){super(mo(6))}},LM=class extends Error{constructor(e){super(mo(7))}},ss=class extends Error{constructor(e){super(mo(8))}},PM=class extends Error{constructor(t){super(mo(9))}},$M=class{constructor(e,t){this.value=e,this.replacement=t}},qd=()=>{let e={p:0,s:0,f:0};return e.p=new Promise((t,n)=>{e.s=t,e.f=n}),e},FM=(e,t)=>{e.s(t),e.p.s=1,e.p.v=t},UM=(e,t)=>{e.f(t),e.p.s=2,e.p.v=t};qd.toString();FM.toString();UM.toString();var BM=()=>{let e=[],t=[],n=!0,o=!1,i=0,l=(h,p,y)=>{for(y=0;y<i;y++)t[y]&&t[y][p](h)},u=(h,p,y,v)=>{for(p=0,y=e.length;p<y;p++)v=e[p],!n&&p===y-1?h[o?"return":"throw"](v):h.next(v)},f=(h,p)=>(n&&(p=i++,t[p]=h),u(h),()=>{n&&(t[p]=t[i],t[i--]=void 0)});return{__SEROVAL_STREAM__:!0,on:h=>f(h),next:h=>{n&&(e.push(h),l(h,"next"))},throw:h=>{n&&(e.push(h),l(h,"throw"),n=!1,o=!1,t.length=0)},return:h=>{n&&(e.push(h),l(h,"return"),n=!1,o=!0,t.length=0)}}},qM=e=>t=>()=>{let n=0,o={[e]:()=>o,next:()=>{if(n>t.d)return{done:!0,value:void 0};let i=n++,l=t.v[i];if(i===t.t)throw l;return{done:i===t.d,value:l}}};return o},VM=(e,t)=>n=>()=>{let o=0,i=-1,l=!1,u=[],f=[],h=(y=0,v=f.length)=>{for(;y<v;y++)f[y].s({done:!0,value:void 0})};n.on({next:y=>{let v=f.shift();v&&v.s({done:!1,value:y}),u.push(y)},throw:y=>{let v=f.shift();v&&v.f(y),h(),i=u.length,l=!0,u.push(y)},return:y=>{let v=f.shift();v&&v.s({done:!0,value:y}),h(),i=u.length,u.push(y)}});let p={[e]:()=>p,next:()=>{if(i===-1){let w=o++;if(w>=u.length){let _=t();return f.push(_),_.p}return{done:!1,value:u[w]}}if(o>i)return{done:!0,value:void 0};let y=o++,v=u[y];if(y!==i)return{done:!1,value:v};if(l)throw v;return{done:!0,value:v}}};return p},_E=e=>{let t=atob(e),n=t.length,o=new Uint8Array(n);for(let i=0;i<n;i++)o[i]=t.charCodeAt(i);return o.buffer};_E.toString();function HM(e){return"__SEROVAL_SEQUENCE__"in e}function EE(e,t,n){return{__SEROVAL_SEQUENCE__:!0,v:e,t,d:n}}function ZM(e){let t=[],n=-1,o=-1,i=e[fo]();for(;;)try{let l=i.next();if(t.push(l.value),l.done){o=t.length-1;break}}catch(l){n=t.length,t.push(l)}return EE(t,n,o)}var QM=qM(fo);function GM(e){return QM(e)}var YM={},KM={},XM={0:{},1:{},2:{},3:{},4:{},5:{}};function Vd(e){return"__SEROVAL_STREAM__"in e}function Xs(){return BM()}function JM(e){let t=Xs(),n=e[uo]();async function o(){try{let i=await n.next();i.done?t.return(i.value):(t.next(i.value),await o())}catch(i){t.throw(i)}}return o().catch(()=>{}),t}var WM=VM(uo,qd);function eI(e){return WM(e)}async function tI(e){try{return[1,await e]}catch(t){return[0,t]}}function nI(e,t){return{plugins:t.plugins,mode:e,marked:new Set,features:63^(t.disabledFeatures||0),refs:t.refs||new Map,depthLimit:t.depthLimit||1e3}}function td(e,t){e.marked.add(t)}function rI(e,t){let n=e.refs.size;return e.refs.set(t,n),n}function Hd(e,t){let n=e.refs.get(t);return n!=null?(td(e,n),{type:1,value:cM(n)}):{type:0,value:rI(e,t)}}function Sg(e,t){let n=Hd(e,t);return n.type===1?n:yE(t)?{type:2,value:hM(n.value,t)}:n}function zs(e,t){let n=Sg(e,t);if(n.type!==0)return n.value;if(t in hE)return fM(n.value,t);throw new Bd(t)}function Zd(e,t){let n=Hd(e,XM[t]);return n.type===1?n.value:Qe(26,n.value,t,I,I,I,I,I,I,I,I,I)}function oI(e){let t=Hd(e,YM);return t.type===1?t.value:Qe(27,t.value,I,I,I,I,I,I,zs(e,fo),I,I,I)}function sI(e){let t=Hd(e,KM);return t.type===1?t.value:Qe(29,t.value,I,I,I,I,I,[Zd(e,1),zs(e,uo)],I,I,I,I)}function iI(e,t,n,o){return Qe(n?11:10,e,I,I,I,o,I,I,I,I,bE(t),I)}function aI(e,t,n,o){return Qe(8,t,I,I,I,I,{k:n,v:o},I,Zd(e,0),I,I,I)}function lI(e,t,n){let o=new Uint8Array(n),i="";for(let l=0,u=o.length;l<u;l++)i+=String.fromCharCode(o[l]);return Qe(19,t,os(btoa(i)),I,I,I,I,I,Zd(e,5),I,I,I)}function cI(e,t){return{base:nI(e,t),child:void 0}}var uI=class{constructor(e,t){this._p=e,this.depth=t}parse(e){return zt(this._p,this.depth,e)}};async function dI(e,t,n){let o=[];for(let i=0,l=n.length;i<l;i++)i in n?o[i]=await zt(e,t,n[i]):o[i]=0;return o}async function fI(e,t,n,o){return mM(n,o,await dI(e,t,o))}async function _g(e,t,n){let o=Object.entries(n),i=[],l=[];for(let u=0,f=o.length;u<f;u++)i.push(os(o[u][0])),l.push(await zt(e,t,o[u][1]));return fo in n&&(i.push(zs(e.base,fo)),l.push(_M(oI(e.base),await zt(e,t,ZM(n))))),uo in n&&(i.push(zs(e.base,uo)),l.push(EM(sI(e.base),await zt(e,t,JM(n))))),na in n&&(i.push(zs(e.base,na)),l.push(wE(n[na]))),ta in n&&(i.push(zs(e.base,ta)),l.push(n[ta]?pE:mE)),{k:i,v:l}}async function Kp(e,t,n,o,i){return iI(n,o,i,await _g(e,t,o))}async function hI(e,t,n,o){return gM(n,await zt(e,t,o.valueOf()))}async function pI(e,t,n,o){return yM(n,o,await zt(e,t,o.buffer))}async function mI(e,t,n,o){return vM(n,o,await zt(e,t,o.buffer))}async function gI(e,t,n,o){return bM(n,o,await zt(e,t,o.buffer))}async function yx(e,t,n,o){let i=vE(o,e.base.features);return wM(n,o,i?await _g(e,t,i):I)}async function yI(e,t,n,o){let i=vE(o,e.base.features);return xM(n,o,i?await _g(e,t,i):I)}async function vI(e,t,n,o){let i=[],l=[];for(let[u,f]of o.entries())i.push(await zt(e,t,u)),l.push(await zt(e,t,f));return aI(e.base,n,i,l)}async function bI(e,t,n,o){let i=[];for(let l of o.keys())i.push(await zt(e,t,l));return SM(n,i)}async function TE(e,t,n,o){let i=e.base.plugins;if(i)for(let l=0,u=i.length;l<u;l++){let f=i[l];if(f.parse.async&&f.test(o))return pM(n,f.tag,await f.parse.async(o,new uI(e,t),{id:n}))}return I}async function wI(e,t,n,o){let[i,l]=await tI(o);return Qe(12,n,i,I,I,I,I,I,await zt(e,t,l),I,I,I)}function xI(e,t,n,o,i){let l=[],u=n.on({next:f=>{td(this.base,t),zt(this,e,f).then(h=>{l.push(CM(t,h))},h=>{i(h),u()})},throw:f=>{td(this.base,t),zt(this,e,f).then(h=>{l.push(RM(t,h)),o(l),u()},h=>{i(h),u()})},return:f=>{td(this.base,t),zt(this,e,f).then(h=>{l.push(AM(t,h)),o(l),u()},h=>{i(h),u()})}})}async function SI(e,t,n,o){return TM(n,Zd(e.base,4),await new Promise(xI.bind(e,t,n,o)))}async function _I(e,t,n,o){let i=[];for(let l=0,u=o.v.length;l<u;l++)i[l]=await zt(e,t,o.v[l]);return NM(n,i,o.t,o.d)}async function EI(e,t,n,o){if(Array.isArray(o))return fI(e,t,n,o);if(Vd(o))return SI(e,t,n,o);if(HM(o))return _I(e,t,n,o);let i=o.constructor;if(i===$M)return zt(e,t,o.replacement);let l=await TE(e,t,n,o);if(l)return l;switch(i){case Object:return Kp(e,t,n,o,!1);case I:return Kp(e,t,n,o,!0);case Date:return uM(n,o);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return yx(e,t,n,o);case Number:case Boolean:case String:case BigInt:return hI(e,t,n,o);case ArrayBuffer:return lI(e.base,n,o);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return pI(e,t,n,o);case DataView:return gI(e,t,n,o);case Map:return vI(e,t,n,o);case Set:return bI(e,t,n,o)}if(i===Promise||o instanceof Promise)return wI(e,t,n,o);let u=e.base.features;if(u&32&&i===RegExp)return dM(n,o);if(u&16)switch(i){case BigInt64Array:case BigUint64Array:return mI(e,t,n,o)}if(u&1&&typeof AggregateError<"u"&&(i===AggregateError||o instanceof AggregateError))return yI(e,t,n,o);if(o instanceof Error)return yx(e,t,n,o);if(fo in o||uo in o)return Kp(e,t,n,o,!!i);throw new Bd(o)}async function TI(e,t,n){let o=Sg(e.base,n);if(o.type!==0)return o.value;let i=await TE(e,t,o.value,n);if(i)return i;throw new Bd(n)}async function zt(e,t,n){switch(typeof n){case"boolean":return n?pE:mE;case"undefined":return Yk;case"string":return wE(n);case"number":return aM(n);case"bigint":return lM(n);case"object":{if(n){let o=Sg(e.base,n);return o.type===0?await EI(e,t+1,o.value,n):o.value}return Kk}case"symbol":return zs(e.base,n);case"function":return TI(e,t,n);default:throw new Bd(n)}}async function CI(e,t){try{return await zt(e,0,t)}catch(n){throw n instanceof gx?n:new gx(n)}}var RI=(e=>(e[e.Vanilla=1]="Vanilla",e[e.Cross=2]="Cross",e))(RI||{});function CE(e,t){for(let n=0,o=t.length;n<o;n++){let i=t[n];e.has(i)||(e.add(i),i.extends&&CE(e,i.extends))}}function RE(e){if(e){let t=new Set;return CE(t,e),[...t]}}function AI(e){switch(e){case"Int8Array":return Int8Array;case"Int16Array":return Int16Array;case"Int32Array":return Int32Array;case"Uint8Array":return Uint8Array;case"Uint16Array":return Uint16Array;case"Uint32Array":return Uint32Array;case"Uint8ClampedArray":return Uint8ClampedArray;case"Float32Array":return Float32Array;case"Float64Array":return Float64Array;case"BigInt64Array":return BigInt64Array;case"BigUint64Array":return BigUint64Array;default:throw new LM(e)}}var NI=1e6,OI=1e4,kI=2e4;function AE(e,t){switch(t){case 3:return Object.freeze(e);case 1:return Object.preventExtensions(e);case 2:return Object.seal(e);default:return e}}var MI=1e3;function II(e,t){var n;return{mode:e,plugins:t.plugins,refs:t.refs||new Map,features:(n=t.features)!=null?n:63^(t.disabledFeatures||0),depthLimit:t.depthLimit||MI}}function DI(e){return{mode:2,base:II(2,e),child:I}}var jI=class{constructor(e,t){this._p=e,this.depth=t}deserialize(e){return rt(this._p,this.depth,e)}};function NE(e,t){if(t<0||!Number.isFinite(t)||!Number.isInteger(t))throw new ss({t:4,i:t});if(e.refs.has(t))throw new Error("Conflicted ref id: "+t)}function zI(e,t,n){return NE(e.base,t),e.state.marked.has(t)&&e.base.refs.set(t,n),n}function LI(e,t,n){return NE(e.base,t),e.base.refs.set(t,n),n}function Lt(e,t,n){return e.mode===1?zI(e,t,n):LI(e,t,n)}function Lm(e,t,n){if(Object.hasOwn(t,n))return t[n];throw new ss(e)}function PI(e,t){return Lt(e,t.i,sM(Ks(t.s)))}function $I(e,t,n){let o=n.a,i=o.length,l=Lt(e,n.i,new Array(i));for(let u=0,f;u<i;u++)f=o[u],f&&(l[u]=rt(e,t,f));return AE(l,n.o),l}function FI(e){switch(e){case"constructor":case"__proto__":case"prototype":case"__defineGetter__":case"__defineSetter__":case"__lookupGetter__":case"__lookupSetter__":return!1;default:return!0}}function UI(e){switch(e){case uo:case ta:case na:case fo:return!0;default:return!1}}function vx(e,t,n){FI(t)?e[t]=n:Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}function BI(e,t,n,o,i){if(typeof o=="string")vx(n,o,rt(e,t,i));else{let l=rt(e,t,o);switch(typeof l){case"string":vx(n,l,rt(e,t,i));break;case"symbol":UI(l)&&(n[l]=rt(e,t,i));break;default:throw new ss(o)}}}function OE(e,t,n,o){let i=n.k;if(i.length>0)for(let l=0,u=n.v,f=i.length;l<f;l++)BI(e,t,o,i[l],u[l]);return o}function qI(e,t,n){let o=Lt(e,n.i,n.t===10?{}:Object.create(null));return OE(e,t,n.p,o),AE(o,n.o),o}function VI(e,t){return Lt(e,t.i,new Date(t.s))}function HI(e,t){if(e.base.features&32){let n=Ks(t.c);if(n.length>kI)throw new ss(t);return Lt(e,t.i,new RegExp(n,t.m))}throw new SE(t)}function ZI(e,t,n){let o=Lt(e,n.i,new Set);for(let i=0,l=n.a,u=l.length;i<u;i++)o.add(rt(e,t,l[i]));return o}function QI(e,t,n){let o=Lt(e,n.i,new Map);for(let i=0,l=n.e.k,u=n.e.v,f=l.length;i<f;i++)o.set(rt(e,t,l[i]),rt(e,t,u[i]));return o}function GI(e,t){if(t.s.length>NI)throw new ss(t);return Lt(e,t.i,_E(Ks(t.s)))}function YI(e,t,n){var o;let i=AI(n.c),l=rt(e,t,n.f),u=(o=n.b)!=null?o:0;if(u<0||u>l.byteLength)throw new ss(n);return Lt(e,n.i,new i(l,u,n.l))}function KI(e,t,n){var o;let i=rt(e,t,n.f),l=(o=n.b)!=null?o:0;if(l<0||l>i.byteLength)throw new ss(n);return Lt(e,n.i,new DataView(i,l,n.l))}function kE(e,t,n,o){if(n.p){let i=OE(e,t,n.p,{});Object.defineProperties(o,Object.getOwnPropertyDescriptors(i))}return o}function XI(e,t,n){let o=Lt(e,n.i,new AggregateError([],Ks(n.m)));return kE(e,t,n,o)}function JI(e,t,n){let o=Lm(n,Gk,n.s),i=Lt(e,n.i,new o(Ks(n.m)));return kE(e,t,n,i)}function WI(e,t,n){let o=qd(),i=Lt(e,n.i,o.p),l=rt(e,t,n.f);return n.s?o.s(l):o.f(l),i}function eD(e,t,n){return Lt(e,n.i,Object(rt(e,t,n.f)))}function tD(e,t,n){let o=e.base.plugins;if(o){let i=Ks(n.c);for(let l=0,u=o.length;l<u;l++){let f=o[l];if(f.tag===i)return Lt(e,n.i,f.deserialize(n.s,new jI(e,t),{id:n.i}))}}throw new DM(n.c)}function nD(e,t){return Lt(e,t.i,Lt(e,t.s,qd()).p)}function rD(e,t,n){let o=e.base.refs.get(n.i);if(o)return o.s(rt(e,t,n.a[1])),I;throw new tc("Promise")}function oD(e,t,n){let o=e.base.refs.get(n.i);if(o)return o.f(rt(e,t,n.a[1])),I;throw new tc("Promise")}function sD(e,t,n){rt(e,t,n.a[0]);let o=rt(e,t,n.a[1]);return GM(o)}function iD(e,t,n){rt(e,t,n.a[0]);let o=rt(e,t,n.a[1]);return eI(o)}function aD(e,t,n){let o=Lt(e,n.i,Xs()),i=n.a,l=i.length;if(l)for(let u=0;u<l;u++)rt(e,t,i[u]);return o}function lD(e,t,n){let o=e.base.refs.get(n.i);if(o&&Vd(o))return o.next(rt(e,t,n.f)),I;throw new tc("Stream")}function cD(e,t,n){let o=e.base.refs.get(n.i);if(o&&Vd(o))return o.throw(rt(e,t,n.f)),I;throw new tc("Stream")}function uD(e,t,n){let o=e.base.refs.get(n.i);if(o&&Vd(o))return o.return(rt(e,t,n.f)),I;throw new tc("Stream")}function dD(e,t,n){return rt(e,t,n.f),I}function fD(e,t,n){return rt(e,t,n.a[1]),I}function hD(e,t,n){let o=Lt(e,n.i,EE([],n.s,n.l));for(let i=0,l=n.a.length;i<l;i++)o.v[i]=rt(e,t,n.a[i]);return o}function rt(e,t,n){if(t>e.base.depthLimit)throw new PM(e.base.depthLimit);switch(t+=1,n.t){case 2:return Lm(n,Zk,n.s);case 0:return Number(n.s);case 1:return Ks(String(n.s));case 3:if(String(n.s).length>OI)throw new ss(n);return BigInt(n.s);case 4:return e.base.refs.get(n.i);case 18:return PI(e,n);case 9:return $I(e,t,n);case 10:case 11:return qI(e,t,n);case 5:return VI(e,n);case 6:return HI(e,n);case 7:return ZI(e,t,n);case 8:return QI(e,t,n);case 19:return GI(e,n);case 16:case 15:return YI(e,t,n);case 20:return KI(e,t,n);case 14:return XI(e,t,n);case 13:return JI(e,t,n);case 12:return WI(e,t,n);case 17:return Lm(n,Hk,n.s);case 21:return eD(e,t,n);case 25:return tD(e,t,n);case 22:return nD(e,n);case 23:return rD(e,t,n);case 24:return oD(e,t,n);case 28:return sD(e,t,n);case 30:return iD(e,t,n);case 31:return aD(e,t,n);case 32:return lD(e,t,n);case 33:return cD(e,t,n);case 34:return uD(e,t,n);case 27:return dD(e,t,n);case 29:return fD(e,t,n);case 35:return hD(e,t,n);default:throw new SE(n)}}function pD(e,t){try{return rt(e,0,t)}catch(n){throw new IM(n)}}var mD=()=>T;mD.toString();function Xp(e,t){let n=RE(t.plugins),o=DI({plugins:n,refs:t.refs,features:t.features,disabledFeatures:t.disabledFeatures});return pD(o,e)}async function gD(e,t={}){let n=RE(t.plugins),o=cI(1,{plugins:n,disabledFeatures:t.disabledFeatures});return{t:await CI(o,e),f:o.base.features,m:Array.from(o.base.marked)}}function yD(e){return{tag:"$TSR/t/"+e.key,test:e.test,parse:{sync(t,n){return n.parse(e.toSerializable(t))},async async(t,n){return await n.parse(e.toSerializable(t))},stream(t,n){return n.parse(e.toSerializable(t))}},serialize:void 0,deserialize(t,n){return e.fromSerializable(n.deserialize(t))}}}var Ho={},ME=e=>new ReadableStream({start:t=>{e.on({next:n=>{try{t.enqueue(n)}catch{}},throw:n=>{t.error(n)},return:()=>{try{t.close()}catch{}}})}}),vD={tag:"seroval-plugins/web/ReadableStreamFactory",test(e){return e===Ho},parse:{sync(){return Ho},async async(){return await Promise.resolve(Ho)},stream(){return Ho}},serialize(){return ME.toString()},deserialize(){return Ho}};function bx(e){let t=Xs(),n=e.getReader();async function o(){try{let i=await n.read();i.done?t.return(i.value):(t.next(i.value),await o())}catch(i){t.throw(i)}}return o().catch(()=>{}),t}var bD={tag:"seroval/plugins/web/ReadableStream",extends:[vD],test(e){return typeof ReadableStream>"u"?!1:e instanceof ReadableStream},parse:{sync(e,t){return{factory:t.parse(Ho),stream:t.parse(Xs())}},async async(e,t){return{factory:await t.parse(Ho),stream:await t.parse(bx(e))}},stream(e,t){return{factory:t.parse(Ho),stream:t.parse(bx(e))}}},serialize(e,t){return"("+t.serialize(e.factory)+")("+t.serialize(e.stream)+")"},deserialize(e,t){let n=t.deserialize(e.stream);return ME(n)}},wD=bD;const xD={tag:"$TSR/Error",test(e){return e instanceof Error},parse:{sync(e,t){return{message:t.parse(e.message)}},async async(e,t){return{message:await t.parse(e.message)}},stream(e,t){return{message:t.parse(e.message)}}},serialize(e,t){return"new Error("+t.serialize(e.message)+")"},deserialize(e,t){return new Error(t.deserialize(e.message))}};class SD{constructor(t,n){this.stream=t,this.hint=n?.hint??"binary"}}const md=globalThis.Buffer,IE=!!md&&typeof md.from=="function";function DE(e){if(e.length===0)return"";if(IE)return md.from(e).toString("base64");const t=32768,n=[];for(let o=0;o<e.length;o+=t){const i=e.subarray(o,o+t);n.push(String.fromCharCode.apply(null,i))}return btoa(n.join(""))}function jE(e){if(e.length===0)return new Uint8Array(0);if(IE){const o=md.from(e,"base64");return new Uint8Array(o.buffer,o.byteOffset,o.byteLength)}const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}const zl=Object.create(null),Ll=Object.create(null),_D=e=>new ReadableStream({start(t){e.on({next(n){try{t.enqueue(jE(n))}catch{}},throw(n){t.error(n)},return(){try{t.close()}catch{}}})}}),ED=new TextEncoder,TD=e=>new ReadableStream({start(t){e.on({next(n){try{typeof n=="string"?t.enqueue(ED.encode(n)):t.enqueue(jE(n.$b64))}catch{}},throw(n){t.error(n)},return(){try{t.close()}catch{}}})}}),CD="(s=>new ReadableStream({start(c){s.on({next(b){try{const d=atob(b),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}catch(_){}},throw(e){c.error(e)},return(){try{c.close()}catch(_){}}})}}))",RD="(s=>{const e=new TextEncoder();return new ReadableStream({start(c){s.on({next(v){try{if(typeof v==='string'){c.enqueue(e.encode(v))}else{const d=atob(v.$b64),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}}catch(_){}},throw(x){c.error(x)},return(){try{c.close()}catch(_){}}})}})})";function wx(e){const t=Xs(),n=e.getReader();return(async()=>{try{for(;;){const{done:o,value:i}=await n.read();if(o){t.return(void 0);break}t.next(DE(i))}}catch(o){t.throw(o)}finally{n.releaseLock()}})(),t}function xx(e){const t=Xs(),n=e.getReader(),o=new TextDecoder("utf-8",{fatal:!0});return(async()=>{try{for(;;){const{done:i,value:l}=await n.read();if(i){try{const u=o.decode();u.length>0&&t.next(u)}catch{}t.return(void 0);break}try{const u=o.decode(l,{stream:!0});u.length>0&&t.next(u)}catch{t.next({$b64:DE(l)})}}}catch(i){t.throw(i)}finally{n.releaseLock()}})(),t}const AD={tag:"tss/RawStreamFactory",test(e){return e===zl},parse:{sync(){},async(){return Promise.resolve(void 0)},stream(){}},serialize(){return CD},deserialize(){return zl}},ND={tag:"tss/RawStreamFactoryText",test(e){return e===Ll},parse:{sync(){},async(){return Promise.resolve(void 0)},stream(){}},serialize(){return RD},deserialize(){return Ll}},OD={tag:"tss/RawStream",extends:[AD,ND],test(e){return e instanceof SD},parse:{sync(e,t){const n=e.hint==="text"?Ll:zl;return{hint:e.hint,factory:t.parse(n),stream:t.parse(Xs())}},async async(e,t){const n=e.hint==="text"?Ll:zl,o=e.hint==="text"?xx(e.stream):wx(e.stream);return{hint:e.hint,factory:await t.parse(n),stream:await t.parse(o)}},stream(e,t){const n=e.hint==="text"?Ll:zl,o=e.hint==="text"?xx(e.stream):wx(e.stream);return{hint:e.hint,factory:t.parse(n),stream:t.parse(o)}}},serialize(e,t){return"("+t.serialize(e.factory)+")("+t.serialize(e.stream)+")"},deserialize(e,t){const n=t.deserialize(e.stream);return e.hint==="text"?TD(n):_D(n)}};function kD(e){return{tag:"tss/RawStream",test:()=>!1,parse:{},serialize(){throw new Error("RawStreamDeserializePlugin.serialize should not be called. Client only deserializes.")},deserialize(t){return e(t.streamId)}}}const MD=[xD,OD,wD],ID="use",gd=$d[ID],Pu=typeof window<"u"?S.useLayoutEffect:S.useEffect;function Jp(e){const t=S.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function DD(e,t,n={},o={}){S.useEffect(()=>{if(!e.current||o.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([l])=>{t(l)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,o.disabled,e])}function jD(e){const t=S.useRef(null);return S.useImperativeHandle(e,()=>t.current,[]),t}function zD({promise:e}){if(gd)return gd(e);const t=Uk(e);if(t[Ar].status==="pending")throw t;if(t[Ar].status==="error")throw t[Ar].error;return t[Ar].data}function LD(e){const t=b.jsx(PD,{...e});return e.fallback?b.jsx(S.Suspense,{fallback:e.fallback,children:t}):t}function PD(e){const t=zD(e);return e.children(t)}function Eg(e){const t=e.errorComponent??Tg;return b.jsx($D,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:o})=>n?S.createElement(t,{error:n,reset:o}):e.children})}class $D extends S.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Tg({error:e}){const[t,n]=S.useState(!1);return b.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[b.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),b.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(o=>!o),children:t?"Hide Error":"Show Error"})]}),b.jsx("div",{style:{height:".25rem"}}),t?b.jsx("div",{children:b.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?b.jsx("code",{children:e.message}):null})}):null]})}function FD({children:e,fallback:t=null}){return zE()?b.jsx(tn.Fragment,{children:e}):b.jsx(tn.Fragment,{children:t})}function zE(){return tn.useSyncExternalStore(UD,()=>!0,()=>!1)}function UD(){return()=>{}}var Wp={exports:{}},em={},tm={exports:{}},nm={};var Sx;function BD(){if(Sx)return nm;Sx=1;var e=ec();function t(v,w){return v===w&&(v!==0||1/v===1/w)||v!==v&&w!==w}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,i=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function f(v,w){var _=w(),R=o({inst:{value:_,getSnapshot:w}}),x=R[0].inst,C=R[1];return l(function(){x.value=_,x.getSnapshot=w,h(x)&&C({inst:x})},[v,_,w]),i(function(){return h(x)&&C({inst:x}),v(function(){h(x)&&C({inst:x})})},[v]),u(_),_}function h(v){var w=v.getSnapshot;v=v.value;try{var _=w();return!n(v,_)}catch{return!0}}function p(v,w){return w()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return nm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,nm}var _x;function LE(){return _x||(_x=1,tm.exports=BD()),tm.exports}var Ex;function qD(){if(Ex)return em;Ex=1;var e=ec(),t=LE();function n(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var o=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,f=e.useMemo,h=e.useDebugValue;return em.useSyncExternalStoreWithSelector=function(p,y,v,w,_){var R=l(null);if(R.current===null){var x={hasValue:!1,value:null};R.current=x}else x=R.current;R=f(function(){function N(V){if(!k){if(k=!0,O=V,V=w(V),_!==void 0&&x.hasValue){var L=x.value;if(_(L,V))return M=L}return M=V}if(L=M,o(O,V))return L;var D=w(V);return _!==void 0&&_(L,D)?(O=V,L):(O=V,M=D)}var k=!1,O,M,$=v===void 0?null:v;return[function(){return N(y())},$===null?void 0:function(){return N($())}]},[y,v,w,_]);var C=i(p,R[0],R[1]);return u(function(){x.hasValue=!0,x.value=C},[C]),h(C),C},em}var Tx;function VD(){return Tx||(Tx=1,Wp.exports=qD()),Wp.exports}var HD=VD();function ZD(e,t=o=>o,n={}){const o=n.equal??QD;return HD.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,o)}function QD(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[o,i]of e)if(!t.has(o)||!Object.is(i,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=Cx(e);if(n.length!==Cx(t).length)return!1;for(let o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!Object.is(e[n[o]],t[n[o]]))return!1;return!0}function Cx(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const rm=S.createContext(null);function PE(){return typeof document>"u"?rm:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=rm,rm)}function rn(e){const t=S.useContext(PE());return e?.warn,t}function xt(e){const t=rn({warn:e?.router===void 0}),n=e?.router||t,o=S.useRef(void 0);return ZD(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const l=wn(o.current,e.select(i));return o.current=l,l}return e.select(i)}return i})}const Qd=S.createContext(void 0),GD=S.createContext(void 0);function Ir(e){const t=S.useContext(e.from?GD:Qd);return xt({select:o=>{const i=o.matches.find(l=>e.from?e.from===l.routeId:l.id===t);if(_n(!((e.shouldThrow??!0)&&!i),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),i!==void 0)return e.select?e.select(i):i},structuralSharing:e.structuralSharing})}function Cg(e){return Ir({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Rg(e){const{select:t,...n}=e;return Ir({...n,select:o=>t?t(o.loaderDeps):o.loaderDeps})}function Ag(e){return Ir({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Ng(e){return Ir({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Gd(e){const t=rn();return S.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var ga=P_();const YD=L_(ga);function KD(e,t){const n=rn(),o=jD(t),{activeProps:i,inactiveProps:l,activeOptions:u,to:f,preload:h,preloadDelay:p,hashScrollIntoView:y,replace:v,startTransition:w,resetScroll:_,viewTransition:R,children:x,target:C,disabled:N,style:k,className:O,onClick:M,onFocus:$,onMouseEnter:V,onMouseLeave:L,onTouchStart:D,ignoreBlocker:Y,params:ie,search:le,hash:se,state:ue,mask:ce,reloadDocument:ge,unsafeRelative:F,from:X,_fromLocation:Z,...ne}=e,be=zE(),z=xt({select:ot=>ot.location.search,structuralSharing:!0}),G=e.from,re=S.useMemo(()=>({...e,from:G}),[n,z,G,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),oe=S.useMemo(()=>n.buildLocation({...re}),[n,re]),de=oe.maskedLocation?oe.maskedLocation.publicHref:oe.publicHref,ve=oe.maskedLocation?oe.maskedLocation.external:oe.external,J=S.useMemo(()=>nj(de,ve,n.history,N),[N,ve,de,n.history]),_e=S.useMemo(()=>{if(J?.external)return ud(J.href)?void 0:J.href;if(!rj(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),ud(f)?void 0:f}catch{}},[f,J]),Te=xt({select:ot=>{if(_e)return!1;if(u?.exact){if(!uk(ot.location.pathname,oe.pathname,n.basepath))return!1}else{const Bt=fd(ot.location.pathname,n.basepath),Jt=fd(oe.pathname,n.basepath);if(!(Bt.startsWith(Jt)&&(Bt.length===Jt.length||Bt[Jt.length]==="/")))return!1}return(u?.includeSearch??!0)&&!Ps(ot.location.search,oe.search,{partial:!u?.exact,ignoreUndefined:!u?.explicitUndefined})?!1:u?.includeHash?be&&ot.location.hash===oe.hash:!0}}),Ce=Te?Zo(i,{})??XD:om,Oe=Te?om:Zo(l,{})??om,je=[O,Ce.className,Oe.className].filter(Boolean).join(" "),ht=(k||Ce.style||Oe.style)&&{...k,...Ce.style,...Oe.style},[It,An]=S.useState(!1),qn=S.useRef(!1),Xt=e.reloadDocument||_e?!1:h??n.options.defaultPreload,_t=p??n.options.defaultPreloadDelay??0,ae=S.useCallback(()=>{n.preloadRoute({...re}).catch(ot=>{console.warn(ot),console.warn(Bk)})},[n,re]),ke=S.useCallback(ot=>{ot?.isIntersecting&&ae()},[ae]);DD(o,ke,tj,{disabled:!!N||Xt!=="viewport"}),S.useEffect(()=>{qn.current||!N&&Xt==="render"&&(ae(),qn.current=!0)},[N,ae,Xt]);const Ue=ot=>{const Bt=ot.currentTarget.getAttribute("target"),Jt=C!==void 0?C:Bt;if(!N&&!oj(ot)&&!ot.defaultPrevented&&(!Jt||Jt==="_self")&&ot.button===0){ot.preventDefault(),ga.flushSync(()=>{An(!0)});const vc=n.subscribe("onResolved",()=>{vc(),An(!1)});n.navigate({...re,replace:v,resetScroll:_,hashScrollIntoView:y,startTransition:w,viewTransition:R,ignoreBlocker:Y})}};if(_e)return{...ne,ref:o,href:_e,...x&&{children:x},...C&&{target:C},...N&&{disabled:N},...k&&{style:k},...O&&{className:O},...M&&{onClick:M},...$&&{onFocus:$},...V&&{onMouseEnter:V},...L&&{onMouseLeave:L},...D&&{onTouchStart:D}};const ze=ot=>{N||Xt&&ae()},Ut=ze,on=ot=>{if(!(N||!Xt))if(!_t)ae();else{const Bt=ot.target;if(Tl.has(Bt))return;const Jt=setTimeout(()=>{Tl.delete(Bt),ae()},_t);Tl.set(Bt,Jt)}},Ef=ot=>{if(N||!Xt||!_t)return;const Bt=ot.target,Jt=Tl.get(Bt);Jt&&(clearTimeout(Jt),Tl.delete(Bt))};return{...ne,...Ce,...Oe,href:J?.href,ref:o,onClick:Cl([M,Ue]),onFocus:Cl([$,ze]),onMouseEnter:Cl([V,on]),onMouseLeave:Cl([L,Ef]),onTouchStart:Cl([D,Ut]),disabled:!!N,target:C,...ht&&{style:ht},...je&&{className:je},...N&&JD,...Te&&WD,...be&&It&&ej}}const om={},XD={className:"active"},JD={role:"link","aria-disabled":!0},WD={"data-status":"active","aria-current":"page"},ej={"data-transitioning":"transitioning"},Tl=new WeakMap,tj={rootMargin:"100px"},Cl=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function nj(e,t,n,o){if(!o)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function rj(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const Ls=S.forwardRef((e,t)=>{const{_asChild:n,...o}=e,{type:i,...l}=KD(o,t),u=typeof o.children=="function"?o.children({isActive:l["data-status"]==="active"}):o.children;if(!n){const{disabled:f,...h}=l;return S.createElement("a",h,u)}return S.createElement(n,l,u)});function oj(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let sj=class extends rE{constructor(t){super(t),this.useMatch=n=>Ir({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ir({...n,from:this.id,select:o=>n?.select?n.select(o.context):o.context}),this.useSearch=n=>Ng({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Ag({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Rg({...n,from:this.id}),this.useLoaderData=n=>Cg({...n,from:this.id}),this.useNavigate=()=>Gd({from:this.fullPath}),this.Link=tn.forwardRef((n,o)=>b.jsx(Ls,{ref:o,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function ij(e){return new sj(e)}class aj extends qk{constructor(t){super(t),this.useMatch=n=>Ir({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ir({...n,from:this.id,select:o=>n?.select?n.select(o.context):o.context}),this.useSearch=n=>Ng({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Ag({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Rg({...n,from:this.id}),this.useLoaderData=n=>Cg({...n,from:this.id}),this.useNavigate=()=>Gd({from:this.fullPath}),this.Link=tn.forwardRef((n,o)=>b.jsx(Ls,{ref:o,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function lj(e){return new aj(e)}function ir(e){return typeof e=="object"?new Rx(e,{silent:!0}).createRoute(e):new Rx(e,{silent:!0}).createRoute}class Rx{constructor(t,n){this.path=t,this.createRoute=o=>{this.silent;const i=ij(o);return i.isRoot=!1,i},this.silent=n?.silent}}class Ax{constructor(t){this.useMatch=n=>Ir({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ir({from:this.options.id,select:o=>n?.select?n.select(o.context):o.context}),this.useSearch=n=>Ng({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Ag({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Rg({...n,from:this.options.id}),this.useLoaderData=n=>Cg({...n,from:this.options.id}),this.useNavigate=()=>{const n=rn();return Gd({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function Nx(e){return typeof e=="object"?new Ax(e):t=>new Ax({id:e,...t})}function jr(e,t){let n,o,i,l;const u=()=>(n||(n=e().then(h=>{n=void 0,o=h[t]}).catch(h=>{if(i=h,QO(i)&&i instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const p=`tanstack_router_reload:${i.message}`;sessionStorage.getItem(p)||(sessionStorage.setItem(p,"1"),l=!0)}})),n),f=function(p){if(l)throw window.location.reload(),new Promise(()=>{});if(i)throw i;if(!o)if(gd)gd(u());else throw u();return S.createElement(o,p)};return f.preload=u,f}function cj(){const e=rn(),t=S.useRef({router:e,mounted:!1}),[n,o]=S.useState(!1),{hasPendingMatches:i,isLoading:l}=xt({select:v=>({isLoading:v.isLoading,hasPendingMatches:v.matches.some(w=>w.status==="pending")}),structuralSharing:!0}),u=Jp(l),f=l||n||i,h=Jp(f),p=l||i,y=Jp(p);return e.startTransition=v=>{o(!0),S.startTransition(()=>{v(),o(!1)})},S.useEffect(()=>{const v=e.history.subscribe(e.load),w=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return lo(e.latestLocation.publicHref)!==lo(w.publicHref)&&e.commitLocation({...w,replace:!0}),()=>{v()}},[e,e.history]),Pu(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(w){console.error(w)}})()},[e]),Pu(()=>{u&&!l&&e.emit({type:"onLoad",...$s(e.state)})},[u,e,l]),Pu(()=>{y&&!p&&e.emit({type:"onBeforeRouteMount",...$s(e.state)})},[p,y,e]),Pu(()=>{if(h&&!f){const v=$s(e.state);e.emit({type:"onResolved",...v}),e.__store.setState(w=>({...w,status:"idle",resolvedLocation:w.location})),v.hrefChanged&&wk(e)}},[f,h,e]),null}function uj(e){const t=xt({select:n=>`not-found-${n.location.pathname}-${n.status}`});return b.jsx(Eg,{getResetKey:()=>t,onCatch:(n,o)=>{if(ln(n))e.onCatch?.(n,o);else throw n},errorComponent:({error:n})=>{if(ln(n))return e.fallback?.(n);throw n},children:e.children})}function dj(){return b.jsx("p",{children:"Not Found"})}function Zi(e){return b.jsx(b.Fragment,{children:e.children})}function $E(e,t,n){return t.options.notFoundComponent?b.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?b.jsx(e.options.defaultNotFoundComponent,{...n}):b.jsx(dj,{})}function fj(){return rn().isScrollRestoring,null}const FE=S.memo(function({matchId:t}){const n=rn(),o=xt({select:x=>{const C=x.matches.findIndex(k=>k.id===t),N=x.matches[C];return _n(N),{routeId:N.routeId,ssr:N.ssr,_displayPending:N._displayPending,resetKey:x.loadedAt,parentRouteId:x.matches[C-1]?.routeId}},structuralSharing:!0}),i=n.routesById[o.routeId],l=i.options.pendingComponent??n.options.defaultPendingComponent,u=l?b.jsx(l,{}):null,f=i.options.errorComponent??n.options.defaultErrorComponent,h=i.options.onCatch??n.options.defaultOnCatch,p=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,y=o.ssr===!1||o.ssr==="data-only",v=(!i.isRoot||i.options.wrapInSuspense||y)&&(i.options.wrapInSuspense??l??(i.options.errorComponent?.preload||y))?S.Suspense:Zi,w=f?Eg:Zi,_=p?uj:Zi,R=i.isRoot?i.options.shellComponent??Zi:Zi;return b.jsxs(R,{children:[b.jsx(Qd.Provider,{value:t,children:b.jsx(v,{fallback:u,children:b.jsx(w,{getResetKey:()=>o.resetKey,errorComponent:f||Tg,onCatch:(x,C)=>{if(ln(x))throw x;h?.(x,C)},children:b.jsx(_,{fallback:x=>{if(!p||x.routeId&&x.routeId!==o.routeId||!x.routeId&&!i.isRoot)throw x;return S.createElement(p,x)},children:y||o._displayPending?b.jsx(FD,{fallback:u,children:b.jsx(Ox,{matchId:t})}):b.jsx(Ox,{matchId:t})})})})}),o.parentRouteId===rr&&n.options.scrollRestoration?b.jsxs(b.Fragment,{children:[b.jsx(hj,{}),b.jsx(fj,{})]}):null]})});function hj(){const e=rn(),t=S.useRef(void 0);return b.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...$s(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const Ox=S.memo(function({matchId:t}){const n=rn(),{match:o,key:i,routeId:l}=xt({select:h=>{const p=h.matches.find(R=>R.id===t),y=p.routeId,w=(n.routesById[y].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:y,loaderDeps:p.loaderDeps,params:p._strictParams,search:p._strictSearch});return{key:w?JSON.stringify(w):void 0,routeId:y,match:{id:p.id,status:p.status,error:p.error,invalid:p.invalid,_forcePending:p._forcePending,_displayPending:p._displayPending}}},structuralSharing:!0}),u=n.routesById[l],f=S.useMemo(()=>{const h=u.options.component??n.options.defaultComponent;return h?b.jsx(h,{},i):b.jsx(UE,{})},[i,u.options.component,n.options.defaultComponent]);if(o._displayPending)throw n.getMatch(o.id)?._nonReactive.displayPendingPromise;if(o._forcePending)throw n.getMatch(o.id)?._nonReactive.minPendingPromise;if(o.status==="pending"){const h=u.options.pendingMinMs??n.options.defaultPendingMinMs;if(h){const p=n.getMatch(o.id);if(p&&!p._nonReactive.minPendingPromise){const y=Us();p._nonReactive.minPendingPromise=y,setTimeout(()=>{y.resolve(),p._nonReactive.minPendingPromise=void 0},h)}}throw n.getMatch(o.id)?._nonReactive.loadPromise}if(o.status==="notFound")return _n(ln(o.error)),$E(n,u,o.error);if(o.status==="redirected")throw _n($n(o.error)),n.getMatch(o.id)?._nonReactive.loadPromise;if(o.status==="error")throw o.error;return f}),UE=S.memo(function(){const t=rn(),n=S.useContext(Qd),o=xt({select:p=>p.matches.find(y=>y.id===n)?.routeId}),i=t.routesById[o],l=xt({select:p=>{const v=p.matches.find(w=>w.id===n);return _n(v),v.globalNotFound}}),u=xt({select:p=>{const y=p.matches,v=y.findIndex(w=>w.id===n);return y[v+1]?.id}}),f=t.options.defaultPendingComponent?b.jsx(t.options.defaultPendingComponent,{}):null;if(l)return $E(t,i,void 0);if(!u)return null;const h=b.jsx(FE,{matchId:u});return o===rr?b.jsx(S.Suspense,{fallback:f,children:h}):h});function pj(){const e=rn(),n=e.routesById[rr].options.pendingComponent??e.options.defaultPendingComponent,o=n?b.jsx(n,{}):null,i=typeof document<"u"&&e.ssr?Zi:S.Suspense,l=b.jsxs(i,{fallback:o,children:[b.jsx(cj,{}),b.jsx(mj,{})]});return e.options.InnerWrap?b.jsx(e.options.InnerWrap,{children:l}):l}function mj(){const e=rn(),t=xt({select:i=>i.matches[0]?.id}),n=xt({select:i=>i.loadedAt}),o=t?b.jsx(FE,{matchId:t}):null;return b.jsx(Qd.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?o:b.jsx(Eg,{getResetKey:()=>n,errorComponent:Tg,onCatch:i=>{i.message||i.toString()},children:o})})}const gj=e=>new yj(e);class yj extends Dk{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=ir,globalThis.createLazyFileRoute=Nx):typeof window<"u"&&(window.createFileRoute=ir,window.createLazyFileRoute=Nx);function vj({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const o=PE(),i=b.jsx(o.Provider,{value:e,children:t});return e.options.Wrap?b.jsx(e.options.Wrap,{children:i}):i}function bj({router:e,...t}){return b.jsx(vj,{router:e,...t,children:b.jsx(pj,{})})}function BE({tag:e,attrs:t,children:n,nonce:o}){switch(e){case"title":return b.jsx("title",{...t,suppressHydrationWarning:!0,children:n});case"meta":return b.jsx("meta",{...t,suppressHydrationWarning:!0});case"link":return b.jsx("link",{...t,nonce:o,suppressHydrationWarning:!0});case"style":return b.jsx("style",{...t,dangerouslySetInnerHTML:{__html:n},nonce:o});case"script":return b.jsx(wj,{attrs:t,children:n});default:return null}}function wj({attrs:e,children:t}){rn(),S.useEffect(()=>{if(e?.src){const n=(()=>{try{const l=document.baseURI||window.location.href;return new URL(e.src,l).href}catch{return e.src}})();if(Array.from(document.querySelectorAll("script[src]")).find(l=>l.src===n))return;const i=document.createElement("script");for(const[l,u]of Object.entries(e))l!=="suppressHydrationWarning"&&u!==void 0&&u!==!1&&i.setAttribute(l,typeof u=="boolean"?"":String(u));return document.head.appendChild(i),()=>{i.parentNode&&i.parentNode.removeChild(i)}}if(typeof t=="string"){const n=typeof e?.type=="string"?e.type:"text/javascript",o=typeof e?.nonce=="string"?e.nonce:void 0;if(Array.from(document.querySelectorAll("script:not([src])")).find(u=>{if(!(u instanceof HTMLScriptElement))return!1;const f=u.getAttribute("type")??"text/javascript",h=u.getAttribute("nonce")??void 0;return u.textContent===t&&f===n&&h===o}))return;const l=document.createElement("script");if(l.textContent=t,e)for(const[u,f]of Object.entries(e))u!=="suppressHydrationWarning"&&f!==void 0&&f!==!1&&l.setAttribute(u,typeof f=="boolean"?"":String(f));return document.head.appendChild(l),()=>{l.parentNode&&l.parentNode.removeChild(l)}}},[e,t]);{const{src:n,...o}=e||{};return b.jsx("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:""},...o})}}const xj=()=>{const e=rn(),t=e.options.ssr?.nonce,n=xt({select:h=>h.matches.map(p=>p.meta).filter(Boolean)}),o=S.useMemo(()=>{const h=[],p={};let y;for(let v=n.length-1;v>=0;v--){const w=n[v];for(let _=w.length-1;_>=0;_--){const R=w[_];if(R)if(R.title)y||(y={tag:"title",children:R.title});else if("script:ld+json"in R)try{const x=JSON.stringify(R["script:ld+json"]);h.push({tag:"script",attrs:{type:"application/ld+json"},children:XO(x)})}catch{}else{const x=R.name??R.property;if(x){if(p[x])continue;p[x]=!0}h.push({tag:"meta",attrs:{...R,nonce:t}})}}}return y&&h.push(y),t&&h.push({tag:"meta",attrs:{property:"csp-nonce",content:t}}),h.reverse(),h},[n,t]),i=xt({select:h=>{const p=h.matches.map(w=>w.links).filter(Boolean).flat(1).map(w=>({tag:"link",attrs:{...w,nonce:t}})),y=e.ssr?.manifest,v=h.matches.map(w=>y?.routes[w.routeId]?.assets??[]).filter(Boolean).flat(1).filter(w=>w.tag==="link").map(w=>({tag:"link",attrs:{...w.attrs,suppressHydrationWarning:!0,nonce:t}}));return[...p,...v]},structuralSharing:!0}),l=xt({select:h=>{const p=[];return h.matches.map(y=>e.looseRoutesById[y.routeId]).forEach(y=>e.ssr?.manifest?.routes[y.id]?.preloads?.filter(Boolean).forEach(v=>{p.push({tag:"link",attrs:{rel:"modulepreload",href:v,nonce:t}})})),p},structuralSharing:!0}),u=xt({select:h=>h.matches.map(p=>p.styles).flat(1).filter(Boolean).map(({children:p,...y})=>({tag:"style",attrs:{...y,nonce:t},children:p})),structuralSharing:!0}),f=xt({select:h=>h.matches.map(p=>p.headScripts).flat(1).filter(Boolean).map(({children:p,...y})=>({tag:"script",attrs:{...y,nonce:t},children:p})),structuralSharing:!0});return Sj([...o,...l,...i,...u,...f],h=>JSON.stringify(h))};function Sj(e,t){const n=new Set;return e.filter(o=>{const i=t(o);return n.has(i)?!1:(n.add(i),!0)})}function _j(){const e=xj(),n=rn().options.ssr?.nonce;return b.jsx(b.Fragment,{children:e.map(o=>S.createElement(BE,{...o,key:`tsr-meta-${JSON.stringify(o)}`,nonce:n}))})}const Ej=()=>{const e=rn(),t=e.options.ssr?.nonce,n=xt({select:u=>{const f=[],h=e.ssr?.manifest;return h?(u.matches.map(p=>e.looseRoutesById[p.routeId]).forEach(p=>h.routes[p.id]?.assets?.filter(y=>y.tag==="script").forEach(y=>{f.push({tag:"script",attrs:{...y.attrs,nonce:t},children:y.children})})),f):[]},structuralSharing:!0}),{scripts:o}=xt({select:u=>({scripts:u.matches.map(f=>f.scripts).flat(1).filter(Boolean).map(({children:f,...h})=>({tag:"script",attrs:{...h,suppressHydrationWarning:!0,nonce:t},children:f}))}),structuralSharing:!0});let i;e.serverSsr&&(i=e.serverSsr.takeBufferedScripts());const l=[...o,...n];return i&&l.unshift(i),b.jsx(b.Fragment,{children:l.map((u,f)=>S.createElement(BE,{...u,key:`tsr-scripts-${u.tag}-${f}`}))})};function qE(e){if(Array.isArray(e))return e.flatMap(y=>qE(y));if(typeof e!="string")return[];const t=[];let n=0,o,i,l,u,f;const h=()=>{for(;n<e.length&&/\s/.test(e.charAt(n));)n+=1;return n<e.length},p=()=>(i=e.charAt(n),i!=="="&&i!==";"&&i!==",");for(;n<e.length;){for(o=n,f=!1;h();)if(i=e.charAt(n),i===","){for(l=n,n+=1,h(),u=n;n<e.length&&p();)n+=1;n<e.length&&e.charAt(n)==="="?(f=!0,n=u,t.push(e.slice(o,l)),o=n):n=l+1}else n+=1;(!f||n>=e.length)&&t.push(e.slice(o))}return t}function Tj(e){return e instanceof Headers?e:Array.isArray(e)?new Headers(e):typeof e=="object"?new Headers(e):null}function Cj(...e){return e.reduce((t,n)=>{const o=Tj(n);if(!o)return t;for(const[i,l]of o.entries())i==="set-cookie"?qE(l).forEach(f=>t.append("set-cookie",f)):t.set(i,l);return t},new Headers)}function Rj(e,t){e.id=t.i,e.__beforeLoadContext=t.b,e.loaderData=t.l,e.status=t.s,e.ssr=t.ssr,e.updatedAt=t.u,e.error=t.e}async function Aj(e){_n(window.$_TSR);const t=e.options.serializationAdapters;if(t?.length){const x=new Map;t.forEach(C=>{x.set(C.key,C.fromSerializable)}),window.$_TSR.t=x,window.$_TSR.buffer.forEach(C=>C())}window.$_TSR.initialized=!0,_n(window.$_TSR.router);const{manifest:n,dehydratedData:o,lastMatchId:i}=window.$_TSR.router;e.ssr={manifest:n};const u=document.querySelector('meta[property="csp-nonce"]')?.content;e.options.ssr={nonce:u};const f=e.matchRoutes(e.state.location),h=Promise.all(f.map(x=>{const C=e.looseRoutesById[x.routeId];return e.loadRouteChunk(C)}));function p(x){const N=e.looseRoutesById[x.routeId].options.pendingMinMs??e.options.defaultPendingMinMs;if(N){const k=Us();x._nonReactive.minPendingPromise=k,x._forcePending=!0,setTimeout(()=>{k.resolve(),e.updateMatch(x.id,O=>(O._nonReactive.minPendingPromise=void 0,{...O,_forcePending:void 0}))},N)}}function y(x){const C=e.looseRoutesById[x.routeId];C&&(C.options.ssr=x.ssr)}let v;f.forEach(x=>{const C=window.$_TSR.router.matches.find(N=>N.i===x.id);if(!C){x._nonReactive.dehydrated=!1,x.ssr=!1,y(x);return}Rj(x,C),y(x),x._nonReactive.dehydrated=x.ssr!==!1,(x.ssr==="data-only"||x.ssr===!1)&&v===void 0&&(v=x.index,p(x))}),e.__store.setState(x=>({...x,matches:f})),await e.options.hydrate?.(o),await Promise.all(e.state.matches.map(async x=>{try{const C=e.looseRoutesById[x.routeId],k=e.state.matches[x.index-1]?.context??e.options.context;if(C.options.context){const V={deps:x.loaderDeps,params:x.params,context:k??{},location:e.state.location,navigate:L=>e.navigate({...L,_fromLocation:e.state.location}),buildLocation:e.buildLocation,cause:x.cause,abortController:x.abortController,preload:!1,matches:f};x.__routeContext=C.options.context(V)??void 0}x.context={...k,...x.__routeContext,...x.__beforeLoadContext};const O={ssr:e.options.ssr,matches:e.state.matches,match:x,params:x.params,loaderData:x.loaderData},M=await C.options.head?.(O),$=await C.options.scripts?.(O);x.meta=M?.meta,x.links=M?.links,x.headScripts=M?.scripts,x.styles=M?.styles,x.scripts=$}catch(C){if(ln(C))x.error={isNotFound:!0},console.error(`NotFound error during hydration for routeId: ${x.routeId}`,C);else throw x.error=C,console.error(`Error during hydration for route ${x.routeId}:`,C),C}}));const w=f[f.length-1].id!==i;if(!f.some(x=>x.ssr===!1)&&!w)return f.forEach(x=>{x._nonReactive.dehydrated=void 0}),h;const R=Promise.resolve().then(()=>e.load()).catch(x=>{console.error("Error during router hydration:",x)});if(w){const x=f[1];_n(x),p(x),x._displayPending=!0,x._nonReactive.displayPendingPromise=R,R.then(()=>{Ji(()=>{e.__store.state.status==="pending"&&e.__store.setState(C=>({...C,status:"idle",resolvedLocation:C.location})),e.updateMatch(x.id,C=>({...C,_displayPending:void 0,displayPendingPromise:void 0}))})})}return h}const Nj="__TSS_CONTEXT",Pm=Symbol.for("TSS_SERVER_FUNCTION"),kx=Symbol.for("TSS_SERVER_FUNCTION_FACTORY"),Oj="x-tss-serialized",kj="x-tss-raw",VE="application/x-tss-framed",so={JSON:0,CHUNK:1,END:2,ERROR:3},Fi=9,Mx=1,Mj=/;\s*v=(\d+)/;function Ij(e){const t=e.match(Mj);return t?parseInt(t[1],10):void 0}function Dj(e){const t=Ij(e);if(t!==void 0&&t!==Mx)throw new Error(`Incompatible framed protocol version: server=${t}, client=${Mx}. Please ensure client and server are using compatible versions.`)}const Og=()=>window.__TSS_START_OPTIONS__;function jj(){return[...Og()?.serializationAdapters?.map(yD)??[],...MD]}const Ix=new TextDecoder,zj=new Uint8Array(0),Dx=16*1024*1024,jx=32*1024*1024,zx=1024,Lx=1e5;function Lj(e){const t=new Map,n=new Map,o=new Set;let i=!1,l=null,u=0,f;const h=new ReadableStream({start(v){f=v},cancel(){i=!0;try{l?.cancel()}catch{}t.forEach(v=>{try{v.error(new Error("Framed response cancelled"))}catch{}}),t.clear(),n.clear(),o.clear()}});function p(v){const w=n.get(v);if(w)return w;if(o.has(v))return new ReadableStream({start(R){R.close()}});if(n.size>=zx)throw new Error(`Too many raw streams in framed response (max ${zx})`);const _=new ReadableStream({start(R){t.set(v,R)},cancel(){o.add(v),t.delete(v),n.delete(v)}});return n.set(v,_),_}function y(v){return p(v),t.get(v)}return(async()=>{const v=e.getReader();l=v;const w=[];let _=0;function R(){if(_<Fi)return null;const C=w[0];if(C.length>=Fi){const L=C[0],D=(C[1]<<24|C[2]<<16|C[3]<<8|C[4])>>>0,Y=(C[5]<<24|C[6]<<16|C[7]<<8|C[8])>>>0;return{type:L,streamId:D,length:Y}}const N=new Uint8Array(Fi);let k=0,O=Fi;for(let L=0;L<w.length&&O>0;L++){const D=w[L],Y=Math.min(D.length,O);N.set(D.subarray(0,Y),k),k+=Y,O-=Y}const M=N[0],$=(N[1]<<24|N[2]<<16|N[3]<<8|N[4])>>>0,V=(N[5]<<24|N[6]<<16|N[7]<<8|N[8])>>>0;return{type:M,streamId:$,length:V}}function x(C){if(C===0)return zj;const N=new Uint8Array(C);let k=0,O=C;for(;O>0&&w.length>0;){const M=w[0];if(!M)break;const $=Math.min(M.length,O);N.set(M.subarray(0,$),k),k+=$,O-=$,$===M.length?w.shift():w[0]=M.subarray($)}return _-=C,N}try{for(;;){const{done:C,value:N}=await v.read();if(i||C)break;if(N){if(_+N.length>jx)throw new Error(`Framed response buffer exceeded ${jx} bytes`);for(w.push(N),_+=N.length;;){const k=R();if(!k)break;const{type:O,streamId:M,length:$}=k;if(O!==so.JSON&&O!==so.CHUNK&&O!==so.END&&O!==so.ERROR)throw new Error(`Unknown frame type: ${O}`);if(O===so.JSON){if(M!==0)throw new Error("Invalid JSON frame streamId (expected 0)")}else if(M===0)throw new Error("Invalid raw frame streamId (expected non-zero)");if($>Dx)throw new Error(`Frame payload too large: ${$} bytes (max ${Dx})`);const V=Fi+$;if(_<V)break;if(++u>Lx)throw new Error(`Too many frames in framed response (max ${Lx})`);x(Fi);const L=x($);switch(O){case so.JSON:{try{f.enqueue(Ix.decode(L))}catch{}break}case so.CHUNK:{const D=y(M);D&&D.enqueue(L);break}case so.END:{const D=y(M);if(o.add(M),D){try{D.close()}catch{}t.delete(M)}break}case so.ERROR:{const D=y(M);if(o.add(M),D){const Y=Ix.decode(L);D.error(new Error(Y)),t.delete(M)}break}}}}}if(_!==0)throw new Error("Incomplete frame at end of framed response");try{f.close()}catch{}t.forEach(C=>{try{C.close()}catch{}}),t.clear()}catch(C){try{f.error(C)}catch{}t.forEach(N=>{try{N.error(C)}catch{}}),t.clear()}finally{try{v.releaseLock()}catch{}l=null}})(),{getOrCreateStream:p,jsonChunks:h}}let ra=null;const Pj=Object.prototype.hasOwnProperty;function HE(e){for(const t in e)if(Pj.call(e,t))return!0;return!1}async function $j(e,t,n){ra||(ra=jj());const i=t[0],l=i.fetch??n,u=i.data instanceof FormData?"formData":"payload",f=i.headers?new Headers(i.headers):new Headers;if(f.set("x-tsr-serverFn","true"),u==="payload"&&f.set("accept",`${VE}, application/x-ndjson, application/json`),i.method==="GET"){if(u==="formData")throw new Error("FormData is not supported with GET requests");const p=await ZE(i);if(p!==void 0){const y=Z_({payload:p});e.includes("?")?e+=`&${y}`:e+=`?${y}`}}let h;if(i.method==="POST"){const p=await Fj(i);p?.contentType&&f.set("content-type",p.contentType),h=p?.body}return await Uj(async()=>l(e,{method:i.method,headers:f,signal:i.signal,body:h}))}async function ZE(e){let t=!1;const n={};if(e.data!==void 0&&(t=!0,n.data=e.data),e.context&&HE(e.context)&&(t=!0,n.context=e.context),t)return QE(n)}async function QE(e){return JSON.stringify(await Promise.resolve(gD(e,{plugins:ra})))}async function Fj(e){if(e.data instanceof FormData){let n;return e.context&&HE(e.context)&&(n=await QE(e.context)),n!==void 0&&e.data.set(Nj,n),{body:e.data}}const t=await ZE(e);if(t)return{body:t,contentType:"application/json"}}async function Uj(e){let t;try{t=await e()}catch(i){if(i instanceof Response)t=i;else throw console.log(i),i}if(t.headers.get(kj)==="true")return t;const n=t.headers.get("content-type");if(_n(n),!!t.headers.get(Oj)){let i;if(n.includes(VE)){if(Dj(n),!t.body)throw new Error("No response body for framed response");const{getOrCreateStream:l,jsonChunks:u}=Lj(t.body),h=[kD(l),...ra||[]],p=new Map;i=await qj({jsonStream:u,onMessage:y=>Xp(y,{refs:p,plugins:h}),onError(y,v){console.error(y,v)}})}else if(n.includes("application/x-ndjson")){const l=new Map;i=await Bj({response:t,onMessage:u=>Xp(u,{refs:l,plugins:ra}),onError(u,f){console.error(u,f)}})}else if(n.includes("application/json")){const l=await t.json();i=Xp(l,{plugins:ra})}if(_n(i),i instanceof Error)throw i;return i}if(n.includes("application/json")){const i=await t.json(),l=G_(i);if(l)throw l;if(ln(i))throw i;return i}if(!t.ok)throw new Error(await t.text());return t}async function Bj({response:e,onMessage:t,onError:n}){if(!e.body)throw new Error("No response body");const o=e.body.pipeThrough(new TextDecoderStream).getReader();let i="",l=!1,u;for(;!l;){const{value:f,done:h}=await o.read();if(f&&(i+=f),i.length===0&&h)throw new Error("Stream ended before first object");if(i.endsWith(`
13
+ `)){const p=i.split(`
14
+ `).filter(Boolean),y=p[0];if(!y)throw new Error("No JSON line in the first chunk");u=JSON.parse(y),l=!0,i=p.slice(1).join(`
15
+ `)}else{const p=i.indexOf(`
16
+ `);if(p>=0){const y=i.slice(0,p).trim();i=i.slice(p+1),y.length>0&&(u=JSON.parse(y),l=!0)}}}return(async()=>{try{for(;;){const{value:f,done:h}=await o.read();f&&(i+=f);const p=i.lastIndexOf(`
17
+ `);if(p>=0){const y=i.slice(0,p);i=i.slice(p+1);const v=y.split(`
18
+ `).filter(Boolean);for(const w of v)try{t(JSON.parse(w))}catch(_){n?.(`Invalid JSON line: ${w}`,_)}}if(h)break}}catch(f){n?.("Stream processing error:",f)}})(),t(u)}async function qj({jsonStream:e,onMessage:t,onError:n}){const o=e.getReader(),{value:i,done:l}=await o.read();if(l||!i)throw new Error("Stream ended before first object");const u=JSON.parse(i);return(async()=>{try{for(;;){const{value:f,done:h}=await o.read();if(h)break;if(f)try{t(JSON.parse(f))}catch(p){n?.(`Invalid JSON: ${f}`,p)}}}catch(f){n?.("Stream processing error:",f)}})(),t(u)}function GE(e){const t="/_serverFn/"+e;return Object.assign((...i)=>{const l=Og()?.serverFns?.fetch;return $j(t,i,l??fetch)},{url:t,serverFnMeta:{id:e},[Pm]:!0})}const Vj={key:"$TSS/serverfn",test:e=>typeof e!="function"||!(Pm in e)?!1:!!e[Pm],toSerializable:({serverFnMeta:e})=>({functionId:e.id}),fromSerializable:({functionId:e})=>GE(e)};var Nr=[],nr=[],Hj=Uint8Array,sm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Ui=0,Zj=sm.length;Ui<Zj;++Ui)Nr[Ui]=sm[Ui],nr[sm.charCodeAt(Ui)]=Ui;nr[45]=62;nr[95]=63;function Qj(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var o=n===t?0:4-n%4;return[n,o]}function Gj(e,t,n){return(t+n)*3/4-n}function Vl(e){var t,n=Qj(e),o=n[0],i=n[1],l=new Hj(Gj(e,o,i)),u=0,f=i>0?o-4:o,h;for(h=0;h<f;h+=4)t=nr[e.charCodeAt(h)]<<18|nr[e.charCodeAt(h+1)]<<12|nr[e.charCodeAt(h+2)]<<6|nr[e.charCodeAt(h+3)],l[u++]=t>>16&255,l[u++]=t>>8&255,l[u++]=t&255;return i===2&&(t=nr[e.charCodeAt(h)]<<2|nr[e.charCodeAt(h+1)]>>4,l[u++]=t&255),i===1&&(t=nr[e.charCodeAt(h)]<<10|nr[e.charCodeAt(h+1)]<<4|nr[e.charCodeAt(h+2)]>>2,l[u++]=t>>8&255,l[u++]=t&255),l}function Yj(e){return Nr[e>>18&63]+Nr[e>>12&63]+Nr[e>>6&63]+Nr[e&63]}function Kj(e,t,n){for(var o,i=[],l=t;l<n;l+=3)o=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(e[l+2]&255),i.push(Yj(o));return i.join("")}function Hl(e){for(var t,n=e.length,o=n%3,i=[],l=16383,u=0,f=n-o;u<f;u+=l)i.push(Kj(e,u,u+l>f?f:u+l));return o===1?(t=e[n-1],i.push(Nr[t>>2]+Nr[t<<4&63]+"==")):o===2&&(t=(e[n-2]<<8)+e[n-1],i.push(Nr[t>>10]+Nr[t>>4&63]+Nr[t<<2&63]+"=")),i.join("")}function or(e){if(e===void 0)return{};if(!YE(e))throw new Error(`The arguments to a Convex function must be an object. Received: ${e}`);return e}function Xj(e){if(typeof e>"u")throw new Error("Client created with undefined deployment address. If you used an environment variable, check that it's set.");if(typeof e!="string")throw new Error(`Invalid deployment address: found ${e}".`);if(!(e.startsWith("http:")||e.startsWith("https:")))throw new Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${e}".`);try{new URL(e)}catch{throw new Error(`Invalid deployment address: "${e}" is not a valid URL. If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}if(e.endsWith(".convex.site"))throw new Error(`Invalid deployment address: "${e}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}function YE(e){const t=typeof e=="object",n=Object.getPrototypeOf(e),o=n===null||n===Object.prototype||n?.constructor?.name==="Object";return t&&o}const KE=!0,ua=BigInt("-9223372036854775808"),kg=BigInt("9223372036854775807"),$m=BigInt("0"),Jj=BigInt("8"),Wj=BigInt("256");function XE(e){return Number.isNaN(e)||!Number.isFinite(e)||Object.is(e,-0)}function ez(e){e<$m&&(e-=ua+ua);let t=e.toString(16);t.length%2===1&&(t="0"+t);const n=new Uint8Array(new ArrayBuffer(8));let o=0;for(const i of t.match(/.{2}/g).reverse())n.set([parseInt(i,16)],o++),e>>=Jj;return Hl(n)}function tz(e){const t=Vl(e);if(t.byteLength!==8)throw new Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);let n=$m,o=$m;for(const i of t)n+=BigInt(i)*Wj**o,o++;return n>kg&&(n+=ua+ua),n}function nz(e){if(e<ua||kg<e)throw new Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);const t=new ArrayBuffer(8);return new DataView(t).setBigInt64(0,e,!0),Hl(new Uint8Array(t))}function rz(e){const t=Vl(e);if(t.byteLength!==8)throw new Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);return new DataView(t.buffer).getBigInt64(0,!0)}const oz=DataView.prototype.setBigInt64?nz:ez,sz=DataView.prototype.getBigInt64?rz:tz,Px=1024;function Fm(e){if(e.length>Px)throw new Error(`Field name ${e} exceeds maximum field name length ${Px}.`);if(e.startsWith("$"))throw new Error(`Field name ${e} starts with a '$', which is reserved.`);for(let t=0;t<e.length;t+=1){const n=e.charCodeAt(t);if(n<32||n>=127)throw new Error(`Field name ${e} has invalid character '${e[t]}': Field names can only contain non-control ASCII characters`)}}function nn(e){if(e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string")return e;if(Array.isArray(e))return e.map(o=>nn(o));if(typeof e!="object")throw new Error(`Unexpected type of ${e}`);const t=Object.entries(e);if(t.length===1){const o=t[0][0];if(o==="$bytes"){if(typeof e.$bytes!="string")throw new Error(`Malformed $bytes field on ${e}`);return Vl(e.$bytes).buffer}if(o==="$integer"){if(typeof e.$integer!="string")throw new Error(`Malformed $integer field on ${e}`);return sz(e.$integer)}if(o==="$float"){if(typeof e.$float!="string")throw new Error(`Malformed $float field on ${e}`);const i=Vl(e.$float);if(i.byteLength!==8)throw new Error(`Received ${i.byteLength} bytes, expected 8 for $float`);const u=new DataView(i.buffer).getFloat64(0,KE);if(!XE(u))throw new Error(`Float ${u} should be encoded as a number`);return u}if(o==="$set")throw new Error("Received a Set which is no longer supported as a Convex type.");if(o==="$map")throw new Error("Received a Map which is no longer supported as a Convex type.")}const n={};for(const[o,i]of Object.entries(e))Fm(o),n[o]=nn(i);return n}const $x=16384;function oa(e){const t=JSON.stringify(e,(n,o)=>o===void 0?"undefined":typeof o=="bigint"?`${o.toString()}n`:o);if(t.length>$x){const n="[...truncated]";let o=$x-n.length;const i=t.codePointAt(o-1);return i!==void 0&&i>65535&&(o-=1),t.substring(0,o)+n}return t}function Zl(e,t,n,o){if(e===void 0){const u=n&&` (present at path ${n} in original object ${oa(t)})`;throw new Error(`undefined is not a valid Convex value${u}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(e===null)return e;if(typeof e=="bigint"){if(e<ua||kg<e)throw new Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);return{$integer:oz(e)}}if(typeof e=="number")if(XE(e)){const u=new ArrayBuffer(8);return new DataView(u).setFloat64(0,e,KE),{$float:Hl(new Uint8Array(u))}}else return e;if(typeof e=="boolean"||typeof e=="string")return e;if(e instanceof ArrayBuffer)return{$bytes:Hl(new Uint8Array(e))};if(Array.isArray(e))return e.map((u,f)=>Zl(u,t,n+`[${f}]`,!1));if(e instanceof Set)throw new Error(im(n,"Set",[...e],t));if(e instanceof Map)throw new Error(im(n,"Map",[...e],t));if(!YE(e)){const u=e?.constructor?.name,f=u?`${u} `:"";throw new Error(im(n,f,e,t))}const i={},l=Object.entries(e);l.sort(([u,f],[h,p])=>u===h?0:u<h?-1:1);for(const[u,f]of l)f!==void 0?(Fm(u),i[u]=Zl(f,t,n+`.${u}`,!1)):o&&(Fm(u),i[u]=JE(f,t,n+`.${u}`));return i}function im(e,t,n,o){return e?`${t}${oa(n)} is not a supported Convex type (present at path ${e} in original object ${oa(o)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${t}${oa(n)} is not a supported Convex type.`}function JE(e,t,n){if(e===void 0)return{$undefined:null};if(t===void 0)throw new Error(`Programming error. Current value is ${oa(e)} but original value is undefined`);return Zl(e,t,n,!1)}function ut(e){return Zl(e,e,"",!1)}function ks(e){return JE(e,e,"")}function iz(e){return Zl(e,e,"",!0)}var az=Object.defineProperty,lz=(e,t,n)=>t in e?az(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ct=(e,t,n)=>lz(e,typeof t!="symbol"?t+"":t,n);const cz="https://docs.convex.dev/error#undefined-validator";function Ql(e,t){const n=t!==void 0?` for field "${t}"`:"";throw new Error(`A validator is undefined${n} in ${e}. This is often caused by circular imports. See ${cz} for details.`)}class Un{constructor({isOptional:t}){ct(this,"type"),ct(this,"fieldPaths"),ct(this,"isOptional"),ct(this,"isConvexValidator"),this.isOptional=t,this.isConvexValidator=!0}}class Mg extends Un{constructor({isOptional:t,tableName:n}){if(super({isOptional:t}),ct(this,"tableName"),ct(this,"kind","id"),typeof n!="string")throw new Error("v.id(tableName) requires a string");this.tableName=n}get json(){return{type:"id",tableName:this.tableName}}asOptional(){return new Mg({isOptional:"optional",tableName:this.tableName})}}class yd extends Un{constructor(){super(...arguments),ct(this,"kind","float64")}get json(){return{type:"number"}}asOptional(){return new yd({isOptional:"optional"})}}class vd extends Un{constructor(){super(...arguments),ct(this,"kind","int64")}get json(){return{type:"bigint"}}asOptional(){return new vd({isOptional:"optional"})}}class Ig extends Un{constructor(){super(...arguments),ct(this,"kind","boolean")}get json(){return{type:this.kind}}asOptional(){return new Ig({isOptional:"optional"})}}class Dg extends Un{constructor(){super(...arguments),ct(this,"kind","bytes")}get json(){return{type:this.kind}}asOptional(){return new Dg({isOptional:"optional"})}}class jg extends Un{constructor(){super(...arguments),ct(this,"kind","string")}get json(){return{type:this.kind}}asOptional(){return new jg({isOptional:"optional"})}}class zg extends Un{constructor(){super(...arguments),ct(this,"kind","null")}get json(){return{type:this.kind}}asOptional(){return new zg({isOptional:"optional"})}}class Lg extends Un{constructor(){super(...arguments),ct(this,"kind","any")}get json(){return{type:this.kind}}asOptional(){return new Lg({isOptional:"optional"})}}class Ms extends Un{constructor({isOptional:t,fields:n}){super({isOptional:t}),ct(this,"fields"),ct(this,"kind","object"),globalThis.Object.entries(n).forEach(([o,i])=>{if(i===void 0&&Ql("v.object()",o),!i.isConvexValidator)throw new Error("v.object() entries must be validators")}),this.fields=n}get json(){return{type:this.kind,value:globalThis.Object.fromEntries(globalThis.Object.entries(this.fields).map(([t,n])=>[t,{fieldType:n.json,optional:n.isOptional==="optional"}]))}}asOptional(){return new Ms({isOptional:"optional",fields:this.fields})}omit(...t){const n={...this.fields};for(const o of t)delete n[o];return new Ms({isOptional:this.isOptional,fields:n})}pick(...t){const n={};for(const o of t)n[o]=this.fields[o];return new Ms({isOptional:this.isOptional,fields:n})}partial(){const t={};for(const[n,o]of globalThis.Object.entries(this.fields))t[n]=o.asOptional();return new Ms({isOptional:this.isOptional,fields:t})}extend(t){return new Ms({isOptional:this.isOptional,fields:{...this.fields,...t}})}}class Pg extends Un{constructor({isOptional:t,value:n}){if(super({isOptional:t}),ct(this,"value"),ct(this,"kind","literal"),typeof n!="string"&&typeof n!="boolean"&&typeof n!="number"&&typeof n!="bigint")throw new Error("v.literal(value) must be a string, number, or boolean");this.value=n}get json(){return{type:this.kind,value:ut(this.value)}}asOptional(){return new Pg({isOptional:"optional",value:this.value})}}class $g extends Un{constructor({isOptional:t,element:n}){super({isOptional:t}),ct(this,"element"),ct(this,"kind","array"),n===void 0&&Ql("v.array()"),this.element=n}get json(){return{type:this.kind,value:this.element.json}}asOptional(){return new $g({isOptional:"optional",element:this.element})}}class Fg extends Un{constructor({isOptional:t,key:n,value:o}){if(super({isOptional:t}),ct(this,"key"),ct(this,"value"),ct(this,"kind","record"),n===void 0&&Ql("v.record()","key"),o===void 0&&Ql("v.record()","value"),n.isOptional==="optional")throw new Error("Record validator cannot have optional keys");if(o.isOptional==="optional")throw new Error("Record validator cannot have optional values");if(!n.isConvexValidator||!o.isConvexValidator)throw new Error("Key and value of v.record() but be validators");this.key=n,this.value=o}get json(){return{type:this.kind,keys:this.key.json,values:{fieldType:this.value.json,optional:!1}}}asOptional(){return new Fg({isOptional:"optional",key:this.key,value:this.value})}}class Ug extends Un{constructor({isOptional:t,members:n}){super({isOptional:t}),ct(this,"members"),ct(this,"kind","union"),n.forEach((o,i)=>{if(o===void 0&&Ql("v.union()",`member at index ${i}`),!o.isConvexValidator)throw new Error("All members of v.union() must be validators")}),this.members=n}get json(){return{type:this.kind,value:this.members.map(t=>t.json)}}asOptional(){return new Ug({isOptional:"optional",members:this.members})}}function WE(e){return!!e.isConvexValidator}function e1(e){return WE(e)?e:c.object(e)}const c={id:e=>new Mg({isOptional:"required",tableName:e}),null:()=>new zg({isOptional:"required"}),number:()=>new yd({isOptional:"required"}),float64:()=>new yd({isOptional:"required"}),bigint:()=>new vd({isOptional:"required"}),int64:()=>new vd({isOptional:"required"}),boolean:()=>new Ig({isOptional:"required"}),string:()=>new jg({isOptional:"required"}),bytes:()=>new Dg({isOptional:"required"}),literal:e=>new Pg({isOptional:"required",value:e}),array:e=>new $g({isOptional:"required",element:e}),object:e=>new Ms({isOptional:"required",fields:e}),record:(e,t)=>new Fg({isOptional:"required",key:e,value:t}),union:(...e)=>new Ug({isOptional:"required",members:e}),any:()=>new Lg({isOptional:"required"}),optional:e=>e.asOptional(),nullable:e=>c.union(e,c.null())};var uz=Object.defineProperty,dz=(e,t,n)=>t in e?uz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,am=(e,t,n)=>dz(e,typeof t!="symbol"?t+"":t,n),Fx,Ux;const fz=Symbol.for("ConvexError");class bd extends(Ux=Error,Fx=fz,Ux){constructor(t){super(typeof t=="string"?t:oa(t)),am(this,"name","ConvexError"),am(this,"data"),am(this,Fx,!0),this.data=t}}const t1=()=>Array.from({length:4},()=>0);t1();t1();const gr="1.31.6";var hz=Object.defineProperty,pz=(e,t,n)=>t in e?hz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bx=(e,t,n)=>pz(e,typeof t!="symbol"?t+"":t,n);const mz="color:rgb(0, 145, 255)";function n1(e){switch(e){case"query":return"Q";case"mutation":return"M";case"action":return"A";case"any":return"?"}}class r1{constructor(t){Bx(this,"_onLogLineFuncs"),Bx(this,"_verbose"),this._onLogLineFuncs={},this._verbose=t.verbose}addLogLineListener(t){let n=Math.random().toString(36).substring(2,15);for(let o=0;o<10&&this._onLogLineFuncs[n]!==void 0;o++)n=Math.random().toString(36).substring(2,15);return this._onLogLineFuncs[n]=t,()=>{delete this._onLogLineFuncs[n]}}logVerbose(...t){if(this._verbose)for(const n of Object.values(this._onLogLineFuncs))n("debug",`${new Date().toISOString()}`,...t)}log(...t){for(const n of Object.values(this._onLogLineFuncs))n("info",...t)}warn(...t){for(const n of Object.values(this._onLogLineFuncs))n("warn",...t)}error(...t){for(const n of Object.values(this._onLogLineFuncs))n("error",...t)}}function o1(e){const t=new r1(e);return t.addLogLineListener((n,...o)=>{switch(n){case"debug":console.debug(...o);break;case"info":console.log(...o);break;case"warn":console.warn(...o);break;case"error":console.error(...o);break;default:console.log(...o)}}),t}function s1(e){return new r1(e)}function wd(e,t,n,o,i){const l=n1(n);if(typeof i=="object"&&(i=`ConvexError ${JSON.stringify(i.errorData,null,2)}`),t==="info"){const u=i.match(/^\[.*?\] /);if(u===null){e.error(`[CONVEX ${l}(${o})] Could not parse console.log`);return}const f=i.slice(1,u[0].length-2),h=i.slice(u[0].length);e.log(`%c[CONVEX ${l}(${o})] [${f}]`,mz,h)}else e.error(`[CONVEX ${l}(${o})] ${i}`)}function gz(e,t){const n=`[CONVEX FATAL ERROR] ${t}`;return e.error(n),new Error(n)}function Yi(e,t,n){return`[CONVEX ${n1(e)}(${t})] ${n.errorMessage}
19
+ Called by client`}function Um(e,t){return t.data=e.errorData,t}function Vs(e){const t=e.split(":");let n,o;return t.length===1?(n=t[0],o="default"):(n=t.slice(0,t.length-1).join(":"),o=t[t.length-1]),n.endsWith(".js")&&(n=n.slice(0,-3)),`${n}:${o}`}function Fs(e,t){return JSON.stringify({udfPath:Vs(e),args:ut(t)})}function qx(e,t,n){const{initialNumItems:o,id:i}=n;return JSON.stringify({type:"paginated",udfPath:Vs(e),args:ut(t),options:ut({initialNumItems:o,id:i})})}var yz=Object.defineProperty,vz=(e,t,n)=>t in e?yz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cr=(e,t,n)=>vz(e,typeof t!="symbol"?t+"":t,n);class bz{constructor(){Cr(this,"nextQueryId"),Cr(this,"querySetVersion"),Cr(this,"querySet"),Cr(this,"queryIdToToken"),Cr(this,"identityVersion"),Cr(this,"auth"),Cr(this,"outstandingQueriesOlderThanRestart"),Cr(this,"outstandingAuthOlderThanRestart"),Cr(this,"paused"),Cr(this,"pendingQuerySetModifications"),this.nextQueryId=0,this.querySetVersion=0,this.identityVersion=0,this.querySet=new Map,this.queryIdToToken=new Map,this.outstandingQueriesOlderThanRestart=new Set,this.outstandingAuthOlderThanRestart=!1,this.paused=!1,this.pendingQuerySetModifications=new Map}hasSyncedPastLastReconnect(){return this.outstandingQueriesOlderThanRestart.size===0&&!this.outstandingAuthOlderThanRestart}markAuthCompletion(){this.outstandingAuthOlderThanRestart=!1}subscribe(t,n,o,i){const l=Vs(t),u=Fs(l,n),f=this.querySet.get(u);if(f!==void 0)return f.numSubscribers+=1,{queryToken:u,modification:null,unsubscribe:()=>this.removeSubscriber(u)};{const h=this.nextQueryId++,p={id:h,canonicalizedUdfPath:l,args:n,numSubscribers:1,journal:o,componentPath:i};this.querySet.set(u,p),this.queryIdToToken.set(h,u);const y=this.querySetVersion,v=this.querySetVersion+1,w={type:"Add",queryId:h,udfPath:l,args:[ut(n)],journal:o,componentPath:i};return this.paused?this.pendingQuerySetModifications.set(h,w):this.querySetVersion=v,{queryToken:u,modification:{type:"ModifyQuerySet",baseVersion:y,newVersion:v,modifications:[w]},unsubscribe:()=>this.removeSubscriber(u)}}}transition(t){for(const n of t.modifications)switch(n.type){case"QueryUpdated":case"QueryFailed":{this.outstandingQueriesOlderThanRestart.delete(n.queryId);const o=n.journal;if(o!==void 0){const i=this.queryIdToToken.get(n.queryId);i!==void 0&&(this.querySet.get(i).journal=o)}break}case"QueryRemoved":{this.outstandingQueriesOlderThanRestart.delete(n.queryId);break}default:throw new Error(`Invalid modification ${n.type}`)}}queryId(t,n){const o=Vs(t),i=Fs(o,n),l=this.querySet.get(i);return l!==void 0?l.id:null}isCurrentOrNewerAuthVersion(t){return t>=this.identityVersion}getAuth(){return this.auth}setAuth(t){this.auth={tokenType:"User",value:t};const n=this.identityVersion;return this.paused||(this.identityVersion=n+1),{type:"Authenticate",baseVersion:n,...this.auth}}setAdminAuth(t,n){const o={tokenType:"Admin",value:t,impersonating:n};this.auth=o;const i=this.identityVersion;return this.paused||(this.identityVersion=i+1),{type:"Authenticate",baseVersion:i,...o}}clearAuth(){this.auth=void 0,this.markAuthCompletion();const t=this.identityVersion;return this.paused||(this.identityVersion=t+1),{type:"Authenticate",tokenType:"None",baseVersion:t}}hasAuth(){return!!this.auth}isNewAuth(t){return this.auth?.value!==t}queryPath(t){const n=this.queryIdToToken.get(t);return n?this.querySet.get(n).canonicalizedUdfPath:null}queryArgs(t){const n=this.queryIdToToken.get(t);return n?this.querySet.get(n).args:null}queryToken(t){return this.queryIdToToken.get(t)??null}queryJournal(t){return this.querySet.get(t)?.journal}restart(t){this.unpause(),this.outstandingQueriesOlderThanRestart.clear();const n=[];for(const l of this.querySet.values()){const u={type:"Add",queryId:l.id,udfPath:l.canonicalizedUdfPath,args:[ut(l.args)],journal:l.journal,componentPath:l.componentPath};n.push(u),t.has(l.id)||this.outstandingQueriesOlderThanRestart.add(l.id)}this.querySetVersion=1;const o={type:"ModifyQuerySet",baseVersion:0,newVersion:1,modifications:n};if(!this.auth)return this.identityVersion=0,[o,void 0];this.outstandingAuthOlderThanRestart=!0;const i={type:"Authenticate",baseVersion:0,...this.auth};return this.identityVersion=1,[o,i]}pause(){this.paused=!0}resume(){const t=this.pendingQuerySetModifications.size>0?{type:"ModifyQuerySet",baseVersion:this.querySetVersion,newVersion:++this.querySetVersion,modifications:Array.from(this.pendingQuerySetModifications.values())}:void 0,n=this.auth!==void 0?{type:"Authenticate",baseVersion:this.identityVersion++,...this.auth}:void 0;return this.unpause(),[t,n]}unpause(){this.paused=!1,this.pendingQuerySetModifications.clear()}removeSubscriber(t){const n=this.querySet.get(t);if(n.numSubscribers>1)return n.numSubscribers-=1,null;{this.querySet.delete(t),this.queryIdToToken.delete(n.id),this.outstandingQueriesOlderThanRestart.delete(n.id);const o=this.querySetVersion,i=this.querySetVersion+1,l={type:"Remove",queryId:n.id};return this.paused?this.pendingQuerySetModifications.has(n.id)?this.pendingQuerySetModifications.delete(n.id):this.pendingQuerySetModifications.set(n.id,l):this.querySetVersion=i,{type:"ModifyQuerySet",baseVersion:o,newVersion:i,modifications:[l]}}}}var wz=Object.defineProperty,xz=(e,t,n)=>t in e?wz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$u=(e,t,n)=>xz(e,typeof t!="symbol"?t+"":t,n);class Sz{constructor(t,n){this.logger=t,this.markConnectionStateDirty=n,$u(this,"inflightRequests"),$u(this,"requestsOlderThanRestart"),$u(this,"inflightMutationsCount",0),$u(this,"inflightActionsCount",0),this.inflightRequests=new Map,this.requestsOlderThanRestart=new Set}request(t,n){const o=new Promise(i=>{const l=n?"Requested":"NotSent";this.inflightRequests.set(t.requestId,{message:t,status:{status:l,requestedAt:new Date,onResult:i}}),t.type==="Mutation"?this.inflightMutationsCount++:t.type==="Action"&&this.inflightActionsCount++});return this.markConnectionStateDirty(),o}onResponse(t){const n=this.inflightRequests.get(t.requestId);if(n===void 0||n.status.status==="Completed")return null;const o=n.message.type==="Mutation"?"mutation":"action",i=n.message.udfPath;for(const h of t.logLines)wd(this.logger,"info",o,i,h);const l=n.status;let u,f;if(t.success)u={success:!0,logLines:t.logLines,value:nn(t.result)},f=()=>l.onResult(u);else{const h=t.result,{errorData:p}=t;wd(this.logger,"error",o,i,h),u={success:!1,errorMessage:h,errorData:p!==void 0?nn(p):void 0,logLines:t.logLines},f=()=>l.onResult(u)}return t.type==="ActionResponse"||!t.success?(f(),this.inflightRequests.delete(t.requestId),this.requestsOlderThanRestart.delete(t.requestId),n.message.type==="Action"?this.inflightActionsCount--:n.message.type==="Mutation"&&this.inflightMutationsCount--,this.markConnectionStateDirty(),{requestId:t.requestId,result:u}):(n.status={status:"Completed",result:u,ts:t.ts,onResolve:f},null)}removeCompleted(t){const n=new Map;for(const[o,i]of this.inflightRequests.entries()){const l=i.status;l.status==="Completed"&&l.ts.lessThanOrEqual(t)&&(l.onResolve(),n.set(o,l.result),i.message.type==="Mutation"?this.inflightMutationsCount--:i.message.type==="Action"&&this.inflightActionsCount--,this.inflightRequests.delete(o),this.requestsOlderThanRestart.delete(o))}return n.size>0&&this.markConnectionStateDirty(),n}restart(){this.requestsOlderThanRestart=new Set(this.inflightRequests.keys());const t=[];for(const[n,o]of this.inflightRequests){if(o.status.status==="NotSent"){o.status.status="Requested",t.push(o.message);continue}if(o.message.type==="Mutation")t.push(o.message);else if(o.message.type==="Action"){if(this.inflightRequests.delete(n),this.requestsOlderThanRestart.delete(n),this.inflightActionsCount--,o.status.status==="Completed")throw new Error("Action should never be in 'Completed' state");o.status.onResult({success:!1,errorMessage:"Connection lost while action was in flight",logLines:[]})}}return this.markConnectionStateDirty(),t}resume(){const t=[];for(const[,n]of this.inflightRequests)if(n.status.status==="NotSent"){n.status.status="Requested",t.push(n.message);continue}return t}hasIncompleteRequests(){for(const t of this.inflightRequests.values())if(t.status.status==="Requested")return!0;return!1}hasInflightRequests(){return this.inflightRequests.size>0}hasSyncedPastLastReconnect(){return this.requestsOlderThanRestart.size===0}timeOfOldestInflightRequest(){if(this.inflightRequests.size===0)return null;let t=Date.now();for(const n of this.inflightRequests.values())n.status.status!=="Completed"&&n.status.requestedAt.getTime()<t&&(t=n.status.requestedAt.getTime());return new Date(t)}inflightMutations(){return this.inflightMutationsCount}inflightActions(){return this.inflightActionsCount}}const Gl=Symbol.for("functionName"),i1=Symbol.for("toReferencePath");function _z(e){return e[i1]??null}function Ez(e){return e.startsWith("function://")}function Yd(e){let t;if(typeof e=="string")Ez(e)?t={functionHandle:e}:t={name:e};else if(e[Gl])t={name:e[Gl]};else{const n=_z(e);if(!n)throw new Error(`${e} is not a functionReference`);t={reference:n}}return t}function Sn(e){const t=Yd(e);if(t.name===void 0)throw t.functionHandle!==void 0?new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${t.functionHandle}`):t.reference!==void 0?new Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${t.reference}`):new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(t)}`);if(typeof e=="string")return e;const n=e[Gl];if(!n)throw new Error(`${e} is not a functionReference`);return n}function a1(e){return{[Gl]:e}}function l1(e=[]){const t={get(n,o){if(typeof o=="string"){const i=[...e,o];return l1(i)}else if(o===Gl){if(e.length<2){const u=["api",...e].join(".");throw new Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${u}\``)}const i=e.slice(0,-1).join("/"),l=e[e.length-1];return l==="default"?i:i+":"+l}else return o===Symbol.toStringTag?"FunctionReference":void 0}};return new Proxy({},t)}const Tz=l1();var Cz=Object.defineProperty,Rz=(e,t,n)=>t in e?Cz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xd=(e,t,n)=>Rz(e,typeof t!="symbol"?t+"":t,n);class Yl{constructor(t){xd(this,"queryResults"),xd(this,"modifiedQueries"),this.queryResults=t,this.modifiedQueries=[]}getQuery(t,...n){const o=or(n[0]),i=Sn(t),l=this.queryResults.get(Fs(i,o));if(l!==void 0)return Yl.queryValue(l.result)}getAllQueries(t){const n=[],o=Sn(t);for(const i of this.queryResults.values())i.udfPath===Vs(o)&&n.push({args:i.args,value:Yl.queryValue(i.result)});return n}setQuery(t,n,o){const i=or(n),l=Sn(t),u=Fs(l,i);let f;o===void 0?f=void 0:f={success:!0,value:o,logLines:[]};const h={udfPath:l,args:i,result:f};this.queryResults.set(u,h),this.modifiedQueries.push(u)}static queryValue(t){if(t!==void 0)return t.success?t.value:void 0}}class Az{constructor(){xd(this,"queryResults"),xd(this,"optimisticUpdates"),this.queryResults=new Map,this.optimisticUpdates=[]}ingestQueryResultsFromServer(t,n){this.optimisticUpdates=this.optimisticUpdates.filter(u=>!n.has(u.mutationId));const o=this.queryResults;this.queryResults=new Map(t);const i=new Yl(this.queryResults);for(const u of this.optimisticUpdates)u.update(i);const l=[];for(const[u,f]of this.queryResults){const h=o.get(u);(h===void 0||h.result!==f.result)&&l.push(u)}return l}applyOptimisticUpdate(t,n){this.optimisticUpdates.push({update:t,mutationId:n});const o=new Yl(this.queryResults);return t(o),o.modifiedQueries}rawQueryResult(t){const n=this.queryResults.get(t);if(n!==void 0)return n.result}queryResult(t){const n=this.queryResults.get(t);if(n===void 0)return;const o=n.result;if(o!==void 0){if(o.success)return o.value;throw o.errorData!==void 0?Um(o,new bd(Yi("query",n.udfPath,o))):new Error(Yi("query",n.udfPath,o))}}hasQueryResult(t){return this.queryResults.get(t)!==void 0}queryLogs(t){return this.queryResults.get(t)?.result?.logLines}}var Nz=Object.defineProperty,Oz=(e,t,n)=>t in e?Nz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lm=(e,t,n)=>Oz(e,typeof t!="symbol"?t+"":t,n);class xn{constructor(t,n){lm(this,"low"),lm(this,"high"),lm(this,"__isUnsignedLong__"),this.low=t|0,this.high=n|0,this.__isUnsignedLong__=!0}static isLong(t){return(t&&t.__isUnsignedLong__)===!0}static fromBytesLE(t){return new xn(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24)}toBytesLE(){const t=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]}static fromNumber(t){return isNaN(t)||t<0?Vx:t>=kz?Mz:new xn(t%Pl|0,t/Pl|0)}toString(){return(BigInt(this.high)*BigInt(Pl)+BigInt(this.low)).toString()}equals(t){return xn.isLong(t)||(t=xn.fromValue(t)),this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low}notEquals(t){return!this.equals(t)}comp(t){return xn.isLong(t)||(t=xn.fromValue(t)),this.equals(t)?0:t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1}lessThanOrEqual(t){return this.comp(t)<=0}static fromValue(t){return typeof t=="number"?xn.fromNumber(t):new xn(t.low,t.high)}}const Vx=new xn(0,0),Hx=65536,Pl=Hx*Hx,kz=Pl*Pl,Mz=new xn(-1,-1);var Iz=Object.defineProperty,Dz=(e,t,n)=>t in e?Iz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fu=(e,t,n)=>Dz(e,typeof t!="symbol"?t+"":t,n);class Zx{constructor(t,n){Fu(this,"version"),Fu(this,"remoteQuerySet"),Fu(this,"queryPath"),Fu(this,"logger"),this.version={querySet:0,ts:xn.fromNumber(0),identity:0},this.remoteQuerySet=new Map,this.queryPath=t,this.logger=n}transition(t){const n=t.startVersion;if(this.version.querySet!==n.querySet||this.version.ts.notEquals(n.ts)||this.version.identity!==n.identity)throw new Error(`Invalid start version: ${n.ts.toString()}:${n.querySet}:${n.identity}, transitioning from ${this.version.ts.toString()}:${this.version.querySet}:${this.version.identity}`);for(const o of t.modifications)switch(o.type){case"QueryUpdated":{const i=this.queryPath(o.queryId);if(i)for(const u of o.logLines)wd(this.logger,"info","query",i,u);const l=nn(o.value??null);this.remoteQuerySet.set(o.queryId,{success:!0,value:l,logLines:o.logLines});break}case"QueryFailed":{const i=this.queryPath(o.queryId);if(i)for(const u of o.logLines)wd(this.logger,"info","query",i,u);const{errorData:l}=o;this.remoteQuerySet.set(o.queryId,{success:!1,errorMessage:o.errorMessage,errorData:l!==void 0?nn(l):void 0,logLines:o.logLines});break}case"QueryRemoved":{this.remoteQuerySet.delete(o.queryId);break}default:throw new Error(`Invalid modification ${o.type}`)}this.version=t.endVersion}remoteQueryResults(){return this.remoteQuerySet}timestamp(){return this.version.ts}}function cm(e){const t=Vl(e);return xn.fromBytesLE(Array.from(t))}function jz(e){const t=new Uint8Array(e.toBytesLE());return Hl(t)}function Qx(e){switch(e.type){case"FatalError":case"AuthError":case"ActionResponse":case"TransitionChunk":case"Ping":return{...e};case"MutationResponse":return e.success?{...e,ts:cm(e.ts)}:{...e};case"Transition":return{...e,startVersion:{...e.startVersion,ts:cm(e.startVersion.ts)},endVersion:{...e.endVersion,ts:cm(e.endVersion.ts)}}}}function zz(e){switch(e.type){case"Authenticate":case"ModifyQuerySet":case"Mutation":case"Action":case"Event":return{...e};case"Connect":return e.maxObservedTimestamp!==void 0?{...e,maxObservedTimestamp:jz(e.maxObservedTimestamp)}:{...e,maxObservedTimestamp:void 0}}}var Lz=Object.defineProperty,Pz=(e,t,n)=>t in e?Lz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,At=(e,t,n)=>Pz(e,typeof t!="symbol"?t+"":t,n);const $z=1e3,Fz=1001,Uz=1005,Bz=4040;let nd;function Qi(){return nd===void 0&&(nd=Date.now()),typeof performance>"u"||!performance.now?Date.now():Math.round(nd+performance.now())}function Gx(){return`t=${Math.round((Qi()-nd)/100)/10}s`}const c1={InternalServerError:{timeout:1e3},SubscriptionsWorkerFullError:{timeout:3e3},TooManyConcurrentRequests:{timeout:3e3},CommitterFullError:{timeout:3e3},AwsTooManyRequestsException:{timeout:3e3},ExecuteFullError:{timeout:3e3},SystemTimeoutError:{timeout:3e3},ExpiredInQueue:{timeout:3e3},VectorIndexesUnavailable:{timeout:1e3},SearchIndexesUnavailable:{timeout:1e3},TableSummariesUnavailable:{timeout:1e3},VectorIndexTooLarge:{timeout:3e3},SearchIndexTooLarge:{timeout:3e3},TooManyWritesInTimePeriod:{timeout:3e3}};function qz(e){if(e===void 0)return"Unknown";for(const t of Object.keys(c1))if(e.startsWith(t))return t;return"Unknown"}class Vz{constructor(t,n,o,i,l,u){this.markConnectionStateDirty=l,this.debug=u,At(this,"socket"),At(this,"connectionCount"),At(this,"_hasEverConnected",!1),At(this,"lastCloseReason"),At(this,"transitionChunkBuffer",null),At(this,"defaultInitialBackoff"),At(this,"maxBackoff"),At(this,"retries"),At(this,"serverInactivityThreshold"),At(this,"reconnectDueToServerInactivityTimeout"),At(this,"scheduledReconnect",null),At(this,"networkOnlineHandler",null),At(this,"pendingNetworkRecoveryInfo",null),At(this,"uri"),At(this,"onOpen"),At(this,"onResume"),At(this,"onMessage"),At(this,"webSocketConstructor"),At(this,"logger"),At(this,"onServerDisconnectError"),this.webSocketConstructor=o,this.socket={state:"disconnected"},this.connectionCount=0,this.lastCloseReason="InitialConnect",this.defaultInitialBackoff=1e3,this.maxBackoff=16e3,this.retries=0,this.serverInactivityThreshold=6e4,this.reconnectDueToServerInactivityTimeout=null,this.uri=t,this.onOpen=n.onOpen,this.onResume=n.onResume,this.onMessage=n.onMessage,this.onServerDisconnectError=n.onServerDisconnectError,this.logger=i,this.setupNetworkListener(),this.connect()}setSocketState(t){this.socket=t,this._logVerbose(`socket state changed: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}`),this.markConnectionStateDirty()}setupNetworkListener(){typeof window>"u"||typeof window.addEventListener!="function"||this.networkOnlineHandler===null&&(this.networkOnlineHandler=()=>{this._logVerbose("network online event detected"),this.tryReconnectImmediately()},window.addEventListener("online",this.networkOnlineHandler),this._logVerbose("network online event listener registered"))}cleanupNetworkListener(){this.networkOnlineHandler&&typeof window<"u"&&typeof window.removeEventListener=="function"&&(window.removeEventListener("online",this.networkOnlineHandler),this.networkOnlineHandler=null,this._logVerbose("network online event listener removed"))}assembleTransition(t){if(t.partNumber<0||t.partNumber>=t.totalParts||t.totalParts===0||this.transitionChunkBuffer&&(this.transitionChunkBuffer.totalParts!==t.totalParts||this.transitionChunkBuffer.transitionId!==t.transitionId))throw this.transitionChunkBuffer=null,new Error("Invalid TransitionChunk");if(this.transitionChunkBuffer===null&&(this.transitionChunkBuffer={chunks:[],totalParts:t.totalParts,transitionId:t.transitionId}),t.partNumber!==this.transitionChunkBuffer.chunks.length){const n=this.transitionChunkBuffer.chunks.length;throw this.transitionChunkBuffer=null,new Error(`TransitionChunk received out of order: expected part ${n}, got ${t.partNumber}`)}if(this.transitionChunkBuffer.chunks.push(t.chunk),this.transitionChunkBuffer.chunks.length===t.totalParts){const n=this.transitionChunkBuffer.chunks.join("");this.transitionChunkBuffer=null;const o=Qx(JSON.parse(n));if(o.type!=="Transition")throw new Error(`Expected Transition, got ${o.type} after assembling chunks`);return o}return null}connect(){if(this.socket.state==="terminated")return;if(this.socket.state!=="disconnected"&&this.socket.state!=="stopped")throw new Error("Didn't start connection from disconnected state: "+this.socket.state);const t=new this.webSocketConstructor(this.uri);this._logVerbose("constructed WebSocket"),this.setSocketState({state:"connecting",ws:t,paused:"no"}),this.resetServerInactivityTimeout(),t.onopen=()=>{if(this.logger.logVerbose("begin ws.onopen"),this.socket.state!=="connecting")throw new Error("onopen called with socket not in connecting state");if(this.setSocketState({state:"ready",ws:t,paused:this.socket.paused==="yes"?"uninitialized":"no"}),this.resetServerInactivityTimeout(),this.socket.paused==="no"&&(this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:Qi()})),this.lastCloseReason!=="InitialConnect"&&(this.lastCloseReason?this.logger.log("WebSocket reconnected at",Gx(),"after disconnect due to",this.lastCloseReason):this.logger.log("WebSocket reconnected at",Gx())),this.connectionCount+=1,this.lastCloseReason=null,this.pendingNetworkRecoveryInfo!==null){const{timeSavedMs:n}=this.pendingNetworkRecoveryInfo;this.pendingNetworkRecoveryInfo=null,this.sendMessage({type:"Event",eventType:"NetworkRecoveryReconnect",event:{timeSavedMs:n}}),this.logger.log(`Network recovery reconnect saved ~${Math.round(n/1e3)}s of waiting`)}},t.onerror=n=>{this.transitionChunkBuffer=null;const o=n.message;o&&this.logger.log(`WebSocket error message: ${o}`)},t.onmessage=n=>{this.resetServerInactivityTimeout();const o=n.data.length;let i=Qx(JSON.parse(n.data));if(this._logVerbose(`received ws message with type ${i.type}`),i.type==="Ping")return;if(i.type==="TransitionChunk"){const u=this.assembleTransition(i);if(!u)return;i=u,this._logVerbose(`assembled full ws message of type ${i.type}`)}this.transitionChunkBuffer!==null&&(this.transitionChunkBuffer=null,this.logger.log(`Received unexpected ${i.type} while buffering TransitionChunks`)),i.type==="Transition"&&this.reportLargeTransition({messageLength:o,transition:i}),this.onMessage(i).hasSyncedPastLastReconnect&&(this.retries=0,this.markConnectionStateDirty())},t.onclose=n=>{if(this._logVerbose("begin ws.onclose"),this.transitionChunkBuffer=null,this.lastCloseReason===null&&(this.lastCloseReason=n.reason||`closed with code ${n.code}`),n.code!==$z&&n.code!==Fz&&n.code!==Uz&&n.code!==Bz){let i=`WebSocket closed with code ${n.code}`;n.reason&&(i+=`: ${n.reason}`),this.logger.log(i),this.onServerDisconnectError&&n.reason&&this.onServerDisconnectError(i)}const o=qz(n.reason);this.scheduleReconnect(o)}}socketState(){return this.socket.state}sendMessage(t){const n={type:t.type,...t.type==="Authenticate"&&t.tokenType==="User"?{value:`...${t.value.slice(-7)}`}:{}};if(this.socket.state==="ready"&&this.socket.paused==="no"){const o=zz(t),i=JSON.stringify(o);let l=!1;try{this.socket.ws.send(i),l=!0}catch(u){this.logger.log(`Failed to send message on WebSocket, reconnecting: ${u}`),this.closeAndReconnect("FailedToSendMessage")}return this._logVerbose(`${l?"sent":"failed to send"} message with type ${t.type}: ${JSON.stringify(n)}`),!0}return this._logVerbose(`message not sent (socket state: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}): ${JSON.stringify(n)}`),!1}resetServerInactivityTimeout(){this.socket.state!=="terminated"&&(this.reconnectDueToServerInactivityTimeout!==null&&(clearTimeout(this.reconnectDueToServerInactivityTimeout),this.reconnectDueToServerInactivityTimeout=null),this.reconnectDueToServerInactivityTimeout=setTimeout(()=>{this.closeAndReconnect("InactiveServer")},this.serverInactivityThreshold))}scheduleReconnect(t){this.scheduledReconnect&&(clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null),this.socket={state:"disconnected"};const n=this.nextBackoff(t);this.markConnectionStateDirty(),this.logger.log(`Attempting reconnect in ${Math.round(n)}ms`);const o=Qi(),i=setTimeout(()=>{this.scheduledReconnect?.timeout===i&&(this.scheduledReconnect=null,this.connect())},n);this.scheduledReconnect={timeout:i,scheduledAt:o,backoffMs:n}}closeAndReconnect(t){switch(this._logVerbose(`begin closeAndReconnect with reason ${t}`),this.socket.state){case"disconnected":case"terminated":case"stopped":return;case"connecting":case"ready":{this.lastCloseReason=t,this.close(),this.scheduleReconnect("client");return}default:this.socket}}close(){switch(this.transitionChunkBuffer=null,this.socket.state){case"disconnected":case"terminated":case"stopped":return Promise.resolve();case"connecting":{const t=this.socket.ws;return t.onmessage=n=>{this._logVerbose("Ignoring message received after close")},new Promise(n=>{t.onclose=()=>{this._logVerbose("Closed after connecting"),n()},t.onopen=()=>{this._logVerbose("Opened after connecting"),t.close()}})}case"ready":{this._logVerbose("ws.close called");const t=this.socket.ws;t.onmessage=o=>{this._logVerbose("Ignoring message received after close")};const n=new Promise(o=>{t.onclose=()=>{o()}});return t.close(),n}default:return this.socket,Promise.resolve()}}terminate(){switch(this.reconnectDueToServerInactivityTimeout&&clearTimeout(this.reconnectDueToServerInactivityTimeout),this.scheduledReconnect&&(clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null),this.cleanupNetworkListener(),this.socket.state){case"terminated":case"stopped":case"disconnected":case"connecting":case"ready":{const t=this.close();return this.setSocketState({state:"terminated"}),t}default:throw this.socket,new Error(`Invalid websocket state: ${this.socket.state}`)}}stop(){switch(this.socket.state){case"terminated":return Promise.resolve();case"connecting":case"stopped":case"disconnected":case"ready":{this.cleanupNetworkListener();const t=this.close();return this.socket={state:"stopped"},t}default:return this.socket,Promise.resolve()}}tryRestart(){switch(this.socket.state){case"stopped":break;case"terminated":case"connecting":case"ready":case"disconnected":this.logger.logVerbose("Restart called without stopping first");return;default:this.socket}this.setupNetworkListener(),this.connect()}pause(){switch(this.socket.state){case"disconnected":case"stopped":case"terminated":return;case"connecting":case"ready":{this.socket={...this.socket,paused:"yes"};return}default:{this.socket;return}}}tryReconnectImmediately(){if(this._logVerbose("tryReconnectImmediately called"),this.socket.state!=="disconnected"){this._logVerbose(`tryReconnectImmediately called but socket state is ${this.socket.state}, no action taken`);return}let t=null;if(this.scheduledReconnect){const n=Qi()-this.scheduledReconnect.scheduledAt;t=Math.max(0,this.scheduledReconnect.backoffMs-n),this._logVerbose(`would have waited ${Math.round(t)}ms more (backoff was ${Math.round(this.scheduledReconnect.backoffMs)}ms, elapsed ${Math.round(n)}ms)`),clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null,this._logVerbose("canceled scheduled reconnect")}this.logger.log("Network recovery detected, reconnecting immediately"),this.pendingNetworkRecoveryInfo=t!==null?{timeSavedMs:t}:null,this.connect()}resume(){switch(this.socket.state){case"connecting":this.socket={...this.socket,paused:"no"};return;case"ready":this.socket.paused==="uninitialized"?(this.socket={...this.socket,paused:"no"},this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:Qi()})):this.socket.paused==="yes"&&(this.socket={...this.socket,paused:"no"},this.onResume());return;case"terminated":case"stopped":case"disconnected":return;default:this.socket}this.connect()}connectionState(){return{isConnected:this.socket.state==="ready",hasEverConnected:this._hasEverConnected,connectionCount:this.connectionCount,connectionRetries:this.retries}}_logVerbose(t){this.logger.logVerbose(t)}nextBackoff(t){const o=(t==="client"?100:t==="Unknown"?this.defaultInitialBackoff:c1[t].timeout)*Math.pow(2,this.retries);this.retries+=1;const i=Math.min(o,this.maxBackoff),l=i*(Math.random()-.5);return i+l}reportLargeTransition({transition:t,messageLength:n}){if(t.clientClockSkew===void 0||t.serverTs===void 0)return;const o=Qi()-t.clientClockSkew-t.serverTs/1e6,i=`${Math.round(o)}ms`,l=`${Math.round(n/1e4)/100}MB`,u=n/(o/1e3),f=`${Math.round(u/1e4)/100}MB per second`;this._logVerbose(`received ${l} transition in ${i} at ${f}`),n>2e7?this.logger.log(`received query results totaling more that 20MB (${l}) which will take a long time to download on slower connections`):o>2e4&&this.logger.log(`received query results totaling ${l} which took more than 20s to arrive (${i})`),this.debug&&this.sendMessage({type:"Event",eventType:"ClientReceivedTransition",event:{transitionTransitTime:o,messageLength:n}})}}function Hz(){return Zz()}function Zz(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}class Ol extends Error{}Ol.prototype.name="InvalidTokenError";function Qz(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let o=n.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}function Gz(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return Qz(t)}catch{return atob(t)}}function u1(e,t){if(typeof e!="string")throw new Ol("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,o=e.split(".")[n];if(typeof o!="string")throw new Ol(`Invalid token specified: missing part #${n+1}`);let i;try{i=Gz(o)}catch(l){throw new Ol(`Invalid token specified: invalid base64 for part #${n+1} (${l.message})`)}try{return JSON.parse(i)}catch(l){throw new Ol(`Invalid token specified: invalid json for part #${n+1} (${l.message})`)}}var Yz=Object.defineProperty,Kz=(e,t,n)=>t in e?Yz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,er=(e,t,n)=>Kz(e,typeof t!="symbol"?t+"":t,n);const Xz=480*60*60*1e3,Yx=2;class Jz{constructor(t,n,o){er(this,"authState",{state:"noAuth"}),er(this,"configVersion",0),er(this,"syncState"),er(this,"authenticate"),er(this,"stopSocket"),er(this,"tryRestartSocket"),er(this,"pauseSocket"),er(this,"resumeSocket"),er(this,"clearAuth"),er(this,"logger"),er(this,"refreshTokenLeewaySeconds"),er(this,"tokenConfirmationAttempts",0),this.syncState=t,this.authenticate=n.authenticate,this.stopSocket=n.stopSocket,this.tryRestartSocket=n.tryRestartSocket,this.pauseSocket=n.pauseSocket,this.resumeSocket=n.resumeSocket,this.clearAuth=n.clearAuth,this.logger=o.logger,this.refreshTokenLeewaySeconds=o.refreshTokenLeewaySeconds}async setConfig(t,n){this.resetAuthState(),this._logVerbose("pausing WS for auth token fetch"),this.pauseSocket();const o=await this.fetchTokenAndGuardAgainstRace(t,{forceRefreshToken:!1});o.isFromOutdatedConfig||(o.value?(this.setAuthState({state:"waitingForServerConfirmationOfCachedToken",config:{fetchToken:t,onAuthChange:n},hasRetried:!1}),this.authenticate(o.value)):(this.setAuthState({state:"initialRefetch",config:{fetchToken:t,onAuthChange:n}}),await this.refetchToken()),this._logVerbose("resuming WS after auth token fetch"),this.resumeSocket())}onTransition(t){if(this.syncState.isCurrentOrNewerAuthVersion(t.endVersion.identity)&&!(t.endVersion.identity<=t.startVersion.identity)){if(this.authState.state==="waitingForServerConfirmationOfCachedToken"){this._logVerbose("server confirmed auth token is valid"),this.refetchToken(),this.authState.config.onAuthChange(!0);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this._logVerbose("server confirmed new auth token is valid"),this.scheduleTokenRefetch(this.authState.token),this.tokenConfirmationAttempts=0,this.authState.hadAuth||this.authState.config.onAuthChange(!0))}}onAuthError(t){if(t.authUpdateAttempted===!1&&(this.authState.state==="waitingForServerConfirmationOfFreshToken"||this.authState.state==="waitingForServerConfirmationOfCachedToken")){this._logVerbose("ignoring non-auth token expired error");return}const{baseVersion:n}=t;if(!this.syncState.isCurrentOrNewerAuthVersion(n+1)){this._logVerbose("ignoring auth error for previous auth attempt");return}this.tryToReauthenticate(t)}async tryToReauthenticate(t){if(this._logVerbose(`attempting to reauthenticate: ${t.error}`),this.authState.state==="noAuth"||this.authState.state==="waitingForServerConfirmationOfFreshToken"&&this.tokenConfirmationAttempts>=Yx){this.logger.error(`Failed to authenticate: "${t.error}", check your server auth config`),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.authState.state!=="noAuth"&&this.setAndReportAuthFailed(this.authState.config.onAuthChange);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this.tokenConfirmationAttempts++,this._logVerbose(`retrying reauthentication, ${Yx-this.tokenConfirmationAttempts} attempts remaining`)),await this.stopSocket();const n=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});n.isFromOutdatedConfig||(n.value&&this.syncState.isNewAuth(n.value)?(this.authenticate(n.value),this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",config:this.authState.config,token:n.value,hadAuth:this.authState.state==="notRefetching"||this.authState.state==="waitingForScheduledRefetch"})):(this._logVerbose("reauthentication failed, could not fetch a new token"),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this.tryRestartSocket())}async refetchToken(){if(this.authState.state==="noAuth")return;this._logVerbose("refetching auth token");const t=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});t.isFromOutdatedConfig||(t.value?this.syncState.isNewAuth(t.value)?(this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",hadAuth:this.syncState.hasAuth(),token:t.value,config:this.authState.config}),this.authenticate(t.value)):this.setAuthState({state:"notRefetching",config:this.authState.config}):(this._logVerbose("refetching token failed"),this.syncState.hasAuth()&&this.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this._logVerbose("restarting WS after auth token fetch (if currently stopped)"),this.tryRestartSocket())}scheduleTokenRefetch(t){if(this.authState.state==="noAuth")return;const n=this.decodeToken(t);if(!n){this.logger.error("Auth token is not a valid JWT, cannot refetch the token");return}const{iat:o,exp:i}=n;if(!o||!i){this.logger.error("Auth token does not have required fields, cannot refetch the token");return}const l=i-o;if(l<=2){this.logger.error("Auth token does not live long enough, cannot refetch the token");return}let u=Math.min(Xz,(l-this.refreshTokenLeewaySeconds)*1e3);u<=0&&(this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${l}s`),u=0);const f=setTimeout(()=>{this._logVerbose("running scheduled token refetch"),this.refetchToken()},u);this.setAuthState({state:"waitingForScheduledRefetch",refetchTokenTimeoutId:f,config:this.authState.config}),this._logVerbose(`scheduled preemptive auth token refetching in ${u}ms`)}async fetchTokenAndGuardAgainstRace(t,n){const o=++this.configVersion;this._logVerbose(`fetching token with config version ${o}`);const i=await t(n);return this.configVersion!==o?(this._logVerbose(`stale config version, expected ${o}, got ${this.configVersion}`),{isFromOutdatedConfig:!0}):{isFromOutdatedConfig:!1,value:i}}stop(){this.resetAuthState(),this.configVersion++,this._logVerbose(`config version bumped to ${this.configVersion}`)}setAndReportAuthFailed(t){t(!1),this.resetAuthState()}resetAuthState(){this.setAuthState({state:"noAuth"})}setAuthState(t){const n=t.state==="waitingForServerConfirmationOfFreshToken"?{hadAuth:t.hadAuth,state:t.state,token:`...${t.token.slice(-7)}`}:{state:t.state};switch(this._logVerbose(`setting auth state to ${JSON.stringify(n)}`),t.state){case"waitingForScheduledRefetch":case"notRefetching":case"noAuth":this.tokenConfirmationAttempts=0;break}this.authState.state==="waitingForScheduledRefetch"&&(clearTimeout(this.authState.refetchTokenTimeoutId),this.syncState.markAuthCompletion()),this.authState=t}decodeToken(t){try{return u1(t)}catch(n){return this._logVerbose(`Error decoding token: ${n instanceof Error?n.message:"Unknown error"}`),null}}_logVerbose(t){this.logger.logVerbose(`${t} [v${this.configVersion}]`)}}const Wz=["convexClientConstructed","convexWebSocketOpen","convexFirstMessageReceived"];function eL(e,t){const n={sessionId:t};typeof performance>"u"||!performance.mark||performance.mark(e,{detail:n})}function tL(e){let t=e.name.slice(6);return t=t.charAt(0).toLowerCase()+t.slice(1),{name:t,startTime:e.startTime}}function nL(e){if(typeof performance>"u"||!performance.getEntriesByName)return[];const t=[];for(const n of Wz){const o=performance.getEntriesByName(n).filter(i=>i.entryType==="mark").filter(i=>i.detail.sessionId===e);t.push(...o)}return t.map(tL)}var rL=Object.defineProperty,oL=(e,t,n)=>t in e?rL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nt=(e,t,n)=>oL(e,typeof t!="symbol"?t+"":t,n);class sL{constructor(t,n,o){if(Nt(this,"address"),Nt(this,"state"),Nt(this,"requestManager"),Nt(this,"webSocketManager"),Nt(this,"authenticationManager"),Nt(this,"remoteQuerySet"),Nt(this,"optimisticQueryResults"),Nt(this,"_transitionHandlerCounter",0),Nt(this,"_nextRequestId"),Nt(this,"_onTransitionFns",new Map),Nt(this,"_sessionId"),Nt(this,"firstMessageReceived",!1),Nt(this,"debug"),Nt(this,"logger"),Nt(this,"maxObservedTimestamp"),Nt(this,"connectionStateSubscribers",new Map),Nt(this,"nextConnectionStateSubscriberId",0),Nt(this,"_lastPublishedConnectionState"),Nt(this,"markConnectionStateDirty",()=>{Promise.resolve().then(()=>{const _=this.connectionState();if(JSON.stringify(_)!==JSON.stringify(this._lastPublishedConnectionState)){this._lastPublishedConnectionState=_;for(const R of this.connectionStateSubscribers.values())R(_)}})}),Nt(this,"mark",_=>{this.debug&&eL(_,this.sessionId)}),typeof t=="object")throw new Error("Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.");o?.skipConvexDeploymentUrlCheck!==!0&&Xj(t),o={...o};const i=o.authRefreshTokenLeewaySeconds??2;let l=o.webSocketConstructor;if(!l&&typeof WebSocket>"u")throw new Error("No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient");l=l||WebSocket,this.debug=o.reportDebugInfoToConvex??!1,this.address=t,this.logger=o.logger===!1?s1({verbose:o.verbose??!1}):o.logger!==!0&&o.logger?o.logger:o1({verbose:o.verbose??!1});const u=t.search("://");if(u===-1)throw new Error("Provided address was not an absolute URL.");const f=t.substring(u+3),h=t.substring(0,u);let p;if(h==="http")p="ws";else if(h==="https")p="wss";else throw new Error(`Unknown parent protocol ${h}`);const y=`${p}://${f}/api/${gr}/sync`;this.state=new bz,this.remoteQuerySet=new Zx(_=>this.state.queryPath(_),this.logger),this.requestManager=new Sz(this.logger,this.markConnectionStateDirty);const v=()=>{this.webSocketManager.pause(),this.state.pause()};this.authenticationManager=new Jz(this.state,{authenticate:_=>{const R=this.state.setAuth(_);return this.webSocketManager.sendMessage(R),R.baseVersion},stopSocket:()=>this.webSocketManager.stop(),tryRestartSocket:()=>this.webSocketManager.tryRestart(),pauseSocket:v,resumeSocket:()=>this.webSocketManager.resume(),clearAuth:()=>{this.clearAuth()}},{logger:this.logger,refreshTokenLeewaySeconds:i}),this.optimisticQueryResults=new Az,this.addOnTransitionHandler(_=>{n(_.queries.map(R=>R.token))}),this._nextRequestId=0,this._sessionId=Hz();const{unsavedChangesWarning:w}=o;if(typeof window>"u"||typeof window.addEventListener>"u"){if(w===!0)throw new Error("unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.")}else w!==!1&&window.addEventListener("beforeunload",_=>{if(this.requestManager.hasIncompleteRequests()){_.preventDefault();const R="Are you sure you want to leave? Your changes may not be saved.";return(_||window.event).returnValue=R,R}});this.webSocketManager=new Vz(y,{onOpen:_=>{this.mark("convexWebSocketOpen"),this.webSocketManager.sendMessage({..._,type:"Connect",sessionId:this._sessionId,maxObservedTimestamp:this.maxObservedTimestamp});const R=new Set(this.remoteQuerySet.remoteQueryResults().keys());this.remoteQuerySet=new Zx(N=>this.state.queryPath(N),this.logger);const[x,C]=this.state.restart(R);C&&this.webSocketManager.sendMessage(C),this.webSocketManager.sendMessage(x);for(const N of this.requestManager.restart())this.webSocketManager.sendMessage(N)},onResume:()=>{const[_,R]=this.state.resume();R&&this.webSocketManager.sendMessage(R),_&&this.webSocketManager.sendMessage(_);for(const x of this.requestManager.resume())this.webSocketManager.sendMessage(x)},onMessage:_=>{switch(this.firstMessageReceived||(this.firstMessageReceived=!0,this.mark("convexFirstMessageReceived"),this.reportMarks()),_.type){case"Transition":{this.observedTimestamp(_.endVersion.ts),this.authenticationManager.onTransition(_),this.remoteQuerySet.transition(_),this.state.transition(_);const R=this.requestManager.removeCompleted(this.remoteQuerySet.timestamp());this.notifyOnQueryResultChanges(R);break}case"MutationResponse":{_.success&&this.observedTimestamp(_.ts);const R=this.requestManager.onResponse(_);R!==null&&this.notifyOnQueryResultChanges(new Map([[R.requestId,R.result]]));break}case"ActionResponse":{this.requestManager.onResponse(_);break}case"AuthError":{this.authenticationManager.onAuthError(_);break}case"FatalError":{const R=gz(this.logger,_.error);throw this.webSocketManager.terminate(),R}}return{hasSyncedPastLastReconnect:this.hasSyncedPastLastReconnect()}},onServerDisconnectError:o.onServerDisconnectError},l,this.logger,this.markConnectionStateDirty,this.debug),this.mark("convexClientConstructed"),o.expectAuth&&v()}hasSyncedPastLastReconnect(){return this.requestManager.hasSyncedPastLastReconnect()||this.state.hasSyncedPastLastReconnect()}observedTimestamp(t){(this.maxObservedTimestamp===void 0||this.maxObservedTimestamp.lessThanOrEqual(t))&&(this.maxObservedTimestamp=t)}getMaxObservedTimestamp(){return this.maxObservedTimestamp}notifyOnQueryResultChanges(t){const n=this.remoteQuerySet.remoteQueryResults(),o=new Map;for(const[l,u]of n){const f=this.state.queryToken(l);if(f!==null){const h={result:u,udfPath:this.state.queryPath(l),args:this.state.queryArgs(l)};o.set(f,h)}}const i=this.optimisticQueryResults.ingestQueryResultsFromServer(o,new Set(t.keys()));this.handleTransition({queries:i.map(l=>{const u=this.optimisticQueryResults.rawQueryResult(l);return{token:l,modification:{kind:"Updated",result:u}}}),reflectedMutations:Array.from(t).map(([l,u])=>({requestId:l,result:u})),timestamp:this.remoteQuerySet.timestamp()})}handleTransition(t){for(const n of this._onTransitionFns.values())n(t)}addOnTransitionHandler(t){const n=this._transitionHandlerCounter++;return this._onTransitionFns.set(n,t),()=>this._onTransitionFns.delete(n)}getCurrentAuthClaims(){const t=this.state.getAuth();let n={};if(t&&t.tokenType==="User")try{n=t?u1(t.value):{}}catch{n={}}else return;return{token:t.value,decoded:n}}setAuth(t,n){this.authenticationManager.setConfig(t,n)}hasAuth(){return this.state.hasAuth()}setAdminAuth(t,n){const o=this.state.setAdminAuth(t,n);this.webSocketManager.sendMessage(o)}clearAuth(){const t=this.state.clearAuth();this.webSocketManager.sendMessage(t)}subscribe(t,n,o){const i=or(n),{modification:l,queryToken:u,unsubscribe:f}=this.state.subscribe(t,i,o?.journal,o?.componentPath);return l!==null&&this.webSocketManager.sendMessage(l),{queryToken:u,unsubscribe:()=>{const h=f();h&&this.webSocketManager.sendMessage(h)}}}localQueryResult(t,n){const o=or(n),i=Fs(t,o);return this.optimisticQueryResults.queryResult(i)}localQueryResultByToken(t){return this.optimisticQueryResults.queryResult(t)}hasLocalQueryResultByToken(t){return this.optimisticQueryResults.hasQueryResult(t)}localQueryLogs(t,n){const o=or(n),i=Fs(t,o);return this.optimisticQueryResults.queryLogs(i)}queryJournal(t,n){const o=or(n),i=Fs(t,o);return this.state.queryJournal(i)}connectionState(){const t=this.webSocketManager.connectionState();return{hasInflightRequests:this.requestManager.hasInflightRequests(),isWebSocketConnected:t.isConnected,hasEverConnected:t.hasEverConnected,connectionCount:t.connectionCount,connectionRetries:t.connectionRetries,timeOfOldestInflightRequest:this.requestManager.timeOfOldestInflightRequest(),inflightMutations:this.requestManager.inflightMutations(),inflightActions:this.requestManager.inflightActions()}}subscribeToConnectionState(t){const n=this.nextConnectionStateSubscriberId++;return this.connectionStateSubscribers.set(n,t),()=>{this.connectionStateSubscribers.delete(n)}}async mutation(t,n,o){const i=await this.mutationInternal(t,n,o);if(!i.success)throw i.errorData!==void 0?Um(i,new bd(Yi("mutation",t,i))):new Error(Yi("mutation",t,i));return i.value}async mutationInternal(t,n,o,i){const{mutationPromise:l}=this.enqueueMutation(t,n,o,i);return l}enqueueMutation(t,n,o,i){const l=or(n);this.tryReportLongDisconnect();const u=this.nextRequestId;if(this._nextRequestId++,o!==void 0){const y=o.optimisticUpdate;if(y!==void 0){const v=R=>{y(R,l)instanceof Promise&&this.logger.warn("Optimistic update handler returned a Promise. Optimistic updates should be synchronous.")},_=this.optimisticQueryResults.applyOptimisticUpdate(v,u).map(R=>{const x=this.localQueryResultByToken(R);return{token:R,modification:{kind:"Updated",result:x===void 0?void 0:{success:!0,value:x,logLines:[]}}}});this.handleTransition({queries:_,reflectedMutations:[],timestamp:this.remoteQuerySet.timestamp()})}}const f={type:"Mutation",requestId:u,udfPath:t,componentPath:i,args:[ut(l)]},h=this.webSocketManager.sendMessage(f),p=this.requestManager.request(f,h);return{requestId:u,mutationPromise:p}}async action(t,n){const o=await this.actionInternal(t,n);if(!o.success)throw o.errorData!==void 0?Um(o,new bd(Yi("action",t,o))):new Error(Yi("action",t,o));return o.value}async actionInternal(t,n,o){const i=or(n),l=this.nextRequestId;this._nextRequestId++,this.tryReportLongDisconnect();const u={type:"Action",requestId:l,udfPath:t,componentPath:o,args:[ut(i)]},f=this.webSocketManager.sendMessage(u);return this.requestManager.request(u,f)}async close(){return this.authenticationManager.stop(),this.webSocketManager.terminate()}get url(){return this.address}get nextRequestId(){return this._nextRequestId}get sessionId(){return this._sessionId}reportMarks(){if(this.debug){const t=nL(this.sessionId);this.webSocketManager.sendMessage({type:"Event",eventType:"ClientConnect",event:t})}}tryReportLongDisconnect(){if(!this.debug)return;const t=this.connectionState().timeOfOldestInflightRequest;if(t===null||Date.now()-t.getTime()<=60*1e3)return;const n=`${this.address}/api/debug_event`;fetch(n,{method:"POST",headers:{"Content-Type":"application/json","Convex-Client":`npm-${gr}`},body:JSON.stringify({event:"LongWebsocketDisconnect"})}).then(o=>{o.ok||this.logger.warn("Analytics request failed with response:",o.body)}).catch(o=>{this.logger.warn("Analytics response failed with error:",o)})}}function um(e){if(typeof e!="object"||e===null||!Array.isArray(e.page)||typeof e.isDone!="boolean"||typeof e.continueCursor!="string")throw new Error(`Not a valid paginated query result: ${e?.toString()}`);return e}var iL=Object.defineProperty,aL=(e,t,n)=>t in e?iL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kx=(e,t,n)=>aL(e,typeof t!="symbol"?t+"":t,n);class lL{constructor(t,n){this.client=t,this.onTransition=n,Kx(this,"paginatedQuerySet",new Map),Kx(this,"lastTransitionTs"),this.lastTransitionTs=xn.fromNumber(0),this.client.addOnTransitionHandler(o=>this.onBaseTransition(o))}subscribe(t,n,o){const i=Vs(t),l=qx(i,n,o),u=()=>this.removePaginatedQuerySubscriber(l),f=this.paginatedQuerySet.get(l);return f?(f.numSubscribers+=1,{paginatedQueryToken:l,unsubscribe:u}):(this.paginatedQuerySet.set(l,{token:l,canonicalizedUdfPath:i,args:n,numSubscribers:1,options:{initialNumItems:o.initialNumItems},nextPageKey:0,pageKeys:[],pageKeyToQuery:new Map,ongoingSplits:new Map,skip:!1,id:o.id}),this.addPageToPaginatedQuery(l,null,o.initialNumItems),{paginatedQueryToken:l,unsubscribe:u})}localQueryResult(t,n,o){const i=Vs(t),l=qx(i,n,o);return this.localQueryResultByToken(l)}localQueryResultByToken(t){const n=this.paginatedQuerySet.get(t);if(!n)return;const o=this.activePageQueryTokens(n);if(o.length===0)return{results:[],status:"LoadingFirstPage",loadMore:h=>this.loadMoreOfPaginatedQuery(t,h)};let i=[],l=!1,u=!1;for(const h of o){const p=this.client.localQueryResultByToken(h);if(p===void 0){l=!0,u=!1;continue}const y=um(p);i=i.concat(y.page),u=!!y.isDone}let f;return l?f=i.length===0?"LoadingFirstPage":"LoadingMore":u?f="Exhausted":f="CanLoadMore",{results:i,status:f,loadMore:h=>this.loadMoreOfPaginatedQuery(t,h)}}onBaseTransition(t){const n=t.queries.map(u=>u.token),o=this.queriesContainingTokens(n);let i=[];o.length>0&&(this.processPaginatedQuerySplits(o,u=>this.client.localQueryResultByToken(u)),i=o.map(u=>({token:u,modification:{kind:"Updated",result:this.localQueryResultByToken(u)}})));const l={...t,paginatedQueries:i};this.onTransition(l)}loadMoreOfPaginatedQuery(t,n){this.mustGetPaginatedQuery(t);const o=this.queryTokenForLastPageOfPaginatedQuery(t),i=this.client.localQueryResultByToken(o);if(!i)return!1;const l=um(i);if(l.isDone)return!1;this.addPageToPaginatedQuery(t,l.continueCursor,n);const u={timestamp:this.lastTransitionTs,reflectedMutations:[],queries:[],paginatedQueries:[{token:t,modification:{kind:"Updated",result:this.localQueryResultByToken(t)}}]};return this.onTransition(u),!0}queriesContainingTokens(t){if(t.length===0)return[];const n=[],o=new Set(t);for(const[i,l]of this.paginatedQuerySet)for(const u of this.allQueryTokens(l))if(o.has(u)){n.push(i);break}return n}processPaginatedQuerySplits(t,n){for(const o of t){const i=this.mustGetPaginatedQuery(o),{ongoingSplits:l,pageKeyToQuery:u,pageKeys:f}=i;for(const[h,[p,y]]of l)n(u.get(p).queryToken)!==void 0&&n(u.get(y).queryToken)!==void 0&&this.completePaginatedQuerySplit(i,h,p,y);for(const h of f){if(l.has(h))continue;const p=u.get(h).queryToken,y=n(p);if(!y)continue;const v=um(y);v.splitCursor&&(v.pageStatus==="SplitRecommended"||v.pageStatus==="SplitRequired"||v.page.length>i.options.initialNumItems*2)&&this.splitPaginatedQueryPage(i,h,v.splitCursor,v.continueCursor)}}}splitPaginatedQueryPage(t,n,o,i){const l=t.nextPageKey++,u=t.nextPageKey++,f={cursor:i,numItems:t.options.initialNumItems,id:t.id},h=this.client.subscribe(t.canonicalizedUdfPath,{...t.args,paginationOpts:{...f,cursor:null,endCursor:o}});t.pageKeyToQuery.set(l,h);const p=this.client.subscribe(t.canonicalizedUdfPath,{...t.args,paginationOpts:{...f,cursor:o,endCursor:i}});t.pageKeyToQuery.set(u,p),t.ongoingSplits.set(n,[l,u])}addPageToPaginatedQuery(t,n,o){const i=this.mustGetPaginatedQuery(t),l=i.nextPageKey++,u={cursor:n,numItems:o,id:i.id},f={...i.args,paginationOpts:u},h=this.client.subscribe(i.canonicalizedUdfPath,f);return i.pageKeys.push(l),i.pageKeyToQuery.set(l,h),h}removePaginatedQuerySubscriber(t){const n=this.paginatedQuerySet.get(t);if(n&&(n.numSubscribers-=1,!(n.numSubscribers>0))){for(const o of n.pageKeyToQuery.values())o.unsubscribe();this.paginatedQuerySet.delete(t)}}completePaginatedQuerySplit(t,n,o,i){const l=t.pageKeyToQuery.get(n);t.pageKeyToQuery.delete(n);const u=t.pageKeys.indexOf(n);t.pageKeys.splice(u,1,o,i),t.ongoingSplits.delete(n),l.unsubscribe()}activePageQueryTokens(t){return t.pageKeys.map(n=>t.pageKeyToQuery.get(n).queryToken)}allQueryTokens(t){return Array.from(t.pageKeyToQuery.values()).map(n=>n.queryToken)}queryTokenForLastPageOfPaginatedQuery(t){const n=this.mustGetPaginatedQuery(t),o=n.pageKeys[n.pageKeys.length-1];if(o===void 0)throw new Error(`No pages for paginated query ${t}`);return n.pageKeyToQuery.get(o).queryToken}mustGetPaginatedQuery(t){const n=this.paginatedQuerySet.get(t);if(!n)throw new Error("paginated query no longer exists for token "+t);return n}}function cL({getCurrentValue:e,subscribe:t}){const[n,o]=S.useState(()=>({getCurrentValue:e,subscribe:t,value:e()}));let i=n.value;return(n.getCurrentValue!==e||n.subscribe!==t)&&(i=e(),o({getCurrentValue:e,subscribe:t,value:i})),S.useEffect(()=>{let l=!1;const u=()=>{l||o(h=>{if(h.getCurrentValue!==e||h.subscribe!==t)return h;const p=e();return h.value===p?h:{...h,value:p}})},f=t(u);return u(),()=>{l=!0,f()}},[e,t]),i}var uL=Object.defineProperty,dL=(e,t,n)=>t in e?uL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,io=(e,t,n)=>dL(e,typeof t!="symbol"?t+"":t,n);const fL=5e3;if(typeof tn>"u")throw new Error("Required dependency 'react' not found");function d1(e,t,n){function o(i){return gL(i),t.mutation(e,i,{optimisticUpdate:n})}return o.withOptimisticUpdate=function(l){if(n!==void 0)throw new Error(`Already specified optimistic update for mutation ${Sn(e)}`);return d1(e,t,l)},o}class hL{constructor(t,n){if(io(this,"address"),io(this,"cachedSync"),io(this,"cachedPaginatedQueryClient"),io(this,"listeners"),io(this,"options"),io(this,"closed",!1),io(this,"_logger"),io(this,"adminAuth"),io(this,"fakeUserIdentity"),t===void 0)throw new Error("No address provided to ConvexReactClient.\nIf trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/\nIf running locally, make sure to run `convex dev` and ensure the .env.local file is populated.");if(typeof t!="string")throw new Error(`ConvexReactClient requires a URL like 'https://happy-otter-123.convex.cloud', received something of type ${typeof t} instead.`);if(!t.includes("://"))throw new Error("Provided address was not an absolute URL.");this.address=t,this.listeners=new Map,this._logger=n?.logger===!1?s1({verbose:n?.verbose??!1}):n?.logger!==!0&&n?.logger?n.logger:o1({verbose:n?.verbose??!1}),this.options={...n,logger:this._logger}}get url(){return this.address}get sync(){if(this.closed)throw new Error("ConvexReactClient has already been closed.");return this.cachedSync?this.cachedSync:(this.cachedSync=new sL(this.address,()=>{},this.options),this.adminAuth&&this.cachedSync.setAdminAuth(this.adminAuth,this.fakeUserIdentity),this.cachedPaginatedQueryClient=new lL(this.cachedSync,t=>this.handleTransition(t)),this.cachedSync)}get paginatedQueryClient(){if(this.sync,this.cachedPaginatedQueryClient)return this.cachedPaginatedQueryClient;throw new Error("Should already be instantiated")}setAuth(t,n){if(typeof t=="string")throw new Error("Passing a string to ConvexReactClient.setAuth is no longer supported, please upgrade to passing in an async function to handle reauthentication.");this.sync.setAuth(t,n??(()=>{}))}clearAuth(){this.sync.clearAuth()}setAdminAuth(t,n){if(this.adminAuth=t,this.fakeUserIdentity=n,this.closed)throw new Error("ConvexReactClient has already been closed.");this.cachedSync&&this.sync.setAdminAuth(t,n)}watchQuery(t,...n){const[o,i]=n,l=Sn(t);return{onUpdate:u=>{const{queryToken:f,unsubscribe:h}=this.sync.subscribe(l,o,i),p=this.listeners.get(f);return p!==void 0?p.add(u):this.listeners.set(f,new Set([u])),()=>{if(this.closed)return;const y=this.listeners.get(f);y.delete(u),y.size===0&&this.listeners.delete(f),h()}},localQueryResult:()=>{if(this.cachedSync)return this.cachedSync.localQueryResult(l,o)},localQueryLogs:()=>{if(this.cachedSync)return this.cachedSync.localQueryLogs(l,o)},journal:()=>{if(this.cachedSync)return this.cachedSync.queryJournal(l,o)}}}prewarmQuery(t){const n=t.extendSubscriptionFor??fL,i=this.watchQuery(t.query,t.args||{}).onUpdate(()=>{});setTimeout(i,n)}watchPaginatedQuery(t,n,o){const i=Sn(t);return{onUpdate:l=>{const{paginatedQueryToken:u,unsubscribe:f}=this.paginatedQueryClient.subscribe(i,n||{},o),h=this.listeners.get(u);return h!==void 0?h.add(l):this.listeners.set(u,new Set([l])),()=>{if(this.closed)return;const p=this.listeners.get(u);p.delete(l),p.size===0&&this.listeners.delete(u),f()}},localQueryResult:()=>this.paginatedQueryClient.localQueryResult(i,n,o)}}mutation(t,...n){const[o,i]=n,l=Sn(t);return this.sync.mutation(l,o,i)}action(t,...n){const o=Sn(t);return this.sync.action(o,...n)}query(t,...n){const o=this.watchQuery(t,...n),i=o.localQueryResult();return i!==void 0?Promise.resolve(i):new Promise((l,u)=>{const f=o.onUpdate(()=>{f();try{l(o.localQueryResult())}catch(h){u(h)}})})}connectionState(){return this.sync.connectionState()}subscribeToConnectionState(t){return this.sync.subscribeToConnectionState(t)}get logger(){return this._logger}async close(){if(this.closed=!0,this.listeners=new Map,this.cachedPaginatedQueryClient&&(this.cachedPaginatedQueryClient=void 0),this.cachedSync){const t=this.cachedSync;this.cachedSync=void 0,await t.close()}}handleTransition(t){const n=t.queries.map(i=>i.token),o=t.paginatedQueries.map(i=>i.token);this.transition([...n,...o])}transition(t){for(const n of t){const o=this.listeners.get(n);if(o)for(const i of o)i()}}}const Bg=tn.createContext(void 0);function pL(){return S.useContext(Bg)}const mL=({client:e,children:t})=>tn.createElement(Bg.Provider,{value:e},t);function f1(e,...t){const n=t[0]==="skip",o=t[0]==="skip"?{}:or(t[0]),i=typeof e=="string"?a1(e):e,l=Sn(i),u=S.useMemo(()=>n?{}:{query:{query:i,args:o}},[JSON.stringify(ut(o)),l,n]),h=wL(u).query;if(h instanceof Error)throw h;return h}function Xx(e){const t=typeof e=="string"?a1(e):e,n=S.useContext(Bg);if(n===void 0)throw new Error("Could not find Convex client! `useMutation` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return S.useMemo(()=>d1(t,n),[n,Sn(t)])}function gL(e){if(typeof e=="object"&&e!==null&&"bubbles"in e&&"persist"in e&&"isDefaultPrevented"in e)throw new Error("Convex function called with SyntheticEvent object. Did you use a Convex function as an event handler directly? Event handlers like onClick receive an event object as their first argument. These SyntheticEvent objects are not valid Convex values. Try wrapping the function like `const handler = () => myMutation();` and using `handler` in the event handler.")}var yL=Object.defineProperty,vL=(e,t,n)=>t in e?yL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dm=(e,t,n)=>vL(e,typeof t!="symbol"?t+"":t,n);class bL{constructor(t){dm(this,"createWatch"),dm(this,"queries"),dm(this,"listeners"),this.createWatch=t,this.queries={},this.listeners=new Set}setQueries(t){for(const n of Object.keys(t)){const{query:o,args:i,paginationOptions:l}=t[n];if(Sn(o),this.queries[n]===void 0)this.addQuery(n,o,i,l?{paginationOptions:l}:{});else{const u=this.queries[n];(Sn(o)!==Sn(u.query)||JSON.stringify(ut(i))!==JSON.stringify(ut(u.args))||JSON.stringify(l)!==JSON.stringify(u.paginationOptions))&&(this.removeQuery(n),this.addQuery(n,o,i,l?{paginationOptions:l}:{}))}}for(const n of Object.keys(this.queries))t[n]===void 0&&this.removeQuery(n)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}getLocalResults(t){const n={};for(const o of Object.keys(t)){const{query:i,args:l}=t[o],u=t[o].paginationOptions;Sn(i);const f=this.createWatch(i,l,u?{paginationOptions:u}:{});let h;try{h=f.localQueryResult()}catch(p){if(p instanceof Error)h=p;else throw p}n[o]=h}return n}setCreateWatch(t){this.createWatch=t;for(const n of Object.keys(this.queries)){const{query:o,args:i,watch:l,paginationOptions:u}=this.queries[n],f="journal"in l?l.journal():void 0;this.removeQuery(n),this.addQuery(n,o,i,{...f?{journal:f}:[],...u?{paginationOptions:u}:{}})}}destroy(){for(const t of Object.keys(this.queries))this.removeQuery(t);this.listeners=new Set}addQuery(t,n,o,{paginationOptions:i,journal:l}){if(this.queries[t]!==void 0)throw new Error(`Tried to add a new query with identifier ${t} when it already exists.`);const u=this.createWatch(n,o,{...l?{journal:l}:[],...i?{paginationOptions:i}:{}}),f=u.onUpdate(()=>this.notifyListeners());this.queries[t]={query:n,args:o,watch:u,unsubscribe:f,...i?{paginationOptions:i}:{}}}removeQuery(t){const n=this.queries[t];if(n===void 0)throw new Error(`No query found with identifier ${t}.`);n.unsubscribe(),delete this.queries[t]}notifyListeners(){for(const t of this.listeners)t()}}function wL(e){const t=pL();if(t===void 0)throw new Error("Could not find Convex client! `useQuery` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");const n=S.useMemo(()=>(o,i,{journal:l,paginationOptions:u})=>u?t.watchPaginatedQuery(o,i,u):t.watchQuery(o,i,l?{journal:l}:{}),[t]);return xL(e,n)}function xL(e,t){const[n]=S.useState(()=>new bL(t));n.createWatch!==t&&n.setCreateWatch(t),S.useEffect(()=>()=>n.destroy(),[n]);const o=S.useMemo(()=>({getCurrentValue:()=>n.getLocalResults(e),subscribe:i=>(n.setQueries(e),n.subscribe(i))}),[n,e]);return cL(o)}const SL="/assets/globals-CoCRjt0K.css";const h1=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim();const _L=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const EL=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase());const Jx=e=>{const t=EL(e);return t.charAt(0).toUpperCase()+t.slice(1)};var TL={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 CL=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const RL=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:i="",children:l,iconNode:u,...f},h)=>S.createElement("svg",{ref:h,...TL,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:h1("lucide",i),...!l&&!CL(f)&&{"aria-hidden":"true"},...f},[...u.map(([p,y])=>S.createElement(p,y)),...Array.isArray(l)?l:[l]]));const Se=(e,t)=>{const n=S.forwardRef(({className:o,...i},l)=>S.createElement(RL,{ref:l,iconNode:t,className:h1(`lucide-${_L(Jx(e))}`,`lucide-${e}`,o),...i}));return n.displayName=Jx(e),n};const AL=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],NL=Se("archive",AL);const OL=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Bm=Se("bell",OL);const kL=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],ML=Se("book",kL);const IL=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]],DL=Se("bookmark",IL);const jL=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],p1=Se("braces",jL);const zL=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],qm=Se("calendar",zL);const LL=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],m1=Se("check",LL);const PL=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Js=Se("chevron-down",PL);const $L=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],FL=Se("chevron-right",$L);const UL=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],g1=Se("chevron-up",UL);const BL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],qL=Se("circle-alert",BL);const VL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],y1=Se("circle-question-mark",VL);const HL=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ZL=Se("clock",HL);const QL=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],GL=Se("code-xml",QL);const YL=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],KL=Se("code",YL);const XL=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],JL=Se("dollar-sign",XL);const WL=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],eP=Se("external-link",WL);const tP=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],nP=Se("eye",tP);const rP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],oP=Se("file-code",rP);const sP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],iP=Se("file-text",sP);const aP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]],lP=Se("file-type",aP);const cP=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],uP=Se("flag",cP);const dP=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],fP=Se("folder-open",dP);const hP=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],pP=Se("folder",hP);const mP=[["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"}]],gP=Se("globe",mP);const yP=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],v1=Se("hash",yP);const vP=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],bP=Se("heart",vP);const wP=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],b1=Se("house",wP);const xP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],w1=Se("image",xP);const SP=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],x1=Se("layers",SP);const _P=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],EP=Se("layout-dashboard",_P);const TP=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],CP=Se("link-2",TP);const RP=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],AP=Se("link",RP);const NP=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],OP=Se("list",NP);const kP=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],MP=Se("loader-circle",kP);const IP=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],DP=Se("lock",IP);const jP=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],zP=Se("log-out",jP);const LP=[["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"}]],PP=Se("mail",LP);const $P=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],FP=Se("map-pin",$P);const UP=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],BP=Se("message-square",UP);const qP=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],VP=Se("package",qP);const HP=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],ZP=Se("phone",HP);const QP=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],S1=Se("plus",QP);const GP=[["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"}]],YP=Se("settings",GP);const KP=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],XP=Se("square-check-big",KP);const JP=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],WP=Se("square-pen",JP);const e3=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],t3=Se("star",e3);const n3=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],r3=Se("tag",n3);const o3=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],s3=Se("tags",o3);const i3=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],a3=Se("text-align-start",i3);const l3=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],_1=Se("toggle-left",l3);const c3=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],u3=Se("trash-2",c3);const d3=[["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"}]],f3=Se("triangle-alert",d3);const h3=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],E1=Se("user",h3);const p3=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Sd=Se("x",p3);function T1(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=T1(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function C1(){for(var e,t,n=0,o="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=T1(e))&&(o&&(o+=" "),o+=t);return o}const m3=(e,t)=>{const n=new Array(e.length+t.length);for(let o=0;o<e.length;o++)n[o]=e[o];for(let o=0;o<t.length;o++)n[e.length+o]=t[o];return n},g3=(e,t)=>({classGroupId:e,validator:t}),R1=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),_d="-",Wx=[],y3="arbitrary..",v3=e=>{const t=w3(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return b3(u);const f=u.split(_d),h=f[0]===""&&f.length>1?1:0;return A1(f,h,t)},getConflictingClassGroupIds:(u,f)=>{if(f){const h=o[u],p=n[u];return h?p?m3(p,h):h:p||Wx}return n[u]||Wx}}},A1=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],l=n.nextPart.get(i);if(l){const p=A1(e,t+1,l);if(p)return p}const u=n.validators;if(u===null)return;const f=t===0?e.join(_d):e.slice(t).join(_d),h=u.length;for(let p=0;p<h;p++){const y=u[p];if(y.validator(f))return y.classGroupId}},b3=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),o=t.slice(0,n);return o?y3+o:void 0})(),w3=e=>{const{theme:t,classGroups:n}=e;return x3(n,t)},x3=(e,t)=>{const n=R1();for(const o in e){const i=e[o];qg(i,n,o,t)}return n},qg=(e,t,n,o)=>{const i=e.length;for(let l=0;l<i;l++){const u=e[l];S3(u,t,n,o)}},S3=(e,t,n,o)=>{if(typeof e=="string"){_3(e,t,n);return}if(typeof e=="function"){E3(e,t,n,o);return}T3(e,t,n,o)},_3=(e,t,n)=>{const o=e===""?t:N1(t,e);o.classGroupId=n},E3=(e,t,n,o)=>{if(C3(e)){qg(e(o),t,n,o);return}t.validators===null&&(t.validators=[]),t.validators.push(g3(n,e))},T3=(e,t,n,o)=>{const i=Object.entries(e),l=i.length;for(let u=0;u<l;u++){const[f,h]=i[u];qg(h,N1(t,f),n,o)}},N1=(e,t)=>{let n=e;const o=t.split(_d),i=o.length;for(let l=0;l<i;l++){const u=o[l];let f=n.nextPart.get(u);f||(f=R1(),n.nextPart.set(u,f)),n=f}return n},C3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,R3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),o=Object.create(null);const i=(l,u)=>{n[l]=u,t++,t>e&&(t=0,o=n,n=Object.create(null))};return{get(l){let u=n[l];if(u!==void 0)return u;if((u=o[l])!==void 0)return i(l,u),u},set(l,u){l in n?n[l]=u:i(l,u)}}},Vm="!",eS=":",A3=[],tS=(e,t,n,o,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:o,isExternal:i}),N3=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=i=>{const l=[];let u=0,f=0,h=0,p;const y=i.length;for(let x=0;x<y;x++){const C=i[x];if(u===0&&f===0){if(C===eS){l.push(i.slice(h,x)),h=x+1;continue}if(C==="/"){p=x;continue}}C==="["?u++:C==="]"?u--:C==="("?f++:C===")"&&f--}const v=l.length===0?i:i.slice(h);let w=v,_=!1;v.endsWith(Vm)?(w=v.slice(0,-1),_=!0):v.startsWith(Vm)&&(w=v.slice(1),_=!0);const R=p&&p>h?p-h:void 0;return tS(l,_,w,R)};if(t){const i=t+eS,l=o;o=u=>u.startsWith(i)?l(u.slice(i.length)):tS(A3,!1,u,void 0,!0)}if(n){const i=o;o=l=>n({className:l,parseClassName:i})}return o},O3=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,o)=>{t.set(n,1e6+o)}),n=>{const o=[];let i=[];for(let l=0;l<n.length;l++){const u=n[l],f=u[0]==="[",h=t.has(u);f||h?(i.length>0&&(i.sort(),o.push(...i),i=[]),o.push(u)):i.push(u)}return i.length>0&&(i.sort(),o.push(...i)),o}},k3=e=>({cache:R3(e.cacheSize),parseClassName:N3(e),sortModifiers:O3(e),...v3(e)}),M3=/\s+/,I3=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:i,sortModifiers:l}=t,u=[],f=e.trim().split(M3);let h="";for(let p=f.length-1;p>=0;p-=1){const y=f[p],{isExternal:v,modifiers:w,hasImportantModifier:_,baseClassName:R,maybePostfixModifierPosition:x}=n(y);if(v){h=y+(h.length>0?" "+h:h);continue}let C=!!x,N=o(C?R.substring(0,x):R);if(!N){if(!C){h=y+(h.length>0?" "+h:h);continue}if(N=o(R),!N){h=y+(h.length>0?" "+h:h);continue}C=!1}const k=w.length===0?"":w.length===1?w[0]:l(w).join(":"),O=_?k+Vm:k,M=O+N;if(u.indexOf(M)>-1)continue;u.push(M);const $=i(N,C);for(let V=0;V<$.length;++V){const L=$[V];u.push(O+L)}h=y+(h.length>0?" "+h:h)}return h},D3=(...e)=>{let t=0,n,o,i="";for(;t<e.length;)(n=e[t++])&&(o=O1(n))&&(i&&(i+=" "),i+=o);return i},O1=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=O1(e[o]))&&(n&&(n+=" "),n+=t);return n},j3=(e,...t)=>{let n,o,i,l;const u=h=>{const p=t.reduce((y,v)=>v(y),e());return n=k3(p),o=n.cache.get,i=n.cache.set,l=f,f(h)},f=h=>{const p=o(h);if(p)return p;const y=I3(h,n);return i(h,y),y};return l=u,(...h)=>l(D3(...h))},z3=[],jt=e=>{const t=n=>n[e]||z3;return t.isThemeGetter=!0,t},k1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,M1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,L3=/^\d+\/\d+$/,P3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$3=/\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$/,F3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,U3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,B3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Bi=e=>L3.test(e),Ie=e=>!!e&&!Number.isNaN(Number(e)),Uo=e=>!!e&&Number.isInteger(Number(e)),fm=e=>e.endsWith("%")&&Ie(e.slice(0,-1)),ao=e=>P3.test(e),q3=()=>!0,V3=e=>$3.test(e)&&!F3.test(e),I1=()=>!1,H3=e=>U3.test(e),Z3=e=>B3.test(e),Q3=e=>!he(e)&&!pe(e),G3=e=>ya(e,z1,I1),he=e=>k1.test(e),Os=e=>ya(e,L1,V3),hm=e=>ya(e,W3,Ie),nS=e=>ya(e,D1,I1),Y3=e=>ya(e,j1,Z3),Uu=e=>ya(e,P1,H3),pe=e=>M1.test(e),Rl=e=>va(e,L1),K3=e=>va(e,e4),rS=e=>va(e,D1),X3=e=>va(e,z1),J3=e=>va(e,j1),Bu=e=>va(e,P1,!0),ya=(e,t,n)=>{const o=k1.exec(e);return o?o[1]?t(o[1]):n(o[2]):!1},va=(e,t,n=!1)=>{const o=M1.exec(e);return o?o[1]?t(o[1]):n:!1},D1=e=>e==="position"||e==="percentage",j1=e=>e==="image"||e==="url",z1=e=>e==="length"||e==="size"||e==="bg-size",L1=e=>e==="length",W3=e=>e==="number",e4=e=>e==="family-name",P1=e=>e==="shadow",t4=()=>{const e=jt("color"),t=jt("font"),n=jt("text"),o=jt("font-weight"),i=jt("tracking"),l=jt("leading"),u=jt("breakpoint"),f=jt("container"),h=jt("spacing"),p=jt("radius"),y=jt("shadow"),v=jt("inset-shadow"),w=jt("text-shadow"),_=jt("drop-shadow"),R=jt("blur"),x=jt("perspective"),C=jt("aspect"),N=jt("ease"),k=jt("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],$=()=>[...M(),pe,he],V=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],D=()=>[pe,he,h],Y=()=>[Bi,"full","auto",...D()],ie=()=>[Uo,"none","subgrid",pe,he],le=()=>["auto",{span:["full",Uo,pe,he]},Uo,pe,he],se=()=>[Uo,"auto",pe,he],ue=()=>["auto","min","max","fr",pe,he],ce=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ge=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...D()],X=()=>[Bi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],Z=()=>[e,pe,he],ne=()=>[...M(),rS,nS,{position:[pe,he]}],be=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",X3,G3,{size:[pe,he]}],G=()=>[fm,Rl,Os],re=()=>["","none","full",p,pe,he],oe=()=>["",Ie,Rl,Os],de=()=>["solid","dashed","dotted","double"],ve=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[Ie,fm,rS,nS],_e=()=>["","none",R,pe,he],Te=()=>["none",Ie,pe,he],Ce=()=>["none",Ie,pe,he],Oe=()=>[Ie,pe,he],je=()=>[Bi,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ao],breakpoint:[ao],color:[q3],container:[ao],"drop-shadow":[ao],ease:["in","out","in-out"],font:[Q3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ao],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ao],shadow:[ao],spacing:["px",Ie],text:[ao],"text-shadow":[ao],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Bi,he,pe,C]}],container:["container"],columns:[{columns:[Ie,he,pe,f]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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:$()}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{start:Y()}],end:[{end:Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[Uo,"auto",pe,he]}],basis:[{basis:[Bi,"full","auto",f,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ie,Bi,"auto","initial","none",he]}],grow:[{grow:["",Ie,pe,he]}],shrink:[{shrink:["",Ie,pe,he]}],order:[{order:[Uo,"first","last","none",pe,he]}],"grid-cols":[{"grid-cols":ie()}],"col-start-end":[{col:le()}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":ie()}],"row-start-end":[{row:le()}],"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":ue()}],"auto-rows":[{"auto-rows":ue()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...ce(),"normal"]}],"justify-items":[{"justify-items":[...ge(),"normal"]}],"justify-self":[{"justify-self":["auto",...ge()]}],"align-content":[{content:["normal",...ce()]}],"align-items":[{items:[...ge(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ge(),{baseline:["","last"]}]}],"place-content":[{"place-content":ce()}],"place-items":[{"place-items":[...ge(),"baseline"]}],"place-self":[{"place-self":["auto",...ge()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],w:[{w:[f,"screen",...X()]}],"min-w":[{"min-w":[f,"screen","none",...X()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",n,Rl,Os]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,pe,hm]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",fm,he]}],"font-family":[{font:[K3,he,t]}],"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:[i,pe,he]}],"line-clamp":[{"line-clamp":[Ie,"none",pe,hm]}],leading:[{leading:[l,...D()]}],"list-image":[{"list-image":["none",pe,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Z()}],"text-color":[{text:Z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ie,"from-font","auto",pe,Os]}],"text-decoration-color":[{decoration:Z()}],"underline-offset":[{"underline-offset":[Ie,"auto",pe,he]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe,he]}],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",pe,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:be()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Uo,pe,he],radial:["",pe,he],conic:[Uo,pe,he]},J3,Y3]}],"bg-color":[{bg:Z()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:Z()}],"gradient-via":[{via:Z()}],"gradient-to":[{to:Z()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:Z()}],"border-color-x":[{"border-x":Z()}],"border-color-y":[{"border-y":Z()}],"border-color-s":[{"border-s":Z()}],"border-color-e":[{"border-e":Z()}],"border-color-t":[{"border-t":Z()}],"border-color-r":[{"border-r":Z()}],"border-color-b":[{"border-b":Z()}],"border-color-l":[{"border-l":Z()}],"divide-color":[{divide:Z()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ie,pe,he]}],"outline-w":[{outline:["",Ie,Rl,Os]}],"outline-color":[{outline:Z()}],shadow:[{shadow:["","none",y,Bu,Uu]}],"shadow-color":[{shadow:Z()}],"inset-shadow":[{"inset-shadow":["none",v,Bu,Uu]}],"inset-shadow-color":[{"inset-shadow":Z()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Z()}],"ring-offset-w":[{"ring-offset":[Ie,Os]}],"ring-offset-color":[{"ring-offset":Z()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":Z()}],"text-shadow":[{"text-shadow":["none",w,Bu,Uu]}],"text-shadow-color":[{"text-shadow":Z()}],opacity:[{opacity:[Ie,pe,he]}],"mix-blend":[{"mix-blend":[...ve(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ve()}],"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":[Ie]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"mask-image-linear-from-color":[{"mask-linear-from":Z()}],"mask-image-linear-to-color":[{"mask-linear-to":Z()}],"mask-image-t-from-pos":[{"mask-t-from":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"mask-image-t-from-color":[{"mask-t-from":Z()}],"mask-image-t-to-color":[{"mask-t-to":Z()}],"mask-image-r-from-pos":[{"mask-r-from":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"mask-image-r-from-color":[{"mask-r-from":Z()}],"mask-image-r-to-color":[{"mask-r-to":Z()}],"mask-image-b-from-pos":[{"mask-b-from":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"mask-image-b-from-color":[{"mask-b-from":Z()}],"mask-image-b-to-color":[{"mask-b-to":Z()}],"mask-image-l-from-pos":[{"mask-l-from":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"mask-image-l-from-color":[{"mask-l-from":Z()}],"mask-image-l-to-color":[{"mask-l-to":Z()}],"mask-image-x-from-pos":[{"mask-x-from":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"mask-image-x-from-color":[{"mask-x-from":Z()}],"mask-image-x-to-color":[{"mask-x-to":Z()}],"mask-image-y-from-pos":[{"mask-y-from":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":Z()}],"mask-image-y-to-color":[{"mask-y-to":Z()}],"mask-image-radial":[{"mask-radial":[pe,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"mask-image-radial-from-color":[{"mask-radial-from":Z()}],"mask-image-radial-to-color":[{"mask-radial-to":Z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[Ie]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"mask-image-conic-from-color":[{"mask-conic-from":Z()}],"mask-image-conic-to-color":[{"mask-conic-to":Z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:be()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,he]}],filter:[{filter:["","none",pe,he]}],blur:[{blur:_e()}],brightness:[{brightness:[Ie,pe,he]}],contrast:[{contrast:[Ie,pe,he]}],"drop-shadow":[{"drop-shadow":["","none",_,Bu,Uu]}],"drop-shadow-color":[{"drop-shadow":Z()}],grayscale:[{grayscale:["",Ie,pe,he]}],"hue-rotate":[{"hue-rotate":[Ie,pe,he]}],invert:[{invert:["",Ie,pe,he]}],saturate:[{saturate:[Ie,pe,he]}],sepia:[{sepia:["",Ie,pe,he]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,he]}],"backdrop-blur":[{"backdrop-blur":_e()}],"backdrop-brightness":[{"backdrop-brightness":[Ie,pe,he]}],"backdrop-contrast":[{"backdrop-contrast":[Ie,pe,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ie,pe,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ie,pe,he]}],"backdrop-invert":[{"backdrop-invert":["",Ie,pe,he]}],"backdrop-opacity":[{"backdrop-opacity":[Ie,pe,he]}],"backdrop-saturate":[{"backdrop-saturate":[Ie,pe,he]}],"backdrop-sepia":[{"backdrop-sepia":["",Ie,pe,he]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pe,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ie,"initial",pe,he]}],ease:[{ease:["linear","initial",N,pe,he]}],delay:[{delay:[Ie,pe,he]}],animate:[{animate:["none",k,pe,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,pe,he]}],"perspective-origin":[{"perspective-origin":$()}],rotate:[{rotate:Te()}],"rotate-x":[{"rotate-x":Te()}],"rotate-y":[{"rotate-y":Te()}],"rotate-z":[{"rotate-z":Te()}],scale:[{scale:Ce()}],"scale-x":[{"scale-x":Ce()}],"scale-y":[{"scale-y":Ce()}],"scale-z":[{"scale-z":Ce()}],"scale-3d":["scale-3d"],skew:[{skew:Oe()}],"skew-x":[{"skew-x":Oe()}],"skew-y":[{"skew-y":Oe()}],transform:[{transform:[pe,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:$()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:je()}],"translate-x":[{"translate-x":je()}],"translate-y":[{"translate-y":je()}],"translate-z":[{"translate-z":je()}],"translate-none":["translate-none"],accent:[{accent:Z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Z()}],"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",pe,he]}],"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":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",pe,he]}],fill:[{fill:["none",...Z()]}],"stroke-w":[{stroke:[Ie,Rl,Os,hm]}],stroke:[{stroke:["none",...Z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},n4=j3(t4);function De(...e){return n4(C1(e))}const r4="modulepreload",o4=function(e){return"/"+e},oS={},zr=function(t,n,o){let i=Promise.resolve();if(n&&n.length>0){let h=function(p){return Promise.all(p.map(y=>Promise.resolve(y).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),f=u?.nonce||u?.getAttribute("nonce");i=h(n.map(p=>{if(p=o4(p),p in oS)return;oS[p]=!0;const y=p.endsWith(".css"),v=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${v}`))return;const w=document.createElement("link");if(w.rel=y?"stylesheet":r4,y||(w.as="script"),w.crossOrigin="",w.href=p,f&&w.setAttribute("nonce",f),document.head.appendChild(w),y)return new Promise((_,R)=>{w.addEventListener("load",_),w.addEventListener("error",()=>R(new Error(`Unable to preload CSS for ${p}`)))})}))}function l(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return i.then(u=>{for(const f of u||[])f.status==="rejected"&&l(f.reason);return t().catch(l)})};function Hm(e,t){if(typeof Convex>"u"||Convex.syscall===void 0)throw new Error("The Convex database and auth objects are being used outside of a Convex backend. Did you mean to use `useQuery` or `useMutation` to call a Convex function?");const n=Convex.syscall(e,JSON.stringify(t));return JSON.parse(n)}async function Yt(e,t){if(typeof Convex>"u"||Convex.asyncSyscall===void 0)throw new Error("The Convex database and auth objects are being used outside of a Convex backend. Did you mean to use `useQuery` or `useMutation` to call a Convex function?");let n;try{n=await Convex.asyncSyscall(e,JSON.stringify(t))}catch(o){if(o.data!==void 0){const i=new bd(o.message);throw i.data=nn(o.data),i}throw new Error(o.message)}return JSON.parse(n)}function lt(e,t,n,o){if(e===void 0)throw new TypeError(`Must provide arg ${t} \`${o}\` to \`${n}\``)}function s4(e,t,n,o){if(!Number.isInteger(e)||e<0)throw new TypeError(`Arg ${t} \`${o}\` to \`${n}\` must be a non-negative integer`)}function $1(e){return{getUserIdentity:async()=>await Yt("1.0/getUserIdentity",{requestId:e})}}var i4=Object.defineProperty,a4=(e,t,n)=>t in e?i4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sS=(e,t,n)=>a4(e,typeof t!="symbol"?t+"":t,n);class l4{constructor(){sS(this,"_isExpression"),sS(this,"_value")}}var c4=Object.defineProperty,u4=(e,t,n)=>t in e?c4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,d4=(e,t,n)=>u4(e,t+"",n);class Gt extends l4{constructor(t){super(),d4(this,"inner"),this.inner=t}serialize(){return this.inner}}function nt(e){return e instanceof Gt?e.serialize():{$literal:ks(e)}}const f4={eq(e,t){return new Gt({$eq:[nt(e),nt(t)]})},neq(e,t){return new Gt({$neq:[nt(e),nt(t)]})},lt(e,t){return new Gt({$lt:[nt(e),nt(t)]})},lte(e,t){return new Gt({$lte:[nt(e),nt(t)]})},gt(e,t){return new Gt({$gt:[nt(e),nt(t)]})},gte(e,t){return new Gt({$gte:[nt(e),nt(t)]})},add(e,t){return new Gt({$add:[nt(e),nt(t)]})},sub(e,t){return new Gt({$sub:[nt(e),nt(t)]})},mul(e,t){return new Gt({$mul:[nt(e),nt(t)]})},div(e,t){return new Gt({$div:[nt(e),nt(t)]})},mod(e,t){return new Gt({$mod:[nt(e),nt(t)]})},neg(e){return new Gt({$neg:nt(e)})},and(...e){return new Gt({$and:e.map(nt)})},or(...e){return new Gt({$or:e.map(nt)})},not(e){return new Gt({$not:nt(e)})},field(e){return new Gt({$field:e})}};var h4=Object.defineProperty,p4=(e,t,n)=>t in e?h4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m4=(e,t,n)=>p4(e,t+"",n);class g4{constructor(){m4(this,"_isIndexRange")}}var y4=Object.defineProperty,v4=(e,t,n)=>t in e?y4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iS=(e,t,n)=>v4(e,typeof t!="symbol"?t+"":t,n);class Vo extends g4{constructor(t){super(),iS(this,"rangeExpressions"),iS(this,"isConsumed"),this.rangeExpressions=t,this.isConsumed=!1}static new(){return new Vo([])}consume(){if(this.isConsumed)throw new Error("IndexRangeBuilder has already been used! Chain your method calls like `q => q.eq(...).eq(...)`. See https://docs.convex.dev/using/indexes");this.isConsumed=!0}eq(t,n){return this.consume(),new Vo(this.rangeExpressions.concat({type:"Eq",fieldPath:t,value:ks(n)}))}gt(t,n){return this.consume(),new Vo(this.rangeExpressions.concat({type:"Gt",fieldPath:t,value:ks(n)}))}gte(t,n){return this.consume(),new Vo(this.rangeExpressions.concat({type:"Gte",fieldPath:t,value:ks(n)}))}lt(t,n){return this.consume(),new Vo(this.rangeExpressions.concat({type:"Lt",fieldPath:t,value:ks(n)}))}lte(t,n){return this.consume(),new Vo(this.rangeExpressions.concat({type:"Lte",fieldPath:t,value:ks(n)}))}export(){return this.consume(),this.rangeExpressions}}var b4=Object.defineProperty,w4=(e,t,n)=>t in e?b4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,x4=(e,t,n)=>w4(e,t+"",n);class S4{constructor(){x4(this,"_isSearchFilter")}}var _4=Object.defineProperty,E4=(e,t,n)=>t in e?_4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,aS=(e,t,n)=>E4(e,typeof t!="symbol"?t+"":t,n);class $l extends S4{constructor(t){super(),aS(this,"filters"),aS(this,"isConsumed"),this.filters=t,this.isConsumed=!1}static new(){return new $l([])}consume(){if(this.isConsumed)throw new Error("SearchFilterBuilder has already been used! Chain your method calls like `q => q.search(...).eq(...)`.");this.isConsumed=!0}search(t,n){return lt(t,1,"search","fieldName"),lt(n,2,"search","query"),this.consume(),new $l(this.filters.concat({type:"Search",fieldPath:t,value:n}))}eq(t,n){return lt(t,1,"eq","fieldName"),arguments.length!==2&&lt(n,2,"search","value"),this.consume(),new $l(this.filters.concat({type:"Eq",fieldPath:t,value:ks(n)}))}export(){return this.consume(),this.filters}}var T4=Object.defineProperty,C4=(e,t,n)=>t in e?T4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zm=(e,t,n)=>C4(e,typeof t!="symbol"?t+"":t,n);const lS=256;class F1{constructor(t){Zm(this,"tableName"),this.tableName=t}withIndex(t,n){lt(t,1,"withIndex","indexName");let o=Vo.new();return n!==void 0&&(o=n(o)),new Yo({source:{type:"IndexRange",indexName:this.tableName+"."+t,range:o.export(),order:null},operators:[]})}withSearchIndex(t,n){lt(t,1,"withSearchIndex","indexName"),lt(n,2,"withSearchIndex","searchFilter");const o=$l.new();return new Yo({source:{type:"Search",indexName:this.tableName+"."+t,filters:n(o).export()},operators:[]})}fullTableScan(){return new Yo({source:{type:"FullTableScan",tableName:this.tableName,order:null},operators:[]})}order(t){return this.fullTableScan().order(t)}async count(){const t=await Yt("1.0/count",{table:this.tableName});return nn(t)}filter(t){return this.fullTableScan().filter(t)}limit(t){return this.fullTableScan().limit(t)}collect(){return this.fullTableScan().collect()}take(t){return this.fullTableScan().take(t)}paginate(t){return this.fullTableScan().paginate(t)}first(){return this.fullTableScan().first()}unique(){return this.fullTableScan().unique()}[Symbol.asyncIterator](){return this.fullTableScan()[Symbol.asyncIterator]()}}function cS(e){throw new Error(e==="consumed"?"This query is closed and can't emit any more values.":"This query has been chained with another operator and can't be reused.")}class Yo{constructor(t){Zm(this,"state"),Zm(this,"tableNameForErrorMessages"),this.state={type:"preparing",query:t},t.source.type==="FullTableScan"?this.tableNameForErrorMessages=t.source.tableName:this.tableNameForErrorMessages=t.source.indexName.split(".")[0]}takeQuery(){if(this.state.type!=="preparing")throw new Error("A query can only be chained once and can't be chained after iteration begins.");const t=this.state.query;return this.state={type:"closed"},t}startQuery(){if(this.state.type==="executing")throw new Error("Iteration can only begin on a query once.");(this.state.type==="closed"||this.state.type==="consumed")&&cS(this.state.type);const t=this.state.query,{queryId:n}=Hm("1.0/queryStream",{query:t,version:gr});return this.state={type:"executing",queryId:n},n}closeQuery(){if(this.state.type==="executing"){const t=this.state.queryId;Hm("1.0/queryCleanup",{queryId:t})}this.state={type:"consumed"}}order(t){lt(t,1,"order","order");const n=this.takeQuery();if(n.source.type==="Search")throw new Error("Search queries must always be in relevance order. Can not set order manually.");if(n.source.order!==null)throw new Error("Queries may only specify order at most once");return n.source.order=t,new Yo(n)}filter(t){lt(t,1,"filter","predicate");const n=this.takeQuery();if(n.operators.length>=lS)throw new Error(`Can't construct query with more than ${lS} operators`);return n.operators.push({filter:nt(t(f4))}),new Yo(n)}limit(t){lt(t,1,"limit","n");const n=this.takeQuery();return n.operators.push({limit:t}),new Yo(n)}[Symbol.asyncIterator](){return this.startQuery(),this}async next(){(this.state.type==="closed"||this.state.type==="consumed")&&cS(this.state.type);const t=this.state.type==="preparing"?this.startQuery():this.state.queryId,{value:n,done:o}=await Yt("1.0/queryStreamNext",{queryId:t});return o&&this.closeQuery(),{value:nn(n),done:o}}return(){return this.closeQuery(),Promise.resolve({done:!0,value:void 0})}async paginate(t){if(lt(t,1,"paginate","options"),typeof t?.numItems!="number"||t.numItems<0)throw new Error(`\`options.numItems\` must be a positive number. Received \`${t?.numItems}\`.`);const n=this.takeQuery(),o=t.numItems,i=t.cursor,l=t?.endCursor??null,u=t.maximumRowsRead??null,{page:f,isDone:h,continueCursor:p,splitCursor:y,pageStatus:v}=await Yt("1.0/queryPage",{query:n,cursor:i,endCursor:l,pageSize:o,maximumRowsRead:u,maximumBytesRead:t.maximumBytesRead,version:gr});return{page:f.map(w=>nn(w)),isDone:h,continueCursor:p,splitCursor:y,pageStatus:v}}async collect(){const t=[];for await(const n of this)t.push(n);return t}async take(t){return lt(t,1,"take","n"),s4(t,1,"take","n"),this.limit(t).collect()}async first(){const t=await this.take(1);return t.length===0?null:t[0]}async unique(){const t=await this.take(2);if(t.length===0)return null;if(t.length===2)throw new Error(`unique() query returned more than one result from table ${this.tableNameForErrorMessages}:
20
+ [${t[0]._id}, ${t[1]._id}, ...]`);return t[0]}}async function Qm(e,t,n){if(lt(t,1,"get","id"),typeof t!="string")throw new Error(`Invalid argument \`id\` for \`db.get\`, expected string but got '${typeof t}': ${t}`);const o={id:ut(t),isSystem:n,version:gr,table:e},i=await Yt("1.0/get",o);return nn(i)}function U1(){const e=(i=!1)=>({get:async(l,u)=>u!==void 0?await Qm(l,u,i):await Qm(void 0,l,i),query:l=>new Xm(l,i).query(),normalizeId:(l,u)=>{lt(l,1,"normalizeId","tableName"),lt(u,2,"normalizeId","id");const f=l.startsWith("_");if(f!==i)throw new Error(`${f?"System":"User"} tables can only be accessed from db.${i?"":"system."}normalizeId().`);const h=Hm("1.0/db/normalizeId",{table:l,idString:u});return nn(h).id},system:null,table:l=>new Xm(l,i)}),{system:t,...n}=e(!0),o=e();return o.system=n,o}async function B1(e,t){if(e.startsWith("_"))throw new Error("System tables (prefixed with `_`) are read-only.");lt(e,1,"insert","table"),lt(t,2,"insert","value");const n=await Yt("1.0/insert",{table:e,value:ut(t)});return nn(n)._id}async function Gm(e,t,n){lt(t,1,"patch","id"),lt(n,2,"patch","value"),await Yt("1.0/shallowMerge",{id:ut(t),value:iz(n),table:e})}async function Ym(e,t,n){lt(t,1,"replace","id"),lt(n,2,"replace","value"),await Yt("1.0/replace",{id:ut(t),value:ut(n),table:e})}async function Km(e,t){lt(t,1,"delete","id"),await Yt("1.0/remove",{id:ut(t),table:e})}function R4(){const e=U1();return{get:e.get,query:e.query,normalizeId:e.normalizeId,system:e.system,insert:async(t,n)=>await B1(t,n),patch:async(t,n,o)=>o!==void 0?await Gm(t,n,o):await Gm(void 0,t,n),replace:async(t,n,o)=>o!==void 0?await Ym(t,n,o):await Ym(void 0,t,n),delete:async(t,n)=>n!==void 0?await Km(t,n):await Km(void 0,t),table:t=>new A4(t,!1)}}class Xm{constructor(t,n){this.tableName=t,this.isSystem=n}async get(t){return Qm(this.tableName,t,this.isSystem)}query(){const t=this.tableName.startsWith("_");if(t!==this.isSystem)throw new Error(`${t?"System":"User"} tables can only be accessed from db.${this.isSystem?"":"system."}query().`);return new F1(this.tableName)}}class A4 extends Xm{async insert(t){return B1(this.tableName,t)}async patch(t,n){return Gm(this.tableName,t,n)}async replace(t,n){return Ym(this.tableName,t,n)}async delete(t){return Km(this.tableName,t)}}function N4(){return{runAfter:async(e,t,n)=>{const o=O4(e,t,n);return await Yt("1.0/schedule",o)},runAt:async(e,t,n)=>{const o=k4(e,t,n);return await Yt("1.0/schedule",o)},cancel:async e=>{lt(e,1,"cancel","id");const t={id:ut(e)};await Yt("1.0/cancel_job",t)}}}function O4(e,t,n){if(typeof e!="number")throw new Error("`delayMs` must be a number");if(!isFinite(e))throw new Error("`delayMs` must be a finite number");if(e<0)throw new Error("`delayMs` must be non-negative");const o=or(n),i=Yd(t),l=(Date.now()+e)/1e3;return{...i,ts:l,args:ut(o),version:gr}}function k4(e,t,n){let o;if(e instanceof Date)o=e.valueOf()/1e3;else if(typeof e=="number")o=e/1e3;else throw new Error("The invoke time must a Date or a timestamp");const i=Yd(t),l=or(n);return{...i,ts:o,args:ut(l),version:gr}}function q1(e){return{getUrl:async t=>(lt(t,1,"getUrl","storageId"),await Yt("1.0/storageGetUrl",{requestId:e,version:gr,storageId:t})),getMetadata:async t=>await Yt("1.0/storageGetMetadata",{requestId:e,version:gr,storageId:t})}}function M4(e){const t=q1(e);return{generateUploadUrl:async()=>await Yt("1.0/storageGenerateUploadUrl",{requestId:e,version:gr}),delete:async n=>{await Yt("1.0/storageDelete",{requestId:e,version:gr,storageId:n})},getUrl:t.getUrl,getMetadata:t.getMetadata}}async function V1(e,t){const o=nn(JSON.parse(t)),i={db:R4(),auth:$1(""),storage:M4(""),scheduler:N4(),runQuery:(u,f)=>Jm("query",u,f),runMutation:(u,f)=>Jm("mutation",u,f)},l=await Z1(e,i,o);return H1(l),JSON.stringify(ut(l===void 0?null:l))}function H1(e){if(e instanceof F1||e instanceof Yo)throw new Error("Return value is a Query. Results must be retrieved with `.collect()`, `.take(n), `.unique()`, or `.first()`.")}async function Z1(e,t,n){let o;try{o=await Promise.resolve(e(t,...n))}catch(i){throw I4(i)}return o}function Vg(e,t){return(n,o)=>(globalThis.console.warn(`Convex functions should not directly call other Convex functions. Consider calling a helper function instead. e.g. \`export const foo = ${e}(...); await foo(ctx);\` is not supported. See https://docs.convex.dev/production/best-practices/#use-helper-functions-to-write-shared-code`),t(n,o))}function I4(e){if(typeof e=="object"&&e!==null&&Symbol.for("ConvexError")in e){const t=e;return t.data=JSON.stringify(ut(t.data===void 0?null:t.data)),t.ConvexErrorSymbol=Symbol.for("ConvexError"),t}else return e}function Hg(){if(typeof window>"u"||window.__convexAllowFunctionsInBrowser)return;(Object.getOwnPropertyDescriptor(globalThis,"window")?.get?.toString().includes("[native code]")??!1)&&console.error("Convex functions should not be imported in the browser. This will throw an error in future versions of `convex`. If this is a false negative, please report it to Convex support.")}function Q1(e,t){if(t===void 0)throw new Error(`A validator is undefined for field "${e}". This is often caused by circular imports. See https://docs.convex.dev/error#undefined-validator for details.`);return t}function Zg(e){return()=>{let t=c.any();return typeof e=="object"&&e.args!==void 0&&(t=e1(e.args)),JSON.stringify(t.json,Q1)}}function Qg(e){return()=>{let t;return typeof e=="object"&&e.returns!==void 0&&(t=e1(e.returns)),JSON.stringify(t?t.json:null,Q1)}}const D4=(e=>{const t=typeof e=="function"?e:e.handler,n=Vg("mutation",t);return Hg(),n.isMutation=!0,n.isPublic=!0,n.invokeMutation=o=>V1(t,o),n.exportArgs=Zg(e),n.exportReturns=Qg(e),n._handler=t,n}),j4=(e=>{const t=typeof e=="function"?e:e.handler,n=Vg("internalMutation",t);return Hg(),n.isMutation=!0,n.isInternal=!0,n.invokeMutation=o=>V1(t,o),n.exportArgs=Zg(e),n.exportReturns=Qg(e),n._handler=t,n});async function z4(e,t){const o=nn(JSON.parse(t)),i={db:U1(),auth:$1(""),storage:q1(""),runQuery:(u,f)=>Jm("query",u,f)},l=await Z1(e,i,o);return H1(l),JSON.stringify(ut(l===void 0?null:l))}const L4=(e=>{const t=typeof e=="function"?e:e.handler,n=Vg("query",t);return Hg(),n.isQuery=!0,n.isPublic=!0,n.invokeQuery=o=>z4(t,o),n.exportArgs=Zg(e),n.exportReturns=Qg(e),n._handler=t,n});async function Jm(e,t,n){const o=or(n),i={udfType:e,args:ut(o),...Yd(t)},l=await Yt("1.0/runUdf",i);return nn(l)}const Kd=c.object({numItems:c.number(),cursor:c.union(c.string(),c.null()),endCursor:c.optional(c.union(c.string(),c.null())),id:c.optional(c.number()),maximumRowsRead:c.optional(c.number()),maximumBytesRead:c.optional(c.number())});function G1(e,t){const n={get(o,i){if(typeof i=="string"){const l=[...t,i];return G1(e,l)}else if(i===i1){if(t.length<1){const l=[e,...t].join(".");throw new Error(`API path is expected to be of the form \`${e}.childComponent.functionName\`. Found: \`${l}\``)}return"_reference/childComponent/"+t.join("/")}else return}};return new Proxy({},n)}const P4=()=>G1("components",[]);var $4=Object.defineProperty,F4=(e,t,n)=>t in e?$4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rr=(e,t,n)=>F4(e,typeof t!="symbol"?t+"":t,n);class uS{constructor(t){Rr(this,"indexes"),Rr(this,"stagedDbIndexes"),Rr(this,"searchIndexes"),Rr(this,"stagedSearchIndexes"),Rr(this,"vectorIndexes"),Rr(this,"stagedVectorIndexes"),Rr(this,"validator"),this.indexes=[],this.stagedDbIndexes=[],this.searchIndexes=[],this.stagedSearchIndexes=[],this.vectorIndexes=[],this.stagedVectorIndexes=[],this.validator=t}" indexes"(){return this.indexes}index(t,n){return Array.isArray(n)?this.indexes.push({indexDescriptor:t,fields:n}):n.staged?this.stagedDbIndexes.push({indexDescriptor:t,fields:n.fields}):this.indexes.push({indexDescriptor:t,fields:n.fields}),this}searchIndex(t,n){return n.staged?this.stagedSearchIndexes.push({indexDescriptor:t,searchField:n.searchField,filterFields:n.filterFields||[]}):this.searchIndexes.push({indexDescriptor:t,searchField:n.searchField,filterFields:n.filterFields||[]}),this}vectorIndex(t,n){return n.staged?this.stagedVectorIndexes.push({indexDescriptor:t,vectorField:n.vectorField,dimensions:n.dimensions,filterFields:n.filterFields||[]}):this.vectorIndexes.push({indexDescriptor:t,vectorField:n.vectorField,dimensions:n.dimensions,filterFields:n.filterFields||[]}),this}self(){return this}export(){const t=this.validator.json;if(typeof t!="object")throw new Error("Invalid validator: please make sure that the parameter of `defineTable` is valid (see https://docs.convex.dev/database/schemas)");return{indexes:this.indexes,stagedDbIndexes:this.stagedDbIndexes,searchIndexes:this.searchIndexes,stagedSearchIndexes:this.stagedSearchIndexes,vectorIndexes:this.vectorIndexes,stagedVectorIndexes:this.stagedVectorIndexes,documentType:t}}}function en(e){return WE(e)?new uS(e):new uS(c.object(e))}class U4{constructor(t,n){Rr(this,"tables"),Rr(this,"strictTableNameTypes"),Rr(this,"schemaValidation"),this.tables=t,this.schemaValidation=n?.schemaValidation===void 0?!0:n.schemaValidation}export(){return JSON.stringify({tables:Object.entries(this.tables).map(([t,n])=>{const{indexes:o,stagedDbIndexes:i,searchIndexes:l,stagedSearchIndexes:u,vectorIndexes:f,stagedVectorIndexes:h,documentType:p}=n.export();return{tableName:t,indexes:o,stagedDbIndexes:i,searchIndexes:l,stagedSearchIndexes:u,vectorIndexes:f,stagedVectorIndexes:h,documentType:p}}),schemaValidation:this.schemaValidation})}}function Y1(e,t){return new U4(e,t)}Y1({_scheduled_functions:en({name:c.string(),args:c.array(c.any()),scheduledTime:c.float64(),completedTime:c.optional(c.float64()),state:c.union(c.object({kind:c.literal("pending")}),c.object({kind:c.literal("inProgress")}),c.object({kind:c.literal("success")}),c.object({kind:c.literal("failed"),error:c.string()}),c.object({kind:c.literal("canceled")}))}),_storage:en({sha256:c.string(),size:c.float64(),contentType:c.optional(c.string())})});function cn(e,t){return Object.fromEntries(Object.entries(e).filter(([n])=>!t.includes(n)))}const dS=["text","richText","number","boolean","date","datetime","reference","media","json","select","multiSelect","tags","category"];c.union(c.literal("text"),c.literal("richText"),c.literal("number"),c.literal("boolean"),c.literal("date"),c.literal("datetime"),c.literal("reference"),c.literal("media"),c.literal("json"),c.literal("select"),c.literal("multiSelect"),c.literal("tags"),c.literal("category"));const yr=c.string(),Gg=c.union(c.literal("image"),c.literal("video"),c.literal("audio"),c.literal("document"),c.literal("other")),nc=c.union(c.literal("thumbnail"),c.literal("responsive"),c.literal("format")),Yg=c.union(c.literal("pending"),c.literal("processing"),c.literal("completed"),c.literal("failed")),En={name:c.string(),label:c.string(),required:c.boolean(),searchable:c.optional(c.boolean()),localized:c.optional(c.boolean()),description:c.optional(c.string()),defaultValue:c.optional(c.any())},K1=c.object({...En,type:c.literal("text"),options:c.optional(c.object({minLength:c.optional(c.number()),maxLength:c.optional(c.number()),pattern:c.optional(c.string())}))}),X1=c.object({...En,type:c.literal("number"),options:c.optional(c.object({min:c.optional(c.number()),max:c.optional(c.number()),step:c.optional(c.number()),precision:c.optional(c.number())}))}),J1=c.object({...En,type:c.literal("boolean"),options:c.optional(c.object({trueLabel:c.optional(c.string()),falseLabel:c.optional(c.string())}))}),W1=c.object({...En,type:c.literal("richText"),options:c.optional(c.object({allowedBlocks:c.optional(c.array(c.string())),allowedMarks:c.optional(c.array(c.string()))}))}),eT=c.object({...En,type:c.literal("media"),options:c.optional(c.object({mediaType:c.optional(Gg),allowedMimeTypes:c.optional(c.array(c.string())),maxFileSize:c.optional(c.number()),multiple:c.optional(c.boolean())}))}),tT=c.object({...En,type:c.literal("select"),options:c.optional(c.object({options:c.optional(c.array(c.object({value:c.string(),label:c.string()})))}))}),B4=c.object({...En,type:c.literal("tags"),options:c.optional(c.object({taxonomyId:c.optional(c.id("taxonomies")),allowCreate:c.optional(c.boolean()),maxTags:c.optional(c.number()),minTags:c.optional(c.number())}))}),nT=c.object({...En,type:c.literal("category"),options:c.optional(c.object({allowMultiple:c.optional(c.boolean())}))}),rT=c.object({...En,type:c.literal("json"),options:c.optional(c.object({schema:c.optional(c.any())}))}),oT=c.object({...En,type:c.literal("reference"),options:c.optional(c.object({allowedContentTypes:c.optional(c.array(c.string())),multiple:c.optional(c.boolean()),minItems:c.optional(c.number())}))}),sT=c.object({...En,type:c.literal("multiSelect"),options:c.optional(c.object({options:c.optional(c.array(c.object({value:c.string(),label:c.string()})))}))}),iT=c.object({...En,type:c.literal("date"),options:c.optional(c.object({min:c.optional(c.number()),max:c.optional(c.number())}))}),aT=c.object({...En,type:c.literal("datetime"),options:c.optional(c.object({min:c.optional(c.number()),max:c.optional(c.number())}))}),Kg=c.union(K1,X1,J1,W1,eT,tT,sT,B4,nT,rT,iT,aT,oT),q4={name:c.string(),displayName:c.string(),createdBy:c.string(),description:c.optional(c.string()),fields:c.array(Kg),icon:c.optional(c.string()),singleton:c.optional(c.boolean()),slugField:c.optional(c.string()),titleField:c.optional(c.string()),sortOrder:c.optional(c.number()),isActive:c.boolean(),deletedAt:c.optional(c.number()),updatedBy:c.optional(c.string())},V4={contentTypeName:c.string(),slug:c.string(),status:yr,data:c.any(),locale:c.optional(c.string()),primaryEntryId:c.optional(c.id("contentEntries")),version:c.number(),scheduledPublishAt:c.optional(c.number()),firstPublishedAt:c.optional(c.number()),lastPublishedAt:c.optional(c.number()),lockedBy:c.optional(c.string()),lockExpiresAt:c.optional(c.number()),deletedAt:c.optional(c.number()),createdBy:c.optional(c.string()),updatedBy:c.optional(c.string()),searchText:c.optional(c.string())},H4={entryId:c.id("contentEntries"),versionNumber:c.number(),data:c.any(),slug:c.string(),status:yr,changeDescription:c.optional(c.string()),createdBy:c.optional(c.string()),wasPublished:c.boolean(),publishedAt:c.optional(c.number())},Ed={name:c.string(),title:c.optional(c.string()),description:c.optional(c.string()),parentId:c.optional(c.id("mediaItems")),path:c.string(),tags:c.optional(c.array(c.string())),size:c.optional(c.number()),metadata:c.optional(c.record(c.string(),c.any())),deletedAt:c.optional(c.number()),createdBy:c.optional(c.string()),updatedBy:c.optional(c.string()),searchText:c.optional(c.string())},lT={kind:c.literal("asset"),storageId:c.id("_storage"),mimeType:c.string(),width:c.optional(c.number()),height:c.optional(c.number()),duration:c.optional(c.number()),altText:c.optional(c.string())},cT={kind:c.literal("folder"),sortOrder:c.optional(c.number())},Xd=c.object({...Ed,...lT}),uT=c.object({...Ed,...cT});c.union(Xd,uT);const Z4={assetId:c.id("mediaItems"),storageId:c.id("_storage"),variantType:c.union(c.literal("thumbnail"),c.literal("responsive"),c.literal("format")),width:c.optional(c.number()),height:c.optional(c.number()),format:c.string(),mimeType:c.string(),size:c.number(),quality:c.optional(c.number()),preset:c.optional(c.string()),autoGenerated:c.boolean(),status:c.union(c.literal("pending"),c.literal("processing"),c.literal("completed"),c.literal("failed")),errorMessage:c.optional(c.string()),processingStartedAt:c.optional(c.number()),processingCompletedAt:c.optional(c.number()),deletedAt:c.optional(c.number()),createdBy:c.optional(c.string())},Q4={name:c.string(),displayName:c.string(),description:c.optional(c.string()),isHierarchical:c.boolean(),allowInlineCreation:c.boolean(),icon:c.optional(c.string()),sortOrder:c.optional(c.number()),isActive:c.boolean(),deletedAt:c.optional(c.number()),createdBy:c.optional(c.string()),updatedBy:c.optional(c.string())},G4={taxonomyId:c.id("taxonomies"),slug:c.string(),name:c.string(),description:c.optional(c.string()),parentId:c.optional(c.id("taxonomyTerms")),path:c.optional(c.string()),depth:c.number(),color:c.optional(c.string()),icon:c.optional(c.string()),sortOrder:c.optional(c.number()),usageCount:c.number(),deletedAt:c.optional(c.number()),createdBy:c.optional(c.string()),updatedBy:c.optional(c.string()),searchText:c.optional(c.string())},Tn=Y1({contentTypes:en({...q4}).index("by_name",["name"]).index("by_active",["isActive"]).index("by_deleted",["deletedAt"]),contentEntries:en({...V4}).index("by_content_type",["contentTypeName"]).index("by_content_type_and_slug",["contentTypeName","slug"]).index("by_status",["status"]).index("by_content_type_and_status",["contentTypeName","status"]).index("by_primary_entry",["primaryEntryId"]).index("by_locale",["locale"]).index("by_deleted",["deletedAt"]).index("by_scheduled_publish",["status","scheduledPublishAt"]).index("by_locked",["lockedBy"]).searchIndex("search_content",{searchField:"searchText",filterFields:["contentTypeName","status","locale"]}),contentVersions:en({...H4}).index("by_entry",["entryId"]).index("by_entry_and_version",["entryId","versionNumber"]).index("by_entry_and_published",["entryId","wasPublished"]),mediaItems:en(c.union(c.object({...Ed,...lT}),c.object({...Ed,...cT}))).index("by_parent",["parentId"]).index("by_path",["path"]).index("by_kind",["kind"]).index("by_kind_and_parent",["kind","parentId"]).index("by_storage_id",["storageId"]).index("by_mime_type",["mimeType"]).index("by_deleted",["deletedAt"]).searchIndex("search_media",{searchField:"searchText"}),mediaVariants:en({...Z4}).index("by_asset",["assetId"]).index("by_asset_and_type",["assetId","variantType"]).index("by_asset_and_preset",["assetId","preset"]).index("by_asset_and_format",["assetId","format"]).index("by_status",["status"]).index("by_deleted",["deletedAt"]),taxonomies:en({...Q4}).index("by_name",["name"]).index("by_active",["isActive"]).index("by_deleted",["deletedAt"]),taxonomyTerms:en({...G4}).index("by_taxonomy",["taxonomyId"]).index("by_taxonomy_and_slug",["taxonomyId","slug"]).index("by_parent",["parentId"]).index("by_taxonomy_and_path",["taxonomyId","path"]).index("by_deleted",["deletedAt"]).index("by_taxonomy_and_usage",["taxonomyId","usageCount"]).searchIndex("search_terms",{searchField:"searchText",filterFields:["taxonomyId"]}),contentEntryTags:en({entryId:c.id("contentEntries"),termId:c.id("taxonomyTerms"),taxonomyId:c.id("taxonomies"),fieldName:c.string(),sortOrder:c.optional(c.number())}).index("by_entry",["entryId"]).index("by_term",["termId"]).index("by_taxonomy",["taxonomyId"]).index("by_entry_and_field",["entryId","fieldName"]).index("by_taxonomy_and_term",["taxonomyId","termId"]),mediaAssetTags:en({mediaId:c.id("mediaItems"),termId:c.id("taxonomyTerms"),taxonomyId:c.id("taxonomies"),sortOrder:c.optional(c.number())}).index("by_media",["mediaId"]).index("by_term",["termId"]).index("by_taxonomy",["taxonomyId"]).index("by_media_and_taxonomy",["mediaId","taxonomyId"]).index("by_taxonomy_and_term",["taxonomyId","termId"]),trashConfig:en({retentionDays:c.number(),autoCleanupEnabled:c.boolean(),lastCleanupAt:c.optional(c.number()),lastCleanupCount:c.optional(c.number()),updatedBy:c.optional(c.string())}),cmsEvents:en({eventType:c.string(),resourceType:c.union(c.literal("contentEntry"),c.literal("contentType"),c.literal("mediaAsset"),c.literal("mediaFolder")),resourceId:c.string(),action:c.union(c.literal("created"),c.literal("updated"),c.literal("published"),c.literal("unpublished"),c.literal("deleted"),c.literal("restored"),c.literal("duplicated"),c.literal("scheduled")),payload:c.any(),userId:c.optional(c.string()),processed:c.boolean(),processedAt:c.optional(c.number()),correlationId:c.optional(c.string()),metadata:c.optional(c.any())}).index("by_event_type",["eventType"]).index("by_resource",["resourceType","resourceId"]).index("by_processed",["processed"]).index("by_user",["userId"]).index("by_correlation_id",["correlationId"]),webhookConfigs:en({name:c.string(),description:c.optional(c.string()),url:c.string(),secret:c.optional(c.string()),eventTypes:c.array(c.string()),resourceTypes:c.optional(c.array(c.union(c.literal("contentEntry"),c.literal("contentType"),c.literal("mediaAsset"),c.literal("mediaFolder")))),contentTypes:c.optional(c.array(c.string())),headers:c.optional(c.any()),enabled:c.boolean(),maxRetries:c.optional(c.number()),timeoutMs:c.optional(c.number()),deletedAt:c.optional(c.number()),createdBy:c.optional(c.string()),updatedBy:c.optional(c.string())}).index("by_enabled",["enabled"]).index("by_deleted",["deletedAt"]),webhookDeliveries:en({webhookId:c.id("webhookConfigs"),eventId:c.id("cmsEvents"),eventType:c.string(),status:c.union(c.literal("pending"),c.literal("processing"),c.literal("delivered"),c.literal("failed"),c.literal("retrying")),attemptCount:c.number(),maxAttempts:c.number(),lastAttemptAt:c.optional(c.number()),nextRetryAt:c.optional(c.number()),lastStatusCode:c.optional(c.number()),lastError:c.optional(c.string()),lastResponseBody:c.optional(c.string()),lastDurationMs:c.optional(c.number()),payload:c.any(),deliveredAt:c.optional(c.number())}).index("by_webhook",["webhookId"]).index("by_event",["eventId"]).index("by_status",["status"]).index("by_next_retry",["status","nextRetryAt"]).index("by_webhook_and_status",["webhookId","status"]),cmsSettings:en({defaultLocale:c.string(),availableLocales:c.array(c.string()),updatedBy:c.optional(c.string())})}),{contentTypes:SG,contentEntries:_G,contentVersions:EG,mediaItems:TG,mediaVariants:CG,taxonomies:RG,taxonomyTerms:AG,contentEntryTags:NG,mediaAssetTags:OG,cmsEvents:kG,webhookConfigs:MG,webhookDeliveries:IG,cmsSettings:DG}=Tn.tables;c.string();c.float64();c.float64();c.boolean();c.int64();c.int64();c.any();c.null();c.bytes();const Y4=e=>({_id:c.id(e),_creationTime:c.number()}),Bn=(e,t)=>{function n(o){if(o.kind==="object")return c.object({...o.fields,...Y4(t)});if(o.kind!=="union")throw new Error("Only object and union validators are supported for documents");return c.union(...o.members.map(n))}return n(e.tables[t].validator)};c.optional(c.any());const K4=c.object({name:c.string(),displayName:c.string(),createdBy:c.string(),description:c.optional(c.string()),fields:c.array(Kg),icon:c.optional(c.string()),singleton:c.optional(c.boolean()),slugField:c.optional(c.string()),titleField:c.optional(c.string()),sortOrder:c.optional(c.number())}),X4=c.object({id:c.id("contentTypes"),displayName:c.optional(c.string()),description:c.optional(c.string()),fields:c.optional(c.array(Kg)),icon:c.optional(c.string()),singleton:c.optional(c.boolean()),slugField:c.optional(c.string()),titleField:c.optional(c.string()),sortOrder:c.optional(c.number()),isActive:c.optional(c.boolean()),updatedBy:c.optional(c.string())}),J4=c.object({id:c.id("contentTypes"),cascade:c.optional(c.boolean()),hardDelete:c.optional(c.boolean()),deletedBy:c.optional(c.string())}),W4=c.object({contentTypeName:c.string(),slug:c.optional(c.string()),data:c.any(),locale:c.optional(c.string()),primaryEntryId:c.optional(c.id("contentEntries")),status:c.optional(yr),scheduledPublishAt:c.optional(c.number()),createdBy:c.optional(c.string())}),e$=c.object({id:c.id("contentEntries"),slug:c.optional(c.string()),data:c.optional(c.any()),status:c.optional(yr),scheduledPublishAt:c.optional(c.number()),updatedBy:c.optional(c.string()),regenerateSlug:c.optional(c.boolean())}),t$=c.object({id:c.id("contentEntries"),changeDescription:c.optional(c.string()),updatedBy:c.optional(c.string())});c.object({id:c.id("contentEntries"),publishAt:c.number(),updatedBy:c.optional(c.string())});c.object({id:c.id("contentEntries"),updatedBy:c.optional(c.string())});const n$=c.object({id:c.id("contentEntries"),deletedBy:c.optional(c.string()),hardDelete:c.optional(c.boolean())}),r$=c.object({sourceEntryId:c.id("contentEntries"),slug:c.optional(c.string()),copyMediaReferences:c.optional(c.boolean()),locale:c.optional(c.string()),createdBy:c.optional(c.string())});c.object({entryId:c.id("contentEntries"),paginationOpts:Kd});c.object({entryId:c.id("contentEntries"),versionId:c.optional(c.id("contentVersions")),versionNumber:c.optional(c.number())});c.object({entryId:c.id("contentEntries"),versionNumber:c.number(),updatedBy:c.optional(c.string())});c.object({entryId:c.id("contentEntries"),changeDescription:c.optional(c.string()),createdBy:c.optional(c.string()),wasPublished:c.optional(c.boolean())});c.object({entryId:c.id("contentEntries"),fromVersionNumber:c.number(),toVersionNumber:c.number()});const dT=c.object({field:c.string(),fromValue:c.optional(c.any()),toValue:c.optional(c.any()),changeType:c.union(c.literal("added"),c.literal("removed"),c.literal("modified"))});c.object({hasChanges:c.boolean(),fromVersion:c.object({versionNumber:c.number(),status:yr,slug:c.string(),wasPublished:c.boolean(),createdAt:c.number()}),toVersion:c.object({versionNumber:c.number(),status:yr,slug:c.string(),wasPublished:c.boolean(),createdAt:c.number()}),changedFields:c.array(c.string()),fieldDiffs:c.array(dT),slugChanged:c.boolean(),statusChanged:c.boolean(),changeSummary:c.string()});const o$=c.object({storageId:c.id("_storage"),mimeType:c.string(),name:c.string(),title:c.optional(c.string()),description:c.optional(c.string()),parentId:c.optional(c.id("mediaItems")),tags:c.optional(c.array(c.string())),size:c.optional(c.number()),metadata:c.optional(c.record(c.string(),c.any())),width:c.optional(c.number()),height:c.optional(c.number()),duration:c.optional(c.number()),altText:c.optional(c.string()),createdBy:c.optional(c.string())}),s$=c.object({id:c.id("mediaItems"),name:c.optional(c.string()),title:c.optional(c.string()),description:c.optional(c.string()),parentId:c.optional(c.id("mediaItems")),tags:c.optional(c.array(c.string())),metadata:c.optional(c.record(c.string(),c.any())),width:c.optional(c.number()),height:c.optional(c.number()),duration:c.optional(c.number()),altText:c.optional(c.string()),updatedBy:c.optional(c.string())}),i$=c.object({id:c.id("mediaItems"),deletedBy:c.optional(c.string()),hardDelete:c.optional(c.boolean()),forceDelete:c.optional(c.boolean())}),a$=c.object({id:c.id("mediaItems"),restoredBy:c.optional(c.string())});c.object({name:c.string(),title:c.optional(c.string()),description:c.optional(c.string()),parentId:c.optional(c.id("mediaItems")),tags:c.optional(c.array(c.string())),metadata:c.optional(c.record(c.string(),c.any())),sortOrder:c.optional(c.number()),createdBy:c.optional(c.string())});c.object({id:c.id("mediaItems"),name:c.optional(c.string()),title:c.optional(c.string()),description:c.optional(c.string()),parentId:c.optional(c.id("mediaItems")),tags:c.optional(c.array(c.string())),metadata:c.optional(c.record(c.string(),c.any())),sortOrder:c.optional(c.number()),updatedBy:c.optional(c.string())});c.object({id:c.id("mediaItems"),newParentId:c.optional(c.id("mediaItems")),updatedBy:c.optional(c.string())});c.object({id:c.id("mediaItems"),deletedBy:c.optional(c.string()),hardDelete:c.optional(c.boolean()),recursive:c.optional(c.boolean())});c.object({id:c.id("mediaItems"),restoredBy:c.optional(c.string()),recursive:c.optional(c.boolean())});const l$=c.object({assetIds:c.array(c.id("mediaItems")),targetFolderId:c.optional(c.id("mediaItems")),movedBy:c.optional(c.string())}),c$=c.object({id:c.id("mediaItems"),success:c.boolean(),error:c.optional(c.string()),previousFolderId:c.optional(c.id("mediaItems"))}),u$=c.object({total:c.number(),succeeded:c.number(),failed:c.number(),targetFolderId:c.optional(c.id("mediaItems")),targetFolderPath:c.optional(c.string()),results:c.array(c$)});c.object({assetId:c.id("mediaItems"),storageId:c.id("_storage"),variantType:nc,width:c.optional(c.number()),height:c.optional(c.number()),format:c.string(),mimeType:c.string(),size:c.number(),quality:c.optional(c.number()),preset:c.optional(c.string()),autoGenerated:c.optional(c.boolean()),createdBy:c.optional(c.string())});c.object({assetId:c.id("mediaItems"),variantType:nc,width:c.optional(c.number()),height:c.optional(c.number()),format:c.string(),quality:c.optional(c.number()),preset:c.optional(c.string()),requestedBy:c.optional(c.string())});c.object({id:c.id("mediaVariants"),status:Yg,storageId:c.optional(c.id("_storage")),size:c.optional(c.number()),mimeType:c.optional(c.string()),width:c.optional(c.number()),height:c.optional(c.number()),errorMessage:c.optional(c.string())});c.object({id:c.id("mediaVariants"),hardDelete:c.optional(c.boolean()),deletedBy:c.optional(c.string())});c.object({assetId:c.id("mediaItems"),hardDelete:c.optional(c.boolean()),deletedBy:c.optional(c.string())});c.object({id:c.id("mediaVariants"),includeDeleted:c.optional(c.boolean())});c.object({assetId:c.id("mediaItems"),variantType:c.optional(nc),format:c.optional(c.string()),preset:c.optional(c.string()),status:c.optional(Yg),includeDeleted:c.optional(c.boolean())});c.object({assetId:c.id("mediaItems"),targetWidth:c.optional(c.number()),targetHeight:c.optional(c.number()),preferredFormat:c.optional(c.string()),fallbackToOriginal:c.optional(c.boolean())});const d$=Bn(Tn,"mediaVariants");c.object({...d$.fields,url:c.union(c.string(),c.null())});c.object({name:c.string(),variantType:nc,width:c.optional(c.number()),height:c.optional(c.number()),format:c.string(),quality:c.optional(c.number()),description:c.optional(c.string())});c.object({total:c.number(),succeeded:c.number(),failed:c.number(),results:c.array(c.object({preset:c.string(),success:c.boolean(),variantId:c.optional(c.id("mediaVariants")),error:c.optional(c.string())}))});const f$=c.object({url:c.string(),descriptor:c.string(),width:c.number(),format:c.string()});c.object({src:c.union(c.string(),c.null()),srcset:c.string(),entries:c.array(f$),sizes:c.optional(c.string())});c.object({contentTypeName:c.optional(c.string()),status:c.optional(yr),statusIn:c.optional(c.array(yr)),locale:c.optional(c.string()),search:c.optional(c.string()),includeDeleted:c.optional(c.boolean()),cursor:c.optional(c.string()),limit:c.optional(c.number())});c.object({folderId:c.optional(c.id("mediaItems")),type:c.optional(Gg),mimeType:c.optional(c.string()),search:c.optional(c.string()),tags:c.optional(c.array(c.string())),includeDeleted:c.optional(c.boolean()),cursor:c.optional(c.string()),limit:c.optional(c.number())});const h$=c.union(c.literal("asc"),c.literal("desc")),p$=c.union(c.literal("_creationTime"),c.literal("filename"),c.literal("size"),c.literal("type"),c.literal("mimeType"));c.object({folderId:c.optional(c.id("mediaItems")),includeRootLevel:c.optional(c.boolean()),type:c.optional(Gg),mimeType:c.optional(c.string()),mimeTypePrefix:c.optional(c.string()),search:c.optional(c.string()),tags:c.optional(c.array(c.string())),includeDeleted:c.optional(c.boolean()),deletedOnly:c.optional(c.boolean()),sortField:c.optional(p$),sortDirection:c.optional(h$),paginationOpts:Kd});const ba=Bn(Tn,"contentTypes"),Cn=Bn(Tn,"contentEntries"),m$=Bn(Tn,"contentVersions"),Xg=Bn(Tn,"mediaItems"),g$=Bn(Tn,"taxonomies"),y$=Bn(Tn,"taxonomyTerms");Bn(Tn,"contentEntryTags");Bn(Tn,"webhookConfigs");Bn(Tn,"webhookDeliveries");Bn(Tn,"cmsSettings");c.object({versioning:c.boolean(),scheduling:c.boolean(),localization:c.boolean(),mediaManagement:c.boolean()});c.object({defaultLocale:c.optional(c.string()),availableLocales:c.optional(c.array(c.string())),updatedBy:c.optional(c.string())});const v$=c.object({entryId:c.id("contentEntries"),slug:c.string(),contentTypeName:c.string(),fields:c.array(c.string())}),fS=100;c.object({ids:c.array(c.id("contentEntries")),changeDescription:c.optional(c.string()),updatedBy:c.optional(c.string())});c.object({ids:c.array(c.id("contentEntries")),updatedBy:c.optional(c.string())});c.object({ids:c.array(c.id("contentEntries")),deletedBy:c.optional(c.string()),hardDelete:c.optional(c.boolean())});c.object({ids:c.array(c.id("contentEntries")),data:c.optional(c.any()),status:c.optional(yr),updatedBy:c.optional(c.string())});const b$=c.object({id:c.id("contentEntries"),success:c.boolean(),error:c.optional(c.string())});c.object({total:c.number(),succeeded:c.number(),failed:c.number(),results:c.array(b$)});const w$=Bn(Tn,"trashConfig");c.object({retentionDays:c.optional(c.number()),autoCleanupEnabled:c.optional(c.boolean()),updatedBy:c.optional(c.string())});c.object({contentTypeName:c.optional(c.string()),search:c.optional(c.string()),paginationOpts:Kd});c.object({olderThanDays:c.optional(c.number()),contentTypeName:c.optional(c.string()),deletedBy:c.optional(c.string())});c.object({deletedCount:c.number(),deletedVersionsCount:c.number(),errors:c.array(c.object({id:c.id("contentEntries"),error:c.string()}))});c.object({...Cn.fields,deletedDaysAgo:c.number(),expiresAt:c.optional(c.number()),contentTypeName:c.optional(c.string())});const hS=1800*1e3,x$=14400*1e3,S$=c.object({id:c.id("contentEntries"),userId:c.string(),lockDuration:c.optional(c.number())}),_$=c.object({id:c.id("contentEntries"),userId:c.string()}),E$=c.object({id:c.id("contentEntries"),releasedBy:c.string()}),T$=c.object({id:c.id("contentEntries"),userId:c.string(),lockDuration:c.optional(c.number())}),C$=c.object({id:c.id("contentEntries")}),R$=c.object({contentTypeName:c.optional(c.string()),lockedBy:c.optional(c.string()),paginationOpts:Kd}),A$=c.object({isLocked:c.boolean(),lockedBy:c.optional(c.string()),lockExpiresAt:c.optional(c.number()),timeRemaining:c.optional(c.number()),isExpired:c.optional(c.boolean())}),N$=c.object({success:c.boolean(),entry:c.optional(Cn),error:c.optional(c.string()),currentLockHolder:c.optional(c.string()),currentLockExpiresAt:c.optional(c.number())}),Jd=c.union(c.literal("contentEntry"),c.literal("contentType"),c.literal("mediaAsset"),c.literal("mediaFolder")),fT=c.union(c.literal("created"),c.literal("updated"),c.literal("published"),c.literal("unpublished"),c.literal("deleted"),c.literal("restored"),c.literal("duplicated"),c.literal("scheduled")),Jg=Bn(Tn,"cmsEvents");c.object({resourceType:c.optional(Jd),action:c.optional(fT),processed:c.optional(c.boolean()),limit:c.optional(c.number()),cursor:c.optional(c.string())});c.object({resourceType:Jd,resourceId:c.string(),limit:c.optional(c.number())});c.object({eventIds:c.array(c.id("cmsEvents"))});c.object({retentionDays:c.optional(c.number())});const un=c.object({userId:c.string(),role:c.union(c.string(),c.null()),resourceOwnerId:c.optional(c.string())});function Pt(e){return e.deletedAt!==void 0}const wa=L4,St=D4,O$=j4;async function Kt(e,t){const{eventType:n,resourceType:o,resourceId:i,action:l,payload:u,userId:f,correlationId:h,metadata:p}=t;return await e.db.insert("cmsEvents",{eventType:n,resourceType:o,resourceId:i,action:l,payload:u,userId:f,processed:!1,correlationId:h,metadata:p})}wa({args:{resourceType:c.optional(Jd),action:c.optional(fT),processed:c.optional(c.boolean()),limit:c.optional(c.number()),cursor:c.optional(c.string())},returns:c.object({events:c.array(Jg),hasMore:c.boolean()}),handler:async(e,t)=>{const{resourceType:n,action:o,processed:i,limit:l=50}=t;let u;i!==void 0?u=await e.db.query("cmsEvents").withIndex("by_processed",p=>p.eq("processed",i)).order("desc").take(l*2):u=await e.db.query("cmsEvents").order("desc").take(l*2),n!==void 0&&(u=u.filter(p=>p.resourceType===n)),o!==void 0&&(u=u.filter(p=>p.action===o));const f=u.slice(0,l),h=u.length>l;return{events:f,hasMore:h}}});wa({args:{resourceType:Jd,resourceId:c.string(),limit:c.optional(c.number())},returns:c.array(Jg),handler:async(e,t)=>{const{resourceType:n,resourceId:o,limit:i=50}=t;return await e.db.query("cmsEvents").withIndex("by_resource",u=>u.eq("resourceType",n).eq("resourceId",o)).order("desc").take(i)}});wa({args:{limit:c.optional(c.number())},returns:c.array(Jg),handler:async(e,t)=>{const{limit:n=100}=t;return await e.db.query("cmsEvents").withIndex("by_processed",i=>i.eq("processed",!1)).order("asc").take(n)}});St({args:{eventIds:c.array(c.id("cmsEvents"))},returns:c.object({processedCount:c.number()}),handler:async(e,t)=>{const{eventIds:n}=t,o=Date.now();let i=0;for(const l of n){const u=await e.db.get(l);u&&!u.processed&&(await e.db.patch(l,{processed:!0,processedAt:o}),i++)}return{processedCount:i}}});O$({args:{eventType:c.string(),resourceType:c.union(c.literal("contentEntry"),c.literal("contentType"),c.literal("mediaAsset"),c.literal("mediaFolder")),resourceId:c.string(),action:c.union(c.literal("created"),c.literal("updated"),c.literal("published"),c.literal("unpublished"),c.literal("deleted"),c.literal("restored"),c.literal("duplicated"),c.literal("scheduled")),payload:c.any(),userId:c.optional(c.string()),correlationId:c.optional(c.string()),metadata:c.optional(c.any())},returns:c.id("cmsEvents"),handler:async(e,t)=>await e.db.insert("cmsEvents",{eventType:t.eventType,resourceType:t.resourceType,resourceId:t.resourceId,action:t.action,payload:t.payload,userId:t.userId,processed:!1,correlationId:t.correlationId,metadata:t.metadata})});St({args:{retentionDays:c.optional(c.number())},returns:c.object({deletedCount:c.number()}),handler:async(e,t)=>{const{retentionDays:n=30}=t,o=Date.now()-n*24*60*60*1e3;let i=0;const l=await e.db.query("cmsEvents").withIndex("by_processed",u=>u.eq("processed",!0)).filter(u=>u.lt(u.field("_creationTime"),o)).take(1e3);for(const u of l)await e.db.delete(u._id),i++;return{deletedCount:i}}});function Xo(e){return`contentEntry.${e}`}function Wg(e){return`contentType.${e}`}function da(e){return`mediaAsset.${e}`}const Lr={NOT_FOUND:"CONTENT_TYPE_NOT_FOUND",DELETED:"CONTENT_TYPE_DELETED",INACTIVE:"CONTENT_TYPE_INACTIVE",NAME_INVALID:"CONTENT_TYPE_NAME_INVALID",NAME_DUPLICATE:"CONTENT_TYPE_NAME_DUPLICATE",FIELD_VALIDATION_FAILED:"CONTENT_TYPE_FIELD_VALIDATION_FAILED",SLUG_FIELD_INVALID:"CONTENT_TYPE_SLUG_FIELD_INVALID",TITLE_FIELD_INVALID:"CONTENT_TYPE_TITLE_FIELD_INVALID",HAS_ENTRIES:"CONTENT_TYPE_HAS_ENTRIES",BREAKING_CHANGE:"CONTENT_TYPE_BREAKING_CHANGE"},Pr={NOT_FOUND:"CONTENT_ENTRY_NOT_FOUND",DELETED:"CONTENT_ENTRY_DELETED",NOT_DELETED:"CONTENT_ENTRY_NOT_DELETED",ALREADY_PUBLISHED:"CONTENT_ENTRY_ALREADY_PUBLISHED",NOT_PUBLISHED:"CONTENT_ENTRY_NOT_PUBLISHED",ARCHIVED:"CONTENT_ENTRY_ARCHIVED",VALIDATION_FAILED:"CONTENT_ENTRY_VALIDATION_FAILED",LOCKED:"CONTENT_ENTRY_LOCKED",CREATE_FAILED:"CONTENT_ENTRY_CREATE_FAILED",UPDATE_FAILED:"CONTENT_ENTRY_UPDATE_FAILED"},xa={NOT_FOUND:"MEDIA_ASSET_NOT_FOUND",DELETED:"MEDIA_ASSET_DELETED",NOT_DELETED:"MEDIA_ASSET_NOT_DELETED",HAS_REFERENCES:"MEDIA_ASSET_HAS_REFERENCES",CREATE_FAILED:"MEDIA_ASSET_CREATE_FAILED",UPDATE_FAILED:"MEDIA_ASSET_UPDATE_FAILED"},hT={NOT_FOUND:"MEDIA_FOLDER_NOT_FOUND",DELETED:"MEDIA_FOLDER_DELETED"},ey={BATCH_SIZE_EXCEEDED:"BATCH_SIZE_EXCEEDED",PERMISSION_DENIED:"PERMISSION_DENIED",INTERNAL_ERROR:"INTERNAL_ERROR"};class qe extends Error{code;category;context;constructor(t,n,o,i){const l=`[${t}] ${o}`;super(l),this.name="CMSError",this.code=t,this.category=n,this.context=i,Error.captureStackTrace&&Error.captureStackTrace(this,qe)}toJSON(){return{name:this.name,code:this.code,category:this.category,message:this.message,context:this.context}}}function rc(e){return new qe(Lr.NOT_FOUND,"NOT_FOUND",`Content type not found. The content type with ID "${e}" does not exist.`,{resourceType:"contentType",resourceId:e})}function oc(e,t){const n=t?`"${t}" (${e})`:`"${e}"`;return new qe(Lr.DELETED,"DELETED",`Content type ${n} has been deleted. Restore it first to perform this operation.`,{resourceType:"contentType",resourceId:e,resourceName:t,currentState:"deleted"})}function pT(e,t){const n=t?`"${t}"`:`"${e}"`;return new qe(Lr.INACTIVE,"INACTIVE",`Content type ${n} is not active. Activate it first to create entries.`,{resourceType:"contentType",resourceId:e,resourceName:t,currentState:"inactive"})}function k$(e){return new qe(Lr.NAME_INVALID,"VALIDATION",`Invalid content type name "${e}". Name must start with a lowercase letter and contain only lowercase letters, numbers, and underscores (1-64 characters).`,{details:`Provided name: "${e}"`})}function M$(e){return new qe(Lr.NAME_DUPLICATE,"STATE_CONFLICT",`A content type with name "${e}" already exists. Please choose a different name.`,{resourceType:"contentType",resourceName:e})}function mT(e){const t=e.map(n=>`${n.fieldName}: ${n.message}`).join("; ");return new qe(Lr.FIELD_VALIDATION_FAILED,"VALIDATION",`Invalid field definitions: ${t}`,{fields:e.map(n=>({field:n.fieldName,message:n.message,code:n.code}))})}function gT(e,t){return new qe(Lr.SLUG_FIELD_INVALID,"VALIDATION",`slugField "${e}" does not reference an existing field. Available fields: ${t.join(", ")}`,{details:`Invalid slugField: "${e}"`})}function yT(e,t){return new qe(Lr.TITLE_FIELD_INVALID,"VALIDATION",`titleField "${e}" does not reference an existing field. Available fields: ${t.join(", ")}`,{details:`Invalid titleField: "${e}"`})}function I$(e,t,n){return new qe(Lr.HAS_ENTRIES,"REFERENCE_CONFLICT",`Cannot delete content type "${t}": it has ${n} content ${n===1?"entry":"entries"}. Delete all entries first or use force delete.`,{resourceType:"contentType",resourceId:e,resourceName:t,referenceCount:n})}function D$(e){const t=e.map(n=>`- ${n.fieldName}: ${n.message} (affects ${n.affectedEntriesCount} entries)`).join(`
21
+ `);return new qe(Lr.BREAKING_CHANGE,"STATE_CONFLICT",`Cannot update content type due to breaking changes:
22
+ ${t}
23
+
24
+ Use allowBreakingChanges: true to force the update.`,{details:t})}function Sa(e){return new qe(Pr.NOT_FOUND,"NOT_FOUND",`Content entry not found. The entry with ID "${e}" does not exist.`,{resourceType:"contentEntry",resourceId:e})}function sc(e){return new qe(Pr.DELETED,"DELETED",`Content entry "${e}" has been deleted. Restore it from trash first to perform this operation.`,{resourceType:"contentEntry",resourceId:e,currentState:"deleted"})}function j$(e){return new qe(Pr.NOT_DELETED,"STATE_CONFLICT",`Content entry "${e}" is not deleted. Only deleted entries can be restored.`,{resourceType:"contentEntry",resourceId:e,currentState:"active",expectedState:"deleted"})}function z$(e){return new qe(Pr.ALREADY_PUBLISHED,"STATE_CONFLICT",`Content entry "${e}" is already published. Use update instead if you want to modify it.`,{resourceType:"contentEntry",resourceId:e,currentState:"published",expectedState:"draft"})}function L$(e,t){return new qe(Pr.NOT_PUBLISHED,"STATE_CONFLICT",`Content entry "${e}" is not published. Current status: "${t}". Only published entries can be unpublished.`,{resourceType:"contentEntry",resourceId:e,currentState:t,expectedState:"published"})}function P$(e){return new qe(Pr.ARCHIVED,"STATE_CONFLICT",`Cannot publish archived content entry "${e}". Restore it from archive first.`,{resourceType:"contentEntry",resourceId:e,currentState:"archived"})}function ty(e){const t=e.map(n=>`${n.field}: ${n.message}`).join("; ");return new qe(Pr.VALIDATION_FAILED,"VALIDATION",`Content validation failed: ${t}`,{fields:e})}function pS(e,t,n,o){const i=new Date(n).toISOString();return new qe(Pr.LOCKED,"LOCK_CONFLICT",`Content entry "${e}" is locked by user "${t}" since ${i}. Only the lock holder can modify this entry.`,{lockedBy:t,lockedAt:n,currentUser:o})}function vT(e){return new qe(Pr.CREATE_FAILED,"INTERNAL",`Failed to create content entry for content type "${e}". The entry was not persisted.`,{resourceType:"contentEntry"})}function ny(e){return new qe(Pr.UPDATE_FAILED,"INTERNAL",`Failed to retrieve content entry "${e}" after update. The update may have failed.`,{resourceType:"contentEntry",resourceId:e})}function ry(e){return new qe(xa.NOT_FOUND,"NOT_FOUND",`Media asset not found. The asset with ID "${e}" does not exist.`,{resourceType:"mediaAsset",resourceId:e})}function bT(e){return new qe(xa.DELETED,"DELETED",`Media asset "${e}" has been deleted. Restore it first to perform this operation.`,{resourceType:"mediaAsset",resourceId:e,currentState:"deleted"})}function $$(e){return new qe(xa.NOT_DELETED,"STATE_CONFLICT",`Media asset "${e}" is not deleted. Only deleted assets can be restored.`,{resourceType:"mediaAsset",resourceId:e,currentState:"active",expectedState:"deleted"})}function F$(e,t){const n=t.slice(0,5).map(i=>`${i.type}: ${i.name||i.id}`).join(", "),o=t.length>5?` and ${t.length-5} more`:"";return new qe(xa.HAS_REFERENCES,"REFERENCE_CONFLICT",`Cannot delete media asset "${e}": it is referenced by ${t.length} ${t.length===1?"resource":"resources"} (${n}${o}). Remove references first or use force delete.`,{referencingResources:t,referenceCount:t.length})}function U$(){return new qe(xa.CREATE_FAILED,"INTERNAL","Failed to create media asset. The asset was not persisted.",{resourceType:"mediaAsset"})}function B$(e){return new qe(xa.UPDATE_FAILED,"INTERNAL",`Failed to retrieve media asset "${e}" after update. The update may have failed.`,{resourceType:"mediaAsset",resourceId:e})}function oy(e){return new qe(hT.NOT_FOUND,"NOT_FOUND",`Media folder not found. The folder with ID "${e}" does not exist.`,{resourceType:"mediaFolder",resourceId:e})}function sy(e){return new qe(hT.DELETED,"DELETED",`Media folder "${e}" has been deleted. Restore it first to perform this operation.`,{resourceType:"mediaFolder",resourceId:e,currentState:"deleted"})}function q$(e,t){return new qe(ey.BATCH_SIZE_EXCEEDED,"LIMIT_EXCEEDED",`Batch size exceeds limit. Maximum ${e} items per batch, but ${t} were requested.`,{details:`Max: ${e}, requested: ${t}`})}function pm(e,t){return new qe(ey.PERMISSION_DENIED,"PERMISSION",`Permission denied: you do not have access to ${e} ${t}.`,{details:`Action: ${e}, resource: ${t}`})}function iy(e){return new qe(ey.INTERNAL_ERROR,"INTERNAL",`Internal error: ${e}`,{details:e})}c.union(c.literal("admin"),c.literal("editor"),c.literal("author"),c.literal("viewer"));const V$=c.union(c.literal("contentTypes"),c.literal("contentEntries"),c.literal("mediaItems"),c.literal("settings")),H$=c.union(c.literal("create"),c.literal("read"),c.literal("update"),c.literal("delete"),c.literal("publish"),c.literal("unpublish"),c.literal("restore"),c.literal("manage"),c.literal("move"));c.object({resource:V$,action:H$,scope:c.optional(c.union(c.literal("all"),c.literal("own")))});function Fl(e,t="all"){return[{resource:e,action:"create",scope:t},{resource:e,action:"read",scope:t},{resource:e,action:"update",scope:t},{resource:e,action:"delete",scope:t}]}function sa(e,t="all"){return[{resource:e,action:"read",scope:t}]}function wT(e="all"){return[{resource:"contentEntries",action:"publish",scope:e},{resource:"contentEntries",action:"unpublish",scope:e}]}const Z$={name:"admin",displayName:"Administrator",description:"Full access to all CMS features including settings and content type management",isSystem:!0,permissions:[...Fl("contentTypes"),...Fl("contentEntries"),...wT(),{resource:"contentEntries",action:"restore"},...Fl("mediaItems"),{resource:"settings",action:"manage"},...sa("settings")]},Q$={name:"editor",displayName:"Editor",description:"Can manage all content and media, but cannot modify settings or content types",isSystem:!0,permissions:[...sa("contentTypes"),...Fl("contentEntries"),...wT(),{resource:"contentEntries",action:"restore"},...Fl("mediaItems")]},G$={name:"author",displayName:"Author",description:"Can create and manage own content and media",isSystem:!0,permissions:[...sa("contentTypes"),{resource:"contentEntries",action:"create"},{resource:"contentEntries",action:"read",scope:"own"},{resource:"contentEntries",action:"update",scope:"own"},{resource:"contentEntries",action:"delete",scope:"own"},{resource:"contentEntries",action:"publish",scope:"own"},{resource:"contentEntries",action:"unpublish",scope:"own"},{resource:"mediaItems",action:"create"},{resource:"mediaItems",action:"read",scope:"all"},{resource:"mediaItems",action:"update",scope:"own"},{resource:"mediaItems",action:"delete",scope:"own"}]},Y$={name:"viewer",displayName:"Viewer",description:"Read-only access to published content and media",isSystem:!0,permissions:[...sa("contentTypes"),...sa("contentEntries"),...sa("mediaItems")]},ay={admin:Z$,editor:Q$,author:G$,viewer:Y$};function K$(e,t){if(e.resource!==t.resource||e.action!==t.action)return!1;const n=e.scope??"all",o=t.scope??"all";return n==="all"?!0:o==="own"}function Wm(e,t,n){const o=ay[e]??n?.[e];return o?o.permissions.some(i=>K$(i,t)):!1}function X$(e,t){return(ay[e]??t?.[e])?.permissions??[]}function J$(e,t){return ay[e]??t?.[e]}function W$(e,t,n){return X$(e,n).filter(o=>o.resource===t)}function jG(e,t,n){return W$(e,t,n).length>0}function dn(e,t,n,o){if(!e)return;const{userId:i,role:l,resourceOwnerId:u}=e;if(!l)throw pm(n,t);if(Wm(l,{resource:t,action:n,scope:"all"},o?.customRoles))return;if(Wm(l,{resource:t,action:n,scope:"own"},o?.customRoles)){if(u&&u===i||n==="create")return;throw pm(`${n} other users'`,t)}throw pm(n,t)}function is(e,t){if(e)return{...e,resourceOwnerId:t}}function xT(e){return/^[a-z][a-zA-Z0-9_]{0,63}$/.test(e)}function e5(e,t,n){const o=[],i=new Map(e.map(u=>[u.name,u])),l=new Map(t.map(u=>[u.name,u]));for(const u of e)if(!l.has(u.name)){const f=n.filter(h=>{const p=h.data[u.name];return p!=null&&p!==""}).length;f>0&&o.push({type:"FIELD_REMOVED",fieldName:u.name,message:`Removing field "${u.name}" will delete data from ${f} existing entries`,affectedEntriesCount:f})}for(const u of t){const f=i.get(u.name);if(f){if(f.type!==u.type){const h=n.filter(p=>{const y=p.data[u.name];return y!=null}).length;h>0&&o.push({type:"FIELD_TYPE_CHANGED",fieldName:u.name,message:`Changing field "${u.name}" type from "${f.type}" to "${u.type}" may invalidate ${h} existing entries`,affectedEntriesCount:h})}if(!f.required&&u.required){const h=n.filter(p=>{const y=p.data[u.name];return y==null||y===""}).length;h>0&&o.push({type:"FIELD_MADE_REQUIRED",fieldName:u.name,message:`Making field "${u.name}" required will invalidate ${h} entries with missing values`,affectedEntriesCount:h})}if((f.type==="select"||f.type==="multiSelect")&&f.options?.options&&u.options?.options){const h=new Set(f.options.options.map(v=>v.value)),p=new Set(u.options.options.map(v=>v.value)),y=[...h].filter(v=>!p.has(v));if(y.length>0){const v=n.filter(w=>{const _=w.data[u.name];return f.type==="select"?y.includes(_):_?.some(x=>y.includes(x))}).length;v>0&&o.push({type:"SELECT_OPTIONS_REMOVED",fieldName:u.name,message:`Removing options [${y.join(", ")}] from "${u.name}" will invalidate ${v} entries using those values`,affectedEntriesCount:v})}}if(f.type==="reference"&&u.type==="reference"&&f.options?.allowedContentTypes&&u.options?.allowedContentTypes){const h=new Set(f.options.allowedContentTypes),p=new Set(u.options.allowedContentTypes),y=[...h].filter(v=>!p.has(v));y.length>0&&o.push({type:"REFERENCE_TYPES_RESTRICTED",fieldName:u.name,message:`Restricting allowed content types for "${u.name}" by removing [${y.join(", ")}] may invalidate existing references`,affectedEntriesCount:n.length})}if(f.type==="text"&&u.type==="text"&&f.options&&u.options){const h=[];if(u.options.minLength!==void 0&&(f.options.minLength===void 0||u.options.minLength>f.options.minLength)&&h.push(`minLength increased to ${u.options.minLength}`),u.options.maxLength!==void 0&&f.options.maxLength!==void 0&&u.options.maxLength<f.options.maxLength&&h.push(`maxLength decreased to ${u.options.maxLength}`),h.length>0){const p=n.filter(y=>{const v=y.data[u.name];return typeof v!="string"?!1:u.options?.minLength!==void 0&&v.length<u.options.minLength||u.options?.maxLength!==void 0&&v.length>u.options.maxLength}).length;p>0&&o.push({type:"VALIDATION_TIGHTENED",fieldName:u.name,message:`Tightening validation for "${u.name}" (${h.join(", ")}) will invalidate ${p} entries`,affectedEntriesCount:p})}}}}return o}function ST(e){const t=[],n=new Set;for(const o of e){if(!o.name||typeof o.name!="string"){t.push({fieldName:o.name||"(unnamed)",message:"Field must have a name property",code:"MISSING_REQUIRED_PROPERTY"});continue}(!o.label||typeof o.label!="string")&&t.push({fieldName:o.name,message:`Field "${o.name}" must have a label property`,code:"MISSING_REQUIRED_PROPERTY"}),(!o.type||typeof o.type!="string")&&t.push({fieldName:o.name,message:`Field "${o.name}" must have a type property`,code:"MISSING_REQUIRED_PROPERTY"}),typeof o.required!="boolean"&&t.push({fieldName:o.name,message:`Field "${o.name}" must have a required property (boolean)`,code:"MISSING_REQUIRED_PROPERTY"}),o.name&&!xT(o.name)&&t.push({fieldName:o.name,message:`Field name "${o.name}" must start with a lowercase letter and contain only letters, numbers, and underscores (max 64 chars)`,code:"INVALID_FIELD_NAME"}),n.has(o.name)&&t.push({fieldName:o.name,message:`Duplicate field name: "${o.name}"`,code:"DUPLICATE_FIELD_NAME"}),n.add(o.name),o.type&&!dS.includes(o.type)&&t.push({fieldName:o.name,message:`Invalid field type "${o.type}". Must be one of: ${dS.join(", ")}`,code:"INVALID_FIELD_TYPE"}),(o.type==="select"||o.type==="multiSelect")&&(!o.options?.options||o.options.options.length===0)&&t.push({fieldName:o.name,message:`${o.type} field "${o.name}" must have options defined`,code:"INVALID_SELECT_OPTIONS"})}return t}St({args:{...K4.fields,_auth:c.optional(un)},returns:ba,handler:async(e,t)=>{const{name:n,displayName:o,description:i,fields:l,icon:u,singleton:f,slugField:h,titleField:p,sortOrder:y,createdBy:v,_auth:w}=t;if(dn(w,"contentTypes","create"),!xT(n))throw k$(n);if(await e.db.query("contentTypes").withIndex("by_name",k=>k.eq("name",n)).first())throw M$(n);const R=ST(l);if(R.length>0)throw mT(R);const x=l.map(k=>k.name);if(h&&!l.some(O=>O.name===h))throw gT(h,x);if(p&&!l.some(O=>O.name===p))throw yT(p,x);const C=await e.db.insert("contentTypes",{name:n,displayName:o,description:i,fields:l,icon:u,singleton:f,slugField:h,titleField:p,sortOrder:y,isActive:!0,createdBy:v}),N=await e.db.get(C);if(!N)throw iy("Failed to retrieve created content type");return await Kt(e,{eventType:Wg("created"),resourceType:"contentType",resourceId:C,action:"created",payload:{name:n,displayName:o,fieldCount:l.length,isActive:!0},userId:v}),N}});const t5=c.object({type:c.union(c.literal("FIELD_REMOVED"),c.literal("FIELD_TYPE_CHANGED"),c.literal("FIELD_MADE_REQUIRED"),c.literal("SELECT_OPTIONS_REMOVED"),c.literal("REFERENCE_TYPES_RESTRICTED"),c.literal("VALIDATION_TIGHTENED")),fieldName:c.string(),message:c.string(),affectedEntriesCount:c.number()}),n5=c.object({...ba.fields,breakingChanges:c.optional(c.array(t5))});St({args:{...X4.fields,force:c.optional(c.boolean()),_auth:c.optional(un)},returns:n5,handler:async(e,t)=>{const{id:n,displayName:o,description:i,fields:l,icon:u,singleton:f,slugField:h,titleField:p,sortOrder:y,isActive:v,updatedBy:w,force:_=!1,_auth:R}=t;dn(R,"contentTypes","update");const x=await e.db.get(n);if(!x)throw rc(n);if(Pt(x))throw oc(n,x.name);const C={updatedBy:w};o!==void 0&&(C.displayName=o),i!==void 0&&(C.description=i),u!==void 0&&(C.icon=u),f!==void 0&&(C.singleton=f),y!==void 0&&(C.sortOrder=y),v!==void 0&&(C.isActive=v);let N=[];if(l!==void 0){const D=ST(l);if(D.length>0)throw mT(D);const Y=await e.db.query("contentEntries").withIndex("by_content_type",ie=>ie.eq("contentTypeName",x.name)).filter(ie=>ie.eq(ie.field("deletedAt"),void 0)).collect();if(Y.length>0&&(N=e5(x.fields,l,Y.map(ie=>({data:ie.data}))),N.length>0&&!_))throw D$(N);C.fields=l}const k=l??x.fields,O=h!==void 0?h:x.slugField,M=p!==void 0?p:x.titleField,$=k.map(D=>D.name);if(O){if(!k.some(Y=>Y.name===O))throw gT(O,$);h!==void 0&&(C.slugField=h)}else h!==void 0&&(C.slugField=h);if(M){if(!k.some(Y=>Y.name===M))throw yT(M,$);p!==void 0&&(C.titleField=p)}else p!==void 0&&(C.titleField=p);await e.db.patch(n,C);const V=await e.db.get(n);if(!V)throw iy("Failed to retrieve updated content type");const L=Object.keys(C).filter(D=>D!=="updatedBy");return await Kt(e,{eventType:Wg("updated"),resourceType:"contentType",resourceId:n,action:"updated",payload:{name:V.name,displayName:V.displayName,fieldCount:V.fields.length,isActive:V.isActive,changedFields:L},userId:w}),{...V,breakingChanges:N.length>0?N:void 0}}});const _T=c.object({success:c.boolean(),deletedId:c.id("contentTypes"),deletedEntriesCount:c.number(),deletedVersionsCount:c.number(),wasHardDelete:c.boolean()});St({args:{...J4.fields,_auth:c.optional(un)},returns:_T,handler:async(e,t)=>{const{id:n,cascade:o=!1,hardDelete:i=!1,deletedBy:l,_auth:u}=t;dn(u,"contentTypes","delete");const f=await e.db.get(n);if(!f)throw rc(n);if(Pt(f))throw oc(n,f.name);const h=await e.db.query("contentEntries").withIndex("by_content_type",_=>_.eq("contentTypeName",f.name)).filter(_=>_.eq(_.field("deletedAt"),void 0)).collect(),p=h.length;if(p>0&&!o)throw I$(n,f.name,p);let y=0,v=0;const w=Date.now();if(o&&p>0)if(i)for(const _ of h){const R=await e.db.query("contentVersions").withIndex("by_entry",x=>x.eq("entryId",_._id)).collect();for(const x of R)await e.db.delete(x._id),v++;await e.db.delete(_._id),y++}else for(const _ of h)await e.db.patch(_._id,{deletedAt:w,updatedBy:l}),y++;return i?await e.db.delete(n):await e.db.patch(n,{deletedAt:w,isActive:!1,updatedBy:l}),await Kt(e,{eventType:Wg("deleted"),resourceType:"contentType",resourceId:n,action:"deleted",payload:{name:f.name,displayName:f.displayName,fieldCount:f.fields.length,isActive:!1},userId:l,metadata:{hardDelete:i,cascade:o,deletedEntriesCount:y,deletedVersionsCount:v}}),{success:!0,deletedId:n,deletedEntriesCount:y,deletedVersionsCount:v,wasHardDelete:i}}});const r5={ä:"ae",ö:"oe",ü:"ue",ß:"ss",Ä:"ae",Ö:"oe",Ü:"ue",à:"a",â:"a",ç:"c",é:"e",è:"e",ê:"e",ë:"e",î:"i",ï:"i",ô:"o",ù:"u",û:"u",ÿ:"y",œ:"oe",æ:"ae",ñ:"n",Ñ:"n",ą:"a",Ą:"a",ć:"c",Ć:"c",ę:"e",Ę:"e",ł:"l",Ł:"l",ń:"n",Ń:"n",ó:"o",Ó:"o",ś:"s",Ś:"s",ź:"z",Ź:"z",ż:"z",Ż:"z",å:"a",Å:"a",ø:"o",Ø:"o",ð:"d",þ:"th","&":"and","@":"at","#":"hash","%":"percent","+":"plus","=":"equals","'":"","‘":"","’":"","“":"","”":""};function ly(e,t={}){const{maxLength:n=100,separator:o="-",lowercase:i=!0,customReplacements:l={}}=t;if(!e||typeof e!="string")return"";const u={...r5,...l};let f=e.trim();for(const[v,w]of Object.entries(u))f=f.split(v).join(w);f=f.normalize("NFD").replace(/[\u0300-\u036f]/g,""),i&&(f=f.toLowerCase());const h=new RegExp(`[^a-z0-9${kl(o)}]`,"gi");f=f.replace(h,o);const p=new RegExp(`${kl(o)}+`,"g");f=f.replace(p,o);const y=new RegExp(`^${kl(o)}|${kl(o)}$`,"g");return f=f.replace(y,""),f.length>n&&(f=o5(f,n,o)),f}function kl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function o5(e,t,n){if(e.length<=t)return e;const o=e.substring(0,t),i=o.lastIndexOf(n);return i>0?o.substring(0,i):o}function s5(e,t="-"){return!e||typeof e!="string"?!1:new RegExp(`^[a-z0-9]+(?:${kl(t)}[a-z0-9]+)*$`).test(e)}async function i5(e,t,n=100){if(await t(e))return e;for(let i=1;i<=n;i++){const l=`${e}-${i}`;if(await t(l))return l}const o=Date.now().toString(36);return`${e}-${o}`}async function Td(e,t,n={}){const{excludeEntryId:o,maxAttempts:i=100}=n;let l=e;return s5(l,n.separator)||(l=ly(l,{separator:n.separator})),l||(l="untitled"),i5(l,async f=>{const h=await t(f);return!!(!h||o&&h._id===o)},i)}function a5(e){if(e==null||typeof e!="object"||Array.isArray(e))return!1;const t=Object.keys(e);if(t.length===0||!t.some(i=>i.includes("-")))return!1;const o=/^[a-z]{2,3}(-[A-Z][a-z]{3})?(-[A-Z]{2})?$/;return t.every(i=>i.length>3&&!i.includes("-")?!1:o.test(i))}function l5(e,t){const n=[],{name:o,required:i,options:l}=t;return i&&(e==null||e==="")?(n.push({field:o,message:`${o} is required`,code:"REQUIRED"}),n):e==null||e===""?n:typeof e!="string"?(n.push({field:o,message:`${o} must be a string`,code:"INVALID_TYPE"}),n):(l?.minLength!==void 0&&e.length<l.minLength&&n.push({field:o,message:`${o} must be at least ${l.minLength} characters`,code:"MIN_LENGTH"}),l?.maxLength!==void 0&&e.length>l.maxLength&&n.push({field:o,message:`${o} must be at most ${l.maxLength} characters`,code:"MAX_LENGTH"}),l?.pattern!==void 0&&(new RegExp(l.pattern).test(e)||n.push({field:o,message:`${o} does not match the required pattern`,code:"PATTERN_MISMATCH"})),n)}function c5(e,t){const n=[],{name:o,required:i,options:l}=t;return i&&(e==null||e==="")?(n.push({field:o,message:`${o} is required`,code:"REQUIRED"}),n):e==null||e===""?n:typeof e!="string"?(n.push({field:o,message:`${o} must be a string`,code:"INVALID_TYPE"}),n):(l?.maxLength!==void 0&&e.replace(/<[^>]*>/g,"").length>l.maxLength&&n.push({field:o,message:`${o} content must be at most ${l.maxLength} characters`,code:"MAX_LENGTH"}),n)}function u5(e,t){const n=[],{name:o,required:i,options:l}=t;return i&&e==null?(n.push({field:o,message:`${o} is required`,code:"REQUIRED"}),n):e==null?n:typeof e!="number"||isNaN(e)?(n.push({field:o,message:`${o} must be a number`,code:"INVALID_TYPE"}),n):(l?.precision===0&&!Number.isInteger(e)&&n.push({field:o,message:`${o} must be a whole number`,code:"NOT_INTEGER"}),l?.min!==void 0&&e<l.min&&n.push({field:o,message:`${o} must be at least ${l.min}`,code:"MIN_VALUE"}),l?.max!==void 0&&e>l.max&&n.push({field:o,message:`${o} must be at most ${l.max}`,code:"MAX_VALUE"}),n)}function d5(e,t){const n=[],{name:o,required:i}=t;return i&&e==null?(n.push({field:o,message:`${o} is required`,code:"REQUIRED"}),n):(e==null||typeof e!="boolean"&&n.push({field:o,message:`${o} must be a boolean`,code:"INVALID_TYPE"}),n)}function f5(e,t){const n=[],{name:o,required:i,options:l}=t;return i&&e==null?(n.push({field:o,message:`${o} is required`,code:"REQUIRED"}),n):e==null?n:typeof e!="number"||isNaN(e)?(n.push({field:o,message:`${o} must be a valid timestamp`,code:"INVALID_TYPE"}),n):(l?.min!==void 0&&e<l.min&&n.push({field:o,message:`${o} must be on or after the minimum date`,code:"MIN_DATE"}),l?.max!==void 0&&e>l.max&&n.push({field:o,message:`${o} must be on or before the maximum date`,code:"MAX_DATE"}),n)}function h5(e,t){const n=[],{name:o,required:i,options:l}=t,u=l?.multiple??!1;if(i&&e==null)return n.push({field:o,message:`${o} is required`,code:"REQUIRED"}),n;if(e==null)return n;if(u){if(!Array.isArray(e))return n.push({field:o,message:`${o} must be an array of references`,code:"INVALID_TYPE"}),n;i&&e.length===0&&n.push({field:o,message:`${o} requires at least one reference`,code:"REQUIRED"});for(const f of e)if(typeof f!="string"){n.push({field:o,message:`${o} contains invalid reference IDs`,code:"INVALID_TYPE"});break}l?.minItems!==void 0&&e.length<l.minItems&&n.push({field:o,message:`${o} requires at least ${l.minItems} reference${l.minItems===1?"":"s"}`,code:"MIN_ITEMS"}),l?.max!==void 0&&e.length>l.max&&n.push({field:o,message:`${o} can have at most ${l.max} reference${l.max===1?"":"s"}`,code:"MAX_ITEMS"})}else typeof e!="string"&&n.push({field:o,message:`${o} must be a reference ID`,code:"INVALID_TYPE"});return n}function p5(e,t){const n=[],{name:o,required:i,options:l}=t,u=l?.multiple??!1;if(i&&e==null)return n.push({field:o,message:`${o} is required`,code:"REQUIRED"}),n;if(e==null)return n;if(u){if(!Array.isArray(e))return n.push({field:o,message:`${o} must be an array of media asset IDs`,code:"INVALID_TYPE"}),n;i&&e.length===0&&n.push({field:o,message:`${o} requires at least one media asset`,code:"REQUIRED"});for(const f of e)if(typeof f!="string"){n.push({field:o,message:`${o} contains invalid media asset IDs`,code:"INVALID_TYPE"});break}l?.minItems!==void 0&&e.length<l.minItems&&n.push({field:o,message:`${o} requires at least ${l.minItems} media asset${l.minItems===1?"":"s"}`,code:"MIN_ITEMS"}),l?.max!==void 0&&e.length>l.max&&n.push({field:o,message:`${o} can have at most ${l.max} media asset${l.max===1?"":"s"}`,code:"MAX_ITEMS"})}else typeof e!="string"&&n.push({field:o,message:`${o} must be a media asset ID`,code:"INVALID_TYPE"});return n}function m5(e,t){const n=[],{name:o,required:i,options:l}=t;return i&&(e==null||e==="")?(n.push({field:o,message:`${o} is required`,code:"REQUIRED"}),n):e==null||e===""?n:typeof e!="string"?(n.push({field:o,message:`${o} must be a string`,code:"INVALID_TYPE"}),n):(l?.options&&(l.options.map(f=>f.value).includes(e)||n.push({field:o,message:`${o} has an invalid value`,code:"INVALID_TYPE"})),n)}function g5(e,t){const n=[],{name:o,required:i,options:l}=t;if(i&&e==null)return n.push({field:o,message:`${o} is required`,code:"REQUIRED"}),n;if(e==null)return n;if(!Array.isArray(e))return n.push({field:o,message:`${o} must be an array`,code:"INVALID_TYPE"}),n;i&&e.length===0&&n.push({field:o,message:`${o} requires at least one selection`,code:"REQUIRED"});const u=l?.options?.map(f=>f.value)??[];for(const f of e){if(typeof f!="string"){n.push({field:o,message:`${o} contains invalid values`,code:"INVALID_TYPE"});break}if(u.length>0&&!u.includes(f)){n.push({field:o,message:`${o} contains an invalid option`,code:"INVALID_TYPE"});break}}return n}function y5(e,t){const n=[],{name:o,required:i}=t;return i&&e==null&&n.push({field:o,message:`${o} is required`,code:"REQUIRED"}),n}function v5(e,t){const n=[],{name:o,required:i,options:l}=t;if(i&&e==null)return n.push({field:o,message:`${o} is required`,code:"REQUIRED"}),n;if(e==null)return n;if(!Array.isArray(e))return n.push({field:o,message:`${o} must be an array of tag IDs`,code:"INVALID_TYPE"}),n;if(i&&e.length===0)return n.push({field:o,message:`${o} requires at least one tag`,code:"REQUIRED"}),n;for(const h of e)if(typeof h!="string"){n.push({field:o,message:`${o} contains invalid tag IDs`,code:"INVALID_TYPE"});break}const u=l?.minTags;u!==void 0&&e.length<u&&n.push({field:o,message:`${o} requires at least ${u} tag${u===1?"":"s"}`,code:"MIN_ITEMS"});const f=l?.maxTags;return f!==void 0&&e.length>f&&n.push({field:o,message:`${o} can have at most ${f} tag${f===1?"":"s"}`,code:"MAX_ITEMS"}),n}function b5(e,t){const n=[],{name:o,required:i,options:l}=t,u=l?.allowMultiple??!1;if(i&&e==null)return n.push({field:o,message:`${o} is required`,code:"REQUIRED"}),n;if(e==null)return n;if(u){if(!Array.isArray(e))return n.push({field:o,message:`${o} must be an array of category IDs`,code:"INVALID_TYPE"}),n;i&&e.length===0&&n.push({field:o,message:`${o} requires at least one category`,code:"REQUIRED"});for(const f of e)if(typeof f!="string"){n.push({field:o,message:`${o} contains invalid category IDs`,code:"INVALID_TYPE"});break}}else typeof e!="string"&&n.push({field:o,message:`${o} must be a category ID`,code:"INVALID_TYPE"});return n}function eg(e,t){const{name:n,type:o}=t;switch(o){case"text":return l5(e,t);case"richText":return c5(e,t);case"number":return u5(e,t);case"boolean":return d5(e,t);case"date":case"datetime":return f5(e,t);case"reference":return h5(e,t);case"media":return p5(e,t);case"select":return m5(e,t);case"multiSelect":return g5(e,t);case"json":return y5(e,t);case"tags":return v5(e,t);case"category":return b5(e,t);default:return[{field:n,message:`Unknown field type: ${o}`,code:"INVALID_TYPE"}]}}function w5(e,t,n={}){const o=[],{name:i,required:l}=t,{locale:u,requiredLocales:f}=n;if(e==null)return l&&o.push({field:i,message:`${i} is required`,code:"REQUIRED"}),o;if(!a5(e))return o.push({field:i,message:`${i} must be a localized field structure (object with locale codes as keys)`,code:"INVALID_LOCALIZED_STRUCTURE"}),o;const h=e,p=Object.keys(h);if(l&&p.length===0)return o.push({field:i,message:`${i} requires at least one locale value`,code:"REQUIRED"}),o;if(f&&f.length>0)for(const y of f)y in h||o.push({field:i,message:`${i} is missing required translation for locale: ${y}`,code:"MISSING_LOCALE"});if(u){if(u in h){const y={...t},v=eg(h[u],y);for(const w of v)o.push({...w,field:`${i}[${u}]`,message:`${i} (${u}): ${w.message.replace(`${i} `,"")}`})}}else for(const[y,v]of Object.entries(h)){const w={...t,required:!1},_=eg(v,w);for(const R of _)o.push({...R,field:`${i}[${y}]`,message:`${i} (${y}): ${R.message.replace(`${i} `,"")}`})}return o}function x5(e,t,n){return t.localized?w5(e,t,n):eg(e,t)}function cy(e,t,n={}){const o=[],i=new Map(t.fields.map(p=>[p.name,p])),{strictFields:l,locale:u,requiredLocales:f}=n,h={locale:u,requiredLocales:f};for(const p of t.fields){const y=e[p.name],v=x5(y,p,h);o.push(...v)}if(l)for(const p of Object.keys(e))i.has(p)||o.push({field:p,message:`Unknown field: ${p}`,code:"UNKNOWN_FIELD"});return o.length===0?{valid:!0,errors:[]}:{valid:!1,errors:o}}function ic(e){return e===void 0?!1:Date.now()<e}function ET(e){if(e===void 0)return 0;const t=e-Date.now();return t>0?t:0}function TT(e){const t=e??hS;return t<=0?hS:Math.min(t,x$)}wa({args:C$.fields,returns:A$,handler:async(e,t)=>{const{id:n}=t,o=await e.db.get(n);if(!o)throw new Error(`Content entry not found: ${n}`);const i=o.lockedBy!==void 0&&o.lockExpiresAt!==void 0,l=i&&ic(o.lockExpiresAt),u=i&&!l,f=l?ET(o.lockExpiresAt):void 0;return{isLocked:l,lockedBy:l?o.lockedBy:void 0,lockExpiresAt:l?o.lockExpiresAt:void 0,timeRemaining:f,isExpired:u}}});wa({args:R$.fields,returns:c.object({page:c.array(c.object({...Cn.fields,timeRemaining:c.optional(c.number())})),continueCursor:c.union(c.string(),c.null()),isDone:c.boolean()}),handler:async(e,t)=>{const{contentTypeName:n,lockedBy:o,paginationOpts:i}=t,f=(await e.db.query("contentEntries").withIndex("by_locked").collect()).filter(x=>!(x.lockedBy===void 0||x.lockExpiresAt===void 0||!ic(x.lockExpiresAt)||Pt(x)||n&&x.contentTypeName!==n||o&&x.lockedBy!==o)),h=i.numItems??50,p=i.cursor;let y=0;if(p){const x=f.findIndex(C=>C._id===p);x!==-1&&(y=x+1)}const v=f.slice(y,y+h),w=y+h<f.length,_=w?v[v.length-1]?._id??null:null;return{page:v.map(x=>({...x,timeRemaining:ET(x.lockExpiresAt)})),continueCursor:_,isDone:!w}}});St({args:S$.fields,returns:N$,handler:async(e,t)=>{const{id:n,userId:o,lockDuration:i}=t,l=await e.db.get(n);if(!l)return{success:!1,error:`Content entry not found: ${n}`};if(Pt(l))return{success:!1,error:`Content entry has been deleted: ${n}`};const u=TT(i),h=Date.now()+u,y=l.lockedBy!==void 0&&l.lockExpiresAt!==void 0&&ic(l.lockExpiresAt),v=l.lockedBy===o;if(y&&!v)return{success:!1,error:"Entry is locked by another user",currentLockHolder:l.lockedBy,currentLockExpiresAt:l.lockExpiresAt};await e.db.patch(n,{lockedBy:o,lockExpiresAt:h});const w=await e.db.get(n);return w?{success:!0,entry:w}:{success:!1,error:"Failed to retrieve updated entry"}}});St({args:_$.fields,returns:Cn,handler:async(e,t)=>{const{id:n,userId:o}=t,i=await e.db.get(n);if(!i)throw new Error(`Content entry not found: ${n}`);if(i.lockedBy!==o)throw i.lockedBy===void 0?new Error(`Content entry is not locked: ${n}`):new Error("Cannot release lock: entry is locked by another user");await e.db.patch(n,{lockedBy:void 0,lockExpiresAt:void 0});const l=await e.db.get(n);if(!l)throw new Error("Failed to retrieve updated entry");return l}});St({args:E$.fields,returns:Cn,handler:async(e,t)=>{const{id:n,releasedBy:o}=t,i=await e.db.get(n);if(!i)throw new Error(`Content entry not found: ${n}`);if(i.lockedBy===void 0)throw new Error(`Content entry is not locked: ${n}`);await e.db.patch(n,{lockedBy:void 0,lockExpiresAt:void 0,updatedBy:o});const l=await e.db.get(n);if(!l)throw new Error("Failed to retrieve updated entry");return l}});St({args:T$.fields,returns:Cn,handler:async(e,t)=>{const{id:n,userId:o,lockDuration:i}=t,l=await e.db.get(n);if(!l)throw new Error(`Content entry not found: ${n}`);if(l.lockedBy!==o)throw l.lockedBy===void 0?new Error(`Content entry is not locked: ${n}`):new Error("Cannot renew lock: entry is locked by another user");if(!ic(l.lockExpiresAt))throw new Error("Lock has expired and cannot be renewed. Please acquire a new lock.");const u=TT(i),h=Date.now()+u;await e.db.patch(n,{lockExpiresAt:h});const p=await e.db.get(n);if(!p)throw new Error("Failed to retrieve updated entry");return p}});function S5(e,t){return e.lockedBy===void 0||e.lockExpiresAt===void 0?{isAllowed:!0}:ic(e.lockExpiresAt)?t&&e.lockedBy===t?{isAllowed:!0}:{isAllowed:!1,error:`Cannot update: entry is locked by user ${e.lockedBy}. Lock expires at ${new Date(e.lockExpiresAt).toISOString()}`}:{isAllowed:!0}}St({args:{...W4.fields,_auth:c.optional(un)},returns:Cn,handler:async(e,t)=>{const{contentTypeName:n,data:o,locale:i,primaryEntryId:l,createdBy:u,_auth:f}=t;dn(f,"contentEntries","create");const h=await e.db.query("contentTypes").withIndex("by_name",M=>M.eq("name",n)).first();if(!h)throw rc(n);if(!h.isActive)throw pT(n,h.displayName);if(Pt(h))throw oc(n,h.displayName);const p=h.slugField??"title",y=o,v={name:h.name,displayName:h.displayName,description:h.description,fields:h.fields,titleField:h.titleField,slugField:h.slugField,singleton:h.singleton},w=cy(y,v);if(!w.valid)throw ty(w.errors);let _=t.slug;if(!_){const M=y[p];typeof M=="string"&&M.trim()?_=ly(M):_="untitled"}const x=await Td(_,async M=>await e.db.query("contentEntries").withIndex("by_content_type_and_slug",$=>$.eq("contentTypeName",n).eq("slug",M)).filter($=>$.eq($.field("deletedAt"),void 0)).first()),C=t.status??"draft";let N="";for(const M of h.fields)if(M.searchable&&y[M.name]){const $=y[M.name];typeof $=="string"&&(N+=` ${$}`)}N=N.trim()||void 0;const k=await e.db.insert("contentEntries",{contentTypeName:n,slug:x,status:C,data:o,locale:i,primaryEntryId:l,version:1,createdBy:u,updatedBy:u,searchText:N}),O=await e.db.get(k);if(!O)throw vT(n);return await Kt(e,{eventType:Xo("created"),resourceType:"contentEntry",resourceId:k,action:"created",payload:{slug:x,contentTypeName:n,status:C,version:1,locale:i},userId:u}),O}});St({args:{...e$.fields,_auth:c.optional(un)},returns:Cn,handler:async(e,t)=>{const{id:n,slug:o,data:i,status:l,scheduledPublishAt:u,updatedBy:f,regenerateSlug:h,_auth:p}=t,y=await e.db.get(n);if(!y)throw Sa(n);if(Pt(y))throw sc(n);if(dn(is(p,y.createdBy),"contentEntries","update"),!S5(y,f).isAllowed)throw y.lockedBy&&y.lockExpiresAt?pS(n,y.lockedBy,y.lockExpiresAt,f):pS(n,"unknown",Date.now(),f);const w=await e.db.query("contentTypes").withIndex("by_name",O=>O.eq("name",y.contentTypeName)).first();if(!w)throw rc(y.contentTypeName);if(Pt(w))throw oc(y.contentTypeName,w.displayName);const _={updatedBy:f};let R;if(i!==void 0?R={...y.data,...i}:R=y.data,i!==void 0){const O={name:w.name,displayName:w.displayName,description:w.description,fields:w.fields,titleField:w.titleField,slugField:w.slugField,singleton:w.singleton},M=cy(R,O);if(!M.valid)throw ty(M.errors);_.data=R}const x=async O=>{const M=await e.db.query("contentEntries").withIndex("by_content_type_and_slug",$=>$.eq("contentTypeName",y.contentTypeName).eq("slug",O)).filter($=>$.eq($.field("deletedAt"),void 0)).first();return M&&M._id!==n?M:null};if(o!==void 0&&o!==y.slug){const O=await Td(o,x,{excludeEntryId:n});_.slug=O}else if(h&&i!==void 0){const O=w.slugField??"title",M=R[O];if(typeof M=="string"&&M.trim()){const $=ly(M);if($!==y.slug){const V=await Td($,x,{excludeEntryId:n});_.slug=V}}}if(i!==void 0){let O="";for(const M of w.fields)if(M.searchable&&R[M.name]){const $=R[M.name];typeof $=="string"&&(O+=` ${$}`)}_.searchText=O.trim()||void 0}l!==void 0&&(_.status=l),u!==void 0&&(_.scheduledPublishAt=u);const C=i!==void 0&&JSON.stringify(y.data)!==JSON.stringify(R),N=_.slug!==void 0;(C||N)&&await e.db.insert("contentVersions",{entryId:n,versionNumber:y.version,data:y.data,slug:y.slug,status:y.status,changeDescription:"Draft saved",createdBy:f,wasPublished:!1}),_.version=y.version+1,await e.db.patch(n,_);const k=await e.db.get(n);if(!k)throw ny(n);return await Kt(e,{eventType:Xo("updated"),resourceType:"contentEntry",resourceId:n,action:"updated",payload:{slug:k.slug,contentTypeName:y.contentTypeName,status:k.status,version:k.version,locale:k.locale},userId:f}),k}});St({args:{...t$.fields,_auth:c.optional(un)},returns:Cn,handler:async(e,t)=>{const{id:n,changeDescription:o,updatedBy:i,_auth:l}=t,u=await e.db.get(n);if(!u)throw Sa(n);if(Pt(u))throw sc(n);if(dn(is(l,u.createdBy),"contentEntries","publish"),u.status==="published")throw z$(n);if(u.status==="archived")throw P$(n);const f=Date.now();await e.db.insert("contentVersions",{entryId:n,versionNumber:u.version,data:u.data,slug:u.slug,status:u.status,changeDescription:o,createdBy:i,wasPublished:!0,publishedAt:f});const h={status:"published",lastPublishedAt:f,version:u.version+1,updatedBy:i,scheduledPublishAt:void 0};u.firstPublishedAt===void 0&&(h.firstPublishedAt=f),await e.db.patch(n,h);const p=await e.db.get(n);if(!p)throw ny(n);return await Kt(e,{eventType:Xo("published"),resourceType:"contentEntry",resourceId:n,action:"published",payload:{slug:p.slug,contentTypeName:u.contentTypeName,status:"published",version:p.version,locale:p.locale,changeDescription:o},userId:i}),p}});St({args:{id:c.id("contentEntries"),updatedBy:c.optional(c.string()),_auth:c.optional(un)},returns:Cn,handler:async(e,t)=>{const{id:n,updatedBy:o,_auth:i}=t,l=await e.db.get(n);if(!l)throw Sa(n);if(Pt(l))throw sc(n);if(dn(is(i,l.createdBy),"contentEntries","unpublish"),l.status!=="published")throw L$(n,l.status);await e.db.patch(n,{status:"draft",version:l.version+1,updatedBy:o});const u=await e.db.get(n);if(!u)throw ny(n);return await Kt(e,{eventType:Xo("unpublished"),resourceType:"contentEntry",resourceId:n,action:"unpublished",payload:{slug:u.slug,contentTypeName:l.contentTypeName,status:"draft",version:u.version,locale:u.locale},userId:o}),u}});const CT=c.object({...Cn.fields,deletedVersionsCount:c.optional(c.number())});St({args:{...n$.fields,_auth:c.optional(un)},returns:CT,handler:async(e,t)=>{const{id:n,deletedBy:o,hardDelete:i=!1,_auth:l}=t,u=await e.db.get(n);if(!u)throw Sa(n);if(dn(is(l,u.createdBy),"contentEntries","delete"),!i&&Pt(u))throw sc(n);const f=await e.db.query("contentVersions").withIndex("by_entry",p=>p.eq("entryId",n)).collect(),h=f.length;if(i){for(const p of f)await e.db.delete(p._id);return await e.db.delete(n),await Kt(e,{eventType:Xo("deleted"),resourceType:"contentEntry",resourceId:n,action:"deleted",payload:{slug:u.slug,contentTypeName:u.contentTypeName,status:u.status,version:u.version,locale:u.locale},userId:o,metadata:{hardDelete:!0}}),{...u,deletedAt:Date.now(),updatedBy:o,deletedVersionsCount:h}}else{const p=Date.now();return await e.db.patch(n,{deletedAt:p,updatedBy:o}),await Kt(e,{eventType:Xo("deleted"),resourceType:"contentEntry",resourceId:n,action:"deleted",payload:{slug:u.slug,contentTypeName:u.contentTypeName,status:u.status,version:u.version,locale:u.locale},userId:o,metadata:{hardDelete:!1}}),{...u,deletedAt:p,updatedBy:o??u.updatedBy,deletedVersionsCount:h}}}});St({args:{id:c.id("contentEntries"),restoredBy:c.optional(c.string()),_auth:c.optional(un)},returns:Cn,handler:async(e,t)=>{const{id:n,restoredBy:o,_auth:i}=t,l=await e.db.get(n);if(!l)throw Sa(n);if(dn(is(i,l.createdBy),"contentEntries","restore"),!Pt(l))throw j$(n);return await e.db.patch(n,{deletedAt:void 0,updatedBy:o}),await Kt(e,{eventType:Xo("restored"),resourceType:"contentEntry",resourceId:n,action:"restored",payload:{slug:l.slug,contentTypeName:l.contentTypeName,status:l.status,version:l.version,locale:l.locale},userId:o}),{...l,deletedAt:void 0,updatedBy:o??l.updatedBy}}});St({args:{...r$.fields,_auth:c.optional(un)},returns:Cn,handler:async(e,t)=>{const{sourceEntryId:n,slug:o,copyMediaReferences:i=!0,locale:l,createdBy:u,_auth:f}=t;dn(f,"contentEntries","create");const h=await e.db.get(n);if(!h)throw Sa(n);if(Pt(h))throw sc(n);const p=await e.db.query("contentTypes").withIndex("by_name",O=>O.eq("name",h.contentTypeName)).first();if(!p)throw rc(h.contentTypeName);if(!p.isActive)throw pT(h.contentTypeName,p.displayName);if(Pt(p))throw oc(h.contentTypeName,p.displayName);const y=JSON.parse(JSON.stringify(h.data));if(!i){const O=p.fields;for(const M of O)if(M.type==="media"&&y[M.name]!==void 0){const $=M.options?.multiple;y[M.name]=$?[]:null}}const v={name:p.name,displayName:p.displayName,description:p.description,fields:p.fields,titleField:p.titleField,slugField:p.slugField,singleton:p.singleton},w=cy(y,v);if(!w.valid)throw ty(w.errors);let _=o;_||(_=h.slug);const x=await Td(_,async O=>await e.db.query("contentEntries").withIndex("by_content_type_and_slug",M=>M.eq("contentTypeName",h.contentTypeName).eq("slug",O)).filter(M=>M.eq(M.field("deletedAt"),void 0)).first());let C="";for(const O of p.fields)if(O.searchable&&y[O.name]){const M=y[O.name];typeof M=="string"&&(C+=` ${M}`)}C=C.trim()||void 0;const N=await e.db.insert("contentEntries",{contentTypeName:h.contentTypeName,slug:x,status:"draft",data:y,locale:l??h.locale,version:1,firstPublishedAt:void 0,lastPublishedAt:void 0,scheduledPublishAt:void 0,lockedBy:void 0,lockExpiresAt:void 0,createdBy:u,updatedBy:u,searchText:C}),k=await e.db.get(N);if(!k)throw vT(h.contentTypeName);return await Kt(e,{eventType:Xo("duplicated"),resourceType:"contentEntry",resourceId:N,action:"duplicated",payload:{slug:x,contentTypeName:h.contentTypeName,status:"draft",version:1,locale:l??h.locale,sourceEntryId:n},userId:u}),k}});const _5=new Set(["image/jpeg","image/jpg","image/png","image/gif","image/webp","image/avif","image/svg+xml","image/bmp","image/tiff","image/x-icon","image/ico","image/heic","image/heif"]),E5=new Set(["video/mp4","video/webm","video/ogg","video/quicktime","video/x-msvideo","video/mpeg","video/3gpp","video/x-matroska","video/x-flv"]),T5=new Set(["audio/mpeg","audio/mp3","audio/ogg","audio/wav","audio/webm","audio/aac","audio/flac","audio/x-m4a","audio/mp4","audio/x-wav"]),C5=new Set(["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","text/plain","text/csv","text/markdown","application/rtf","application/json","application/xml","text/xml"]);function fa(e){const t=e.toLowerCase();return _5.has(t)?"image":E5.has(t)?"video":T5.has(t)?"audio":C5.has(t)?"document":t.startsWith("image/")?"image":t.startsWith("video/")?"video":t.startsWith("audio/")?"audio":(t.startsWith("text/")||t.startsWith("application/"))&&(t.includes("document")||t.includes("sheet")||t.includes("presentation"))?"document":"other"}const RT=c.object({...Xd.fields,_id:c.id("mediaItems"),_creationTime:c.number(),deletedAt:c.optional(c.number()),storageFileDeleted:c.optional(c.boolean())});St({args:{...o$.fields,_auth:c.optional(un)},returns:Xg,handler:async(e,t)=>{const{storageId:n,name:o,mimeType:i,size:l,title:u,description:f,altText:h,parentId:p,width:y,height:v,duration:w,metadata:_,tags:R,createdBy:x,_auth:C}=t;if(dn(C,"mediaItems","create"),p!==void 0){const L=await e.db.get(p);if(!L)throw oy(p);if(Pt(L))throw sy(p)}const N=[];N.push(o),u&&N.push(u),f&&N.push(f),R&&R.length>0&&N.push(...R);const k=N.join(" ").trim()||void 0;let O="/";if(p){const L=await e.db.get(p);L&&L.kind==="folder"?O=L.path+o:O="/"+o}else O="/"+o;const M=await e.db.insert("mediaItems",{kind:"asset",storageId:n,name:o,mimeType:i,size:l,title:u,description:f,altText:h,parentId:p,path:O,width:y,height:v,duration:w,metadata:_,tags:R,createdBy:x,searchText:k}),$=await e.db.get(M);if(!$)throw U$();let V;if(p){const L=await e.db.get(p);L&&L.kind==="folder"&&(V=L.path)}return await Kt(e,{eventType:da("created"),resourceType:"mediaAsset",resourceId:M,action:"created",payload:{name:o,mimeType:i,type:fa(i),size:l??0,parentId:p,path:V},userId:x}),$}});St({args:{...s$.fields,_auth:c.optional(un)},returns:Xg,handler:async(e,t)=>{const{id:n,name:o,title:i,description:l,altText:u,parentId:f,tags:h,_auth:p}=t,y=await e.db.get(n);if(!y||y.kind!=="asset")throw ry(n);const v=y;if(Pt(v))throw bT(n);if(dn(is(p,v.createdBy),"mediaItems","update"),f!==void 0&&f!==v.parentId){const x=await e.db.get(f);if(!x||x.kind!=="folder")throw oy(f);if(Pt(x))throw sy(f)}const w={};if(o!==void 0&&(w.name=o),i!==void 0&&(w.title=i),l!==void 0&&(w.description=l),u!==void 0&&(w.altText=u),f!==void 0&&(w.parentId=f),h!==void 0&&(w.tags=h),o!==void 0||i!==void 0||l!==void 0||h!==void 0){const x=[],C=o??v.name,N=i??v.title,k=l??v.description,O=h??v.tags;x.push(C),N&&x.push(N),k&&x.push(k),O&&O.length>0&&x.push(...O),w.searchText=x.join(" ").trim()||void 0}await e.db.patch(n,w);const _=await e.db.get(n);if(!_||_.kind!=="asset")throw B$(n);let R;if(_.parentId){const x=await e.db.get(_.parentId);x&&x.kind==="folder"&&(R=x.path)}return await Kt(e,{eventType:da("updated"),resourceType:"mediaAsset",resourceId:n,action:"updated",payload:{name:_.name,mimeType:_.mimeType,type:fa(_.mimeType),size:_.size??0,parentId:_.parentId,path:R},userId:v.createdBy}),_}});wa({args:{mediaAssetId:c.id("mediaItems"),limit:c.optional(c.number())},returns:c.array(v$),handler:async(e,t)=>{const{mediaAssetId:n,limit:o=100}=t,i=n,l=[],u=await e.db.query("contentTypes").collect(),f=new Map(u.map(p=>[p.name,p])),h=await e.db.query("contentEntries").filter(p=>p.eq(p.field("deletedAt"),void 0)).take(1e4);for(const p of h){if(l.length>=o)break;const y=f.get(p.contentTypeName);if(!y)continue;const v=y.fields.filter(_=>_.type==="media"),w=[];for(const _ of v){const R=p.data?.[_.name];if(!R)continue;(_.options?.multiple??!1)&&Array.isArray(R)?R.includes(i)&&w.push(_.name):R===i&&w.push(_.name)}w.length>0&&l.push({entryId:p._id,slug:p.slug,contentTypeName:y.name,fields:w})}return l}});async function R5(e,t){const n=t.toString(),o=[],i=await e.db.query("contentTypes").collect(),l=new Map(i.map(f=>[f.name,f])),u=await e.db.query("contentEntries").filter(f=>f.eq(f.field("deletedAt"),void 0)).take(1e4);for(const f of u){if(o.length>=100)break;const h=l.get(f.contentTypeName);if(!h)continue;const p=h.fields.filter(v=>v.type==="media"),y=[];for(const v of p){const w=f.data?.[v.name];if(!w)continue;(v.options?.multiple??!1)&&Array.isArray(w)?w.includes(n)&&y.push(v.name):w===n&&y.push(v.name)}y.length>0&&o.push({entryId:f._id,slug:f.slug,contentTypeName:h.name,fields:y})}return o}St({args:{...i$.fields,_auth:c.optional(un)},returns:RT,handler:async(e,t)=>{const{id:n,deletedBy:o,hardDelete:i=!1,forceDelete:l=!1,_auth:u}=t,f=await e.db.get(n);if(!f||f.kind!=="asset")throw ry(n);const h=f;if(dn(is(u,h.createdBy),"mediaItems","delete"),!i&&Pt(h))throw bT(n);if(!l){const y=await R5(e,n);if(y.length>0)throw F$(n,y.map(v=>({type:"contentEntry",id:v.entryId,name:`${v.contentTypeName}/${v.slug}`})))}let p;if(h.parentId){const y=await e.db.get(h.parentId);y&&y.kind==="folder"&&(p=y.path)}if(i){let y=!1;try{await e.storage.delete(h.storageId),y=!0}catch(v){console.warn(`Could not delete storage file for asset ${n}:`,v instanceof Error?v.message:v)}return await e.db.delete(n),await Kt(e,{eventType:da("deleted"),resourceType:"mediaAsset",resourceId:n,action:"deleted",payload:{name:h.name,mimeType:h.mimeType,type:fa(h.mimeType),size:h.size??0,parentId:h.parentId,path:p},userId:o,metadata:{hardDelete:!0,storageFileDeleted:y}}),{...h,deletedAt:Date.now(),storageFileDeleted:y}}else{const y=Date.now();return await e.db.patch(n,{deletedAt:y}),await Kt(e,{eventType:da("deleted"),resourceType:"mediaAsset",resourceId:n,action:"deleted",payload:{name:h.name,mimeType:h.mimeType,type:fa(h.mimeType),size:h.size??0,parentId:h.parentId,path:p},userId:o,metadata:{hardDelete:!1}}),{...h,deletedAt:y,storageFileDeleted:void 0}}}});St({args:{...a$.fields,_auth:c.optional(un)},returns:Xg,handler:async(e,t)=>{const{id:n,restoredBy:o,_auth:i}=t,l=await e.db.get(n);if(!l||l.kind!=="asset")throw ry(n);const u=l;if(dn(is(i,u.createdBy),"mediaItems","update"),u.deletedAt===void 0)throw $$(n);await e.db.patch(n,{deletedAt:void 0});const f=await e.db.get(n);if(!f||f.kind!=="asset")throw iy("Failed to restore media asset");let h;if(f.parentId){const p=await e.db.get(f.parentId);p&&p.kind==="folder"&&(h=p.path)}return await Kt(e,{eventType:da("restored"),resourceType:"mediaAsset",resourceId:n,action:"restored",payload:{name:f.name,mimeType:f.mimeType,type:fa(f.mimeType),size:f.size??0,parentId:f.parentId,path:h},userId:o}),f}});St({args:{...l$.fields,_auth:c.optional(un)},returns:u$,handler:async(e,t)=>{const{assetIds:n,targetFolderId:o,movedBy:i,_auth:l}=t;if(dn(l,"mediaItems","update"),n.length>fS)throw q$(fS,n.length);if(n.length===0)return{total:0,succeeded:0,failed:0,targetFolderId:o,targetFolderPath:void 0,results:[]};let u;if(o!==void 0){const p=await e.db.get(o);if(!p)throw oy(o);if(Pt(p))throw sy(o);u=p.path}const f=[];for(const p of n)try{const y=await e.db.get(p);if(!y||y.kind!=="asset"){f.push({id:p,success:!1,error:"Asset not found"});continue}if(Pt(y)){f.push({id:p,success:!1,error:"Asset has been deleted"});continue}if(y.parentId===o){f.push({id:p,success:!0,previousFolderId:y.parentId});continue}const v=y.parentId;await e.db.patch(p,{parentId:o}),await Kt(e,{eventType:da("updated"),resourceType:"mediaAsset",resourceId:p,action:"updated",payload:{name:y.name,mimeType:y.mimeType,type:fa(y.mimeType),size:y.size??0,parentId:o,path:u},userId:i,metadata:{moveOperation:!0,previousFolderId:v}}),f.push({id:p,success:!0,previousFolderId:v})}catch(y){f.push({id:p,success:!1,error:y instanceof Error?y.message:"Unknown error"})}const h=f.filter(p=>p.success).length;return{total:n.length,succeeded:h,failed:n.length-h,targetFolderId:o,targetFolderPath:u,results:f}}});c.object({numItems:c.number(),cursor:c.union(c.string(),c.null())});const A5=c.object({...En,type:c.literal("tags"),options:c.optional(c.object({taxonomyId:c.optional(c.string()),allowCreate:c.optional(c.boolean()),maxTags:c.optional(c.number()),minTags:c.optional(c.number())}))}),Wd=c.union(K1,X1,J1,W1,eT,tT,sT,A5,nT,rT,iT,aT,oT);c.object({...cn(ba.fields,["_id","fields"]),_id:c.string(),fields:c.array(Wd)});c.object({...cn(ba.fields,["_id","fields"]),_id:c.string(),fields:c.array(Wd),entryCount:c.optional(c.number())});const AT=c.union(c.literal("code"),c.literal("database"));c.object({...cn(ba.fields,["_id","fields"]),_id:c.string(),fields:c.array(Wd),source:AT});c.object({...cn(ba.fields,["_id","fields"]),_id:c.string(),fields:c.array(Wd),source:AT,entryCount:c.optional(c.number())});c.object({...cn(_T.fields,["deletedId"]),deletedId:c.string()});const uy=c.object({...cn(Cn.fields,["_id","primaryEntryId"]),_id:c.string(),primaryEntryId:c.optional(c.string())});c.object({...cn(CT.fields,["_id","primaryEntryId"]),_id:c.string(),primaryEntryId:c.optional(c.string())});c.object({...cn(m$.fields,["_id","entryId"]),_id:c.string(),entryId:c.string()});c.object({hasChanges:c.boolean(),fromVersion:c.object({versionNumber:c.number(),status:yr,slug:c.string(),wasPublished:c.boolean(),createdAt:c.number()}),toVersion:c.object({versionNumber:c.number(),status:yr,slug:c.string(),wasPublished:c.boolean(),createdAt:c.number()}),changedFields:c.array(c.string()),fieldDiffs:c.array(dT),slugChanged:c.boolean(),statusChanged:c.boolean(),changeSummary:c.string()});const N5=c.object({isResizable:c.boolean(),aspectRatio:c.optional(c.number()),hasTransparency:c.optional(c.boolean()),isVector:c.optional(c.boolean()),suggestedMaxWidth:c.optional(c.number()),durationSeconds:c.optional(c.number())}),NT=c.object({...cn(Xd.fields,["parentId","storageId"]),_id:c.string(),_creationTime:c.number(),parentId:c.optional(c.string()),storageId:c.string()}),O5=c.object({...cn(Xd.fields,["parentId","storageId"]),_id:c.string(),_creationTime:c.number(),parentId:c.optional(c.string()),storageId:c.string(),url:c.union(c.string(),c.null()),optimizationHints:N5}),OT=c.object({...cn(uT.fields,["parentId"]),_id:c.string(),_creationTime:c.number(),parentId:c.optional(c.string())});c.union(NT,OT);c.union(O5,OT);c.object({...cn(RT.fields,["_id","parentId","storageId"]),_id:c.string(),parentId:c.optional(c.string()),storageId:c.string()});const k5=c.object({id:c.string(),success:c.boolean(),error:c.optional(c.string()),previousFolderId:c.optional(c.string())});c.object({total:c.number(),succeeded:c.number(),failed:c.number(),targetFolderId:c.optional(c.string()),targetFolderPath:c.optional(c.string()),results:c.array(k5)});const M5=c.object({_id:c.string(),_creationTime:c.number(),assetId:c.string(),storageId:c.string(),variantType:nc,width:c.optional(c.number()),height:c.optional(c.number()),format:c.string(),mimeType:c.string(),size:c.number(),quality:c.optional(c.number()),preset:c.optional(c.string()),autoGenerated:c.boolean(),status:Yg,errorMessage:c.optional(c.string()),processingStartedAt:c.optional(c.number()),processingCompletedAt:c.optional(c.number()),deletedAt:c.optional(c.number()),createdBy:c.optional(c.string())}),I5=c.object({...M5.fields,url:c.union(c.string(),c.null())});c.object({total:c.number(),succeeded:c.number(),failed:c.number(),results:c.array(c.object({preset:c.string(),success:c.boolean(),variantId:c.optional(c.string()),error:c.optional(c.string())}))});c.object({src:c.union(c.string(),c.null()),srcset:c.string(),entries:c.array(c.object({url:c.string(),descriptor:c.string(),width:c.number(),format:c.string()})),sizes:c.optional(c.string())});c.object({asset:NT,variants:c.array(I5),originalUrl:c.union(c.string(),c.null())});c.object({...cn(g$.fields,["_id"]),_id:c.string()});c.object({...cn(y$.fields,["_id","taxonomyId","parentId"]),_id:c.string(),taxonomyId:c.string(),parentId:c.optional(c.string())});c.object({_id:c.string(),name:c.string(),slug:c.string(),description:c.optional(c.string()),color:c.optional(c.string()),icon:c.optional(c.string()),sortOrder:c.optional(c.number()),usageCount:c.number(),depth:c.number(),children:c.array(c.any())});c.object({...cn(w$.fields,["_id"]),_id:c.optional(c.string())});c.object({...uy.fields,deletedDaysAgo:c.number(),expiresAt:c.optional(c.number()),contentTypeName:c.optional(c.string())});c.object({totalItems:c.number(),byContentType:c.array(c.object({contentTypeId:c.string(),contentTypeName:c.string(),count:c.number()})),expiringWithin7Days:c.number(),oldestItemDaysAgo:c.optional(c.number())});c.object({deletedCount:c.number(),deletedVersionsCount:c.number(),errors:c.array(c.object({id:c.string(),error:c.string()}))});c.object({isLocked:c.boolean(),lockedBy:c.optional(c.string()),lockExpiresAt:c.optional(c.number()),timeRemaining:c.optional(c.number()),isExpired:c.optional(c.boolean())});c.object({success:c.boolean(),entry:c.optional(uy),error:c.optional(c.string()),currentLockHolder:c.optional(c.string()),currentLockExpiresAt:c.optional(c.number())});c.object({...uy.fields,contentTypeName:c.optional(c.string())});const D5=c.object({id:c.string(),success:c.boolean(),error:c.optional(c.string())});c.object({total:c.number(),succeeded:c.number(),failed:c.number(),results:c.array(D5)});c.object({contentTypes:c.number(),contentEntries:c.number(),mediaAssets:c.number(),published:c.number()});c.object({_id:c.union(c.string(),c.null()),_creationTime:c.optional(c.number()),defaultLocale:c.string(),availableLocales:c.array(c.string()),features:c.object({versioning:c.boolean(),scheduling:c.boolean(),localization:c.boolean(),mediaManagement:c.boolean()}),updatedBy:c.optional(c.string())});c.object({type:c.union(c.literal("CONTENT_TYPE_MISSING_IN_DB"),c.literal("CONTENT_TYPE_MISSING_IN_CODE"),c.literal("FIELD_MISSING_IN_DB"),c.literal("FIELD_MISSING_IN_CODE"),c.literal("FIELD_TYPE_MISMATCH"),c.literal("FIELD_REQUIRED_MISMATCH")),severity:c.union(c.literal("error"),c.literal("warning"),c.literal("info")),contentTypeName:c.string(),fieldName:c.optional(c.string()),message:c.string()});const j5=new Map,kT=[{name:"text",displayName:"Text",icon:"Type",validator:c.string(),defaultValue:""},{name:"richText",displayName:"Rich Text",icon:"FileText",validator:c.string(),defaultValue:""},{name:"number",displayName:"Number",icon:"Hash",validator:c.number(),defaultValue:0},{name:"boolean",displayName:"Boolean",icon:"ToggleLeft",validator:c.boolean(),defaultValue:!1},{name:"date",displayName:"Date",icon:"Calendar",validator:c.union(c.string(),c.null()),defaultValue:null},{name:"datetime",displayName:"Date & Time",icon:"Clock",validator:c.union(c.string(),c.null()),defaultValue:null},{name:"reference",displayName:"Reference",icon:"Link",validator:c.union(c.string(),c.array(c.string()),c.null()),defaultValue:null},{name:"media",displayName:"Media",icon:"Image",validator:c.union(c.string(),c.null()),defaultValue:null},{name:"json",displayName:"JSON",icon:"Braces",validator:c.any(),defaultValue:null},{name:"select",displayName:"Select",icon:"ChevronDown",validator:c.string(),defaultValue:""},{name:"multiSelect",displayName:"Multi Select",icon:"CheckSquare",validator:c.array(c.string()),defaultValue:[]},{name:"tags",displayName:"Tags",icon:"Tags",validator:c.array(c.string()),defaultValue:[]},{name:"category",displayName:"Category",icon:"Folder",validator:c.union(c.string(),c.array(c.string()),c.null()),defaultValue:null}];kT.forEach(e=>j5.set(e.name,e));new Set(kT.map(e=>e.name));function ee(e,t,n){function o(f,h){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:h,constr:u,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,h);const p=u.prototype,y=Object.keys(p);for(let v=0;v<y.length;v++){const w=y[v];w in f||(f[w]=p[w].bind(f))}}const i=n?.Parent??Object;class l extends i{}Object.defineProperty(l,"name",{value:e});function u(f){var h;const p=n?.Parent?new l:this;o(p,f),(h=p._zod).deferred??(h.deferred=[]);for(const y of p._zod.deferred)y();return p}return Object.defineProperty(u,"init",{value:o}),Object.defineProperty(u,Symbol.hasInstance,{value:f=>n?.Parent&&f instanceof n.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class ia extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class MT extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const IT={};function Jo(e){return IT}function DT(e){const t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,i])=>t.indexOf(+o)===-1).map(([o,i])=>i)}function tg(e,t){return typeof t=="bigint"?t.toString():t}function dy(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function fy(e){return e==null}function hy(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function z5(e,t){const n=(e.toString().split(".")[1]||"").length,o=t.toString();let i=(o.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(o)){const h=o.match(/\d?e-(\d?)/);h?.[1]&&(i=Number.parseInt(h[1]))}const l=n>i?n:i,u=Number.parseInt(e.toFixed(l).replace(".","")),f=Number.parseInt(t.toFixed(l).replace(".",""));return u%f/10**l}const mS=Symbol("evaluating");function Xe(e,t,n){let o;Object.defineProperty(e,t,{get(){if(o!==mS)return o===void 0&&(o=mS,o=n()),o},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Ws(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function as(...e){const t={};for(const n of e){const o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function gS(e){return JSON.stringify(e)}function L5(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const jT="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Cd(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const P5=dy(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ha(e){if(Cd(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Cd(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function zT(e){return ha(e)?{...e}:Array.isArray(e)?[...e]:e}const $5=new Set(["string","number","symbol"]);function ef(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ls(e,t,n){const o=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(o._zod.parent=e),o}function xe(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function F5(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const U5={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function B5(e,t){const n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const l=as(e._zod.def,{get shape(){const u={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(u[f]=n.shape[f])}return Ws(this,"shape",u),u},checks:[]});return ls(e,l)}function q5(e,t){const n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const l=as(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete u[f]}return Ws(this,"shape",u),u},checks:[]});return ls(e,l)}function V5(e,t){if(!ha(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const l=e._zod.def.shape;for(const u in t)if(Object.getOwnPropertyDescriptor(l,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=as(e._zod.def,{get shape(){const l={...e._zod.def.shape,...t};return Ws(this,"shape",l),l}});return ls(e,i)}function H5(e,t){if(!ha(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=as(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return Ws(this,"shape",o),o}});return ls(e,n)}function Z5(e,t){const n=as(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return Ws(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return ls(e,n)}function Q5(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const u=as(t._zod.def,{get shape(){const f=t._zod.def.shape,h={...f};if(n)for(const p in n){if(!(p in f))throw new Error(`Unrecognized key: "${p}"`);n[p]&&(h[p]=e?new e({type:"optional",innerType:f[p]}):f[p])}else for(const p in f)h[p]=e?new e({type:"optional",innerType:f[p]}):f[p];return Ws(this,"shape",h),h},checks:[]});return ls(t,u)}function G5(e,t,n){const o=as(t._zod.def,{get shape(){const i=t._zod.def.shape,l={...i};if(n)for(const u in n){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(l[u]=new e({type:"nonoptional",innerType:i[u]}))}else for(const u in i)l[u]=new e({type:"nonoptional",innerType:i[u]});return Ws(this,"shape",l),l}});return ls(t,o)}function Ki(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Xi(e,t){return t.map(n=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function qu(e){return typeof e=="string"?e:e?.message}function Wo(e,t,n){const o={...e,path:e.path??[]};if(!e.message){const i=qu(e.inst?._zod.def?.error?.(e))??qu(t?.error?.(e))??qu(n.customError?.(e))??qu(n.localeError?.(e))??"Invalid input";o.message=i}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function py(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Kl(...e){const[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:{...t}}const LT=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,tg,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},PT=ee("$ZodError",LT),$T=ee("$ZodError",LT,{Parent:Error});function Y5(e,t=n=>n.message){const n={},o=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):o.push(t(i));return{formErrors:o,fieldErrors:n}}function K5(e,t=n=>n.message){const n={_errors:[]},o=i=>{for(const l of i.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>o({issues:u}));else if(l.code==="invalid_key")o({issues:l.issues});else if(l.code==="invalid_element")o({issues:l.issues});else if(l.path.length===0)n._errors.push(t(l));else{let u=n,f=0;for(;f<l.path.length;){const h=l.path[f];f===l.path.length-1?(u[h]=u[h]||{_errors:[]},u[h]._errors.push(t(l))):u[h]=u[h]||{_errors:[]},u=u[h],f++}}};return o(e),n}const my=e=>(t,n,o,i)=>{const l=o?Object.assign(o,{async:!1}):{async:!1},u=t._zod.run({value:n,issues:[]},l);if(u instanceof Promise)throw new ia;if(u.issues.length){const f=new(i?.Err??e)(u.issues.map(h=>Wo(h,l,Jo())));throw jT(f,i?.callee),f}return u.value},gy=e=>async(t,n,o,i)=>{const l=o?Object.assign(o,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},l);if(u instanceof Promise&&(u=await u),u.issues.length){const f=new(i?.Err??e)(u.issues.map(h=>Wo(h,l,Jo())));throw jT(f,i?.callee),f}return u.value},tf=e=>(t,n,o)=>{const i=o?{...o,async:!1}:{async:!1},l=t._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw new ia;return l.issues.length?{success:!1,error:new(e??PT)(l.issues.map(u=>Wo(u,i,Jo())))}:{success:!0,data:l.value}},X5=tf($T),nf=e=>async(t,n,o)=>{const i=o?Object.assign(o,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},i);return l instanceof Promise&&(l=await l),l.issues.length?{success:!1,error:new e(l.issues.map(u=>Wo(u,i,Jo())))}:{success:!0,data:l.value}},J5=nf($T),W5=e=>(t,n,o)=>{const i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return my(e)(t,n,i)},e6=e=>(t,n,o)=>my(e)(t,n,o),t6=e=>async(t,n,o)=>{const i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return gy(e)(t,n,i)},n6=e=>async(t,n,o)=>gy(e)(t,n,o),r6=e=>(t,n,o)=>{const i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return tf(e)(t,n,i)},o6=e=>(t,n,o)=>tf(e)(t,n,o),s6=e=>async(t,n,o)=>{const i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return nf(e)(t,n,i)},i6=e=>async(t,n,o)=>nf(e)(t,n,o),a6=/^[cC][^\s-]{8,}$/,l6=/^[0-9a-z]+$/,c6=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,u6=/^[0-9a-vA-V]{20}$/,d6=/^[A-Za-z0-9]{27}$/,f6=/^[a-zA-Z0-9_-]{21}$/,h6=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,p6=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,yS=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,m6=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,g6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function y6(){return new RegExp(g6,"u")}const v6=/^(?:(?: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])$/,b6=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,w6=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,x6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,S6=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,FT=/^[A-Za-z0-9_-]*$/,_6=/^\+[1-9]\d{6,14}$/,UT="(?:(?:\\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])))",E6=new RegExp(`^${UT}$`);function BT(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function T6(e){return new RegExp(`^${BT(e)}$`)}function C6(e){const t=BT({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${t}(?:${n.join("|")})`;return new RegExp(`^${UT}T(?:${o})$`)}const R6=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},A6=/^-?\d+$/,qT=/^-?\d+(?:\.\d+)?$/,N6=/^(?:true|false)$/i,O6=/^[^A-Z]*$/,k6=/^[^a-z]*$/,Rn=ee("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),VT={number:"number",bigint:"bigint",object:"date"},HT=ee("$ZodCheckLessThan",(e,t)=>{Rn.init(e,t);const n=VT[typeof t.value];e._zod.onattach.push(o=>{const i=o._zod.bag,l=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<l&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ZT=ee("$ZodCheckGreaterThan",(e,t)=>{Rn.init(e,t);const n=VT[typeof t.value];e._zod.onattach.push(o=>{const i=o._zod.bag,l=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>l&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),M6=ee("$ZodCheckMultipleOf",(e,t)=>{Rn.init(e,t),e._zod.onattach.push(n=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):z5(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),I6=ee("$ZodCheckNumberFormat",(e,t)=>{Rn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),o=n?"int":"number",[i,l]=U5[t.format];e._zod.onattach.push(u=>{const f=u._zod.bag;f.format=t.format,f.minimum=i,f.maximum=l,n&&(f.pattern=A6)}),e._zod.check=u=>{const f=u.value;if(n){if(!Number.isInteger(f)){u.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?u.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):u.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}f<i&&u.issues.push({origin:"number",input:f,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),f>l&&u.issues.push({origin:"number",input:f,code:"too_big",maximum:l,inclusive:!0,inst:e,continue:!t.abort})}}),D6=ee("$ZodCheckMaxLength",(e,t)=>{var n;Rn.init(e,t),(n=e._zod.def).when??(n.when=o=>{const i=o.value;return!fy(i)&&i.length!==void 0}),e._zod.onattach.push(o=>{const i=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{const i=o.value;if(i.length<=t.maximum)return;const u=py(i);o.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),j6=ee("$ZodCheckMinLength",(e,t)=>{var n;Rn.init(e,t),(n=e._zod.def).when??(n.when=o=>{const i=o.value;return!fy(i)&&i.length!==void 0}),e._zod.onattach.push(o=>{const i=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const i=o.value;if(i.length>=t.minimum)return;const u=py(i);o.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),z6=ee("$ZodCheckLengthEquals",(e,t)=>{var n;Rn.init(e,t),(n=e._zod.def).when??(n.when=o=>{const i=o.value;return!fy(i)&&i.length!==void 0}),e._zod.onattach.push(o=>{const i=o._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=o=>{const i=o.value,l=i.length;if(l===t.length)return;const u=py(i),f=l>t.length;o.issues.push({origin:u,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),rf=ee("$ZodCheckStringFormat",(e,t)=>{var n,o;Rn.init(e,t),e._zod.onattach.push(i=>{const l=i._zod.bag;l.format=t.format,t.pattern&&(l.patterns??(l.patterns=new Set),l.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),L6=ee("$ZodCheckRegex",(e,t)=>{rf.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),P6=ee("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=O6),rf.init(e,t)}),$6=ee("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=k6),rf.init(e,t)}),F6=ee("$ZodCheckIncludes",(e,t)=>{Rn.init(e,t);const n=ef(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push(i=>{const l=i._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(o)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),U6=ee("$ZodCheckStartsWith",(e,t)=>{Rn.init(e,t);const n=new RegExp(`^${ef(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),B6=ee("$ZodCheckEndsWith",(e,t)=>{Rn.init(e,t);const n=new RegExp(`.*${ef(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}}),q6=ee("$ZodCheckOverwrite",(e,t)=>{Rn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class V6{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const o=t.split(`
25
+ `).filter(u=>u),i=Math.min(...o.map(u=>u.length-u.trimStart().length)),l=o.map(u=>u.slice(i)).map(u=>" ".repeat(this.indent*2)+u);for(const u of l)this.content.push(u)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(l=>` ${l}`)];return new t(...n,i.join(`
26
+ `))}}const H6={major:4,minor:3,patch:6},yt=ee("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=H6;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const i of o)for(const l of i._zod.onattach)l(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(u,f,h)=>{let p=Ki(u),y;for(const v of f){if(v._zod.def.when){if(!v._zod.def.when(u))continue}else if(p)continue;const w=u.issues.length,_=v._zod.check(u);if(_ instanceof Promise&&h?.async===!1)throw new ia;if(y||_ instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await _,u.issues.length!==w&&(p||(p=Ki(u,w)))});else{if(u.issues.length===w)continue;p||(p=Ki(u,w))}}return y?y.then(()=>u):u},l=(u,f,h)=>{if(Ki(u))return u.aborted=!0,u;const p=i(f,o,h);if(p instanceof Promise){if(h.async===!1)throw new ia;return p.then(y=>e._zod.parse(y,h))}return e._zod.parse(p,h)};e._zod.run=(u,f)=>{if(f.skipChecks)return e._zod.parse(u,f);if(f.direction==="backward"){const p=e._zod.parse({value:u.value,issues:[]},{...f,skipChecks:!0});return p instanceof Promise?p.then(y=>l(y,u,f)):l(p,u,f)}const h=e._zod.parse(u,f);if(h instanceof Promise){if(f.async===!1)throw new ia;return h.then(p=>i(p,o,f))}return i(h,o,f)}}Xe(e,"~standard",()=>({validate:i=>{try{const l=X5(e,i);return l.success?{value:l.data}:{issues:l.error?.issues}}catch{return J5(e,i).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},vendor:"zod",version:1}))}),yy=ee("$ZodString",(e,t)=>{yt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??R6(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),dt=ee("$ZodStringFormat",(e,t)=>{rf.init(e,t),yy.init(e,t)}),Z6=ee("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=p6),dt.init(e,t)}),Q6=ee("$ZodUUID",(e,t)=>{if(t.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=yS(o))}else t.pattern??(t.pattern=yS());dt.init(e,t)}),G6=ee("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=m6),dt.init(e,t)}),Y6=ee("$ZodURL",(e,t)=>{dt.init(e,t),e._zod.check=n=>{try{const o=n.value.trim(),i=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),K6=ee("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=y6()),dt.init(e,t)}),X6=ee("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=f6),dt.init(e,t)}),J6=ee("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=a6),dt.init(e,t)}),W6=ee("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=l6),dt.init(e,t)}),eF=ee("$ZodULID",(e,t)=>{t.pattern??(t.pattern=c6),dt.init(e,t)}),tF=ee("$ZodXID",(e,t)=>{t.pattern??(t.pattern=u6),dt.init(e,t)}),nF=ee("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=d6),dt.init(e,t)}),rF=ee("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=C6(t)),dt.init(e,t)}),oF=ee("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=E6),dt.init(e,t)}),sF=ee("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=T6(t)),dt.init(e,t)}),iF=ee("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=h6),dt.init(e,t)}),aF=ee("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=v6),dt.init(e,t),e._zod.bag.format="ipv4"}),lF=ee("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=b6),dt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),cF=ee("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=w6),dt.init(e,t)}),uF=ee("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=x6),dt.init(e,t),e._zod.check=n=>{const o=n.value.split("/");try{if(o.length!==2)throw new Error;const[i,l]=o;if(!l)throw new Error;const u=Number(l);if(`${u}`!==l)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function QT(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const dF=ee("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=S6),dt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{QT(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function fF(e){if(!FT.test(e))return!1;const t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return QT(n)}const hF=ee("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=FT),dt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{fF(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),pF=ee("$ZodE164",(e,t)=>{t.pattern??(t.pattern=_6),dt.init(e,t)});function mF(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[o]=n;if(!o)return!1;const i=JSON.parse(atob(o));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const gF=ee("$ZodJWT",(e,t)=>{dt.init(e,t),e._zod.check=n=>{mF(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),GT=ee("$ZodNumber",(e,t)=>{yt.init(e,t),e._zod.pattern=e._zod.bag.pattern??qT,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const l=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...l?{received:l}:{}}),n}}),yF=ee("$ZodNumberFormat",(e,t)=>{I6.init(e,t),GT.init(e,t)}),vF=ee("$ZodBoolean",(e,t)=>{yt.init(e,t),e._zod.pattern=N6,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),bF=ee("$ZodUnknown",(e,t)=>{yt.init(e,t),e._zod.parse=n=>n}),wF=ee("$ZodNever",(e,t)=>{yt.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function vS(e,t,n){e.issues.length&&t.issues.push(...Xi(n,e.issues)),t.value[n]=e.value}const xF=ee("$ZodArray",(e,t)=>{yt.init(e,t),e._zod.parse=(n,o)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const l=[];for(let u=0;u<i.length;u++){const f=i[u],h=t.element._zod.run({value:f,issues:[]},o);h instanceof Promise?l.push(h.then(p=>vS(p,n,u))):vS(h,n,u)}return l.length?Promise.all(l).then(()=>n):n}});function Rd(e,t,n,o,i){if(e.issues.length){if(i&&!(n in o))return;t.issues.push(...Xi(n,e.issues))}e.value===void 0?n in o&&(t.value[n]=void 0):t.value[n]=e.value}function YT(e){const t=Object.keys(e.shape);for(const o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const n=F5(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function KT(e,t,n,o,i,l){const u=[],f=i.keySet,h=i.catchall._zod,p=h.def.type,y=h.optout==="optional";for(const v in t){if(f.has(v))continue;if(p==="never"){u.push(v);continue}const w=h.run({value:t[v],issues:[]},o);w instanceof Promise?e.push(w.then(_=>Rd(_,n,v,t,y))):Rd(w,n,v,t,y)}return u.length&&n.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:l}),e.length?Promise.all(e).then(()=>n):n}const SF=ee("$ZodObject",(e,t)=>{if(yt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...f};return Object.defineProperty(t,"shape",{value:h}),h}})}const o=dy(()=>YT(t));Xe(e._zod,"propValues",()=>{const f=t.shape,h={};for(const p in f){const y=f[p]._zod;if(y.values){h[p]??(h[p]=new Set);for(const v of y.values)h[p].add(v)}}return h});const i=Cd,l=t.catchall;let u;e._zod.parse=(f,h)=>{u??(u=o.value);const p=f.value;if(!i(p))return f.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),f;f.value={};const y=[],v=u.shape;for(const w of u.keys){const _=v[w],R=_._zod.optout==="optional",x=_._zod.run({value:p[w],issues:[]},h);x instanceof Promise?y.push(x.then(C=>Rd(C,f,w,p,R))):Rd(x,f,w,p,R)}return l?KT(y,p,f,h,o.value,e):y.length?Promise.all(y).then(()=>f):f}}),_F=ee("$ZodObjectJIT",(e,t)=>{SF.init(e,t);const n=e._zod.parse,o=dy(()=>YT(t)),i=w=>{const _=new V6(["shape","payload","ctx"]),R=o.value,x=O=>{const M=gS(O);return`shape[${M}]._zod.run({ value: input[${M}], issues: [] }, ctx)`};_.write("const input = payload.value;");const C=Object.create(null);let N=0;for(const O of R.keys)C[O]=`key_${N++}`;_.write("const newResult = {};");for(const O of R.keys){const M=C[O],$=gS(O),L=w[O]?._zod?.optout==="optional";_.write(`const ${M} = ${x(O)};`),L?_.write(`
27
+ if (${M}.issues.length) {
28
+ if (${$} in input) {
29
+ payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
30
+ ...iss,
31
+ path: iss.path ? [${$}, ...iss.path] : [${$}]
32
+ })));
33
+ }
34
+ }
35
+
36
+ if (${M}.value === undefined) {
37
+ if (${$} in input) {
38
+ newResult[${$}] = undefined;
39
+ }
40
+ } else {
41
+ newResult[${$}] = ${M}.value;
42
+ }
43
+
44
+ `):_.write(`
45
+ if (${M}.issues.length) {
46
+ payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
47
+ ...iss,
48
+ path: iss.path ? [${$}, ...iss.path] : [${$}]
49
+ })));
50
+ }
51
+
52
+ if (${M}.value === undefined) {
53
+ if (${$} in input) {
54
+ newResult[${$}] = undefined;
55
+ }
56
+ } else {
57
+ newResult[${$}] = ${M}.value;
58
+ }
59
+
60
+ `)}_.write("payload.value = newResult;"),_.write("return payload;");const k=_.compile();return(O,M)=>k(w,O,M)};let l;const u=Cd,f=!IT.jitless,p=f&&P5.value,y=t.catchall;let v;e._zod.parse=(w,_)=>{v??(v=o.value);const R=w.value;return u(R)?f&&p&&_?.async===!1&&_.jitless!==!0?(l||(l=i(t.shape)),w=l(w,_),y?KT([],R,w,_,v,e):w):n(w,_):(w.issues.push({expected:"object",code:"invalid_type",input:R,inst:e}),w)}});function bS(e,t,n,o){for(const l of e)if(l.issues.length===0)return t.value=l.value,t;const i=e.filter(l=>!Ki(l));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(l=>l.issues.map(u=>Wo(u,o,Jo())))}),t)}const EF=ee("$ZodUnion",(e,t)=>{yt.init(e,t),Xe(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Xe(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Xe(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Xe(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(l=>l._zod.pattern);return new RegExp(`^(${i.map(l=>hy(l.source)).join("|")})$`)}});const n=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(i,l)=>{if(n)return o(i,l);let u=!1;const f=[];for(const h of t.options){const p=h._zod.run({value:i.value,issues:[]},l);if(p instanceof Promise)f.push(p),u=!0;else{if(p.issues.length===0)return p;f.push(p)}}return u?Promise.all(f).then(h=>bS(h,i,e,l)):bS(f,i,e,l)}}),TF=ee("$ZodIntersection",(e,t)=>{yt.init(e,t),e._zod.parse=(n,o)=>{const i=n.value,l=t.left._zod.run({value:i,issues:[]},o),u=t.right._zod.run({value:i,issues:[]},o);return l instanceof Promise||u instanceof Promise?Promise.all([l,u]).then(([h,p])=>wS(n,h,p)):wS(n,l,u)}});function ng(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ha(e)&&ha(t)){const n=Object.keys(t),o=Object.keys(e).filter(l=>n.indexOf(l)!==-1),i={...e,...t};for(const l of o){const u=ng(e[l],t[l]);if(!u.valid)return{valid:!1,mergeErrorPath:[l,...u.mergeErrorPath]};i[l]=u.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let o=0;o<e.length;o++){const i=e[o],l=t[o],u=ng(i,l);if(!u.valid)return{valid:!1,mergeErrorPath:[o,...u.mergeErrorPath]};n.push(u.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function wS(e,t,n){const o=new Map;let i;for(const f of t.issues)if(f.code==="unrecognized_keys"){i??(i=f);for(const h of f.keys)o.has(h)||o.set(h,{}),o.get(h).l=!0}else e.issues.push(f);for(const f of n.issues)if(f.code==="unrecognized_keys")for(const h of f.keys)o.has(h)||o.set(h,{}),o.get(h).r=!0;else e.issues.push(f);const l=[...o].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(l.length&&i&&e.issues.push({...i,keys:l}),Ki(e))return e;const u=ng(t.value,n.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const CF=ee("$ZodRecord",(e,t)=>{yt.init(e,t),e._zod.parse=(n,o)=>{const i=n.value;if(!ha(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const l=[],u=t.keyType._zod.values;if(u){n.value={};const f=new Set;for(const p of u)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){f.add(typeof p=="number"?p.toString():p);const y=t.valueType._zod.run({value:i[p],issues:[]},o);y instanceof Promise?l.push(y.then(v=>{v.issues.length&&n.issues.push(...Xi(p,v.issues)),n.value[p]=v.value})):(y.issues.length&&n.issues.push(...Xi(p,y.issues)),n.value[p]=y.value)}let h;for(const p in i)f.has(p)||(h=h??[],h.push(p));h&&h.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:h})}else{n.value={};for(const f of Reflect.ownKeys(i)){if(f==="__proto__")continue;let h=t.keyType._zod.run({value:f,issues:[]},o);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&qT.test(f)&&h.issues.length){const v=t.keyType._zod.run({value:Number(f),issues:[]},o);if(v instanceof Promise)throw new Error("Async schemas not supported in object keys currently");v.issues.length===0&&(h=v)}if(h.issues.length){t.mode==="loose"?n.value[f]=i[f]:n.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(v=>Wo(v,o,Jo())),input:f,path:[f],inst:e});continue}const y=t.valueType._zod.run({value:i[f],issues:[]},o);y instanceof Promise?l.push(y.then(v=>{v.issues.length&&n.issues.push(...Xi(f,v.issues)),n.value[h.value]=v.value})):(y.issues.length&&n.issues.push(...Xi(f,y.issues)),n.value[h.value]=y.value)}}return l.length?Promise.all(l).then(()=>n):n}}),RF=ee("$ZodEnum",(e,t)=>{yt.init(e,t);const n=DT(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter(i=>$5.has(typeof i)).map(i=>typeof i=="string"?ef(i):i.toString()).join("|")})$`),e._zod.parse=(i,l)=>{const u=i.value;return o.has(u)||i.issues.push({code:"invalid_value",values:n,input:u,inst:e}),i}}),AF=ee("$ZodTransform",(e,t)=>{yt.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new MT(e.constructor.name);const i=t.transform(n.value,n);if(o.async)return(i instanceof Promise?i:Promise.resolve(i)).then(u=>(n.value=u,n));if(i instanceof Promise)throw new ia;return n.value=i,n}});function xS(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const XT=ee("$ZodOptional",(e,t)=>{yt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Xe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Xe(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${hy(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(n,o);return i instanceof Promise?i.then(l=>xS(l,n.value)):xS(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,o)}}),NF=ee("$ZodExactOptional",(e,t)=>{XT.init(e,t),Xe(e._zod,"values",()=>t.innerType._zod.values),Xe(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,o)=>t.innerType._zod.run(n,o)}),OF=ee("$ZodNullable",(e,t)=>{yt.init(e,t),Xe(e._zod,"optin",()=>t.innerType._zod.optin),Xe(e._zod,"optout",()=>t.innerType._zod.optout),Xe(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${hy(n.source)}|null)$`):void 0}),Xe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>n.value===null?n:t.innerType._zod.run(n,o)}),kF=ee("$ZodDefault",(e,t)=>{yt.init(e,t),e._zod.optin="optional",Xe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,o);return i instanceof Promise?i.then(l=>SS(l,t)):SS(i,t)}});function SS(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const MF=ee("$ZodPrefault",(e,t)=>{yt.init(e,t),e._zod.optin="optional",Xe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>(o.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,o))}),IF=ee("$ZodNonOptional",(e,t)=>{yt.init(e,t),Xe(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{const i=t.innerType._zod.run(n,o);return i instanceof Promise?i.then(l=>_S(l,e)):_S(i,e)}});function _S(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const DF=ee("$ZodCatch",(e,t)=>{yt.init(e,t),Xe(e._zod,"optin",()=>t.innerType._zod.optin),Xe(e._zod,"optout",()=>t.innerType._zod.optout),Xe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);const i=t.innerType._zod.run(n,o);return i instanceof Promise?i.then(l=>(n.value=l.value,l.issues.length&&(n.value=t.catchValue({...n,error:{issues:l.issues.map(u=>Wo(u,o,Jo()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(l=>Wo(l,o,Jo()))},input:n.value}),n.issues=[]),n)}}),jF=ee("$ZodPipe",(e,t)=>{yt.init(e,t),Xe(e._zod,"values",()=>t.in._zod.values),Xe(e._zod,"optin",()=>t.in._zod.optin),Xe(e._zod,"optout",()=>t.out._zod.optout),Xe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction==="backward"){const l=t.out._zod.run(n,o);return l instanceof Promise?l.then(u=>Vu(u,t.in,o)):Vu(l,t.in,o)}const i=t.in._zod.run(n,o);return i instanceof Promise?i.then(l=>Vu(l,t.out,o)):Vu(i,t.out,o)}});function Vu(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const zF=ee("$ZodReadonly",(e,t)=>{yt.init(e,t),Xe(e._zod,"propValues",()=>t.innerType._zod.propValues),Xe(e._zod,"values",()=>t.innerType._zod.values),Xe(e._zod,"optin",()=>t.innerType?._zod?.optin),Xe(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);const i=t.innerType._zod.run(n,o);return i instanceof Promise?i.then(ES):ES(i)}});function ES(e){return e.value=Object.freeze(e.value),e}const LF=ee("$ZodCustom",(e,t)=>{Rn.init(e,t),yt.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=n=>{const o=n.value,i=t.fn(o);if(i instanceof Promise)return i.then(l=>TS(l,n,o,e));TS(i,n,o,e)}});function TS(e,t,n,o){if(!e){const i={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(i.params=o._zod.def.params),t.issues.push(Kl(i))}}var CS;class PF{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const o=n[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const o={...this.get(n)??{}};delete o.id;const i={...o,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function $F(){return new PF}(CS=globalThis).__zod_globalRegistry??(CS.__zod_globalRegistry=$F());const Ml=globalThis.__zod_globalRegistry;function FF(e,t){return new e({type:"string",...xe(t)})}function UF(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...xe(t)})}function RS(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...xe(t)})}function BF(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...xe(t)})}function qF(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...xe(t)})}function VF(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...xe(t)})}function HF(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...xe(t)})}function ZF(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...xe(t)})}function QF(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...xe(t)})}function GF(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...xe(t)})}function YF(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...xe(t)})}function KF(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...xe(t)})}function XF(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...xe(t)})}function JF(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...xe(t)})}function WF(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...xe(t)})}function eU(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...xe(t)})}function tU(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...xe(t)})}function nU(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...xe(t)})}function rU(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...xe(t)})}function oU(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...xe(t)})}function sU(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...xe(t)})}function iU(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...xe(t)})}function aU(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...xe(t)})}function lU(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...xe(t)})}function cU(e,t){return new e({type:"string",format:"date",check:"string_format",...xe(t)})}function uU(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...xe(t)})}function dU(e,t){return new e({type:"string",format:"duration",check:"string_format",...xe(t)})}function fU(e,t){return new e({type:"number",checks:[],...xe(t)})}function hU(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...xe(t)})}function pU(e,t){return new e({type:"boolean",...xe(t)})}function mU(e){return new e({type:"unknown"})}function gU(e,t){return new e({type:"never",...xe(t)})}function AS(e,t){return new HT({check:"less_than",...xe(t),value:e,inclusive:!1})}function mm(e,t){return new HT({check:"less_than",...xe(t),value:e,inclusive:!0})}function NS(e,t){return new ZT({check:"greater_than",...xe(t),value:e,inclusive:!1})}function gm(e,t){return new ZT({check:"greater_than",...xe(t),value:e,inclusive:!0})}function OS(e,t){return new M6({check:"multiple_of",...xe(t),value:e})}function JT(e,t){return new D6({check:"max_length",...xe(t),maximum:e})}function Ad(e,t){return new j6({check:"min_length",...xe(t),minimum:e})}function WT(e,t){return new z6({check:"length_equals",...xe(t),length:e})}function yU(e,t){return new L6({check:"string_format",format:"regex",...xe(t),pattern:e})}function vU(e){return new P6({check:"string_format",format:"lowercase",...xe(e)})}function bU(e){return new $6({check:"string_format",format:"uppercase",...xe(e)})}function wU(e,t){return new F6({check:"string_format",format:"includes",...xe(t),includes:e})}function xU(e,t){return new U6({check:"string_format",format:"starts_with",...xe(t),prefix:e})}function SU(e,t){return new B6({check:"string_format",format:"ends_with",...xe(t),suffix:e})}function _a(e){return new q6({check:"overwrite",tx:e})}function _U(e){return _a(t=>t.normalize(e))}function EU(){return _a(e=>e.trim())}function TU(){return _a(e=>e.toLowerCase())}function CU(){return _a(e=>e.toUpperCase())}function RU(){return _a(e=>L5(e))}function AU(e,t,n){return new e({type:"array",element:t,...xe(n)})}function NU(e,t,n){return new e({type:"custom",check:"custom",fn:t,...xe(n)})}function OU(e){const t=kU(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Kl(o,n.value,t._zod.def));else{const i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(Kl(i))}},e(n.value,n)));return t}function kU(e,t){const n=new Rn({check:"custom",...xe(t)});return n._zod.check=e,n}function eC(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ml,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function kt(e,t,n={path:[],schemaPath:[]}){var o;const i=e._zod.def,l=t.seen.get(e);if(l)return l.count++,n.schemaPath.includes(e)&&(l.cycle=n.path),l.schema;const u={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,u);const f=e._zod.toJSONSchema?.();if(f)u.schema=f;else{const y={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,u.schema,y);else{const w=u.schema,_=t.processors[i.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);_(e,t,w,y)}const v=e._zod.parent;v&&(u.ref||(u.ref=v),kt(v,t,y),t.seen.get(v).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(u.schema,h),t.io==="input"&&an(e)&&(delete u.schema.examples,delete u.schema.default),t.io==="input"&&u.schema._prefault&&((o=u.schema).default??(o.default=u.schema._prefault)),delete u.schema._prefault,t.seen.get(e).schema}function tC(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=new Map;for(const u of e.seen.entries()){const f=e.metadataRegistry.get(u[0])?.id;if(f){const h=o.get(f);if(h&&h!==u[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(f,u[0])}}const i=u=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=e.external.registry.get(u[0])?.id,w=e.external.uri??(R=>R);if(v)return{ref:w(v)};const _=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=_,{defId:_,ref:`${w("__shared")}#/${f}/${_}`}}if(u[1]===n)return{ref:"#"};const p=`#/${f}/`,y=u[1].schema.id??`__schema${e.counter++}`;return{defId:y,ref:p+y}},l=u=>{if(u[1].schema.$ref)return;const f=u[1],{ref:h,defId:p}=i(u);f.def={...f.schema},p&&(f.defId=p);const y=f.schema;for(const v in y)delete y[v];y.$ref=h};if(e.cycles==="throw")for(const u of e.seen.entries()){const f=u[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
61
+
62
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const f=u[1];if(t===u[0]){l(u);continue}if(e.external){const p=e.external.registry.get(u[0])?.id;if(t!==u[0]&&p){l(u);continue}}if(e.metadataRegistry.get(u[0])?.id){l(u);continue}if(f.cycle){l(u);continue}if(f.count>1&&e.reused==="ref"){l(u);continue}}}function nC(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=u=>{const f=e.seen.get(u);if(f.ref===null)return;const h=f.def??f.schema,p={...h},y=f.ref;if(f.ref=null,y){o(y);const w=e.seen.get(y),_=w.schema;if(_.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(_)):Object.assign(h,_),Object.assign(h,p),u._zod.parent===y)for(const x in h)x==="$ref"||x==="allOf"||x in p||delete h[x];if(_.$ref&&w.def)for(const x in h)x==="$ref"||x==="allOf"||x in w.def&&JSON.stringify(h[x])===JSON.stringify(w.def[x])&&delete h[x]}const v=u._zod.parent;if(v&&v!==y){o(v);const w=e.seen.get(v);if(w?.schema.$ref&&(h.$ref=w.schema.$ref,w.def))for(const _ in h)_==="$ref"||_==="allOf"||_ in w.def&&JSON.stringify(h[_])===JSON.stringify(w.def[_])&&delete h[_]}e.override({zodSchema:u,jsonSchema:h,path:f.path??[]})};for(const u of[...e.seen.entries()].reverse())o(u[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const u=e.external.registry.get(t)?.id;if(!u)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(u)}Object.assign(i,n.def??n.schema);const l=e.external?.defs??{};for(const u of e.seen.entries()){const f=u[1];f.def&&f.defId&&(l[f.defId]=f.def)}e.external||Object.keys(l).length>0&&(e.target==="draft-2020-12"?i.$defs=l:i.definitions=l);try{const u=JSON.parse(JSON.stringify(i));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:Nd(t,"input",e.processors),output:Nd(t,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function an(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return an(o.element,n);if(o.type==="set")return an(o.valueType,n);if(o.type==="lazy")return an(o.getter(),n);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return an(o.innerType,n);if(o.type==="intersection")return an(o.left,n)||an(o.right,n);if(o.type==="record"||o.type==="map")return an(o.keyType,n)||an(o.valueType,n);if(o.type==="pipe")return an(o.in,n)||an(o.out,n);if(o.type==="object"){for(const i in o.shape)if(an(o.shape[i],n))return!0;return!1}if(o.type==="union"){for(const i of o.options)if(an(i,n))return!0;return!1}if(o.type==="tuple"){for(const i of o.items)if(an(i,n))return!0;return!!(o.rest&&an(o.rest,n))}return!1}const MU=(e,t={})=>n=>{const o=eC({...n,processors:t});return kt(e,o),tC(o,e),nC(o,e)},Nd=(e,t,n={})=>o=>{const{libraryOptions:i,target:l}=o??{},u=eC({...i??{},target:l,io:t,processors:n});return kt(e,u),tC(u,e),nC(u,e)},IU={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},DU=(e,t,n,o)=>{const i=n;i.type="string";const{minimum:l,maximum:u,format:f,patterns:h,contentEncoding:p}=e._zod.bag;if(typeof l=="number"&&(i.minLength=l),typeof u=="number"&&(i.maxLength=u),f&&(i.format=IU[f]??f,i.format===""&&delete i.format,f==="time"&&delete i.format),p&&(i.contentEncoding=p),h&&h.size>0){const y=[...h];y.length===1?i.pattern=y[0].source:y.length>1&&(i.allOf=[...y.map(v=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},jU=(e,t,n,o)=>{const i=n,{minimum:l,maximum:u,format:f,multipleOf:h,exclusiveMaximum:p,exclusiveMinimum:y}=e._zod.bag;typeof f=="string"&&f.includes("int")?i.type="integer":i.type="number",typeof y=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=y,i.exclusiveMinimum=!0):i.exclusiveMinimum=y),typeof l=="number"&&(i.minimum=l,typeof y=="number"&&t.target!=="draft-04"&&(y>=l?delete i.minimum:delete i.exclusiveMinimum)),typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=p,i.exclusiveMaximum=!0):i.exclusiveMaximum=p),typeof u=="number"&&(i.maximum=u,typeof p=="number"&&t.target!=="draft-04"&&(p<=u?delete i.maximum:delete i.exclusiveMaximum)),typeof h=="number"&&(i.multipleOf=h)},zU=(e,t,n,o)=>{n.type="boolean"},LU=(e,t,n,o)=>{n.not={}},PU=(e,t,n,o)=>{},$U=(e,t,n,o)=>{const i=e._zod.def,l=DT(i.entries);l.every(u=>typeof u=="number")&&(n.type="number"),l.every(u=>typeof u=="string")&&(n.type="string"),n.enum=l},FU=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},UU=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},BU=(e,t,n,o)=>{const i=n,l=e._zod.def,{minimum:u,maximum:f}=e._zod.bag;typeof u=="number"&&(i.minItems=u),typeof f=="number"&&(i.maxItems=f),i.type="array",i.items=kt(l.element,t,{...o,path:[...o.path,"items"]})},qU=(e,t,n,o)=>{const i=n,l=e._zod.def;i.type="object",i.properties={};const u=l.shape;for(const p in u)i.properties[p]=kt(u[p],t,{...o,path:[...o.path,"properties",p]});const f=new Set(Object.keys(u)),h=new Set([...f].filter(p=>{const y=l.shape[p]._zod;return t.io==="input"?y.optin===void 0:y.optout===void 0}));h.size>0&&(i.required=Array.from(h)),l.catchall?._zod.def.type==="never"?i.additionalProperties=!1:l.catchall?l.catchall&&(i.additionalProperties=kt(l.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},VU=(e,t,n,o)=>{const i=e._zod.def,l=i.inclusive===!1,u=i.options.map((f,h)=>kt(f,t,{...o,path:[...o.path,l?"oneOf":"anyOf",h]}));l?n.oneOf=u:n.anyOf=u},HU=(e,t,n,o)=>{const i=e._zod.def,l=kt(i.left,t,{...o,path:[...o.path,"allOf",0]}),u=kt(i.right,t,{...o,path:[...o.path,"allOf",1]}),f=p=>"allOf"in p&&Object.keys(p).length===1,h=[...f(l)?l.allOf:[l],...f(u)?u.allOf:[u]];n.allOf=h},ZU=(e,t,n,o)=>{const i=n,l=e._zod.def;i.type="object";const u=l.keyType,h=u._zod.bag?.patterns;if(l.mode==="loose"&&h&&h.size>0){const y=kt(l.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});i.patternProperties={};for(const v of h)i.patternProperties[v.source]=y}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=kt(l.keyType,t,{...o,path:[...o.path,"propertyNames"]})),i.additionalProperties=kt(l.valueType,t,{...o,path:[...o.path,"additionalProperties"]});const p=u._zod.values;if(p){const y=[...p].filter(v=>typeof v=="string"||typeof v=="number");y.length>0&&(i.required=y)}},QU=(e,t,n,o)=>{const i=e._zod.def,l=kt(i.innerType,t,o),u=t.seen.get(e);t.target==="openapi-3.0"?(u.ref=i.innerType,n.nullable=!0):n.anyOf=[l,{type:"null"}]},GU=(e,t,n,o)=>{const i=e._zod.def;kt(i.innerType,t,o);const l=t.seen.get(e);l.ref=i.innerType},YU=(e,t,n,o)=>{const i=e._zod.def;kt(i.innerType,t,o);const l=t.seen.get(e);l.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},KU=(e,t,n,o)=>{const i=e._zod.def;kt(i.innerType,t,o);const l=t.seen.get(e);l.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},XU=(e,t,n,o)=>{const i=e._zod.def;kt(i.innerType,t,o);const l=t.seen.get(e);l.ref=i.innerType;let u;try{u=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=u},JU=(e,t,n,o)=>{const i=e._zod.def,l=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;kt(l,t,o);const u=t.seen.get(e);u.ref=l},WU=(e,t,n,o)=>{const i=e._zod.def;kt(i.innerType,t,o);const l=t.seen.get(e);l.ref=i.innerType,n.readOnly=!0},rC=(e,t,n,o)=>{const i=e._zod.def;kt(i.innerType,t,o);const l=t.seen.get(e);l.ref=i.innerType},eB=ee("ZodISODateTime",(e,t)=>{rF.init(e,t),ft.init(e,t)});function tB(e){return lU(eB,e)}const nB=ee("ZodISODate",(e,t)=>{oF.init(e,t),ft.init(e,t)});function rB(e){return cU(nB,e)}const oB=ee("ZodISOTime",(e,t)=>{sF.init(e,t),ft.init(e,t)});function sB(e){return uU(oB,e)}const iB=ee("ZodISODuration",(e,t)=>{iF.init(e,t),ft.init(e,t)});function aB(e){return dU(iB,e)}const lB=(e,t)=>{PT.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>K5(e,n)},flatten:{value:n=>Y5(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,tg,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,tg,2)}},isEmpty:{get(){return e.issues.length===0}}})},ar=ee("ZodError",lB,{Parent:Error}),cB=my(ar),uB=gy(ar),dB=tf(ar),fB=nf(ar),hB=W5(ar),pB=e6(ar),mB=t6(ar),gB=n6(ar),yB=r6(ar),vB=o6(ar),bB=s6(ar),wB=i6(ar),vt=ee("ZodType",(e,t)=>(yt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Nd(e,"input"),output:Nd(e,"output")}}),e.toJSONSchema=MU(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(as(t,{checks:[...t.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),e.with=e.check,e.clone=(n,o)=>ls(e,n,o),e.brand=()=>e,e.register=((n,o)=>(n.add(e,o),e)),e.parse=(n,o)=>cB(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>dB(e,n,o),e.parseAsync=async(n,o)=>uB(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>fB(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>hB(e,n,o),e.decode=(n,o)=>pB(e,n,o),e.encodeAsync=async(n,o)=>mB(e,n,o),e.decodeAsync=async(n,o)=>gB(e,n,o),e.safeEncode=(n,o)=>yB(e,n,o),e.safeDecode=(n,o)=>vB(e,n,o),e.safeEncodeAsync=async(n,o)=>bB(e,n,o),e.safeDecodeAsync=async(n,o)=>wB(e,n,o),e.refine=(n,o)=>e.check(hq(n,o)),e.superRefine=n=>e.check(pq(n)),e.overwrite=n=>e.check(_a(n)),e.optional=()=>DS(e),e.exactOptional=()=>eq(e),e.nullable=()=>jS(e),e.nullish=()=>DS(jS(e)),e.nonoptional=n=>iq(e,n),e.array=()=>vy(e),e.or=n=>QB([e,n]),e.and=n=>YB(e,n),e.transform=n=>zS(e,JB(n)),e.default=n=>rq(e,n),e.prefault=n=>sq(e,n),e.catch=n=>lq(e,n),e.pipe=n=>zS(e,n),e.readonly=()=>dq(e),e.describe=n=>{const o=e.clone();return Ml.add(o,{description:n}),o},Object.defineProperty(e,"description",{get(){return Ml.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Ml.get(e);const o=e.clone();return Ml.add(o,n[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),oC=ee("_ZodString",(e,t)=>{yy.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(o,i,l)=>DU(e,o,i);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...o)=>e.check(yU(...o)),e.includes=(...o)=>e.check(wU(...o)),e.startsWith=(...o)=>e.check(xU(...o)),e.endsWith=(...o)=>e.check(SU(...o)),e.min=(...o)=>e.check(Ad(...o)),e.max=(...o)=>e.check(JT(...o)),e.length=(...o)=>e.check(WT(...o)),e.nonempty=(...o)=>e.check(Ad(1,...o)),e.lowercase=o=>e.check(vU(o)),e.uppercase=o=>e.check(bU(o)),e.trim=()=>e.check(EU()),e.normalize=(...o)=>e.check(_U(...o)),e.toLowerCase=()=>e.check(TU()),e.toUpperCase=()=>e.check(CU()),e.slugify=()=>e.check(RU())}),xB=ee("ZodString",(e,t)=>{yy.init(e,t),oC.init(e,t),e.email=n=>e.check(UF(SB,n)),e.url=n=>e.check(ZF(_B,n)),e.jwt=n=>e.check(aU(PB,n)),e.emoji=n=>e.check(QF(EB,n)),e.guid=n=>e.check(RS(kS,n)),e.uuid=n=>e.check(BF(Hu,n)),e.uuidv4=n=>e.check(qF(Hu,n)),e.uuidv6=n=>e.check(VF(Hu,n)),e.uuidv7=n=>e.check(HF(Hu,n)),e.nanoid=n=>e.check(GF(TB,n)),e.guid=n=>e.check(RS(kS,n)),e.cuid=n=>e.check(YF(CB,n)),e.cuid2=n=>e.check(KF(RB,n)),e.ulid=n=>e.check(XF(AB,n)),e.base64=n=>e.check(oU(jB,n)),e.base64url=n=>e.check(sU(zB,n)),e.xid=n=>e.check(JF(NB,n)),e.ksuid=n=>e.check(WF(OB,n)),e.ipv4=n=>e.check(eU(kB,n)),e.ipv6=n=>e.check(tU(MB,n)),e.cidrv4=n=>e.check(nU(IB,n)),e.cidrv6=n=>e.check(rU(DB,n)),e.e164=n=>e.check(iU(LB,n)),e.datetime=n=>e.check(tB(n)),e.date=n=>e.check(rB(n)),e.time=n=>e.check(sB(n)),e.duration=n=>e.check(aB(n))});function Ot(e){return FF(xB,e)}const ft=ee("ZodStringFormat",(e,t)=>{dt.init(e,t),oC.init(e,t)}),SB=ee("ZodEmail",(e,t)=>{G6.init(e,t),ft.init(e,t)}),kS=ee("ZodGUID",(e,t)=>{Z6.init(e,t),ft.init(e,t)}),Hu=ee("ZodUUID",(e,t)=>{Q6.init(e,t),ft.init(e,t)}),_B=ee("ZodURL",(e,t)=>{Y6.init(e,t),ft.init(e,t)}),EB=ee("ZodEmoji",(e,t)=>{K6.init(e,t),ft.init(e,t)}),TB=ee("ZodNanoID",(e,t)=>{X6.init(e,t),ft.init(e,t)}),CB=ee("ZodCUID",(e,t)=>{J6.init(e,t),ft.init(e,t)}),RB=ee("ZodCUID2",(e,t)=>{W6.init(e,t),ft.init(e,t)}),AB=ee("ZodULID",(e,t)=>{eF.init(e,t),ft.init(e,t)}),NB=ee("ZodXID",(e,t)=>{tF.init(e,t),ft.init(e,t)}),OB=ee("ZodKSUID",(e,t)=>{nF.init(e,t),ft.init(e,t)}),kB=ee("ZodIPv4",(e,t)=>{aF.init(e,t),ft.init(e,t)}),MB=ee("ZodIPv6",(e,t)=>{lF.init(e,t),ft.init(e,t)}),IB=ee("ZodCIDRv4",(e,t)=>{cF.init(e,t),ft.init(e,t)}),DB=ee("ZodCIDRv6",(e,t)=>{uF.init(e,t),ft.init(e,t)}),jB=ee("ZodBase64",(e,t)=>{dF.init(e,t),ft.init(e,t)}),zB=ee("ZodBase64URL",(e,t)=>{hF.init(e,t),ft.init(e,t)}),LB=ee("ZodE164",(e,t)=>{pF.init(e,t),ft.init(e,t)}),PB=ee("ZodJWT",(e,t)=>{gF.init(e,t),ft.init(e,t)}),sC=ee("ZodNumber",(e,t)=>{GT.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(o,i,l)=>jU(e,o,i),e.gt=(o,i)=>e.check(NS(o,i)),e.gte=(o,i)=>e.check(gm(o,i)),e.min=(o,i)=>e.check(gm(o,i)),e.lt=(o,i)=>e.check(AS(o,i)),e.lte=(o,i)=>e.check(mm(o,i)),e.max=(o,i)=>e.check(mm(o,i)),e.int=o=>e.check(MS(o)),e.safe=o=>e.check(MS(o)),e.positive=o=>e.check(NS(0,o)),e.nonnegative=o=>e.check(gm(0,o)),e.negative=o=>e.check(AS(0,o)),e.nonpositive=o=>e.check(mm(0,o)),e.multipleOf=(o,i)=>e.check(OS(o,i)),e.step=(o,i)=>e.check(OS(o,i)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function iC(e){return fU(sC,e)}const $B=ee("ZodNumberFormat",(e,t)=>{yF.init(e,t),sC.init(e,t)});function MS(e){return hU($B,e)}const FB=ee("ZodBoolean",(e,t)=>{vF.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,o,i)=>zU(e,n,o)});function gt(e){return pU(FB,e)}const UB=ee("ZodUnknown",(e,t)=>{bF.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,o,i)=>PU()});function IS(){return mU(UB)}const BB=ee("ZodNever",(e,t)=>{wF.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,o,i)=>LU(e,n,o)});function qB(e){return gU(BB,e)}const VB=ee("ZodArray",(e,t)=>{xF.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,o,i)=>BU(e,n,o,i),e.element=t.element,e.min=(n,o)=>e.check(Ad(n,o)),e.nonempty=n=>e.check(Ad(1,n)),e.max=(n,o)=>e.check(JT(n,o)),e.length=(n,o)=>e.check(WT(n,o)),e.unwrap=()=>e.element});function vy(e,t){return AU(VB,e,t)}const HB=ee("ZodObject",(e,t)=>{_F.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,o,i)=>qU(e,n,o,i),Xe(e,"shape",()=>t.shape),e.keyof=()=>ac(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:IS()}),e.loose=()=>e.clone({...e._zod.def,catchall:IS()}),e.strict=()=>e.clone({...e._zod.def,catchall:qB()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>V5(e,n),e.safeExtend=n=>H5(e,n),e.merge=n=>Z5(e,n),e.pick=n=>B5(e,n),e.omit=n=>q5(e,n),e.partial=(...n)=>Q5(lC,e,n[0]),e.required=(...n)=>G5(cC,e,n[0])});function lr(e,t){const n={type:"object",shape:e??{},...xe(t)};return new HB(n)}const ZB=ee("ZodUnion",(e,t)=>{EF.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,o,i)=>VU(e,n,o,i),e.options=t.options});function QB(e,t){return new ZB({type:"union",options:e,...xe(t)})}const GB=ee("ZodIntersection",(e,t)=>{TF.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,o,i)=>HU(e,n,o,i)});function YB(e,t){return new GB({type:"intersection",left:e,right:t})}const KB=ee("ZodRecord",(e,t)=>{CF.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,o,i)=>ZU(e,n,o,i),e.keyType=t.keyType,e.valueType=t.valueType});function aC(e,t,n){return new KB({type:"record",keyType:e,valueType:t,...xe(n)})}const rg=ee("ZodEnum",(e,t)=>{RF.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(o,i,l)=>$U(e,o,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(o,i)=>{const l={};for(const u of o)if(n.has(u))l[u]=t.entries[u];else throw new Error(`Key ${u} not found in enum`);return new rg({...t,checks:[],...xe(i),entries:l})},e.exclude=(o,i)=>{const l={...t.entries};for(const u of o)if(n.has(u))delete l[u];else throw new Error(`Key ${u} not found in enum`);return new rg({...t,checks:[],...xe(i),entries:l})}});function ac(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new rg({type:"enum",entries:n,...xe(t)})}const XB=ee("ZodTransform",(e,t)=>{AF.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,o,i)=>UU(e,n),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new MT(e.constructor.name);n.addIssue=l=>{if(typeof l=="string")n.issues.push(Kl(l,n.value,t));else{const u=l;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=n.value),u.inst??(u.inst=e),n.issues.push(Kl(u))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(l=>(n.value=l,n)):(n.value=i,n)}});function JB(e){return new XB({type:"transform",transform:e})}const lC=ee("ZodOptional",(e,t)=>{XT.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,o,i)=>rC(e,n,o,i),e.unwrap=()=>e._zod.def.innerType});function DS(e){return new lC({type:"optional",innerType:e})}const WB=ee("ZodExactOptional",(e,t)=>{NF.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,o,i)=>rC(e,n,o,i),e.unwrap=()=>e._zod.def.innerType});function eq(e){return new WB({type:"optional",innerType:e})}const tq=ee("ZodNullable",(e,t)=>{OF.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,o,i)=>QU(e,n,o,i),e.unwrap=()=>e._zod.def.innerType});function jS(e){return new tq({type:"nullable",innerType:e})}const nq=ee("ZodDefault",(e,t)=>{kF.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,o,i)=>YU(e,n,o,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function rq(e,t){return new nq({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():zT(t)}})}const oq=ee("ZodPrefault",(e,t)=>{MF.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,o,i)=>KU(e,n,o,i),e.unwrap=()=>e._zod.def.innerType});function sq(e,t){return new oq({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():zT(t)}})}const cC=ee("ZodNonOptional",(e,t)=>{IF.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,o,i)=>GU(e,n,o,i),e.unwrap=()=>e._zod.def.innerType});function iq(e,t){return new cC({type:"nonoptional",innerType:e,...xe(t)})}const aq=ee("ZodCatch",(e,t)=>{DF.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,o,i)=>XU(e,n,o,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function lq(e,t){return new aq({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const cq=ee("ZodPipe",(e,t)=>{jF.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,o,i)=>JU(e,n,o,i),e.in=t.in,e.out=t.out});function zS(e,t){return new cq({type:"pipe",in:e,out:t})}const uq=ee("ZodReadonly",(e,t)=>{zF.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,o,i)=>WU(e,n,o,i),e.unwrap=()=>e._zod.def.innerType});function dq(e){return new uq({type:"readonly",innerType:e})}const fq=ee("ZodCustom",(e,t)=>{LF.init(e,t),vt.init(e,t),e._zod.processJSONSchema=(n,o,i)=>FU(e,n)});function hq(e,t={}){return NU(fq,e,t)}function pq(e){return OU(e)}const mq=lr({id:Ot(),path:Ot(),label:Ot(),icon:Ot(),visible:gt().default(!0),section:ac(["main","config"]).default("main"),badge:Ot().optional(),exact:gt().optional()}),LS=lr({appName:Ot().default("Convex CMS"),logo:Ot().optional(),favicon:Ot().optional()}),PS=lr({sidebarWidth:iC().min(200).max(400).default(256),sidebarCollapsible:gt().default(!1)}),$S=lr({showDashboard:gt().default(!0),showContent:gt().default(!0),showMedia:gt().default(!0),showTaxonomies:gt().default(!0),showContentTypes:gt().default(!0),showTrash:gt().default(!0),showSettings:gt().default(!0),customItems:vy(mq).default([])}),FS=lr({mode:ac(["light","dark","system"]).default("system"),allowModeSwitch:gt().default(!0),tokens:aC(Ot(),Ot()).optional()});lr({branding:LS.default(()=>LS.parse({})),layout:PS.default(()=>PS.parse({})),navigation:$S.default(()=>$S.parse({})),theme:FS.default(()=>FS.parse({}))});const uC=S.createContext(null);function gq({children:e,getUser:t,getUserRole:n,onLogout:o,autoRedirectToLogin:i=!1,loginUrl:l="/login"}){const[u,f]=S.useState(null),[h,p]=S.useState(null),[y,v]=S.useState("loading"),[w,_]=S.useState(null),R=S.useCallback(async()=>{v("loading"),_(null);try{const O=await t();if(!O){f(null),p(null),v("unauthenticated"),i&&typeof window<"u"&&(window.location.href=l);return}const M=await n({userId:O.id});f(O),p(M),v("authenticated")}catch(O){console.error("Authentication error:",O),f(null),p(null),_(O instanceof Error?O.message:"Authentication failed"),v("error")}},[t,n,i,l]);S.useEffect(()=>{R()},[R]);const x=S.useCallback(O=>h?Wm(h,O):!1,[h]),C=S.useCallback(async()=>{try{o&&await o(),f(null),p(null),v("unauthenticated"),i&&typeof window<"u"&&(window.location.href=l)}catch(O){console.error("Logout error:",O),_(O instanceof Error?O.message:"Logout failed")}},[o,i,l]),N=S.useCallback(async()=>{await R()},[R]),k={user:u,role:h,authState:y,isLoading:y==="loading",isAuthenticated:y==="authenticated",error:w,checkPermission:x,logout:C,refresh:N};return b.jsx(uC.Provider,{value:k,children:e})}function dC(){const e=S.useContext(uC);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}const fC=S.createContext(null),hC="convex-cms-theme";function US(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function BS(){if(typeof window>"u")return"system";const e=localStorage.getItem(hC);return e==="light"||e==="dark"||e==="system"?e:"system"}function yq({children:e}){const[t,n]=S.useState(()=>BS()),[o,i]=S.useState(()=>{const f=BS();return f==="system"?US():f}),l=S.useCallback(f=>{const h=f==="system"?US():f;i(h);const p=document.documentElement;p.classList.remove("light","dark"),p.classList.add(h)},[]),u=S.useCallback(f=>{n(f),localStorage.setItem(hC,f),l(f)},[l]);return S.useEffect(()=>{l(t)},[t,l]),S.useEffect(()=>{const f=window.matchMedia("(prefers-color-scheme: dark)"),h=()=>{t==="system"&&l("system")};return f.addEventListener("change",h),()=>f.removeEventListener("change",h)},[t,l]),b.jsx(fC.Provider,{value:{theme:t,resolvedTheme:o,setTheme:u},children:e})}function zG(){const e=S.useContext(fC);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e}const vq=lr({id:Ot(),path:Ot(),label:Ot(),icon:Ot(),visible:gt().default(!0),section:ac(["main","config"]).default("main"),badge:Ot().optional(),exact:gt().optional()}),qS=lr({appName:Ot().default("Convex CMS"),logo:Ot().optional(),favicon:Ot().optional()}),VS=lr({sidebarWidth:iC().min(200).max(400).default(256),sidebarCollapsible:gt().default(!1)}),HS=lr({showDashboard:gt().default(!0),showContent:gt().default(!0),showMedia:gt().default(!0),showTaxonomies:gt().default(!0),showContentTypes:gt().default(!0),showTrash:gt().default(!0),showSettings:gt().default(!0),customItems:vy(vq).default([])}),ZS=lr({mode:ac(["light","dark","system"]).default("system"),allowModeSwitch:gt().default(!0),tokens:aC(Ot(),Ot()).optional()}),bq=lr({branding:qS.default(()=>qS.parse({})),layout:VS.default(()=>VS.parse({})),navigation:HS.default(()=>HS.parse({})),theme:ZS.default(()=>ZS.parse({}))}),wq=[{id:"dashboard",path:"/",label:"Dashboard",icon:"LayoutDashboard",section:"main",exact:!0},{id:"content",path:"/content",label:"Content",icon:"FileText",section:"main"},{id:"media",path:"/media",label:"Media",icon:"Image",section:"main"},{id:"taxonomies",path:"/taxonomies",label:"Taxonomies",icon:"Tags",section:"main"},{id:"content-types",path:"/content-types",label:"Content Types",icon:"Layers",section:"config"},{id:"trash",path:"/trash",label:"Trash",icon:"Trash2",section:"config"},{id:"settings",path:"/settings",label:"Settings",icon:"Settings",section:"config"}];function xq(e){return bq.parse(e??{})}function Sq(e){const t={dashboard:e.navigation.showDashboard,content:e.navigation.showContent,media:e.navigation.showMedia,taxonomies:e.navigation.showTaxonomies,"content-types":e.navigation.showContentTypes,trash:e.navigation.showTrash,settings:e.navigation.showSettings},o=[...wq.filter(i=>t[i.id]!==!1),...e.navigation.customItems.filter(i=>i.visible!==!1)];return{main:o.filter(i=>i.section==="main"),config:o.filter(i=>i.section==="config")}}const pC=S.createContext(null);function _q({config:e,children:t}){const n=Sq(e),o={...e,navItems:n};return b.jsx(pC.Provider,{value:o,children:t})}function by(){const e=S.useContext(pC);if(!e)throw new Error("useAdminConfig must be used within AdminConfigProvider");return e}const mC=S.createContext(null);function Eq({baseConfig:e,children:t,api:n}){const o=n?n.getSettings:"skip",i=f1(o),l=S.useMemo(()=>i?{...e,navigation:{...e.navigation,showMedia:e.navigation.showMedia&&i.features.mediaManagement}}:e,[e,i]),u=S.useMemo(()=>({baseConfig:e,settings:i}),[e,i]);return b.jsx(mC.Provider,{value:u,children:b.jsx(_q,{config:l,children:t})})}function LG(){const e=S.useContext(mC);if(!e)throw new Error("useSettingsConfig must be used within SettingsConfigProvider");return e}const gC=S.createContext(null);function Tq({children:e}){const[t,n]=S.useState(new Map),o=S.useCallback((u,f)=>{n(h=>{const p=new Map(h);return p.set(u,f),p})},[]),i=S.useCallback(u=>{n(f=>{const h=new Map(f);return h.delete(u),h})},[]),l=S.useMemo(()=>({overrides:t,setOverride:o,clearOverride:i}),[t,o,i]);return b.jsx(gC.Provider,{value:l,children:e})}function Cq(){const e=S.useContext(gC);if(!e)throw new Error("useBreadcrumbContext must be used within a BreadcrumbProvider");return e}const Rq={LayoutDashboard:EP,FileText:iP,Image:w1,Layers:x1,Tags:s3,FileCode:oP,Settings:YP,Trash2:u3,HelpCircle:y1,Home:b1,User:E1,Bell:Bm,Lock:DP,Globe:gP,Calendar:qm,Clock:ZL,Link:AP,Hash:v1,ToggleLeft:_1,ChevronDown:Js,CheckSquare:XP,Braces:p1,Folder:pP,MapPin:FP,DollarSign:JL,Mail:PP,Phone:ZP,Package:VP,Star:t3,Heart:bP,Flag:uP,Bookmark:DL,Archive:NL,Edit:WP,Eye:nP,AlertCircle:qL};function QS({name:e,className:t="size-5"}){const n=Rq[e];return n?b.jsx(n,{className:t}):null}const yC=S.createContext(null);function Aq({api:e,children:t}){return b.jsx(yC.Provider,{value:e,children:t})}function vC(){const e=S.useContext(yC);if(!e)throw new Error("useApi must be used within ApiProvider");return e}function me(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function Nq(e,t){const n=S.createContext(t),o=l=>{const{children:u,...f}=l,h=S.useMemo(()=>f,Object.values(f));return b.jsx(n.Provider,{value:h,children:u})};o.displayName=e+"Provider";function i(l){const u=S.useContext(n);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[o,i]}function $r(e,t=[]){let n=[];function o(l,u){const f=S.createContext(u),h=n.length;n=[...n,u];const p=v=>{const{scope:w,children:_,...R}=v,x=w?.[e]?.[h]||f,C=S.useMemo(()=>R,Object.values(R));return b.jsx(x.Provider,{value:C,children:_})};p.displayName=l+"Provider";function y(v,w){const _=w?.[e]?.[h]||f,R=S.useContext(_);if(R)return R;if(u!==void 0)return u;throw new Error(`\`${v}\` must be used within \`${l}\``)}return[p,y]}const i=()=>{const l=n.map(u=>S.createContext(u));return function(f){const h=f?.[e]||l;return S.useMemo(()=>({[`__scope${e}`]:{...f,[e]:h}}),[f,h])}};return i.scopeName=e,[o,Oq(i,...t)]}function Oq(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(l){const u=o.reduce((f,{useScope:h,scopeName:p})=>{const v=h(l)[`__scope${p}`];return{...f,...v}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}var Mt=globalThis?.document?S.useLayoutEffect:()=>{},kq=$d[" useInsertionEffect ".trim().toString()]||Mt;function es({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[i,l,u]=Mq({defaultProp:t,onChange:n}),f=e!==void 0,h=f?e:i;{const y=S.useRef(e!==void 0);S.useEffect(()=>{const v=y.current;v!==f&&console.warn(`${o} is changing from ${v?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=f},[f,o])}const p=S.useCallback(y=>{if(f){const v=Iq(y)?y(e):y;v!==e&&u.current?.(v)}else l(y)},[f,e,l,u]);return[h,p]}function Mq({defaultProp:e,onChange:t}){const[n,o]=S.useState(e),i=S.useRef(n),l=S.useRef(t);return kq(()=>{l.current=t},[t]),S.useEffect(()=>{i.current!==n&&(l.current?.(n),i.current=n)},[n,i]),[n,o,l]}function Iq(e){return typeof e=="function"}function GS(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function lc(...e){return t=>{let n=!1;const o=e.map(i=>{const l=GS(i,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let i=0;i<o.length;i++){const l=o[i];typeof l=="function"?l():GS(e[i],null)}}}}function Ze(...e){return S.useCallback(lc(...e),e)}function Hs(e){const t=Dq(e),n=S.forwardRef((o,i)=>{const{children:l,...u}=o,f=S.Children.toArray(l),h=f.find(zq);if(h){const p=h.props.children,y=f.map(v=>v===h?S.Children.count(p)>1?S.Children.only(null):S.isValidElement(p)?p.props.children:null:v);return b.jsx(t,{...u,ref:i,children:S.isValidElement(p)?S.cloneElement(p,void 0,y):null})}return b.jsx(t,{...u,ref:i,children:l})});return n.displayName=`${e}.Slot`,n}function Dq(e){const t=S.forwardRef((n,o)=>{const{children:i,...l}=n;if(S.isValidElement(i)){const u=Pq(i),f=Lq(l,i.props);return i.type!==S.Fragment&&(f.ref=o?lc(o,u):u),S.cloneElement(i,f)}return S.Children.count(i)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var jq=Symbol("radix.slottable");function zq(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jq}function Lq(e,t){const n={...t};for(const o in t){const i=e[o],l=t[o];/^on[A-Z]/.test(o)?i&&l?n[o]=(...f)=>{const h=l(...f);return i(...f),h}:i&&(n[o]=i):o==="style"?n[o]={...i,...l}:o==="className"&&(n[o]=[i,l].filter(Boolean).join(" "))}return{...e,...n}}function Pq(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $q=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ne=$q.reduce((e,t)=>{const n=Hs(`Primitive.${t}`),o=S.forwardRef((i,l)=>{const{asChild:u,...f}=i,h=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(h,{...f,ref:l})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function bC(e,t){e&&ga.flushSync(()=>e.dispatchEvent(t))}function Fq(e,t){return S.useReducer((n,o)=>t[n][o]??n,e)}var cr=e=>{const{present:t,children:n}=e,o=Uq(t),i=typeof n=="function"?n({present:o.isPresent}):S.Children.only(n),l=Ze(o.ref,Bq(i));return typeof n=="function"||o.isPresent?S.cloneElement(i,{ref:l}):null};cr.displayName="Presence";function Uq(e){const[t,n]=S.useState(),o=S.useRef(null),i=S.useRef(e),l=S.useRef("none"),u=e?"mounted":"unmounted",[f,h]=Fq(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const p=Zu(o.current);l.current=f==="mounted"?p:"none"},[f]),Mt(()=>{const p=o.current,y=i.current;if(y!==e){const w=l.current,_=Zu(p);e?h("MOUNT"):_==="none"||p?.display==="none"?h("UNMOUNT"):h(y&&w!==_?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,h]),Mt(()=>{if(t){let p;const y=t.ownerDocument.defaultView??window,v=_=>{const x=Zu(o.current).includes(CSS.escape(_.animationName));if(_.target===t&&x&&(h("ANIMATION_END"),!i.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",p=y.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},w=_=>{_.target===t&&(l.current=Zu(o.current))};return t.addEventListener("animationstart",w),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{y.clearTimeout(p),t.removeEventListener("animationstart",w),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:S.useCallback(p=>{o.current=p?getComputedStyle(p):null,n(p)},[])}}function Zu(e){return e?.animationName||"none"}function Bq(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var qq=$d[" useId ".trim().toString()]||(()=>{}),Vq=0;function mr(e){const[t,n]=S.useState(qq());return Mt(()=>{n(o=>o??String(Vq++))},[e]),e||(t?`radix-${t}`:"")}var of="Collapsible",[Hq]=$r(of),[Zq,wy]=Hq(of),wC=S.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:o,defaultOpen:i,disabled:l,onOpenChange:u,...f}=e,[h,p]=es({prop:o,defaultProp:i??!1,onChange:u,caller:of});return b.jsx(Zq,{scope:n,disabled:l,contentId:mr(),open:h,onOpenToggle:S.useCallback(()=>p(y=>!y),[p]),children:b.jsx(Ne.div,{"data-state":Sy(h),"data-disabled":l?"":void 0,...f,ref:t})})});wC.displayName=of;var xC="CollapsibleTrigger",SC=S.forwardRef((e,t)=>{const{__scopeCollapsible:n,...o}=e,i=wy(xC,n);return b.jsx(Ne.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Sy(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...o,ref:t,onClick:me(e.onClick,i.onOpenToggle)})});SC.displayName=xC;var xy="CollapsibleContent",_C=S.forwardRef((e,t)=>{const{forceMount:n,...o}=e,i=wy(xy,e.__scopeCollapsible);return b.jsx(cr,{present:n||i.open,children:({present:l})=>b.jsx(Qq,{...o,ref:t,present:l})})});_C.displayName=xy;var Qq=S.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:o,children:i,...l}=e,u=wy(xy,n),[f,h]=S.useState(o),p=S.useRef(null),y=Ze(t,p),v=S.useRef(0),w=v.current,_=S.useRef(0),R=_.current,x=u.open||f,C=S.useRef(x),N=S.useRef(void 0);return S.useEffect(()=>{const k=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(k)},[]),Mt(()=>{const k=p.current;if(k){N.current=N.current||{transitionDuration:k.style.transitionDuration,animationName:k.style.animationName},k.style.transitionDuration="0s",k.style.animationName="none";const O=k.getBoundingClientRect();v.current=O.height,_.current=O.width,C.current||(k.style.transitionDuration=N.current.transitionDuration,k.style.animationName=N.current.animationName),h(o)}},[u.open,o]),b.jsx(Ne.div,{"data-state":Sy(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!x,...l,ref:y,style:{"--radix-collapsible-content-height":w?`${w}px`:void 0,"--radix-collapsible-content-width":R?`${R}px`:void 0,...e.style},children:x&&i})});function Sy(e){return e?"open":"closed"}var Gq=wC;const Yq=Gq,Kq=SC,Xq=_C;function vr(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>t.current?.(...n),[])}function Jq(e,t=globalThis?.document){const n=vr(e);S.useEffect(()=>{const o=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var Wq="DismissableLayer",og="dismissableLayer.update",e8="dismissableLayer.pointerDownOutside",t8="dismissableLayer.focusOutside",YS,EC=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cc=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:l,onInteractOutside:u,onDismiss:f,...h}=e,p=S.useContext(EC),[y,v]=S.useState(null),w=y?.ownerDocument??globalThis?.document,[,_]=S.useState({}),R=Ze(t,L=>v(L)),x=Array.from(p.layers),[C]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),N=x.indexOf(C),k=y?x.indexOf(y):-1,O=p.layersWithOutsidePointerEventsDisabled.size>0,M=k>=N,$=o8(L=>{const D=L.target,Y=[...p.branches].some(ie=>ie.contains(D));!M||Y||(i?.(L),u?.(L),L.defaultPrevented||f?.())},w),V=s8(L=>{const D=L.target;[...p.branches].some(ie=>ie.contains(D))||(l?.(L),u?.(L),L.defaultPrevented||f?.())},w);return Jq(L=>{k===p.layers.size-1&&(o?.(L),!L.defaultPrevented&&f&&(L.preventDefault(),f()))},w),S.useEffect(()=>{if(y)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(YS=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(y)),p.layers.add(y),KS(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(w.body.style.pointerEvents=YS)}},[y,w,n,p]),S.useEffect(()=>()=>{y&&(p.layers.delete(y),p.layersWithOutsidePointerEventsDisabled.delete(y),KS())},[y,p]),S.useEffect(()=>{const L=()=>_({});return document.addEventListener(og,L),()=>document.removeEventListener(og,L)},[]),b.jsx(Ne.div,{...h,ref:R,style:{pointerEvents:O?M?"auto":"none":void 0,...e.style},onFocusCapture:me(e.onFocusCapture,V.onFocusCapture),onBlurCapture:me(e.onBlurCapture,V.onBlurCapture),onPointerDownCapture:me(e.onPointerDownCapture,$.onPointerDownCapture)})});cc.displayName=Wq;var n8="DismissableLayerBranch",r8=S.forwardRef((e,t)=>{const n=S.useContext(EC),o=S.useRef(null),i=Ze(t,o);return S.useEffect(()=>{const l=o.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),b.jsx(Ne.div,{...e,ref:i})});r8.displayName=n8;function o8(e,t=globalThis?.document){const n=vr(e),o=S.useRef(!1),i=S.useRef(()=>{});return S.useEffect(()=>{const l=f=>{if(f.target&&!o.current){let h=function(){TC(e8,n,p,{discrete:!0})};const p={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=h,t.addEventListener("click",i.current,{once:!0})):h()}else t.removeEventListener("click",i.current);o.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",l),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function s8(e,t=globalThis?.document){const n=vr(e),o=S.useRef(!1);return S.useEffect(()=>{const i=l=>{l.target&&!o.current&&TC(t8,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function KS(){const e=new CustomEvent(og);document.dispatchEvent(e)}function TC(e,t,n,{discrete:o}){const i=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),o?bC(i,l):i.dispatchEvent(l)}var ym="focusScope.autoFocusOnMount",vm="focusScope.autoFocusOnUnmount",XS={bubbles:!1,cancelable:!0},i8="FocusScope",uc=S.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:l,...u}=e,[f,h]=S.useState(null),p=vr(i),y=vr(l),v=S.useRef(null),w=Ze(t,x=>h(x)),_=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(o){let x=function(O){if(_.paused||!f)return;const M=O.target;f.contains(M)?v.current=M:Bo(v.current,{select:!0})},C=function(O){if(_.paused||!f)return;const M=O.relatedTarget;M!==null&&(f.contains(M)||Bo(v.current,{select:!0}))},N=function(O){if(document.activeElement===document.body)for(const $ of O)$.removedNodes.length>0&&Bo(f)};document.addEventListener("focusin",x),document.addEventListener("focusout",C);const k=new MutationObserver(N);return f&&k.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",C),k.disconnect()}}},[o,f,_.paused]),S.useEffect(()=>{if(f){WS.add(_);const x=document.activeElement;if(!f.contains(x)){const N=new CustomEvent(ym,XS);f.addEventListener(ym,p),f.dispatchEvent(N),N.defaultPrevented||(a8(f8(CC(f)),{select:!0}),document.activeElement===x&&Bo(f))}return()=>{f.removeEventListener(ym,p),setTimeout(()=>{const N=new CustomEvent(vm,XS);f.addEventListener(vm,y),f.dispatchEvent(N),N.defaultPrevented||Bo(x??document.body,{select:!0}),f.removeEventListener(vm,y),WS.remove(_)},0)}}},[f,p,y,_]);const R=S.useCallback(x=>{if(!n&&!o||_.paused)return;const C=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,N=document.activeElement;if(C&&N){const k=x.currentTarget,[O,M]=l8(k);O&&M?!x.shiftKey&&N===M?(x.preventDefault(),n&&Bo(O,{select:!0})):x.shiftKey&&N===O&&(x.preventDefault(),n&&Bo(M,{select:!0})):N===k&&x.preventDefault()}},[n,o,_.paused]);return b.jsx(Ne.div,{tabIndex:-1,...u,ref:w,onKeyDown:R})});uc.displayName=i8;function a8(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Bo(o,{select:t}),document.activeElement!==n)return}function l8(e){const t=CC(e),n=JS(t,e),o=JS(t.reverse(),e);return[n,o]}function CC(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const i=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||i?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function JS(e,t){for(const n of e)if(!c8(n,{upTo:t}))return n}function c8(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function u8(e){return e instanceof HTMLInputElement&&"select"in e}function Bo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&u8(e)&&t&&e.select()}}var WS=d8();function d8(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=e_(e,t),e.unshift(t)},remove(t){e=e_(e,t),e[0]?.resume()}}}function e_(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function f8(e){return e.filter(t=>t.tagName!=="A")}var h8="Portal",dc=S.forwardRef((e,t)=>{const{container:n,...o}=e,[i,l]=S.useState(!1);Mt(()=>l(!0),[]);const u=n||i&&globalThis?.document?.body;return u?YD.createPortal(b.jsx(Ne.div,{...o,ref:t}),u):null});dc.displayName=h8;var bm=0;function sf(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??t_()),document.body.insertAdjacentElement("beforeend",e[1]??t_()),bm++,()=>{bm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),bm--}},[])}function t_(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Or=function(){return Or=Object.assign||function(t){for(var n,o=1,i=arguments.length;o<i;o++){n=arguments[o];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},Or.apply(this,arguments)};function RC(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]]);return n}function p8(e,t,n){if(n||arguments.length===2)for(var o=0,i=t.length,l;o<i;o++)(l||!(o in t))&&(l||(l=Array.prototype.slice.call(t,0,o)),l[o]=t[o]);return e.concat(l||Array.prototype.slice.call(t))}var rd="right-scroll-bar-position",od="width-before-scroll-bar",m8="with-scroll-bars-hidden",g8="--removed-body-scroll-bar-size";function wm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function y8(e,t){var n=S.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var i=n.value;i!==o&&(n.value=o,n.callback(o,i))}}}})[0];return n.callback=t,n.facade}var v8=typeof window<"u"?S.useLayoutEffect:S.useEffect,n_=new WeakMap;function b8(e,t){var n=y8(null,function(o){return e.forEach(function(i){return wm(i,o)})});return v8(function(){var o=n_.get(n);if(o){var i=new Set(o),l=new Set(e),u=n.current;i.forEach(function(f){l.has(f)||wm(f,null)}),l.forEach(function(f){i.has(f)||wm(f,u)})}n_.set(n,e)},[e]),n}function w8(e){return e}function x8(e,t){t===void 0&&(t=w8);var n=[],o=!1,i={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var u=t(l,o);return n.push(u),function(){n=n.filter(function(f){return f!==u})}},assignSyncMedium:function(l){for(o=!0;n.length;){var u=n;n=[],u.forEach(l)}n={push:function(f){return l(f)},filter:function(){return n}}},assignMedium:function(l){o=!0;var u=[];if(n.length){var f=n;n=[],f.forEach(l),u=n}var h=function(){var y=u;u=[],y.forEach(l)},p=function(){return Promise.resolve().then(h)};p(),n={push:function(y){u.push(y),p()},filter:function(y){return u=u.filter(y),n}}}};return i}function S8(e){e===void 0&&(e={});var t=x8(null);return t.options=Or({async:!0,ssr:!1},e),t}var AC=function(e){var t=e.sideCar,n=RC(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return S.createElement(o,Or({},n))};AC.isSideCarExport=!0;function _8(e,t){return e.useMedium(t),AC}var NC=S8(),xm=function(){},af=S.forwardRef(function(e,t){var n=S.useRef(null),o=S.useState({onScrollCapture:xm,onWheelCapture:xm,onTouchMoveCapture:xm}),i=o[0],l=o[1],u=e.forwardProps,f=e.children,h=e.className,p=e.removeScrollBar,y=e.enabled,v=e.shards,w=e.sideCar,_=e.noRelative,R=e.noIsolation,x=e.inert,C=e.allowPinchZoom,N=e.as,k=N===void 0?"div":N,O=e.gapMode,M=RC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),$=w,V=b8([n,t]),L=Or(Or({},M),i);return S.createElement(S.Fragment,null,y&&S.createElement($,{sideCar:NC,removeScrollBar:p,shards:v,noRelative:_,noIsolation:R,inert:x,setCallbacks:l,allowPinchZoom:!!C,lockRef:n,gapMode:O}),u?S.cloneElement(S.Children.only(f),Or(Or({},L),{ref:V})):S.createElement(k,Or({},L,{className:h,ref:V}),f))});af.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};af.classNames={fullWidth:od,zeroRight:rd};var E8=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function T8(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=E8();return t&&e.setAttribute("nonce",t),e}function C8(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function R8(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var A8=function(){var e=0,t=null;return{add:function(n){e==0&&(t=T8())&&(C8(t,n),R8(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},N8=function(){var e=A8();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},OC=function(){var e=N8(),t=function(n){var o=n.styles,i=n.dynamic;return e(o,i),null};return t},O8={left:0,top:0,right:0,gap:0},Sm=function(e){return parseInt(e||"",10)||0},k8=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Sm(n),Sm(o),Sm(i)]},M8=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return O8;var t=k8(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},I8=OC(),aa="data-scroll-locked",D8=function(e,t,n,o){var i=e.left,l=e.top,u=e.right,f=e.gap;return n===void 0&&(n="margin"),`
63
+ .`.concat(m8,` {
64
+ overflow: hidden `).concat(o,`;
65
+ padding-right: `).concat(f,"px ").concat(o,`;
66
+ }
67
+ body[`).concat(aa,`] {
68
+ overflow: hidden `).concat(o,`;
69
+ overscroll-behavior: contain;
70
+ `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&`
71
+ padding-left: `.concat(i,`px;
72
+ padding-top: `).concat(l,`px;
73
+ padding-right: `).concat(u,`px;
74
+ margin-left:0;
75
+ margin-top:0;
76
+ margin-right: `).concat(f,"px ").concat(o,`;
77
+ `),n==="padding"&&"padding-right: ".concat(f,"px ").concat(o,";")].filter(Boolean).join(""),`
78
+ }
79
+
80
+ .`).concat(rd,` {
81
+ right: `).concat(f,"px ").concat(o,`;
82
+ }
83
+
84
+ .`).concat(od,` {
85
+ margin-right: `).concat(f,"px ").concat(o,`;
86
+ }
87
+
88
+ .`).concat(rd," .").concat(rd,` {
89
+ right: 0 `).concat(o,`;
90
+ }
91
+
92
+ .`).concat(od," .").concat(od,` {
93
+ margin-right: 0 `).concat(o,`;
94
+ }
95
+
96
+ body[`).concat(aa,`] {
97
+ `).concat(g8,": ").concat(f,`px;
98
+ }
99
+ `)},r_=function(){var e=parseInt(document.body.getAttribute(aa)||"0",10);return isFinite(e)?e:0},j8=function(){S.useEffect(function(){return document.body.setAttribute(aa,(r_()+1).toString()),function(){var e=r_()-1;e<=0?document.body.removeAttribute(aa):document.body.setAttribute(aa,e.toString())}},[])},z8=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,i=o===void 0?"margin":o;j8();var l=S.useMemo(function(){return M8(i)},[i]);return S.createElement(I8,{styles:D8(l,!t,i,n?"":"!important")})},sg=!1;if(typeof window<"u")try{var Qu=Object.defineProperty({},"passive",{get:function(){return sg=!0,!0}});window.addEventListener("test",Qu,Qu),window.removeEventListener("test",Qu,Qu)}catch{sg=!1}var qi=sg?{passive:!1}:!1,L8=function(e){return e.tagName==="TEXTAREA"},kC=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!L8(e)&&n[t]==="visible")},P8=function(e){return kC(e,"overflowY")},$8=function(e){return kC(e,"overflowX")},o_=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var i=MC(e,o);if(i){var l=IC(e,o),u=l[1],f=l[2];if(u>f)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},F8=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},U8=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},MC=function(e,t){return e==="v"?P8(t):$8(t)},IC=function(e,t){return e==="v"?F8(t):U8(t)},B8=function(e,t){return e==="h"&&t==="rtl"?-1:1},q8=function(e,t,n,o,i){var l=B8(e,window.getComputedStyle(t).direction),u=l*o,f=n.target,h=t.contains(f),p=!1,y=u>0,v=0,w=0;do{if(!f)break;var _=IC(e,f),R=_[0],x=_[1],C=_[2],N=x-C-l*R;(R||N)&&MC(e,f)&&(v+=N,w+=R);var k=f.parentNode;f=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!h&&f!==document.body||h&&(t.contains(f)||t===f));return(y&&Math.abs(v)<1||!y&&Math.abs(w)<1)&&(p=!0),p},Gu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},s_=function(e){return[e.deltaX,e.deltaY]},i_=function(e){return e&&"current"in e?e.current:e},V8=function(e,t){return e[0]===t[0]&&e[1]===t[1]},H8=function(e){return`
100
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
101
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
102
+ `)},Z8=0,Vi=[];function Q8(e){var t=S.useRef([]),n=S.useRef([0,0]),o=S.useRef(),i=S.useState(Z8++)[0],l=S.useState(OC)[0],u=S.useRef(e);S.useEffect(function(){u.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var x=p8([e.lockRef.current],(e.shards||[]).map(i_),!0).filter(Boolean);return x.forEach(function(C){return C.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var f=S.useCallback(function(x,C){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!u.current.allowPinchZoom;var N=Gu(x),k=n.current,O="deltaX"in x?x.deltaX:k[0]-N[0],M="deltaY"in x?x.deltaY:k[1]-N[1],$,V=x.target,L=Math.abs(O)>Math.abs(M)?"h":"v";if("touches"in x&&L==="h"&&V.type==="range")return!1;var D=window.getSelection(),Y=D&&D.anchorNode,ie=Y?Y===V||Y.contains(V):!1;if(ie)return!1;var le=o_(L,V);if(!le)return!0;if(le?$=L:($=L==="v"?"h":"v",le=o_(L,V)),!le)return!1;if(!o.current&&"changedTouches"in x&&(O||M)&&(o.current=$),!$)return!0;var se=o.current||$;return q8(se,C,x,se==="h"?O:M)},[]),h=S.useCallback(function(x){var C=x;if(!(!Vi.length||Vi[Vi.length-1]!==l)){var N="deltaY"in C?s_(C):Gu(C),k=t.current.filter(function($){return $.name===C.type&&($.target===C.target||C.target===$.shadowParent)&&V8($.delta,N)})[0];if(k&&k.should){C.cancelable&&C.preventDefault();return}if(!k){var O=(u.current.shards||[]).map(i_).filter(Boolean).filter(function($){return $.contains(C.target)}),M=O.length>0?f(C,O[0]):!u.current.noIsolation;M&&C.cancelable&&C.preventDefault()}}},[]),p=S.useCallback(function(x,C,N,k){var O={name:x,delta:C,target:N,should:k,shadowParent:G8(N)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(M){return M!==O})},1)},[]),y=S.useCallback(function(x){n.current=Gu(x),o.current=void 0},[]),v=S.useCallback(function(x){p(x.type,s_(x),x.target,f(x,e.lockRef.current))},[]),w=S.useCallback(function(x){p(x.type,Gu(x),x.target,f(x,e.lockRef.current))},[]);S.useEffect(function(){return Vi.push(l),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:w}),document.addEventListener("wheel",h,qi),document.addEventListener("touchmove",h,qi),document.addEventListener("touchstart",y,qi),function(){Vi=Vi.filter(function(x){return x!==l}),document.removeEventListener("wheel",h,qi),document.removeEventListener("touchmove",h,qi),document.removeEventListener("touchstart",y,qi)}},[]);var _=e.removeScrollBar,R=e.inert;return S.createElement(S.Fragment,null,R?S.createElement(l,{styles:H8(i)}):null,_?S.createElement(z8,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function G8(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Y8=_8(NC,Q8);var fc=S.forwardRef(function(e,t){return S.createElement(af,Or({},e,{ref:t,sideCar:Y8}))});fc.classNames=af.classNames;var K8=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Hi=new WeakMap,Yu=new WeakMap,Ku={},_m=0,DC=function(e){return e&&(e.host||DC(e.parentNode))},X8=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=DC(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},J8=function(e,t,n,o){var i=X8(t,Array.isArray(e)?e:[e]);Ku[n]||(Ku[n]=new WeakMap);var l=Ku[n],u=[],f=new Set,h=new Set(i),p=function(v){!v||f.has(v)||(f.add(v),p(v.parentNode))};i.forEach(p);var y=function(v){!v||h.has(v)||Array.prototype.forEach.call(v.children,function(w){if(f.has(w))y(w);else try{var _=w.getAttribute(o),R=_!==null&&_!=="false",x=(Hi.get(w)||0)+1,C=(l.get(w)||0)+1;Hi.set(w,x),l.set(w,C),u.push(w),x===1&&R&&Yu.set(w,!0),C===1&&w.setAttribute(n,"true"),R||w.setAttribute(o,"true")}catch(N){console.error("aria-hidden: cannot operate on ",w,N)}})};return y(t),f.clear(),_m++,function(){u.forEach(function(v){var w=Hi.get(v)-1,_=l.get(v)-1;Hi.set(v,w),l.set(v,_),w||(Yu.has(v)||v.removeAttribute(o),Yu.delete(v)),_||v.removeAttribute(n)}),_m--,_m||(Hi=new WeakMap,Hi=new WeakMap,Yu=new WeakMap,Ku={})}},lf=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),i=K8(e);return i?(o.push.apply(o,Array.from(i.querySelectorAll("[aria-live], script"))),J8(o,i,n,"aria-hidden")):function(){return null}},cf="Dialog",[jC]=$r(cf),[W8,xr]=jC(cf),zC=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:i,onOpenChange:l,modal:u=!0}=e,f=S.useRef(null),h=S.useRef(null),[p,y]=es({prop:o,defaultProp:i??!1,onChange:l,caller:cf});return b.jsx(W8,{scope:t,triggerRef:f,contentRef:h,contentId:mr(),titleId:mr(),descriptionId:mr(),open:p,onOpenChange:y,onOpenToggle:S.useCallback(()=>y(v=>!v),[y]),modal:u,children:n})};zC.displayName=cf;var LC="DialogTrigger",eV=S.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,i=xr(LC,n),l=Ze(t,i.triggerRef);return b.jsx(Ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ty(i.open),...o,ref:l,onClick:me(e.onClick,i.onOpenToggle)})});eV.displayName=LC;var _y="DialogPortal",[tV,PC]=jC(_y,{forceMount:void 0}),$C=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:i}=e,l=xr(_y,t);return b.jsx(tV,{scope:t,forceMount:n,children:S.Children.map(o,u=>b.jsx(cr,{present:n||l.open,children:b.jsx(dc,{asChild:!0,container:i,children:u})}))})};$C.displayName=_y;var Od="DialogOverlay",FC=S.forwardRef((e,t)=>{const n=PC(Od,e.__scopeDialog),{forceMount:o=n.forceMount,...i}=e,l=xr(Od,e.__scopeDialog);return l.modal?b.jsx(cr,{present:o||l.open,children:b.jsx(rV,{...i,ref:t})}):null});FC.displayName=Od;var nV=Hs("DialogOverlay.RemoveScroll"),rV=S.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,i=xr(Od,n);return b.jsx(fc,{as:nV,allowPinchZoom:!0,shards:[i.contentRef],children:b.jsx(Ne.div,{"data-state":Ty(i.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Zs="DialogContent",UC=S.forwardRef((e,t)=>{const n=PC(Zs,e.__scopeDialog),{forceMount:o=n.forceMount,...i}=e,l=xr(Zs,e.__scopeDialog);return b.jsx(cr,{present:o||l.open,children:l.modal?b.jsx(oV,{...i,ref:t}):b.jsx(sV,{...i,ref:t})})});UC.displayName=Zs;var oV=S.forwardRef((e,t)=>{const n=xr(Zs,e.__scopeDialog),o=S.useRef(null),i=Ze(t,n.contentRef,o);return S.useEffect(()=>{const l=o.current;if(l)return lf(l)},[]),b.jsx(BC,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:me(e.onCloseAutoFocus,l=>{l.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:me(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&l.preventDefault()}),onFocusOutside:me(e.onFocusOutside,l=>l.preventDefault())})}),sV=S.forwardRef((e,t)=>{const n=xr(Zs,e.__scopeDialog),o=S.useRef(!1),i=S.useRef(!1);return b.jsx(BC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{e.onCloseAutoFocus?.(l),l.defaultPrevented||(o.current||n.triggerRef.current?.focus(),l.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:l=>{e.onInteractOutside?.(l),l.defaultPrevented||(o.current=!0,l.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=l.target;n.triggerRef.current?.contains(u)&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&i.current&&l.preventDefault()}})}),BC=S.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:l,...u}=e,f=xr(Zs,n),h=S.useRef(null),p=Ze(t,h);return sf(),b.jsxs(b.Fragment,{children:[b.jsx(uc,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:l,children:b.jsx(cc,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Ty(f.open),...u,ref:p,onDismiss:()=>f.onOpenChange(!1)})}),b.jsxs(b.Fragment,{children:[b.jsx(iV,{titleId:f.titleId}),b.jsx(lV,{contentRef:h,descriptionId:f.descriptionId})]})]})}),Ey="DialogTitle",qC=S.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,i=xr(Ey,n);return b.jsx(Ne.h2,{id:i.titleId,...o,ref:t})});qC.displayName=Ey;var VC="DialogDescription",HC=S.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,i=xr(VC,n);return b.jsx(Ne.p,{id:i.descriptionId,...o,ref:t})});HC.displayName=VC;var ZC="DialogClose",QC=S.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,i=xr(ZC,n);return b.jsx(Ne.button,{type:"button",...o,ref:t,onClick:me(e.onClick,()=>i.onOpenChange(!1))})});QC.displayName=ZC;function Ty(e){return e?"open":"closed"}var GC="DialogTitleWarning",[PG,YC]=Nq(GC,{contentName:Zs,titleName:Ey,docsSlug:"dialog"}),iV=({titleId:e})=>{const t=YC(GC),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
103
+
104
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
105
+
106
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},aV="DialogDescriptionWarning",lV=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${YC(aV).contentName}}.`;return S.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},cV=zC,uV=$C,dV=FC,fV=UC,hV=qC,pV=HC,mV=QC;function gV({...e}){return b.jsx(cV,{"data-slot":"dialog",...e})}function yV({...e}){return b.jsx(uV,{"data-slot":"dialog-portal",...e})}function vV({className:e,...t}){return b.jsx(dV,{"data-slot":"dialog-overlay",className:De("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function bV({className:e,children:t,showCloseButton:n=!0,...o}){return b.jsxs(yV,{"data-slot":"dialog-portal",children:[b.jsx(vV,{}),b.jsxs(fV,{"data-slot":"dialog-content",className:De("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",e),...o,children:[t,n&&b.jsxs(mV,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[b.jsx(Sd,{}),b.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function wV({className:e,...t}){return b.jsx("div",{"data-slot":"dialog-header",className:De("flex flex-col gap-2 text-center sm:text-left",e),...t})}function xV({className:e,...t}){return b.jsx("div",{"data-slot":"dialog-footer",className:De("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function SV({className:e,...t}){return b.jsx(hV,{"data-slot":"dialog-title",className:De("text-lg leading-none font-semibold",e),...t})}function _V({className:e,...t}){return b.jsx(pV,{"data-slot":"dialog-description",className:De("text-muted-foreground text-sm",e),...t})}var EV=Symbol.for("react.lazy"),kd=$d[" use ".trim().toString()];function TV(e){return typeof e=="object"&&e!==null&&"then"in e}function KC(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===EV&&"_payload"in e&&TV(e._payload)}function XC(e){const t=CV(e),n=S.forwardRef((o,i)=>{let{children:l,...u}=o;KC(l)&&typeof kd=="function"&&(l=kd(l._payload));const f=S.Children.toArray(l),h=f.find(AV);if(h){const p=h.props.children,y=f.map(v=>v===h?S.Children.count(p)>1?S.Children.only(null):S.isValidElement(p)?p.props.children:null:v);return b.jsx(t,{...u,ref:i,children:S.isValidElement(p)?S.cloneElement(p,void 0,y):null})}return b.jsx(t,{...u,ref:i,children:l})});return n.displayName=`${e}.Slot`,n}var JC=XC("Slot");function CV(e){const t=S.forwardRef((n,o)=>{let{children:i,...l}=n;if(KC(i)&&typeof kd=="function"&&(i=kd(i._payload)),S.isValidElement(i)){const u=OV(i),f=NV(l,i.props);return i.type!==S.Fragment&&(f.ref=o?lc(o,u):u),S.cloneElement(i,f)}return S.Children.count(i)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var RV=Symbol("radix.slottable");function AV(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===RV}function NV(e,t){const n={...t};for(const o in t){const i=e[o],l=t[o];/^on[A-Z]/.test(o)?i&&l?n[o]=(...f)=>{const h=l(...f);return i(...f),h}:i&&(n[o]=i):o==="style"?n[o]={...i,...l}:o==="className"&&(n[o]=[i,l].filter(Boolean).join(" "))}return{...e,...n}}function OV(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const a_=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,l_=C1,kV=(e,t)=>n=>{var o;if(t?.variants==null)return l_(e,n?.class,n?.className);const{variants:i,defaultVariants:l}=t,u=Object.keys(i).map(p=>{const y=n?.[p],v=l?.[p];if(y===null)return null;const w=a_(y)||a_(v);return i[p][w]}),f=n&&Object.entries(n).reduce((p,y)=>{let[v,w]=y;return w===void 0||(p[v]=w),p},{}),h=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((p,y)=>{let{class:v,className:w,..._}=y;return Object.entries(_).every(R=>{let[x,C]=R;return Array.isArray(C)?C.includes({...l,...f}[x]):{...l,...f}[x]===C})?[...p,v,w]:p},[]);return l_(e,u,h,n?.class,n?.className)},MV=kV("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Ul({className:e,variant:t="default",size:n="default",asChild:o=!1,...i}){const l=o?JC:"button";return b.jsx(l,{"data-slot":"button","data-variant":t,"data-size":n,className:De(MV({variant:t,size:n,className:e})),...i})}const c_={fast:"duration-100 ease-out"},IV={primary:"default",secondary:"secondary",danger:"destructive",ghost:"ghost",outline:"outline",link:"link",success:"default",warning:"default"},DV={success:"bg-success text-success-foreground hover:bg-success/90 focus-visible:ring-success",warning:"bg-warning text-warning-foreground hover:bg-warning/90 focus-visible:ring-warning"},jV=()=>b.jsxs("svg",{className:"size-4 animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[b.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),b.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]});function co({variant:e="primary",loading:t,disabled:n,children:o,className:i,asChild:l,...u}){const f=IV[e],h=DV[e];return l?b.jsx(Ul,{variant:f,disabled:n||t,className:De(c_.fast,h,i),asChild:!0,...u,children:o}):b.jsxs(Ul,{variant:f,disabled:n||t,className:De(c_.fast,h,i),...u,children:[t&&b.jsx(jV,{}),o]})}const zV={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl"};function Cy({open:e,onOpenChange:t,title:n,description:o,children:i,footer:l,size:u="md",className:f}){return b.jsx(gV,{open:e,onOpenChange:t,children:b.jsxs(bV,{className:De("flex max-h-[85vh] flex-col overflow-hidden",zV[u],f),children:[b.jsxs(wV,{className:"shrink-0",children:[b.jsx(SV,{children:n}),o&&b.jsx(_V,{children:o})]}),b.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto py-4 [&::-webkit-scrollbar]:hidden",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:i}),l&&b.jsx(xV,{className:"shrink-0 border-t pt-4",children:l})]})})}function $G({open:e,onOpenChange:t,title:n,description:o,confirmLabel:i="Confirm",cancelLabel:l="Cancel",onConfirm:u,onCancel:f,variant:h="default",loading:p,isLoading:y,error:v}){const w=p??y??!1,_=()=>{f?.(),t(!1)},R=()=>{u()},x=()=>h==="danger"?"danger":h==="warning"?"warning":"primary";return b.jsx(Cy,{open:e,onOpenChange:t,title:n,size:"sm",footer:b.jsxs(b.Fragment,{children:[b.jsx(co,{variant:"outline",onClick:_,disabled:w,children:l}),b.jsx(co,{variant:x(),onClick:R,loading:w,children:i})]}),children:b.jsxs("div",{className:"space-y-3",children:[b.jsx("p",{className:"text-sm text-muted-foreground",children:o}),v&&b.jsx("p",{className:"text-sm text-destructive",children:v})]})})}function Is({className:e,type:t,...n}){return b.jsx("input",{type:t,"data-slot":"input",className:De("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}var LV=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],uf=LV.reduce((e,t)=>{const n=XC(`Primitive.${t}`),o=S.forwardRef((i,l)=>{const{asChild:u,...f}=i,h=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(h,{...f,ref:l})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),PV="Label",WC=S.forwardRef((e,t)=>b.jsx(uf.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));WC.displayName=PV;var $V=WC;function tr({className:e,...t}){return b.jsx($V,{"data-slot":"label",className:De("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function FV({className:e,...t}){return b.jsx("textarea",{"data-slot":"textarea",className:De("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}function eR(e){const t=S.useRef({value:e,previous:e});return S.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function tR(e){const[t,n]=S.useState(void 0);return Mt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const l=i[0];let u,f;if("borderBoxSize"in l){const h=l.borderBoxSize,p=Array.isArray(h)?h[0]:h;u=p.inlineSize,f=p.blockSize}else u=e.offsetWidth,f=e.offsetHeight;n({width:u,height:f})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var df="Checkbox",[UV]=$r(df),[BV,Ry]=UV(df);function qV(e){const{__scopeCheckbox:t,checked:n,children:o,defaultChecked:i,disabled:l,form:u,name:f,onCheckedChange:h,required:p,value:y="on",internal_do_not_use_render:v}=e,[w,_]=es({prop:n,defaultProp:i??!1,onChange:h,caller:df}),[R,x]=S.useState(null),[C,N]=S.useState(null),k=S.useRef(!1),O=R?!!u||!!R.closest("form"):!0,M={checked:w,disabled:l,setChecked:_,control:R,setControl:x,name:f,form:u,value:y,hasConsumerStoppedPropagationRef:k,required:p,defaultChecked:Ko(i)?!1:i,isFormControl:O,bubbleInput:C,setBubbleInput:N};return b.jsx(BV,{scope:t,...M,children:VV(v)?v(M):o})}var nR="CheckboxTrigger",rR=S.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...o},i)=>{const{control:l,value:u,disabled:f,checked:h,required:p,setControl:y,setChecked:v,hasConsumerStoppedPropagationRef:w,isFormControl:_,bubbleInput:R}=Ry(nR,e),x=Ze(i,y),C=S.useRef(h);return S.useEffect(()=>{const N=l?.form;if(N){const k=()=>v(C.current);return N.addEventListener("reset",k),()=>N.removeEventListener("reset",k)}},[l,v]),b.jsx(Ne.button,{type:"button",role:"checkbox","aria-checked":Ko(h)?"mixed":h,"aria-required":p,"data-state":cR(h),"data-disabled":f?"":void 0,disabled:f,value:u,...o,ref:x,onKeyDown:me(t,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:me(n,N=>{v(k=>Ko(k)?!0:!k),R&&_&&(w.current=N.isPropagationStopped(),w.current||N.stopPropagation())})})});rR.displayName=nR;var oR=S.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:o,checked:i,defaultChecked:l,required:u,disabled:f,value:h,onCheckedChange:p,form:y,...v}=e;return b.jsx(qV,{__scopeCheckbox:n,checked:i,defaultChecked:l,disabled:f,required:u,onCheckedChange:p,name:o,form:y,value:h,internal_do_not_use_render:({isFormControl:w})=>b.jsxs(b.Fragment,{children:[b.jsx(rR,{...v,ref:t,__scopeCheckbox:n}),w&&b.jsx(lR,{__scopeCheckbox:n})]})})});oR.displayName=df;var sR="CheckboxIndicator",iR=S.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:o,...i}=e,l=Ry(sR,n);return b.jsx(cr,{present:o||Ko(l.checked)||l.checked===!0,children:b.jsx(Ne.span,{"data-state":cR(l.checked),"data-disabled":l.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});iR.displayName=sR;var aR="CheckboxBubbleInput",lR=S.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:o,hasConsumerStoppedPropagationRef:i,checked:l,defaultChecked:u,required:f,disabled:h,name:p,value:y,form:v,bubbleInput:w,setBubbleInput:_}=Ry(aR,e),R=Ze(n,_),x=eR(l),C=tR(o);S.useEffect(()=>{const k=w;if(!k)return;const O=window.HTMLInputElement.prototype,$=Object.getOwnPropertyDescriptor(O,"checked").set,V=!i.current;if(x!==l&&$){const L=new Event("click",{bubbles:V});k.indeterminate=Ko(l),$.call(k,Ko(l)?!1:l),k.dispatchEvent(L)}},[w,x,l,i]);const N=S.useRef(Ko(l)?!1:l);return b.jsx(Ne.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??N.current,required:f,disabled:h,name:p,value:y,form:v,...t,tabIndex:-1,ref:R,style:{...t.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});lR.displayName=aR;function VV(e){return typeof e=="function"}function Ko(e){return e==="indeterminate"}function cR(e){return Ko(e)?"indeterminate":e?"checked":"unchecked"}function u_({className:e,...t}){return b.jsx(oR,{"data-slot":"checkbox",className:De("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:b.jsx(iR,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:b.jsx(m1,{className:"size-3.5"})})})}function d_(e,[t,n]){return Math.min(n,Math.max(t,e))}function Ay(e){const t=e+"CollectionProvider",[n,o]=$r(t),[i,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),u=x=>{const{scope:C,children:N}=x,k=tn.useRef(null),O=tn.useRef(new Map).current;return b.jsx(i,{scope:C,itemMap:O,collectionRef:k,children:N})};u.displayName=t;const f=e+"CollectionSlot",h=Hs(f),p=tn.forwardRef((x,C)=>{const{scope:N,children:k}=x,O=l(f,N),M=Ze(C,O.collectionRef);return b.jsx(h,{ref:M,children:k})});p.displayName=f;const y=e+"CollectionItemSlot",v="data-radix-collection-item",w=Hs(y),_=tn.forwardRef((x,C)=>{const{scope:N,children:k,...O}=x,M=tn.useRef(null),$=Ze(C,M),V=l(y,N);return tn.useEffect(()=>(V.itemMap.set(M,{ref:M,...O}),()=>{V.itemMap.delete(M)})),b.jsx(w,{[v]:"",ref:$,children:k})});_.displayName=y;function R(x){const C=l(e+"CollectionConsumer",x);return tn.useCallback(()=>{const k=C.collectionRef.current;if(!k)return[];const O=Array.from(k.querySelectorAll(`[${v}]`));return Array.from(C.itemMap.values()).sort((V,L)=>O.indexOf(V.ref.current)-O.indexOf(L.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:u,Slot:p,ItemSlot:_},R,o]}var HV=S.createContext(void 0);function Ny(e){const t=S.useContext(HV);return e||t||"ltr"}const ZV=["top","right","bottom","left"],ts=Math.min,Pn=Math.max,Md=Math.round,Xu=Math.floor,Mr=e=>({x:e,y:e}),QV={left:"right",right:"left",bottom:"top",top:"bottom"},GV={start:"end",end:"start"};function ig(e,t,n){return Pn(e,ts(t,n))}function ho(e,t){return typeof e=="function"?e(t):e}function po(e){return e.split("-")[0]}function Ea(e){return e.split("-")[1]}function Oy(e){return e==="x"?"y":"x"}function ky(e){return e==="y"?"height":"width"}const YV=new Set(["top","bottom"]);function kr(e){return YV.has(po(e))?"y":"x"}function My(e){return Oy(kr(e))}function KV(e,t,n){n===void 0&&(n=!1);const o=Ea(e),i=My(e),l=ky(i);let u=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(u=Id(u)),[u,Id(u)]}function XV(e){const t=Id(e);return[ag(e),t,ag(t)]}function ag(e){return e.replace(/start|end/g,t=>GV[t])}const f_=["left","right"],h_=["right","left"],JV=["top","bottom"],WV=["bottom","top"];function e9(e,t,n){switch(e){case"top":case"bottom":return n?t?h_:f_:t?f_:h_;case"left":case"right":return t?JV:WV;default:return[]}}function t9(e,t,n,o){const i=Ea(e);let l=e9(po(e),n==="start",o);return i&&(l=l.map(u=>u+"-"+i),t&&(l=l.concat(l.map(ag)))),l}function Id(e){return e.replace(/left|right|bottom|top/g,t=>QV[t])}function n9(e){return{top:0,right:0,bottom:0,left:0,...e}}function uR(e){return typeof e!="number"?n9(e):{top:e,right:e,bottom:e,left:e}}function Dd(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function p_(e,t,n){let{reference:o,floating:i}=e;const l=kr(t),u=My(t),f=ky(u),h=po(t),p=l==="y",y=o.x+o.width/2-i.width/2,v=o.y+o.height/2-i.height/2,w=o[f]/2-i[f]/2;let _;switch(h){case"top":_={x:y,y:o.y-i.height};break;case"bottom":_={x:y,y:o.y+o.height};break;case"right":_={x:o.x+o.width,y:v};break;case"left":_={x:o.x-i.width,y:v};break;default:_={x:o.x,y:o.y}}switch(Ea(t)){case"start":_[u]-=w*(n&&p?-1:1);break;case"end":_[u]+=w*(n&&p?-1:1);break}return _}async function r9(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:l,rects:u,elements:f,strategy:h}=e,{boundary:p="clippingAncestors",rootBoundary:y="viewport",elementContext:v="floating",altBoundary:w=!1,padding:_=0}=ho(t,e),R=uR(_),C=f[w?v==="floating"?"reference":"floating":v],N=Dd(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(C)))==null||n?C:C.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(f.floating)),boundary:p,rootBoundary:y,strategy:h})),k=v==="floating"?{x:o,y:i,width:u.floating.width,height:u.floating.height}:u.reference,O=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f.floating)),M=await(l.isElement==null?void 0:l.isElement(O))?await(l.getScale==null?void 0:l.getScale(O))||{x:1,y:1}:{x:1,y:1},$=Dd(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:k,offsetParent:O,strategy:h}):k);return{top:(N.top-$.top+R.top)/M.y,bottom:($.bottom-N.bottom+R.bottom)/M.y,left:(N.left-$.left+R.left)/M.x,right:($.right-N.right+R.right)/M.x}}const o9=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:l=[],platform:u}=n,f=l.filter(Boolean),h=await(u.isRTL==null?void 0:u.isRTL(t));let p=await u.getElementRects({reference:e,floating:t,strategy:i}),{x:y,y:v}=p_(p,o,h),w=o,_={},R=0;for(let C=0;C<f.length;C++){var x;const{name:N,fn:k}=f[C],{x:O,y:M,data:$,reset:V}=await k({x:y,y:v,initialPlacement:o,placement:w,strategy:i,middlewareData:_,rects:p,platform:{...u,detectOverflow:(x=u.detectOverflow)!=null?x:r9},elements:{reference:e,floating:t}});y=O??y,v=M??v,_={..._,[N]:{..._[N],...$}},V&&R<=50&&(R++,typeof V=="object"&&(V.placement&&(w=V.placement),V.rects&&(p=V.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:i}):V.rects),{x:y,y:v}=p_(p,w,h)),C=-1)}return{x:y,y:v,placement:w,strategy:i,middlewareData:_}},s9=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:l,platform:u,elements:f,middlewareData:h}=t,{element:p,padding:y=0}=ho(e,t)||{};if(p==null)return{};const v=uR(y),w={x:n,y:o},_=My(i),R=ky(_),x=await u.getDimensions(p),C=_==="y",N=C?"top":"left",k=C?"bottom":"right",O=C?"clientHeight":"clientWidth",M=l.reference[R]+l.reference[_]-w[_]-l.floating[R],$=w[_]-l.reference[_],V=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let L=V?V[O]:0;(!L||!await(u.isElement==null?void 0:u.isElement(V)))&&(L=f.floating[O]||l.floating[R]);const D=M/2-$/2,Y=L/2-x[R]/2-1,ie=ts(v[N],Y),le=ts(v[k],Y),se=ie,ue=L-x[R]-le,ce=L/2-x[R]/2+D,ge=ig(se,ce,ue),F=!h.arrow&&Ea(i)!=null&&ce!==ge&&l.reference[R]/2-(ce<se?ie:le)-x[R]/2<0,X=F?ce<se?ce-se:ce-ue:0;return{[_]:w[_]+X,data:{[_]:ge,centerOffset:ce-ge-X,...F&&{alignmentOffset:X}},reset:F}}}),i9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:l,rects:u,initialPlacement:f,platform:h,elements:p}=t,{mainAxis:y=!0,crossAxis:v=!0,fallbackPlacements:w,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:R="none",flipAlignment:x=!0,...C}=ho(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const N=po(i),k=kr(f),O=po(f)===f,M=await(h.isRTL==null?void 0:h.isRTL(p.floating)),$=w||(O||!x?[Id(f)]:XV(f)),V=R!=="none";!w&&V&&$.push(...t9(f,x,R,M));const L=[f,...$],D=await h.detectOverflow(t,C),Y=[];let ie=((o=l.flip)==null?void 0:o.overflows)||[];if(y&&Y.push(D[N]),v){const ce=KV(i,u,M);Y.push(D[ce[0]],D[ce[1]])}if(ie=[...ie,{placement:i,overflows:Y}],!Y.every(ce=>ce<=0)){var le,se;const ce=(((le=l.flip)==null?void 0:le.index)||0)+1,ge=L[ce];if(ge&&(!(v==="alignment"?k!==kr(ge):!1)||ie.every(Z=>kr(Z.placement)===k?Z.overflows[0]>0:!0)))return{data:{index:ce,overflows:ie},reset:{placement:ge}};let F=(se=ie.filter(X=>X.overflows[0]<=0).sort((X,Z)=>X.overflows[1]-Z.overflows[1])[0])==null?void 0:se.placement;if(!F)switch(_){case"bestFit":{var ue;const X=(ue=ie.filter(Z=>{if(V){const ne=kr(Z.placement);return ne===k||ne==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(ne=>ne>0).reduce((ne,be)=>ne+be,0)]).sort((Z,ne)=>Z[1]-ne[1])[0])==null?void 0:ue[0];X&&(F=X);break}case"initialPlacement":F=f;break}if(i!==F)return{reset:{placement:F}}}return{}}}};function m_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function g_(e){return ZV.some(t=>e[t]>=0)}const a9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:i="referenceHidden",...l}=ho(e,t);switch(i){case"referenceHidden":{const u=await o.detectOverflow(t,{...l,elementContext:"reference"}),f=m_(u,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:g_(f)}}}case"escaped":{const u=await o.detectOverflow(t,{...l,altBoundary:!0}),f=m_(u,n.floating);return{data:{escapedOffsets:f,escaped:g_(f)}}}default:return{}}}}},dR=new Set(["left","top"]);async function l9(e,t){const{placement:n,platform:o,elements:i}=e,l=await(o.isRTL==null?void 0:o.isRTL(i.floating)),u=po(n),f=Ea(n),h=kr(n)==="y",p=dR.has(u)?-1:1,y=l&&h?-1:1,v=ho(t,e);let{mainAxis:w,crossAxis:_,alignmentAxis:R}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return f&&typeof R=="number"&&(_=f==="end"?R*-1:R),h?{x:_*y,y:w*p}:{x:w*p,y:_*y}}const c9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:l,placement:u,middlewareData:f}=t,h=await l9(t,e);return u===((n=f.offset)==null?void 0:n.placement)&&(o=f.arrow)!=null&&o.alignmentOffset?{}:{x:i+h.x,y:l+h.y,data:{...h,placement:u}}}}},u9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i,platform:l}=t,{mainAxis:u=!0,crossAxis:f=!1,limiter:h={fn:N=>{let{x:k,y:O}=N;return{x:k,y:O}}},...p}=ho(e,t),y={x:n,y:o},v=await l.detectOverflow(t,p),w=kr(po(i)),_=Oy(w);let R=y[_],x=y[w];if(u){const N=_==="y"?"top":"left",k=_==="y"?"bottom":"right",O=R+v[N],M=R-v[k];R=ig(O,R,M)}if(f){const N=w==="y"?"top":"left",k=w==="y"?"bottom":"right",O=x+v[N],M=x-v[k];x=ig(O,x,M)}const C=h.fn({...t,[_]:R,[w]:x});return{...C,data:{x:C.x-n,y:C.y-o,enabled:{[_]:u,[w]:f}}}}}},d9=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:i,rects:l,middlewareData:u}=t,{offset:f=0,mainAxis:h=!0,crossAxis:p=!0}=ho(e,t),y={x:n,y:o},v=kr(i),w=Oy(v);let _=y[w],R=y[v];const x=ho(f,t),C=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(h){const O=w==="y"?"height":"width",M=l.reference[w]-l.floating[O]+C.mainAxis,$=l.reference[w]+l.reference[O]-C.mainAxis;_<M?_=M:_>$&&(_=$)}if(p){var N,k;const O=w==="y"?"width":"height",M=dR.has(po(i)),$=l.reference[v]-l.floating[O]+(M&&((N=u.offset)==null?void 0:N[v])||0)+(M?0:C.crossAxis),V=l.reference[v]+l.reference[O]+(M?0:((k=u.offset)==null?void 0:k[v])||0)-(M?C.crossAxis:0);R<$?R=$:R>V&&(R=V)}return{[w]:_,[v]:R}}}},f9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:i,rects:l,platform:u,elements:f}=t,{apply:h=()=>{},...p}=ho(e,t),y=await u.detectOverflow(t,p),v=po(i),w=Ea(i),_=kr(i)==="y",{width:R,height:x}=l.floating;let C,N;v==="top"||v==="bottom"?(C=v,N=w===(await(u.isRTL==null?void 0:u.isRTL(f.floating))?"start":"end")?"left":"right"):(N=v,C=w==="end"?"top":"bottom");const k=x-y.top-y.bottom,O=R-y.left-y.right,M=ts(x-y[C],k),$=ts(R-y[N],O),V=!t.middlewareData.shift;let L=M,D=$;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=O),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(L=k),V&&!w){const ie=Pn(y.left,0),le=Pn(y.right,0),se=Pn(y.top,0),ue=Pn(y.bottom,0);_?D=R-2*(ie!==0||le!==0?ie+le:Pn(y.left,y.right)):L=x-2*(se!==0||ue!==0?se+ue:Pn(y.top,y.bottom))}await h({...t,availableWidth:D,availableHeight:L});const Y=await u.getDimensions(f.floating);return R!==Y.width||x!==Y.height?{reset:{rects:!0}}:{}}}};function ff(){return typeof window<"u"}function Ta(e){return fR(e)?(e.nodeName||"").toLowerCase():"#document"}function Fn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Fr(e){var t;return(t=(fR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function fR(e){return ff()?e instanceof Node||e instanceof Fn(e).Node:!1}function br(e){return ff()?e instanceof Element||e instanceof Fn(e).Element:!1}function Dr(e){return ff()?e instanceof HTMLElement||e instanceof Fn(e).HTMLElement:!1}function y_(e){return!ff()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Fn(e).ShadowRoot}const h9=new Set(["inline","contents"]);function hc(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=wr(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!h9.has(i)}const p9=new Set(["table","td","th"]);function m9(e){return p9.has(Ta(e))}const g9=[":popover-open",":modal"];function hf(e){return g9.some(t=>{try{return e.matches(t)}catch{return!1}})}const y9=["transform","translate","scale","rotate","perspective"],v9=["transform","translate","scale","rotate","perspective","filter"],b9=["paint","layout","strict","content"];function Iy(e){const t=Dy(),n=br(e)?wr(e):e;return y9.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||v9.some(o=>(n.willChange||"").includes(o))||b9.some(o=>(n.contain||"").includes(o))}function w9(e){let t=ns(e);for(;Dr(t)&&!pa(t);){if(Iy(t))return t;if(hf(t))return null;t=ns(t)}return null}function Dy(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const x9=new Set(["html","body","#document"]);function pa(e){return x9.has(Ta(e))}function wr(e){return Fn(e).getComputedStyle(e)}function pf(e){return br(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ns(e){if(Ta(e)==="html")return e;const t=e.assignedSlot||e.parentNode||y_(e)&&e.host||Fr(e);return y_(t)?t.host:t}function hR(e){const t=ns(e);return pa(t)?e.ownerDocument?e.ownerDocument.body:e.body:Dr(t)&&hc(t)?t:hR(t)}function Xl(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=hR(e),l=i===((o=e.ownerDocument)==null?void 0:o.body),u=Fn(i);if(l){const f=lg(u);return t.concat(u,u.visualViewport||[],hc(i)?i:[],f&&n?Xl(f):[])}return t.concat(i,Xl(i,[],n))}function lg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pR(e){const t=wr(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=Dr(e),l=i?e.offsetWidth:n,u=i?e.offsetHeight:o,f=Md(n)!==l||Md(o)!==u;return f&&(n=l,o=u),{width:n,height:o,$:f}}function jy(e){return br(e)?e:e.contextElement}function la(e){const t=jy(e);if(!Dr(t))return Mr(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:l}=pR(t);let u=(l?Md(n.width):n.width)/o,f=(l?Md(n.height):n.height)/i;return(!u||!Number.isFinite(u))&&(u=1),(!f||!Number.isFinite(f))&&(f=1),{x:u,y:f}}const S9=Mr(0);function mR(e){const t=Fn(e);return!Dy()||!t.visualViewport?S9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Fn(e)?!1:t}function Qs(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),l=jy(e);let u=Mr(1);t&&(o?br(o)&&(u=la(o)):u=la(e));const f=_9(l,n,o)?mR(l):Mr(0);let h=(i.left+f.x)/u.x,p=(i.top+f.y)/u.y,y=i.width/u.x,v=i.height/u.y;if(l){const w=Fn(l),_=o&&br(o)?Fn(o):o;let R=w,x=lg(R);for(;x&&o&&_!==R;){const C=la(x),N=x.getBoundingClientRect(),k=wr(x),O=N.left+(x.clientLeft+parseFloat(k.paddingLeft))*C.x,M=N.top+(x.clientTop+parseFloat(k.paddingTop))*C.y;h*=C.x,p*=C.y,y*=C.x,v*=C.y,h+=O,p+=M,R=Fn(x),x=lg(R)}}return Dd({width:y,height:v,x:h,y:p})}function mf(e,t){const n=pf(e).scrollLeft;return t?t.left+n:Qs(Fr(e)).left+n}function gR(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-mf(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function E9(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const l=i==="fixed",u=Fr(o),f=t?hf(t.floating):!1;if(o===u||f&&l)return n;let h={scrollLeft:0,scrollTop:0},p=Mr(1);const y=Mr(0),v=Dr(o);if((v||!v&&!l)&&((Ta(o)!=="body"||hc(u))&&(h=pf(o)),Dr(o))){const _=Qs(o);p=la(o),y.x=_.x+o.clientLeft,y.y=_.y+o.clientTop}const w=u&&!v&&!l?gR(u,h):Mr(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-h.scrollLeft*p.x+y.x+w.x,y:n.y*p.y-h.scrollTop*p.y+y.y+w.y}}function T9(e){return Array.from(e.getClientRects())}function C9(e){const t=Fr(e),n=pf(e),o=e.ownerDocument.body,i=Pn(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),l=Pn(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let u=-n.scrollLeft+mf(e);const f=-n.scrollTop;return wr(o).direction==="rtl"&&(u+=Pn(t.clientWidth,o.clientWidth)-i),{width:i,height:l,x:u,y:f}}const v_=25;function R9(e,t){const n=Fn(e),o=Fr(e),i=n.visualViewport;let l=o.clientWidth,u=o.clientHeight,f=0,h=0;if(i){l=i.width,u=i.height;const y=Dy();(!y||y&&t==="fixed")&&(f=i.offsetLeft,h=i.offsetTop)}const p=mf(o);if(p<=0){const y=o.ownerDocument,v=y.body,w=getComputedStyle(v),_=y.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,R=Math.abs(o.clientWidth-v.clientWidth-_);R<=v_&&(l-=R)}else p<=v_&&(l+=p);return{width:l,height:u,x:f,y:h}}const A9=new Set(["absolute","fixed"]);function N9(e,t){const n=Qs(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,l=Dr(e)?la(e):Mr(1),u=e.clientWidth*l.x,f=e.clientHeight*l.y,h=i*l.x,p=o*l.y;return{width:u,height:f,x:h,y:p}}function b_(e,t,n){let o;if(t==="viewport")o=R9(e,n);else if(t==="document")o=C9(Fr(e));else if(br(t))o=N9(t,n);else{const i=mR(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Dd(o)}function yR(e,t){const n=ns(e);return n===t||!br(n)||pa(n)?!1:wr(n).position==="fixed"||yR(n,t)}function O9(e,t){const n=t.get(e);if(n)return n;let o=Xl(e,[],!1).filter(f=>br(f)&&Ta(f)!=="body"),i=null;const l=wr(e).position==="fixed";let u=l?ns(e):e;for(;br(u)&&!pa(u);){const f=wr(u),h=Iy(u);!h&&f.position==="fixed"&&(i=null),(l?!h&&!i:!h&&f.position==="static"&&!!i&&A9.has(i.position)||hc(u)&&!h&&yR(e,u))?o=o.filter(y=>y!==u):i=f,u=ns(u)}return t.set(e,o),o}function k9(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const u=[...n==="clippingAncestors"?hf(t)?[]:O9(t,this._c):[].concat(n),o],f=u[0],h=u.reduce((p,y)=>{const v=b_(t,y,i);return p.top=Pn(v.top,p.top),p.right=ts(v.right,p.right),p.bottom=ts(v.bottom,p.bottom),p.left=Pn(v.left,p.left),p},b_(t,f,i));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function M9(e){const{width:t,height:n}=pR(e);return{width:t,height:n}}function I9(e,t,n){const o=Dr(t),i=Fr(t),l=n==="fixed",u=Qs(e,!0,l,t);let f={scrollLeft:0,scrollTop:0};const h=Mr(0);function p(){h.x=mf(i)}if(o||!o&&!l)if((Ta(t)!=="body"||hc(i))&&(f=pf(t)),o){const _=Qs(t,!0,l,t);h.x=_.x+t.clientLeft,h.y=_.y+t.clientTop}else i&&p();l&&!o&&i&&p();const y=i&&!o&&!l?gR(i,f):Mr(0),v=u.left+f.scrollLeft-h.x-y.x,w=u.top+f.scrollTop-h.y-y.y;return{x:v,y:w,width:u.width,height:u.height}}function Em(e){return wr(e).position==="static"}function w_(e,t){if(!Dr(e)||wr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Fr(e)===n&&(n=n.ownerDocument.body),n}function vR(e,t){const n=Fn(e);if(hf(e))return n;if(!Dr(e)){let i=ns(e);for(;i&&!pa(i);){if(br(i)&&!Em(i))return i;i=ns(i)}return n}let o=w_(e,t);for(;o&&m9(o)&&Em(o);)o=w_(o,t);return o&&pa(o)&&Em(o)&&!Iy(o)?n:o||w9(e)||n}const D9=async function(e){const t=this.getOffsetParent||vR,n=this.getDimensions,o=await n(e.floating);return{reference:I9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function j9(e){return wr(e).direction==="rtl"}const z9={convertOffsetParentRelativeRectToViewportRelativeRect:E9,getDocumentElement:Fr,getClippingRect:k9,getOffsetParent:vR,getElementRects:D9,getClientRects:T9,getDimensions:M9,getScale:la,isElement:br,isRTL:j9};function bR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function L9(e,t){let n=null,o;const i=Fr(e);function l(){var f;clearTimeout(o),(f=n)==null||f.disconnect(),n=null}function u(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),l();const p=e.getBoundingClientRect(),{left:y,top:v,width:w,height:_}=p;if(f||t(),!w||!_)return;const R=Xu(v),x=Xu(i.clientWidth-(y+w)),C=Xu(i.clientHeight-(v+_)),N=Xu(y),O={rootMargin:-R+"px "+-x+"px "+-C+"px "+-N+"px",threshold:Pn(0,ts(1,h))||1};let M=!0;function $(V){const L=V[0].intersectionRatio;if(L!==h){if(!M)return u();L?u(!1,L):o=setTimeout(()=>{u(!1,1e-7)},1e3)}L===1&&!bR(p,e.getBoundingClientRect())&&u(),M=!1}try{n=new IntersectionObserver($,{...O,root:i.ownerDocument})}catch{n=new IntersectionObserver($,O)}n.observe(e)}return u(!0),l}function P9(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=o,p=jy(e),y=i||l?[...p?Xl(p):[],...Xl(t)]:[];y.forEach(N=>{i&&N.addEventListener("scroll",n,{passive:!0}),l&&N.addEventListener("resize",n)});const v=p&&f?L9(p,n):null;let w=-1,_=null;u&&(_=new ResizeObserver(N=>{let[k]=N;k&&k.target===p&&_&&(_.unobserve(t),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var O;(O=_)==null||O.observe(t)})),n()}),p&&!h&&_.observe(p),_.observe(t));let R,x=h?Qs(e):null;h&&C();function C(){const N=Qs(e);x&&!bR(x,N)&&n(),x=N,R=requestAnimationFrame(C)}return n(),()=>{var N;y.forEach(k=>{i&&k.removeEventListener("scroll",n),l&&k.removeEventListener("resize",n)}),v?.(),(N=_)==null||N.disconnect(),_=null,h&&cancelAnimationFrame(R)}}const $9=c9,F9=u9,U9=i9,B9=f9,q9=a9,x_=s9,V9=d9,H9=(e,t,n)=>{const o=new Map,i={platform:z9,...n},l={...i.platform,_c:o};return o9(e,t,{...i,platform:l})};var Z9=typeof document<"u",Q9=function(){},sd=Z9?S.useLayoutEffect:Q9;function jd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!jd(e[o],t[o]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,i[o]))return!1;for(o=n;o--!==0;){const l=i[o];if(!(l==="_owner"&&e.$$typeof)&&!jd(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function wR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function S_(e,t){const n=wR(e);return Math.round(t*n)/n}function Tm(e){const t=S.useRef(e);return sd(()=>{t.current=e}),t}function G9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:l,floating:u}={},transform:f=!0,whileElementsMounted:h,open:p}=e,[y,v]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[w,_]=S.useState(o);jd(w,o)||_(o);const[R,x]=S.useState(null),[C,N]=S.useState(null),k=S.useCallback(Z=>{Z!==V.current&&(V.current=Z,x(Z))},[]),O=S.useCallback(Z=>{Z!==L.current&&(L.current=Z,N(Z))},[]),M=l||R,$=u||C,V=S.useRef(null),L=S.useRef(null),D=S.useRef(y),Y=h!=null,ie=Tm(h),le=Tm(i),se=Tm(p),ue=S.useCallback(()=>{if(!V.current||!L.current)return;const Z={placement:t,strategy:n,middleware:w};le.current&&(Z.platform=le.current),H9(V.current,L.current,Z).then(ne=>{const be={...ne,isPositioned:se.current!==!1};ce.current&&!jd(D.current,be)&&(D.current=be,ga.flushSync(()=>{v(be)}))})},[w,t,n,le,se]);sd(()=>{p===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,v(Z=>({...Z,isPositioned:!1})))},[p]);const ce=S.useRef(!1);sd(()=>(ce.current=!0,()=>{ce.current=!1}),[]),sd(()=>{if(M&&(V.current=M),$&&(L.current=$),M&&$){if(ie.current)return ie.current(M,$,ue);ue()}},[M,$,ue,ie,Y]);const ge=S.useMemo(()=>({reference:V,floating:L,setReference:k,setFloating:O}),[k,O]),F=S.useMemo(()=>({reference:M,floating:$}),[M,$]),X=S.useMemo(()=>{const Z={position:n,left:0,top:0};if(!F.floating)return Z;const ne=S_(F.floating,y.x),be=S_(F.floating,y.y);return f?{...Z,transform:"translate("+ne+"px, "+be+"px)",...wR(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ne,top:be}},[n,f,F.floating,y.x,y.y]);return S.useMemo(()=>({...y,update:ue,refs:ge,elements:F,floatingStyles:X}),[y,ue,ge,F,X])}const Y9=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:i}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?x_({element:o.current,padding:i}).fn(n):{}:o?x_({element:o,padding:i}).fn(n):{}}}},K9=(e,t)=>({...$9(e),options:[e,t]}),X9=(e,t)=>({...F9(e),options:[e,t]}),J9=(e,t)=>({...V9(e),options:[e,t]}),W9=(e,t)=>({...U9(e),options:[e,t]}),e7=(e,t)=>({...B9(e),options:[e,t]}),t7=(e,t)=>({...q9(e),options:[e,t]}),n7=(e,t)=>({...Y9(e),options:[e,t]});var r7="Arrow",xR=S.forwardRef((e,t)=>{const{children:n,width:o=10,height:i=5,...l}=e;return b.jsx(Ne.svg,{...l,ref:t,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:b.jsx("polygon",{points:"0,0 30,0 15,10"})})});xR.displayName=r7;var o7=xR,zy="Popper",[SR,Ca]=$r(zy),[s7,_R]=SR(zy),ER=e=>{const{__scopePopper:t,children:n}=e,[o,i]=S.useState(null);return b.jsx(s7,{scope:t,anchor:o,onAnchorChange:i,children:n})};ER.displayName=zy;var TR="PopperAnchor",CR=S.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...i}=e,l=_R(TR,n),u=S.useRef(null),f=Ze(t,u),h=S.useRef(null);return S.useEffect(()=>{const p=h.current;h.current=o?.current||u.current,p!==h.current&&l.onAnchorChange(h.current)}),o?null:b.jsx(Ne.div,{...i,ref:f})});CR.displayName=TR;var Ly="PopperContent",[i7,a7]=SR(Ly),RR=S.forwardRef((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:i=0,align:l="center",alignOffset:u=0,arrowPadding:f=0,avoidCollisions:h=!0,collisionBoundary:p=[],collisionPadding:y=0,sticky:v="partial",hideWhenDetached:w=!1,updatePositionStrategy:_="optimized",onPlaced:R,...x}=e,C=_R(Ly,n),[N,k]=S.useState(null),O=Ze(t,J=>k(J)),[M,$]=S.useState(null),V=tR(M),L=V?.width??0,D=V?.height??0,Y=o+(l!=="center"?"-"+l:""),ie=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},le=Array.isArray(p)?p:[p],se=le.length>0,ue={padding:ie,boundary:le.filter(c7),altBoundary:se},{refs:ce,floatingStyles:ge,placement:F,isPositioned:X,middlewareData:Z}=G9({strategy:"fixed",placement:Y,whileElementsMounted:(...J)=>P9(...J,{animationFrame:_==="always"}),elements:{reference:C.anchor},middleware:[K9({mainAxis:i+D,alignmentAxis:u}),h&&X9({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?J9():void 0,...ue}),h&&W9({...ue}),e7({...ue,apply:({elements:J,rects:_e,availableWidth:Te,availableHeight:Ce})=>{const{width:Oe,height:je}=_e.reference,ht=J.floating.style;ht.setProperty("--radix-popper-available-width",`${Te}px`),ht.setProperty("--radix-popper-available-height",`${Ce}px`),ht.setProperty("--radix-popper-anchor-width",`${Oe}px`),ht.setProperty("--radix-popper-anchor-height",`${je}px`)}}),M&&n7({element:M,padding:f}),u7({arrowWidth:L,arrowHeight:D}),w&&t7({strategy:"referenceHidden",...ue})]}),[ne,be]=OR(F),z=vr(R);Mt(()=>{X&&z?.()},[X,z]);const G=Z.arrow?.x,re=Z.arrow?.y,oe=Z.arrow?.centerOffset!==0,[de,ve]=S.useState();return Mt(()=>{N&&ve(window.getComputedStyle(N).zIndex)},[N]),b.jsx("div",{ref:ce.setFloating,"data-radix-popper-content-wrapper":"",style:{...ge,transform:X?ge.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[Z.transformOrigin?.x,Z.transformOrigin?.y].join(" "),...Z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:b.jsx(i7,{scope:n,placedSide:ne,onArrowChange:$,arrowX:G,arrowY:re,shouldHideArrow:oe,children:b.jsx(Ne.div,{"data-side":ne,"data-align":be,...x,ref:O,style:{...x.style,animation:X?void 0:"none"}})})})});RR.displayName=Ly;var AR="PopperArrow",l7={top:"bottom",right:"left",bottom:"top",left:"right"},NR=S.forwardRef(function(t,n){const{__scopePopper:o,...i}=t,l=a7(AR,o),u=l7[l.placedSide];return b.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:b.jsx(o7,{...i,ref:n,style:{...i.style,display:"block"}})})});NR.displayName=AR;function c7(e){return e!==null}var u7=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:i}=t,u=i.arrow?.centerOffset!==0,f=u?0:e.arrowWidth,h=u?0:e.arrowHeight,[p,y]=OR(n),v={start:"0%",center:"50%",end:"100%"}[y],w=(i.arrow?.x??0)+f/2,_=(i.arrow?.y??0)+h/2;let R="",x="";return p==="bottom"?(R=u?v:`${w}px`,x=`${-h}px`):p==="top"?(R=u?v:`${w}px`,x=`${o.floating.height+h}px`):p==="right"?(R=`${-h}px`,x=u?v:`${_}px`):p==="left"&&(R=`${o.floating.width+h}px`,x=u?v:`${_}px`),{data:{x:R,y:x}}}});function OR(e){const[t,n="center"]=e.split("-");return[t,n]}var Py=ER,gf=CR,$y=RR,Fy=NR,kR=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),d7="VisuallyHidden",f7=S.forwardRef((e,t)=>b.jsx(Ne.span,{...e,ref:t,style:{...kR,...e.style}}));f7.displayName=d7;var h7=[" ","Enter","ArrowUp","ArrowDown"],p7=[" ","Enter"],Gs="Select",[yf,vf,m7]=Ay(Gs),[Ra]=$r(Gs,[m7,Ca]),bf=Ca(),[g7,cs]=Ra(Gs),[y7,v7]=Ra(Gs),MR=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:i,onOpenChange:l,value:u,defaultValue:f,onValueChange:h,dir:p,name:y,autoComplete:v,disabled:w,required:_,form:R}=e,x=bf(t),[C,N]=S.useState(null),[k,O]=S.useState(null),[M,$]=S.useState(!1),V=Ny(p),[L,D]=es({prop:o,defaultProp:i??!1,onChange:l,caller:Gs}),[Y,ie]=es({prop:u,defaultProp:f,onChange:h,caller:Gs}),le=S.useRef(null),se=C?R||!!C.closest("form"):!0,[ue,ce]=S.useState(new Set),ge=Array.from(ue).map(F=>F.props.value).join(";");return b.jsx(Py,{...x,children:b.jsxs(g7,{required:_,scope:t,trigger:C,onTriggerChange:N,valueNode:k,onValueNodeChange:O,valueNodeHasChildren:M,onValueNodeHasChildrenChange:$,contentId:mr(),value:Y,onValueChange:ie,open:L,onOpenChange:D,dir:V,triggerPointerDownPosRef:le,disabled:w,children:[b.jsx(yf.Provider,{scope:t,children:b.jsx(y7,{scope:e.__scopeSelect,onNativeOptionAdd:S.useCallback(F=>{ce(X=>new Set(X).add(F))},[]),onNativeOptionRemove:S.useCallback(F=>{ce(X=>{const Z=new Set(X);return Z.delete(F),Z})},[]),children:n})}),se?b.jsxs(eA,{"aria-hidden":!0,required:_,tabIndex:-1,name:y,autoComplete:v,value:Y,onChange:F=>ie(F.target.value),disabled:w,form:R,children:[Y===void 0?b.jsx("option",{value:""}):null,Array.from(ue)]},ge):null]})})};MR.displayName=Gs;var IR="SelectTrigger",DR=S.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...i}=e,l=bf(n),u=cs(IR,n),f=u.disabled||o,h=Ze(t,u.onTriggerChange),p=vf(n),y=S.useRef("touch"),[v,w,_]=nA(x=>{const C=p().filter(O=>!O.disabled),N=C.find(O=>O.value===u.value),k=rA(C,x,N);k!==void 0&&u.onValueChange(k.value)}),R=x=>{f||(u.onOpenChange(!0),_()),x&&(u.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return b.jsx(gf,{asChild:!0,...l,children:b.jsx(Ne.button,{type:"button",role:"combobox","aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":tA(u.value)?"":void 0,...i,ref:h,onClick:me(i.onClick,x=>{x.currentTarget.focus(),y.current!=="mouse"&&R(x)}),onPointerDown:me(i.onPointerDown,x=>{y.current=x.pointerType;const C=x.target;C.hasPointerCapture(x.pointerId)&&C.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(R(x),x.preventDefault())}),onKeyDown:me(i.onKeyDown,x=>{const C=v.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&w(x.key),!(C&&x.key===" ")&&h7.includes(x.key)&&(R(),x.preventDefault())})})})});DR.displayName=IR;var jR="SelectValue",zR=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:i,children:l,placeholder:u="",...f}=e,h=cs(jR,n),{onValueNodeHasChildrenChange:p}=h,y=l!==void 0,v=Ze(t,h.onValueNodeChange);return Mt(()=>{p(y)},[p,y]),b.jsx(Ne.span,{...f,ref:v,style:{pointerEvents:"none"},children:tA(h.value)?b.jsx(b.Fragment,{children:u}):l})});zR.displayName=jR;var b7="SelectIcon",LR=S.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...i}=e;return b.jsx(Ne.span,{"aria-hidden":!0,...i,ref:t,children:o||"▼"})});LR.displayName=b7;var w7="SelectPortal",PR=e=>b.jsx(dc,{asChild:!0,...e});PR.displayName=w7;var Ys="SelectContent",$R=S.forwardRef((e,t)=>{const n=cs(Ys,e.__scopeSelect),[o,i]=S.useState();if(Mt(()=>{i(new DocumentFragment)},[]),!n.open){const l=o;return l?ga.createPortal(b.jsx(FR,{scope:e.__scopeSelect,children:b.jsx(yf.Slot,{scope:e.__scopeSelect,children:b.jsx("div",{children:e.children})})}),l):null}return b.jsx(UR,{...e,ref:t})});$R.displayName=Ys;var pr=10,[FR,us]=Ra(Ys),x7="SelectContentImpl",S7=Hs("SelectContent.RemoveScroll"),UR=S.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:l,onPointerDownOutside:u,side:f,sideOffset:h,align:p,alignOffset:y,arrowPadding:v,collisionBoundary:w,collisionPadding:_,sticky:R,hideWhenDetached:x,avoidCollisions:C,...N}=e,k=cs(Ys,n),[O,M]=S.useState(null),[$,V]=S.useState(null),L=Ze(t,J=>M(J)),[D,Y]=S.useState(null),[ie,le]=S.useState(null),se=vf(n),[ue,ce]=S.useState(!1),ge=S.useRef(!1);S.useEffect(()=>{if(O)return lf(O)},[O]),sf();const F=S.useCallback(J=>{const[_e,...Te]=se().map(je=>je.ref.current),[Ce]=Te.slice(-1),Oe=document.activeElement;for(const je of J)if(je===Oe||(je?.scrollIntoView({block:"nearest"}),je===_e&&$&&($.scrollTop=0),je===Ce&&$&&($.scrollTop=$.scrollHeight),je?.focus(),document.activeElement!==Oe))return},[se,$]),X=S.useCallback(()=>F([D,O]),[F,D,O]);S.useEffect(()=>{ue&&X()},[ue,X]);const{onOpenChange:Z,triggerPointerDownPosRef:ne}=k;S.useEffect(()=>{if(O){let J={x:0,y:0};const _e=Ce=>{J={x:Math.abs(Math.round(Ce.pageX)-(ne.current?.x??0)),y:Math.abs(Math.round(Ce.pageY)-(ne.current?.y??0))}},Te=Ce=>{J.x<=10&&J.y<=10?Ce.preventDefault():O.contains(Ce.target)||Z(!1),document.removeEventListener("pointermove",_e),ne.current=null};return ne.current!==null&&(document.addEventListener("pointermove",_e),document.addEventListener("pointerup",Te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",_e),document.removeEventListener("pointerup",Te,{capture:!0})}}},[O,Z,ne]),S.useEffect(()=>{const J=()=>Z(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[Z]);const[be,z]=nA(J=>{const _e=se().filter(Oe=>!Oe.disabled),Te=_e.find(Oe=>Oe.ref.current===document.activeElement),Ce=rA(_e,J,Te);Ce&&setTimeout(()=>Ce.ref.current.focus())}),G=S.useCallback((J,_e,Te)=>{const Ce=!ge.current&&!Te;(k.value!==void 0&&k.value===_e||Ce)&&(Y(J),Ce&&(ge.current=!0))},[k.value]),re=S.useCallback(()=>O?.focus(),[O]),oe=S.useCallback((J,_e,Te)=>{const Ce=!ge.current&&!Te;(k.value!==void 0&&k.value===_e||Ce)&&le(J)},[k.value]),de=o==="popper"?cg:BR,ve=de===cg?{side:f,sideOffset:h,align:p,alignOffset:y,arrowPadding:v,collisionBoundary:w,collisionPadding:_,sticky:R,hideWhenDetached:x,avoidCollisions:C}:{};return b.jsx(FR,{scope:n,content:O,viewport:$,onViewportChange:V,itemRefCallback:G,selectedItem:D,onItemLeave:re,itemTextRefCallback:oe,focusSelectedItem:X,selectedItemText:ie,position:o,isPositioned:ue,searchRef:be,children:b.jsx(fc,{as:S7,allowPinchZoom:!0,children:b.jsx(uc,{asChild:!0,trapped:k.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:me(i,J=>{k.trigger?.focus({preventScroll:!0}),J.preventDefault()}),children:b.jsx(cc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:b.jsx(de,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:J=>J.preventDefault(),...N,...ve,onPlaced:()=>ce(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:me(N.onKeyDown,J=>{const _e=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!_e&&J.key.length===1&&z(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let Ce=se().filter(Oe=>!Oe.disabled).map(Oe=>Oe.ref.current);if(["ArrowUp","End"].includes(J.key)&&(Ce=Ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const Oe=J.target,je=Ce.indexOf(Oe);Ce=Ce.slice(je+1)}setTimeout(()=>F(Ce)),J.preventDefault()}})})})})})})});UR.displayName=x7;var _7="SelectItemAlignedPosition",BR=S.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...i}=e,l=cs(Ys,n),u=us(Ys,n),[f,h]=S.useState(null),[p,y]=S.useState(null),v=Ze(t,L=>y(L)),w=vf(n),_=S.useRef(!1),R=S.useRef(!0),{viewport:x,selectedItem:C,selectedItemText:N,focusSelectedItem:k}=u,O=S.useCallback(()=>{if(l.trigger&&l.valueNode&&f&&p&&x&&C&&N){const L=l.trigger.getBoundingClientRect(),D=p.getBoundingClientRect(),Y=l.valueNode.getBoundingClientRect(),ie=N.getBoundingClientRect();if(l.dir!=="rtl"){const Oe=ie.left-D.left,je=Y.left-Oe,ht=L.left-je,It=L.width+ht,An=Math.max(It,D.width),qn=window.innerWidth-pr,Xt=d_(je,[pr,Math.max(pr,qn-An)]);f.style.minWidth=It+"px",f.style.left=Xt+"px"}else{const Oe=D.right-ie.right,je=window.innerWidth-Y.right-Oe,ht=window.innerWidth-L.right-je,It=L.width+ht,An=Math.max(It,D.width),qn=window.innerWidth-pr,Xt=d_(je,[pr,Math.max(pr,qn-An)]);f.style.minWidth=It+"px",f.style.right=Xt+"px"}const le=w(),se=window.innerHeight-pr*2,ue=x.scrollHeight,ce=window.getComputedStyle(p),ge=parseInt(ce.borderTopWidth,10),F=parseInt(ce.paddingTop,10),X=parseInt(ce.borderBottomWidth,10),Z=parseInt(ce.paddingBottom,10),ne=ge+F+ue+Z+X,be=Math.min(C.offsetHeight*5,ne),z=window.getComputedStyle(x),G=parseInt(z.paddingTop,10),re=parseInt(z.paddingBottom,10),oe=L.top+L.height/2-pr,de=se-oe,ve=C.offsetHeight/2,J=C.offsetTop+ve,_e=ge+F+J,Te=ne-_e;if(_e<=oe){const Oe=le.length>0&&C===le[le.length-1].ref.current;f.style.bottom="0px";const je=p.clientHeight-x.offsetTop-x.offsetHeight,ht=Math.max(de,ve+(Oe?re:0)+je+X),It=_e+ht;f.style.height=It+"px"}else{const Oe=le.length>0&&C===le[0].ref.current;f.style.top="0px";const ht=Math.max(oe,ge+x.offsetTop+(Oe?G:0)+ve)+Te;f.style.height=ht+"px",x.scrollTop=_e-oe+x.offsetTop}f.style.margin=`${pr}px 0`,f.style.minHeight=be+"px",f.style.maxHeight=se+"px",o?.(),requestAnimationFrame(()=>_.current=!0)}},[w,l.trigger,l.valueNode,f,p,x,C,N,l.dir,o]);Mt(()=>O(),[O]);const[M,$]=S.useState();Mt(()=>{p&&$(window.getComputedStyle(p).zIndex)},[p]);const V=S.useCallback(L=>{L&&R.current===!0&&(O(),k?.(),R.current=!1)},[O,k]);return b.jsx(T7,{scope:n,contentWrapper:f,shouldExpandOnScrollRef:_,onScrollButtonChange:V,children:b.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:b.jsx(Ne.div,{...i,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});BR.displayName=_7;var E7="SelectPopperPosition",cg=S.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:i=pr,...l}=e,u=bf(n);return b.jsx($y,{...u,...l,ref:t,align:o,collisionPadding:i,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});cg.displayName=E7;var[T7,Uy]=Ra(Ys,{}),ug="SelectViewport",qR=S.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...i}=e,l=us(ug,n),u=Uy(ug,n),f=Ze(t,l.onViewportChange),h=S.useRef(0);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),b.jsx(yf.Slot,{scope:n,children:b.jsx(Ne.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:me(i.onScroll,p=>{const y=p.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:w}=u;if(w?.current&&v){const _=Math.abs(h.current-y.scrollTop);if(_>0){const R=window.innerHeight-pr*2,x=parseFloat(v.style.minHeight),C=parseFloat(v.style.height),N=Math.max(x,C);if(N<R){const k=N+_,O=Math.min(R,k),M=k-O;v.style.height=O+"px",v.style.bottom==="0px"&&(y.scrollTop=M>0?M:0,v.style.justifyContent="flex-end")}}}h.current=y.scrollTop})})})]})});qR.displayName=ug;var VR="SelectGroup",[C7,R7]=Ra(VR),A7=S.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,i=mr();return b.jsx(C7,{scope:n,id:i,children:b.jsx(Ne.div,{role:"group","aria-labelledby":i,...o,ref:t})})});A7.displayName=VR;var HR="SelectLabel",N7=S.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,i=R7(HR,n);return b.jsx(Ne.div,{id:i.id,...o,ref:t})});N7.displayName=HR;var zd="SelectItem",[O7,ZR]=Ra(zd),QR=S.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:i=!1,textValue:l,...u}=e,f=cs(zd,n),h=us(zd,n),p=f.value===o,[y,v]=S.useState(l??""),[w,_]=S.useState(!1),R=Ze(t,k=>h.itemRefCallback?.(k,o,i)),x=mr(),C=S.useRef("touch"),N=()=>{i||(f.onValueChange(o),f.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return b.jsx(O7,{scope:n,value:o,disabled:i,textId:x,isSelected:p,onItemTextChange:S.useCallback(k=>{v(O=>O||(k?.textContent??"").trim())},[]),children:b.jsx(yf.ItemSlot,{scope:n,value:o,disabled:i,textValue:y,children:b.jsx(Ne.div,{role:"option","aria-labelledby":x,"data-highlighted":w?"":void 0,"aria-selected":p&&w,"data-state":p?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...u,ref:R,onFocus:me(u.onFocus,()=>_(!0)),onBlur:me(u.onBlur,()=>_(!1)),onClick:me(u.onClick,()=>{C.current!=="mouse"&&N()}),onPointerUp:me(u.onPointerUp,()=>{C.current==="mouse"&&N()}),onPointerDown:me(u.onPointerDown,k=>{C.current=k.pointerType}),onPointerMove:me(u.onPointerMove,k=>{C.current=k.pointerType,i?h.onItemLeave?.():C.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:me(u.onPointerLeave,k=>{k.currentTarget===document.activeElement&&h.onItemLeave?.()}),onKeyDown:me(u.onKeyDown,k=>{h.searchRef?.current!==""&&k.key===" "||(p7.includes(k.key)&&N(),k.key===" "&&k.preventDefault())})})})})});QR.displayName=zd;var Il="SelectItemText",GR=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:i,...l}=e,u=cs(Il,n),f=us(Il,n),h=ZR(Il,n),p=v7(Il,n),[y,v]=S.useState(null),w=Ze(t,N=>v(N),h.onItemTextChange,N=>f.itemTextRefCallback?.(N,h.value,h.disabled)),_=y?.textContent,R=S.useMemo(()=>b.jsx("option",{value:h.value,disabled:h.disabled,children:_},h.value),[h.disabled,h.value,_]),{onNativeOptionAdd:x,onNativeOptionRemove:C}=p;return Mt(()=>(x(R),()=>C(R)),[x,C,R]),b.jsxs(b.Fragment,{children:[b.jsx(Ne.span,{id:h.textId,...l,ref:w}),h.isSelected&&u.valueNode&&!u.valueNodeHasChildren?ga.createPortal(l.children,u.valueNode):null]})});GR.displayName=Il;var YR="SelectItemIndicator",KR=S.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return ZR(YR,n).isSelected?b.jsx(Ne.span,{"aria-hidden":!0,...o,ref:t}):null});KR.displayName=YR;var dg="SelectScrollUpButton",XR=S.forwardRef((e,t)=>{const n=us(dg,e.__scopeSelect),o=Uy(dg,e.__scopeSelect),[i,l]=S.useState(!1),u=Ze(t,o.onScrollButtonChange);return Mt(()=>{if(n.viewport&&n.isPositioned){let f=function(){const p=h.scrollTop>0;l(p)};const h=n.viewport;return f(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,n.isPositioned]),i?b.jsx(WR,{...e,ref:u,onAutoScroll:()=>{const{viewport:f,selectedItem:h}=n;f&&h&&(f.scrollTop=f.scrollTop-h.offsetHeight)}}):null});XR.displayName=dg;var fg="SelectScrollDownButton",JR=S.forwardRef((e,t)=>{const n=us(fg,e.__scopeSelect),o=Uy(fg,e.__scopeSelect),[i,l]=S.useState(!1),u=Ze(t,o.onScrollButtonChange);return Mt(()=>{if(n.viewport&&n.isPositioned){let f=function(){const p=h.scrollHeight-h.clientHeight,y=Math.ceil(h.scrollTop)<p;l(y)};const h=n.viewport;return f(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,n.isPositioned]),i?b.jsx(WR,{...e,ref:u,onAutoScroll:()=>{const{viewport:f,selectedItem:h}=n;f&&h&&(f.scrollTop=f.scrollTop+h.offsetHeight)}}):null});JR.displayName=fg;var WR=S.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...i}=e,l=us("SelectScrollButton",n),u=S.useRef(null),f=vf(n),h=S.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},[]);return S.useEffect(()=>()=>h(),[h]),Mt(()=>{f().find(y=>y.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[f]),b.jsx(Ne.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:me(i.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(o,50))}),onPointerMove:me(i.onPointerMove,()=>{l.onItemLeave?.(),u.current===null&&(u.current=window.setInterval(o,50))}),onPointerLeave:me(i.onPointerLeave,()=>{h()})})}),k7="SelectSeparator",M7=S.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return b.jsx(Ne.div,{"aria-hidden":!0,...o,ref:t})});M7.displayName=k7;var hg="SelectArrow",I7=S.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,i=bf(n),l=cs(hg,n),u=us(hg,n);return l.open&&u.position==="popper"?b.jsx(Fy,{...i,...o,ref:t}):null});I7.displayName=hg;var D7="SelectBubbleInput",eA=S.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const i=S.useRef(null),l=Ze(o,i),u=eR(t);return S.useEffect(()=>{const f=i.current;if(!f)return;const h=window.HTMLSelectElement.prototype,y=Object.getOwnPropertyDescriptor(h,"value").set;if(u!==t&&y){const v=new Event("change",{bubbles:!0});y.call(f,t),f.dispatchEvent(v)}},[u,t]),b.jsx(Ne.select,{...n,style:{...kR,...n.style},ref:l,defaultValue:t})});eA.displayName=D7;function tA(e){return e===""||e===void 0}function nA(e){const t=vr(e),n=S.useRef(""),o=S.useRef(0),i=S.useCallback(u=>{const f=n.current+u;t(f),(function h(p){n.current=p,window.clearTimeout(o.current),p!==""&&(o.current=window.setTimeout(()=>h(""),1e3))})(f)},[t]),l=S.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,i,l]}function rA(e,t,n){const i=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let u=j7(e,Math.max(l,0));i.length===1&&(u=u.filter(p=>p!==n));const h=u.find(p=>p.textValue.toLowerCase().startsWith(i.toLowerCase()));return h!==n?h:void 0}function j7(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var z7=MR,L7=DR,P7=zR,$7=LR,F7=PR,U7=$R,B7=qR,q7=QR,V7=GR,H7=KR,Z7=XR,Q7=JR;function Cm({...e}){return b.jsx(z7,{"data-slot":"select",...e})}function Rm({...e}){return b.jsx(P7,{"data-slot":"select-value",...e})}function Am({className:e,size:t="default",children:n,...o}){return b.jsxs(L7,{"data-slot":"select-trigger","data-size":t,className:De("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o,children:[n,b.jsx($7,{asChild:!0,children:b.jsx(Js,{className:"size-4 opacity-50"})})]})}function Nm({className:e,children:t,position:n="item-aligned",align:o="center",...i}){return b.jsx(F7,{children:b.jsxs(U7,{"data-slot":"select-content",className:De("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:o,...i,children:[b.jsx(G7,{}),b.jsx(B7,{className:De("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),b.jsx(Y7,{})]})})}function Al({className:e,children:t,...n}){return b.jsxs(q7,{"data-slot":"select-item",className:De("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[b.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:b.jsx(H7,{children:b.jsx(m1,{className:"size-4"})})}),b.jsx(V7,{children:t})]})}function G7({className:e,...t}){return b.jsx(Z7,{"data-slot":"select-scroll-up-button",className:De("flex cursor-default items-center justify-center py-1",e),...t,children:b.jsx(g1,{className:"size-4"})})}function Y7({className:e,...t}){return b.jsx(Q7,{"data-slot":"select-scroll-down-button",className:De("flex cursor-default items-center justify-center py-1",e),...t,children:b.jsx(Js,{className:"size-4"})})}function K7({isOpen:e,onClose:t,breakingChanges:n,onForceUpdate:o,onCancel:i,isLoading:l}){const u=()=>{i(),t()};return b.jsx(Cy,{open:e,onOpenChange:f=>!f&&!l&&u(),title:"Breaking Changes Detected",size:"lg",footer:b.jsxs(b.Fragment,{children:[b.jsx(co,{variant:"outline",onClick:u,disabled:l,children:"Cancel"}),b.jsx(co,{variant:"danger",onClick:o,loading:l,children:"Force Update"})]}),children:b.jsxs("div",{className:"space-y-4",children:[b.jsxs("div",{className:"diff-modified flex items-start gap-3 rounded-lg border p-3",children:[b.jsx(f3,{className:"mt-0.5 size-5 shrink-0 text-diff-modified"}),b.jsxs("div",{className:"space-y-1",children:[b.jsx("p",{className:"text-sm font-medium text-diff-modified",children:"These changes may affect existing content"}),b.jsx("p",{className:"text-sm text-diff-modified-foreground",children:"The following changes could cause data loss or validation errors for existing entries. Review carefully before proceeding."})]})]}),b.jsxs("div",{className:"space-y-2",children:[b.jsxs("p",{className:"text-sm font-medium text-foreground",children:[n.length," breaking change",n.length!==1?"s":""," detected:"]}),b.jsx("ul",{className:"space-y-2",children:n.map((f,h)=>b.jsxs("li",{className:"flex items-start gap-2 rounded-md border bg-muted/30 px-3 py-2 text-sm",children:[b.jsx("span",{className:"mt-0.5 size-1.5 shrink-0 rounded-full bg-warning"}),b.jsx("span",{className:"text-muted-foreground",children:f})]},h))})]}),b.jsx("p",{className:"text-xs text-muted-foreground",children:'Click "Force Update" to apply these changes anyway, or "Cancel" to go back and modify your changes.'})]})})}const Om={text:{label:"Text",icon:b.jsx(a3,{className:"size-4"}),description:"Single line text input"},richText:{label:"Rich Text",icon:b.jsx(lP,{className:"size-4"}),description:"Multi-line formatted text"},number:{label:"Number",icon:b.jsx(v1,{className:"size-4"}),description:"Numeric value"},boolean:{label:"Boolean",icon:b.jsx(_1,{className:"size-4"}),description:"True/false toggle"},date:{label:"Date",icon:b.jsx(qm,{className:"size-4"}),description:"Date picker"},datetime:{label:"Date & Time",icon:b.jsx(qm,{className:"size-4"}),description:"Date and time picker"},reference:{label:"Reference",icon:b.jsx(CP,{className:"size-4"}),description:"Link to another content entry"},media:{label:"Media",icon:b.jsx(w1,{className:"size-4"}),description:"Image, video, or file"},json:{label:"JSON",icon:b.jsx(p1,{className:"size-4"}),description:"Custom JSON data"},select:{label:"Select",icon:b.jsx(Js,{className:"size-4"}),description:"Dropdown selection"},multiSelect:{label:"Multi-Select",icon:b.jsx(OP,{className:"size-4"}),description:"Multiple selections"},tags:{label:"Tags",icon:b.jsx(r3,{className:"size-4"}),description:"Free-form tag list"},category:{label:"Category",icon:b.jsx(fP,{className:"size-4"}),description:"Taxonomy category selection"}};function __(e){return e.toLowerCase().trim().replace(/[^a-z0-9\s]/g,"").replace(/\s+/g,"_").replace(/^[0-9]/,"_$&").slice(0,64)}function E_(e){return/^[a-z][a-z0-9_]{0,63}$/.test(e)}function X7({isOpen:e,onClose:t,onCreated:n,onUpdated:o,contentType:i}){const l=!!i,u=i?.source==="code",f=u,[h,p]=S.useState(""),[y,v]=S.useState(""),[w,_]=S.useState(!1),[R,x]=S.useState(""),[C,N]=S.useState(!1),[k,O]=S.useState([{name:"title",label:"Title",type:"text",required:!0}]),[M,$]=S.useState("title"),[V,L]=S.useState("title"),[D,Y]=S.useState(!1),[ie,le]=S.useState(null),[se,ue]=S.useState(null),[ce,ge]=S.useState(!1),[F,X]=S.useState([]),[Z,ne]=S.useState(!1),[be,z]=S.useState(!1),G=vC(),re=Xx(G.createContentType),oe=Xx(G.updateContentType);S.useEffect(()=>{i&&e&&(p(i.displayName),v(i.name),_(!0),x(i.description||""),N(i.singleton||!1),O(i.fields),$(i.titleField||""),L(i.slugField||""))},[i,e]);const de=S.useCallback(()=>{p(""),v(""),_(!1),x(""),N(!1),O([{name:"title",label:"Title",type:"text",required:!0}]),$("title"),L("title"),Y(!1),le(null),ue(null),ge(!1),X([]),ne(!1),z(!1)},[]),ve=S.useCallback(ae=>{p(ae),w||v(__(ae))},[w]),J=S.useCallback(ae=>{_(!0),v(ae.toLowerCase().replace(/[^a-z0-9_]/g,""))},[]),_e=S.useCallback(()=>{const ae=`field_${k.length+1}`;O(ke=>[...ke,{name:ae,label:`Field ${ke.length+1}`,type:"text",required:!1}]),ue(k.length),ge(!0)},[k.length]),Te=S.useCallback(ae=>{const ke=k[ae];if(O(Ue=>Ue.filter((ze,Ut)=>Ut!==ae)),M===ke.name){const Ue=k.find((ze,Ut)=>Ut!==ae&&ze.type==="text");$(Ue?.name||"")}if(V===ke.name){const Ue=k.find((ze,Ut)=>Ut!==ae&&ze.type==="text");L(Ue?.name||"")}se===ae?(ue(null),ge(!1)):se!==null&&se>ae&&ue(se-1)},[k,se,M,V]),Ce=S.useCallback((ae,ke)=>{O(Ue=>Ue.map((ze,Ut)=>Ut===ae?{...ze,...ke}:ze))},[]),Oe=S.useCallback((ae,ke)=>{O(Ue=>{const ze=[...Ue],[Ut]=ze.splice(ae,1);return ze.splice(ke,0,Ut),ze}),ue(ke)},[]),je=S.useMemo(()=>{const ae=[];h.trim()||ae.push("Display name is required"),y.trim()?E_(y)||ae.push("System Name must start with a letter and contain only lowercase letters, numbers, and underscores"):ae.push("System Name is required"),k.length===0&&ae.push("At least one field is required");const ke=k.map(ze=>ze.name),Ue=ke.filter((ze,Ut)=>ke.indexOf(ze)!==Ut);Ue.length>0&&ae.push(`Duplicate field names: ${[...new Set(Ue)].join(", ")}`);for(const ze of k)ze.name.trim()?/^[a-z][a-z0-9_]{0,63}$/.test(ze.name)||ae.push(`Field "${ze.name}" has an invalid name format`):ae.push(`Field "${ze.label}" has an empty name`),ze.label.trim()||ae.push(`Field with name "${ze.name}" has an empty label`),(ze.type==="select"||ze.type==="multiSelect")&&(!ze.options?.options||ze.options.options.length===0)&&ae.push(`${ze.type} field "${ze.label}" requires at least one option`);return ae},[h,y,k]),ht=S.useMemo(()=>k.filter(ae=>ae.type==="text"),[k]),It=ae=>ae.split(`
107
+ `).filter(Ue=>Ue.trim().startsWith("-")).map(Ue=>Ue.trim().substring(2)),An=S.useCallback(async(ae,ke=!1)=>{if(ae.preventDefault(),je.length>0){le(je.join(". "));return}Y(!0),le(null);try{if(l&&i){const Ue=await oe({id:i._id,displayName:h.trim(),description:R.trim()||void 0,fields:k,singleton:C,titleField:M||void 0,slugField:V||void 0,force:ke});o?.(Ue),de(),t()}else{const Ue=await re({name:y,displayName:h.trim(),description:R.trim()||void 0,fields:k,singleton:C,titleField:M||void 0,slugField:V||void 0});n?.(Ue),de(),t()}}catch(Ue){const ze=Ue instanceof Error?Ue.message:l?"Failed to update content type":"Failed to create content type";if(l&&!ke&&ze.includes("breaking change")){const Ut=It(ze);X(Ut),ne(!0)}else le(ze)}finally{Y(!1)}},[je,l,i,re,oe,y,h,R,k,C,M,V,n,o,de,t]),qn=S.useCallback(async()=>{z(!0);try{if(i){const ae=await oe({id:i._id,displayName:h.trim(),description:R.trim()||void 0,fields:k,singleton:C,titleField:M||void 0,slugField:V||void 0,force:!0});o?.(ae),de(),ne(!1),t()}}catch(ae){const ke=ae instanceof Error?ae.message:"Failed to update content type";le(ke),ne(!1)}finally{z(!1)}},[i,oe,h,R,k,C,M,V,o,de,t]),Xt=S.useCallback(()=>{D||(de(),t())},[D,de,t]);if(!e)return null;const _t=se!==null?k[se]:null;return b.jsxs(b.Fragment,{children:[b.jsx(Cy,{open:e,onOpenChange:ae=>!ae&&Xt(),title:u?"View Content Type":l?"Edit Content Type":"Create Content Type",size:"2xl",footer:f?b.jsx(co,{variant:"outline",onClick:Xt,children:"Close"}):b.jsxs(b.Fragment,{children:[b.jsx(co,{variant:"outline",onClick:Xt,disabled:D,children:"Cancel"}),b.jsx(co,{variant:"primary",onClick:An,disabled:je.length>0,loading:D,"data-testid":l?"update-content-type-submit":"create-content-type-submit",children:l?"Save Changes":"Create Content Type"})]}),children:b.jsxs("form",{onSubmit:An,className:"space-y-6",children:[u&&b.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-violet-200 bg-violet-50 p-3",children:[b.jsx(GL,{className:"mt-0.5 size-5 shrink-0 text-violet-600"}),b.jsxs("div",{className:"space-y-1",children:[b.jsx("p",{className:"text-sm font-medium text-violet-900",children:"Managed by Code"}),b.jsx("p",{className:"text-sm text-violet-700",children:"This content type is defined in your codebase and cannot be edited through the admin interface. To make changes, update the definition in your code."})]})]}),b.jsxs("div",{className:"space-y-4",children:[b.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"Basic Information"}),b.jsxs("div",{className:"space-y-2",children:[b.jsxs(tr,{htmlFor:"displayName",children:["Display Name ",b.jsx("span",{className:"text-destructive",children:"*"})]}),b.jsx(Is,{id:"displayName",value:h,onChange:ae=>ve(ae.target.value),placeholder:"e.g., Blog Post",disabled:D||f,autoFocus:!f,"data-testid":"display-name-input"})]}),b.jsxs("div",{className:"space-y-2",children:[b.jsxs(tr,{htmlFor:"machineName",children:["System Name ",b.jsx("span",{className:"text-destructive",children:"*"})]}),b.jsx(Is,{id:"machineName",value:y,onChange:ae=>J(ae.target.value),placeholder:"e.g., blog_post",disabled:D||l||f,className:De(!E_(y)&&y&&"border-destructive"),"data-testid":"machine-name-input"}),b.jsx("p",{className:"text-xs text-muted-foreground",children:l?"System name cannot be changed after creation":"Lowercase letters, numbers, and underscores only. Used in API queries."})]}),b.jsxs("div",{className:"space-y-2",children:[b.jsx(tr,{htmlFor:"description",children:"Description"}),b.jsx(FV,{id:"description",value:R,onChange:ae=>x(ae.target.value),placeholder:"Optional description of this content type",disabled:D||f,rows:2})]}),b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(u_,{id:"singleton",checked:C,onCheckedChange:ae=>N(ae),disabled:D||f}),b.jsx(tr,{htmlFor:"singleton",className:"cursor-pointer",children:"Singleton (only one entry allowed)"})]})]}),b.jsxs("div",{className:"space-y-4",children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"Fields"}),!f&&b.jsxs(co,{type:"button",variant:"secondary",size:"sm",onClick:_e,disabled:D,"data-testid":"add-field-button",children:[b.jsx(S1,{className:"size-3.5"}),"Add Field"]})]}),b.jsx("div",{className:"space-y-2",children:k.map((ae,ke)=>b.jsxs("div",{className:De("flex items-center gap-2 rounded-lg border p-2 transition-colors",!f&&"cursor-pointer hover:bg-muted/50",se===ke&&"border-primary bg-primary/5"),onClick:()=>{f||(ue(ke),ge(!0))},"data-testid":`field-item-${ke}`,children:[!f&&b.jsxs("div",{className:"flex flex-col gap-0.5",children:[ke>0&&b.jsx("button",{type:"button",onClick:Ue=>{Ue.stopPropagation(),Oe(ke,ke-1)},className:"rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",children:b.jsx(g1,{className:"size-3"})}),ke<k.length-1&&b.jsx("button",{type:"button",onClick:Ue=>{Ue.stopPropagation(),Oe(ke,ke+1)},className:"rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",children:b.jsx(Js,{className:"size-3"})})]}),b.jsx("div",{className:"flex size-8 items-center justify-center rounded bg-muted text-muted-foreground",children:Om[ae.type].icon}),b.jsxs("div",{className:"min-w-0 flex-1",children:[b.jsx("p",{className:"truncate text-sm font-medium",children:ae.label}),b.jsxs("p",{className:"text-xs text-muted-foreground",children:[Om[ae.type].label,ae.required&&" *"]})]}),!f&&b.jsx("button",{type:"button",onClick:Ue=>{Ue.stopPropagation(),Te(ke)},disabled:D||k.length===1,className:"rounded p-1 text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive disabled:opacity-50",children:b.jsx(Sd,{className:"size-4"})})]},ke))}),!f&&ce&&_t&&se!==null&&b.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4","data-testid":"field-editor",children:[b.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[b.jsxs("h5",{className:"font-medium",children:["Edit Field: ",_t.label]}),b.jsx("button",{type:"button",onClick:()=>{ge(!1),ue(null)},className:"rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",children:b.jsx(Sd,{className:"size-4"})})]}),b.jsxs("div",{className:"space-y-4",children:[b.jsxs("div",{className:"space-y-2",children:[b.jsxs(tr,{htmlFor:"fieldLabel",children:["Label ",b.jsx("span",{className:"text-destructive",children:"*"})]}),b.jsx(Is,{id:"fieldLabel",value:_t.label,onChange:ae=>Ce(se,{label:ae.target.value,name:w?_t.name:__(ae.target.value)||_t.name}),disabled:D,"data-testid":"field-label-input"})]}),b.jsxs("div",{className:"space-y-2",children:[b.jsxs(tr,{htmlFor:"fieldName",children:["Name ",b.jsx("span",{className:"text-destructive",children:"*"})]}),b.jsx(Is,{id:"fieldName",value:_t.name,onChange:ae=>Ce(se,{name:ae.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"")}),disabled:D,"data-testid":"field-name-input"})]}),b.jsxs("div",{className:"space-y-2",children:[b.jsxs(tr,{htmlFor:"fieldType",children:["Type ",b.jsx("span",{className:"text-destructive",children:"*"})]}),b.jsxs(Cm,{value:_t.type,onValueChange:ae=>Ce(se,{type:ae,options:void 0}),disabled:D,children:[b.jsx(Am,{"data-testid":"field-type-select",children:b.jsx(Rm,{})}),b.jsx(Nm,{children:Object.entries(Om).map(([ae,ke])=>b.jsx(Al,{value:ae,children:b.jsxs("div",{className:"flex items-center gap-2",children:[ke.icon,b.jsx("span",{children:ke.label}),b.jsxs("span",{className:"text-muted-foreground",children:["- ",ke.description]})]})},ae))})]})]}),b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(u_,{id:"fieldRequired",checked:_t.required,onCheckedChange:ae=>Ce(se,{required:ae}),disabled:D}),b.jsx(tr,{htmlFor:"fieldRequired",className:"cursor-pointer",children:"Required"})]}),b.jsxs("div",{className:"space-y-2",children:[b.jsx(tr,{htmlFor:"fieldDescription",children:"Help Text"}),b.jsx(Is,{id:"fieldDescription",value:_t.description||"",onChange:ae=>Ce(se,{description:ae.target.value||void 0}),placeholder:"Help text shown below the field",disabled:D})]}),(_t.type==="select"||_t.type==="multiSelect")&&b.jsx(J7,{options:_t.options?.options||[],onChange:ae=>Ce(se,{options:{..._t.options,options:ae}}),disabled:D})]})]})]}),ht.length>0&&b.jsxs("div",{className:"space-y-4",children:[b.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"Display Settings"}),b.jsxs("div",{className:"space-y-2",children:[b.jsx(tr,{htmlFor:"titleField",children:"Title Field"}),b.jsxs(Cm,{value:M||"none",onValueChange:ae=>$(ae==="none"?"":ae),disabled:D,children:[b.jsx(Am,{children:b.jsx(Rm,{placeholder:"None"})}),b.jsxs(Nm,{children:[b.jsx(Al,{value:"none",children:"None"}),ht.map(ae=>b.jsx(Al,{value:ae.name,children:ae.label},ae.name))]})]}),b.jsx("p",{className:"text-xs text-muted-foreground",children:"Field to display as the entry title in lists"})]}),b.jsxs("div",{className:"space-y-2",children:[b.jsx(tr,{htmlFor:"slugField",children:"Slug Field"}),b.jsxs(Cm,{value:V||"none",onValueChange:ae=>L(ae==="none"?"":ae),disabled:D,children:[b.jsx(Am,{children:b.jsx(Rm,{placeholder:"None (auto-generate)"})}),b.jsxs(Nm,{children:[b.jsx(Al,{value:"none",children:"None (auto-generate)"}),ht.map(ae=>b.jsx(Al,{value:ae.name,children:ae.label},ae.name))]})]}),b.jsx("p",{className:"text-xs text-muted-foreground",children:"Field to use for generating URL-friendly slugs"})]})]}),ie&&b.jsx("div",{className:"diff-removed rounded-lg border px-3 py-2 text-sm",role:"alert","data-testid":"submit-error",children:ie})]})}),b.jsx(K7,{isOpen:Z,onClose:()=>ne(!1),breakingChanges:F,onForceUpdate:qn,onCancel:()=>{ne(!1),X([])},isLoading:be})]})}function J7({options:e,onChange:t,disabled:n}){const o=()=>{t([...e,{value:`option_${e.length+1}`,label:""}])},i=u=>{t(e.filter((f,h)=>h!==u))},l=(u,f)=>{t(e.map((h,p)=>p===u?{...h,...f}:h))};return b.jsxs("div",{className:"space-y-2",children:[b.jsxs(tr,{children:["Options ",b.jsx("span",{className:"text-destructive",children:"*"})]}),b.jsx("div",{className:"space-y-2",children:e.map((u,f)=>b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(Is,{value:u.label,onChange:h=>{const p=h.target.value,y=p.toLowerCase().replace(/[^a-z0-9]/g,"_").replace(/^_+|_+$/g,"");l(f,{label:p,value:y})},placeholder:"Option label",disabled:n,className:"flex-1"}),b.jsx(Is,{value:u.value,onChange:h=>l(f,{value:h.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"")}),placeholder:"value",disabled:n,className:"w-32"}),b.jsx("button",{type:"button",onClick:()=>i(f),disabled:n,className:"rounded p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:b.jsx(Sd,{className:"size-4"})})]},f))}),b.jsxs(co,{type:"button",variant:"secondary",size:"sm",onClick:o,disabled:n,children:[b.jsx(S1,{className:"size-3.5"}),"Add Option"]})]})}function W7(){const t=xt().location.pathname,n=by(),{navItems:o,branding:i,layout:l}=n,u=vC(),[f,h]=S.useState(!1),p=f1(u.listContentTypes,{isActive:!0}),y=p?.page??[],v=(C,N)=>N?t===C:t.startsWith(C),w=t==="/content"||t.startsWith("/entries/type/")||t.startsWith("/entries/new/")||t.startsWith("/entries/"),_=C=>C.id==="content"?R(C):b.jsxs(Ls,{to:C.path,className:De("flex items-center gap-3 rounded-md px-2 py-2 text-sm font-medium transition-colors",v(C.path,C.exact)?"bg-sidebar-accent text-sidebar-accent-foreground":"text-sidebar-foreground hover:bg-sidebar-accent/50 hover:text-sidebar-accent-foreground"),children:[b.jsx(QS,{name:C.icon,className:"size-5"}),b.jsx("span",{className:"flex-1",children:C.label}),C.badge&&b.jsx("span",{className:"rounded-full bg-sidebar-primary px-2 py-0.5 text-xs text-sidebar-primary-foreground",children:C.badge})]},C.id),R=C=>b.jsxs(Yq,{defaultOpen:w,children:[b.jsxs(Kq,{className:De("flex w-full items-center gap-3 rounded-md px-2 py-2 text-sm font-medium transition-colors",w?"bg-sidebar-accent text-sidebar-accent-foreground":"text-sidebar-foreground hover:bg-sidebar-accent/50 hover:text-sidebar-accent-foreground","group"),children:[b.jsx(QS,{name:C.icon,className:"size-5"}),b.jsx("span",{className:"flex-1 text-left",children:C.label}),b.jsx(Js,{className:"size-4 transition-transform duration-200 group-data-[state=open]:rotate-180"})]}),b.jsx(Xq,{children:b.jsxs("div",{className:"ml-5 mt-1 space-y-1 border-l border-sidebar-border pl-3",children:[b.jsx(Ls,{to:"/content",className:De("flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors",t==="/content"?"bg-sidebar-accent/60 text-sidebar-accent-foreground":"text-sidebar-foreground/80 hover:bg-sidebar-accent/30 hover:text-sidebar-accent-foreground"),children:"All Entries"}),y.map(N=>b.jsx(Ls,{to:"/entries/type/$contentTypeId",params:{contentTypeId:N._id},className:De("flex items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors",t===`/entries/type/${N._id}`?"bg-sidebar-accent/60 text-sidebar-accent-foreground":"text-sidebar-foreground/80 hover:bg-sidebar-accent/30 hover:text-sidebar-accent-foreground"),children:N.displayName},N._id)),y.length===0&&p!==void 0&&b.jsx("button",{type:"button",onClick:()=>h(!0),className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-sidebar-foreground/60 hover:bg-sidebar-accent/30 hover:text-sidebar-accent-foreground",children:"+ Create content type"})]})})]},C.id),x=l.sidebarWidth;return b.jsxs(b.Fragment,{children:[b.jsxs("aside",{className:"fixed inset-y-0 left-0 z-50 flex flex-col border-r border-sidebar-border bg-sidebar",style:{width:x},children:[b.jsx("div",{className:"flex h-14 items-center gap-2 border-b border-sidebar-border px-4",children:b.jsxs(Ls,{to:"/",className:"flex items-center gap-2 font-semibold text-sidebar-foreground",children:[i.logo?b.jsx("img",{src:i.logo,alt:i.appName,className:"size-8"}):b.jsx("div",{className:"flex size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground",children:b.jsx(x1,{className:"size-4"})}),b.jsx("span",{className:"text-base",children:i.appName})]})}),b.jsxs("nav",{className:"flex-1 space-y-6 overflow-y-auto p-4",children:[o.main.length>0&&b.jsxs("div",{className:"space-y-1",children:[b.jsx("span",{className:"px-2 text-xs font-medium uppercase tracking-wider text-sidebar-foreground/60",children:"Main"}),b.jsx("div",{className:"space-y-1 pt-2",children:o.main.map(_)})]}),o.config.length>0&&b.jsxs("div",{className:"space-y-1",children:[b.jsx("span",{className:"px-2 text-xs font-medium uppercase tracking-wider text-sidebar-foreground/60",children:"Configuration"}),b.jsx("div",{className:"space-y-1 pt-2",children:o.config.map(_)})]})]}),b.jsx("div",{className:"border-t border-sidebar-border p-4",children:b.jsxs("div",{className:"flex items-center justify-between text-xs text-sidebar-foreground/60",children:[b.jsx("span",{children:"Version"}),b.jsx("span",{className:"font-mono",children:"0.1.0"})]})})]}),b.jsx(X7,{isOpen:f,onClose:()=>h(!1)})]})}function eH({...e}){return b.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function tH({className:e,...t}){return b.jsx("ol",{"data-slot":"breadcrumb-list",className:De("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function nH({className:e,...t}){return b.jsx("li",{"data-slot":"breadcrumb-item",className:De("inline-flex items-center gap-1.5",e),...t})}function rH({asChild:e,className:t,...n}){const o=e?JC:"a";return b.jsx(o,{"data-slot":"breadcrumb-link",className:De("hover:text-foreground transition-colors",t),...n})}function oH({className:e,...t}){return b.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:De("text-foreground font-normal",e),...t})}function sH({children:e,className:t,...n}){return b.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:De("[&>svg]:size-3.5",t),...n,children:e??b.jsx(FL,{})})}var km="rovingFocusGroup.onEntryFocus",iH={bubbles:!1,cancelable:!0},pc="RovingFocusGroup",[pg,oA,aH]=Ay(pc),[lH,sA]=$r(pc,[aH]),[cH,uH]=lH(pc),iA=S.forwardRef((e,t)=>b.jsx(pg.Provider,{scope:e.__scopeRovingFocusGroup,children:b.jsx(pg.Slot,{scope:e.__scopeRovingFocusGroup,children:b.jsx(dH,{...e,ref:t})})}));iA.displayName=pc;var dH=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:i=!1,dir:l,currentTabStopId:u,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:h,onEntryFocus:p,preventScrollOnEntryFocus:y=!1,...v}=e,w=S.useRef(null),_=Ze(t,w),R=Ny(l),[x,C]=es({prop:u,defaultProp:f??null,onChange:h,caller:pc}),[N,k]=S.useState(!1),O=vr(p),M=oA(n),$=S.useRef(!1),[V,L]=S.useState(0);return S.useEffect(()=>{const D=w.current;if(D)return D.addEventListener(km,O),()=>D.removeEventListener(km,O)},[O]),b.jsx(cH,{scope:n,orientation:o,dir:R,loop:i,currentTabStopId:x,onItemFocus:S.useCallback(D=>C(D),[C]),onItemShiftTab:S.useCallback(()=>k(!0),[]),onFocusableItemAdd:S.useCallback(()=>L(D=>D+1),[]),onFocusableItemRemove:S.useCallback(()=>L(D=>D-1),[]),children:b.jsx(Ne.div,{tabIndex:N||V===0?-1:0,"data-orientation":o,...v,ref:_,style:{outline:"none",...e.style},onMouseDown:me(e.onMouseDown,()=>{$.current=!0}),onFocus:me(e.onFocus,D=>{const Y=!$.current;if(D.target===D.currentTarget&&Y&&!N){const ie=new CustomEvent(km,iH);if(D.currentTarget.dispatchEvent(ie),!ie.defaultPrevented){const le=M().filter(F=>F.focusable),se=le.find(F=>F.active),ue=le.find(F=>F.id===x),ge=[se,ue,...le].filter(Boolean).map(F=>F.ref.current);cA(ge,y)}}$.current=!1}),onBlur:me(e.onBlur,()=>k(!1))})})}),aA="RovingFocusGroupItem",lA=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:i=!1,tabStopId:l,children:u,...f}=e,h=mr(),p=l||h,y=uH(aA,n),v=y.currentTabStopId===p,w=oA(n),{onFocusableItemAdd:_,onFocusableItemRemove:R,currentTabStopId:x}=y;return S.useEffect(()=>{if(o)return _(),()=>R()},[o,_,R]),b.jsx(pg.ItemSlot,{scope:n,id:p,focusable:o,active:i,children:b.jsx(Ne.span,{tabIndex:v?0:-1,"data-orientation":y.orientation,...f,ref:t,onMouseDown:me(e.onMouseDown,C=>{o?y.onItemFocus(p):C.preventDefault()}),onFocus:me(e.onFocus,()=>y.onItemFocus(p)),onKeyDown:me(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){y.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const N=pH(C,y.orientation,y.dir);if(N!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let O=w().filter(M=>M.focusable).map(M=>M.ref.current);if(N==="last")O.reverse();else if(N==="prev"||N==="next"){N==="prev"&&O.reverse();const M=O.indexOf(C.currentTarget);O=y.loop?mH(O,M+1):O.slice(M+1)}setTimeout(()=>cA(O))}}),children:typeof u=="function"?u({isCurrentTabStop:v,hasTabStop:x!=null}):u})})});lA.displayName=aA;var fH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hH(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function pH(e,t,n){const o=hH(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return fH[o]}function cA(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function mH(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var gH=iA,yH=lA,mg=["Enter"," "],vH=["ArrowDown","PageUp","Home"],uA=["ArrowUp","PageDown","End"],bH=[...vH,...uA],wH={ltr:[...mg,"ArrowRight"],rtl:[...mg,"ArrowLeft"]},xH={ltr:["ArrowLeft"],rtl:["ArrowRight"]},mc="Menu",[Jl,SH,_H]=Ay(mc),[ei,dA]=$r(mc,[_H,Ca,sA]),wf=Ca(),fA=sA(),[EH,ti]=ei(mc),[TH,gc]=ei(mc),hA=e=>{const{__scopeMenu:t,open:n=!1,children:o,dir:i,onOpenChange:l,modal:u=!0}=e,f=wf(t),[h,p]=S.useState(null),y=S.useRef(!1),v=vr(l),w=Ny(i);return S.useEffect(()=>{const _=()=>{y.current=!0,document.addEventListener("pointerdown",R,{capture:!0,once:!0}),document.addEventListener("pointermove",R,{capture:!0,once:!0})},R=()=>y.current=!1;return document.addEventListener("keydown",_,{capture:!0}),()=>{document.removeEventListener("keydown",_,{capture:!0}),document.removeEventListener("pointerdown",R,{capture:!0}),document.removeEventListener("pointermove",R,{capture:!0})}},[]),b.jsx(Py,{...f,children:b.jsx(EH,{scope:t,open:n,onOpenChange:v,content:h,onContentChange:p,children:b.jsx(TH,{scope:t,onClose:S.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:y,dir:w,modal:u,children:o})})})};hA.displayName=mc;var CH="MenuAnchor",By=S.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,i=wf(n);return b.jsx(gf,{...i,...o,ref:t})});By.displayName=CH;var qy="MenuPortal",[RH,pA]=ei(qy,{forceMount:void 0}),mA=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:i}=e,l=ti(qy,t);return b.jsx(RH,{scope:t,forceMount:n,children:b.jsx(cr,{present:n||l.open,children:b.jsx(dc,{asChild:!0,container:i,children:o})})})};mA.displayName=qy;var sr="MenuContent",[AH,Vy]=ei(sr),gA=S.forwardRef((e,t)=>{const n=pA(sr,e.__scopeMenu),{forceMount:o=n.forceMount,...i}=e,l=ti(sr,e.__scopeMenu),u=gc(sr,e.__scopeMenu);return b.jsx(Jl.Provider,{scope:e.__scopeMenu,children:b.jsx(cr,{present:o||l.open,children:b.jsx(Jl.Slot,{scope:e.__scopeMenu,children:u.modal?b.jsx(NH,{...i,ref:t}):b.jsx(OH,{...i,ref:t})})})})}),NH=S.forwardRef((e,t)=>{const n=ti(sr,e.__scopeMenu),o=S.useRef(null),i=Ze(t,o);return S.useEffect(()=>{const l=o.current;if(l)return lf(l)},[]),b.jsx(Hy,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:me(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),OH=S.forwardRef((e,t)=>{const n=ti(sr,e.__scopeMenu);return b.jsx(Hy,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),kH=Hs("MenuContent.ScrollLock"),Hy=S.forwardRef((e,t)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:i,onOpenAutoFocus:l,onCloseAutoFocus:u,disableOutsidePointerEvents:f,onEntryFocus:h,onEscapeKeyDown:p,onPointerDownOutside:y,onFocusOutside:v,onInteractOutside:w,onDismiss:_,disableOutsideScroll:R,...x}=e,C=ti(sr,n),N=gc(sr,n),k=wf(n),O=fA(n),M=SH(n),[$,V]=S.useState(null),L=S.useRef(null),D=Ze(t,L,C.onContentChange),Y=S.useRef(0),ie=S.useRef(""),le=S.useRef(0),se=S.useRef(null),ue=S.useRef("right"),ce=S.useRef(0),ge=R?fc:S.Fragment,F=R?{as:kH,allowPinchZoom:!0}:void 0,X=ne=>{const be=ie.current+ne,z=M().filter(J=>!J.disabled),G=document.activeElement,re=z.find(J=>J.ref.current===G)?.textValue,oe=z.map(J=>J.textValue),de=qH(oe,be,re),ve=z.find(J=>J.textValue===de)?.ref.current;(function J(_e){ie.current=_e,window.clearTimeout(Y.current),_e!==""&&(Y.current=window.setTimeout(()=>J(""),1e3))})(be),ve&&setTimeout(()=>ve.focus())};S.useEffect(()=>()=>window.clearTimeout(Y.current),[]),sf();const Z=S.useCallback(ne=>ue.current===se.current?.side&&HH(ne,se.current?.area),[]);return b.jsx(AH,{scope:n,searchRef:ie,onItemEnter:S.useCallback(ne=>{Z(ne)&&ne.preventDefault()},[Z]),onItemLeave:S.useCallback(ne=>{Z(ne)||(L.current?.focus(),V(null))},[Z]),onTriggerLeave:S.useCallback(ne=>{Z(ne)&&ne.preventDefault()},[Z]),pointerGraceTimerRef:le,onPointerGraceIntentChange:S.useCallback(ne=>{se.current=ne},[]),children:b.jsx(ge,{...F,children:b.jsx(uc,{asChild:!0,trapped:i,onMountAutoFocus:me(l,ne=>{ne.preventDefault(),L.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:b.jsx(cc,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:p,onPointerDownOutside:y,onFocusOutside:v,onInteractOutside:w,onDismiss:_,children:b.jsx(gH,{asChild:!0,...O,dir:N.dir,orientation:"vertical",loop:o,currentTabStopId:$,onCurrentTabStopIdChange:V,onEntryFocus:me(h,ne=>{N.isUsingKeyboardRef.current||ne.preventDefault()}),preventScrollOnEntryFocus:!0,children:b.jsx($y,{role:"menu","aria-orientation":"vertical","data-state":MA(C.open),"data-radix-menu-content":"",dir:N.dir,...k,...x,ref:D,style:{outline:"none",...x.style},onKeyDown:me(x.onKeyDown,ne=>{const z=ne.target.closest("[data-radix-menu-content]")===ne.currentTarget,G=ne.ctrlKey||ne.altKey||ne.metaKey,re=ne.key.length===1;z&&(ne.key==="Tab"&&ne.preventDefault(),!G&&re&&X(ne.key));const oe=L.current;if(ne.target!==oe||!bH.includes(ne.key))return;ne.preventDefault();const ve=M().filter(J=>!J.disabled).map(J=>J.ref.current);uA.includes(ne.key)&&ve.reverse(),UH(ve)}),onBlur:me(e.onBlur,ne=>{ne.currentTarget.contains(ne.target)||(window.clearTimeout(Y.current),ie.current="")}),onPointerMove:me(e.onPointerMove,Wl(ne=>{const be=ne.target,z=ce.current!==ne.clientX;if(ne.currentTarget.contains(be)&&z){const G=ne.clientX>ce.current?"right":"left";ue.current=G,ce.current=ne.clientX}}))})})})})})})});gA.displayName=sr;var MH="MenuGroup",Zy=S.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return b.jsx(Ne.div,{role:"group",...o,ref:t})});Zy.displayName=MH;var IH="MenuLabel",yA=S.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return b.jsx(Ne.div,{...o,ref:t})});yA.displayName=IH;var Ld="MenuItem",T_="menu.itemSelect",xf=S.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:o,...i}=e,l=S.useRef(null),u=gc(Ld,e.__scopeMenu),f=Vy(Ld,e.__scopeMenu),h=Ze(t,l),p=S.useRef(!1),y=()=>{const v=l.current;if(!n&&v){const w=new CustomEvent(T_,{bubbles:!0,cancelable:!0});v.addEventListener(T_,_=>o?.(_),{once:!0}),bC(v,w),w.defaultPrevented?p.current=!1:u.onClose()}};return b.jsx(vA,{...i,ref:h,disabled:n,onClick:me(e.onClick,y),onPointerDown:v=>{e.onPointerDown?.(v),p.current=!0},onPointerUp:me(e.onPointerUp,v=>{p.current||v.currentTarget?.click()}),onKeyDown:me(e.onKeyDown,v=>{const w=f.searchRef.current!=="";n||w&&v.key===" "||mg.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})});xf.displayName=Ld;var vA=S.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:i,...l}=e,u=Vy(Ld,n),f=fA(n),h=S.useRef(null),p=Ze(t,h),[y,v]=S.useState(!1),[w,_]=S.useState("");return S.useEffect(()=>{const R=h.current;R&&_((R.textContent??"").trim())},[l.children]),b.jsx(Jl.ItemSlot,{scope:n,disabled:o,textValue:i??w,children:b.jsx(yH,{asChild:!0,...f,focusable:!o,children:b.jsx(Ne.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...l,ref:p,onPointerMove:me(e.onPointerMove,Wl(R=>{o?u.onItemLeave(R):(u.onItemEnter(R),R.defaultPrevented||R.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:me(e.onPointerLeave,Wl(R=>u.onItemLeave(R))),onFocus:me(e.onFocus,()=>v(!0)),onBlur:me(e.onBlur,()=>v(!1))})})})}),DH="MenuCheckboxItem",bA=S.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...i}=e;return b.jsx(EA,{scope:e.__scopeMenu,checked:n,children:b.jsx(xf,{role:"menuitemcheckbox","aria-checked":Pd(n)?"mixed":n,...i,ref:t,"data-state":Gy(n),onSelect:me(i.onSelect,()=>o?.(Pd(n)?!0:!n),{checkForDefaultPrevented:!1})})})});bA.displayName=DH;var wA="MenuRadioGroup",[jH,zH]=ei(wA,{value:void 0,onValueChange:()=>{}}),xA=S.forwardRef((e,t)=>{const{value:n,onValueChange:o,...i}=e,l=vr(o);return b.jsx(jH,{scope:e.__scopeMenu,value:n,onValueChange:l,children:b.jsx(Zy,{...i,ref:t})})});xA.displayName=wA;var SA="MenuRadioItem",_A=S.forwardRef((e,t)=>{const{value:n,...o}=e,i=zH(SA,e.__scopeMenu),l=n===i.value;return b.jsx(EA,{scope:e.__scopeMenu,checked:l,children:b.jsx(xf,{role:"menuitemradio","aria-checked":l,...o,ref:t,"data-state":Gy(l),onSelect:me(o.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});_A.displayName=SA;var Qy="MenuItemIndicator",[EA,LH]=ei(Qy,{checked:!1}),TA=S.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...i}=e,l=LH(Qy,n);return b.jsx(cr,{present:o||Pd(l.checked)||l.checked===!0,children:b.jsx(Ne.span,{...i,ref:t,"data-state":Gy(l.checked)})})});TA.displayName=Qy;var PH="MenuSeparator",CA=S.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return b.jsx(Ne.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});CA.displayName=PH;var $H="MenuArrow",RA=S.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,i=wf(n);return b.jsx(Fy,{...i,...o,ref:t})});RA.displayName=$H;var FH="MenuSub",[FG,AA]=ei(FH),Dl="MenuSubTrigger",NA=S.forwardRef((e,t)=>{const n=ti(Dl,e.__scopeMenu),o=gc(Dl,e.__scopeMenu),i=AA(Dl,e.__scopeMenu),l=Vy(Dl,e.__scopeMenu),u=S.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:h}=l,p={__scopeMenu:e.__scopeMenu},y=S.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return S.useEffect(()=>y,[y]),S.useEffect(()=>{const v=f.current;return()=>{window.clearTimeout(v),h(null)}},[f,h]),b.jsx(By,{asChild:!0,...p,children:b.jsx(vA,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":MA(n.open),...e,ref:lc(t,i.onTriggerChange),onClick:v=>{e.onClick?.(v),!(e.disabled||v.defaultPrevented)&&(v.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:me(e.onPointerMove,Wl(v=>{l.onItemEnter(v),!v.defaultPrevented&&!e.disabled&&!n.open&&!u.current&&(l.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{n.onOpenChange(!0),y()},100))})),onPointerLeave:me(e.onPointerLeave,Wl(v=>{y();const w=n.content?.getBoundingClientRect();if(w){const _=n.content?.dataset.side,R=_==="right",x=R?-5:5,C=w[R?"left":"right"],N=w[R?"right":"left"];l.onPointerGraceIntentChange({area:[{x:v.clientX+x,y:v.clientY},{x:C,y:w.top},{x:N,y:w.top},{x:N,y:w.bottom},{x:C,y:w.bottom}],side:_}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(v),v.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:me(e.onKeyDown,v=>{const w=l.searchRef.current!=="";e.disabled||w&&v.key===" "||wH[o.dir].includes(v.key)&&(n.onOpenChange(!0),n.content?.focus(),v.preventDefault())})})})});NA.displayName=Dl;var OA="MenuSubContent",kA=S.forwardRef((e,t)=>{const n=pA(sr,e.__scopeMenu),{forceMount:o=n.forceMount,...i}=e,l=ti(sr,e.__scopeMenu),u=gc(sr,e.__scopeMenu),f=AA(OA,e.__scopeMenu),h=S.useRef(null),p=Ze(t,h);return b.jsx(Jl.Provider,{scope:e.__scopeMenu,children:b.jsx(cr,{present:o||l.open,children:b.jsx(Jl.Slot,{scope:e.__scopeMenu,children:b.jsx(Hy,{id:f.contentId,"aria-labelledby":f.triggerId,...i,ref:p,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:y=>{u.isUsingKeyboardRef.current&&h.current?.focus(),y.preventDefault()},onCloseAutoFocus:y=>y.preventDefault(),onFocusOutside:me(e.onFocusOutside,y=>{y.target!==f.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:me(e.onEscapeKeyDown,y=>{u.onClose(),y.preventDefault()}),onKeyDown:me(e.onKeyDown,y=>{const v=y.currentTarget.contains(y.target),w=xH[u.dir].includes(y.key);v&&w&&(l.onOpenChange(!1),f.trigger?.focus(),y.preventDefault())})})})})})});kA.displayName=OA;function MA(e){return e?"open":"closed"}function Pd(e){return e==="indeterminate"}function Gy(e){return Pd(e)?"indeterminate":e?"checked":"unchecked"}function UH(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function BH(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function qH(e,t,n){const i=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let u=BH(e,Math.max(l,0));i.length===1&&(u=u.filter(p=>p!==n));const h=u.find(p=>p.toLowerCase().startsWith(i.toLowerCase()));return h!==n?h:void 0}function VH(e,t){const{x:n,y:o}=e;let i=!1;for(let l=0,u=t.length-1;l<t.length;u=l++){const f=t[l],h=t[u],p=f.x,y=f.y,v=h.x,w=h.y;y>o!=w>o&&n<(v-p)*(o-y)/(w-y)+p&&(i=!i)}return i}function HH(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return VH(n,t)}function Wl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var ZH=hA,QH=By,GH=mA,YH=gA,KH=Zy,XH=yA,JH=xf,WH=bA,eZ=xA,tZ=_A,nZ=TA,rZ=CA,oZ=RA,sZ=NA,iZ=kA,Sf="DropdownMenu",[aZ]=$r(Sf,[dA]),fn=dA(),[lZ,IA]=aZ(Sf),DA=e=>{const{__scopeDropdownMenu:t,children:n,dir:o,open:i,defaultOpen:l,onOpenChange:u,modal:f=!0}=e,h=fn(t),p=S.useRef(null),[y,v]=es({prop:i,defaultProp:l??!1,onChange:u,caller:Sf});return b.jsx(lZ,{scope:t,triggerId:mr(),triggerRef:p,contentId:mr(),open:y,onOpenChange:v,onOpenToggle:S.useCallback(()=>v(w=>!w),[v]),modal:f,children:b.jsx(ZH,{...h,open:y,onOpenChange:v,dir:o,modal:f,children:n})})};DA.displayName=Sf;var jA="DropdownMenuTrigger",zA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...i}=e,l=IA(jA,n),u=fn(n);return b.jsx(QH,{asChild:!0,...u,children:b.jsx(Ne.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...i,ref:lc(t,l.triggerRef),onPointerDown:me(e.onPointerDown,f=>{!o&&f.button===0&&f.ctrlKey===!1&&(l.onOpenToggle(),l.open||f.preventDefault())}),onKeyDown:me(e.onKeyDown,f=>{o||(["Enter"," "].includes(f.key)&&l.onOpenToggle(),f.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(f.key)&&f.preventDefault())})})})});zA.displayName=jA;var cZ="DropdownMenuPortal",LA=e=>{const{__scopeDropdownMenu:t,...n}=e,o=fn(t);return b.jsx(GH,{...o,...n})};LA.displayName=cZ;var PA="DropdownMenuContent",$A=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=IA(PA,n),l=fn(n),u=S.useRef(!1);return b.jsx(YH,{id:i.contentId,"aria-labelledby":i.triggerId,...l,...o,ref:t,onCloseAutoFocus:me(e.onCloseAutoFocus,f=>{u.current||i.triggerRef.current?.focus(),u.current=!1,f.preventDefault()}),onInteractOutside:me(e.onInteractOutside,f=>{const h=f.detail.originalEvent,p=h.button===0&&h.ctrlKey===!0,y=h.button===2||p;(!i.modal||y)&&(u.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});$A.displayName=PA;var uZ="DropdownMenuGroup",dZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(KH,{...i,...o,ref:t})});dZ.displayName=uZ;var fZ="DropdownMenuLabel",FA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(XH,{...i,...o,ref:t})});FA.displayName=fZ;var hZ="DropdownMenuItem",UA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(JH,{...i,...o,ref:t})});UA.displayName=hZ;var pZ="DropdownMenuCheckboxItem",mZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(WH,{...i,...o,ref:t})});mZ.displayName=pZ;var gZ="DropdownMenuRadioGroup",yZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(eZ,{...i,...o,ref:t})});yZ.displayName=gZ;var vZ="DropdownMenuRadioItem",bZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(tZ,{...i,...o,ref:t})});bZ.displayName=vZ;var wZ="DropdownMenuItemIndicator",xZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(nZ,{...i,...o,ref:t})});xZ.displayName=wZ;var SZ="DropdownMenuSeparator",BA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(rZ,{...i,...o,ref:t})});BA.displayName=SZ;var _Z="DropdownMenuArrow",EZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(oZ,{...i,...o,ref:t})});EZ.displayName=_Z;var TZ="DropdownMenuSubTrigger",CZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(sZ,{...i,...o,ref:t})});CZ.displayName=TZ;var RZ="DropdownMenuSubContent",AZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(iZ,{...i,...o,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});AZ.displayName=RZ;var NZ=DA,OZ=zA,kZ=LA,MZ=$A,IZ=FA,DZ=UA,jZ=BA;function zZ({...e}){return b.jsx(NZ,{"data-slot":"dropdown-menu",...e})}function LZ({...e}){return b.jsx(OZ,{"data-slot":"dropdown-menu-trigger",...e})}function PZ({className:e,sideOffset:t=4,...n}){return b.jsx(kZ,{children:b.jsx(MZ,{"data-slot":"dropdown-menu-content",sideOffset:t,className:De("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function C_({className:e,inset:t,variant:n="default",...o}){return b.jsx(DZ,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:De("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o})}function $Z({className:e,inset:t,...n}){return b.jsx(IZ,{"data-slot":"dropdown-menu-label","data-inset":t,className:De("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function R_({className:e,...t}){return b.jsx(jZ,{"data-slot":"dropdown-menu-separator",className:De("bg-border -mx-1 my-1 h-px",e),...t})}function FZ(e,t=[]){let n=[];function o(l,u){const f=S.createContext(u);f.displayName=l+"Context";const h=n.length;n=[...n,u];const p=v=>{const{scope:w,children:_,...R}=v,x=w?.[e]?.[h]||f,C=S.useMemo(()=>R,Object.values(R));return b.jsx(x.Provider,{value:C,children:_})};p.displayName=l+"Provider";function y(v,w){const _=w?.[e]?.[h]||f,R=S.useContext(_);if(R)return R;if(u!==void 0)return u;throw new Error(`\`${v}\` must be used within \`${l}\``)}return[p,y]}const i=()=>{const l=n.map(u=>S.createContext(u));return function(f){const h=f?.[e]||l;return S.useMemo(()=>({[`__scope${e}`]:{...f,[e]:h}}),[f,h])}};return i.scopeName=e,[o,UZ(i,...t)]}function UZ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(l){const u=o.reduce((f,{useScope:h,scopeName:p})=>{const v=h(l)[`__scope${p}`];return{...f,...v}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}var BZ=LE();function qZ(){return BZ.useSyncExternalStore(VZ,()=>!0,()=>!1)}function VZ(){return()=>{}}var Yy="Avatar",[HZ]=FZ(Yy),[ZZ,qA]=HZ(Yy),VA=S.forwardRef((e,t)=>{const{__scopeAvatar:n,...o}=e,[i,l]=S.useState("idle");return b.jsx(ZZ,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:l,children:b.jsx(uf.span,{...o,ref:t})})});VA.displayName=Yy;var HA="AvatarImage",ZA=S.forwardRef((e,t)=>{const{__scopeAvatar:n,src:o,onLoadingStatusChange:i=()=>{},...l}=e,u=qA(HA,n),f=QZ(o,l),h=vr(p=>{i(p),u.onImageLoadingStatusChange(p)});return Mt(()=>{f!=="idle"&&h(f)},[f,h]),f==="loaded"?b.jsx(uf.img,{...l,ref:t,src:o}):null});ZA.displayName=HA;var QA="AvatarFallback",GA=S.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:o,...i}=e,l=qA(QA,n),[u,f]=S.useState(o===void 0);return S.useEffect(()=>{if(o!==void 0){const h=window.setTimeout(()=>f(!0),o);return()=>window.clearTimeout(h)}},[o]),u&&l.imageLoadingStatus!=="loaded"?b.jsx(uf.span,{...i,ref:t}):null});GA.displayName=QA;function A_(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function QZ(e,{referrerPolicy:t,crossOrigin:n}){const o=qZ(),i=S.useRef(null),l=o?(i.current||(i.current=new window.Image),i.current):null,[u,f]=S.useState(()=>A_(l,e));return Mt(()=>{f(A_(l,e))},[l,e]),Mt(()=>{const h=v=>()=>{f(v)};if(!l)return;const p=h("loaded"),y=h("error");return l.addEventListener("load",p),l.addEventListener("error",y),t&&(l.referrerPolicy=t),typeof n=="string"&&(l.crossOrigin=n),()=>{l.removeEventListener("load",p),l.removeEventListener("error",y)}},[l,n,t]),u}var GZ=VA,YZ=ZA,KZ=GA;function XZ({className:e,...t}){return b.jsx(GZ,{"data-slot":"avatar",className:De("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function JZ({className:e,...t}){return b.jsx(YZ,{"data-slot":"avatar-image",className:De("aspect-square size-full",e),...t})}function WZ({className:e,...t}){return b.jsx(KZ,{"data-slot":"avatar-fallback",className:De("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}var _f="Popover",[YA]=$r(_f,[Ca]),yc=Ca(),[eQ,ds]=YA(_f),KA=e=>{const{__scopePopover:t,children:n,open:o,defaultOpen:i,onOpenChange:l,modal:u=!1}=e,f=yc(t),h=S.useRef(null),[p,y]=S.useState(!1),[v,w]=es({prop:o,defaultProp:i??!1,onChange:l,caller:_f});return b.jsx(Py,{...f,children:b.jsx(eQ,{scope:t,contentId:mr(),triggerRef:h,open:v,onOpenChange:w,onOpenToggle:S.useCallback(()=>w(_=>!_),[w]),hasCustomAnchor:p,onCustomAnchorAdd:S.useCallback(()=>y(!0),[]),onCustomAnchorRemove:S.useCallback(()=>y(!1),[]),modal:u,children:n})})};KA.displayName=_f;var XA="PopoverAnchor",tQ=S.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,i=ds(XA,n),l=yc(n),{onCustomAnchorAdd:u,onCustomAnchorRemove:f}=i;return S.useEffect(()=>(u(),()=>f()),[u,f]),b.jsx(gf,{...l,...o,ref:t})});tQ.displayName=XA;var JA="PopoverTrigger",WA=S.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,i=ds(JA,n),l=yc(n),u=Ze(t,i.triggerRef),f=b.jsx(Ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":oN(i.open),...o,ref:u,onClick:me(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?f:b.jsx(gf,{asChild:!0,...l,children:f})});WA.displayName=JA;var Ky="PopoverPortal",[nQ,rQ]=YA(Ky,{forceMount:void 0}),eN=e=>{const{__scopePopover:t,forceMount:n,children:o,container:i}=e,l=ds(Ky,t);return b.jsx(nQ,{scope:t,forceMount:n,children:b.jsx(cr,{present:n||l.open,children:b.jsx(dc,{asChild:!0,container:i,children:o})})})};eN.displayName=Ky;var ma="PopoverContent",tN=S.forwardRef((e,t)=>{const n=rQ(ma,e.__scopePopover),{forceMount:o=n.forceMount,...i}=e,l=ds(ma,e.__scopePopover);return b.jsx(cr,{present:o||l.open,children:l.modal?b.jsx(sQ,{...i,ref:t}):b.jsx(iQ,{...i,ref:t})})});tN.displayName=ma;var oQ=Hs("PopoverContent.RemoveScroll"),sQ=S.forwardRef((e,t)=>{const n=ds(ma,e.__scopePopover),o=S.useRef(null),i=Ze(t,o),l=S.useRef(!1);return S.useEffect(()=>{const u=o.current;if(u)return lf(u)},[]),b.jsx(fc,{as:oQ,allowPinchZoom:!0,children:b.jsx(nN,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:me(e.onCloseAutoFocus,u=>{u.preventDefault(),l.current||n.triggerRef.current?.focus()}),onPointerDownOutside:me(e.onPointerDownOutside,u=>{const f=u.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,p=f.button===2||h;l.current=p},{checkForDefaultPrevented:!1}),onFocusOutside:me(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1})})})}),iQ=S.forwardRef((e,t)=>{const n=ds(ma,e.__scopePopover),o=S.useRef(!1),i=S.useRef(!1);return b.jsx(nN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{e.onCloseAutoFocus?.(l),l.defaultPrevented||(o.current||n.triggerRef.current?.focus(),l.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:l=>{e.onInteractOutside?.(l),l.defaultPrevented||(o.current=!0,l.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=l.target;n.triggerRef.current?.contains(u)&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&i.current&&l.preventDefault()}})}),nN=S.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:y,...v}=e,w=ds(ma,n),_=yc(n);return sf(),b.jsx(uc,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:l,children:b.jsx(cc,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:y,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onDismiss:()=>w.onOpenChange(!1),children:b.jsx($y,{"data-state":oN(w.open),role:"dialog",id:w.contentId,..._,...v,ref:t,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),rN="PopoverClose",aQ=S.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,i=ds(rN,n);return b.jsx(Ne.button,{type:"button",...o,ref:t,onClick:me(e.onClick,()=>i.onOpenChange(!1))})});aQ.displayName=rN;var lQ="PopoverArrow",cQ=S.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,i=yc(n);return b.jsx(Fy,{...i,...o,ref:t})});cQ.displayName=lQ;function oN(e){return e?"open":"closed"}var uQ=KA,dQ=WA,fQ=eN,hQ=tN;function N_({...e}){return b.jsx(uQ,{"data-slot":"popover",...e})}function O_({...e}){return b.jsx(dQ,{"data-slot":"popover-trigger",...e})}function k_({className:e,align:t="center",sideOffset:n=4,...o}){return b.jsx(fQ,{children:b.jsx(hQ,{"data-slot":"popover-content",align:t,sideOffset:n,className:De("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...o})})}const pQ=[{keys:["⌘","S"],description:"Save entry"},{keys:["⌘","⇧","P"],description:"Publish entry"},{keys:["⌘","K"],description:"Quick search"},{keys:["Esc"],description:"Close modal/panel"}],mQ=[{label:"Documentation",url:"https://docs.convex.dev",icon:ML},{label:"API Reference",url:"https://docs.convex.dev/api",icon:KL},{label:"Community Discord",url:"https://discord.gg/convex",icon:BP}],gQ={"/":"Dashboard","/content":"Content","/media":"Media Library","/content-types":"Content Types","/settings":"Settings","/taxonomies":"Taxonomies","/trash":"Trash","/entries":"Entries","/entries/type":"Content Types","/entries/new":"New Entry"};function yQ(e,t,n){const o=[{label:t,to:"/"}],i=decodeURIComponent(e);if(i==="/")return o;const l=i.split("/").filter(Boolean);let u="";return l.forEach((f,h)=>{u+=`/${f}`;const p=h===l.length-1;let y=n.get(u)??gQ[u];y||(y=f.charAt(0).toUpperCase()+f.slice(1).replace(/-/g," ")),p?o.push({label:y}):o.push({label:y,to:u})}),o}function vQ(){const e=xt(),t=Gd(),{branding:n}=by();let o=new Map;try{o=Cq().overrides}catch{}const i=yQ(e.location.pathname,n.appName,o);let l=null,u=null,f=async()=>{},h=!1;try{const x=dC();l=x.user,u=x.role,f=x.logout,h=x.isAuthenticated}catch{}const y=(u?J$(u):null)?.displayName??u??"No Role",v=l?.name??l?.email??"User",w=x=>{const C=x.split(" ");return C.length>=2?`${C[0][0]}${C[1][0]}`.toUpperCase():x.slice(0,2).toUpperCase()},_=l?.name?w(l.name):"U",R=async()=>{await f()};return b.jsxs("header",{className:"sticky top-0 z-40 flex h-14 items-center justify-between border-b border-border bg-background/95 px-6 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:[b.jsx(eH,{children:b.jsx(tH,{children:i.map((x,C)=>b.jsxs(S.Fragment,{children:[C>0&&b.jsx(sH,{}),b.jsx(nH,{children:x.to?b.jsx(rH,{asChild:!0,children:b.jsxs(Ls,{to:x.to,className:"flex items-center gap-1.5",children:[C===0&&b.jsx(b1,{className:"size-3.5"}),b.jsx("span",{children:x.label})]})}):b.jsx(oH,{children:x.label})})]},C))})}),b.jsxs("div",{className:"flex items-center gap-1",children:[b.jsxs(N_,{children:[b.jsx(O_,{asChild:!0,children:b.jsxs(Ul,{variant:"ghost",size:"icon",className:"size-9",children:[b.jsx(Bm,{className:"size-4"}),b.jsx("span",{className:"sr-only",children:"Notifications"})]})}),b.jsxs(k_,{align:"end",className:"w-80",children:[b.jsx("div",{className:"flex items-center justify-between pb-2",children:b.jsx("h4",{className:"font-medium",children:"Notifications"})}),b.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[b.jsx(Bm,{className:"size-8 text-muted-foreground/50"}),b.jsx("p",{className:"mt-2 text-sm font-medium",children:"No notifications yet"}),b.jsx("p",{className:"text-xs text-muted-foreground",children:"You're all caught up!"})]})]})]}),b.jsxs(N_,{children:[b.jsx(O_,{asChild:!0,children:b.jsxs(Ul,{variant:"ghost",size:"icon",className:"size-9",children:[b.jsx(y1,{className:"size-4"}),b.jsx("span",{className:"sr-only",children:"Help"})]})}),b.jsxs(k_,{align:"end",className:"w-72",children:[b.jsx("div",{className:"pb-2",children:b.jsx("h4",{className:"font-medium",children:"Help & Resources"})}),b.jsxs("div",{className:"space-y-4",children:[b.jsxs("div",{children:[b.jsx("h5",{className:"mb-2 text-xs font-medium text-muted-foreground",children:"Keyboard Shortcuts"}),b.jsx("div",{className:"space-y-1",children:pQ.map((x,C)=>b.jsxs("div",{className:"flex items-center justify-between text-sm",children:[b.jsx("span",{className:"text-muted-foreground",children:x.description}),b.jsx("div",{className:"flex gap-0.5",children:x.keys.map((N,k)=>b.jsx("kbd",{className:"rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-xs",children:N},k))})]},C))})]}),b.jsxs("div",{children:[b.jsx("h5",{className:"mb-2 text-xs font-medium text-muted-foreground",children:"Resources"}),b.jsx("div",{className:"space-y-1",children:mQ.map(x=>b.jsxs("a",{href:x.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent",children:[b.jsx(x.icon,{className:"size-4 text-muted-foreground"}),b.jsx("span",{className:"flex-1",children:x.label}),b.jsx(eP,{className:"size-3 text-muted-foreground"})]},x.label))})]})]})]})]}),b.jsxs(zZ,{children:[b.jsx(LZ,{asChild:!0,children:b.jsxs(Ul,{variant:"ghost",className:"h-9 gap-2 pl-2 pr-3",children:[b.jsxs(XZ,{className:"size-6",children:[b.jsx(JZ,{src:l?.avatarUrl,alt:v}),b.jsx(WZ,{className:"text-xs",children:_})]}),b.jsx("span",{className:"text-sm font-medium",children:v}),b.jsx(Js,{className:"size-3.5 text-muted-foreground"})]})}),b.jsxs(PZ,{align:"end",className:"w-56",children:[b.jsx($Z,{className:"font-normal",children:b.jsxs("div",{className:"flex flex-col space-y-1",children:[b.jsx("p",{className:"text-sm font-medium",children:v}),l?.email&&b.jsx("p",{className:"text-xs text-muted-foreground",children:l.email}),b.jsx("p",{className:"text-xs text-muted-foreground",children:y})]})}),b.jsx(R_,{}),b.jsxs(C_,{onClick:()=>t({to:"/settings"}),children:[b.jsx(E1,{className:"mr-2 size-4"}),b.jsx("span",{children:"Profile & Settings"})]}),h&&b.jsxs(b.Fragment,{children:[b.jsx(R_,{}),b.jsxs(C_,{onClick:R,className:"text-destructive focus:text-destructive",children:[b.jsx(zP,{className:"mr-2 size-4"}),b.jsx("span",{children:"Logout"})]})]})]})]})]})]})}function bQ({children:e}){const{layout:t}=by();return b.jsxs("div",{className:"flex min-h-screen bg-background",children:[b.jsx(W7,{}),b.jsxs("div",{className:"flex flex-1 flex-col",style:{marginLeft:t.sidebarWidth},children:[b.jsx(vQ,{}),b.jsx("main",{className:"flex-1 overflow-auto p-6",children:e})]})]})}function wQ(){return b.jsx("div",{className:"route-guard route-guard--loading bg-background flex items-center justify-center min-h-screen",children:b.jsx(MP,{className:"h-8 w-8 animate-spin text-muted-foreground"})})}function xQ(){return b.jsxs("div",{className:"route-guard route-guard--unauthenticated",children:[b.jsx("div",{className:"route-guard-icon",children:b.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[b.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),b.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}),b.jsx("h2",{children:"Authentication Required"}),b.jsx("p",{children:"Please log in to access the admin panel."})]})}function Mm({requiredRole:e,requiredPermission:t}){return b.jsxs("div",{className:"route-guard route-guard--unauthorized",children:[b.jsx("div",{className:"route-guard-icon",children:b.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[b.jsx("circle",{cx:"12",cy:"12",r:"10"}),b.jsx("line",{x1:"4.93",y1:"4.93",x2:"19.07",y2:"19.07"})]})}),b.jsx("h2",{children:"Access Denied"}),b.jsx("p",{children:"You don't have permission to access this page."}),e&&b.jsxs("p",{className:"route-guard-detail",children:["Required role: ",b.jsx("strong",{children:e})]}),t&&b.jsxs("p",{className:"route-guard-detail",children:["Required permission:"," ",b.jsxs("strong",{children:[t.action," on ",t.resource]})]})]})}function SQ({error:e}){return b.jsxs("div",{className:"route-guard route-guard--error",children:[b.jsx("div",{className:"route-guard-icon",children:b.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[b.jsx("circle",{cx:"12",cy:"12",r:"10"}),b.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),b.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),b.jsx("h2",{children:"Authentication Error"}),b.jsx("p",{children:e})]})}function _Q({children:e,requiredPermission:t,requiredRole:n,loadingComponent:o,unauthenticatedComponent:i,unauthorizedComponent:l,onUnauthenticated:u,onUnauthorized:f}){const{authState:h,role:p,checkPermission:y,error:v}=dC();return h==="loading"?b.jsx(b.Fragment,{children:o??b.jsx(wQ,{})}):h==="error"?b.jsx(SQ,{error:v??"An error occurred"}):h==="unauthenticated"?(u?.(),b.jsx(b.Fragment,{children:i??b.jsx(xQ,{})})):p?n&&p!==n?(f?.(),b.jsx(b.Fragment,{children:l??b.jsx(Mm,{requiredRole:n,requiredPermission:t})})):t&&!y(t)?(f?.(),b.jsx(b.Fragment,{children:l??b.jsx(Mm,{requiredRole:n,requiredPermission:t})})):b.jsx(b.Fragment,{children:e}):(f?.(),b.jsx(b.Fragment,{children:l??b.jsx(Mm,{requiredRole:n,requiredPermission:t})}))}const sN=()=>{throw new Error("createServerOnlyFn() functions can only be called on the server!")};function M_(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"}function gg(e,t){const n=Object.create(null);if(e)for(const o of Object.keys(e))M_(o)&&(n[o]=e[o]);if(t&&typeof t=="object")for(const o of Object.keys(t))M_(o)&&(n[o]=t[o]);return n}function iN(e){return Object.create(null)}const id=(e,t)=>{const n=t||e||{};return typeof n.method>"u"&&(n.method="GET"),Object.assign(l=>{const u={...n,...l};return id(void 0,u)},{options:n,middleware:l=>{const u=[...n.middleware||[]];l.map(p=>{kx in p?p.options.middleware&&u.push(...p.options.middleware):u.push(p)});const f={...n,middleware:u},h=id(void 0,f);return h[kx]=!0,h},inputValidator:l=>{const u={...n,inputValidator:l};return id(void 0,u)},handler:(...l)=>{const[u,f]=l,h={...n,extractedFn:u,serverFn:f},p=[...h.middleware||[],CQ(h)];return Object.assign(async y=>{const v=await I_(p,"client",{...u,...h,data:y?.data,headers:y?.headers,signal:y?.signal,fetch:y?.fetch,context:iN()}),w=G_(v.error);if(w)throw w;if(v.error)throw v.error;return v.result},{...u,__executeServer:async(y,v)=>{const w=sN(),_=w.contextAfterGlobalMiddlewares,R={...u,...y,serverFnMeta:u.serverFnMeta,context:gg(_,y.context),signal:v,request:w.request};return await I_(p,"server",R).then(C=>({result:C.result,error:C.error,context:C.sendContext}))}})}})};async function I_(e,t,n){const o=Og()?.functionMiddleware||[];let i=EQ([...o,...e]);if(t==="server"){const u=sN();u?.executedRequestMiddlewares&&(i=i.filter(f=>!u.executedRequestMiddlewares.has(f)))}const l=async u=>{const f=i.shift();if(!f)return u;try{"inputValidator"in f.options&&f.options.inputValidator&&t==="server"&&(u.data=await TQ(f.options.inputValidator,u.data));let h;if(t==="client"?"client"in f.options&&(h=f.options.client):"server"in f.options&&(h=f.options.server),h){const y=await h({...u,next:async(v={})=>{const w={...u,...v,context:gg(u.context,v.context),sendContext:gg(u.sendContext,v.sendContext),headers:Cj(u.headers,v.headers),_callSiteFetch:u._callSiteFetch,fetch:u._callSiteFetch??v.fetch??u.fetch,result:v.result!==void 0?v.result:v instanceof Response?v:u.result,error:v.error??u.error},_=await l(w);if(_.error)throw _.error;return _}});if($n(y))return{...u,error:y};if(y instanceof Response)return{...u,result:y};if(!y)throw new Error("User middleware returned undefined. You must call next() or return a result in your middlewares.");return y}return l(u)}catch(h){return{...u,error:h}}};return l({...n,headers:n.headers||{},sendContext:n.sendContext||{},context:n.context||iN(),_callSiteFetch:n.fetch})}function EQ(e,t=100){const n=new Set,o=[],i=(l,u)=>{if(u>t)throw new Error(`Middleware nesting depth exceeded maximum of ${t}. Check for circular references.`);l.forEach(f=>{f.options.middleware&&i(f.options.middleware,u+1),n.has(f)||(n.add(f),o.push(f))})};return i(e,0),o}async function TQ(e,t){if(e==null)return{};if("~standard"in e){const n=await e["~standard"].validate(t);if(n.issues)throw new Error(JSON.stringify(n.issues,void 0,2));return n.value}if("parse"in e)return e.parse(t);if(typeof e=="function")return e(t);throw new Error("Invalid validator type!")}function CQ(e){return{"~types":void 0,options:{inputValidator:e.inputValidator,client:async({next:t,sendContext:n,fetch:o,...i})=>{const l={...i,context:n,fetch:o},u=await e.extractedFn?.(l);return t(u)},server:async({next:t,...n})=>{const o=await e.serverFn?.(n);return t({...n,result:o})}}}}const RQ=id({method:"GET"}).handler(GE("dff4e5b7f7b29b6a323200a2df0a5335d739cf583e83c9e514598af6b5ade819")),AQ=Tz;P4();const D_=()=>({id:"mock_user_123",name:"Demo Admin",email:"admin@example.com"}),j_=()=>"admin",z_=()=>{console.log("Logout called (mock mode)")},NQ=()=>null,OQ=()=>null,kQ=()=>{};function MQ(e){switch(e){case"mock":case"demo":return{getUser:D_,getUserRole:j_,onLogout:z_};case"none":case"disabled":return{getUser:NQ,getUserRole:OQ,onLogout:kQ};default:return{getUser:D_,getUserRole:j_,onLogout:z_}}}const ur=lj({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{title:"Convex CMS Admin"},{name:"description",content:"Admin interface for Convex CMS - manage content, media, and publishing workflows"}],links:[{rel:"stylesheet",href:SL},{rel:"icon",href:"/favicon.ico"}]}),loader:async()=>({config:await RQ()}),component:IQ});function IQ(){const{config:e}=ur.useLoaderData(),t=S.useMemo(()=>MQ(e.authMode),[e.authMode]),n=S.useMemo(()=>xq(e.adminConfig),[e.adminConfig]);return b.jsx(jQ,{children:b.jsx(yq,{children:b.jsx(Tq,{children:b.jsx(DQ,{config:e,adminConfig:n,children:b.jsx(gq,{getUser:t.getUser,getUserRole:t.getUserRole,onLogout:t.onLogout,children:b.jsx(_Q,{children:b.jsx(bQ,{children:b.jsx(UE,{})})})})})})})})}function DQ({children:e,config:t,adminConfig:n}){const o=S.useMemo(()=>t.convexUrl?new hL(t.convexUrl):null,[t.convexUrl]);return o?b.jsx(mL,{client:o,children:b.jsx(Aq,{api:AQ.admin,children:b.jsx(Eq,{baseConfig:n,children:e})})}):b.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-6",children:b.jsxs("div",{className:"diff-modified max-w-lg space-y-4 rounded-lg border p-6 text-center",children:[b.jsx("h2",{className:"text-xl font-semibold text-diff-modified",children:"Convex Configuration Required"}),b.jsx("p",{className:"text-sm text-diff-modified-foreground",children:"Please provide a Convex deployment URL to connect to your backend."}),b.jsxs("div",{className:"space-y-2 text-left text-sm text-diff-modified-foreground",children:[b.jsx("p",{className:"font-medium",children:"Options:"}),b.jsxs("ul",{className:"list-inside list-disc space-y-1",children:[b.jsxs("li",{children:["Run with URL:"," ",b.jsx("code",{className:"rounded bg-diff-modified-bg/50 px-1",children:"npx convex-cms admin --url YOUR_URL"})]}),b.jsxs("li",{children:["Set environment variable:"," ",b.jsx("code",{className:"rounded bg-diff-modified-bg/50 px-1",children:"CONVEX_URL=YOUR_URL"})]}),b.jsxs("li",{children:["Add to"," ",b.jsx("code",{className:"rounded bg-diff-modified-bg/50 px-1",children:".env.local"}),":"," ",b.jsx("code",{className:"rounded bg-diff-modified-bg/50 px-1",children:"CONVEX_URL=YOUR_URL"})]})]})]}),b.jsxs("p",{className:"text-sm text-diff-modified-foreground",children:["Run"," ",b.jsx("code",{className:"rounded bg-diff-modified-bg/50 px-1",children:"npx convex dev"})," to start Convex and get your URL."]})]})})}function jQ({children:e}){return b.jsxs("html",{lang:"en",children:[b.jsx("head",{children:b.jsx(_j,{})}),b.jsxs("body",{children:[e,b.jsx(Ej,{})]})]})}const zQ=()=>zr(()=>import("./trash-C3Lt5m9d.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),LQ=ir("/trash")({component:jr(zQ,"component")}),PQ=()=>zr(()=>import("./taxonomies-WG8YV2pR.js"),__vite__mapDeps([10,4,11,1,5,6,12,9])),$Q=ir("/taxonomies")({component:jr(PQ,"component")}),FQ=()=>zr(()=>import("./settings-DB6TvceQ.js"),__vite__mapDeps([13,14,1,5,15,6,7,9])),UQ=ir("/settings")({component:jr(FQ,"component")}),BQ=()=>zr(()=>import("./media-Cx9IyZvU.js"),__vite__mapDeps([16,17,18,1,2,3,4,19,20,6,11,8,9])),qQ=ir("/media")({component:jr(BQ,"component")}),VQ=()=>zr(()=>import("./content-types-QYcwm0Sy.js"),__vite__mapDeps([21,1,2,3,4,6,11,9])),HQ=ir("/content-types")({component:jr(VQ,"component")}),ZQ=()=>zr(()=>import("./content-DdQ1u7T4.js"),__vite__mapDeps([22,14,23,6,1,2,3,4,24,9])),QQ=ir("/content")({component:jr(ZQ,"component")}),GQ=()=>zr(()=>import("./index-kxLB3e43.js"),__vite__mapDeps([25,1,7,18,9])),YQ=ir("/")({component:jr(GQ,"component")}),KQ=()=>zr(()=>import("./_entryId-Dhq6ybYt.js"),__vite__mapDeps([26,27,15,17,18,4,11,3,20,6,24,12,23,14,28])),XQ=ir("/entries/$entryId")({component:jr(KQ,"component")}),JQ=()=>zr(()=>import("./_contentTypeId-vT09P77i.js"),__vite__mapDeps([29,14,28,1,2,3,24,6,4,19,20])),WQ=ir("/entries/type/$contentTypeId")({component:jr(JQ,"component")}),eG=()=>zr(()=>import("./new._contentTypeId-2HsDwzy_.js"),__vite__mapDeps([30,27,15,17,18,4,11,3,20,6,24,12,23,28])),tG=ir("/entries/new/$contentTypeId")({component:jr(eG,"component")}),nG=LQ.update({id:"/trash",path:"/trash",getParentRoute:()=>ur}),rG=$Q.update({id:"/taxonomies",path:"/taxonomies",getParentRoute:()=>ur}),oG=UQ.update({id:"/settings",path:"/settings",getParentRoute:()=>ur}),sG=qQ.update({id:"/media",path:"/media",getParentRoute:()=>ur}),iG=HQ.update({id:"/content-types",path:"/content-types",getParentRoute:()=>ur}),aG=QQ.update({id:"/content",path:"/content",getParentRoute:()=>ur}),lG=YQ.update({id:"/",path:"/",getParentRoute:()=>ur}),cG=XQ.update({id:"/entries/$entryId",path:"/entries/$entryId",getParentRoute:()=>ur}),uG=WQ.update({id:"/entries/type/$contentTypeId",path:"/entries/type/$contentTypeId",getParentRoute:()=>ur}),dG=tG.update({id:"/entries/new/$contentTypeId",path:"/entries/new/$contentTypeId",getParentRoute:()=>ur}),fG={IndexRoute:lG,ContentRoute:aG,ContentTypesRoute:iG,MediaRoute:sG,SettingsRoute:oG,TaxonomiesRoute:rG,TrashRoute:nG,EntriesEntryIdRoute:cG,EntriesNewContentTypeIdRoute:dG,EntriesTypeContentTypeIdRoute:uG},hG=ur._addFileChildren(fG);function pG(){return gj({routeTree:hG,scrollRestoration:!0,defaultPreload:"intent"})}async function mG(){const e=await pG();let t;return t=[],window.__TSS_START_OPTIONS__={serializationAdapters:t},t.push(Vj),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:"",serializationAdapters:t}),e.state.matches.length||await Aj(e),e}async function gG(){const e=await mG();return window.$_TSR?.h(),e}let Im;function yG(){return Im||(Im=gG()),b.jsx(LD,{promise:Im,children:e=>b.jsx(bj,{router:e})})}S.startTransition(()=>{DO.hydrateRoot(document,b.jsx(S.StrictMode,{children:b.jsx(yG,{})}))});export{OP as $,bV as A,SV as B,co as C,gV as D,w1 as E,iP as F,Ul as G,MP as H,Is as I,zZ as J,LZ as K,tr as L,PZ as M,C_ as N,nP as O,S1 as P,R_ as Q,_Q as R,Cm as S,u3 as T,CP as U,b1 as V,pP as W,Sd as X,wV as Y,xV as Z,LG as _,Xx as a,lP as a0,GL as a1,a3 as a2,X7 as a3,fP as a4,p1 as a5,qm as a6,_1 as a7,v1 as a8,qL as a9,cr as aA,$r as aB,me as aC,vr as aD,Mt as aE,d_ as aF,es as aG,eR as aH,tR as aI,mr as aJ,gH as aK,yH as aL,sA as aM,Cq as aN,cV as aO,uV as aP,dV as aQ,fV as aR,lc as aS,JC as aT,x1 as aa,YP as ab,kV as ac,xt as ad,Gd as ae,Ag as af,XQ as ag,WQ as ah,Ls as ai,g1 as aj,N_ as ak,O_ as al,k_ as am,dC as an,W$ as ao,jG as ap,Wm as aq,tG as ar,tn as as,MV as at,AP as au,KL as av,ZL as aw,Ze as ax,Ny as ay,Ne as az,Am as b,Rm as c,Nm as d,Al as e,f3 as f,u_ as g,De as h,$G as i,b as j,AQ as k,Se as l,vC as m,Cy as n,FV as o,s3 as p,Js as q,S as r,FL as s,r3 as t,f1 as u,by as v,DP as w,m1 as x,zG as y,uf as z};