convex-cms 0.0.9-alpha.7 → 0.0.9-alpha.9

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 (87) hide show
  1. package/README.md +27 -0
  2. package/admin/src/components/cmsds/CmsFilterBar.tsx +74 -0
  3. package/admin/src/components/cmsds/CmsInput.tsx +24 -0
  4. package/admin/src/components/cmsds/CmsPagination.tsx +79 -0
  5. package/admin/src/components/cmsds/CmsSelect.tsx +59 -0
  6. package/admin/src/components/cmsds/CmsStatCard.tsx +79 -0
  7. package/admin/src/components/cmsds/CmsStatusBadge.tsx +1 -1
  8. package/admin/src/components/cmsds/index.ts +5 -0
  9. package/admin/src/contexts/ThemeContext.tsx +85 -17
  10. package/admin/src/embed/components/EmbedHeader.tsx +11 -9
  11. package/admin/src/embed/index.tsx +10 -6
  12. package/admin/src/embed/types.ts +12 -0
  13. package/admin/src/pages/ContentPage.tsx +116 -172
  14. package/admin/src/pages/ContentTypeEntriesPage.tsx +120 -194
  15. package/admin/src/pages/ContentTypesPage.tsx +136 -139
  16. package/admin/src/pages/DashboardPage.tsx +13 -52
  17. package/admin/src/pages/MediaPage.tsx +31 -57
  18. package/admin/src/pages/SettingsPage.tsx +5 -1
  19. package/admin/src/pages/TrashPage.tsx +115 -170
  20. package/admin/src/styles/globals.css +18 -31
  21. package/admin/src/styles/tailwind-config.css +12 -0
  22. package/admin/src/styles/theme.css +299 -38
  23. package/admin-dist/nitro.json +1 -1
  24. package/admin-dist/public/assets/{CmsEmptyState-gxhf-b6F.js → CmsEmptyState-DTlpzjOI.js} +1 -1
  25. package/admin-dist/public/assets/{CmsPageHeader-equV7Sd9.js → CmsPageHeader-0REGRH4X.js} +1 -1
  26. package/admin-dist/public/assets/{CmsStatusBadge-DQAslyW4.js → CmsStatusBadge-D_n8u8xa.js} +1 -1
  27. package/admin-dist/public/assets/{CmsSurface-DdC_aGB5.js → CmsSurface-BHmvNai4.js} +1 -1
  28. package/admin-dist/public/assets/{CmsToolbar-Crleacii.js → CmsToolbar-CY6GV2L8.js} +1 -1
  29. package/admin-dist/public/assets/{ContentEntryEditor-RmtIo3lE.js → ContentEntryEditor-CRgcRkk5.js} +1 -1
  30. package/admin-dist/public/assets/{TaxonomyFilter-BsoK90hw.js → TaxonomyFilter-Ohv5Jg9c.js} +1 -1
  31. package/admin-dist/public/assets/{_contentTypeId-Bn2ItET5.js → _contentTypeId-C_vJq22X.js} +1 -1
  32. package/admin-dist/public/assets/{_entryId-CkZWLvOZ.js → _entryId-jPXz4z9T.js} +1 -1
  33. package/admin-dist/public/assets/{alert-C7q0k4u0.js → alert-CG97cMfC.js} +1 -1
  34. package/admin-dist/public/assets/{badge-DiaAY1It.js → badge-C6qt24oj.js} +1 -1
  35. package/admin-dist/public/assets/{circle-check-big-Bl0y10am.js → circle-check-big-PltpxuB1.js} +1 -1
  36. package/admin-dist/public/assets/{command-QyTDg7pa.js → command-CJ8i86fd.js} +1 -1
  37. package/admin-dist/public/assets/{content-D868GT7T.js → content-pKaIL2ru.js} +1 -1
  38. package/admin-dist/public/assets/{content-types-DD7fJA5i.js → content-types-Bl_8I1Re.js} +1 -1
  39. package/admin-dist/public/assets/{index-CMnzrG_D.js → index-CtHq_P5q.js} +1 -1
  40. package/admin-dist/public/assets/{main-DWSY6jZL.js → main-CA-4LyFT.js} +2 -2
  41. package/admin-dist/public/assets/{media-aqxopgtw.js → media-Bl1tBbJQ.js} +1 -1
  42. package/admin-dist/public/assets/{new._contentTypeId-9ji3Hibs.js → new._contentTypeId-qsvo01mH.js} +1 -1
  43. package/admin-dist/public/assets/{pencil-D8GqMaV3.js → pencil-gAL0R34f.js} +1 -1
  44. package/admin-dist/public/assets/{refresh-cw-JipRPLLT.js → refresh-cw-sdVUGJNs.js} +1 -1
  45. package/admin-dist/public/assets/{rotate-ccw-CK11hP79.js → rotate-ccw-6OcXCcxb.js} +1 -1
  46. package/admin-dist/public/assets/{scroll-area-CJS1P20j.js → scroll-area-CJBhf9pf.js} +1 -1
  47. package/admin-dist/public/assets/{search-BT8HTHxb.js → search-WXp6KxDJ.js} +1 -1
  48. package/admin-dist/public/assets/settings-D8crrFCn.js +1 -0
  49. package/admin-dist/public/assets/{switch-Cb-ecsrJ.js → switch-Ck9ecqEX.js} +1 -1
  50. package/admin-dist/public/assets/{tabs-CFEXN2p7.js → tabs-vQYu8rjC.js} +1 -1
  51. package/admin-dist/public/assets/{tanstack-adapter-CGxC-fmP.js → tanstack-adapter-BRt2CUCw.js} +1 -1
  52. package/admin-dist/public/assets/{taxonomies-C21Z8CBa.js → taxonomies-DvILUNvr.js} +1 -1
  53. package/admin-dist/public/assets/{trash-CMRJlzc0.js → trash-YyYaC3L9.js} +1 -1
  54. package/admin-dist/public/assets/{useBreadcrumbLabel-ZZFYdqzi.js → useBreadcrumbLabel-tlSh7dtO.js} +1 -1
  55. package/admin-dist/public/assets/{usePermissions-C2FRye75.js → usePermissions-BTGdTOJS.js} +1 -1
  56. package/admin-dist/server/_ssr/{CmsEmptyState-DWqt3y_O.mjs → CmsEmptyState-CB6e53i5.mjs} +1 -1
  57. package/admin-dist/server/_ssr/{CmsPageHeader-BuN0dOPA.mjs → CmsPageHeader-COUHuECp.mjs} +1 -1
  58. package/admin-dist/server/_ssr/{CmsStatusBadge-CV35-X_8.mjs → CmsStatusBadge-kMTL6koE.mjs} +2 -2
  59. package/admin-dist/server/_ssr/{CmsSurface-DEcWf_aJ.mjs → CmsSurface-D1HDYjRg.mjs} +1 -1
  60. package/admin-dist/server/_ssr/{CmsToolbar-BMBEZVgb.mjs → CmsToolbar-NB014hsd.mjs} +1 -1
  61. package/admin-dist/server/_ssr/{ContentEntryEditor-Db9Sy_0y.mjs → ContentEntryEditor-Bq8FR_uK.mjs} +8 -8
  62. package/admin-dist/server/_ssr/{TaxonomyFilter-D_xDfC8t.mjs → TaxonomyFilter-bm_p4ADg.mjs} +3 -3
  63. package/admin-dist/server/_ssr/{_contentTypeId-HZlfcQi-.mjs → _contentTypeId-B7obLmi_.mjs} +10 -10
  64. package/admin-dist/server/_ssr/{_entryId-Cc_Ry7AV.mjs → _entryId-B4zhQqFg.mjs} +11 -11
  65. package/admin-dist/server/_ssr/_tanstack-start-manifest_v-DndoqCo7.mjs +4 -0
  66. package/admin-dist/server/_ssr/{badge-CmG74mbX.mjs → badge-NOEC9bkk.mjs} +1 -1
  67. package/admin-dist/server/_ssr/{command-DWXiOsOb.mjs → command-h4-OYNBo.mjs} +1 -1
  68. package/admin-dist/server/_ssr/{content-CAgFQzx-.mjs → content-CShtLuhK.mjs} +8 -8
  69. package/admin-dist/server/_ssr/{content-types-CqKvAZ8P.mjs → content-types-PeyRyfbc.mjs} +6 -6
  70. package/admin-dist/server/_ssr/{index--qYdIqvh.mjs → index-CplFXpGg.mjs} +3 -3
  71. package/admin-dist/server/_ssr/index.mjs +2 -2
  72. package/admin-dist/server/_ssr/{media-AXePwPAK.mjs → media-QAkNdX54.mjs} +9 -9
  73. package/admin-dist/server/_ssr/{new._contentTypeId-DNWIl-Ha.mjs → new._contentTypeId-DEJyMphJ.mjs} +10 -10
  74. package/admin-dist/server/_ssr/{router-B_gIkxi2.mjs → router-CQXMuGMF.mjs} +10 -10
  75. package/admin-dist/server/_ssr/{scroll-area-Cz-9ry0J.mjs → scroll-area-B7zoNyWB.mjs} +1 -1
  76. package/admin-dist/server/_ssr/{settings-BjSxo5d6.mjs → settings-CNaqVa4D.mjs} +9 -9
  77. package/admin-dist/server/_ssr/{switch-IsC1gdb1.mjs → switch-BKZhvryc.mjs} +1 -1
  78. package/admin-dist/server/_ssr/{tabs-BdgLwrYe.mjs → tabs-DtIIQxiD.mjs} +1 -1
  79. package/admin-dist/server/_ssr/{tanstack-adapter-CFwjrqRl.mjs → tanstack-adapter-CLavdbUY.mjs} +1 -1
  80. package/admin-dist/server/_ssr/{taxonomies-D5Di9EgA.mjs → taxonomies-vIZYICzr.mjs} +7 -7
  81. package/admin-dist/server/_ssr/{trash-DokZl1yA.mjs → trash-7yGR4-dF.mjs} +7 -7
  82. package/admin-dist/server/_ssr/{useBreadcrumbLabel-C4TsA5z0.mjs → useBreadcrumbLabel-DR5FaAMf.mjs} +1 -1
  83. package/admin-dist/server/_ssr/{usePermissions-COsRlMp-.mjs → usePermissions-DKkpETj_.mjs} +1 -1
  84. package/admin-dist/server/index.mjs +155 -155
  85. package/package.json +1 -1
  86. package/admin-dist/public/assets/settings-DCY0s2hR.js +0 -1
  87. package/admin-dist/server/_ssr/_tanstack-start-manifest_v-DhspKP9e.mjs +0 -4
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/trash-CMRJlzc0.js","assets/CmsPageHeader-equV7Sd9.js","assets/CmsToolbar-Crleacii.js","assets/search-BT8HTHxb.js","assets/CmsEmptyState-gxhf-b6F.js","assets/CmsSurface-DdC_aGB5.js","assets/badge-DiaAY1It.js","assets/alert-C7q0k4u0.js","assets/rotate-ccw-CK11hP79.js","assets/tanstack-adapter-CGxC-fmP.js","assets/taxonomies-C21Z8CBa.js","assets/pencil-D8GqMaV3.js","assets/scroll-area-CJS1P20j.js","assets/settings-DCY0s2hR.js","assets/usePermissions-C2FRye75.js","assets/switch-Cb-ecsrJ.js","assets/media-aqxopgtw.js","assets/tabs-CFEXN2p7.js","assets/refresh-cw-JipRPLLT.js","assets/TaxonomyFilter-BsoK90hw.js","assets/command-QyTDg7pa.js","assets/content-types-DD7fJA5i.js","assets/content-D868GT7T.js","assets/circle-check-big-Bl0y10am.js","assets/CmsStatusBadge-DQAslyW4.js","assets/index-CMnzrG_D.js","assets/_entryId-CkZWLvOZ.js","assets/ContentEntryEditor-RmtIo3lE.js","assets/useBreadcrumbLabel-ZZFYdqzi.js","assets/_contentTypeId-Bn2ItET5.js","assets/new._contentTypeId-9ji3Hibs.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/trash-YyYaC3L9.js","assets/CmsPageHeader-0REGRH4X.js","assets/CmsToolbar-CY6GV2L8.js","assets/search-WXp6KxDJ.js","assets/CmsEmptyState-DTlpzjOI.js","assets/CmsSurface-BHmvNai4.js","assets/badge-C6qt24oj.js","assets/alert-CG97cMfC.js","assets/rotate-ccw-6OcXCcxb.js","assets/tanstack-adapter-BRt2CUCw.js","assets/taxonomies-DvILUNvr.js","assets/pencil-gAL0R34f.js","assets/scroll-area-CJBhf9pf.js","assets/settings-D8crrFCn.js","assets/usePermissions-BTGdTOJS.js","assets/switch-Ck9ecqEX.js","assets/media-Bl1tBbJQ.js","assets/tabs-vQYu8rjC.js","assets/refresh-cw-sdVUGJNs.js","assets/TaxonomyFilter-Ohv5Jg9c.js","assets/command-CJ8i86fd.js","assets/content-types-Bl_8I1Re.js","assets/content-pKaIL2ru.js","assets/circle-check-big-PltpxuB1.js","assets/CmsStatusBadge-D_n8u8xa.js","assets/index-CtHq_P5q.js","assets/_entryId-jPXz4z9T.js","assets/ContentEntryEditor-CRgcRkk5.js","assets/useBreadcrumbLabel-tlSh7dtO.js","assets/_contentTypeId-C_vJq22X.js","assets/new._contentTypeId-qsvo01mH.js"])))=>i.map(i=>d[i]);
2
2
  function RO(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 $_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lp={exports:{}},wl={};var Yw;function AO(){if(Yw)return wl;Yw=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 Kw;function NO(){return Kw||(Kw=1,Lp.exports=AO()),Lp.exports}var b=NO(),Pp={exports:{}},Re={};var Xw;function OO(){if(Xw)return Re;Xw=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 Jw;function ec(){return Jw||(Jw=1,Pp.exports=OO()),Pp.exports}var S=ec();const tn=$_(S),$d=RO({__proto__:null,default:tn},[S]);var $p={exports:{}},xl={},Fp={exports:{}},Up={};var Ww;function kO(){return Ww||(Ww=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 ex;function MO(){return ex||(ex=1,Fp.exports=kO()),Fp.exports}var Bp={exports:{}},Wt={};var tx;function IO(){if(tx)return Wt;tx=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 nx;function F_(){if(nx)return Bp.exports;nx=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=IO(),Bp.exports}var rx;function DO(){if(rx)return xl;rx=1;var e=MO(),t=ec(),n=F_();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)?vw(r):0;break;default:if(r=s.tagName,s=s.namespaceURI)s=vw(s),r=bw(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=bw(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
3
  at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
4
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(`
@@ -104,4 +104,4 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
104
104
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
105
105
 
106
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},uV="DialogDescriptionWarning",dV=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${XC(uV).contentName}}.`;return S.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},fV=PC,hV=UC,pV=BC,mV=qC,gV=HC,yV=QC,vV=YC;function bV({...e}){return b.jsx(fV,{"data-slot":"dialog",...e})}function wV({...e}){return b.jsx(hV,{"data-slot":"dialog-portal",...e})}function xV({className:e,...t}){return b.jsx(pV,{"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 SV({className:e,children:t,showCloseButton:n=!0,...o}){return b.jsxs(wV,{"data-slot":"dialog-portal",children:[b.jsx(xV,{}),b.jsxs(mV,{"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(vV,{"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 _V({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 EV({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 TV({className:e,...t}){return b.jsx(gV,{"data-slot":"dialog-title",className:De("text-lg leading-none font-semibold",e),...t})}function CV({className:e,...t}){return b.jsx(yV,{"data-slot":"dialog-description",className:De("text-muted-foreground text-sm",e),...t})}var RV=Symbol.for("react.lazy"),kd=$d[" use ".trim().toString()];function AV(e){return typeof e=="object"&&e!==null&&"then"in e}function JC(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===RV&&"_payload"in e&&AV(e._payload)}function WC(e){const t=NV(e),n=S.forwardRef((o,i)=>{let{children:l,...u}=o;JC(l)&&typeof kd=="function"&&(l=kd(l._payload));const f=S.Children.toArray(l),h=f.find(kV);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 eR=WC("Slot");function NV(e){const t=S.forwardRef((n,o)=>{let{children:i,...l}=n;if(JC(i)&&typeof kd=="function"&&(i=kd(i._payload)),S.isValidElement(i)){const u=IV(i),f=MV(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 OV=Symbol("radix.slottable");function kV(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===OV}function MV(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 IV(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 l_=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,c_=A1,DV=(e,t)=>n=>{var o;if(t?.variants==null)return c_(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=l_(y)||l_(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 c_(e,u,h,n?.class,n?.className)},jV=DV("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?eR:"button";return b.jsx(l,{"data-slot":"button","data-variant":t,"data-size":n,className:De(jV({variant:t,size:n,className:e})),...i})}const u_={fast:"duration-100 ease-out"},zV={primary:"default",secondary:"secondary",danger:"destructive",ghost:"ghost",outline:"outline",link:"link",success:"default",warning:"default"},LV={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"},PV=()=>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=zV[e],h=LV[e];return l?b.jsx(Ul,{variant:f,disabled:n||t,className:De(u_.fast,h,i),asChild:!0,...u,children:o}):b.jsxs(Ul,{variant:f,disabled:n||t,className:De(u_.fast,h,i),...u,children:[t&&b.jsx(PV,{}),o]})}const $V={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl"};function Ry({open:e,onOpenChange:t,title:n,description:o,children:i,footer:l,size:u="md",className:f}){return b.jsx(bV,{open:e,onOpenChange:t,children:b.jsxs(SV,{className:De("flex max-h-[85vh] flex-col overflow-hidden",$V[u],f),children:[b.jsxs(_V,{className:"shrink-0",children:[b.jsx(TV,{children:n}),o&&b.jsx(CV,{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(EV,{className:"shrink-0 border-t pt-4",children:l})]})})}function UG({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(Ry,{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 FV=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],uf=FV.reduce((e,t)=>{const n=WC(`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}},{}),UV="Label",tR=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())}}));tR.displayName=UV;var BV=tR;function tr({className:e,...t}){return b.jsx(BV,{"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 qV({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 nR(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 rR(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",[VV]=$r(df),[HV,Ay]=VV(df);function ZV(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(HV,{scope:t,...M,children:QV(v)?v(M):o})}var oR="CheckboxTrigger",sR=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}=Ay(oR,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":dR(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())})})});sR.displayName=oR;var iR=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(ZV,{__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(sR,{...v,ref:t,__scopeCheckbox:n}),w&&b.jsx(uR,{__scopeCheckbox:n})]})})});iR.displayName=df;var aR="CheckboxIndicator",lR=S.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:o,...i}=e,l=Ay(aR,n);return b.jsx(cr,{present:o||Ko(l.checked)||l.checked===!0,children:b.jsx(Ne.span,{"data-state":dR(l.checked),"data-disabled":l.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});lR.displayName=aR;var cR="CheckboxBubbleInput",uR=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:_}=Ay(cR,e),R=Ze(n,_),x=nR(l),C=rR(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%)"}})});uR.displayName=cR;function QV(e){return typeof e=="function"}function Ko(e){return e==="indeterminate"}function dR(e){return Ko(e)?"indeterminate":e?"checked":"unchecked"}function d_({className:e,...t}){return b.jsx(iR,{"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(lR,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:b.jsx(y1,{className:"size-3.5"})})})}function f_(e,[t,n]){return Math.min(n,Math.max(t,e))}function Ny(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 GV=S.createContext(void 0);function Oy(e){const t=S.useContext(GV);return e||t||"ltr"}const YV=["top","right","bottom","left"],ts=Math.min,Pn=Math.max,Md=Math.round,Xu=Math.floor,Mr=e=>({x:e,y:e}),KV={left:"right",right:"left",bottom:"top",top:"bottom"},XV={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 ky(e){return e==="x"?"y":"x"}function My(e){return e==="y"?"height":"width"}const JV=new Set(["top","bottom"]);function kr(e){return JV.has(po(e))?"y":"x"}function Iy(e){return ky(kr(e))}function WV(e,t,n){n===void 0&&(n=!1);const o=Ea(e),i=Iy(e),l=My(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 e9(e){const t=Id(e);return[ag(e),t,ag(t)]}function ag(e){return e.replace(/start|end/g,t=>XV[t])}const h_=["left","right"],p_=["right","left"],t9=["top","bottom"],n9=["bottom","top"];function r9(e,t,n){switch(e){case"top":case"bottom":return n?t?p_:h_:t?h_:p_;case"left":case"right":return t?t9:n9;default:return[]}}function o9(e,t,n,o){const i=Ea(e);let l=r9(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=>KV[t])}function s9(e){return{top:0,right:0,bottom:0,left:0,...e}}function fR(e){return typeof e!="number"?s9(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 m_(e,t,n){let{reference:o,floating:i}=e;const l=kr(t),u=Iy(t),f=My(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 i9(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=fR(_),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 a9=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}=m_(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:i9},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}=m_(p,w,h)),C=-1)}return{x:y,y:v,placement:w,strategy:i,middlewareData:_}},l9=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=fR(y),w={x:n,y:o},_=Iy(i),R=My(_),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}}}),c9=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)]:e9(f)),V=R!=="none";!w&&V&&$.push(...o9(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=WV(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 g_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function y_(e){return YV.some(t=>e[t]>=0)}const u9=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=g_(u,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:y_(f)}}}case"escaped":{const u=await o.detectOverflow(t,{...l,altBoundary:!0}),f=g_(u,n.floating);return{data:{escapedOffsets:f,escaped:y_(f)}}}default:return{}}}}},hR=new Set(["left","top"]);async function d9(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=hR.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 f9=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 d9(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}}}}},h9=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)),_=ky(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}}}}}},p9=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=ky(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=hR.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}}}},m9=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 pR(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=(pR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pR(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 v_(e){return!ff()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Fn(e).ShadowRoot}const g9=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)&&!g9.has(i)}const y9=new Set(["table","td","th"]);function v9(e){return y9.has(Ta(e))}const b9=[":popover-open",":modal"];function hf(e){return b9.some(t=>{try{return e.matches(t)}catch{return!1}})}const w9=["transform","translate","scale","rotate","perspective"],x9=["transform","translate","scale","rotate","perspective","filter"],S9=["paint","layout","strict","content"];function Dy(e){const t=jy(),n=br(e)?wr(e):e;return w9.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)||x9.some(o=>(n.willChange||"").includes(o))||S9.some(o=>(n.contain||"").includes(o))}function _9(e){let t=ns(e);for(;Dr(t)&&!pa(t);){if(Dy(t))return t;if(hf(t))return null;t=ns(t)}return null}function jy(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const E9=new Set(["html","body","#document"]);function pa(e){return E9.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||v_(e)&&e.host||Fr(e);return v_(t)?t.host:t}function mR(e){const t=ns(e);return pa(t)?e.ownerDocument?e.ownerDocument.body:e.body:Dr(t)&&hc(t)?t:mR(t)}function Xl(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=mR(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 gR(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 zy(e){return br(e)?e:e.contextElement}function la(e){const t=zy(e);if(!Dr(t))return Mr(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:l}=gR(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 T9=Mr(0);function yR(e){const t=Fn(e);return!jy()||!t.visualViewport?T9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function C9(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=zy(e);let u=Mr(1);t&&(o?br(o)&&(u=la(o)):u=la(e));const f=C9(l,n,o)?yR(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 vR(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 R9(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?vR(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 A9(e){return Array.from(e.getClientRects())}function N9(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 b_=25;function O9(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=jy();(!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<=b_&&(l-=R)}else p<=b_&&(l+=p);return{width:l,height:u,x:f,y:h}}const k9=new Set(["absolute","fixed"]);function M9(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 w_(e,t,n){let o;if(t==="viewport")o=O9(e,n);else if(t==="document")o=N9(Fr(e));else if(br(t))o=M9(t,n);else{const i=yR(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Dd(o)}function bR(e,t){const n=ns(e);return n===t||!br(n)||pa(n)?!1:wr(n).position==="fixed"||bR(n,t)}function I9(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=Dy(u);!h&&f.position==="fixed"&&(i=null),(l?!h&&!i:!h&&f.position==="static"&&!!i&&k9.has(i.position)||hc(u)&&!h&&bR(e,u))?o=o.filter(y=>y!==u):i=f,u=ns(u)}return t.set(e,o),o}function D9(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const u=[...n==="clippingAncestors"?hf(t)?[]:I9(t,this._c):[].concat(n),o],f=u[0],h=u.reduce((p,y)=>{const v=w_(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},w_(t,f,i));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function j9(e){const{width:t,height:n}=gR(e);return{width:t,height:n}}function z9(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?vR(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 x_(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 wR(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=x_(e,t);for(;o&&v9(o)&&Em(o);)o=x_(o,t);return o&&pa(o)&&Em(o)&&!Dy(o)?n:o||_9(e)||n}const L9=async function(e){const t=this.getOffsetParent||wR,n=this.getDimensions,o=await n(e.floating);return{reference:z9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function P9(e){return wr(e).direction==="rtl"}const $9={convertOffsetParentRelativeRectToViewportRelativeRect:R9,getDocumentElement:Fr,getClippingRect:D9,getOffsetParent:wR,getElementRects:L9,getClientRects:A9,getDimensions:j9,getScale:la,isElement:br,isRTL:P9};function xR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function F9(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&&!xR(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 U9(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=zy(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?F9(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&&!xR(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 B9=f9,q9=h9,V9=c9,H9=m9,Z9=u9,S_=l9,Q9=p9,G9=(e,t,n)=>{const o=new Map,i={platform:$9,...n},l={...i.platform,_c:o};return a9(e,t,{...i,platform:l})};var Y9=typeof document<"u",K9=function(){},sd=Y9?S.useLayoutEffect:K9;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 SR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function __(e,t){const n=SR(e);return Math.round(t*n)/n}function Tm(e){const t=S.useRef(e);return sd(()=>{t.current=e}),t}function X9(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),G9(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=__(F.floating,y.x),be=__(F.floating,y.y);return f?{...Z,transform:"translate("+ne+"px, "+be+"px)",...SR(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 J9=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?S_({element:o.current,padding:i}).fn(n):{}:o?S_({element:o,padding:i}).fn(n):{}}}},W9=(e,t)=>({...B9(e),options:[e,t]}),e7=(e,t)=>({...q9(e),options:[e,t]}),t7=(e,t)=>({...Q9(e),options:[e,t]}),n7=(e,t)=>({...V9(e),options:[e,t]}),r7=(e,t)=>({...H9(e),options:[e,t]}),o7=(e,t)=>({...Z9(e),options:[e,t]}),s7=(e,t)=>({...J9(e),options:[e,t]});var i7="Arrow",_R=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"})})});_R.displayName=i7;var a7=_R,Ly="Popper",[ER,Ca]=$r(Ly),[l7,TR]=ER(Ly),CR=e=>{const{__scopePopper:t,children:n}=e,[o,i]=S.useState(null);return b.jsx(l7,{scope:t,anchor:o,onAnchorChange:i,children:n})};CR.displayName=Ly;var RR="PopperAnchor",AR=S.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...i}=e,l=TR(RR,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})});AR.displayName=RR;var Py="PopperContent",[c7,u7]=ER(Py),NR=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=TR(Py,n),[N,k]=S.useState(null),O=Ze(t,J=>k(J)),[M,$]=S.useState(null),V=rR(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(f7),altBoundary:se},{refs:ce,floatingStyles:ge,placement:F,isPositioned:X,middlewareData:Z}=X9({strategy:"fixed",placement:Y,whileElementsMounted:(...J)=>U9(...J,{animationFrame:_==="always"}),elements:{reference:C.anchor},middleware:[W9({mainAxis:i+D,alignmentAxis:u}),h&&e7({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?t7():void 0,...ue}),h&&n7({...ue}),r7({...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&&s7({element:M,padding:f}),h7({arrowWidth:L,arrowHeight:D}),w&&o7({strategy:"referenceHidden",...ue})]}),[ne,be]=MR(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(c7,{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"}})})})});NR.displayName=Py;var OR="PopperArrow",d7={top:"bottom",right:"left",bottom:"top",left:"right"},kR=S.forwardRef(function(t,n){const{__scopePopper:o,...i}=t,l=u7(OR,o),u=d7[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(a7,{...i,ref:n,style:{...i.style,display:"block"}})})});kR.displayName=OR;function f7(e){return e!==null}var h7=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]=MR(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 MR(e){const[t,n="center"]=e.split("-");return[t,n]}var $y=CR,gf=AR,Fy=NR,Uy=kR,IR=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"}),p7="VisuallyHidden",m7=S.forwardRef((e,t)=>b.jsx(Ne.span,{...e,ref:t,style:{...IR,...e.style}}));m7.displayName=p7;var g7=[" ","Enter","ArrowUp","ArrowDown"],y7=[" ","Enter"],Gs="Select",[yf,vf,v7]=Ny(Gs),[Ra]=$r(Gs,[v7,Ca]),bf=Ca(),[b7,cs]=Ra(Gs),[w7,x7]=Ra(Gs),DR=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=Oy(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($y,{...x,children:b.jsxs(b7,{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(w7,{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(nA,{"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]})})};DR.displayName=Gs;var jR="SelectTrigger",zR=S.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...i}=e,l=bf(n),u=cs(jR,n),f=u.disabled||o,h=Ze(t,u.onTriggerChange),p=vf(n),y=S.useRef("touch"),[v,w,_]=oA(x=>{const C=p().filter(O=>!O.disabled),N=C.find(O=>O.value===u.value),k=sA(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":rA(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===" ")&&g7.includes(x.key)&&(R(),x.preventDefault())})})})});zR.displayName=jR;var LR="SelectValue",PR=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:i,children:l,placeholder:u="",...f}=e,h=cs(LR,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:rA(h.value)?b.jsx(b.Fragment,{children:u}):l})});PR.displayName=LR;var S7="SelectIcon",$R=S.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...i}=e;return b.jsx(Ne.span,{"aria-hidden":!0,...i,ref:t,children:o||"▼"})});$R.displayName=S7;var _7="SelectPortal",FR=e=>b.jsx(dc,{asChild:!0,...e});FR.displayName=_7;var Ys="SelectContent",UR=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(BR,{scope:e.__scopeSelect,children:b.jsx(yf.Slot,{scope:e.__scopeSelect,children:b.jsx("div",{children:e.children})})}),l):null}return b.jsx(qR,{...e,ref:t})});UR.displayName=Ys;var pr=10,[BR,us]=Ra(Ys),E7="SelectContentImpl",T7=Hs("SelectContent.RemoveScroll"),qR=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]=oA(J=>{const _e=se().filter(Oe=>!Oe.disabled),Te=_e.find(Oe=>Oe.ref.current===document.activeElement),Ce=sA(_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:VR,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(BR,{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:T7,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()}})})})})})})});qR.displayName=E7;var C7="SelectItemAlignedPosition",VR=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=f_(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=f_(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(A7,{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}})})})});VR.displayName=C7;var R7="SelectPopperPosition",cg=S.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:i=pr,...l}=e,u=bf(n);return b.jsx(Fy,{...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=R7;var[A7,By]=Ra(Ys,{}),ug="SelectViewport",HR=S.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...i}=e,l=us(ug,n),u=By(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})})})]})});HR.displayName=ug;var ZR="SelectGroup",[N7,O7]=Ra(ZR),k7=S.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,i=mr();return b.jsx(N7,{scope:n,id:i,children:b.jsx(Ne.div,{role:"group","aria-labelledby":i,...o,ref:t})})});k7.displayName=ZR;var QR="SelectLabel",M7=S.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,i=O7(QR,n);return b.jsx(Ne.div,{id:i.id,...o,ref:t})});M7.displayName=QR;var zd="SelectItem",[I7,GR]=Ra(zd),YR=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(I7,{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===" "||(y7.includes(k.key)&&N(),k.key===" "&&k.preventDefault())})})})})});YR.displayName=zd;var Il="SelectItemText",KR=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:i,...l}=e,u=cs(Il,n),f=us(Il,n),h=GR(Il,n),p=x7(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]})});KR.displayName=Il;var XR="SelectItemIndicator",JR=S.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return GR(XR,n).isSelected?b.jsx(Ne.span,{"aria-hidden":!0,...o,ref:t}):null});JR.displayName=XR;var dg="SelectScrollUpButton",WR=S.forwardRef((e,t)=>{const n=us(dg,e.__scopeSelect),o=By(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(tA,{...e,ref:u,onAutoScroll:()=>{const{viewport:f,selectedItem:h}=n;f&&h&&(f.scrollTop=f.scrollTop-h.offsetHeight)}}):null});WR.displayName=dg;var fg="SelectScrollDownButton",eA=S.forwardRef((e,t)=>{const n=us(fg,e.__scopeSelect),o=By(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(tA,{...e,ref:u,onAutoScroll:()=>{const{viewport:f,selectedItem:h}=n;f&&h&&(f.scrollTop=f.scrollTop+h.offsetHeight)}}):null});eA.displayName=fg;var tA=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()})})}),D7="SelectSeparator",j7=S.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return b.jsx(Ne.div,{"aria-hidden":!0,...o,ref:t})});j7.displayName=D7;var hg="SelectArrow",z7=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(Uy,{...i,...o,ref:t}):null});z7.displayName=hg;var L7="SelectBubbleInput",nA=S.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const i=S.useRef(null),l=Ze(o,i),u=nR(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:{...IR,...n.style},ref:l,defaultValue:t})});nA.displayName=L7;function rA(e){return e===""||e===void 0}function oA(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 sA(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=P7(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 P7(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var $7=DR,F7=zR,U7=PR,B7=$R,q7=FR,V7=UR,H7=HR,Z7=YR,Q7=KR,G7=JR,Y7=WR,K7=eA;function Cm({...e}){return b.jsx($7,{"data-slot":"select",...e})}function Rm({...e}){return b.jsx(U7,{"data-slot":"select-value",...e})}function Am({className:e,size:t="default",children:n,...o}){return b.jsxs(F7,{"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(B7,{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(q7,{children:b.jsxs(V7,{"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(X7,{}),b.jsx(H7,{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(J7,{})]})})}function Al({className:e,children:t,...n}){return b.jsxs(Z7,{"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(G7,{children:b.jsx(y1,{className:"size-4"})})}),b.jsx(Q7,{children:t})]})}function X7({className:e,...t}){return b.jsx(Y7,{"data-slot":"select-scroll-up-button",className:De("flex cursor-default items-center justify-center py-1",e),...t,children:b.jsx(v1,{className:"size-4"})})}function J7({className:e,...t}){return b.jsx(K7,{"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 W7({isOpen:e,onClose:t,breakingChanges:n,onForceUpdate:o,onCancel:i,isLoading:l}){const u=()=>{i(),t()};return b.jsx(Ry,{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(p3,{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(c3,{className:"size-4"}),description:"Single line text input"},richText:{label:"Rich Text",icon:b.jsx(uP,{className:"size-4"}),description:"Multi-line formatted text"},number:{label:"Number",icon:b.jsx(w1,{className:"size-4"}),description:"Numeric value"},boolean:{label:"Boolean",icon:b.jsx(T1,{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(AP,{className:"size-4"}),description:"Link to another content entry"},media:{label:"Media",icon:b.jsx(S1,{className:"size-4"}),description:"Image, video, or file"},json:{label:"JSON",icon:b.jsx(g1,{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(MP,{className:"size-4"}),description:"Multiple selections"},tags:{label:"Tags",icon:b.jsx(s3,{className:"size-4"}),description:"Free-form tag list"},category:{label:"Category",icon:b.jsx(pP,{className:"size-4"}),description:"Taxonomy category selection"}};function E_(e){return e.toLowerCase().trim().replace(/[^a-z0-9\s]/g,"").replace(/\s+/g,"_").replace(/^[0-9]/,"_$&").slice(0,64)}function T_(e){return/^[a-z][a-z0-9_]{0,63}$/.test(e)}function eH({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=wC(),re=Jx(G.createContentType),oe=Jx(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(E_(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()?T_(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(Ry,{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(KL,{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(!T_(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(qV,{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(d_,{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(E1,{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(v1,{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:E_(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(d_,{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(tH,{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(W7,{isOpen:Z,onClose:()=>ne(!1),breakingChanges:F,onForceUpdate:qn,onCancel:()=>{ne(!1),X([])},isLoading:be})]})}function tH({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(E1,{className:"size-3.5"}),"Add Option"]})]})}function nH(){const t=xt().location.pathname,n=by(),{navItems:o,branding:i,layout:l}=n,u=wC(),[f,h]=S.useState(!1),p=p1(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(GS,{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(Jq,{defaultOpen:w,children:[b.jsxs(Wq,{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(GS,{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(e8,{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(_1,{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(eH,{isOpen:f,onClose:()=>h(!1)})]})}function rH({...e}){return b.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function oH({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 sH({className:e,...t}){return b.jsx("li",{"data-slot":"breadcrumb-item",className:De("inline-flex items-center gap-1.5",e),...t})}function iH({asChild:e,className:t,...n}){const o=e?eR:"a";return b.jsx(o,{"data-slot":"breadcrumb-link",className:De("hover:text-foreground transition-colors",t),...n})}function aH({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 lH({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(BL,{})})}var km="rovingFocusGroup.onEntryFocus",cH={bubbles:!1,cancelable:!0},pc="RovingFocusGroup",[pg,iA,uH]=Ny(pc),[dH,aA]=$r(pc,[uH]),[fH,hH]=dH(pc),lA=S.forwardRef((e,t)=>b.jsx(pg.Provider,{scope:e.__scopeRovingFocusGroup,children:b.jsx(pg.Slot,{scope:e.__scopeRovingFocusGroup,children:b.jsx(pH,{...e,ref:t})})}));lA.displayName=pc;var pH=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=Oy(l),[x,C]=es({prop:u,defaultProp:f??null,onChange:h,caller:pc}),[N,k]=S.useState(!1),O=vr(p),M=iA(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(fH,{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,cH);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);dA(ge,y)}}$.current=!1}),onBlur:me(e.onBlur,()=>k(!1))})})}),cA="RovingFocusGroupItem",uA=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=hH(cA,n),v=y.currentTabStopId===p,w=iA(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=yH(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?vH(O,M+1):O.slice(M+1)}setTimeout(()=>dA(O))}}),children:typeof u=="function"?u({isCurrentTabStop:v,hasTabStop:x!=null}):u})})});uA.displayName=cA;var mH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function gH(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function yH(e,t,n){const o=gH(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return mH[o]}function dA(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function vH(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var bH=lA,wH=uA,mg=["Enter"," "],xH=["ArrowDown","PageUp","Home"],fA=["ArrowUp","PageDown","End"],SH=[...xH,...fA],_H={ltr:[...mg,"ArrowRight"],rtl:[...mg,"ArrowLeft"]},EH={ltr:["ArrowLeft"],rtl:["ArrowRight"]},mc="Menu",[Jl,TH,CH]=Ny(mc),[ei,hA]=$r(mc,[CH,Ca,aA]),wf=Ca(),pA=aA(),[RH,ti]=ei(mc),[AH,gc]=ei(mc),mA=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=Oy(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($y,{...f,children:b.jsx(RH,{scope:t,open:n,onOpenChange:v,content:h,onContentChange:p,children:b.jsx(AH,{scope:t,onClose:S.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:y,dir:w,modal:u,children:o})})})};mA.displayName=mc;var NH="MenuAnchor",qy=S.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,i=wf(n);return b.jsx(gf,{...i,...o,ref:t})});qy.displayName=NH;var Vy="MenuPortal",[OH,gA]=ei(Vy,{forceMount:void 0}),yA=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:i}=e,l=ti(Vy,t);return b.jsx(OH,{scope:t,forceMount:n,children:b.jsx(cr,{present:n||l.open,children:b.jsx(dc,{asChild:!0,container:i,children:o})})})};yA.displayName=Vy;var sr="MenuContent",[kH,Hy]=ei(sr),vA=S.forwardRef((e,t)=>{const n=gA(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(MH,{...i,ref:t}):b.jsx(IH,{...i,ref:t})})})})}),MH=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(Zy,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:me(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),IH=S.forwardRef((e,t)=>{const n=ti(sr,e.__scopeMenu);return b.jsx(Zy,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),DH=Hs("MenuContent.ScrollLock"),Zy=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=pA(n),M=TH(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:DH,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=ZH(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&&GH(ne,se.current?.area),[]);return b.jsx(kH,{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(bH,{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(Fy,{role:"menu","aria-orientation":"vertical","data-state":DA(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||!SH.includes(ne.key))return;ne.preventDefault();const ve=M().filter(J=>!J.disabled).map(J=>J.ref.current);fA.includes(ne.key)&&ve.reverse(),VH(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}}))})})})})})})});vA.displayName=sr;var jH="MenuGroup",Qy=S.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return b.jsx(Ne.div,{role:"group",...o,ref:t})});Qy.displayName=jH;var zH="MenuLabel",bA=S.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return b.jsx(Ne.div,{...o,ref:t})});bA.displayName=zH;var Ld="MenuItem",C_="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=Hy(Ld,e.__scopeMenu),h=Ze(t,l),p=S.useRef(!1),y=()=>{const v=l.current;if(!n&&v){const w=new CustomEvent(C_,{bubbles:!0,cancelable:!0});v.addEventListener(C_,_=>o?.(_),{once:!0}),xC(v,w),w.defaultPrevented?p.current=!1:u.onClose()}};return b.jsx(wA,{...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 wA=S.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:i,...l}=e,u=Hy(Ld,n),f=pA(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(wH,{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))})})})}),LH="MenuCheckboxItem",xA=S.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...i}=e;return b.jsx(CA,{scope:e.__scopeMenu,checked:n,children:b.jsx(xf,{role:"menuitemcheckbox","aria-checked":Pd(n)?"mixed":n,...i,ref:t,"data-state":Yy(n),onSelect:me(i.onSelect,()=>o?.(Pd(n)?!0:!n),{checkForDefaultPrevented:!1})})})});xA.displayName=LH;var SA="MenuRadioGroup",[PH,$H]=ei(SA,{value:void 0,onValueChange:()=>{}}),_A=S.forwardRef((e,t)=>{const{value:n,onValueChange:o,...i}=e,l=vr(o);return b.jsx(PH,{scope:e.__scopeMenu,value:n,onValueChange:l,children:b.jsx(Qy,{...i,ref:t})})});_A.displayName=SA;var EA="MenuRadioItem",TA=S.forwardRef((e,t)=>{const{value:n,...o}=e,i=$H(EA,e.__scopeMenu),l=n===i.value;return b.jsx(CA,{scope:e.__scopeMenu,checked:l,children:b.jsx(xf,{role:"menuitemradio","aria-checked":l,...o,ref:t,"data-state":Yy(l),onSelect:me(o.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});TA.displayName=EA;var Gy="MenuItemIndicator",[CA,FH]=ei(Gy,{checked:!1}),RA=S.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...i}=e,l=FH(Gy,n);return b.jsx(cr,{present:o||Pd(l.checked)||l.checked===!0,children:b.jsx(Ne.span,{...i,ref:t,"data-state":Yy(l.checked)})})});RA.displayName=Gy;var UH="MenuSeparator",AA=S.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return b.jsx(Ne.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});AA.displayName=UH;var BH="MenuArrow",NA=S.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,i=wf(n);return b.jsx(Uy,{...i,...o,ref:t})});NA.displayName=BH;var qH="MenuSub",[BG,OA]=ei(qH),Dl="MenuSubTrigger",kA=S.forwardRef((e,t)=>{const n=ti(Dl,e.__scopeMenu),o=gc(Dl,e.__scopeMenu),i=OA(Dl,e.__scopeMenu),l=Hy(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(qy,{asChild:!0,...p,children:b.jsx(wA,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":DA(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===" "||_H[o.dir].includes(v.key)&&(n.onOpenChange(!0),n.content?.focus(),v.preventDefault())})})})});kA.displayName=Dl;var MA="MenuSubContent",IA=S.forwardRef((e,t)=>{const n=gA(sr,e.__scopeMenu),{forceMount:o=n.forceMount,...i}=e,l=ti(sr,e.__scopeMenu),u=gc(sr,e.__scopeMenu),f=OA(MA,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(Zy,{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=EH[u.dir].includes(y.key);v&&w&&(l.onOpenChange(!1),f.trigger?.focus(),y.preventDefault())})})})})})});IA.displayName=MA;function DA(e){return e?"open":"closed"}function Pd(e){return e==="indeterminate"}function Yy(e){return Pd(e)?"indeterminate":e?"checked":"unchecked"}function VH(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function HH(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function ZH(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=HH(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 QH(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 GH(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return QH(n,t)}function Wl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var YH=mA,KH=qy,XH=yA,JH=vA,WH=Qy,eZ=bA,tZ=xf,nZ=xA,rZ=_A,oZ=TA,sZ=RA,iZ=AA,aZ=NA,lZ=kA,cZ=IA,Sf="DropdownMenu",[uZ]=$r(Sf,[hA]),fn=hA(),[dZ,jA]=uZ(Sf),zA=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(dZ,{scope:t,triggerId:mr(),triggerRef:p,contentId:mr(),open:y,onOpenChange:v,onOpenToggle:S.useCallback(()=>v(w=>!w),[v]),modal:f,children:b.jsx(YH,{...h,open:y,onOpenChange:v,dir:o,modal:f,children:n})})};zA.displayName=Sf;var LA="DropdownMenuTrigger",PA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...i}=e,l=jA(LA,n),u=fn(n);return b.jsx(KH,{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())})})})});PA.displayName=LA;var fZ="DropdownMenuPortal",$A=e=>{const{__scopeDropdownMenu:t,...n}=e,o=fn(t);return b.jsx(XH,{...o,...n})};$A.displayName=fZ;var FA="DropdownMenuContent",UA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=jA(FA,n),l=fn(n),u=S.useRef(!1);return b.jsx(JH,{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)"}})});UA.displayName=FA;var hZ="DropdownMenuGroup",pZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(WH,{...i,...o,ref:t})});pZ.displayName=hZ;var mZ="DropdownMenuLabel",BA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(eZ,{...i,...o,ref:t})});BA.displayName=mZ;var gZ="DropdownMenuItem",qA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(tZ,{...i,...o,ref:t})});qA.displayName=gZ;var yZ="DropdownMenuCheckboxItem",vZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(nZ,{...i,...o,ref:t})});vZ.displayName=yZ;var bZ="DropdownMenuRadioGroup",wZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(rZ,{...i,...o,ref:t})});wZ.displayName=bZ;var xZ="DropdownMenuRadioItem",SZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(oZ,{...i,...o,ref:t})});SZ.displayName=xZ;var _Z="DropdownMenuItemIndicator",EZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(sZ,{...i,...o,ref:t})});EZ.displayName=_Z;var TZ="DropdownMenuSeparator",VA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(iZ,{...i,...o,ref:t})});VA.displayName=TZ;var CZ="DropdownMenuArrow",RZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(aZ,{...i,...o,ref:t})});RZ.displayName=CZ;var AZ="DropdownMenuSubTrigger",NZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(lZ,{...i,...o,ref:t})});NZ.displayName=AZ;var OZ="DropdownMenuSubContent",kZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(cZ,{...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)"}})});kZ.displayName=OZ;var MZ=zA,IZ=PA,DZ=$A,jZ=UA,zZ=BA,LZ=qA,PZ=VA;function $Z({...e}){return b.jsx(MZ,{"data-slot":"dropdown-menu",...e})}function FZ({...e}){return b.jsx(IZ,{"data-slot":"dropdown-menu-trigger",...e})}function UZ({className:e,sideOffset:t=4,...n}){return b.jsx(DZ,{children:b.jsx(jZ,{"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 R_({className:e,inset:t,variant:n="default",...o}){return b.jsx(LZ,{"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 BZ({className:e,inset:t,...n}){return b.jsx(zZ,{"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 A_({className:e,...t}){return b.jsx(PZ,{"data-slot":"dropdown-menu-separator",className:De("bg-border -mx-1 my-1 h-px",e),...t})}function qZ(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,VZ(i,...t)]}function VZ(...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 HZ=$E();function ZZ(){return HZ.useSyncExternalStore(QZ,()=>!0,()=>!1)}function QZ(){return()=>{}}var Ky="Avatar",[GZ]=qZ(Ky),[YZ,HA]=GZ(Ky),ZA=S.forwardRef((e,t)=>{const{__scopeAvatar:n,...o}=e,[i,l]=S.useState("idle");return b.jsx(YZ,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:l,children:b.jsx(uf.span,{...o,ref:t})})});ZA.displayName=Ky;var QA="AvatarImage",GA=S.forwardRef((e,t)=>{const{__scopeAvatar:n,src:o,onLoadingStatusChange:i=()=>{},...l}=e,u=HA(QA,n),f=KZ(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});GA.displayName=QA;var YA="AvatarFallback",KA=S.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:o,...i}=e,l=HA(YA,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});KA.displayName=YA;function N_(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function KZ(e,{referrerPolicy:t,crossOrigin:n}){const o=ZZ(),i=S.useRef(null),l=o?(i.current||(i.current=new window.Image),i.current):null,[u,f]=S.useState(()=>N_(l,e));return Mt(()=>{f(N_(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 XZ=ZA,JZ=GA,WZ=KA;function eQ({className:e,...t}){return b.jsx(XZ,{"data-slot":"avatar",className:De("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function tQ({className:e,...t}){return b.jsx(JZ,{"data-slot":"avatar-image",className:De("aspect-square size-full",e),...t})}function nQ({className:e,...t}){return b.jsx(WZ,{"data-slot":"avatar-fallback",className:De("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}var _f="Popover",[XA]=$r(_f,[Ca]),yc=Ca(),[rQ,ds]=XA(_f),JA=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($y,{...f,children:b.jsx(rQ,{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})})};JA.displayName=_f;var WA="PopoverAnchor",oQ=S.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,i=ds(WA,n),l=yc(n),{onCustomAnchorAdd:u,onCustomAnchorRemove:f}=i;return S.useEffect(()=>(u(),()=>f()),[u,f]),b.jsx(gf,{...l,...o,ref:t})});oQ.displayName=WA;var eN="PopoverTrigger",tN=S.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,i=ds(eN,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":iN(i.open),...o,ref:u,onClick:me(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?f:b.jsx(gf,{asChild:!0,...l,children:f})});tN.displayName=eN;var Xy="PopoverPortal",[sQ,iQ]=XA(Xy,{forceMount:void 0}),nN=e=>{const{__scopePopover:t,forceMount:n,children:o,container:i}=e,l=ds(Xy,t);return b.jsx(sQ,{scope:t,forceMount:n,children:b.jsx(cr,{present:n||l.open,children:b.jsx(dc,{asChild:!0,container:i,children:o})})})};nN.displayName=Xy;var ma="PopoverContent",rN=S.forwardRef((e,t)=>{const n=iQ(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(lQ,{...i,ref:t}):b.jsx(cQ,{...i,ref:t})})});rN.displayName=ma;var aQ=Hs("PopoverContent.RemoveScroll"),lQ=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:aQ,allowPinchZoom:!0,children:b.jsx(oN,{...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})})})}),cQ=S.forwardRef((e,t)=>{const n=ds(ma,e.__scopePopover),o=S.useRef(!1),i=S.useRef(!1);return b.jsx(oN,{...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()}})}),oN=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(Fy,{"data-state":iN(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)"}})})})}),sN="PopoverClose",uQ=S.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,i=ds(sN,n);return b.jsx(Ne.button,{type:"button",...o,ref:t,onClick:me(e.onClick,()=>i.onOpenChange(!1))})});uQ.displayName=sN;var dQ="PopoverArrow",fQ=S.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,i=yc(n);return b.jsx(Uy,{...i,...o,ref:t})});fQ.displayName=dQ;function iN(e){return e?"open":"closed"}var hQ=JA,pQ=tN,mQ=nN,gQ=rN;function O_({...e}){return b.jsx(hQ,{"data-slot":"popover",...e})}function k_({...e}){return b.jsx(pQ,{"data-slot":"popover-trigger",...e})}function M_({className:e,align:t="center",sideOffset:n=4,...o}){return b.jsx(mQ,{children:b.jsx(gQ,{"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 yQ=[{keys:["⌘","S"],description:"Save entry"},{keys:["⌘","⇧","P"],description:"Publish entry"},{keys:["⌘","K"],description:"Quick search"},{keys:["Esc"],description:"Close modal/panel"}],vQ=[{label:"Documentation",url:"https://docs.convex.dev",icon:DL},{label:"API Reference",url:"https://docs.convex.dev/api",icon:JL},{label:"Community Discord",url:"https://discord.gg/convex",icon:VP}],bQ={"/":"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 wQ(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)??bQ[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 xQ(){const e=xt(),t=Gd(),{branding:n}=by();let o=new Map;try{o=Nq().overrides}catch{}const i=wQ(e.location.pathname,n.appName,o);let l=null,u=null,f=async()=>{},h=!1;try{const x=hC();l=x.user,u=x.role,f=x.logout,h=x.isAuthenticated}catch{}const y=(u?e5(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(rH,{children:b.jsx(oH,{children:i.map((x,C)=>b.jsxs(S.Fragment,{children:[C>0&&b.jsx(lH,{}),b.jsx(sH,{children:x.to?b.jsx(iH,{asChild:!0,children:b.jsxs(Ls,{to:x.to,className:"flex items-center gap-1.5",children:[C===0&&b.jsx(x1,{className:"size-3.5"}),b.jsx("span",{children:x.label})]})}):b.jsx(aH,{children:x.label})})]},C))})}),b.jsxs("div",{className:"flex items-center gap-1",children:[b.jsxs(O_,{children:[b.jsx(k_,{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(M_,{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(O_,{children:[b.jsx(k_,{asChild:!0,children:b.jsxs(Ul,{variant:"ghost",size:"icon",className:"size-9",children:[b.jsx(b1,{className:"size-4"}),b.jsx("span",{className:"sr-only",children:"Help"})]})}),b.jsxs(M_,{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:yQ.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:vQ.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(nP,{className:"size-3 text-muted-foreground"})]},x.label))})]})]})]})]}),b.jsxs($Z,{children:[b.jsx(FZ,{asChild:!0,children:b.jsxs(Ul,{variant:"ghost",className:"h-9 gap-2 pl-2 pr-3",children:[b.jsxs(eQ,{className:"size-6",children:[b.jsx(tQ,{src:l?.avatarUrl,alt:v}),b.jsx(nQ,{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(UZ,{align:"end",className:"w-56",children:[b.jsx(BZ,{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(A_,{}),b.jsxs(R_,{onClick:()=>t({to:"/settings"}),children:[b.jsx(C1,{className:"mr-2 size-4"}),b.jsx("span",{children:"Profile & Settings"})]}),h&&b.jsxs(b.Fragment,{children:[b.jsx(A_,{}),b.jsxs(R_,{onClick:R,className:"text-destructive focus:text-destructive",children:[b.jsx(PP,{className:"mr-2 size-4"}),b.jsx("span",{children:"Logout"})]})]})]})]})]})]})}function SQ({children:e}){const{layout:t}=by();return b.jsxs("div",{className:"flex min-h-screen bg-background",children:[b.jsx(nH,{}),b.jsxs("div",{className:"flex flex-1 flex-col",style:{marginLeft:t.sidebarWidth},children:[b.jsx(xQ,{}),b.jsx("main",{className:"flex-1 overflow-auto p-6",children:e})]})]})}function _Q(){return b.jsx("div",{className:"route-guard route-guard--loading bg-background flex items-center justify-center min-h-screen",children:b.jsx(DP,{className:"h-8 w-8 animate-spin text-muted-foreground"})})}function EQ(){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 TQ({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 CQ({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}=hC();return h==="loading"?b.jsx(b.Fragment,{children:o??b.jsx(_Q,{})}):h==="error"?b.jsx(TQ,{error:v??"An error occurred"}):h==="unauthenticated"?(u?.(),b.jsx(b.Fragment,{children:i??b.jsx(EQ,{})})):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 aN=()=>{throw new Error("createServerOnlyFn() functions can only be called on the server!")};function I_(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))I_(o)&&(n[o]=e[o]);if(t&&typeof t=="object")for(const o of Object.keys(t))I_(o)&&(n[o]=t[o]);return n}function lN(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=>{Mx 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[Mx]=!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||[],NQ(h)];return Object.assign(async y=>{const v=await D_(p,"client",{...u,...h,data:y?.data,headers:y?.headers,signal:y?.signal,fetch:y?.fetch,context:lN()}),w=K_(v.error);if(w)throw w;if(v.error)throw v.error;return v.result},{...u,__executeServer:async(y,v)=>{const w=aN(),_=w.contextAfterGlobalMiddlewares,R={...u,...y,serverFnMeta:u.serverFnMeta,context:gg(_,y.context),signal:v,request:w.request};return await D_(p,"server",R).then(C=>({result:C.result,error:C.error,context:C.sendContext}))}})}})};async function D_(e,t,n){const o=Og()?.functionMiddleware||[];let i=RQ([...o,...e]);if(t==="server"){const u=aN();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 AQ(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:Aj(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||lN(),_callSiteFetch:n.fetch})}function RQ(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 AQ(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 NQ(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 OQ=id({method:"GET"}).handler(KE("dff4e5b7f7b29b6a323200a2df0a5335d739cf583e83c9e514598af6b5ade819")),j_=Rz;F4();const z_=()=>({id:"mock_user_123",name:"Demo Admin",email:"admin@example.com"}),L_=()=>"admin",P_=()=>{console.log("Logout called (mock mode)")},kQ=()=>null,MQ=()=>null,IQ=()=>{};function DQ(e){switch(e){case"mock":case"demo":return{getUser:z_,getUserRole:L_,onLogout:P_};case"none":case"disabled":return{getUser:kQ,getUserRole:MQ,onLogout:IQ};default:return{getUser:z_,getUserRole:L_,onLogout:P_}}}const ur=uj({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:EL},{rel:"icon",href:"/favicon.ico"}]}),loader:async()=>({config:await OQ()}),component:jQ});function jQ(){const{config:e}=ur.useLoaderData(),t=S.useMemo(()=>DQ(e.authMode),[e.authMode]),n=S.useMemo(()=>_q(e.adminConfig),[e.adminConfig]);return b.jsx(LQ,{children:b.jsx(bq,{children:b.jsx(Aq,{children:b.jsx(zQ,{config:e,adminConfig:n,children:b.jsx(vq,{getUser:t.getUser,getUserRole:t.getUserRole,onLogout:t.onLogout,children:b.jsx(CQ,{children:b.jsx(SQ,{children:b.jsx(qE,{})})})})})})})})}function zQ({children:e,config:t,adminConfig:n}){const o=S.useMemo(()=>t.convexUrl?new mL(t.convexUrl):null,[t.convexUrl]);return o?b.jsx(yL,{client:o,children:b.jsx(kq,{api:j_.admin,children:b.jsx(Rq,{baseConfig:n,api:{getSettings:j_.admin.getSettings},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 LQ({children:e}){return b.jsxs("html",{lang:"en",children:[b.jsx("head",{children:b.jsx(Tj,{})}),b.jsxs("body",{children:[e,b.jsx(Cj,{})]})]})}const PQ=()=>zr(()=>import("./trash-CMRJlzc0.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),$Q=ir("/trash")({component:jr(PQ,"component")}),FQ=()=>zr(()=>import("./taxonomies-C21Z8CBa.js"),__vite__mapDeps([10,4,11,1,5,6,12,9])),UQ=ir("/taxonomies")({component:jr(FQ,"component")}),BQ=()=>zr(()=>import("./settings-DCY0s2hR.js"),__vite__mapDeps([13,14,1,5,15,6,7,9])),qQ=ir("/settings")({component:jr(BQ,"component")}),VQ=()=>zr(()=>import("./media-aqxopgtw.js"),__vite__mapDeps([16,17,18,1,2,3,4,19,20,6,11,8,9])),HQ=ir("/media")({component:jr(VQ,"component")}),ZQ=()=>zr(()=>import("./content-types-DD7fJA5i.js"),__vite__mapDeps([21,1,2,3,4,6,11,9])),QQ=ir("/content-types")({component:jr(ZQ,"component")}),GQ=()=>zr(()=>import("./content-D868GT7T.js"),__vite__mapDeps([22,14,23,6,1,2,3,4,24,9])),YQ=ir("/content")({component:jr(GQ,"component")}),KQ=()=>zr(()=>import("./index-CMnzrG_D.js"),__vite__mapDeps([25,1,7,18,9])),XQ=ir("/")({component:jr(KQ,"component")}),JQ=()=>zr(()=>import("./_entryId-CkZWLvOZ.js"),__vite__mapDeps([26,27,15,17,18,4,11,3,20,6,24,12,23,14,28])),WQ=ir("/entries/$entryId")({component:jr(JQ,"component")}),eG=()=>zr(()=>import("./_contentTypeId-Bn2ItET5.js"),__vite__mapDeps([29,14,28,1,2,3,24,6,4,19,20])),tG=ir("/entries/type/$contentTypeId")({component:jr(eG,"component")}),nG=()=>zr(()=>import("./new._contentTypeId-9ji3Hibs.js"),__vite__mapDeps([30,27,15,17,18,4,11,3,20,6,24,12,23,28])),rG=ir("/entries/new/$contentTypeId")({component:jr(nG,"component")}),oG=$Q.update({id:"/trash",path:"/trash",getParentRoute:()=>ur}),sG=UQ.update({id:"/taxonomies",path:"/taxonomies",getParentRoute:()=>ur}),iG=qQ.update({id:"/settings",path:"/settings",getParentRoute:()=>ur}),aG=HQ.update({id:"/media",path:"/media",getParentRoute:()=>ur}),lG=QQ.update({id:"/content-types",path:"/content-types",getParentRoute:()=>ur}),cG=YQ.update({id:"/content",path:"/content",getParentRoute:()=>ur}),uG=XQ.update({id:"/",path:"/",getParentRoute:()=>ur}),dG=WQ.update({id:"/entries/$entryId",path:"/entries/$entryId",getParentRoute:()=>ur}),fG=tG.update({id:"/entries/type/$contentTypeId",path:"/entries/type/$contentTypeId",getParentRoute:()=>ur}),hG=rG.update({id:"/entries/new/$contentTypeId",path:"/entries/new/$contentTypeId",getParentRoute:()=>ur}),pG={IndexRoute:uG,ContentRoute:cG,ContentTypesRoute:lG,MediaRoute:aG,SettingsRoute:iG,TaxonomiesRoute:sG,TrashRoute:oG,EntriesEntryIdRoute:dG,EntriesNewContentTypeIdRoute:hG,EntriesTypeContentTypeIdRoute:fG},mG=ur._addFileChildren(pG);function gG(){return vj({routeTree:mG,scrollRestoration:!0,defaultPreload:"intent"})}async function yG(){const e=await gG();let t;return t=[],window.__TSS_START_OPTIONS__={serializationAdapters:t},t.push(Zj),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:"",serializationAdapters:t}),e.state.matches.length||await Oj(e),e}async function vG(){const e=await yG();return window.$_TSR?.h(),e}let Im;function bG(){return Im||(Im=vG()),b.jsx($D,{promise:Im,children:e=>b.jsx(xj,{router:e})})}S.startTransition(()=>{zO.hydrateRoot(document,b.jsx(S.StrictMode,{children:b.jsx(bG,{})}))});export{MP as $,SV as A,TV as B,co as C,bV as D,S1 as E,lP as F,Ul as G,DP as H,Is as I,$Z as J,FZ as K,tr as L,UZ as M,R_ as N,oP as O,E1 as P,A_ as Q,CQ as R,Cm as S,f3 as T,AP as U,x1 as V,gP as W,Sd as X,_V as Y,EV as Z,$G as _,Jx as a,uP as a0,KL as a1,c3 as a2,eH as a3,pP as a4,g1 as a5,qm as a6,T1 as a7,w1 as a8,HL as a9,cr as aA,$r as aB,me as aC,vr as aD,Mt as aE,f_ as aF,es as aG,nR as aH,rR as aI,mr as aJ,bH as aK,wH as aL,aA as aM,Nq as aN,fV as aO,hV as aP,pV as aQ,mV as aR,lc as aS,eR as aT,_1 as aa,XP as ab,DV as ac,xt as ad,Gd as ae,Ag as af,WQ as ag,tG as ah,Ls as ai,v1 as aj,O_ as ak,k_ as al,M_ as am,hC as an,t5 as ao,LG as ap,Wm as aq,rG as ar,tn as as,jV as at,OP as au,JL as av,GL as aw,Ze as ax,Oy as ay,Ne as az,Am as b,Rm as c,Nm as d,Al as e,p3 as f,d_ as g,De as h,UG as i,b as j,j_ as k,Se as l,wC as m,Ry as n,qV as o,a3 as p,Js as q,S as r,BL as s,s3 as t,p1 as u,by as v,y1 as w,zP as x,PG as y,uf as z};
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(Ry,{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(KL,{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(!T_(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(qV,{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(d_,{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(E1,{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(v1,{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:E_(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(d_,{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(tH,{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(W7,{isOpen:Z,onClose:()=>ne(!1),breakingChanges:F,onForceUpdate:qn,onCancel:()=>{ne(!1),X([])},isLoading:be})]})}function tH({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(E1,{className:"size-3.5"}),"Add Option"]})]})}function nH(){const t=xt().location.pathname,n=by(),{navItems:o,branding:i,layout:l}=n,u=wC(),[f,h]=S.useState(!1),p=p1(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(GS,{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(Jq,{defaultOpen:w,children:[b.jsxs(Wq,{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(GS,{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(e8,{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(_1,{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(eH,{isOpen:f,onClose:()=>h(!1)})]})}function rH({...e}){return b.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function oH({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 sH({className:e,...t}){return b.jsx("li",{"data-slot":"breadcrumb-item",className:De("inline-flex items-center gap-1.5",e),...t})}function iH({asChild:e,className:t,...n}){const o=e?eR:"a";return b.jsx(o,{"data-slot":"breadcrumb-link",className:De("hover:text-foreground transition-colors",t),...n})}function aH({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 lH({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(BL,{})})}var km="rovingFocusGroup.onEntryFocus",cH={bubbles:!1,cancelable:!0},pc="RovingFocusGroup",[pg,iA,uH]=Ny(pc),[dH,aA]=$r(pc,[uH]),[fH,hH]=dH(pc),lA=S.forwardRef((e,t)=>b.jsx(pg.Provider,{scope:e.__scopeRovingFocusGroup,children:b.jsx(pg.Slot,{scope:e.__scopeRovingFocusGroup,children:b.jsx(pH,{...e,ref:t})})}));lA.displayName=pc;var pH=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=Oy(l),[x,C]=es({prop:u,defaultProp:f??null,onChange:h,caller:pc}),[N,k]=S.useState(!1),O=vr(p),M=iA(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(fH,{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,cH);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);dA(ge,y)}}$.current=!1}),onBlur:me(e.onBlur,()=>k(!1))})})}),cA="RovingFocusGroupItem",uA=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=hH(cA,n),v=y.currentTabStopId===p,w=iA(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=yH(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?vH(O,M+1):O.slice(M+1)}setTimeout(()=>dA(O))}}),children:typeof u=="function"?u({isCurrentTabStop:v,hasTabStop:x!=null}):u})})});uA.displayName=cA;var mH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function gH(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function yH(e,t,n){const o=gH(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return mH[o]}function dA(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function vH(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var bH=lA,wH=uA,mg=["Enter"," "],xH=["ArrowDown","PageUp","Home"],fA=["ArrowUp","PageDown","End"],SH=[...xH,...fA],_H={ltr:[...mg,"ArrowRight"],rtl:[...mg,"ArrowLeft"]},EH={ltr:["ArrowLeft"],rtl:["ArrowRight"]},mc="Menu",[Jl,TH,CH]=Ny(mc),[ei,hA]=$r(mc,[CH,Ca,aA]),wf=Ca(),pA=aA(),[RH,ti]=ei(mc),[AH,gc]=ei(mc),mA=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=Oy(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($y,{...f,children:b.jsx(RH,{scope:t,open:n,onOpenChange:v,content:h,onContentChange:p,children:b.jsx(AH,{scope:t,onClose:S.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:y,dir:w,modal:u,children:o})})})};mA.displayName=mc;var NH="MenuAnchor",qy=S.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,i=wf(n);return b.jsx(gf,{...i,...o,ref:t})});qy.displayName=NH;var Vy="MenuPortal",[OH,gA]=ei(Vy,{forceMount:void 0}),yA=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:i}=e,l=ti(Vy,t);return b.jsx(OH,{scope:t,forceMount:n,children:b.jsx(cr,{present:n||l.open,children:b.jsx(dc,{asChild:!0,container:i,children:o})})})};yA.displayName=Vy;var sr="MenuContent",[kH,Hy]=ei(sr),vA=S.forwardRef((e,t)=>{const n=gA(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(MH,{...i,ref:t}):b.jsx(IH,{...i,ref:t})})})})}),MH=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(Zy,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:me(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),IH=S.forwardRef((e,t)=>{const n=ti(sr,e.__scopeMenu);return b.jsx(Zy,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),DH=Hs("MenuContent.ScrollLock"),Zy=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=pA(n),M=TH(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:DH,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=ZH(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&&GH(ne,se.current?.area),[]);return b.jsx(kH,{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(bH,{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(Fy,{role:"menu","aria-orientation":"vertical","data-state":DA(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||!SH.includes(ne.key))return;ne.preventDefault();const ve=M().filter(J=>!J.disabled).map(J=>J.ref.current);fA.includes(ne.key)&&ve.reverse(),VH(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}}))})})})})})})});vA.displayName=sr;var jH="MenuGroup",Qy=S.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return b.jsx(Ne.div,{role:"group",...o,ref:t})});Qy.displayName=jH;var zH="MenuLabel",bA=S.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return b.jsx(Ne.div,{...o,ref:t})});bA.displayName=zH;var Ld="MenuItem",C_="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=Hy(Ld,e.__scopeMenu),h=Ze(t,l),p=S.useRef(!1),y=()=>{const v=l.current;if(!n&&v){const w=new CustomEvent(C_,{bubbles:!0,cancelable:!0});v.addEventListener(C_,_=>o?.(_),{once:!0}),xC(v,w),w.defaultPrevented?p.current=!1:u.onClose()}};return b.jsx(wA,{...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 wA=S.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:i,...l}=e,u=Hy(Ld,n),f=pA(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(wH,{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))})})})}),LH="MenuCheckboxItem",xA=S.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...i}=e;return b.jsx(CA,{scope:e.__scopeMenu,checked:n,children:b.jsx(xf,{role:"menuitemcheckbox","aria-checked":Pd(n)?"mixed":n,...i,ref:t,"data-state":Yy(n),onSelect:me(i.onSelect,()=>o?.(Pd(n)?!0:!n),{checkForDefaultPrevented:!1})})})});xA.displayName=LH;var SA="MenuRadioGroup",[PH,$H]=ei(SA,{value:void 0,onValueChange:()=>{}}),_A=S.forwardRef((e,t)=>{const{value:n,onValueChange:o,...i}=e,l=vr(o);return b.jsx(PH,{scope:e.__scopeMenu,value:n,onValueChange:l,children:b.jsx(Qy,{...i,ref:t})})});_A.displayName=SA;var EA="MenuRadioItem",TA=S.forwardRef((e,t)=>{const{value:n,...o}=e,i=$H(EA,e.__scopeMenu),l=n===i.value;return b.jsx(CA,{scope:e.__scopeMenu,checked:l,children:b.jsx(xf,{role:"menuitemradio","aria-checked":l,...o,ref:t,"data-state":Yy(l),onSelect:me(o.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});TA.displayName=EA;var Gy="MenuItemIndicator",[CA,FH]=ei(Gy,{checked:!1}),RA=S.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...i}=e,l=FH(Gy,n);return b.jsx(cr,{present:o||Pd(l.checked)||l.checked===!0,children:b.jsx(Ne.span,{...i,ref:t,"data-state":Yy(l.checked)})})});RA.displayName=Gy;var UH="MenuSeparator",AA=S.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return b.jsx(Ne.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});AA.displayName=UH;var BH="MenuArrow",NA=S.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,i=wf(n);return b.jsx(Uy,{...i,...o,ref:t})});NA.displayName=BH;var qH="MenuSub",[BG,OA]=ei(qH),Dl="MenuSubTrigger",kA=S.forwardRef((e,t)=>{const n=ti(Dl,e.__scopeMenu),o=gc(Dl,e.__scopeMenu),i=OA(Dl,e.__scopeMenu),l=Hy(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(qy,{asChild:!0,...p,children:b.jsx(wA,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":DA(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===" "||_H[o.dir].includes(v.key)&&(n.onOpenChange(!0),n.content?.focus(),v.preventDefault())})})})});kA.displayName=Dl;var MA="MenuSubContent",IA=S.forwardRef((e,t)=>{const n=gA(sr,e.__scopeMenu),{forceMount:o=n.forceMount,...i}=e,l=ti(sr,e.__scopeMenu),u=gc(sr,e.__scopeMenu),f=OA(MA,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(Zy,{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=EH[u.dir].includes(y.key);v&&w&&(l.onOpenChange(!1),f.trigger?.focus(),y.preventDefault())})})})})})});IA.displayName=MA;function DA(e){return e?"open":"closed"}function Pd(e){return e==="indeterminate"}function Yy(e){return Pd(e)?"indeterminate":e?"checked":"unchecked"}function VH(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function HH(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function ZH(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=HH(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 QH(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 GH(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return QH(n,t)}function Wl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var YH=mA,KH=qy,XH=yA,JH=vA,WH=Qy,eZ=bA,tZ=xf,nZ=xA,rZ=_A,oZ=TA,sZ=RA,iZ=AA,aZ=NA,lZ=kA,cZ=IA,Sf="DropdownMenu",[uZ]=$r(Sf,[hA]),fn=hA(),[dZ,jA]=uZ(Sf),zA=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(dZ,{scope:t,triggerId:mr(),triggerRef:p,contentId:mr(),open:y,onOpenChange:v,onOpenToggle:S.useCallback(()=>v(w=>!w),[v]),modal:f,children:b.jsx(YH,{...h,open:y,onOpenChange:v,dir:o,modal:f,children:n})})};zA.displayName=Sf;var LA="DropdownMenuTrigger",PA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...i}=e,l=jA(LA,n),u=fn(n);return b.jsx(KH,{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())})})})});PA.displayName=LA;var fZ="DropdownMenuPortal",$A=e=>{const{__scopeDropdownMenu:t,...n}=e,o=fn(t);return b.jsx(XH,{...o,...n})};$A.displayName=fZ;var FA="DropdownMenuContent",UA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=jA(FA,n),l=fn(n),u=S.useRef(!1);return b.jsx(JH,{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)"}})});UA.displayName=FA;var hZ="DropdownMenuGroup",pZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(WH,{...i,...o,ref:t})});pZ.displayName=hZ;var mZ="DropdownMenuLabel",BA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(eZ,{...i,...o,ref:t})});BA.displayName=mZ;var gZ="DropdownMenuItem",qA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(tZ,{...i,...o,ref:t})});qA.displayName=gZ;var yZ="DropdownMenuCheckboxItem",vZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(nZ,{...i,...o,ref:t})});vZ.displayName=yZ;var bZ="DropdownMenuRadioGroup",wZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(rZ,{...i,...o,ref:t})});wZ.displayName=bZ;var xZ="DropdownMenuRadioItem",SZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(oZ,{...i,...o,ref:t})});SZ.displayName=xZ;var _Z="DropdownMenuItemIndicator",EZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(sZ,{...i,...o,ref:t})});EZ.displayName=_Z;var TZ="DropdownMenuSeparator",VA=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(iZ,{...i,...o,ref:t})});VA.displayName=TZ;var CZ="DropdownMenuArrow",RZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(aZ,{...i,...o,ref:t})});RZ.displayName=CZ;var AZ="DropdownMenuSubTrigger",NZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(lZ,{...i,...o,ref:t})});NZ.displayName=AZ;var OZ="DropdownMenuSubContent",kZ=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,i=fn(n);return b.jsx(cZ,{...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)"}})});kZ.displayName=OZ;var MZ=zA,IZ=PA,DZ=$A,jZ=UA,zZ=BA,LZ=qA,PZ=VA;function $Z({...e}){return b.jsx(MZ,{"data-slot":"dropdown-menu",...e})}function FZ({...e}){return b.jsx(IZ,{"data-slot":"dropdown-menu-trigger",...e})}function UZ({className:e,sideOffset:t=4,...n}){return b.jsx(DZ,{children:b.jsx(jZ,{"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 R_({className:e,inset:t,variant:n="default",...o}){return b.jsx(LZ,{"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 BZ({className:e,inset:t,...n}){return b.jsx(zZ,{"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 A_({className:e,...t}){return b.jsx(PZ,{"data-slot":"dropdown-menu-separator",className:De("bg-border -mx-1 my-1 h-px",e),...t})}function qZ(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,VZ(i,...t)]}function VZ(...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 HZ=$E();function ZZ(){return HZ.useSyncExternalStore(QZ,()=>!0,()=>!1)}function QZ(){return()=>{}}var Ky="Avatar",[GZ]=qZ(Ky),[YZ,HA]=GZ(Ky),ZA=S.forwardRef((e,t)=>{const{__scopeAvatar:n,...o}=e,[i,l]=S.useState("idle");return b.jsx(YZ,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:l,children:b.jsx(uf.span,{...o,ref:t})})});ZA.displayName=Ky;var QA="AvatarImage",GA=S.forwardRef((e,t)=>{const{__scopeAvatar:n,src:o,onLoadingStatusChange:i=()=>{},...l}=e,u=HA(QA,n),f=KZ(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});GA.displayName=QA;var YA="AvatarFallback",KA=S.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:o,...i}=e,l=HA(YA,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});KA.displayName=YA;function N_(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function KZ(e,{referrerPolicy:t,crossOrigin:n}){const o=ZZ(),i=S.useRef(null),l=o?(i.current||(i.current=new window.Image),i.current):null,[u,f]=S.useState(()=>N_(l,e));return Mt(()=>{f(N_(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 XZ=ZA,JZ=GA,WZ=KA;function eQ({className:e,...t}){return b.jsx(XZ,{"data-slot":"avatar",className:De("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function tQ({className:e,...t}){return b.jsx(JZ,{"data-slot":"avatar-image",className:De("aspect-square size-full",e),...t})}function nQ({className:e,...t}){return b.jsx(WZ,{"data-slot":"avatar-fallback",className:De("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}var _f="Popover",[XA]=$r(_f,[Ca]),yc=Ca(),[rQ,ds]=XA(_f),JA=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($y,{...f,children:b.jsx(rQ,{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})})};JA.displayName=_f;var WA="PopoverAnchor",oQ=S.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,i=ds(WA,n),l=yc(n),{onCustomAnchorAdd:u,onCustomAnchorRemove:f}=i;return S.useEffect(()=>(u(),()=>f()),[u,f]),b.jsx(gf,{...l,...o,ref:t})});oQ.displayName=WA;var eN="PopoverTrigger",tN=S.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,i=ds(eN,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":iN(i.open),...o,ref:u,onClick:me(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?f:b.jsx(gf,{asChild:!0,...l,children:f})});tN.displayName=eN;var Xy="PopoverPortal",[sQ,iQ]=XA(Xy,{forceMount:void 0}),nN=e=>{const{__scopePopover:t,forceMount:n,children:o,container:i}=e,l=ds(Xy,t);return b.jsx(sQ,{scope:t,forceMount:n,children:b.jsx(cr,{present:n||l.open,children:b.jsx(dc,{asChild:!0,container:i,children:o})})})};nN.displayName=Xy;var ma="PopoverContent",rN=S.forwardRef((e,t)=>{const n=iQ(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(lQ,{...i,ref:t}):b.jsx(cQ,{...i,ref:t})})});rN.displayName=ma;var aQ=Hs("PopoverContent.RemoveScroll"),lQ=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:aQ,allowPinchZoom:!0,children:b.jsx(oN,{...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})})})}),cQ=S.forwardRef((e,t)=>{const n=ds(ma,e.__scopePopover),o=S.useRef(!1),i=S.useRef(!1);return b.jsx(oN,{...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()}})}),oN=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(Fy,{"data-state":iN(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)"}})})})}),sN="PopoverClose",uQ=S.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,i=ds(sN,n);return b.jsx(Ne.button,{type:"button",...o,ref:t,onClick:me(e.onClick,()=>i.onOpenChange(!1))})});uQ.displayName=sN;var dQ="PopoverArrow",fQ=S.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,i=yc(n);return b.jsx(Uy,{...i,...o,ref:t})});fQ.displayName=dQ;function iN(e){return e?"open":"closed"}var hQ=JA,pQ=tN,mQ=nN,gQ=rN;function O_({...e}){return b.jsx(hQ,{"data-slot":"popover",...e})}function k_({...e}){return b.jsx(pQ,{"data-slot":"popover-trigger",...e})}function M_({className:e,align:t="center",sideOffset:n=4,...o}){return b.jsx(mQ,{children:b.jsx(gQ,{"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 yQ=[{keys:["⌘","S"],description:"Save entry"},{keys:["⌘","⇧","P"],description:"Publish entry"},{keys:["⌘","K"],description:"Quick search"},{keys:["Esc"],description:"Close modal/panel"}],vQ=[{label:"Documentation",url:"https://docs.convex.dev",icon:DL},{label:"API Reference",url:"https://docs.convex.dev/api",icon:JL},{label:"Community Discord",url:"https://discord.gg/convex",icon:VP}],bQ={"/":"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 wQ(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)??bQ[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 xQ(){const e=xt(),t=Gd(),{branding:n}=by();let o=new Map;try{o=Nq().overrides}catch{}const i=wQ(e.location.pathname,n.appName,o);let l=null,u=null,f=async()=>{},h=!1;try{const x=hC();l=x.user,u=x.role,f=x.logout,h=x.isAuthenticated}catch{}const y=(u?e5(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(rH,{children:b.jsx(oH,{children:i.map((x,C)=>b.jsxs(S.Fragment,{children:[C>0&&b.jsx(lH,{}),b.jsx(sH,{children:x.to?b.jsx(iH,{asChild:!0,children:b.jsxs(Ls,{to:x.to,className:"flex items-center gap-1.5",children:[C===0&&b.jsx(x1,{className:"size-3.5"}),b.jsx("span",{children:x.label})]})}):b.jsx(aH,{children:x.label})})]},C))})}),b.jsxs("div",{className:"flex items-center gap-1",children:[b.jsxs(O_,{children:[b.jsx(k_,{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(M_,{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(O_,{children:[b.jsx(k_,{asChild:!0,children:b.jsxs(Ul,{variant:"ghost",size:"icon",className:"size-9",children:[b.jsx(b1,{className:"size-4"}),b.jsx("span",{className:"sr-only",children:"Help"})]})}),b.jsxs(M_,{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:yQ.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:vQ.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(nP,{className:"size-3 text-muted-foreground"})]},x.label))})]})]})]})]}),b.jsxs($Z,{children:[b.jsx(FZ,{asChild:!0,children:b.jsxs(Ul,{variant:"ghost",className:"h-9 gap-2 pl-2 pr-3",children:[b.jsxs(eQ,{className:"size-6",children:[b.jsx(tQ,{src:l?.avatarUrl,alt:v}),b.jsx(nQ,{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(UZ,{align:"end",className:"w-56",children:[b.jsx(BZ,{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(A_,{}),b.jsxs(R_,{onClick:()=>t({to:"/settings"}),children:[b.jsx(C1,{className:"mr-2 size-4"}),b.jsx("span",{children:"Profile & Settings"})]}),h&&b.jsxs(b.Fragment,{children:[b.jsx(A_,{}),b.jsxs(R_,{onClick:R,className:"text-destructive focus:text-destructive",children:[b.jsx(PP,{className:"mr-2 size-4"}),b.jsx("span",{children:"Logout"})]})]})]})]})]})]})}function SQ({children:e}){const{layout:t}=by();return b.jsxs("div",{className:"flex min-h-screen bg-background",children:[b.jsx(nH,{}),b.jsxs("div",{className:"flex flex-1 flex-col",style:{marginLeft:t.sidebarWidth},children:[b.jsx(xQ,{}),b.jsx("main",{className:"flex-1 overflow-auto p-6",children:e})]})]})}function _Q(){return b.jsx("div",{className:"route-guard route-guard--loading bg-background flex items-center justify-center min-h-screen",children:b.jsx(DP,{className:"h-8 w-8 animate-spin text-muted-foreground"})})}function EQ(){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 TQ({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 CQ({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}=hC();return h==="loading"?b.jsx(b.Fragment,{children:o??b.jsx(_Q,{})}):h==="error"?b.jsx(TQ,{error:v??"An error occurred"}):h==="unauthenticated"?(u?.(),b.jsx(b.Fragment,{children:i??b.jsx(EQ,{})})):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 aN=()=>{throw new Error("createServerOnlyFn() functions can only be called on the server!")};function I_(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))I_(o)&&(n[o]=e[o]);if(t&&typeof t=="object")for(const o of Object.keys(t))I_(o)&&(n[o]=t[o]);return n}function lN(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=>{Mx 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[Mx]=!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||[],NQ(h)];return Object.assign(async y=>{const v=await D_(p,"client",{...u,...h,data:y?.data,headers:y?.headers,signal:y?.signal,fetch:y?.fetch,context:lN()}),w=K_(v.error);if(w)throw w;if(v.error)throw v.error;return v.result},{...u,__executeServer:async(y,v)=>{const w=aN(),_=w.contextAfterGlobalMiddlewares,R={...u,...y,serverFnMeta:u.serverFnMeta,context:gg(_,y.context),signal:v,request:w.request};return await D_(p,"server",R).then(C=>({result:C.result,error:C.error,context:C.sendContext}))}})}})};async function D_(e,t,n){const o=Og()?.functionMiddleware||[];let i=RQ([...o,...e]);if(t==="server"){const u=aN();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 AQ(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:Aj(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||lN(),_callSiteFetch:n.fetch})}function RQ(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 AQ(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 NQ(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 OQ=id({method:"GET"}).handler(KE("dff4e5b7f7b29b6a323200a2df0a5335d739cf583e83c9e514598af6b5ade819")),j_=Rz;F4();const z_=()=>({id:"mock_user_123",name:"Demo Admin",email:"admin@example.com"}),L_=()=>"admin",P_=()=>{console.log("Logout called (mock mode)")},kQ=()=>null,MQ=()=>null,IQ=()=>{};function DQ(e){switch(e){case"mock":case"demo":return{getUser:z_,getUserRole:L_,onLogout:P_};case"none":case"disabled":return{getUser:kQ,getUserRole:MQ,onLogout:IQ};default:return{getUser:z_,getUserRole:L_,onLogout:P_}}}const ur=uj({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:EL},{rel:"icon",href:"/favicon.ico"}]}),loader:async()=>({config:await OQ()}),component:jQ});function jQ(){const{config:e}=ur.useLoaderData(),t=S.useMemo(()=>DQ(e.authMode),[e.authMode]),n=S.useMemo(()=>_q(e.adminConfig),[e.adminConfig]);return b.jsx(LQ,{children:b.jsx(bq,{children:b.jsx(Aq,{children:b.jsx(zQ,{config:e,adminConfig:n,children:b.jsx(vq,{getUser:t.getUser,getUserRole:t.getUserRole,onLogout:t.onLogout,children:b.jsx(CQ,{children:b.jsx(SQ,{children:b.jsx(qE,{})})})})})})})})}function zQ({children:e,config:t,adminConfig:n}){const o=S.useMemo(()=>t.convexUrl?new mL(t.convexUrl):null,[t.convexUrl]);return o?b.jsx(yL,{client:o,children:b.jsx(kq,{api:j_.admin,children:b.jsx(Rq,{baseConfig:n,api:{getSettings:j_.admin.getSettings},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 LQ({children:e}){return b.jsxs("html",{lang:"en",children:[b.jsx("head",{children:b.jsx(Tj,{})}),b.jsxs("body",{children:[e,b.jsx(Cj,{})]})]})}const PQ=()=>zr(()=>import("./trash-YyYaC3L9.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),$Q=ir("/trash")({component:jr(PQ,"component")}),FQ=()=>zr(()=>import("./taxonomies-DvILUNvr.js"),__vite__mapDeps([10,4,11,1,5,6,12,9])),UQ=ir("/taxonomies")({component:jr(FQ,"component")}),BQ=()=>zr(()=>import("./settings-D8crrFCn.js"),__vite__mapDeps([13,14,1,5,15,6,7,9])),qQ=ir("/settings")({component:jr(BQ,"component")}),VQ=()=>zr(()=>import("./media-Bl1tBbJQ.js"),__vite__mapDeps([16,17,18,1,2,3,4,19,20,6,11,8,9])),HQ=ir("/media")({component:jr(VQ,"component")}),ZQ=()=>zr(()=>import("./content-types-Bl_8I1Re.js"),__vite__mapDeps([21,1,2,3,4,6,11,9])),QQ=ir("/content-types")({component:jr(ZQ,"component")}),GQ=()=>zr(()=>import("./content-pKaIL2ru.js"),__vite__mapDeps([22,14,23,6,1,2,3,4,24,9])),YQ=ir("/content")({component:jr(GQ,"component")}),KQ=()=>zr(()=>import("./index-CtHq_P5q.js"),__vite__mapDeps([25,1,7,18,9])),XQ=ir("/")({component:jr(KQ,"component")}),JQ=()=>zr(()=>import("./_entryId-jPXz4z9T.js"),__vite__mapDeps([26,27,15,17,18,4,11,3,20,6,24,12,23,14,28])),WQ=ir("/entries/$entryId")({component:jr(JQ,"component")}),eG=()=>zr(()=>import("./_contentTypeId-C_vJq22X.js"),__vite__mapDeps([29,14,28,1,2,3,24,6,4,19,20])),tG=ir("/entries/type/$contentTypeId")({component:jr(eG,"component")}),nG=()=>zr(()=>import("./new._contentTypeId-qsvo01mH.js"),__vite__mapDeps([30,27,15,17,18,4,11,3,20,6,24,12,23,28])),rG=ir("/entries/new/$contentTypeId")({component:jr(nG,"component")}),oG=$Q.update({id:"/trash",path:"/trash",getParentRoute:()=>ur}),sG=UQ.update({id:"/taxonomies",path:"/taxonomies",getParentRoute:()=>ur}),iG=qQ.update({id:"/settings",path:"/settings",getParentRoute:()=>ur}),aG=HQ.update({id:"/media",path:"/media",getParentRoute:()=>ur}),lG=QQ.update({id:"/content-types",path:"/content-types",getParentRoute:()=>ur}),cG=YQ.update({id:"/content",path:"/content",getParentRoute:()=>ur}),uG=XQ.update({id:"/",path:"/",getParentRoute:()=>ur}),dG=WQ.update({id:"/entries/$entryId",path:"/entries/$entryId",getParentRoute:()=>ur}),fG=tG.update({id:"/entries/type/$contentTypeId",path:"/entries/type/$contentTypeId",getParentRoute:()=>ur}),hG=rG.update({id:"/entries/new/$contentTypeId",path:"/entries/new/$contentTypeId",getParentRoute:()=>ur}),pG={IndexRoute:uG,ContentRoute:cG,ContentTypesRoute:lG,MediaRoute:aG,SettingsRoute:iG,TaxonomiesRoute:sG,TrashRoute:oG,EntriesEntryIdRoute:dG,EntriesNewContentTypeIdRoute:hG,EntriesTypeContentTypeIdRoute:fG},mG=ur._addFileChildren(pG);function gG(){return vj({routeTree:mG,scrollRestoration:!0,defaultPreload:"intent"})}async function yG(){const e=await gG();let t;return t=[],window.__TSS_START_OPTIONS__={serializationAdapters:t},t.push(Zj),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:"",serializationAdapters:t}),e.state.matches.length||await Oj(e),e}async function vG(){const e=await yG();return window.$_TSR?.h(),e}let Im;function bG(){return Im||(Im=vG()),b.jsx($D,{promise:Im,children:e=>b.jsx(xj,{router:e})})}S.startTransition(()=>{zO.hydrateRoot(document,b.jsx(S.StrictMode,{children:b.jsx(bG,{})}))});export{MP as $,SV as A,TV as B,co as C,bV as D,S1 as E,lP as F,Ul as G,DP as H,Is as I,$Z as J,FZ as K,tr as L,UZ as M,R_ as N,oP as O,E1 as P,A_ as Q,CQ as R,Cm as S,f3 as T,AP as U,x1 as V,gP as W,Sd as X,_V as Y,EV as Z,$G as _,Jx as a,uP as a0,KL as a1,c3 as a2,eH as a3,pP as a4,g1 as a5,qm as a6,T1 as a7,w1 as a8,HL as a9,cr as aA,$r as aB,me as aC,vr as aD,Mt as aE,f_ as aF,es as aG,nR as aH,rR as aI,mr as aJ,bH as aK,wH as aL,aA as aM,Nq as aN,fV as aO,hV as aP,pV as aQ,mV as aR,lc as aS,eR as aT,_1 as aa,XP as ab,DV as ac,xt as ad,Gd as ae,Ag as af,WQ as ag,tG as ah,Ls as ai,v1 as aj,O_ as ak,k_ as al,M_ as am,hC as an,t5 as ao,LG as ap,Wm as aq,rG as ar,tn as as,jV as at,OP as au,JL as av,GL as aw,Ze as ax,Oy as ay,Ne as az,Am as b,Rm as c,Nm as d,Al as e,p3 as f,d_ as g,De as h,UG as i,b as j,j_ as k,Se as l,wC as m,Ry as n,qV as o,a3 as p,Js as q,S as r,BL as s,s3 as t,p1 as u,by as v,y1 as w,zP as x,PG as y,uf as z};