@segmentify/ui 0.0.43 → 0.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/segmentify-ui.cjs
CHANGED
|
@@ -57,13 +57,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
57
57
|
maybe you don't need to use a ResponsiveContainer.`,s,l),Ac(!n||n>0,"The aspect(%s) must be greater than zero.",n);var j=Hu(s)?O:s,D=Hu(l)?B:l;n&&n>0&&(j?D=j/n:D&&(j=D*n),f&&D>f&&(D=f)),Ac(j>0||D>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
58
58
|
please check the style of container, or the props width(%s) and height(%s),
|
|
59
59
|
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
60
|
-
height and width.`,j,D,s,l,c,d,n);var V=!Array.isArray(p)&&r6(p.type).endsWith("Chart");return N.Children.map(p,function(G){return N.isValidElement(G)?N.cloneElement(G,qu({width:j,height:D},V?{style:qu({height:"100%",width:"100%",maxHeight:D,maxWidth:j},G.props.style)}:{})):G})},[n,p,l,f,d,c,_,s]);return N.createElement("div",{id:v?"".concat(v):void 0,className:_o("recharts-responsive-container",y),style:qu(qu({},C),{},{width:s,height:l,minWidth:c,minHeight:d,maxHeight:f}),ref:S},M)}),Uu={exports:{}},xt={};var vE;function DX(){if(vE)return xt;vE=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function w(S){if(typeof S=="object"&&S!==null){var R=S.$$typeof;switch(R){case t:switch(S=S.type,S){case l:case u:case r:case i:case o:case d:return S;default:switch(S=S&&S.$$typeof,S){case a:case c:case g:case p:case s:return S;default:return R}}case n:return R}}}function C(S){return w(S)===u}return xt.AsyncMode=l,xt.ConcurrentMode=u,xt.ContextConsumer=a,xt.ContextProvider=s,xt.Element=t,xt.ForwardRef=c,xt.Fragment=r,xt.Lazy=g,xt.Memo=p,xt.Portal=n,xt.Profiler=i,xt.StrictMode=o,xt.Suspense=d,xt.isAsyncMode=function(S){return C(S)||w(S)===l},xt.isConcurrentMode=C,xt.isContextConsumer=function(S){return w(S)===a},xt.isContextProvider=function(S){return w(S)===s},xt.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===t},xt.isForwardRef=function(S){return w(S)===c},xt.isFragment=function(S){return w(S)===r},xt.isLazy=function(S){return w(S)===g},xt.isMemo=function(S){return w(S)===p},xt.isPortal=function(S){return w(S)===n},xt.isProfiler=function(S){return w(S)===i},xt.isStrictMode=function(S){return w(S)===o},xt.isSuspense=function(S){return w(S)===d},xt.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===r||S===u||S===i||S===o||S===d||S===f||typeof S=="object"&&S!==null&&(S.$$typeof===g||S.$$typeof===p||S.$$typeof===s||S.$$typeof===a||S.$$typeof===c||S.$$typeof===v||S.$$typeof===y||S.$$typeof===x||S.$$typeof===m)},xt.typeOf=w,xt}var wt={};var yE;function kX(){return yE||(yE=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function w(L){return typeof L=="string"||typeof L=="function"||L===r||L===u||L===i||L===o||L===d||L===f||typeof L=="object"&&L!==null&&(L.$$typeof===g||L.$$typeof===p||L.$$typeof===s||L.$$typeof===a||L.$$typeof===c||L.$$typeof===v||L.$$typeof===y||L.$$typeof===x||L.$$typeof===m)}function C(L){if(typeof L=="object"&&L!==null){var Z=L.$$typeof;switch(Z){case t:var k=L.type;switch(k){case l:case u:case r:case i:case o:case d:return k;default:var ie=k&&k.$$typeof;switch(ie){case a:case c:case g:case p:case s:return ie;default:return Z}}case n:return Z}}}var S=l,R=u,I=a,T=s,_=t,$=c,A=r,M=g,O=p,B=n,j=i,D=o,V=d,G=!1;function z(L){return G||(G=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),H(L)||C(L)===l}function H(L){return C(L)===u}function ne(L){return C(L)===a}function W(L){return C(L)===s}function J(L){return typeof L=="object"&&L!==null&&L.$$typeof===t}function K(L){return C(L)===c}function U(L){return C(L)===r}function oe(L){return C(L)===g}function X(L){return C(L)===p}function te(L){return C(L)===n}function Q(L){return C(L)===i}function se(L){return C(L)===o}function ae(L){return C(L)===d}wt.AsyncMode=S,wt.ConcurrentMode=R,wt.ContextConsumer=I,wt.ContextProvider=T,wt.Element=_,wt.ForwardRef=$,wt.Fragment=A,wt.Lazy=M,wt.Memo=O,wt.Portal=B,wt.Profiler=j,wt.StrictMode=D,wt.Suspense=V,wt.isAsyncMode=z,wt.isConcurrentMode=H,wt.isContextConsumer=ne,wt.isContextProvider=W,wt.isElement=J,wt.isForwardRef=K,wt.isFragment=U,wt.isLazy=oe,wt.isMemo=X,wt.isPortal=te,wt.isProfiler=Q,wt.isStrictMode=se,wt.isSuspense=ae,wt.isValidElementType=w,wt.typeOf=C})()),wt}var xE;function jX(){return xE||(xE=1,process.env.NODE_ENV==="production"?Uu.exports=DX():Uu.exports=kX()),Uu.exports}function He(){return He=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},He.apply(null,arguments)}function LX(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ev(e,t){return ev=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},ev(e,t)}function FX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}const BX={light:"",dark:".dark"},RM=b.createContext(null);function AM(){const e=b.useContext(RM);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}function VX({id:e,className:t,children:n,config:r,...o}){const i=b.useId(),s=`chart-${e||i.replace(/:/g,"")}`;return h.jsx(RM.Provider,{value:{config:r},children:h.jsxs("div",{"data-slot":"chart","data-chart":s,className:F("ui:[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground ui:[&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 ui:[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border ui:[&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border ui:[&_.recharts-radial-bar-background-sector]:fill-muted ui:[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted ui:[&_.recharts-reference-line_[stroke='#ccc']]:stroke-border ui:flex ui:aspect-video ui:justify-center ui:text-xs ui:[&_.recharts-dot[stroke='#fff']]:stroke-transparent ui:[&_.recharts-layer]:outline-hidden ui:[&_.recharts-sector]:outline-hidden ui:[&_.recharts-sector[stroke='#fff']]:stroke-transparent ui:
|
|
60
|
+
height and width.`,j,D,s,l,c,d,n);var V=!Array.isArray(p)&&r6(p.type).endsWith("Chart");return N.Children.map(p,function(G){return N.isValidElement(G)?N.cloneElement(G,qu({width:j,height:D},V?{style:qu({height:"100%",width:"100%",maxHeight:D,maxWidth:j},G.props.style)}:{})):G})},[n,p,l,f,d,c,_,s]);return N.createElement("div",{id:v?"".concat(v):void 0,className:_o("recharts-responsive-container",y),style:qu(qu({},C),{},{width:s,height:l,minWidth:c,minHeight:d,maxHeight:f}),ref:S},M)}),Uu={exports:{}},xt={};var vE;function DX(){if(vE)return xt;vE=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function w(S){if(typeof S=="object"&&S!==null){var R=S.$$typeof;switch(R){case t:switch(S=S.type,S){case l:case u:case r:case i:case o:case d:return S;default:switch(S=S&&S.$$typeof,S){case a:case c:case g:case p:case s:return S;default:return R}}case n:return R}}}function C(S){return w(S)===u}return xt.AsyncMode=l,xt.ConcurrentMode=u,xt.ContextConsumer=a,xt.ContextProvider=s,xt.Element=t,xt.ForwardRef=c,xt.Fragment=r,xt.Lazy=g,xt.Memo=p,xt.Portal=n,xt.Profiler=i,xt.StrictMode=o,xt.Suspense=d,xt.isAsyncMode=function(S){return C(S)||w(S)===l},xt.isConcurrentMode=C,xt.isContextConsumer=function(S){return w(S)===a},xt.isContextProvider=function(S){return w(S)===s},xt.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===t},xt.isForwardRef=function(S){return w(S)===c},xt.isFragment=function(S){return w(S)===r},xt.isLazy=function(S){return w(S)===g},xt.isMemo=function(S){return w(S)===p},xt.isPortal=function(S){return w(S)===n},xt.isProfiler=function(S){return w(S)===i},xt.isStrictMode=function(S){return w(S)===o},xt.isSuspense=function(S){return w(S)===d},xt.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===r||S===u||S===i||S===o||S===d||S===f||typeof S=="object"&&S!==null&&(S.$$typeof===g||S.$$typeof===p||S.$$typeof===s||S.$$typeof===a||S.$$typeof===c||S.$$typeof===v||S.$$typeof===y||S.$$typeof===x||S.$$typeof===m)},xt.typeOf=w,xt}var wt={};var yE;function kX(){return yE||(yE=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function w(L){return typeof L=="string"||typeof L=="function"||L===r||L===u||L===i||L===o||L===d||L===f||typeof L=="object"&&L!==null&&(L.$$typeof===g||L.$$typeof===p||L.$$typeof===s||L.$$typeof===a||L.$$typeof===c||L.$$typeof===v||L.$$typeof===y||L.$$typeof===x||L.$$typeof===m)}function C(L){if(typeof L=="object"&&L!==null){var Z=L.$$typeof;switch(Z){case t:var k=L.type;switch(k){case l:case u:case r:case i:case o:case d:return k;default:var ie=k&&k.$$typeof;switch(ie){case a:case c:case g:case p:case s:return ie;default:return Z}}case n:return Z}}}var S=l,R=u,I=a,T=s,_=t,$=c,A=r,M=g,O=p,B=n,j=i,D=o,V=d,G=!1;function z(L){return G||(G=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),H(L)||C(L)===l}function H(L){return C(L)===u}function ne(L){return C(L)===a}function W(L){return C(L)===s}function J(L){return typeof L=="object"&&L!==null&&L.$$typeof===t}function K(L){return C(L)===c}function U(L){return C(L)===r}function oe(L){return C(L)===g}function X(L){return C(L)===p}function te(L){return C(L)===n}function Q(L){return C(L)===i}function se(L){return C(L)===o}function ae(L){return C(L)===d}wt.AsyncMode=S,wt.ConcurrentMode=R,wt.ContextConsumer=I,wt.ContextProvider=T,wt.Element=_,wt.ForwardRef=$,wt.Fragment=A,wt.Lazy=M,wt.Memo=O,wt.Portal=B,wt.Profiler=j,wt.StrictMode=D,wt.Suspense=V,wt.isAsyncMode=z,wt.isConcurrentMode=H,wt.isContextConsumer=ne,wt.isContextProvider=W,wt.isElement=J,wt.isForwardRef=K,wt.isFragment=U,wt.isLazy=oe,wt.isMemo=X,wt.isPortal=te,wt.isProfiler=Q,wt.isStrictMode=se,wt.isSuspense=ae,wt.isValidElementType=w,wt.typeOf=C})()),wt}var xE;function jX(){return xE||(xE=1,process.env.NODE_ENV==="production"?Uu.exports=DX():Uu.exports=kX()),Uu.exports}function He(){return He=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},He.apply(null,arguments)}function LX(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ev(e,t){return ev=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},ev(e,t)}function FX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}const BX={light:"",dark:".dark"},RM=b.createContext(null);function AM(){const e=b.useContext(RM);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}function VX({id:e,className:t,children:n,config:r,...o}){const i=b.useId(),s=`chart-${e||i.replace(/:/g,"")}`;return h.jsx(RM.Provider,{value:{config:r},children:h.jsxs("div",{"data-slot":"chart","data-chart":s,className:F("ui:[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground ui:[&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 ui:[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border ui:[&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border ui:[&_.recharts-radial-bar-background-sector]:fill-muted ui:[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted ui:[&_.recharts-reference-line_[stroke='#ccc']]:stroke-border ui:flex ui:aspect-video ui:justify-center ui:text-xs ui:[&_.recharts-dot[stroke='#fff']]:stroke-transparent ui:[&_.recharts-layer]:outline-hidden ui:[&_.recharts-sector]:outline-hidden ui:[&_.recharts-sector[stroke='#fff']]:stroke-transparent ui:[&_.recharts-surface]:outline-hidden",t),...o,children:[h.jsx(TM,{id:s,config:r}),h.jsx(MX,{children:n})]})})}const TM=({id:e,config:t})=>{const n=Object.entries(t).filter(([,r])=>r.theme||r.color);return n.length?h.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(BX).map(([r,o])=>`
|
|
61
61
|
${o} [data-chart=${e}] {
|
|
62
62
|
${n.map(([i,s])=>{const a=s.theme?.[r]||s.color;return a?` --color-${i}: ${a};`:null}).join(`
|
|
63
63
|
`)}
|
|
64
64
|
}
|
|
65
65
|
`).join(`
|
|
66
|
-
`)}}):null},$X=w0;function GX({active:e,payload:t,className:n,indicator:r="dot",hideLabel:o=!1,hideIndicator:i=!1,label:s,labelFormatter:a,labelClassName:l,formatter:u,color:c,nameKey:d,labelKey:f}){const{config:p}=AM(),g=b.useMemo(()=>{if(o||!t?.length)return null;const[v]=t,y=`${f||v?.dataKey||v?.name||"value"}`,x=tv(p,v,y),w=!f&&typeof s=="string"?p[s]?.label||s:x?.label;return a?h.jsx("div",{className:F("ui:font-medium",l),children:a(w,t)}):w?h.jsx("div",{className:F("ui:font-medium",l),children:w}):null},[s,a,t,o,l,p,f]);if(!e||!t?.length)return null;const m=t.length===1&&r!=="dot";return h.jsxs("div",{className:F("ui:border-border/50 ui:bg-background ui:grid ui:min-w-[8rem] ui:items-start ui:gap-1.5 ui:rounded-lg ui:border ui:px-2.5 ui:py-1.5 ui:text-xs ui:shadow-xl",n),children:[m?null:g,h.jsx("div",{className:"ui:grid ui:gap-1.5",children:t.filter(v=>v.type!=="none").map((v,y)=>{const x=`${d||v.name||v.dataKey||"value"}`,w=tv(p,v,x),C=c||v.payload.fill||v.color;return h.jsx("div",{className:F("ui:[&>svg]:text-muted-foreground ui:flex ui:w-full ui:flex-wrap ui:items-stretch ui:gap-2 ui:[&>svg]:h-2.5 ui:[&>svg]:w-2.5",r==="dot"&&"ui:items-center"),children:u&&v?.value!==void 0&&v.name?u(v.value,v.name,v,y,v.payload):h.jsxs(h.Fragment,{children:[w?.icon?h.jsx(w.icon,{}):!i&&h.jsx("div",{className:F("ui:shrink-0 ui:rounded-[2px] ui:border-(--color-border) ui:bg-(--color-bg)",{"ui:h-2.5 ui:w-2.5":r==="dot","ui:w-1":r==="line","ui:w-0 ui:border-[1.5px] ui:border-dashed ui:bg-transparent":r==="dashed","ui:my-0.5":m&&r==="dashed"}),style:{"--color-bg":C,"--color-border":C}}),h.jsxs("div",{className:F("ui:flex ui:flex-1 ui:justify-between ui:leading-none",m?"ui:items-end":"ui:items-center"),children:[h.jsxs("div",{className:"ui:grid ui:gap-1.5",children:[m?g:null,h.jsx("span",{className:"ui:text-muted-foreground",children:w?.label||v.name})]}),v.value&&h.jsx("span",{className:"ui:text-foreground ui:font-mono ui:font-medium ui:tabular-nums",children:v.value.toLocaleString()})]})]})},v.dataKey)})})]})}const HX=y0;function WX({className:e,hideIcon:t=!1,payload:n,verticalAlign:r="bottom",nameKey:o}){const{config:i}=AM();return n?.length?h.jsx("div",{className:F("ui:flex ui:items-center ui:justify-center ui:gap-4",r==="top"?"ui:pb-3":"ui:pt-3",e),children:n.filter(s=>s.type!=="none").map(s=>{const a=`${o||s.dataKey||"value"}`,l=tv(i,s,a);return h.jsxs("div",{className:F("ui:[&>svg]:text-muted-foreground ui:flex ui:items-center ui:gap-1.5 ui:[&>svg]:h-3 ui:[&>svg]:w-3"),children:[l?.icon&&!t?h.jsx(l.icon,{}):h.jsx("div",{className:"ui:h-2 ui:w-2 ui:shrink-0 ui:rounded-[2px]",style:{backgroundColor:s.color}}),l?.label]},s.value)})}):null}function tv(e,t,n){if(typeof t!="object"||t===null)return;const r="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let o=n;return n in t&&typeof t[n]=="string"?o=t[n]:r&&n in r&&typeof r[n]=="string"&&(o=r[n]),o in e?e[o]:e[n]}function OM({className:e,...t}){return h.jsx(IT,{"data-slot":"checkbox",className:F("ui:peer ui:border-input ui:dark:bg-input/30 ui:data-[state=checked]:bg-primary ui:data-[state=checked]:text-primary-foreground ui:dark:data-[state=checked]:bg-primary ui:data-[state=checked]:border-primary ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:aria-invalid:ring-destructive/20 ui:dark:aria-invalid:ring-destructive/40 ui:aria-invalid:border-destructive ui:size-4 ui:shrink-0 ui:rounded-[4px] ui:border ui:shadow-xs ui:transition-shadow ui:outline-none ui:focus-visible:ring-[3px] ui:disabled:cursor-not-allowed ui:disabled:opacity-50",e),...t,children:h.jsx(AT,{"data-slot":"checkbox-indicator",className:"ui:grid ui:place-content-center ui:text-current ui:transition-none",children:h.jsx(_e.CheckIcon,{className:"ui:size-3.5"})})})}function zX({...e}){return h.jsx(YR,{"data-slot":"collapsible",...e})}function qX({...e}){return h.jsx(Qv,{"data-slot":"collapsible-trigger",...e})}function UX({...e}){return h.jsx(ty,{"data-slot":"collapsible-content",...e})}var wE=1,YX=.9,XX=.8,ZX=.17,Sm=.1,Em=.999,JX=.9999,KX=.99,QX=/[\\\/_+.#"@\[\(\{&]/,e8=/[\\\/_+.#"@\[\(\{&]/g,t8=/[\s-]/,NM=/[\s-]/g;function nv(e,t,n,r,o,i,s){if(i===t.length)return o===e.length?wE:KX;var a=`${o},${i}`;if(s[a]!==void 0)return s[a];for(var l=r.charAt(i),u=n.indexOf(l,o),c=0,d,f,p,g;u>=0;)d=nv(e,t,n,r,u+1,i+1,s),d>c&&(u===o?d*=wE:QX.test(e.charAt(u-1))?(d*=XX,p=e.slice(o,u-1).match(e8),p&&o>0&&(d*=Math.pow(Em,p.length))):t8.test(e.charAt(u-1))?(d*=YX,g=e.slice(o,u-1).match(NM),g&&o>0&&(d*=Math.pow(Em,g.length))):(d*=ZX,o>0&&(d*=Math.pow(Em,u-o))),e.charAt(u)!==t.charAt(i)&&(d*=JX)),(d<Sm&&n.charAt(u-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(u-1)!==r.charAt(i))&&(f=nv(e,t,n,r,u+1,i+2,s),f*Sm>d&&(d=f*Sm)),d>c&&(c=d),u=n.indexOf(l,u+1);return s[a]=c,c}function CE(e){return e.toLowerCase().replace(NM," ")}function n8(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,nv(e,t,CE(e),CE(t),0,0,{})}var Fa='[cmdk-group=""]',Im='[cmdk-group-items=""]',r8='[cmdk-group-heading=""]',PM='[cmdk-item=""]',SE=`${PM}:not([aria-disabled="true"])`,rv="cmdk-item-select",ks="data-value",o8=(e,t,n)=>n8(e,t,n),_M=b.createContext(void 0),hu=()=>b.useContext(_M),MM=b.createContext(void 0),C0=()=>b.useContext(MM),DM=b.createContext(void 0),kM=b.forwardRef((e,t)=>{let n=js(()=>{var W,J;return{search:"",value:(J=(W=e.value)!=null?W:e.defaultValue)!=null?J:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=js(()=>new Set),o=js(()=>new Map),i=js(()=>new Map),s=js(()=>new Set),a=jM(e),{label:l,children:u,value:c,onValueChange:d,filter:f,shouldFilter:p,loop:g,disablePointerSelection:m=!1,vimBindings:v=!0,...y}=e,x=Vt(),w=Vt(),C=Vt(),S=b.useRef(null),R=g8();es(()=>{if(c!==void 0){let W=c.trim();n.current.value=W,I.emit()}},[c]),es(()=>{R(6,O)},[]);let I=b.useMemo(()=>({subscribe:W=>(s.current.add(W),()=>s.current.delete(W)),snapshot:()=>n.current,setState:(W,J,K)=>{var U,oe,X,te;if(!Object.is(n.current[W],J)){if(n.current[W]=J,W==="search")M(),$(),R(1,A);else if(W==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Q=document.getElementById(C);Q?Q.focus():(U=document.getElementById(x))==null||U.focus()}if(R(7,()=>{var Q;n.current.selectedItemId=(Q=B())==null?void 0:Q.id,I.emit()}),K||R(5,O),((oe=a.current)==null?void 0:oe.value)!==void 0){let Q=J??"";(te=(X=a.current).onValueChange)==null||te.call(X,Q);return}}I.emit()}},emit:()=>{s.current.forEach(W=>W())}}),[]),T=b.useMemo(()=>({value:(W,J,K)=>{var U;J!==((U=i.current.get(W))==null?void 0:U.value)&&(i.current.set(W,{value:J,keywords:K}),n.current.filtered.items.set(W,_(J,K)),R(2,()=>{$(),I.emit()}))},item:(W,J)=>(r.current.add(W),J&&(o.current.has(J)?o.current.get(J).add(W):o.current.set(J,new Set([W]))),R(3,()=>{M(),$(),n.current.value||A(),I.emit()}),()=>{i.current.delete(W),r.current.delete(W),n.current.filtered.items.delete(W);let K=B();R(4,()=>{M(),K?.getAttribute("id")===W&&A(),I.emit()})}),group:W=>(o.current.has(W)||o.current.set(W,new Set),()=>{i.current.delete(W),o.current.delete(W)}),filter:()=>a.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:x,inputId:C,labelId:w,listInnerRef:S}),[]);function _(W,J){var K,U;let oe=(U=(K=a.current)==null?void 0:K.filter)!=null?U:o8;return W?oe(W,n.current.search,J):0}function $(){if(!n.current.search||a.current.shouldFilter===!1)return;let W=n.current.filtered.items,J=[];n.current.filtered.groups.forEach(U=>{let oe=o.current.get(U),X=0;oe.forEach(te=>{let Q=W.get(te);X=Math.max(Q,X)}),J.push([U,X])});let K=S.current;j().sort((U,oe)=>{var X,te;let Q=U.getAttribute("id"),se=oe.getAttribute("id");return((X=W.get(se))!=null?X:0)-((te=W.get(Q))!=null?te:0)}).forEach(U=>{let oe=U.closest(Im);oe?oe.appendChild(U.parentElement===oe?U:U.closest(`${Im} > *`)):K.appendChild(U.parentElement===K?U:U.closest(`${Im} > *`))}),J.sort((U,oe)=>oe[1]-U[1]).forEach(U=>{var oe;let X=(oe=S.current)==null?void 0:oe.querySelector(`${Fa}[${ks}="${encodeURIComponent(U[0])}"]`);X?.parentElement.appendChild(X)})}function A(){let W=j().find(K=>K.getAttribute("aria-disabled")!=="true"),J=W?.getAttribute(ks);I.setState("value",J||void 0)}function M(){var W,J,K,U;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let oe=0;for(let X of r.current){let te=(J=(W=i.current.get(X))==null?void 0:W.value)!=null?J:"",Q=(U=(K=i.current.get(X))==null?void 0:K.keywords)!=null?U:[],se=_(te,Q);n.current.filtered.items.set(X,se),se>0&&oe++}for(let[X,te]of o.current)for(let Q of te)if(n.current.filtered.items.get(Q)>0){n.current.filtered.groups.add(X);break}n.current.filtered.count=oe}function O(){var W,J,K;let U=B();U&&(((W=U.parentElement)==null?void 0:W.firstChild)===U&&((K=(J=U.closest(Fa))==null?void 0:J.querySelector(r8))==null||K.scrollIntoView({block:"nearest"})),U.scrollIntoView({block:"nearest"}))}function B(){var W;return(W=S.current)==null?void 0:W.querySelector(`${PM}[aria-selected="true"]`)}function j(){var W;return Array.from(((W=S.current)==null?void 0:W.querySelectorAll(SE))||[])}function D(W){let J=j()[W];J&&I.setState("value",J.getAttribute(ks))}function V(W){var J;let K=B(),U=j(),oe=U.findIndex(te=>te===K),X=U[oe+W];(J=a.current)!=null&&J.loop&&(X=oe+W<0?U[U.length-1]:oe+W===U.length?U[0]:U[oe+W]),X&&I.setState("value",X.getAttribute(ks))}function G(W){let J=B(),K=J?.closest(Fa),U;for(;K&&!U;)K=W>0?p8(K,Fa):h8(K,Fa),U=K?.querySelector(SE);U?I.setState("value",U.getAttribute(ks)):V(W)}let z=()=>D(j().length-1),H=W=>{W.preventDefault(),W.metaKey?z():W.altKey?G(1):V(1)},ne=W=>{W.preventDefault(),W.metaKey?D(0):W.altKey?G(-1):V(-1)};return b.createElement(_n.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:W=>{var J;(J=y.onKeyDown)==null||J.call(y,W);let K=W.nativeEvent.isComposing||W.keyCode===229;if(!(W.defaultPrevented||K))switch(W.key){case"n":case"j":{v&&W.ctrlKey&&H(W);break}case"ArrowDown":{H(W);break}case"p":case"k":{v&&W.ctrlKey&&ne(W);break}case"ArrowUp":{ne(W);break}case"Home":{W.preventDefault(),D(0);break}case"End":{W.preventDefault(),z();break}case"Enter":{W.preventDefault();let U=B();if(U){let oe=new Event(rv);U.dispatchEvent(oe)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:b8},l),Ef(e,W=>b.createElement(MM.Provider,{value:I},b.createElement(_M.Provider,{value:T},W))))}),i8=b.forwardRef((e,t)=>{var n,r;let o=Vt(),i=b.useRef(null),s=b.useContext(DM),a=hu(),l=jM(e),u=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:s?.forceMount;es(()=>{if(!u)return a.item(o,s?.id)},[u]);let c=LM(o,i,[e.value,e.children,i],e.keywords),d=C0(),f=fi(R=>R.value&&R.value===c.current),p=fi(R=>u||a.filter()===!1?!0:R.search?R.filtered.items.get(o)>0:!0);b.useEffect(()=>{let R=i.current;if(!(!R||e.disabled))return R.addEventListener(rv,g),()=>R.removeEventListener(rv,g)},[p,e.onSelect,e.disabled]);function g(){var R,I;m(),(I=(R=l.current).onSelect)==null||I.call(R,c.current)}function m(){d.setState("value",c.current,!0)}if(!p)return null;let{disabled:v,value:y,onSelect:x,forceMount:w,keywords:C,...S}=e;return b.createElement(_n.div,{ref:no(i,t),...S,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||a.getDisablePointerSelection()?void 0:m,onClick:v?void 0:g},e.children)}),s8=b.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,s=Vt(),a=b.useRef(null),l=b.useRef(null),u=Vt(),c=hu(),d=fi(p=>o||c.filter()===!1?!0:p.search?p.filtered.groups.has(s):!0);es(()=>c.group(s),[]),LM(s,a,[e.value,e.heading,l]);let f=b.useMemo(()=>({id:s,forceMount:o}),[o]);return b.createElement(_n.div,{ref:no(a,t),...i,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&b.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Ef(e,p=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},b.createElement(DM.Provider,{value:f},p))))}),a8=b.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=b.useRef(null),i=fi(s=>!s.search);return!n&&!i?null:b.createElement(_n.div,{ref:no(o,t),...r,"cmdk-separator":"",role:"separator"})}),l8=b.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=C0(),s=fi(u=>u.search),a=fi(u=>u.selectedItemId),l=hu();return b.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),b.createElement(_n.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":a,id:l.inputId,type:"text",value:o?e.value:s,onChange:u=>{o||i.setState("search",u.target.value),n?.(u.target.value)}})}),u8=b.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,i=b.useRef(null),s=b.useRef(null),a=fi(u=>u.selectedItemId),l=hu();return b.useEffect(()=>{if(s.current&&i.current){let u=s.current,c=i.current,d,f=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let p=u.offsetHeight;c.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return f.observe(u),()=>{cancelAnimationFrame(d),f.unobserve(u)}}},[]),b.createElement(_n.div,{ref:no(i,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:l.listId},Ef(e,u=>b.createElement("div",{ref:no(s,l.listInnerRef),"cmdk-list-sizer":""},u)))}),c8=b.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:s,...a}=e;return b.createElement(Xl,{open:n,onOpenChange:r},b.createElement(Zl,{container:s},b.createElement(Jl,{"cmdk-overlay":"",className:o}),b.createElement(Kl,{"aria-label":e.label,"cmdk-dialog":"",className:i},b.createElement(kM,{ref:t,...a}))))}),d8=b.forwardRef((e,t)=>fi(n=>n.filtered.count===0)?b.createElement(_n.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),f8=b.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...i}=e;return b.createElement(_n.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Ef(e,s=>b.createElement("div",{"aria-hidden":!0},s)))}),ms=Object.assign(kM,{List:u8,Item:i8,Input:l8,Group:s8,Separator:a8,Dialog:c8,Empty:d8,Loading:f8});function p8(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function h8(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function jM(e){let t=b.useRef(e);return es(()=>{t.current=e}),t}var es=typeof window>"u"?b.useEffect:b.useLayoutEffect;function js(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function fi(e){let t=C0(),n=()=>e(t.snapshot());return b.useSyncExternalStore(t.subscribe,n,n)}function LM(e,t,n,r=[]){let o=b.useRef(),i=hu();return es(()=>{var s;let a=(()=>{var u;for(let c of n){if(typeof c=="string")return c.trim();if(typeof c=="object"&&"current"in c)return c.current?(u=c.current.textContent)==null?void 0:u.trim():o.current}})(),l=r.map(u=>u.trim());i.value(e,a,l),(s=t.current)==null||s.setAttribute(ks,a),o.current=a}),o}var g8=()=>{let[e,t]=b.useState(),n=js(()=>new Map);return es(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function m8(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Ef({asChild:e,children:t},n){return e&&b.isValidElement(t)?b.cloneElement(m8(t),{ref:t.ref},n(t.props.children)):n(t)}var b8={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function S0({...e}){return h.jsx(Xl,{"data-slot":"dialog",...e})}function FM({...e}){return h.jsx(jd,{"data-slot":"dialog-trigger",...e})}function BM({...e}){return h.jsx(Zl,{"data-slot":"dialog-portal",...e})}function v8({...e}){return h.jsx(ds,{"data-slot":"dialog-close",...e})}function VM({className:e,...t}){return h.jsx(Jl,{"data-slot":"dialog-overlay",className:F("ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:fixed ui:inset-0 ui:z-50 ui:bg-black/50",e),...t})}function E0({className:e,children:t,showCloseButton:n=!0,...r}){return h.jsxs(BM,{"data-slot":"dialog-portal",children:[h.jsx(VM,{}),h.jsxs(Kl,{"data-slot":"dialog-content",className:F("ui:bg-background ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:fixed ui:top-[50%] ui:left-[50%] ui:z-50 ui:grid ui:w-full ui:max-w-[calc(100%-2rem)] ui:translate-x-[-50%] ui:translate-y-[-50%] ui:gap-4 ui:rounded-lg ui:border ui:p-6 ui:shadow-lg ui:duration-200 ui:outline-none ui:sm:max-w-lg",e),...r,children:[t,n&&h.jsxs(ds,{"data-slot":"dialog-close",className:"ui:ring-offset-background ui:focus:ring-ring ui:data-[state=open]:bg-accent ui:data-[state=open]:text-muted-foreground ui:absolute ui:top-4 ui:right-4 ui:rounded-xs ui:opacity-70 ui:transition-opacity ui:hover:opacity-100 ui:focus:ring-2 ui:focus:ring-offset-2 ui:focus:outline-hidden ui:disabled:pointer-events-none ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",children:[h.jsx(_e.XIcon,{}),h.jsx("span",{className:"ui:sr-only",children:"Close"})]})]})]})}function I0({className:e,...t}){return h.jsx("div",{"data-slot":"dialog-header",className:F("ui:flex ui:flex-col ui:gap-2 ui:text-center ui:sm:text-left",e),...t})}function y8({className:e,...t}){return h.jsx("div",{"data-slot":"dialog-footer",className:F("ui:flex ui:flex-col-reverse ui:gap-2 ui:sm:flex-row ui:sm:justify-end",e),...t})}function R0({className:e,...t}){return h.jsx(Ld,{"data-slot":"dialog-title",className:F("ui:text-lg ui:leading-none ui:font-semibold",e),...t})}function $M({className:e,...t}){return h.jsx(Fd,{"data-slot":"dialog-description",className:F("ui:text-muted-foreground ui:text-sm",e),...t})}function GM({className:e,...t}){return h.jsx(ms,{shouldFilter:!1,"data-slot":"command",className:F("ui:bg-popover ui:text-popover-foreground ui:flex ui:h-full ui:w-full ui:flex-col ui:overflow-hidden ui:rounded-md",e),...t})}function x8({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:o=!0,...i}){return h.jsxs(S0,{...i,children:[h.jsxs(I0,{className:"ui:sr-only",children:[h.jsx(R0,{children:e}),h.jsx($M,{children:t})]}),h.jsx(E0,{className:F("ui:overflow-hidden ui:p-0",r),showCloseButton:o,children:h.jsx(GM,{className:"ui:[&_[cmdk-group-heading]]:text-muted-foreground ui:**:data-[slot=command-input-wrapper]:h-12 ui:[&_[cmdk-group-heading]]:px-2 ui:[&_[cmdk-group-heading]]:font-medium ui:[&_[cmdk-group]]:px-2 ui:[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 ui:[&_[cmdk-input-wrapper]_svg]:h-5 ui:[&_[cmdk-input-wrapper]_svg]:w-5 ui:[&_[cmdk-input]]:h-12 ui:[&_[cmdk-item]]:px-2 ui:[&_[cmdk-item]]:py-3 ui:[&_[cmdk-item]_svg]:h-5 ui:[&_[cmdk-item]_svg]:w-5",children:n})})]})}function w8({containerClassName:e,className:t,...n}){return h.jsxs("div",{"data-slot":"command-input-wrapper",className:F("ui:flex ui:h-9 ui:items-center ui:gap-2 ui:border-b ui:px-3",e),children:[h.jsx(_e.SearchIcon,{className:"ui:size-4 ui:shrink-0 ui:opacity-50"}),h.jsx(ms.Input,{"data-slot":"command-input",className:F("ui:placeholder:text-muted-foreground ui:flex ui:h-10 ui:w-full ui:rounded-md ui:bg-transparent ui:py-3 ui:text-sm ui:outline-hidden ui:disabled:cursor-not-allowed ui:disabled:opacity-50",t),...n})]})}function C8({className:e,...t}){return h.jsx(ms.List,{"data-slot":"command-list",className:F("ui:max-h-[300px] ui:scroll-py-1 ui:overflow-x-hidden ui:overflow-y-auto",e),...t})}function S8({...e}){return h.jsx(ms.Empty,{"data-slot":"command-empty",className:"ui:py-6 ui:text-center ui:text-sm",...e})}function E8({className:e,...t}){return h.jsx(ms.Group,{"data-slot":"command-group",className:F("ui:text-foreground ui:[&_[cmdk-group-heading]]:text-muted-foreground ui:overflow-hidden ui:p-1 ui:[&_[cmdk-group-heading]]:px-2 ui:[&_[cmdk-group-heading]]:py-1.5 ui:[&_[cmdk-group-heading]]:text-xs ui:[&_[cmdk-group-heading]]:font-medium",e),...t})}function I8({className:e,...t}){return h.jsx(ms.Separator,{"data-slot":"command-separator",className:F("ui:bg-border ui:-mx-1 ui:h-px",e),...t})}function R8({className:e,...t}){return h.jsx(ms.Item,{"data-slot":"command-item",className:F("ui:data-[selected=true]:bg-accent ui:data-[selected=true]:text-accent-foreground ui:[&_svg:not([class*='text-'])]:text-muted-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:px-2 ui:py-1.5 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled=true]:pointer-events-none ui:data-[disabled=true]:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...t})}function A8({className:e,...t}){return h.jsx("span",{"data-slot":"command-shortcut",className:F("ui:text-muted-foreground ui:ml-auto ui:text-xs ui:tracking-widest",e),...t})}const HM=({title:e,className:t,titleClassName:n,header:r="",children:o})=>h.jsxs("div",{className:F("ui:bg-white ui:border ui:border-gray-200 ui:rounded-lg ui:shadow",e?"ui:p-4 ui:mt-4":"ui:p-2 ui:items-center",t),children:[r,!r&&e&&h.jsx("h3",{className:F("ui:text-xl ui:text-black-900 ui:font-semibold",n),children:e}),o]}),T8=({onCreate:e,onDelete:t,showCreate:n=!0,className:r})=>h.jsxs("div",{className:F("ui:h-full ui:mt-6 ui:flex ui:gap-2",r),children:[h.jsxs(_r,{children:[h.jsx(rn,{condition:n,children:h.jsx(_e.PlusCircle,{color:"green",size:20,onClick:e,className:"ui:cursor-pointer ui:h-full"})}),h.jsx(Ki,{children:h.jsx("div",{className:"ui:size-5"})})]}),h.jsx(_e.CircleX,{color:"red",size:20,onClick:t,className:"ui:cursor-pointer ui:h-full"})]});var O8="Label",WM=b.forwardRef((e,t)=>h.jsx(_n.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));WM.displayName=O8;var N8=WM;function gr({className:e,variant:t="default",...n}){return h.jsx(N8,{"data-slot":"label",className:F(l9({variant:t}),e),...n})}function If({description:e,className:t}){return h.jsx("p",{className:F("ui:text-gray-500 ui:text-xs ui:mt-1",t),children:e})}const zM=({label:e,name:t,description:n,onCheckedChange:r,...o})=>h.jsxs("article",{children:[h.jsxs("div",{className:"ui:flex ui:items-center ui:gap-2",children:[h.jsx(OM,{...o,id:t,onCheckedChange:r}),h.jsx(gr,{htmlFor:t,children:e})]}),n&&h.jsx(If,{description:n})]});function Rm({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=b.useRef(e!==void 0),[i,s]=b.useState(t),a=o?e:i;if(process.env.NODE_ENV!=="production"){b.useEffect(()=>{o!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${o?"":"un"}controlled ${r} state of ${n} to be ${o?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
|
|
66
|
+
`)}}):null},$X=w0;function GX({active:e,payload:t,className:n,indicator:r="dot",hideLabel:o=!1,hideIndicator:i=!1,label:s,labelFormatter:a,labelClassName:l,formatter:u,color:c,nameKey:d,labelKey:f}){const{config:p}=AM(),g=b.useMemo(()=>{if(o||!t?.length)return null;const[v]=t,y=`${f||v?.dataKey||v?.name||"value"}`,x=tv(p,v,y),w=!f&&typeof s=="string"?p[s]?.label||s:x?.label;return a?h.jsx("div",{className:F("ui:font-medium",l),children:a(w,t)}):w?h.jsx("div",{className:F("ui:font-medium",l),children:w}):null},[s,a,t,o,l,p,f]);if(!e||!t?.length)return null;const m=t.length===1&&r!=="dot";return h.jsxs("div",{className:F("ui:border-border/50 ui:bg-background ui:grid ui:min-w-[8rem] ui:items-start ui:gap-1.5 ui:rounded-lg ui:border ui:px-2.5 ui:py-1.5 ui:text-xs ui:shadow-xl",n),children:[m?null:g,h.jsx("div",{className:"ui:grid ui:gap-1.5",children:t.filter(v=>v.type!=="none").map((v,y)=>{const x=`${d||v.name||v.dataKey||"value"}`,w=tv(p,v,x),C=c||v.payload.fill||v.color;return h.jsx("div",{className:F("ui:[&>svg]:text-muted-foreground ui:flex ui:w-full ui:flex-wrap ui:items-stretch ui:gap-2 ui:[&>svg]:h-2.5 ui:[&>svg]:w-2.5",r==="dot"&&"ui:items-center"),children:u&&v?.value!==void 0&&v.name?u(v.value,v.name,v,y,v.payload):h.jsxs(h.Fragment,{children:[w?.icon?h.jsx(w.icon,{}):!i&&h.jsx("div",{className:F("ui:shrink-0 ui:rounded-[2px] ui:border-(--color-border) ui:bg-(--color-bg)",{"ui:h-2.5 ui:w-2.5":r==="dot","ui:w-1":r==="line","ui:w-0 ui:border-[1.5px] ui:border-dashed ui:bg-transparent":r==="dashed","ui:my-0.5":m&&r==="dashed"}),style:{"--color-bg":C,"--color-border":C}}),h.jsxs("div",{className:F("ui:flex ui:flex-1 ui:justify-between ui:leading-none ui:gap-2",m?"ui:items-end":"ui:items-center"),children:[h.jsxs("div",{className:"ui:grid ui:gap-1.5",children:[m?g:null,h.jsx("span",{className:"ui:text-muted-foreground",children:w?.label||v.name})]}),v.value&&h.jsx("span",{className:"ui:text-foreground ui:font-mono ui:font-medium ui:tabular-nums",children:v.value.toLocaleString()})]})]})},v.dataKey)})})]})}const HX=y0;function WX({className:e,hideIcon:t=!1,payload:n,verticalAlign:r="bottom",nameKey:o}){const{config:i}=AM();return n?.length?h.jsx("div",{className:F("ui:flex ui:items-center ui:justify-center ui:gap-4",r==="top"?"ui:pb-3":"ui:pt-3",e),children:n.filter(s=>s.type!=="none").map(s=>{const a=`${o||s.dataKey||"value"}`,l=tv(i,s,a);return h.jsxs("div",{className:F("ui:[&>svg]:text-muted-foreground ui:flex ui:items-center ui:gap-1.5 ui:[&>svg]:h-3 ui:[&>svg]:w-3"),children:[l?.icon&&!t?h.jsx(l.icon,{}):h.jsx("div",{className:"ui:h-2 ui:w-2 ui:shrink-0 ui:rounded-[2px]",style:{backgroundColor:s.color}}),l?.label]},s.value)})}):null}function tv(e,t,n){if(typeof t!="object"||t===null)return;const r="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let o=n;return n in t&&typeof t[n]=="string"?o=t[n]:r&&n in r&&typeof r[n]=="string"&&(o=r[n]),o in e?e[o]:e[n]}function OM({className:e,...t}){return h.jsx(IT,{"data-slot":"checkbox",className:F("ui:peer ui:border-input ui:dark:bg-input/30 ui:data-[state=checked]:bg-primary ui:data-[state=checked]:text-primary-foreground ui:dark:data-[state=checked]:bg-primary ui:data-[state=checked]:border-primary ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:aria-invalid:ring-destructive/20 ui:dark:aria-invalid:ring-destructive/40 ui:aria-invalid:border-destructive ui:size-4 ui:shrink-0 ui:rounded-[4px] ui:border ui:shadow-xs ui:transition-shadow ui:outline-none ui:focus-visible:ring-[3px] ui:disabled:cursor-not-allowed ui:disabled:opacity-50",e),...t,children:h.jsx(AT,{"data-slot":"checkbox-indicator",className:"ui:grid ui:place-content-center ui:text-current ui:transition-none",children:h.jsx(_e.CheckIcon,{className:"ui:size-3.5"})})})}function zX({...e}){return h.jsx(YR,{"data-slot":"collapsible",...e})}function qX({...e}){return h.jsx(Qv,{"data-slot":"collapsible-trigger",...e})}function UX({...e}){return h.jsx(ty,{"data-slot":"collapsible-content",...e})}var wE=1,YX=.9,XX=.8,ZX=.17,Sm=.1,Em=.999,JX=.9999,KX=.99,QX=/[\\\/_+.#"@\[\(\{&]/,e8=/[\\\/_+.#"@\[\(\{&]/g,t8=/[\s-]/,NM=/[\s-]/g;function nv(e,t,n,r,o,i,s){if(i===t.length)return o===e.length?wE:KX;var a=`${o},${i}`;if(s[a]!==void 0)return s[a];for(var l=r.charAt(i),u=n.indexOf(l,o),c=0,d,f,p,g;u>=0;)d=nv(e,t,n,r,u+1,i+1,s),d>c&&(u===o?d*=wE:QX.test(e.charAt(u-1))?(d*=XX,p=e.slice(o,u-1).match(e8),p&&o>0&&(d*=Math.pow(Em,p.length))):t8.test(e.charAt(u-1))?(d*=YX,g=e.slice(o,u-1).match(NM),g&&o>0&&(d*=Math.pow(Em,g.length))):(d*=ZX,o>0&&(d*=Math.pow(Em,u-o))),e.charAt(u)!==t.charAt(i)&&(d*=JX)),(d<Sm&&n.charAt(u-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(u-1)!==r.charAt(i))&&(f=nv(e,t,n,r,u+1,i+2,s),f*Sm>d&&(d=f*Sm)),d>c&&(c=d),u=n.indexOf(l,u+1);return s[a]=c,c}function CE(e){return e.toLowerCase().replace(NM," ")}function n8(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,nv(e,t,CE(e),CE(t),0,0,{})}var Fa='[cmdk-group=""]',Im='[cmdk-group-items=""]',r8='[cmdk-group-heading=""]',PM='[cmdk-item=""]',SE=`${PM}:not([aria-disabled="true"])`,rv="cmdk-item-select",ks="data-value",o8=(e,t,n)=>n8(e,t,n),_M=b.createContext(void 0),hu=()=>b.useContext(_M),MM=b.createContext(void 0),C0=()=>b.useContext(MM),DM=b.createContext(void 0),kM=b.forwardRef((e,t)=>{let n=js(()=>{var W,J;return{search:"",value:(J=(W=e.value)!=null?W:e.defaultValue)!=null?J:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=js(()=>new Set),o=js(()=>new Map),i=js(()=>new Map),s=js(()=>new Set),a=jM(e),{label:l,children:u,value:c,onValueChange:d,filter:f,shouldFilter:p,loop:g,disablePointerSelection:m=!1,vimBindings:v=!0,...y}=e,x=Vt(),w=Vt(),C=Vt(),S=b.useRef(null),R=g8();es(()=>{if(c!==void 0){let W=c.trim();n.current.value=W,I.emit()}},[c]),es(()=>{R(6,O)},[]);let I=b.useMemo(()=>({subscribe:W=>(s.current.add(W),()=>s.current.delete(W)),snapshot:()=>n.current,setState:(W,J,K)=>{var U,oe,X,te;if(!Object.is(n.current[W],J)){if(n.current[W]=J,W==="search")M(),$(),R(1,A);else if(W==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Q=document.getElementById(C);Q?Q.focus():(U=document.getElementById(x))==null||U.focus()}if(R(7,()=>{var Q;n.current.selectedItemId=(Q=B())==null?void 0:Q.id,I.emit()}),K||R(5,O),((oe=a.current)==null?void 0:oe.value)!==void 0){let Q=J??"";(te=(X=a.current).onValueChange)==null||te.call(X,Q);return}}I.emit()}},emit:()=>{s.current.forEach(W=>W())}}),[]),T=b.useMemo(()=>({value:(W,J,K)=>{var U;J!==((U=i.current.get(W))==null?void 0:U.value)&&(i.current.set(W,{value:J,keywords:K}),n.current.filtered.items.set(W,_(J,K)),R(2,()=>{$(),I.emit()}))},item:(W,J)=>(r.current.add(W),J&&(o.current.has(J)?o.current.get(J).add(W):o.current.set(J,new Set([W]))),R(3,()=>{M(),$(),n.current.value||A(),I.emit()}),()=>{i.current.delete(W),r.current.delete(W),n.current.filtered.items.delete(W);let K=B();R(4,()=>{M(),K?.getAttribute("id")===W&&A(),I.emit()})}),group:W=>(o.current.has(W)||o.current.set(W,new Set),()=>{i.current.delete(W),o.current.delete(W)}),filter:()=>a.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:x,inputId:C,labelId:w,listInnerRef:S}),[]);function _(W,J){var K,U;let oe=(U=(K=a.current)==null?void 0:K.filter)!=null?U:o8;return W?oe(W,n.current.search,J):0}function $(){if(!n.current.search||a.current.shouldFilter===!1)return;let W=n.current.filtered.items,J=[];n.current.filtered.groups.forEach(U=>{let oe=o.current.get(U),X=0;oe.forEach(te=>{let Q=W.get(te);X=Math.max(Q,X)}),J.push([U,X])});let K=S.current;j().sort((U,oe)=>{var X,te;let Q=U.getAttribute("id"),se=oe.getAttribute("id");return((X=W.get(se))!=null?X:0)-((te=W.get(Q))!=null?te:0)}).forEach(U=>{let oe=U.closest(Im);oe?oe.appendChild(U.parentElement===oe?U:U.closest(`${Im} > *`)):K.appendChild(U.parentElement===K?U:U.closest(`${Im} > *`))}),J.sort((U,oe)=>oe[1]-U[1]).forEach(U=>{var oe;let X=(oe=S.current)==null?void 0:oe.querySelector(`${Fa}[${ks}="${encodeURIComponent(U[0])}"]`);X?.parentElement.appendChild(X)})}function A(){let W=j().find(K=>K.getAttribute("aria-disabled")!=="true"),J=W?.getAttribute(ks);I.setState("value",J||void 0)}function M(){var W,J,K,U;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let oe=0;for(let X of r.current){let te=(J=(W=i.current.get(X))==null?void 0:W.value)!=null?J:"",Q=(U=(K=i.current.get(X))==null?void 0:K.keywords)!=null?U:[],se=_(te,Q);n.current.filtered.items.set(X,se),se>0&&oe++}for(let[X,te]of o.current)for(let Q of te)if(n.current.filtered.items.get(Q)>0){n.current.filtered.groups.add(X);break}n.current.filtered.count=oe}function O(){var W,J,K;let U=B();U&&(((W=U.parentElement)==null?void 0:W.firstChild)===U&&((K=(J=U.closest(Fa))==null?void 0:J.querySelector(r8))==null||K.scrollIntoView({block:"nearest"})),U.scrollIntoView({block:"nearest"}))}function B(){var W;return(W=S.current)==null?void 0:W.querySelector(`${PM}[aria-selected="true"]`)}function j(){var W;return Array.from(((W=S.current)==null?void 0:W.querySelectorAll(SE))||[])}function D(W){let J=j()[W];J&&I.setState("value",J.getAttribute(ks))}function V(W){var J;let K=B(),U=j(),oe=U.findIndex(te=>te===K),X=U[oe+W];(J=a.current)!=null&&J.loop&&(X=oe+W<0?U[U.length-1]:oe+W===U.length?U[0]:U[oe+W]),X&&I.setState("value",X.getAttribute(ks))}function G(W){let J=B(),K=J?.closest(Fa),U;for(;K&&!U;)K=W>0?p8(K,Fa):h8(K,Fa),U=K?.querySelector(SE);U?I.setState("value",U.getAttribute(ks)):V(W)}let z=()=>D(j().length-1),H=W=>{W.preventDefault(),W.metaKey?z():W.altKey?G(1):V(1)},ne=W=>{W.preventDefault(),W.metaKey?D(0):W.altKey?G(-1):V(-1)};return b.createElement(_n.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:W=>{var J;(J=y.onKeyDown)==null||J.call(y,W);let K=W.nativeEvent.isComposing||W.keyCode===229;if(!(W.defaultPrevented||K))switch(W.key){case"n":case"j":{v&&W.ctrlKey&&H(W);break}case"ArrowDown":{H(W);break}case"p":case"k":{v&&W.ctrlKey&&ne(W);break}case"ArrowUp":{ne(W);break}case"Home":{W.preventDefault(),D(0);break}case"End":{W.preventDefault(),z();break}case"Enter":{W.preventDefault();let U=B();if(U){let oe=new Event(rv);U.dispatchEvent(oe)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:b8},l),Ef(e,W=>b.createElement(MM.Provider,{value:I},b.createElement(_M.Provider,{value:T},W))))}),i8=b.forwardRef((e,t)=>{var n,r;let o=Vt(),i=b.useRef(null),s=b.useContext(DM),a=hu(),l=jM(e),u=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:s?.forceMount;es(()=>{if(!u)return a.item(o,s?.id)},[u]);let c=LM(o,i,[e.value,e.children,i],e.keywords),d=C0(),f=fi(R=>R.value&&R.value===c.current),p=fi(R=>u||a.filter()===!1?!0:R.search?R.filtered.items.get(o)>0:!0);b.useEffect(()=>{let R=i.current;if(!(!R||e.disabled))return R.addEventListener(rv,g),()=>R.removeEventListener(rv,g)},[p,e.onSelect,e.disabled]);function g(){var R,I;m(),(I=(R=l.current).onSelect)==null||I.call(R,c.current)}function m(){d.setState("value",c.current,!0)}if(!p)return null;let{disabled:v,value:y,onSelect:x,forceMount:w,keywords:C,...S}=e;return b.createElement(_n.div,{ref:no(i,t),...S,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||a.getDisablePointerSelection()?void 0:m,onClick:v?void 0:g},e.children)}),s8=b.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,s=Vt(),a=b.useRef(null),l=b.useRef(null),u=Vt(),c=hu(),d=fi(p=>o||c.filter()===!1?!0:p.search?p.filtered.groups.has(s):!0);es(()=>c.group(s),[]),LM(s,a,[e.value,e.heading,l]);let f=b.useMemo(()=>({id:s,forceMount:o}),[o]);return b.createElement(_n.div,{ref:no(a,t),...i,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&b.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Ef(e,p=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},b.createElement(DM.Provider,{value:f},p))))}),a8=b.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=b.useRef(null),i=fi(s=>!s.search);return!n&&!i?null:b.createElement(_n.div,{ref:no(o,t),...r,"cmdk-separator":"",role:"separator"})}),l8=b.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=C0(),s=fi(u=>u.search),a=fi(u=>u.selectedItemId),l=hu();return b.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),b.createElement(_n.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":a,id:l.inputId,type:"text",value:o?e.value:s,onChange:u=>{o||i.setState("search",u.target.value),n?.(u.target.value)}})}),u8=b.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,i=b.useRef(null),s=b.useRef(null),a=fi(u=>u.selectedItemId),l=hu();return b.useEffect(()=>{if(s.current&&i.current){let u=s.current,c=i.current,d,f=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let p=u.offsetHeight;c.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return f.observe(u),()=>{cancelAnimationFrame(d),f.unobserve(u)}}},[]),b.createElement(_n.div,{ref:no(i,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:l.listId},Ef(e,u=>b.createElement("div",{ref:no(s,l.listInnerRef),"cmdk-list-sizer":""},u)))}),c8=b.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:s,...a}=e;return b.createElement(Xl,{open:n,onOpenChange:r},b.createElement(Zl,{container:s},b.createElement(Jl,{"cmdk-overlay":"",className:o}),b.createElement(Kl,{"aria-label":e.label,"cmdk-dialog":"",className:i},b.createElement(kM,{ref:t,...a}))))}),d8=b.forwardRef((e,t)=>fi(n=>n.filtered.count===0)?b.createElement(_n.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),f8=b.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...i}=e;return b.createElement(_n.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Ef(e,s=>b.createElement("div",{"aria-hidden":!0},s)))}),ms=Object.assign(kM,{List:u8,Item:i8,Input:l8,Group:s8,Separator:a8,Dialog:c8,Empty:d8,Loading:f8});function p8(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function h8(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function jM(e){let t=b.useRef(e);return es(()=>{t.current=e}),t}var es=typeof window>"u"?b.useEffect:b.useLayoutEffect;function js(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function fi(e){let t=C0(),n=()=>e(t.snapshot());return b.useSyncExternalStore(t.subscribe,n,n)}function LM(e,t,n,r=[]){let o=b.useRef(),i=hu();return es(()=>{var s;let a=(()=>{var u;for(let c of n){if(typeof c=="string")return c.trim();if(typeof c=="object"&&"current"in c)return c.current?(u=c.current.textContent)==null?void 0:u.trim():o.current}})(),l=r.map(u=>u.trim());i.value(e,a,l),(s=t.current)==null||s.setAttribute(ks,a),o.current=a}),o}var g8=()=>{let[e,t]=b.useState(),n=js(()=>new Map);return es(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function m8(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Ef({asChild:e,children:t},n){return e&&b.isValidElement(t)?b.cloneElement(m8(t),{ref:t.ref},n(t.props.children)):n(t)}var b8={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function S0({...e}){return h.jsx(Xl,{"data-slot":"dialog",...e})}function FM({...e}){return h.jsx(jd,{"data-slot":"dialog-trigger",...e})}function BM({...e}){return h.jsx(Zl,{"data-slot":"dialog-portal",...e})}function v8({...e}){return h.jsx(ds,{"data-slot":"dialog-close",...e})}function VM({className:e,...t}){return h.jsx(Jl,{"data-slot":"dialog-overlay",className:F("ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:fixed ui:inset-0 ui:z-50 ui:bg-black/50",e),...t})}function E0({className:e,children:t,showCloseButton:n=!0,...r}){return h.jsxs(BM,{"data-slot":"dialog-portal",children:[h.jsx(VM,{}),h.jsxs(Kl,{"data-slot":"dialog-content",className:F("ui:bg-background ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:fixed ui:top-[50%] ui:left-[50%] ui:z-50 ui:grid ui:w-full ui:max-w-[calc(100%-2rem)] ui:translate-x-[-50%] ui:translate-y-[-50%] ui:gap-4 ui:rounded-lg ui:border ui:p-6 ui:shadow-lg ui:duration-200 ui:outline-none ui:sm:max-w-lg",e),...r,children:[t,n&&h.jsxs(ds,{"data-slot":"dialog-close",className:"ui:ring-offset-background ui:focus:ring-ring ui:data-[state=open]:bg-accent ui:data-[state=open]:text-muted-foreground ui:absolute ui:top-4 ui:right-4 ui:rounded-xs ui:opacity-70 ui:transition-opacity ui:hover:opacity-100 ui:focus:ring-2 ui:focus:ring-offset-2 ui:focus:outline-hidden ui:disabled:pointer-events-none ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",children:[h.jsx(_e.XIcon,{}),h.jsx("span",{className:"ui:sr-only",children:"Close"})]})]})]})}function I0({className:e,...t}){return h.jsx("div",{"data-slot":"dialog-header",className:F("ui:flex ui:flex-col ui:gap-2 ui:text-center ui:sm:text-left",e),...t})}function y8({className:e,...t}){return h.jsx("div",{"data-slot":"dialog-footer",className:F("ui:flex ui:flex-col-reverse ui:gap-2 ui:sm:flex-row ui:sm:justify-end",e),...t})}function R0({className:e,...t}){return h.jsx(Ld,{"data-slot":"dialog-title",className:F("ui:text-lg ui:leading-none ui:font-semibold",e),...t})}function $M({className:e,...t}){return h.jsx(Fd,{"data-slot":"dialog-description",className:F("ui:text-muted-foreground ui:text-sm",e),...t})}function GM({className:e,...t}){return h.jsx(ms,{shouldFilter:!1,"data-slot":"command",className:F("ui:bg-popover ui:text-popover-foreground ui:flex ui:h-full ui:w-full ui:flex-col ui:overflow-hidden ui:rounded-md",e),...t})}function x8({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:o=!0,...i}){return h.jsxs(S0,{...i,children:[h.jsxs(I0,{className:"ui:sr-only",children:[h.jsx(R0,{children:e}),h.jsx($M,{children:t})]}),h.jsx(E0,{className:F("ui:overflow-hidden ui:p-0",r),showCloseButton:o,children:h.jsx(GM,{className:"ui:[&_[cmdk-group-heading]]:text-muted-foreground ui:**:data-[slot=command-input-wrapper]:h-12 ui:[&_[cmdk-group-heading]]:px-2 ui:[&_[cmdk-group-heading]]:font-medium ui:[&_[cmdk-group]]:px-2 ui:[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 ui:[&_[cmdk-input-wrapper]_svg]:h-5 ui:[&_[cmdk-input-wrapper]_svg]:w-5 ui:[&_[cmdk-input]]:h-12 ui:[&_[cmdk-item]]:px-2 ui:[&_[cmdk-item]]:py-3 ui:[&_[cmdk-item]_svg]:h-5 ui:[&_[cmdk-item]_svg]:w-5",children:n})})]})}function w8({containerClassName:e,className:t,...n}){return h.jsxs("div",{"data-slot":"command-input-wrapper",className:F("ui:flex ui:h-9 ui:items-center ui:gap-2 ui:border-b ui:px-3",e),children:[h.jsx(_e.SearchIcon,{className:"ui:size-4 ui:shrink-0 ui:opacity-50"}),h.jsx(ms.Input,{"data-slot":"command-input",className:F("ui:placeholder:text-muted-foreground ui:flex ui:h-10 ui:w-full ui:rounded-md ui:bg-transparent ui:py-3 ui:text-sm ui:outline-hidden ui:disabled:cursor-not-allowed ui:disabled:opacity-50",t),...n})]})}function C8({className:e,...t}){return h.jsx(ms.List,{"data-slot":"command-list",className:F("ui:max-h-[300px] ui:scroll-py-1 ui:overflow-x-hidden ui:overflow-y-auto",e),...t})}function S8({...e}){return h.jsx(ms.Empty,{"data-slot":"command-empty",className:"ui:py-6 ui:text-center ui:text-sm",...e})}function E8({className:e,...t}){return h.jsx(ms.Group,{"data-slot":"command-group",className:F("ui:text-foreground ui:[&_[cmdk-group-heading]]:text-muted-foreground ui:overflow-hidden ui:p-1 ui:[&_[cmdk-group-heading]]:px-2 ui:[&_[cmdk-group-heading]]:py-1.5 ui:[&_[cmdk-group-heading]]:text-xs ui:[&_[cmdk-group-heading]]:font-medium",e),...t})}function I8({className:e,...t}){return h.jsx(ms.Separator,{"data-slot":"command-separator",className:F("ui:bg-border ui:-mx-1 ui:h-px",e),...t})}function R8({className:e,...t}){return h.jsx(ms.Item,{"data-slot":"command-item",className:F("ui:data-[selected=true]:bg-accent ui:data-[selected=true]:text-accent-foreground ui:[&_svg:not([class*='text-'])]:text-muted-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:px-2 ui:py-1.5 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled=true]:pointer-events-none ui:data-[disabled=true]:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...t})}function A8({className:e,...t}){return h.jsx("span",{"data-slot":"command-shortcut",className:F("ui:text-muted-foreground ui:ml-auto ui:text-xs ui:tracking-widest",e),...t})}const HM=({title:e,className:t,titleClassName:n,header:r="",children:o})=>h.jsxs("div",{className:F("ui:bg-white ui:border ui:border-gray-200 ui:rounded-lg ui:shadow",e?"ui:p-4 ui:mt-4":"ui:p-2 ui:items-center",t),children:[r,!r&&e&&h.jsx("h3",{className:F("ui:text-xl ui:text-black-900 ui:font-semibold",n),children:e}),o]}),T8=({onCreate:e,onDelete:t,showCreate:n=!0,className:r})=>h.jsxs("div",{className:F("ui:h-full ui:mt-6 ui:flex ui:gap-2",r),children:[h.jsxs(_r,{children:[h.jsx(rn,{condition:n,children:h.jsx(_e.PlusCircle,{color:"green",size:20,onClick:e,className:"ui:cursor-pointer ui:h-full"})}),h.jsx(Ki,{children:h.jsx("div",{className:"ui:size-5"})})]}),h.jsx(_e.CircleX,{color:"red",size:20,onClick:t,className:"ui:cursor-pointer ui:h-full"})]});var O8="Label",WM=b.forwardRef((e,t)=>h.jsx(_n.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));WM.displayName=O8;var N8=WM;function gr({className:e,variant:t="default",...n}){return h.jsx(N8,{"data-slot":"label",className:F(l9({variant:t}),e),...n})}function If({description:e,className:t}){return h.jsx("p",{className:F("ui:text-gray-500 ui:text-xs ui:mt-1",t),children:e})}const zM=({label:e,name:t,description:n,onCheckedChange:r,...o})=>h.jsxs("article",{children:[h.jsxs("div",{className:"ui:flex ui:items-center ui:gap-2",children:[h.jsx(OM,{...o,id:t,onCheckedChange:r}),h.jsx(gr,{htmlFor:t,children:e})]}),n&&h.jsx(If,{description:n})]});function Rm({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=b.useRef(e!==void 0),[i,s]=b.useState(t),a=o?e:i;if(process.env.NODE_ENV!=="production"){b.useEffect(()=>{o!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${o?"":"un"}controlled ${r} state of ${n} to be ${o?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
|
|
67
67
|
`))},[r,n,e]);const{current:u}=b.useRef(t);b.useEffect(()=>{!o&&JSON.stringify(u)!==JSON.stringify(t)&&console.error([`Base UI: A component is changing the default ${r} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
|
|
68
68
|
`))},[JSON.stringify(t)])}const l=b.useCallback(u=>{o||s(u)},[]);return[a,l]}const EE={};function cr(e,t){const n=b.useRef(EE);return n.current===EE&&(n.current=e(t)),n}const Am=b[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],P8=Am&&Am!==b.useLayoutEffect?Am:e=>e();function ke(e){const t=cr(_8).current;return t.next=e,P8(t.effect),t.trampoline}function _8(){const e={next:void 0,callback:M8,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function M8(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}const D8=()=>{},Ge=typeof document<"u"?b.useLayoutEffect:D8,A0=b.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});process.env.NODE_ENV!=="production"&&(A0.displayName="CompositeListContext");function k8(){return b.useContext(A0)}function qM(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:o}=e,i=ke(o),s=b.useRef(0),a=cr(L8).current,l=cr(j8).current,[u,c]=b.useState(0),d=b.useRef(u),f=ke((y,x)=>{l.set(y,x??null),d.current+=1,c(d.current)}),p=ke(y=>{l.delete(y),d.current+=1,c(d.current)}),g=b.useMemo(()=>{const y=new Map;return Array.from(l.keys()).filter(w=>w.isConnected).sort(F8).forEach((w,C)=>{const S=l.get(w)??{};y.set(w,{...S,index:C})}),y},[l,u]);Ge(()=>{if(typeof MutationObserver!="function"||g.size===0)return;const y=new MutationObserver(x=>{const w=new Set,C=S=>w.has(S)?w.delete(S):w.add(S);x.forEach(S=>{S.removedNodes.forEach(C),S.addedNodes.forEach(C)}),w.size===0&&(d.current+=1,c(d.current))});return g.forEach((x,w)=>{w.parentElement&&y.observe(w.parentElement,{childList:!0})}),()=>{y.disconnect()}},[g]),Ge(()=>{d.current===u&&(n.current.length!==g.size&&(n.current.length=g.size),r&&r.current.length!==g.size&&(r.current.length=g.size),s.current=g.size),i(g)},[i,g,n,r,u]),Ge(()=>()=>{n.current=[]},[n]),Ge(()=>()=>{r&&(r.current=[])},[r]);const m=ke(y=>(a.add(y),()=>{a.delete(y)}));Ge(()=>{a.forEach(y=>y(g))},[a,g]);const v=b.useMemo(()=>({register:f,unregister:p,subscribeMapChange:m,elementsRef:n,labelsRef:r,nextIndexRef:s}),[f,p,m,n,r,s]);return h.jsx(A0.Provider,{value:v,children:t})}function j8(){return new Map}function L8(){return new Set}function F8(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const UM=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(UM.displayName="DirectionContext");function YM(){return b.useContext(UM)?.direction??"ltr"}function Fr(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(r=>n.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${n} for the full message.`}function Ml(e,t,n,r){const o=cr(XM).current;return V8(o,e,t,n,r)&&ZM(o,[e,t,n,r]),o.callback}function B8(e){const t=cr(XM).current;return $8(t,e)&&ZM(t,e),t.callback}function XM(){return{callback:null,cleanup:null,refs:[]}}function V8(e,t,n,r,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==o}function $8(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function ZM(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const i=t[o];if(i!=null)switch(typeof i){case"function":{const s=i(n);typeof s=="function"&&(r[o]=s);break}case"object":{i.current=n;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const i=t[o];if(i!=null)switch(typeof i){case"function":{const s=r[o];typeof s=="function"?s():i(null);break}case"object":{i.current=null;break}}}}}}}const G8=parseInt(b.version,10);function T0(e){return G8>=e}function IE(e){if(!b.isValidElement(e))return null;const t=e,n=t.props;return(T0(19)?n?.ref:t.ref)??null}function ov(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function H8(e,t){const n={};for(const r in e){const o=e[r];if(t?.hasOwnProperty(r)){const i=t[r](o);i!=null&&Object.assign(n,i);continue}o===!0?n[`data-${r.toLowerCase()}`]="":o&&(n[`data-${r.toLowerCase()}`]=o.toString())}return n}function W8(e,t){return typeof e=="function"?e(t):e}function z8(e,t){return typeof e=="function"?e(t):e}const cl={};function JM(e,t,n,r,o){let i={...iv(e,cl)};return t&&(i=Tc(i,t)),n&&(i=Tc(i,n)),r&&(i=Tc(i,r)),i}function q8(e){if(e.length===0)return cl;if(e.length===1)return iv(e[0],cl);let t={...iv(e[0],cl)};for(let n=1;n<e.length;n+=1)t=Tc(t,e[n]);return t}function Tc(e,t){return KM(t)?t(e):U8(e,t)}function U8(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=ov(e.style,r);break}case"className":{e[n]=QM(e.className,r);break}default:Y8(n,r)?e[n]=X8(e[n],r):e[n]=r}}return e}function Y8(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),o=e.charCodeAt(2);return n===111&&r===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function KM(e){return typeof e=="function"}function iv(e,t){return KM(e)?e(t):e??cl}function X8(e,t){return t?e?n=>{if(Z8(n)){const o=n;sv(o);const i=t(o);return o.baseUIHandlerPrevented||e?.(o),i}const r=t(n);return e?.(n),r}:t:e}function sv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function QM(e,t){return t?e?t+" "+e:t:e}function Z8(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Lt(){}const Yu=Object.freeze([]),En=Object.freeze({}),J8={style:{transition:"none"}},K8="data-base-ui-click-trigger",Q8={fallbackAxisSide:"none"},e7={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Mn(e,t,n={}){const r=t.render,o=t7(t,n);if(n.enabled===!1)return null;const i=n.state??En;return r7(e,r,o,i)}function t7(e,t={}){const{className:n,style:r,render:o}=e,{state:i=En,ref:s,props:a,stateAttributesMapping:l,enabled:u=!0}=t,c=u?W8(n,i):void 0,d=u?z8(r,i):void 0,f=u?H8(i,l):En,p=u?ov(f,Array.isArray(a)?q8(a):a)??En:En;return typeof document<"u"&&(u?Array.isArray(s)?p.ref=B8([p.ref,IE(o),...s]):p.ref=Ml(p.ref,IE(o),s):Ml(null,null)),u?(c!==void 0&&(p.className=QM(p.className,c)),d!==void 0&&(p.style=ov(p.style,d)),p):En}const n7=Symbol.for("react.lazy");function r7(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const o=JM(n,t.props);o.ref=n.ref;let i=t;if(i?.$$typeof===n7&&(i=b.Children.toArray(t)[0]),process.env.NODE_ENV!=="production"&&!b.isValidElement(i))throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.","https://base-ui.com/r/invalid-render-prop"].join(`
|
|
69
69
|
`));return b.cloneElement(i,o)}if(e&&typeof e=="string")return o7(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":Fr(8))}function o7(e,t){return e==="button"?N.createElement("button",{type:"button",...t,key:t.key}):e==="img"?N.createElement("img",{alt:"",...t,key:t.key}):b.createElement(e,t)}const er="none",av="trigger-press",i7="trigger-hover",O0="outside-press",s7="item-press",RE="clear-press",a7="chip-remove-press",Hs="input-change",ei="input-clear",l7="input-press",Rf="focus-out",eD="escape-key",dl="list-navigation";function Qe(e,t,n,r){let o=!1,i=!1;const s=En;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){i=!0},get isCanceled(){return o},get isPropagationAllowed(){return i},trigger:n,...s}}function Ba(e,t,n){const r=n??En;return{reason:e,event:t??new Event("base-ui"),...r}}const lv={...b};let AE=0;function u7(e,t="mui"){const[n,r]=b.useState(e),o=e||n;return b.useEffect(()=>{n==null&&(AE+=1,r(`${t}-${AE}`))},[n,t]),o}const TE=lv.useId;function N0(e,t){if(TE!==void 0){const n=TE();return e??(t?`${t}-${n}`:n)}return u7(e,t)}function tD(e){return N0(e,"base-ui")}const c7=[];function nD(e){b.useEffect(e,c7)}const Xu=null;let OE=globalThis.requestAnimationFrame;class d7{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1;const r=process.env.NODE_ENV!=="production"&&OE!==requestAnimationFrame&&(OE=requestAnimationFrame,!0);return(!this.isScheduled||r)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Zu=new d7;class Yr{static create(){return new Yr}static request(t){return Zu.request(t)}static cancel(t){return Zu.cancel(t)}currentId=Xu;request(t){this.cancel(),this.currentId=Zu.request(()=>{this.currentId=Xu,t()})}cancel=()=>{this.currentId!==Xu&&(Zu.cancel(this.currentId),this.currentId=Xu)};disposeEffect=()=>this.cancel}function P0(){const e=cr(Yr.create).current;return nD(e.disposeEffect),e}function Io(e){return e==null?e:"current"in e?e.current:e}let Dl=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const f7={[Dl.startingStyle]:""},p7={[Dl.endingStyle]:""},_0={transitionStatus(e){return e==="starting"?f7:e==="ending"?p7:null}};function h7(e,t=!1,n=!0){const r=P0();return ke((o,i=null)=>{r.cancel();function s(){so.flushSync(o)}const a=Io(e);if(a==null)return;const l=a;if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)o();else{let u=function(){const d=Dl.startingStyle;if(!l.hasAttribute(d)){r.request(c);return}const f=new MutationObserver(()=>{l.hasAttribute(d)||(f.disconnect(),c())});f.observe(l,{attributes:!0,attributeFilter:[d]}),i?.addEventListener("abort",()=>f.disconnect(),{once:!0})},c=function(){Promise.all(l.getAnimations().map(d=>d.finished)).then(()=>{i?.aborted||s()}).catch(()=>{const d=l.getAnimations();if(n){if(i?.aborted)return;s()}else d.length>0&&d.some(f=>f.pending||f.playState!=="finished")&&c()})};if(t){u();return}r.request(c)}})}function M0(e,t=!1,n=!1){const[r,o]=b.useState(e&&t?"idle":void 0),[i,s]=b.useState(e);return e&&!i&&(s(!0),o("starting")),!e&&i&&r!=="ending"&&!n&&o("ending"),!e&&!i&&r==="ending"&&o(void 0),Ge(()=>{if(!e&&i&&r!=="ending"&&n){const a=Yr.request(()=>{o("ending")});return()=>{Yr.cancel(a)}}},[e,i,r,n]),Ge(()=>{if(!e||t)return;const a=Yr.request(()=>{o(void 0)});return()=>{Yr.cancel(a)}},[t,e]),Ge(()=>{if(!e||!t)return;e&&i&&r!=="idle"&&o("starting");const a=Yr.request(()=>{o("idle")});return()=>{Yr.cancel(a)}},[t,e,i,o,r]),b.useMemo(()=>({mounted:i,setMounted:s,transitionStatus:r}),[i,r])}let rD=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function oD(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:o,index:i}=e,{register:s,unregister:a,subscribeMapChange:l,elementsRef:u,labelsRef:c,nextIndexRef:d}=k8(),f=b.useRef(-1),[p,g]=b.useState(i??(o===rD.GuessFromOrder?()=>{if(f.current===-1){const y=d.current;d.current+=1,f.current=y}return f.current}:-1)),m=b.useRef(null),v=b.useCallback(y=>{if(m.current=y,p!==-1&&y!==null&&(u.current[p]=y,c)){const x=t!==void 0;c.current[p]=x?t:r?.current?.textContent??y.textContent}},[p,u,c,t,r]);return Ge(()=>{if(i!=null)return;const y=m.current;if(y)return s(y,n),()=>{a(y)}},[i,s,a,n]),Ge(()=>{if(i==null)return l(y=>{const x=m.current?y.get(m.current)?.index:null;x!=null&&g(x)})},[i,l,g]),b.useMemo(()=>({ref:v,index:p}),[p,v])}let uv;process.env.NODE_ENV!=="production"&&(uv=new Set);function NE(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");uv.has(t)||(uv.add(t),console.error(`Base UI: ${t}`))}}const iD=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(iD.displayName="CompositeRootContext");function g7(e=!1){const t=b.useContext(iD);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":Fr(16));return t}function m7(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:o=0,isNativeButton:i}=e,s=r&&t!==!1,a=r&&t===!1;return{props:b.useMemo(()=>{const u={onKeyDown(c){n&&t&&c.key!=="Tab"&&c.preventDefault()}};return r||(u.tabIndex=o,!i&&n&&(u.tabIndex=t?o:-1)),(i&&(t||s)||!i&&n)&&(u["aria-disabled"]=n),i&&(!t||a)&&(u.disabled=n),u},[r,n,t,s,a,i,o])}}function Af(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0}=e,i=b.useRef(null),s=g7(!0)!==void 0,a=ke(()=>{const f=i.current;return!!(f?.tagName==="A"&&f?.href)}),{props:l}=m7({focusableWhenDisabled:n,disabled:t,composite:s,tabIndex:r,isNativeButton:o});process.env.NODE_ENV!=="production"&&b.useEffect(()=>{if(!i.current)return;const f=i.current.tagName==="BUTTON";if(o){if(!f){const p=lv.captureOwnerStack?.()||"";NE(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${p}`)}}else if(f){const p=lv.captureOwnerStack?.()||"";NE(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${p}`)}},[o]);const u=b.useCallback(()=>{const f=i.current;b7(f)&&s&&t&&l.disabled===void 0&&f.disabled&&(f.disabled=!1)},[t,l.disabled,s]);Ge(u,[u]);const c=b.useCallback((f={})=>{const{onClick:p,onMouseDown:g,onKeyUp:m,onKeyDown:v,onPointerDown:y,...x}=f;return JM({type:o?"button":void 0,onClick(C){if(t){C.preventDefault();return}p?.(C)},onMouseDown(C){t||g?.(C)},onKeyDown(C){if(t||(sv(C),v?.(C)),C.baseUIHandlerPrevented)return;const S=C.target===C.currentTarget&&!o&&!a()&&!t,R=C.key==="Enter",I=C.key===" ";S&&((I||R)&&C.preventDefault(),R&&p?.(C))},onKeyUp(C){t||(sv(C),m?.(C)),!C.baseUIHandlerPrevented&&C.target===C.currentTarget&&!o&&!t&&C.key===" "&&p?.(C)},onPointerDown(C){if(t){C.preventDefault();return}y?.(C)}},o?void 0:{role:"button"},l,x)},[t,l,o,a]),d=ke(f=>{i.current=f,u()});return{getButtonProps:c,buttonRef:d}}function b7(e){return Wt(e)&&e.tagName==="BUTTON"}const bs=typeof navigator<"u",Tm=x7(),sD=C7(),D0=w7(),aD=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),lD=Tm.platform==="MacIntel"&&Tm.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Tm.platform),PE=bs&&/firefox/i.test(D0),v7=bs&&/apple/i.test(navigator.vendor),ld=bs&&/android/i.test(sD)||/android/i.test(D0);bs&&sD.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const y7=D0.includes("jsdom/");function x7(){if(!bs)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function w7(){if(!bs)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function C7(){if(!bs)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const cv="data-base-ui-focusable",uD="active",cD="selected",S7="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",ai="ArrowLeft",li="ArrowRight",k0="ArrowUp",gu="ArrowDown";function Ao(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function ft(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Eb(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Nn(e){return"composedPath"in e?e.composedPath()[0]:e.target}function wr(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function E7(e){return e.matches("html,body")}function j0(e){return Wt(e)&&e.matches(S7)}function dv(e){return e?e.getAttribute("role")==="combobox"&&j0(e):!1}function fv(e){return e?e.hasAttribute(cv)?e:e.querySelector(`[${cv}]`)||e:null}function Ys(e,t,n=!0){return e.filter(o=>o.parentId===t&&(!n||o.context?.open)).flatMap(o=>[o,...Ys(e,o.id,n)])}function _E(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(i=>i.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function Tt(e){e.preventDefault(),e.stopPropagation()}function I7(e){return"nativeEvent"in e}function dD(e){return e.pointerType===""&&e.isTrusted?!0:ld&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function fD(e){return y7?!1:!ld&&e.width===0&&e.height===0||ld&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function ME(e,t){return["mouse","pen"].includes(e)}function pD(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function Ju(e,t,n){return Math.floor(e/t)!==n}function fl(e,t){return t<0||t>=e.current.length}function Om(e,t){return vn(e,{disabledIndices:t})}function DE(e,t){return vn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function vn(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let i=t;do i+=n?-o:o;while(i>=0&&i<=e.current.length-1&&pl(e,i,r));return i}function R7(e,{event:t,orientation:n,loopFocus:r,rtl:o,cols:i,disabledIndices:s,minIndex:a,maxIndex:l,prevIndex:u,stopEvent:c=!1}){let d=u;const f=[],p={};let g=!1;{let y=null,x=-1;e.current.forEach((w,C)=>{if(w==null)return;const S=w.closest('[role="row"]');S&&(g=!0),(S!==y||x===-1)&&(y=S,x+=1,f[x]=[]),f[x].push(C),p[C]=x})}const m=g&&f.length>0&&f.some(y=>y.length!==i);function v(y){if(!m||u===-1)return;const x=p[u];if(x==null)return;const w=f[x].indexOf(u);let C=y==="up"?x-1:x+1;r&&(C<0?C=f.length-1:C>=f.length&&(C=0));const S=new Set;for(;C>=0&&C<f.length&&!S.has(C);){S.add(C);const R=f[C];if(R.length===0){C=y==="up"?C-1:C+1;continue}const I=Math.min(w,R.length-1);for(let T=I;T>=0;T-=1){const _=R[T];if(!pl(e,_,s))return _}C=y==="up"?C-1:C+1,r&&(C<0?C=f.length-1:C>=f.length&&(C=0))}}if(t.key===k0){const y=v("up");if(y!==void 0)c&&Tt(t),d=y;else{if(c&&Tt(t),u===-1)d=l;else if(d=vn(e,{startingIndex:d,amount:i,decrement:!0,disabledIndices:s}),r&&(u-i<a||d<0)){const x=u%i,w=l%i,C=l-(w-x);w===x?d=l:d=w>x?C:C-i}fl(e,d)&&(d=u)}}if(t.key===gu){const y=v("down");y!==void 0?(c&&Tt(t),d=y):(c&&Tt(t),u===-1?d=a:(d=vn(e,{startingIndex:u,amount:i,disabledIndices:s}),r&&u+i>l&&(d=vn(e,{startingIndex:u%i-i,amount:i,disabledIndices:s}))),fl(e,d)&&(d=u))}if(n==="both"){const y=Gs(u/i);t.key===(o?ai:li)&&(c&&Tt(t),u%i!==i-1?(d=vn(e,{startingIndex:u,disabledIndices:s}),r&&Ju(d,i,y)&&(d=vn(e,{startingIndex:u-u%i-1,disabledIndices:s}))):r&&(d=vn(e,{startingIndex:u-u%i-1,disabledIndices:s})),Ju(d,i,y)&&(d=u)),t.key===(o?li:ai)&&(c&&Tt(t),u%i!==0?(d=vn(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&Ju(d,i,y)&&(d=vn(e,{startingIndex:u+(i-u%i),decrement:!0,disabledIndices:s}))):r&&(d=vn(e,{startingIndex:u+(i-u%i),decrement:!0,disabledIndices:s})),Ju(d,i,y)&&(d=u));const x=Gs(l/i)===y;fl(e,d)&&(r&&x?d=t.key===(o?li:ai)?l:vn(e,{startingIndex:u-u%i-1,disabledIndices:s}):d=u)}return d}function A7(e,t,n){const r=[];let o=0;return e.forEach(({width:i,height:s},a)=>{if(i>t&&process.env.NODE_ENV!=="production")throw new Error(`[Floating UI]: Invalid grid - item width at index ${a} is greater than grid columns`);let l=!1;for(;!l;){const u=[];for(let c=0;c<i;c+=1)for(let d=0;d<s;d+=1)u.push(o+c+d*t);o%t+i<=t&&u.every(c=>r[c]==null)?(u.forEach(c=>{r[c]=a}),l=!0):o+=1}}),[...r]}function T7(e,t,n,r,o){if(e===-1)return-1;const i=n.indexOf(e),s=t[e];switch(o){case"tl":return i;case"tr":return s?i+s.width-1:i;case"bl":return s?i+(s.height-1)*r:i;case"br":return n.lastIndexOf(e);default:return-1}}function O7(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function pl(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const r=e.current[t];return r?r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true":!1}var N7=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ud=N7.join(","),hD=typeof Element>"u",la=hD?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,cd=!hD&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},dd=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=o===""||o==="true",s=i||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):dd(t.parentNode));return s},P7=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},gD=function(t,n,r){if(dd(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(ud));return n&&la.call(t,ud)&&o.unshift(t),o=o.filter(r),o},fd=function(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!dd(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=fd(l,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:s,candidates:u})}else{var c=la.call(s,ud);c&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var d=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),f=!dd(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(d&&f){var p=fd(d===!0?s.children:d.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:s,candidates:p})}else i.unshift.apply(i,s.children)}}return o},mD=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},bD=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||P7(t))&&!mD(t)?0:t.tabIndex},_7=function(t,n){var r=bD(t);return r<0&&n&&!mD(t)?0:r},M7=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},vD=function(t){return t.tagName==="INPUT"},D7=function(t){return vD(t)&&t.type==="hidden"},k7=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},j7=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},L7=function(t){if(!t.name)return!0;var n=t.form||cd(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var i=j7(o,t.form);return!i||i===t},F7=function(t){return vD(t)&&t.type==="radio"},B7=function(t){return F7(t)&&!L7(t)},V7=function(t){var n,r=t&&cd(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,a,l;for(i=!!((s=o)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!i&&o;){var u,c,d;r=cd(o),o=(u=r)===null||u===void 0?void 0:u.host,i=!!((c=o)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return i},kE=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},$7=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var i=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(t).visibility==="hidden")return!0;var s=la.call(t,"details>summary:first-of-type"),a=s?t.parentElement:t;if(la.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var u=t.parentElement,c=cd(t);if(u&&!u.shadowRoot&&o(u)===!0)return kE(t);t.assignedSlot?t=t.assignedSlot:!u&&c!==t.ownerDocument?t=c.host:t=u}t=l}if(V7(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return kE(t);return!1},G7=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return la.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},pv=function(t,n){return!(n.disabled||D7(n)||$7(n,t)||k7(n)||G7(n))},hv=function(t,n){return!(B7(n)||bD(n)<0||!pv(t,n))},H7=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},yD=function(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,a=s?o.scopeParent:o,l=_7(a,s),u=s?yD(o.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:i,tabIndex:l,item:o,isScope:s,content:u})}),r.sort(M7).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Tf=function(t,n){n=n||{};var r;return n.getShadowRoot?r=fd([t],n.includeContainer,{filter:hv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:H7}):r=gD(t,n.includeContainer,hv.bind(null,n)),yD(r)},W7=function(t,n){n=n||{};var r;return n.getShadowRoot?r=fd([t],n.includeContainer,{filter:pv.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=gD(t,n.includeContainer,pv.bind(null,n)),r},xD=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return la.call(t,ud)===!1?!1:hv(n,t)};function Ht(e){return e?.ownerDocument||document}const mu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function wD(e,t){const n=Tf(e,mu()),r=n.length;if(r===0)return;const o=Ao(Ht(e)),i=n.indexOf(o),s=i===-1?t===1?0:r-1:i+t;return n[s]}function CD(e){return wD(Ht(e).body,1)||e}function SD(e){return wD(Ht(e).body,-1)||e}function hl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ft(n,r)}function z7(e){Tf(e,mu()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function jE(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Of(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,i=ke(o),s=h7(r,n,!1);b.useEffect(()=>{if(!t)return;const a=new AbortController;return s(i,a.signal),()=>{a.abort()}},[t,n,i,s])}const Va=0;class ua{static create(){return new ua}currentId=Va;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Va,n()},t)}isStarted(){return this.currentId!==Va}clear=()=>{this.currentId!==Va&&(clearTimeout(this.currentId),this.currentId=Va)};disposeEffect=()=>this.clear}function ts(){const e=cr(ua.create).current;return nD(e.disposeEffect),e}let LE={},FE={},BE="";function q7(e){if(typeof document>"u")return!1;const t=Ht(e);return cn(t).innerWidth-t.documentElement.clientWidth>0}function U7(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Ht(e),r=n.documentElement,o=n.body,i=vi(r)?r:o,s=i.style.overflowY,a=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",i.style.overflowY="scroll";const l=i.offsetWidth;i.style.overflowY="hidden";const u=i.offsetWidth;return i.style.overflowY=s,r.style.scrollbarGutter=a,l===u}function Y7(e){const t=Ht(e),n=t.documentElement,r=t.body,o=vi(n)?n:r,i={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,i)}}function X7(e){const t=Ht(e),n=t.documentElement,r=t.body,o=cn(n);let i=0,s=0,a=!1;const l=Yr.create();if(aD&&(o.visualViewport?.scale??1)!==1)return()=>{};function u(){const f=o.getComputedStyle(n),p=o.getComputedStyle(r),v=(f.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";i=n.scrollTop,s=n.scrollLeft,LE={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},BE=n.style.scrollBehavior,FE={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const y=n.scrollHeight>n.clientHeight,x=n.scrollWidth>n.clientWidth,w=f.overflowY==="scroll"||p.overflowY==="scroll",C=f.overflowX==="scroll"||p.overflowX==="scroll",S=Math.max(0,o.innerWidth-r.clientWidth),R=Math.max(0,o.innerHeight-r.clientHeight),I=parseFloat(p.marginTop)+parseFloat(p.marginBottom),T=parseFloat(p.marginLeft)+parseFloat(p.marginRight),_=vi(n)?n:r;if(a=U7(e),a){n.style.scrollbarGutter=v,_.style.overflowY="hidden",_.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:v,overflowY:"hidden",overflowX:"hidden"}),(y||w)&&(n.style.overflowY="scroll"),(x||C)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:I||R?`calc(100dvh - ${I+R}px)`:"100dvh",width:T||S?`calc(100vw - ${T+S}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=i,r.scrollLeft=s,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function c(){Object.assign(n.style,LE),Object.assign(r.style,FE),a||(n.scrollTop=i,n.scrollLeft=s,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=BE)}function d(){c(),l.request(u)}return u(),o.addEventListener("resize",d),()=>{l.cancel(),c(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",d)}}class Z7{lockCount=0;restore=null;timeoutLock=ua.create();timeoutUnlock=ua.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Ht(t).documentElement,o=cn(r).getComputedStyle(r).overflowY;if(o==="hidden"||o==="clip"){this.restore=Lt;return}const i=lD||!q7(t);this.restore=i?Y7(t):X7(t)}}const J7=new Z7;function K7(e=!0,t=null){Ge(()=>{if(e)return J7.acquire(t)},[e,t])}function rr(e){const t=cr(Q7,e).current;return t.next=e,Ge(t.effect),t}function Q7(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function eZ(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}const ED=b.createContext(null);process.env.NODE_ENV!=="production"&&(ED.displayName="FloatingNodeContext");const ID=b.createContext(null);process.env.NODE_ENV!=="production"&&(ID.displayName="FloatingTreeContext");const RD=()=>b.useContext(ED)?.id||null,Nf=e=>{const t=b.useContext(ID);return e??t};function pd(e){return`data-base-ui-${e}`}const AD={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},L0={...AD,position:"fixed",top:0,left:0},tZ={...AD,position:"absolute"},kl=b.forwardRef(function(t,n){const[r,o]=b.useState();Ge(()=>{v7&&o("button")},[]);const i={tabIndex:0,role:r};return h.jsx("span",{...t,ref:n,style:L0,"aria-hidden":r?void 0:!0,...i,"data-base-ui-focus-guard":""})});process.env.NODE_ENV!=="production"&&(kl.displayName="FocusGuard");let VE=0;function gl(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(VE);const i=()=>e?.focus({preventScroll:n});o?i():VE=requestAnimationFrame(i)}const Xs={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function $E(e){return e==="inert"?Xs.inert:e==="aria-hidden"?Xs["aria-hidden"]:Xs.none}let Ku=new WeakSet,Qu={},Nm=0;const TD=e=>e&&(e.host||TD(e.parentNode)),nZ=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=TD(n);return e.contains(r)?r:null}).filter(n=>n!=null);function rZ(e,t,n,r){const o="data-base-ui-inert",i=r?"inert":n?"aria-hidden":null,s=nZ(t,e),a=new Set,l=new Set(s),u=[];Qu[o]||(Qu[o]=new WeakMap);const c=Qu[o];s.forEach(d),f(t),a.clear();function d(p){!p||a.has(p)||(a.add(p),p.parentNode&&d(p.parentNode))}function f(p){!p||l.has(p)||[].forEach.call(p.children,g=>{if(bi(g)!=="script")if(a.has(g))f(g);else{const m=i?g.getAttribute(i):null,v=m!==null&&m!=="false",y=$E(i),x=(y.get(g)||0)+1,w=(c.get(g)||0)+1;y.set(g,x),c.set(g,w),u.push(g),x===1&&v&&Ku.add(g),w===1&&g.setAttribute(o,""),!v&&i&&g.setAttribute(i,i==="inert"?"":"true")}})}return Nm+=1,()=>{u.forEach(p=>{const g=$E(i),v=(g.get(p)||0)-1,y=(c.get(p)||0)-1;g.set(p,v),c.set(p,y),v||(!Ku.has(p)&&i&&p.removeAttribute(i),Ku.delete(p)),y||p.removeAttribute(o)}),Nm-=1,Nm||(Xs.inert=new WeakMap,Xs["aria-hidden"]=new WeakMap,Xs.none=new WeakMap,Ku=new WeakSet,Qu={})}}function oZ(e,t=!1,n=!1){const r=Ht(e[0]).body;return rZ(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const F0=b.createContext(null);process.env.NODE_ENV!=="production"&&(F0.displayName="PortalContext");const OD=()=>b.useContext(F0),iZ=pd("portal");function sZ(e={}){const{ref:t,container:n,componentProps:r=En,elementProps:o}=e,i=N0(),a=OD()?.portalNode,[l,u]=b.useState(null),[c,d]=b.useState(null),f=ke(v=>{v!==null&&d(v)}),p=b.useRef(null);Ge(()=>{if(n===null){p.current&&(p.current=null,d(null),u(null));return}if(i==null)return;const v=(n&&(xy(n)?n:n.current))??a??document.body;if(v==null){p.current&&(p.current=null,d(null),u(null));return}p.current!==v&&(p.current=v,d(null),u(v))},[n,a,i]);const g=Mn("div",r,{ref:[t,f],props:[{id:i,[iZ]:""},o]});return{portalNode:c,portalSubtree:l&&g?so.createPortal(g,l):null}}const ND=b.forwardRef(function(t,n){const{children:r,container:o,className:i,render:s,renderGuards:a,...l}=t,{portalNode:u,portalSubtree:c}=sZ({container:o,ref:n,componentProps:t,elementProps:l}),d=b.useRef(null),f=b.useRef(null),p=b.useRef(null),g=b.useRef(null),[m,v]=b.useState(null),y=m?.modal,x=m?.open,w=typeof a=="boolean"?a:!!m&&!m.modal&&m.open&&!!u;b.useEffect(()=>{if(!u||y)return;function S(R){u&&R.relatedTarget&&hl(R)&&(R.type==="focusin"?jE:z7)(u)}return u.addEventListener("focusin",S,!0),u.addEventListener("focusout",S,!0),()=>{u.removeEventListener("focusin",S,!0),u.removeEventListener("focusout",S,!0)}},[u,y]),b.useEffect(()=>{!u||x||jE(u)},[x,u]);const C=b.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:g,portalNode:u,setFocusManagerState:v}),[u]);return h.jsxs(b.Fragment,{children:[c,h.jsxs(F0.Provider,{value:C,children:[w&&u&&h.jsx(kl,{"data-type":"outside",ref:d,onFocus:S=>{if(hl(S,u))p.current?.focus();else{const R=m?m.domReference:null;SD(R)?.focus()}}}),w&&u&&h.jsx("span",{"aria-owns":u.id,style:e7}),u&&so.createPortal(r,u),w&&u&&h.jsx(kl,{"data-type":"outside",ref:f,onFocus:S=>{if(hl(S,u))g.current?.focus();else{const R=m?m.domReference:null;CD(R)?.focus(),m?.closeOnFocusOut&&m?.onOpenChange(!1,Qe(Rf,S.nativeEvent))}}})]})]})});process.env.NODE_ENV!=="production"&&(ND.displayName="FloatingPortal");function aZ(e,t){const n=cn(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const GE=20;let ni=[];function B0(){ni=ni.filter(e=>e.deref()?.isConnected)}function lZ(e){B0(),e&&bi(e)!=="body"&&(ni.push(new WeakRef(e)),ni.length>GE&&(ni=ni.slice(-GE)))}function Pm(){return B0(),ni[ni.length-1]?.deref()}function uZ(e){if(!e)return null;const t=mu();return xD(e,t)?e:Tf(e,t)[0]||e}function cZ(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Bn(e).display!=="none"}function HE(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=mu(),o=W7(e,n).filter(s=>{const a=s.getAttribute("data-tabindex")||"";return xD(s,n)||s.hasAttribute("data-tabindex")&&!a.startsWith("-")}),i=e.getAttribute("tabindex");t.current.includes("floating")||o.length===0?i!=="0"&&e.setAttribute("tabindex","0"):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function dZ(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:i=!0,restoreFocus:s=!1,modal:a=!0,closeOnFocusOut:l=!0,openInteractionType:u="",nextFocusableElement:c,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p}=e,g="rootStore"in t?t.rootStore:t,m=g.useState("open"),v=g.useState("domReferenceElement"),y=g.useState("floatingElement"),{events:x,dataRef:w}=g.context,C=ke(()=>w.current.floatingContext?.nodeId),S=o===!1,R=dv(v)&&S,I=b.useRef(["content"]),T=rr(o),_=rr(i),$=rr(u),A=Nf(p),M=OD(),O=b.useRef(null),B=b.useRef(null),j=b.useRef(!1),D=b.useRef(!1),V=b.useRef(!1),G=b.useRef(-1),z=b.useRef(""),H=b.useRef(""),ne=b.useRef(null),W=b.useRef(null),J=Ml(ne,f,M?.beforeInsideRef),K=Ml(W,M?.afterInsideRef),U=ts(),oe=ts(),X=P0(),te=M!=null,Q=fv(y),se=ke((Z=Q)=>Z?Tf(Z,mu()):[]),ae=ke(Z=>{const k=se(Z);return I.current.map(()=>k).filter(Boolean).flat()});b.useEffect(()=>{if(r||!a)return;function Z(ie){ie.key==="Tab"&&ft(Q,Ao(Ht(Q)))&&se().length===0&&!R&&Tt(ie)}const k=Ht(Q);return k.addEventListener("keydown",Z),()=>{k.removeEventListener("keydown",Z)}},[r,v,Q,a,I,R,se,ae]),b.useEffect(()=>{if(r||!m)return;const Z=Ht(Q);function k(){V.current=!1}function ie(le){const pe=Nn(le),re=ft(y,pe)||ft(v,pe)||ft(M?.portalNode,pe);V.current=!re,H.current=le.pointerType||"keyboard",pe?.closest(`[${K8}]`)&&(D.current=!0)}function Y(){H.current="keyboard"}return Z.addEventListener("pointerdown",ie,!0),Z.addEventListener("pointerup",k,!0),Z.addEventListener("pointercancel",k,!0),Z.addEventListener("keydown",Y,!0),()=>{Z.removeEventListener("pointerdown",ie,!0),Z.removeEventListener("pointerup",k,!0),Z.removeEventListener("pointercancel",k,!0),Z.removeEventListener("keydown",Y,!0)}},[r,y,v,Q,m,M]),b.useEffect(()=>{if(r||!l)return;const Z=Ht(Q);function k(){D.current=!0,oe.start(0,()=>{D.current=!1})}function ie(fe){const de=Nn(fe),we=se().indexOf(de);we!==-1&&(G.current=we)}function Y(fe){const de=fe.relatedTarget,ve=fe.currentTarget,we=Nn(fe);queueMicrotask(()=>{const Se=C(),Ye=g.context.triggerElements,at=de?.hasAttribute(pd("focus-guard"))&&[ne.current,W.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,Io(d),Io(c)].includes(de),Xe=!(ft(v,de)||ft(y,de)||ft(de,y)||ft(M?.portalNode,de)||de!=null&&Ye.hasElement(de)||Ye.hasMatchingElement(Ue=>ft(Ue,de))||at||A&&(Ys(A.nodesRef.current,Se).find(Ue=>ft(Ue.context?.elements.floating,de)||ft(Ue.context?.elements.domReference,de))||_E(A.nodesRef.current,Se).find(Ue=>[Ue.context?.elements.floating,fv(Ue.context?.elements.floating)].includes(de)||Ue.context?.elements.domReference===de)));if(ve===v&&Q&&HE(Q,I),s&&ve!==v&&!cZ(we)&&Ao(Z)===Z.body){if(Wt(Q)&&(Q.focus(),s==="popup")){X.request(()=>{Q.focus()});return}const Ue=G.current,rt=se(),et=rt[Ue]||rt[rt.length-1]||Q;Wt(et)&&et.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(R||!a)&&de&&Xe&&!D.current&&(R||de!==Pm())&&(j.current=!0,g.setOpen(!1,Qe(Rf,fe)))})}function le(){V.current||(w.current.insideReactTree=!0,U.start(0,()=>{w.current.insideReactTree=!1}))}const pe=Wt(v)?v:null,re=[];if(!(!y&&!pe))return pe&&(pe.addEventListener("focusout",Y),pe.addEventListener("pointerdown",k),re.push(()=>{pe.removeEventListener("focusout",Y),pe.removeEventListener("pointerdown",k)})),y&&(y.addEventListener("focusin",ie),y.addEventListener("focusout",Y),M&&(y.addEventListener("focusout",le,!0),re.push(()=>{y.removeEventListener("focusout",le,!0)})),re.push(()=>{y.removeEventListener("focusin",ie),y.removeEventListener("focusout",Y)})),()=>{re.forEach(fe=>{fe()})}},[r,v,y,Q,a,A,M,g,l,s,se,R,C,I,w,U,oe,X,c,d]),b.useEffect(()=>{if(r||!y||!m)return;const Z=Array.from(M?.portalNode?.querySelectorAll(`[${pd("portal")}]`)||[]),ie=(A?_E(A.nodesRef.current,C()):[]).find(le=>dv(le.context?.elements.domReference||null))?.context?.elements.domReference,Y=[y,ie,...Z,O.current,B.current,ne.current,W.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,Io(d),Io(c),R?v:null].filter(le=>le!=null);return oZ(Y,a||R)},[m,r,v,y,a,I,M,R,A,C,c,d]),Ge(()=>{if(!m||r||!Wt(Q))return;const Z=Ht(Q),k=Ao(Z);queueMicrotask(()=>{const ie=ae(Q),Y=T.current,le=typeof Y=="function"?Y($.current||""):Y;if(le===void 0||le===!1)return;let pe;le===!0||le===null?pe=ie[0]||Q:pe=Io(le),pe=pe||ie[0]||Q,!ft(Q,k)&&gl(pe,{preventScroll:pe===Q})})},[r,m,Q,S,ae,T,$]),Ge(()=>{if(r||!Q)return;const Z=Ht(Q),k=Ao(Z);lZ(k);function ie(pe){if(pe.open||(z.current=aZ(pe.nativeEvent,H.current)),pe.reason===i7&&pe.nativeEvent.type==="mouseleave"&&(j.current=!0),pe.reason===O0)if(pe.nested)j.current=!1;else if(dD(pe.nativeEvent)||fD(pe.nativeEvent))j.current=!1;else{let re=!1;document.createElement("div").focus({get preventScroll(){return re=!0,!1}}),re?j.current=!1:j.current=!0}}x.on("openchange",ie);const Y=Z.createElement("span");Y.setAttribute("tabindex","-1"),Y.setAttribute("aria-hidden","true"),Object.assign(Y.style,L0),te&&v&&v.insertAdjacentElement("afterend",Y);function le(){const pe=_.current;let re=typeof pe=="function"?pe(z.current):pe;if(re===void 0||re===!1)return null;if(re===null&&(re=!0),typeof re=="boolean"){const de=v||Pm();return de&&de.isConnected?de:Y}const fe=v||Pm()||Y;return Io(re)||fe}return()=>{x.off("openchange",ie);const pe=Ao(Z),re=ft(y,pe)||A&&Ys(A.nodesRef.current,C(),!1).some(de=>ft(de.context?.elements.floating,pe)),fe=le();queueMicrotask(()=>{const de=uZ(fe),ve=typeof _.current!="boolean";_.current&&!j.current&&Wt(de)&&(!(!ve&&de!==pe&&pe!==Z.body)||re)&&de.focus({preventScroll:!0}),Y.remove(),j.current=!1})}},[r,y,Q,_,w,x,A,te,v,C]),Ge(()=>{if(!aD||m||!y)return;const Z=Ao(Ht(y));!Wt(Z)||!j0(Z)||ft(y,Z)&&Z.blur()},[m,y]),Ge(()=>{if(!(r||!M))return M.setFocusManagerState({modal:a,closeOnFocusOut:l,open:m,onOpenChange:g.setOpen,domReference:v}),()=>{M.setFocusManagerState(null)}},[r,M,a,m,g,l,v]),Ge(()=>{if(!(r||!Q))return HE(Q,I),()=>{queueMicrotask(B0)}},[r,Q,I]);const L=!r&&(a?!R:!0)&&(te||a);return h.jsxs(b.Fragment,{children:[L&&h.jsx(kl,{"data-type":"inside",ref:J,onFocus:Z=>{if(a){const k=ae();gl(k[k.length-1])}else M?.portalNode&&(j.current=!1,hl(Z,M.portalNode)?CD(v)?.focus():Io(d??M.beforeOutsideRef)?.focus())}}),n,L&&h.jsx(kl,{"data-type":"inside",ref:K,onFocus:Z=>{a?gl(ae()[0]):M?.portalNode&&(l&&(j.current=!0),hl(Z,M.portalNode)?SD(v)?.focus():Io(c??M.afterOutsideRef)?.focus())}})]})}function PD(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:o=!0,event:i="click",toggle:s=!0,ignoreMouse:a=!1,stickIfOpen:l=!0,touchOpenDelay:u=0,reason:c=av}=t,d=b.useRef(void 0),f=P0(),p=ts(),g=b.useMemo(()=>({onPointerDown(m){d.current=m.pointerType},onMouseDown(m){const v=d.current,y=m.nativeEvent,x=n.select("open");if(m.button!==0||i==="click"||ME(v)&&a)return;const w=r.current.openEvent,C=w?.type,S=n.select("domReferenceElement")!==m.currentTarget,R=x&&S||!(x&&s&&(!(w&&l)||C==="click"||C==="mousedown"));if(j0(y.target)){const T=Qe(c,y,y.target);R&&v==="touch"&&u>0?p.start(u,()=>{n.setOpen(!0,T)}):n.setOpen(R,T);return}const I=m.currentTarget;f.request(()=>{const T=Qe(c,y,I);R&&v==="touch"&&u>0?p.start(u,()=>{n.setOpen(!0,T)}):n.setOpen(R,T)})},onClick(m){if(i==="mousedown-only")return;const v=d.current;if(i==="mousedown"&&v){d.current=void 0;return}if(ME(v)&&a)return;const y=n.select("open"),x=r.current.openEvent,w=n.select("domReferenceElement")!==m.currentTarget,C=y&&w||!(y&&s&&(!(x&&l)||pD(x))),S=Qe(c,m.nativeEvent,m.currentTarget);C&&v==="touch"&&u>0?p.start(u,()=>{n.setOpen(!0,S)}):n.setOpen(C,S)},onKeyDown(){d.current=void 0}}),[r,i,a,n,l,s,f,p,u,c]);return b.useMemo(()=>o?{reference:g}:En,[o,g])}const fZ={intentional:"onClick",sloppy:"onPointerDown"};function pZ(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function hZ(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),i=n.useState("referenceElement"),s=n.useState("domReferenceElement"),{onOpenChange:a,dataRef:l}=n.context,{enabled:u=!0,escapeKey:c=!0,outsidePress:d=!0,outsidePressEvent:f="sloppy",referencePress:p=!1,referencePressEvent:g="sloppy",ancestorScroll:m=!1,bubbles:v,externalTree:y}=t,x=Nf(y),w=ke(typeof d=="function"?d:()=>!1),C=typeof d=="function"?w:d,S=b.useRef(!1),{escapeKey:R,outsidePress:I}=pZ(v),T=b.useRef(null),_=ts(),$=ts(),A=ke(()=>{$.clear(),l.current.insideReactTree=!1}),M=b.useRef(!1),O=b.useRef(""),B=ke(L=>{O.current=L.pointerType}),j=ke(()=>{const L=O.current,Z=L==="pen"||!L?"mouse":L,k=typeof f=="function"?f():f;return typeof k=="string"?k:k[Z]}),D=ke(L=>{if(!r||!u||!c||L.key!=="Escape"||M.current)return;const Z=l.current.floatingContext?.nodeId,k=x?Ys(x.nodesRef.current,Z):[];if(!R&&k.length>0){let le=!0;if(k.forEach(pe=>{pe.context?.open&&!pe.context.dataRef.current.__escapeKeyBubbles&&(le=!1)}),!le)return}const ie=I7(L)?L.nativeEvent:L,Y=Qe(eD,ie);n.setOpen(!1,Y),!R&&!Y.isPropagationAllowed&&L.stopPropagation()}),V=ke(L=>{const Z=j();return Z==="intentional"&&L.type!=="click"||Z==="sloppy"&&L.type==="click"}),G=ke(()=>{l.current.insideReactTree=!0,$.start(0,A)}),z=ke((L,Z=!1)=>{if(V(L)){A();return}if(l.current.insideReactTree){A();return}if(j()==="intentional"&&Z||typeof C=="function"&&!C(L))return;const k=Nn(L),ie=`[${pd("inert")}]`,Y=Ht(n.select("floatingElement")).querySelectorAll(ie),le=n.context.triggerElements;if(k&&(le.hasElement(k)||le.hasMatchingElement(ve=>ft(ve,k))))return;let pe=Ot(k)?k:null;for(;pe&&!No(pe);){const ve=Mo(pe);if(No(ve)||!Ot(ve))break;pe=ve}if(Y.length&&Ot(k)&&!E7(k)&&!ft(k,n.select("floatingElement"))&&Array.from(Y).every(ve=>!ft(pe,ve)))return;if(Wt(k)&&!("touches"in L)){const ve=No(k),we=Bn(k),Se=/auto|scroll/,Ye=ve||Se.test(we.overflowX),at=ve||Se.test(we.overflowY),Xe=Ye&&k.clientWidth>0&&k.scrollWidth>k.clientWidth,Ue=at&&k.clientHeight>0&&k.scrollHeight>k.clientHeight,rt=we.direction==="rtl",et=Ue&&(rt?L.offsetX<=k.offsetWidth-k.clientWidth:L.offsetX>k.clientWidth),gt=Xe&&L.offsetY>k.clientHeight;if(et||gt)return}const re=l.current.floatingContext?.nodeId,fe=x&&Ys(x.nodesRef.current,re).some(ve=>wr(L,ve.context?.elements.floating));if(wr(L,n.select("floatingElement"))||wr(L,n.select("domReferenceElement"))||fe)return;const de=x?Ys(x.nodesRef.current,re):[];if(de.length>0){let ve=!0;if(de.forEach(we=>{we.context?.open&&!we.context.dataRef.current.__outsidePressBubbles&&(ve=!1)}),!ve)return}n.setOpen(!1,Qe(O0,L)),A()}),H=ke(L=>{j()!=="sloppy"||L.pointerType==="touch"||!n.select("open")||!u||wr(L,n.select("floatingElement"))||wr(L,n.select("domReferenceElement"))||z(L)}),ne=ke(L=>{if(j()!=="sloppy"||!n.select("open")||!u||wr(L,n.select("floatingElement"))||wr(L,n.select("domReferenceElement")))return;const Z=L.touches[0];Z&&(T.current={startTime:Date.now(),startX:Z.clientX,startY:Z.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},_.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}),W=ke(L=>{const Z=Nn(L);function k(){ne(L),Z?.removeEventListener(L.type,k)}Z?.addEventListener(L.type,k)}),J=ke(L=>{const Z=S.current;if(S.current=!1,_.clear(),L.type==="mousedown"&&T.current&&!T.current.dismissOnMouseDown)return;const k=Nn(L);function ie(){L.type==="pointerdown"?H(L):z(L,Z),k?.removeEventListener(L.type,ie)}k?.addEventListener(L.type,ie)}),K=ke(L=>{if(j()!=="sloppy"||!T.current||wr(L,n.select("floatingElement"))||wr(L,n.select("domReferenceElement")))return;const Z=L.touches[0];if(!Z)return;const k=Math.abs(Z.clientX-T.current.startX),ie=Math.abs(Z.clientY-T.current.startY),Y=Math.sqrt(k*k+ie*ie);Y>5&&(T.current.dismissOnTouchEnd=!0),Y>10&&(z(L),_.clear(),T.current=null)}),U=ke(L=>{const Z=Nn(L);function k(){K(L),Z?.removeEventListener(L.type,k)}Z?.addEventListener(L.type,k)}),oe=ke(L=>{j()!=="sloppy"||!T.current||wr(L,n.select("floatingElement"))||wr(L,n.select("domReferenceElement"))||(T.current.dismissOnTouchEnd&&z(L),_.clear(),T.current=null)}),X=ke(L=>{const Z=Nn(L);function k(){oe(L),Z?.removeEventListener(L.type,k)}Z?.addEventListener(L.type,k)});b.useEffect(()=>{if(!r||!u)return;l.current.__escapeKeyBubbles=R,l.current.__outsidePressBubbles=I;const L=new ua;function Z(pe){n.setOpen(!1,Qe(er,pe))}function k(){L.clear(),M.current=!0}function ie(){L.start(Wd()?5:0,()=>{M.current=!1})}const Y=Ht(o);Y.addEventListener("pointerdown",B,!0),c&&(Y.addEventListener("keydown",D),Y.addEventListener("compositionstart",k),Y.addEventListener("compositionend",ie)),C&&(Y.addEventListener("click",J,!0),Y.addEventListener("pointerdown",J,!0),Y.addEventListener("touchstart",W,!0),Y.addEventListener("touchmove",U,!0),Y.addEventListener("touchend",X,!0),Y.addEventListener("mousedown",J,!0));let le=[];return m&&(Ot(s)&&(le=si(s)),Ot(o)&&(le=le.concat(si(o))),!Ot(i)&&i&&i.contextElement&&(le=le.concat(si(i.contextElement)))),le=le.filter(pe=>pe!==Y.defaultView?.visualViewport),le.forEach(pe=>{pe.addEventListener("scroll",Z,{passive:!0})}),()=>{Y.removeEventListener("pointerdown",B,!0),c&&(Y.removeEventListener("keydown",D),Y.removeEventListener("compositionstart",k),Y.removeEventListener("compositionend",ie)),C&&(Y.removeEventListener("click",J,!0),Y.removeEventListener("pointerdown",J,!0),Y.removeEventListener("touchstart",W,!0),Y.removeEventListener("touchmove",U,!0),Y.removeEventListener("touchend",X,!0),Y.removeEventListener("mousedown",J,!0)),le.forEach(pe=>{pe.removeEventListener("scroll",Z)}),L.clear(),S.current=!1}},[l,o,i,s,c,C,r,a,m,u,R,I,D,z,J,H,W,U,X,B,n]),b.useEffect(A,[C,A]);const te=b.useMemo(()=>({onKeyDown:D,...p&&{[fZ[g]]:L=>{n.setOpen(!1,Qe(av,L.nativeEvent))},...g!=="intentional"&&{onClick(L){n.setOpen(!1,Qe(av,L.nativeEvent))}}}}),[D,n,p,g]),Q=ke(L=>{const Z=Nn(L.nativeEvent);!ft(n.select("floatingElement"),Z)||L.button!==0||(S.current=!0)}),se=ke(L=>{!r||!u||L.button!==0||(S.current=!0)}),ae=b.useMemo(()=>({onKeyDown:D,onPointerDown:Q,onMouseDown:Q,onMouseUp:Q,onClickCapture:G,onMouseDownCapture(L){G(),se(L)},onPointerDownCapture(L){G(),se(L)},onMouseUpCapture:G,onTouchEndCapture:G,onTouchMoveCapture:G}),[D,Q,G,se]);return b.useMemo(()=>u?{reference:te,floating:ae,trigger:te}:{},[u,te,ae])}var gZ=(e,t,n)=>{if(t.length===1&&t[0]===n){let r=!1;try{const o={};e(o)===o&&(r=!0)}catch{}if(r){let o;try{throw new Error}catch(i){({stack:o}=i)}console.warn(`The result function returned its own inputs without modification. e.g
|
package/dist/segmentify-ui.js
CHANGED
|
@@ -20002,7 +20002,7 @@ function jde({
|
|
|
20002
20002
|
"data-slot": "chart",
|
|
20003
20003
|
"data-chart": s,
|
|
20004
20004
|
className: F(
|
|
20005
|
-
"ui:[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground ui:[&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 ui:[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border ui:[&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border ui:[&_.recharts-radial-bar-background-sector]:fill-muted ui:[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted ui:[&_.recharts-reference-line_[stroke='#ccc']]:stroke-border ui:flex ui:aspect-video ui:justify-center ui:text-xs ui:[&_.recharts-dot[stroke='#fff']]:stroke-transparent ui:[&_.recharts-layer]:outline-hidden ui:[&_.recharts-sector]:outline-hidden ui:[&_.recharts-sector[stroke='#fff']]:stroke-transparent ui:
|
|
20005
|
+
"ui:[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground ui:[&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 ui:[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border ui:[&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border ui:[&_.recharts-radial-bar-background-sector]:fill-muted ui:[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted ui:[&_.recharts-reference-line_[stroke='#ccc']]:stroke-border ui:flex ui:aspect-video ui:justify-center ui:text-xs ui:[&_.recharts-dot[stroke='#fff']]:stroke-transparent ui:[&_.recharts-layer]:outline-hidden ui:[&_.recharts-sector]:outline-hidden ui:[&_.recharts-sector[stroke='#fff']]:stroke-transparent ui:[&_.recharts-surface]:outline-hidden",
|
|
20006
20006
|
t
|
|
20007
20007
|
),
|
|
20008
20008
|
...o,
|
|
@@ -20097,7 +20097,7 @@ function Yde({
|
|
|
20097
20097
|
"div",
|
|
20098
20098
|
{
|
|
20099
20099
|
className: F(
|
|
20100
|
-
"ui:flex ui:flex-1 ui:justify-between ui:leading-none",
|
|
20100
|
+
"ui:flex ui:flex-1 ui:justify-between ui:leading-none ui:gap-2",
|
|
20101
20101
|
g ? "ui:items-end" : "ui:items-center"
|
|
20102
20102
|
),
|
|
20103
20103
|
children: [
|
package/dist/ui.css
CHANGED
|
@@ -1242,9 +1242,6 @@
|
|
|
1242
1242
|
.ui\:bg-amber-50 {
|
|
1243
1243
|
background-color: var(--ui-color-amber-50);
|
|
1244
1244
|
}
|
|
1245
|
-
.ui\:bg-amber-200 {
|
|
1246
|
-
background-color: var(--ui-color-amber-200);
|
|
1247
|
-
}
|
|
1248
1245
|
.ui\:bg-amber-500\/10 {
|
|
1249
1246
|
background-color: var(--ui-color-amber-500);
|
|
1250
1247
|
@supports (color: color-mix(in lab, red, red)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@segmentify/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.44",
|
|
4
4
|
"description": "A collection of reusable React UI components built with Tailwind CSS and Radix UI",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"react-hook-form": "^7.0.0",
|
|
33
33
|
"@tanstack/react-query": "^5.90.19",
|
|
34
34
|
"lucide-react": ">=0.562.0",
|
|
35
|
-
"sonner": "^2.0.7"
|
|
35
|
+
"sonner": "^2.0.7",
|
|
36
|
+
"recharts": "^2.15.0"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
39
|
"@base-ui/react": "^1.1.0",
|
|
@@ -67,7 +68,6 @@
|
|
|
67
68
|
"radix-ui": "^1.4.3",
|
|
68
69
|
"react-day-picker": "^9.13.0",
|
|
69
70
|
"react-select": "^5.10.2",
|
|
70
|
-
"recharts": "2.15.4",
|
|
71
71
|
"tailwind-merge": "^3.4.0",
|
|
72
72
|
"vaul": "^1.1.2"
|
|
73
73
|
},
|
|
@@ -110,6 +110,7 @@
|
|
|
110
110
|
"@tanstack/react-query": "^5.90.19",
|
|
111
111
|
"lucide-react": "^0.562.0",
|
|
112
112
|
"sonner": "^2.0.7",
|
|
113
|
+
"recharts": "2.15.4",
|
|
113
114
|
"storybook": "^10.1.10",
|
|
114
115
|
"tailwindcss": "^4.1.18",
|
|
115
116
|
"ts-toolbelt": "^9.6.0",
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { VariantProps } from 'class-variance-authority';
|
|
3
|
-
import { buttonVariants } from '../../lib/design-variants';
|
|
4
|
-
import type { Union } from 'ts-toolbelt';
|
|
5
|
-
type BaseProps = {
|
|
6
|
-
title: string;
|
|
7
|
-
description: string;
|
|
8
|
-
onAction: () => void;
|
|
9
|
-
children?: React.ReactNode;
|
|
10
|
-
cancelLabel: string;
|
|
11
|
-
actionLabel: string;
|
|
12
|
-
actionVariant?: VariantProps<typeof buttonVariants>['variant'];
|
|
13
|
-
};
|
|
14
|
-
type ControlledProps = BaseProps & {
|
|
15
|
-
controlled: true;
|
|
16
|
-
open: boolean;
|
|
17
|
-
setOpen: (open: boolean) => void;
|
|
18
|
-
};
|
|
19
|
-
type UncontrolledProps = BaseProps & {
|
|
20
|
-
controlled?: false;
|
|
21
|
-
};
|
|
22
|
-
type Props = Union.Strict<ControlledProps | UncontrolledProps>;
|
|
23
|
-
export declare const ConfirmationDialog: ({ title, description, onAction, children, cancelLabel, actionLabel, actionVariant, open, setOpen, controlled, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
export {};
|