@medixdeck/ui 0.1.24 → 0.1.25
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/README.md +20 -20
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,17 +54,17 @@ export function App() {
|
|
|
54
54
|
|
|
55
55
|
## Public API index
|
|
56
56
|
|
|
57
|
-
| Area | Exports
|
|
58
|
-
| ----------------- |
|
|
59
|
-
| Provider + theme | `MedixProvider`, `useThemeMode`, `useIsDarkMode`, `useColorScheme`, `system`, `medixConfig`, token exports
|
|
60
|
-
| Primitive | `Button`, `IconButton`, `Badge`, `Avatar`, `AvatarGroup`, `Spinner`, `FullPageSpinner`, `Tag`, `Divider`, `Logo`
|
|
57
|
+
| Area | Exports |
|
|
58
|
+
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
59
|
+
| Provider + theme | `MedixProvider`, `useThemeMode`, `useIsDarkMode`, `useColorScheme`, `system`, `medixConfig`, token exports |
|
|
60
|
+
| Primitive | `Button`, `IconButton`, `Badge`, `Avatar`, `AvatarGroup`, `Spinner`, `FullPageSpinner`, `Tag`, `Divider`, `Logo` |
|
|
61
61
|
| Form | `Input`, `SearchInput`, `Textarea`, `Select`, `Checkbox`, `RadioGroup`, `Switch`, `FormControl`, `OTPInput`, `PinInput`, `PhoneInput`, `DatePicker`, `DateRangePicker`, `Calendar`, `Combobox`, `FileUpload`, `TagsInput`, `TagInput`, `clearTextareaDraft`, `getTextareaDraft`, `saveTextareaDraft`, `RichTextInput`, `RichTextEditor`, `clearRichTextDraft`, `getRichTextDraft`, `saveRichTextDraft` |
|
|
62
|
-
| Layout | `Card`, `CardHeader`, `CardBody`, `CardFooter`, `StatCard`, `Container`, `SectionHeader`, `ThemeColorPalette`, `DashboardLayout`, `Footer`
|
|
63
|
-
| Navigation | `Navbar`, `Breadcrumb`, `Tabs`, `Pagination`, `Stepper`
|
|
64
|
-
| Feedback | `Alert`, `Skeleton`, `SkeletonText`, `SkeletonCard`, `Progress`, `Modal`, `Drawer`, `Tooltip`, `EmptyState`, `NotFoundPage`, `ServerErrorPage`, `Toaster`, `toast`, `dismissToast`, `CookieConsentBanner`, `PWAInstallPrompt`
|
|
65
|
-
| Data display | `Accordion`, `TestimonialCard`, `BlogCard`, `DataTable`
|
|
66
|
-
| Healthcare | `DoctorCard`, `VitalBadge`, `AppointmentCard`
|
|
67
|
-
| Chakra re-exports | `Box`, `Flex`, `Grid`, `Stack`, `Text`, `Heading`, `Link`, `Image`, `Icon`, `Center`, `Wrap`, `WrapItem`, others in `lib/index.ts`
|
|
62
|
+
| Layout | `Card`, `CardHeader`, `CardBody`, `CardFooter`, `StatCard`, `Container`, `SectionHeader`, `ThemeColorPalette`, `DashboardLayout`, `Footer` |
|
|
63
|
+
| Navigation | `Navbar`, `Breadcrumb`, `Tabs`, `Pagination`, `Stepper` |
|
|
64
|
+
| Feedback | `Alert`, `Skeleton`, `SkeletonText`, `SkeletonCard`, `Progress`, `Modal`, `Drawer`, `Tooltip`, `EmptyState`, `NotFoundPage`, `ServerErrorPage`, `Toaster`, `toast`, `dismissToast`, `CookieConsentBanner`, `PWAInstallPrompt` |
|
|
65
|
+
| Data display | `Accordion`, `TestimonialCard`, `BlogCard`, `DataTable` |
|
|
66
|
+
| Healthcare | `DoctorCard`, `VitalBadge`, `AppointmentCard` |
|
|
67
|
+
| Chakra re-exports | `Box`, `Flex`, `Grid`, `Stack`, `Text`, `Heading`, `Link`, `Image`, `Icon`, `Center`, `Wrap`, `WrapItem`, others in `lib/index.ts` |
|
|
68
68
|
|
|
69
69
|
## Design-system rules
|
|
70
70
|
|
|
@@ -403,16 +403,16 @@ import { DashboardLayout } from '@medixdeck/ui';
|
|
|
403
403
|
|
|
404
404
|
`DashboardNavItem` props:
|
|
405
405
|
|
|
406
|
-
| Prop | Type | Required | Description
|
|
407
|
-
| ---------- | -------------------- | -------- |
|
|
408
|
-
| `label` | `string` | ✓ | Display label for the sidebar link
|
|
409
|
-
| `href` | `string` | ✓ | Identifier or URL passed to `renderLink` and used as unique key
|
|
410
|
-
| `icon` | `ReactNode` | — | Optional icon element
|
|
411
|
-
| `badge` | `number` | — | Numeric count badge displayed to the right of the label
|
|
412
|
-
| `hasDot` | `boolean` | — | Red dot indicator for unread alerts or notifications
|
|
413
|
-
| `isNew` | `boolean` | — | "NEW" pill badge matching the active `colorScheme` (`blue` or `purple`)
|
|
414
|
-
| `isActive` | `boolean` | — | Marks this item as the active navigation route
|
|
415
|
-
| `subItems` | `DashboardNavItem[]` | — | Nested sub-links that expand/collapse in an accordion menu
|
|
406
|
+
| Prop | Type | Required | Description |
|
|
407
|
+
| ---------- | -------------------- | -------- | ----------------------------------------------------------------------- |
|
|
408
|
+
| `label` | `string` | ✓ | Display label for the sidebar link |
|
|
409
|
+
| `href` | `string` | ✓ | Identifier or URL passed to `renderLink` and used as unique key |
|
|
410
|
+
| `icon` | `ReactNode` | — | Optional icon element |
|
|
411
|
+
| `badge` | `number` | — | Numeric count badge displayed to the right of the label |
|
|
412
|
+
| `hasDot` | `boolean` | — | Red dot indicator for unread alerts or notifications |
|
|
413
|
+
| `isNew` | `boolean` | — | "NEW" pill badge matching the active `colorScheme` (`blue` or `purple`) |
|
|
414
|
+
| `isActive` | `boolean` | — | Marks this item as the active navigation route |
|
|
415
|
+
| `subItems` | `DashboardNavItem[]` | — | Nested sub-links that expand/collapse in an accordion menu |
|
|
416
416
|
|
|
417
417
|
### Mobile bottom navigation (`mobileNavItems`)
|
|
418
418
|
|
package/dist/index.cjs
CHANGED
|
@@ -348,7 +348,7 @@
|
|
|
348
348
|
${w}px !important;
|
|
349
349
|
${A}px !important;
|
|
350
350
|
}
|
|
351
|
-
`),()=>{var O;(O=l.current)==null||O.removeAttribute("data-motion-pop-id"),C.contains(B)&&C.removeChild(B)}},[t]),o.jsx(a0,{isPresent:t,childRef:l,sizeRef:d,pop:s,children:s===!1?e:je.cloneElement(e,{ref:h})})}const c0=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a,anchorX:l,anchorY:d,root:c})=>{const u=ds(u0),h=k.useId();let m=!0,p=k.useMemo(()=>(m=!1,{id:h,initial:t,isPresent:n,custom:i,onExitComplete:x=>{u.set(x,!0);for(const g of u.values())if(!g)return;r&&r()},register:x=>(u.set(x,!1),()=>u.delete(x))}),[n,u,r]);return s&&m&&(p={...p}),k.useMemo(()=>{u.forEach((x,g)=>u.set(g,!1))},[n]),je.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=o.jsx(l0,{pop:a==="popLayout",isPresent:n,anchorX:l,anchorY:d,root:c,children:e}),o.jsx(di.Provider,{value:p,children:e})};function u0(){return new Map}function Qd(e=!0){const t=k.useContext(di);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=k.useId();k.useEffect(()=>{if(e)return i(s)},[e]);const a=k.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,a]:[!0]}const Er=e=>e.key||"";function Al(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const dr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:a=!1,anchorX:l="left",anchorY:d="top",root:c})=>{const[u,h]=Qd(a),m=k.useMemo(()=>Al(e),[e]),p=a&&!u?[]:m.map(Er),x=k.useRef(!0),g=k.useRef(m),v=ds(()=>new Map),y=k.useRef(new Set),[j,w]=k.useState(m),[A,B]=k.useState(m);Tu(()=>{x.current=!1,g.current=m;for(let E=0;E<A.length;E++){const F=Er(A[E]);p.includes(F)?(v.delete(F),y.current.delete(F)):v.get(F)!==!0&&v.set(F,!1)}},[A,p.length,p.join("-")]);const C=[];if(m!==j){let E=[...m];for(let F=0;F<A.length;F++){const L=A[F],R=Er(L);p.includes(R)||(E.splice(F,0,L),C.push(L))}return s==="wait"&&C.length&&(E=C),B(Al(E)),w(m),null}process.env.NODE_ENV!=="production"&&s==="wait"&&A.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:O}=k.useContext(us);return o.jsx(o.Fragment,{children:A.map(E=>{const F=Er(E),L=a&&!u?!1:m===A||p.includes(F),R=()=>{if(y.current.has(F))return;if(v.has(F))y.current.add(F),v.set(F,!0);else return;let D=!0;v.forEach(N=>{N||(D=!1)}),D&&(O==null||O(),B(g.current),a&&(h==null||h()),r&&r())};return o.jsx(c0,{isPresent:L,initial:!x.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,root:c,onExitComplete:L?void 0:R,anchorX:l,anchorY:d,children:E},F)})})},ef=k.createContext({strict:!1}),Ll={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Il=!1;function d0(){if(Il)return;const e={};for(const t in Ll)e[t]={isEnabled:n=>Ll[t].some(r=>!!n[r])};Fd(e),Il=!0}function tf(){return d0(),qx()}function f0(e){const t=tf();for(const n in e)t[n]={...t[n],...e[n]};Fd(t)}const h0=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function ni(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||h0.has(e)}let nf=e=>!ni(e);function p0(e){typeof e=="function"&&(nf=t=>t.startsWith("on")?!ni(t):e(t))}try{p0(require("@emotion/is-prop-valid").default)}catch{}function m0(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||Ue(e[i])||(nf(i)||n===!0&&ni(i)||!t&&!ni(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const mi=k.createContext({});function x0(e,t){if(pi(e)){const{initial:n,animate:r}=e;return{initial:n===!1||cr(n)?n:void 0,animate:cr(r)?r:void 0}}return e.inherit!==!1?t:{}}function g0(e){const{initial:t,animate:n}=x0(e,k.useContext(mi));return k.useMemo(()=>({initial:t,animate:n}),[Dl(t),Dl(n)])}function Dl(e){return Array.isArray(e)?e.join(" "):e}const Os=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function rf(e,t,n){for(const r in t)!Ue(t[r])&&!Pd(r,n)&&(e[r]=t[r])}function y0({transformTemplate:e},t){return k.useMemo(()=>{const n=Os();return Rs(n,t,e),Object.assign({},n.vars,n.style)},[t])}function b0(e,t){const n=e.style||{},r={};return rf(r,n,e),Object.assign(r,y0(e,t)),r}function v0(e,t){const n={},r=b0(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const of=()=>({...Os(),attrs:{}});function k0(e,t,n,r){const i=k.useMemo(()=>{const s=of();return Od(s,t,_d(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};rf(s,e.style,e),i.style={...s,...i.style}}return i}const w0=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function zs(e){return typeof e!="string"||e.includes("-")?!1:!!(w0.indexOf(e)>-1||/[A-Z]/u.test(e))}function S0(e,t,n,{latestValues:r},i,s=!1,a){const d=(a??zs(e)?k0:v0)(t,r,i,e),c=m0(t,typeof e=="string",s),u=e!==k.Fragment?{...c,...d,ref:n}:{},{children:h}=t,m=k.useMemo(()=>Ue(h)?h.get():h,[h]);return k.createElement(e,{...u,children:m})}function C0({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:j0(n,r,i,e),renderState:t()}}function j0(e,t,n,r){const i={},s=r(e,{});for(const m in s)i[m]=Ur(s[m]);let{initial:a,animate:l}=e;const d=pi(e),c=Bd(e);t&&c&&!d&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let u=n?n.initial===!1:!1;u=u||a===!1;const h=u?l:a;if(h&&typeof h!="boolean"&&!hi(h)){const m=Array.isArray(h)?h:[h];for(let p=0;p<m.length;p++){const x=Ts(e,m[p]);if(x){const{transitionEnd:g,transition:v,...y}=x;for(const j in y){let w=y[j];if(Array.isArray(w)){const A=u?w.length-1:0;w=w[A]}w!==null&&(i[j]=w)}for(const j in g)i[j]=g[j]}}}return i}const sf=e=>(t,n)=>{const r=k.useContext(mi),i=k.useContext(di),s=()=>C0(e,t,r,i);return n?s():ds(s)},T0=sf({scrapeMotionValuesFromProps:Ms,createRenderState:Os}),B0=sf({scrapeMotionValuesFromProps:Nd,createRenderState:of}),E0=Symbol.for("motionComponentSymbol");function F0(e,t,n){const r=k.useRef(n);k.useInsertionEffect(()=>{r.current=n});const i=k.useRef(null);return k.useCallback(s=>{var l;s&&((l=e.onMount)==null||l.call(e,s));const a=r.current;if(typeof a=="function")if(s){const d=a(s);typeof d=="function"&&(i.current=d)}else i.current?(i.current(),i.current=null):a(s);else a&&(a.current=s);t&&(s?t.mount(s):t.unmount())},[t])}const af=k.createContext({});function Tn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function A0(e,t,n,r,i,s){var w,A;const{visualElement:a}=k.useContext(mi),l=k.useContext(ef),d=k.useContext(di),c=k.useContext(Ps),u=c.reducedMotion,h=c.skipAnimations,m=k.useRef(null),p=k.useRef(!1);r=r||l.renderer,!m.current&&r&&(m.current=r(e,{visualState:t,parent:a,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:u,skipAnimations:h,isSVG:s}),p.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const x=m.current,g=k.useContext(af);x&&!x.projection&&i&&(x.type==="html"||x.type==="svg")&&L0(m.current,n,i,g);const v=k.useRef(!1);k.useInsertionEffect(()=>{x&&v.current&&x.update(n,d)});const y=n[pd],j=k.useRef(!!y&&typeof window<"u"&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,y))&&((A=window.MotionHasOptimisedAnimation)==null?void 0:A.call(window,y)));return Tu(()=>{p.current=!0,x&&(v.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),j.current&&x.animationState&&x.animationState.animateChanges())}),k.useEffect(()=>{x&&(!j.current&&x.animationState&&x.animationState.animateChanges(),j.current&&(queueMicrotask(()=>{var B;(B=window.MotionHandoffMarkAsComplete)==null||B.call(window,y)}),j.current=!1),x.enteringChildren=void 0)}),x}function L0(e,t,n,r){const{layoutId:i,layout:s,drag:a,dragConstraints:l,layoutScroll:d,layoutRoot:c,layoutAnchor:u,layoutCrossfade:h}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:lf(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!a||l&&Tn(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:d,layoutRoot:c,layoutAnchor:u})}function lf(e){if(e)return e.options.allowProjection!==!1?e.projection:lf(e.parent)}function Ni(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&f0(r);const s=n?n==="svg":zs(e),a=s?B0:T0;function l(c,u){let h;const m={...k.useContext(Ps),...c,layoutId:I0(c)},{isStatic:p}=m,x=g0(c),g=a(c,p);if(!p&&typeof window<"u"){D0(m,r);const v=R0(m);h=v.MeasureLayout,x.visualElement=A0(e,g,m,i,v.ProjectionNode,s)}return o.jsxs(mi.Provider,{value:x,children:[h&&x.visualElement?o.jsx(h,{visualElement:x.visualElement,...m}):null,S0(e,c,F0(g,x.visualElement,u),g,p,t,s)]})}l.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const d=k.forwardRef(l);return d[E0]=e,d}function I0({layoutId:e}){const t=k.useContext(us).id;return t&&e!==void 0?t+"-"+e:e}function D0(e,t){const n=k.useContext(ef).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?On(!1,r,"lazy-strict-mode"):Pt(!1,r,"lazy-strict-mode")}}function R0(e){const t=tf(),{drag:n,layout:r}=t;if(!n&&!r)return{};const i={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function M0(e,t){if(typeof Proxy>"u")return Ni;const n=new Map,r=(s,a)=>Ni(s,a,e,t),i=(s,a)=>(process.env.NODE_ENV!=="production"&&ps(!1,"motion() is deprecated. Use motion.create() instead."),r(s,a));return new Proxy(i,{get:(s,a)=>a==="create"?r:(n.has(a)||n.set(a,Ni(a,void 0,e,t)),n.get(a))})}const P0=(e,t)=>t.isSVG??zs(e)?new fg(t):new sg(t,{allowProjection:e!==k.Fragment});class O0 extends Yt{constructor(t){super(t),t.animationState||(t.animationState=gg(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();hi(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let z0=0;class _0 extends Yt{constructor(){super(...arguments),this.id=z0++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:a,custom:l}=this.node.getProps();if(typeof a=="string"){const d=an(this.node,a,l);if(d){const{transition:c,transitionEnd:u,...h}=d;for(const m in h)(s=this.node.getValue(m))==null||s.jump(h[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const N0={animation:{Feature:O0},exit:{Feature:_0}};function gr(e){return{point:{x:e.pageX,y:e.pageY}}}const V0=e=>t=>As(t)&&e(t,gr(t));function rr(e,t,n,r){return ur(e,t,V0(n),r)}const cf=({current:e})=>e?e.ownerDocument.defaultView:null,Rl=(e,t)=>Math.abs(e-t);function W0(e,t){const n=Rl(e.x,t.x),r=Rl(e.y,t.y);return Math.sqrt(n**2+r**2)}const Ml=new Set(["auto","scroll"]);class uf{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:a=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Fr(this.lastRawMoveEventInfo,this.transformPagePoint));const p=Vi(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,g=W0(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!g)return;const{point:v}=p,{timestamp:y}=He;this.history.push({...v,timestamp:y});const{onStart:j,onMove:w}=this.handlers;x||(j&&j(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,p)},this.handlePointerMove=(p,x)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=Fr(x,this.transformPagePoint),ye.update(this.updatePoint,!0)},this.handlePointerUp=(p,x)=>{this.end();const{onEnd:g,onSessionEnd:v,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const j=Vi(p.type==="pointercancel"?this.lastMoveEventInfo:Fr(x,this.transformPagePoint),this.history);this.startEvent&&g&&g(p,j),v&&v(p,j)},!As(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=i||window;const d=gr(t),c=Fr(d,this.transformPagePoint),{point:u}=c,{timestamp:h}=He;this.history=[{...u,timestamp:h}];const{onSessionStart:m}=n;m&&m(t,Vi(c,this.history)),this.removeListeners=pr(rr(this.contextWindow,"pointermove",this.handlePointerMove),rr(this.contextWindow,"pointerup",this.handlePointerUp),rr(this.contextWindow,"pointercancel",this.handlePointerUp)),l&&this.startScrollTracking(l)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(Ml.has(r.overflowX)||Ml.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,i=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:i.x-n.x,y:i.y-n.y};s.x===0&&s.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,i),ye.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Gt(this.updatePoint)}}function Fr(e,t){return t?{point:t(e.point)}:e}function Pl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Vi({point:e},t){return{point:e,delta:Pl(e,df(t)),offset:Pl(e,H0(t)),velocity:U0(t,.1)}}function H0(e){return e[0]}function df(e){return e[e.length-1]}function U0(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=df(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>et(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>et(t)*2&&(r=e[1]);const s=dt(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const a={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function $0(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?we(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?we(n,e,r.max):Math.min(e,n)),e}function Ol(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function G0(e,{top:t,left:n,bottom:r,right:i}){return{x:Ol(e.x,n,i),y:Ol(e.y,t,r)}}function zl(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Y0(e,t){return{x:zl(e.x,t.x),y:zl(e.y,t.y)}}function K0(e,t){let n=.5;const r=qe(e),i=qe(t);return i>r?n=ar(t.min,t.max-r,e.min):r>i&&(n=ar(e.min,e.max-i,t.min)),Lt(0,1,n)}function q0(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Po=.35;function X0(e=Po){return e===!1?e=0:e===!0&&(e=Po),{x:_l(e,"left","right"),y:_l(e,"top","bottom")}}function _l(e,t,n){return{min:Nl(e,t),max:Nl(e,n)}}function Nl(e,t){return typeof e=="number"?e:e[t]||0}const Z0=new WeakMap;class J0{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Pe(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=h=>{n&&this.snapToCursor(gr(h).point),this.stopAnimation()},a=(h,m)=>{const{drag:p,dragPropagation:x,onDragStart:g}=this.getProps();if(p&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=jx(p),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ct(y=>{let j=this.getAxisMotionValue(y).get()||0;if(Ft.test(j)){const{projection:w}=this.visualElement;if(w&&w.layout){const A=w.layout.layoutBox[y];A&&(j=qe(A)*(parseFloat(j)/100))}}this.originPoint[y]=j}),g&&ye.update(()=>g(h,m),!1,!0),Bo(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},l=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m;const{dragPropagation:p,dragDirectionLock:x,onDirectionLock:g,onDrag:v}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:y}=m;if(x&&this.currentDirection===null){this.currentDirection=ey(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",m.point,y),this.updateAxis("y",m.point,y),this.visualElement.render(),v&&ye.update(()=>v(h,m),!1,!0)},d=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m,this.stop(h,m),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new uf(t,{onSessionStart:s,onStart:a,onMove:l,onSessionEnd:d,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:cf(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!r)return;const{velocity:a}=i;this.startAnimation(a);const{onDragEnd:l}=this.getProps();l&&ye.postRender(()=>l(r,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Ar(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=$0(a,this.constraints[t],this.elastic[t])),s.set(a)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&Tn(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=G0(r.layoutBox,t):this.constraints=!1,this.elastic=X0(n),i!==this.constraints&&!Tn(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Ct(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=q0(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Tn(t))return!1;const r=t.current;Pt(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=eg(r,i.root,this.visualElement.getTransformPagePoint());let a=Y0(i.layout.layoutBox,s);if(n){const l=n(Zx(a));this.hasMutatedConstraints=!!l,l&&(a=Ld(l))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),d=this.constraints||{},c=Ct(u=>{if(!Ar(u,n,this.currentDirection))return;let h=d&&d[u]||{};(a===!0||a===u)&&(h={min:0,max:0});const m=i?200:1e6,p=i?40:1e7,x={type:"inertia",velocity:r?t[u]:0,bounceStiffness:m,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...h};return this.startAxisValueAnimation(u,x)});return Promise.all(c).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Bo(this.visualElement,t),r.start(js(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ct(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ct(n=>{const{drag:r}=this.getProps();if(!Ar(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:l}=i.layout.layoutBox[n],d=s.get()||0;s.set(t[n]-we(a,l,.5)+d)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Tn(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ct(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const d=l.get();i[a]=K0({min:d,max:d},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ct(a=>{if(!Ar(a,t,null))return;const l=this.getAxisMotionValue(a),{min:d,max:c}=this.constraints[a];l.set(we(d,c,i[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Z0.set(this.visualElement,this);const t=this.visualElement.current,n=rr(t,"pointerdown",c=>{const{drag:u,dragListener:h=!0}=this.getProps(),m=c.target,p=m!==t&&Lx(m);u&&h&&!p&&this.start(c)});let r;const i=()=>{const{dragConstraints:c}=this.getProps();Tn(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=Q0(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,a=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ye.read(i);const l=ur(window,"resize",()=>this.scalePositionWithinConstraints()),d=s.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ct(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=c[h].translate,m.set(m.get()+c[h].translate))}),this.visualElement.render())}));return()=>{l(),n(),a(),d&&d(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:a=Po,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:a,dragMomentum:l}}}function Vl(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Q0(e,t,n){const r=Ka(e,Vl(n)),i=Ka(t,Vl(n));return()=>{r(),i()}}function Ar(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ey(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class ty extends Yt{constructor(t){super(t),this.removeGroupControls=ft,this.removeListeners=ft,this.controls=new J0(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ft}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Wi=e=>(t,n)=>{e&&ye.update(()=>e(t,n),!1,!0)};class ny extends Yt{constructor(){super(...arguments),this.removePointerDownListener=ft}onPointerDown(t){this.session=new uf(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:cf(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Wi(t),onStart:Wi(n),onMove:Wi(r),onEnd:(s,a)=>{delete this.session,i&&ye.postRender(()=>i(s,a))}}}mount(){this.removePointerDownListener=rr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Hi=!1;class ry extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),Hi&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),$r.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,{projection:a}=r;return a&&(a.isPresent=s,t.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),Hi=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?a.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?a.promote():a.relegate()||ye.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Fs.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;Hi=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function ff(e){const[t,n]=Qd(),r=k.useContext(us);return o.jsx(ry,{...e,layoutGroup:r,switchLayoutGroup:k.useContext(af),isPresent:t,safeToRemove:n})}const iy={pan:{Feature:ny},drag:{Feature:ty,ProjectionNode:Jd,MeasureLayout:ff}};function Wl(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&ye.postRender(()=>s(t,gr(t)))}class oy extends Yt{mount(){const{current:t}=this.node;t&&(this.unmount=Bx(t,(n,r)=>(Wl(this.node,r,"Start"),i=>Wl(this.node,i,"End"))))}unmount(){}}class sy extends Yt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=pr(ur(this.node.current,"focus",()=>this.onFocus()),ur(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Hl(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&ye.postRender(()=>s(t,gr(t)))}class ay extends Yt{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=Dx(t,(i,s)=>(Hl(this.node,s,"Start"),(a,{success:l})=>Hl(this.node,a,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Oo=new WeakMap,Ui=new WeakMap,ly=e=>{const t=Oo.get(e.target);t&&t(e)},cy=e=>{e.forEach(ly)};function uy({root:e,...t}){const n=e||document;Ui.has(n)||Ui.set(n,{});const r=Ui.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(cy,{root:e,...t})),r[i]}function dy(e,t,n){const r=uy(t);return Oo.set(e,n),r.observe(e),()=>{Oo.delete(e),r.unobserve(e)}}const fy={some:0,all:1};class hy extends Yt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var d;(d=this.stopObserver)==null||d.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:fy[i]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:h,onViewportLeave:m}=this.node.getProps(),p=u?h:m;p&&p(c)};this.stopObserver=dy(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(py(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function py({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const my={inView:{Feature:hy},tap:{Feature:ay},focus:{Feature:sy},hover:{Feature:oy}},xy={layout:{ProjectionNode:Jd,MeasureLayout:ff}},gy={...N0,...my,...iy,...xy},st=M0(gy,P0);function At({label:e,children:t,placement:n="top",...r}){const[i,s]=k.useState(!1),a=k.useRef(null),l=k.useMemo(()=>typeof window>"u"?!1:window.matchMedia("(pointer: coarse)").matches,[]);k.useEffect(()=>{if(!l||!i)return;const c=u=>{a.current&&!a.current.contains(u.target)&&s(!1)};return document.addEventListener("mousedown",c),document.addEventListener("touchstart",c,{passive:!0}),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("touchstart",c)}},[l,i]);const d=c=>{l&&(c.preventDefault(),c.stopPropagation(),s(u=>!u))};return o.jsxs(f.Tooltip.Root,{positioning:{placement:n},open:l?i:void 0,onOpenChange:l?c=>s(c.open):void 0,...r,children:[o.jsx(f.Tooltip.Trigger,{asChild:!0,children:o.jsx("span",{ref:a,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:d,children:t})}),o.jsx(f.Tooltip.Positioner,{children:o.jsx(f.Tooltip.Content,{bg:"gray.900",color:"white",borderRadius:"md",px:"3",py:"1.5",fontSize:"xs",fontFamily:"var(--font-body)",border:"1px solid",borderColor:"gray.700",boxShadow:"none",children:e})})]})}const yy={BASE_URL:"/",DEV:!1,MODE:"production",PACKAGE_VERSION:"0.1.24",PROD:!0,SSR:!1,VITE_STORYBOOK_URL:"https://medixdeck-ui.vercel.app",VITE_WHATSAPP_COMMUNITY_LINK:"https://medixdeck.com/whatsapp"},by={blue:{solid:"#0685FF",hoverBgLight:"rgba(6,133,255,0.08)",hoverBgDark:"rgba(6,133,255,0.12)",activeBgLight:"rgba(6,133,255,0.10)",activeBgDark:"rgba(6,133,255,0.15)",activeBgDarkStrong:"rgba(6,133,255,0.18)",chakraToken:"blue.500"},purple:{solid:"#7700CC",hoverBgLight:"rgba(119,0,204,0.08)",hoverBgDark:"rgba(119,0,204,0.12)",activeBgLight:"rgba(119,0,204,0.10)",activeBgDark:"rgba(119,0,204,0.15)",activeBgDarkStrong:"rgba(119,0,204,0.18)",chakraToken:"purple.500"}},Bt="#EF4444",zo="rgba(239,68,68,0.08)",hf=()=>o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),o.jsx("path",{d:"M9 3v18"}),o.jsx("path",{d:"m14 9-3 3 3 3"})]}),pf=()=>o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),o.jsx("path",{d:"M9 3v18"}),o.jsx("path",{d:"m12 15 3-3-3-3"})]}),vy=()=>o.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),o.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),o.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]}),ky=()=>o.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),mf=({open:e})=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"transform 0.2s ease",transform:e?"rotate(180deg)":"rotate(0deg)"},children:o.jsx("polyline",{points:"6 9 12 15 18 9"})}),_o=()=>o.jsxs("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4"}),o.jsx("polyline",{points:"16 17 21 12 16 7"}),o.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}),wy=()=>o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),o.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),Sy=()=>o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"3"}),o.jsx("path",{d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"})]}),Cy=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"4"}),o.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"4"}),o.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"22"}),o.jsx("line",{x1:"4.93",y1:"4.93",x2:"6.34",y2:"6.34"}),o.jsx("line",{x1:"17.66",y1:"17.66",x2:"19.07",y2:"19.07"}),o.jsx("line",{x1:"2",y1:"12",x2:"4",y2:"12"}),o.jsx("line",{x1:"20",y1:"12",x2:"22",y2:"12"}),o.jsx("line",{x1:"4.93",y1:"19.07",x2:"6.34",y2:"17.66"}),o.jsx("line",{x1:"17.66",y1:"6.34",x2:"19.07",y2:"4.93"})]}),jy=()=>o.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),Ty=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"12",rx:"2"}),o.jsx("line",{x1:"8",y1:"20",x2:"16",y2:"20"}),o.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"20"})]}),By=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M10 2v7.31a2 2 0 0 1-.37 1.17L4.22 18A3 3 0 0 0 6.78 22h10.44a3 3 0 0 0 2.56-4l-5.41-7.52A2 2 0 0 1 14 9.31V2"}),o.jsx("line",{x1:"8.5",y1:"2",x2:"15.5",y2:"2"}),o.jsx("path",{d:"M8.5 14h7"})]}),Ey=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),o.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),o.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),Fy=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),o.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),o.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),Ay=()=>o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),Ly=(e,t)=>o.jsx("a",{href:e.href,style:{textDecoration:"none",display:"block"},children:t});function Iy(){const e=new Date().getHours();return e<12?"Good morning":e<17?"Good afternoon":"Good evening"}const Ul={warning:{bg:"#FFFBEB",border:"#FDE68A",text:"#92400E",darkBg:"rgba(245,158,11,0.12)",darkBorder:"rgba(245,158,11,0.25)",darkText:"#FDE68A",badgeBg:"#F59E0B",badgeColor:"#FFFFFF"},info:{bg:"#EFF6FF",border:"#BFDBFE",text:"#1E40AF",darkBg:"rgba(6,133,255,0.12)",darkBorder:"rgba(6,133,255,0.25)",darkText:"#93C5FD",badgeBg:"#0685FF",badgeColor:"#FFFFFF"},error:{bg:"#FEF2F2",border:"#FECACA",text:"#991B1B",darkBg:"rgba(239,68,68,0.12)",darkBorder:"rgba(239,68,68,0.25)",darkText:"#FCA5A5",badgeBg:"#EF4444",badgeColor:"#FFFFFF"},neutral:{bg:"bg.surface",border:"var(--chakra-colors-border)",text:"text.body",darkBg:"bg.surface",darkBorder:"var(--chakra-colors-border)",darkText:"text.heading",badgeBg:"#6B7280",badgeColor:"#FFFFFF"}};function Dy(e){if(e&&e!=="auto")return{isNonProduction:e!=="production"&&e!=="live",detectedEnv:e};try{if(typeof process<"u"&&process&&process.env){const t=process.env.NODE_ENV,n=process.env.VERCEL_ENV||process.env.NEXT_PUBLIC_VERCEL_ENV,r=process.env.MEDIX_ENV||process.env.NEXT_PUBLIC_MEDIX_ENV||process.env.PUBLIC_MEDIX_ENV,i=process.env.CONTEXT;if(r){const s=String(r).toLowerCase();if(s==="sandbox")return{isNonProduction:!0,detectedEnv:"sandbox"};if(s==="staging")return{isNonProduction:!0,detectedEnv:"staging"};if(s==="test")return{isNonProduction:!0,detectedEnv:"test"};if(s==="dev"||s==="development")return{isNonProduction:!0,detectedEnv:"development"};if(s==="production"||s==="live")return{isNonProduction:!1,detectedEnv:"production"}}if(n==="preview")return{isNonProduction:!0,detectedEnv:"preview"};if(n==="development")return{isNonProduction:!0,detectedEnv:"development"};if(i==="deploy-preview"||i==="branch-deploy")return{isNonProduction:!0,detectedEnv:"preview"};if(t==="development")return{isNonProduction:!0,detectedEnv:"development"};if(t==="test")return{isNonProduction:!0,detectedEnv:"test"}}}catch{}try{if(typeof{url:typeof document>"u"?require("url").pathToFileURL(__filename).href:yn&&yn.tagName.toUpperCase()==="SCRIPT"&&yn.src||new URL("index.cjs",document.baseURI).href}<"u"&&{url:typeof document>"u"?require("url").pathToFileURL(__filename).href:yn&&yn.tagName.toUpperCase()==="SCRIPT"&&yn.src||new URL("index.cjs",document.baseURI).href}&&yy){const t="production"}}catch{}if(typeof window<"u"&&window.location&&window.location.hostname){const t=window.location.hostname.toLowerCase();if(t==="localhost"||t==="127.0.0.1"||t==="[::1]"||t==="0.0.0.0"||t.endsWith(".local")||t.endsWith(".test")||t.endsWith(".internal")||t.includes(".ngrok")||t.includes(".loca.lt"))return{isNonProduction:!0,detectedEnv:"development"};if(t.endsWith(".vercel.app")||t.endsWith(".netlify.app")||t.endsWith(".pages.dev")||t.endsWith(".amplifyapp.com")||t.endsWith(".onrender.com")||t.endsWith(".fly.dev")||t.endsWith(".azurestaticapps.net"))return{isNonProduction:!0,detectedEnv:"preview"};if(t.startsWith("sandbox.")||t.includes("-sandbox."))return{isNonProduction:!0,detectedEnv:"sandbox"};if(t.startsWith("staging.")||t.startsWith("stage.")||t.includes("-staging."))return{isNonProduction:!0,detectedEnv:"staging"};if(t.startsWith("test.")||t.startsWith("qa.")||t.includes("-test."))return{isNonProduction:!0,detectedEnv:"test"};if(t.startsWith("dev.")||t.includes("-dev."))return{isNonProduction:!0,detectedEnv:"development"}}return{isNonProduction:!1,detectedEnv:"production"}}function Ry(e){switch(e){case"sandbox":return"SANDBOX ENVIRONMENT";case"staging":return"STAGING ENVIRONMENT";case"test":return"TEST ENVIRONMENT";case"preview":return"PREVIEW DEPLOYMENT";case"development":return"DEVELOPMENT MODE";default:return"NON-PRODUCTION ENVIRONMENT"}}function My({detectedEnv:e,config:t,onDismiss:n}){const r=t.status??(e==="staging"||e==="preview"?"info":e==="test"?"error":"warning"),i=Ul[r]??Ul.warning,s=t.badgeLabel??Ry(e),a=t.message??"You are in a non-production test/sandbox environment. Simulated patient records, transactions, and actions will not affect live data.",l=r==="info"?o.jsx(Ey,{}):r==="error"?o.jsx(Fy,{}):o.jsx(By,{});return o.jsxs(f.Box,{as:"aside",role:"status","aria-live":"polite","aria-label":`${s}: ${a}`,position:"sticky",top:"0",zIndex:"banner",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"3",px:{base:"3",md:"5"},py:"2",minH:"36px",borderBottom:"1px solid",borderColor:i.border,bg:i.bg,color:i.text,_dark:{bg:i.darkBg,borderColor:i.darkBorder,color:i.darkText},transition:"background 0.2s ease, border-color 0.2s ease",children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2.5",minW:"0",flex:"1",children:[o.jsx(f.Box,{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:i.badgeBg,children:l}),o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",px:"2",py:"0.5",borderRadius:"full",fontSize:"10px",fontWeight:"700",letterSpacing:"0.06em",textTransform:"uppercase",fontFamily:"var(--font-body)",lineHeight:"1",flexShrink:0,style:{background:i.badgeBg,color:i.badgeColor},children:s}),o.jsx(f.Box,{as:"span",fontSize:"xs",fontWeight:"500",fontFamily:"var(--font-body)",lineHeight:"1.4",color:"inherit",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},display:{base:"none",sm:"inline-block"},children:a})]}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2.5",flexShrink:0,children:[t.action,t.dismissible&&o.jsx(f.Box,{as:"button",type:"button",onClick:n,"aria-label":"Dismiss environment banner",display:"inline-flex",alignItems:"center",justifyContent:"center",w:"6",h:"6",borderRadius:"md",border:"none",bg:"transparent",color:"inherit",cursor:"pointer",opacity:.8,_hover:{opacity:1,bg:"blackAlpha.100"},_dark:{_hover:{bg:"whiteAlpha.100"}},_focusVisible:{outline:"2px solid",outlineColor:i.badgeBg,outlineOffset:"1px"},transition:"background 0.15s ease, opacity 0.15s ease",children:o.jsx(Ay,{})})]})]})}const Lr=[{value:"light",label:"Light mode",shortLabel:"Light",icon:o.jsx(Cy,{})},{value:"dark",label:"Dark mode",shortLabel:"Dark",icon:o.jsx(jy,{})},{value:"system",label:"System theme",shortLabel:"System",icon:o.jsx(Ty,{})}];function Py({scheme:e}){const{mounted:t,themeMode:n,themeSetting:r,setThemeMode:i}=hr(),[s,a]=k.useState(!1),l=k.useRef(null),d=t?r:void 0,c=Lr.find(m=>m.value===d)||Lr[0];k.useEffect(()=>{const m=p=>{l.current&&!l.current.contains(p.target)&&a(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);const u=o.jsx(f.Box,{display:{base:"none",md:"flex"},alignItems:"center",gap:"1",bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"full",p:"1","aria-label":"Theme mode switcher",children:Lr.map(m=>{const p=d===m.value,x=m.value==="dark"?e.activeBgDarkStrong:m.value==="system"?e.hoverBgDark:e.hoverBgLight;return o.jsxs(f.Box,{as:"button",onClick:()=>{t&&i(m.value)},"aria-pressed":p,"aria-label":m.label,title:t&&m.value==="system"?`System theme (currently ${n})`:m.label,display:"inline-flex",alignItems:"center",gap:"2",h:"9",px:"3",borderRadius:"full",border:"none",bg:p?x:"transparent",color:p?e.chakraToken:"text.muted",opacity:t?1:.6,cursor:t?"pointer":"default",transition:"background 0.18s ease, color 0.18s ease, opacity 0.18s ease",_hover:t?{bg:p?x:"bg",color:"text.heading"}:void 0,_focusVisible:{outline:"2px solid",outlineColor:e.chakraToken,outlineOffset:"2px"},children:[o.jsx(f.Box,{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,children:m.icon}),o.jsx(f.Box,{as:"span",fontSize:"xs",fontWeight:p?"700":"600",fontFamily:"var(--font-body)",whiteSpace:"nowrap",children:m.shortLabel})]},m.value)})}),h=o.jsxs(f.Box,{display:{base:"block",md:"none"},position:"relative",ref:l,children:[o.jsx(f.Box,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",w:"10",h:"10",borderRadius:"full",bg:"bg.surface",border:"1px solid",borderColor:"border",color:e.chakraToken,cursor:t?"pointer":"default",opacity:t?1:.6,_hover:t?{bg:"bg"}:void 0,onClick:()=>{t&&a(m=>!m)},"aria-label":"Theme mode switcher","aria-expanded":s,"aria-haspopup":"menu",children:c.icon}),s&&t&&o.jsx(f.Box,{role:"menu",position:"absolute",top:"calc(100% + 8px)",right:"0",minW:"150px",bg:"bg",border:"1px solid",borderColor:"border",borderRadius:"xl",boxShadow:"none",zIndex:"popover",overflow:"hidden",py:"1",children:Lr.map(m=>{const p=d===m.value;return o.jsxs(f.Box,{as:"button",role:"menuitem",display:"flex",alignItems:"center",gap:"2.5",w:"full",px:"4",py:"2.5",border:"none",bg:p?e.hoverBgLight:"transparent",color:p?e.chakraToken:"text.body",cursor:"pointer",textAlign:"left",onClick:()=>{i(m.value),a(!1)},_hover:{bg:e.hoverBgLight,color:e.chakraToken},_dark:{bg:p?e.hoverBgDark:"transparent",_hover:{bg:e.hoverBgDark}},children:[o.jsx(f.Box,{flexShrink:0,children:m.icon}),o.jsx(f.Box,{as:"span",fontSize:"sm",fontWeight:p?"600":"500",fontFamily:"var(--font-body)",children:m.label})]},m.value)})})]});return o.jsxs(o.Fragment,{children:[u,h]})}function No({item:e,renderLink:t,onClick:n,scheme:r,isCollapsed:i=!1,isSubItem:s=!1}){var B;const[a,l]=k.useState(!1),[d,c]=k.useState(!1),[u,h]=k.useState(!1),m=k.useRef(null),p=e.isActive??!1,x=((B=e.subItems)==null?void 0:B.some(C=>C.isActive))??!1,[g,v]=k.useState(p||x),y=!!(e.subItems&&e.subItems.length>0),j=k.useId();k.useEffect(()=>{v(p||x)},[p,x]),k.useEffect(()=>{if(!u)return;const C=E=>{m.current&&!m.current.contains(E.target)&&h(!1)},O=E=>{E.key==="Escape"&&h(!1)};return document.addEventListener("mousedown",C),document.addEventListener("keydown",O),()=>{document.removeEventListener("mousedown",C),document.removeEventListener("keydown",O)}},[u]);const w=p;if(i){if(y){const O=o.jsxs(f.Box,{as:"button","aria-label":e.label,"aria-haspopup":"menu","aria-expanded":u,onClick:()=>h(E=>!E),onFocus:E=>c(E.currentTarget.matches(":focus-visible")),onBlur:()=>c(!1),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),display:"flex",alignItems:"center",justifyContent:"center",w:"10",h:"10",mx:"auto",borderRadius:"lg",border:"none",cursor:"pointer",position:"relative",style:{background:p||x?r.activeBgLight:a||u?r.hoverBgLight:"transparent",outline:d?`2px solid ${r.solid}`:void 0,outlineOffset:d?"2px":void 0,transition:"background 0.15s ease"},_dark:{bg:p||x?r.activeBgDark:a||u?r.hoverBgDark:"transparent"},children:[e.icon&&o.jsx(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",style:{color:p||x?r.solid:void 0,opacity:p||x?1:a||u?.85:.6},color:p||x?r.chakraToken:"text.body",children:e.icon}),x&&o.jsx(f.Box,{as:"span",position:"absolute",top:"2px",right:"2px",w:"6px",h:"6px",borderRadius:"full",style:{background:r.solid},"aria-hidden":"true"})]});return o.jsxs(f.Box,{position:"relative",ref:m,my:"0.5",display:"flex",justifyContent:"center",style:{zIndex:u?100:1},children:[u?O:o.jsx(At,{label:e.label,placement:"right",children:O}),u&&o.jsx(st.div,{initial:{opacity:0,x:-6,scale:.98},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:-4,scale:.98},transition:{duration:.16,ease:[0,0,.2,1]},style:{position:"absolute",left:"calc(100% + 8px)",top:0,zIndex:1500},children:o.jsxs(f.Box,{role:"menu","aria-label":e.label,bg:"bg",border:"1px solid",borderColor:"border",borderRadius:"card",boxShadow:"none",py:"1.5",minW:"200px",maxW:"260px",children:[o.jsxs(f.Box,{px:"3.5",py:"1.5",fontSize:"xs",fontWeight:"700",color:"text.muted",fontFamily:"var(--font-heading)",borderBottom:"1px solid",borderColor:"border",mb:"1",display:"flex",alignItems:"center",gap:"2",children:[e.icon&&o.jsx(f.Box,{display:"inline-flex",alignItems:"center",justifyContent:"center",color:r.chakraToken,children:e.icon}),o.jsx(f.Box,{as:"span",children:e.label}),e.isNew&&o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",justifyContent:"center",px:"1.5",py:"0.5",borderRadius:"full",fontSize:"10px",fontWeight:"700",letterSpacing:"0.04em",lineHeight:"1",textTransform:"uppercase",fontFamily:"var(--font-heading)",flexShrink:0,style:{background:r.solid,color:"#fff"},children:"NEW"})]}),o.jsx(f.Box,{display:"flex",flexDirection:"column",gap:"0.5",px:"1",children:e.subItems.map(E=>o.jsx(No,{item:E,renderLink:t,onClick:()=>{h(!1),n==null||n()},scheme:r,isCollapsed:!1,isSubItem:!0},E.href))})]})})]})}const C=o.jsx(f.Box,{display:"flex",justifyContent:"center",alignItems:"center",w:"full",children:o.jsx(At,{label:e.isNew?`${e.label} (NEW)`:e.label,placement:"right",children:o.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",w:"10",h:"10",mx:"auto",my:"0.5",borderRadius:"lg",position:"relative","aria-label":e.label,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onClick:n,style:{background:p?r.activeBgLight:a?r.hoverBgLight:"transparent",outline:d?`2px solid ${r.solid}`:void 0,outlineOffset:d?"2px":void 0,transition:"background 0.15s ease"},_dark:{bg:p?r.activeBgDark:a?r.hoverBgDark:"transparent"},children:[e.icon&&o.jsx(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",style:{color:w?r.solid:void 0,opacity:w?1:a?.85:.6},color:w?r.chakraToken:"text.body",children:e.icon}),typeof e.badge=="number"&&o.jsx(f.Box,{as:"span",position:"absolute",top:"-2px",right:"-2px",minW:"16px",h:"16px",px:"1",borderRadius:"full",fontSize:"9px",fontWeight:"700",lineHeight:"1",display:"inline-flex",alignItems:"center",justifyContent:"center",style:{background:r.solid,color:"#fff"},children:e.badge>99?"99+":e.badge}),e.hasDot&&o.jsx(f.Box,{as:"span",position:"absolute",top:"2px",right:"2px",w:"6px",h:"6px",borderRadius:"full",style:{background:Bt},"aria-label":"New notification"}),e.isNew&&typeof e.badge!="number"&&!e.hasDot&&o.jsx(f.Box,{as:"span",position:"absolute",top:"2px",right:"2px",w:"6px",h:"6px",borderRadius:"full",style:{background:r.solid},"aria-label":"New feature"})]})})});return t(e,C)}const A=o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:s?"2.5":"3",px:s?"2":"3",py:s?"2":"2.5",borderRadius:"lg",borderLeftRadius:y?"lg":"none",borderTopLeftRadius:y?"lg":"none",borderBottomLeftRadius:y?"lg":"none",position:"relative",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onClick:y?void 0:n,style:{background:p?r.activeBgLight:a?r.hoverBgLight:"transparent",boxShadow:p&&!y?`inset 3px 0 0 ${r.solid}`:void 0,outline:d?`2px solid ${r.solid}`:void 0,outlineOffset:d?"2px":void 0,transition:"background 0.15s ease, box-shadow 0.15s ease"},_dark:{bg:p?r.activeBgDark:a?r.hoverBgDark:"transparent"},children:[e.icon&&o.jsx(f.Box,{flexShrink:0,style:{color:w?r.solid:void 0,opacity:w?1:a?.85:.6,transition:"color 0.15s ease, opacity 0.15s ease"},color:w?r.chakraToken:"text.body",children:e.icon}),o.jsx(f.Box,{as:"span",flex:"1",minW:"0",fontSize:"sm",fontWeight:w?"600":"500",fontFamily:"var(--font-body)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",style:{color:w?r.solid:void 0,transition:"color 0.15s ease"},color:w?r.chakraToken:"text.body",children:e.label}),typeof e.badge=="number"&&!y&&o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",justifyContent:"center",minW:"20px",h:"20px",px:"1",borderRadius:"full",fontSize:"xs",fontWeight:"700",lineHeight:"1",style:{background:r.solid,color:"#fff"},children:e.badge}),e.hasDot&&!y&&o.jsx(f.Box,{as:"span",display:"inline-block",w:"7px",h:"7px",borderRadius:"full",flexShrink:0,style:{background:Bt},"aria-label":"New notification"}),e.isNew&&o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",justifyContent:"center",px:"1.5",py:"0.5",borderRadius:"full",fontSize:"10px",fontWeight:"700",letterSpacing:"0.04em",lineHeight:"1",textTransform:"uppercase",fontFamily:"var(--font-heading)",flexShrink:0,style:{background:r.solid,color:"#fff"},children:"NEW"}),y&&o.jsx(f.Box,{flexShrink:0,color:"text.muted",children:o.jsx(mf,{open:g})})]});return o.jsxs(o.Fragment,{children:[y?o.jsx("button",{type:"button","aria-expanded":g,"aria-controls":j,onClick:()=>v(C=>!C),onFocus:C=>{c(C.currentTarget.matches(":focus-visible"))},onBlur:()=>c(!1),style:{display:"block",width:"100%",background:"none",border:"none",padding:0,cursor:"pointer",textAlign:"left"},children:A}):t(e,A),y&&o.jsx(st.div,{id:j,initial:!1,animate:g?{height:"auto",opacity:1}:{height:0,opacity:0},transition:{duration:.2,ease:[0,0,.2,1]},style:{overflow:"hidden"},"aria-hidden":!g,children:o.jsx(f.Box,{display:"flex",flexDirection:"column",gap:"0.5",pl:"3",mt:"0.5",mb:"1",children:e.subItems.map(C=>o.jsx(No,{item:C,renderLink:t,onClick:n,scheme:r,isCollapsed:!1,isSubItem:!0},C.href))})})]})}let $l=!1;function Oy(){if(typeof document>"u"||$l)return;const e=document.createElement("style");e.setAttribute("data-medixdeck","mobile-nav"),e.textContent=`
|
|
351
|
+
`),()=>{var O;(O=l.current)==null||O.removeAttribute("data-motion-pop-id"),C.contains(B)&&C.removeChild(B)}},[t]),o.jsx(a0,{isPresent:t,childRef:l,sizeRef:d,pop:s,children:s===!1?e:je.cloneElement(e,{ref:h})})}const c0=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a,anchorX:l,anchorY:d,root:c})=>{const u=ds(u0),h=k.useId();let m=!0,p=k.useMemo(()=>(m=!1,{id:h,initial:t,isPresent:n,custom:i,onExitComplete:x=>{u.set(x,!0);for(const g of u.values())if(!g)return;r&&r()},register:x=>(u.set(x,!1),()=>u.delete(x))}),[n,u,r]);return s&&m&&(p={...p}),k.useMemo(()=>{u.forEach((x,g)=>u.set(g,!1))},[n]),je.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=o.jsx(l0,{pop:a==="popLayout",isPresent:n,anchorX:l,anchorY:d,root:c,children:e}),o.jsx(di.Provider,{value:p,children:e})};function u0(){return new Map}function Qd(e=!0){const t=k.useContext(di);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=k.useId();k.useEffect(()=>{if(e)return i(s)},[e]);const a=k.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,a]:[!0]}const Er=e=>e.key||"";function Al(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const dr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:a=!1,anchorX:l="left",anchorY:d="top",root:c})=>{const[u,h]=Qd(a),m=k.useMemo(()=>Al(e),[e]),p=a&&!u?[]:m.map(Er),x=k.useRef(!0),g=k.useRef(m),v=ds(()=>new Map),y=k.useRef(new Set),[j,w]=k.useState(m),[A,B]=k.useState(m);Tu(()=>{x.current=!1,g.current=m;for(let E=0;E<A.length;E++){const F=Er(A[E]);p.includes(F)?(v.delete(F),y.current.delete(F)):v.get(F)!==!0&&v.set(F,!1)}},[A,p.length,p.join("-")]);const C=[];if(m!==j){let E=[...m];for(let F=0;F<A.length;F++){const L=A[F],R=Er(L);p.includes(R)||(E.splice(F,0,L),C.push(L))}return s==="wait"&&C.length&&(E=C),B(Al(E)),w(m),null}process.env.NODE_ENV!=="production"&&s==="wait"&&A.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:O}=k.useContext(us);return o.jsx(o.Fragment,{children:A.map(E=>{const F=Er(E),L=a&&!u?!1:m===A||p.includes(F),R=()=>{if(y.current.has(F))return;if(v.has(F))y.current.add(F),v.set(F,!0);else return;let D=!0;v.forEach(N=>{N||(D=!1)}),D&&(O==null||O(),B(g.current),a&&(h==null||h()),r&&r())};return o.jsx(c0,{isPresent:L,initial:!x.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,root:c,onExitComplete:L?void 0:R,anchorX:l,anchorY:d,children:E},F)})})},ef=k.createContext({strict:!1}),Ll={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Il=!1;function d0(){if(Il)return;const e={};for(const t in Ll)e[t]={isEnabled:n=>Ll[t].some(r=>!!n[r])};Fd(e),Il=!0}function tf(){return d0(),qx()}function f0(e){const t=tf();for(const n in e)t[n]={...t[n],...e[n]};Fd(t)}const h0=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function ni(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||h0.has(e)}let nf=e=>!ni(e);function p0(e){typeof e=="function"&&(nf=t=>t.startsWith("on")?!ni(t):e(t))}try{p0(require("@emotion/is-prop-valid").default)}catch{}function m0(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||Ue(e[i])||(nf(i)||n===!0&&ni(i)||!t&&!ni(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const mi=k.createContext({});function x0(e,t){if(pi(e)){const{initial:n,animate:r}=e;return{initial:n===!1||cr(n)?n:void 0,animate:cr(r)?r:void 0}}return e.inherit!==!1?t:{}}function g0(e){const{initial:t,animate:n}=x0(e,k.useContext(mi));return k.useMemo(()=>({initial:t,animate:n}),[Dl(t),Dl(n)])}function Dl(e){return Array.isArray(e)?e.join(" "):e}const Os=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function rf(e,t,n){for(const r in t)!Ue(t[r])&&!Pd(r,n)&&(e[r]=t[r])}function y0({transformTemplate:e},t){return k.useMemo(()=>{const n=Os();return Rs(n,t,e),Object.assign({},n.vars,n.style)},[t])}function b0(e,t){const n=e.style||{},r={};return rf(r,n,e),Object.assign(r,y0(e,t)),r}function v0(e,t){const n={},r=b0(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const of=()=>({...Os(),attrs:{}});function k0(e,t,n,r){const i=k.useMemo(()=>{const s=of();return Od(s,t,_d(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};rf(s,e.style,e),i.style={...s,...i.style}}return i}const w0=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function zs(e){return typeof e!="string"||e.includes("-")?!1:!!(w0.indexOf(e)>-1||/[A-Z]/u.test(e))}function S0(e,t,n,{latestValues:r},i,s=!1,a){const d=(a??zs(e)?k0:v0)(t,r,i,e),c=m0(t,typeof e=="string",s),u=e!==k.Fragment?{...c,...d,ref:n}:{},{children:h}=t,m=k.useMemo(()=>Ue(h)?h.get():h,[h]);return k.createElement(e,{...u,children:m})}function C0({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:j0(n,r,i,e),renderState:t()}}function j0(e,t,n,r){const i={},s=r(e,{});for(const m in s)i[m]=Ur(s[m]);let{initial:a,animate:l}=e;const d=pi(e),c=Bd(e);t&&c&&!d&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let u=n?n.initial===!1:!1;u=u||a===!1;const h=u?l:a;if(h&&typeof h!="boolean"&&!hi(h)){const m=Array.isArray(h)?h:[h];for(let p=0;p<m.length;p++){const x=Ts(e,m[p]);if(x){const{transitionEnd:g,transition:v,...y}=x;for(const j in y){let w=y[j];if(Array.isArray(w)){const A=u?w.length-1:0;w=w[A]}w!==null&&(i[j]=w)}for(const j in g)i[j]=g[j]}}}return i}const sf=e=>(t,n)=>{const r=k.useContext(mi),i=k.useContext(di),s=()=>C0(e,t,r,i);return n?s():ds(s)},T0=sf({scrapeMotionValuesFromProps:Ms,createRenderState:Os}),B0=sf({scrapeMotionValuesFromProps:Nd,createRenderState:of}),E0=Symbol.for("motionComponentSymbol");function F0(e,t,n){const r=k.useRef(n);k.useInsertionEffect(()=>{r.current=n});const i=k.useRef(null);return k.useCallback(s=>{var l;s&&((l=e.onMount)==null||l.call(e,s));const a=r.current;if(typeof a=="function")if(s){const d=a(s);typeof d=="function"&&(i.current=d)}else i.current?(i.current(),i.current=null):a(s);else a&&(a.current=s);t&&(s?t.mount(s):t.unmount())},[t])}const af=k.createContext({});function Tn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function A0(e,t,n,r,i,s){var w,A;const{visualElement:a}=k.useContext(mi),l=k.useContext(ef),d=k.useContext(di),c=k.useContext(Ps),u=c.reducedMotion,h=c.skipAnimations,m=k.useRef(null),p=k.useRef(!1);r=r||l.renderer,!m.current&&r&&(m.current=r(e,{visualState:t,parent:a,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:u,skipAnimations:h,isSVG:s}),p.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const x=m.current,g=k.useContext(af);x&&!x.projection&&i&&(x.type==="html"||x.type==="svg")&&L0(m.current,n,i,g);const v=k.useRef(!1);k.useInsertionEffect(()=>{x&&v.current&&x.update(n,d)});const y=n[pd],j=k.useRef(!!y&&typeof window<"u"&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,y))&&((A=window.MotionHasOptimisedAnimation)==null?void 0:A.call(window,y)));return Tu(()=>{p.current=!0,x&&(v.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),j.current&&x.animationState&&x.animationState.animateChanges())}),k.useEffect(()=>{x&&(!j.current&&x.animationState&&x.animationState.animateChanges(),j.current&&(queueMicrotask(()=>{var B;(B=window.MotionHandoffMarkAsComplete)==null||B.call(window,y)}),j.current=!1),x.enteringChildren=void 0)}),x}function L0(e,t,n,r){const{layoutId:i,layout:s,drag:a,dragConstraints:l,layoutScroll:d,layoutRoot:c,layoutAnchor:u,layoutCrossfade:h}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:lf(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!a||l&&Tn(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:d,layoutRoot:c,layoutAnchor:u})}function lf(e){if(e)return e.options.allowProjection!==!1?e.projection:lf(e.parent)}function Ni(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&f0(r);const s=n?n==="svg":zs(e),a=s?B0:T0;function l(c,u){let h;const m={...k.useContext(Ps),...c,layoutId:I0(c)},{isStatic:p}=m,x=g0(c),g=a(c,p);if(!p&&typeof window<"u"){D0(m,r);const v=R0(m);h=v.MeasureLayout,x.visualElement=A0(e,g,m,i,v.ProjectionNode,s)}return o.jsxs(mi.Provider,{value:x,children:[h&&x.visualElement?o.jsx(h,{visualElement:x.visualElement,...m}):null,S0(e,c,F0(g,x.visualElement,u),g,p,t,s)]})}l.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const d=k.forwardRef(l);return d[E0]=e,d}function I0({layoutId:e}){const t=k.useContext(us).id;return t&&e!==void 0?t+"-"+e:e}function D0(e,t){const n=k.useContext(ef).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?On(!1,r,"lazy-strict-mode"):Pt(!1,r,"lazy-strict-mode")}}function R0(e){const t=tf(),{drag:n,layout:r}=t;if(!n&&!r)return{};const i={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function M0(e,t){if(typeof Proxy>"u")return Ni;const n=new Map,r=(s,a)=>Ni(s,a,e,t),i=(s,a)=>(process.env.NODE_ENV!=="production"&&ps(!1,"motion() is deprecated. Use motion.create() instead."),r(s,a));return new Proxy(i,{get:(s,a)=>a==="create"?r:(n.has(a)||n.set(a,Ni(a,void 0,e,t)),n.get(a))})}const P0=(e,t)=>t.isSVG??zs(e)?new fg(t):new sg(t,{allowProjection:e!==k.Fragment});class O0 extends Yt{constructor(t){super(t),t.animationState||(t.animationState=gg(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();hi(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let z0=0;class _0 extends Yt{constructor(){super(...arguments),this.id=z0++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:a,custom:l}=this.node.getProps();if(typeof a=="string"){const d=an(this.node,a,l);if(d){const{transition:c,transitionEnd:u,...h}=d;for(const m in h)(s=this.node.getValue(m))==null||s.jump(h[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const N0={animation:{Feature:O0},exit:{Feature:_0}};function gr(e){return{point:{x:e.pageX,y:e.pageY}}}const V0=e=>t=>As(t)&&e(t,gr(t));function rr(e,t,n,r){return ur(e,t,V0(n),r)}const cf=({current:e})=>e?e.ownerDocument.defaultView:null,Rl=(e,t)=>Math.abs(e-t);function W0(e,t){const n=Rl(e.x,t.x),r=Rl(e.y,t.y);return Math.sqrt(n**2+r**2)}const Ml=new Set(["auto","scroll"]);class uf{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:a=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Fr(this.lastRawMoveEventInfo,this.transformPagePoint));const p=Vi(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,g=W0(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!g)return;const{point:v}=p,{timestamp:y}=He;this.history.push({...v,timestamp:y});const{onStart:j,onMove:w}=this.handlers;x||(j&&j(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,p)},this.handlePointerMove=(p,x)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=Fr(x,this.transformPagePoint),ye.update(this.updatePoint,!0)},this.handlePointerUp=(p,x)=>{this.end();const{onEnd:g,onSessionEnd:v,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const j=Vi(p.type==="pointercancel"?this.lastMoveEventInfo:Fr(x,this.transformPagePoint),this.history);this.startEvent&&g&&g(p,j),v&&v(p,j)},!As(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=i||window;const d=gr(t),c=Fr(d,this.transformPagePoint),{point:u}=c,{timestamp:h}=He;this.history=[{...u,timestamp:h}];const{onSessionStart:m}=n;m&&m(t,Vi(c,this.history)),this.removeListeners=pr(rr(this.contextWindow,"pointermove",this.handlePointerMove),rr(this.contextWindow,"pointerup",this.handlePointerUp),rr(this.contextWindow,"pointercancel",this.handlePointerUp)),l&&this.startScrollTracking(l)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(Ml.has(r.overflowX)||Ml.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,i=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:i.x-n.x,y:i.y-n.y};s.x===0&&s.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,i),ye.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Gt(this.updatePoint)}}function Fr(e,t){return t?{point:t(e.point)}:e}function Pl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Vi({point:e},t){return{point:e,delta:Pl(e,df(t)),offset:Pl(e,H0(t)),velocity:U0(t,.1)}}function H0(e){return e[0]}function df(e){return e[e.length-1]}function U0(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=df(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>et(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>et(t)*2&&(r=e[1]);const s=dt(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const a={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function $0(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?we(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?we(n,e,r.max):Math.min(e,n)),e}function Ol(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function G0(e,{top:t,left:n,bottom:r,right:i}){return{x:Ol(e.x,n,i),y:Ol(e.y,t,r)}}function zl(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Y0(e,t){return{x:zl(e.x,t.x),y:zl(e.y,t.y)}}function K0(e,t){let n=.5;const r=qe(e),i=qe(t);return i>r?n=ar(t.min,t.max-r,e.min):r>i&&(n=ar(e.min,e.max-i,t.min)),Lt(0,1,n)}function q0(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Po=.35;function X0(e=Po){return e===!1?e=0:e===!0&&(e=Po),{x:_l(e,"left","right"),y:_l(e,"top","bottom")}}function _l(e,t,n){return{min:Nl(e,t),max:Nl(e,n)}}function Nl(e,t){return typeof e=="number"?e:e[t]||0}const Z0=new WeakMap;class J0{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Pe(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=h=>{n&&this.snapToCursor(gr(h).point),this.stopAnimation()},a=(h,m)=>{const{drag:p,dragPropagation:x,onDragStart:g}=this.getProps();if(p&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=jx(p),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ct(y=>{let j=this.getAxisMotionValue(y).get()||0;if(Ft.test(j)){const{projection:w}=this.visualElement;if(w&&w.layout){const A=w.layout.layoutBox[y];A&&(j=qe(A)*(parseFloat(j)/100))}}this.originPoint[y]=j}),g&&ye.update(()=>g(h,m),!1,!0),Bo(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},l=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m;const{dragPropagation:p,dragDirectionLock:x,onDirectionLock:g,onDrag:v}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:y}=m;if(x&&this.currentDirection===null){this.currentDirection=ey(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",m.point,y),this.updateAxis("y",m.point,y),this.visualElement.render(),v&&ye.update(()=>v(h,m),!1,!0)},d=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m,this.stop(h,m),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new uf(t,{onSessionStart:s,onStart:a,onMove:l,onSessionEnd:d,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:cf(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!r)return;const{velocity:a}=i;this.startAnimation(a);const{onDragEnd:l}=this.getProps();l&&ye.postRender(()=>l(r,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Ar(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=$0(a,this.constraints[t],this.elastic[t])),s.set(a)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&Tn(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=G0(r.layoutBox,t):this.constraints=!1,this.elastic=X0(n),i!==this.constraints&&!Tn(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Ct(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=q0(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Tn(t))return!1;const r=t.current;Pt(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=eg(r,i.root,this.visualElement.getTransformPagePoint());let a=Y0(i.layout.layoutBox,s);if(n){const l=n(Zx(a));this.hasMutatedConstraints=!!l,l&&(a=Ld(l))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),d=this.constraints||{},c=Ct(u=>{if(!Ar(u,n,this.currentDirection))return;let h=d&&d[u]||{};(a===!0||a===u)&&(h={min:0,max:0});const m=i?200:1e6,p=i?40:1e7,x={type:"inertia",velocity:r?t[u]:0,bounceStiffness:m,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...h};return this.startAxisValueAnimation(u,x)});return Promise.all(c).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Bo(this.visualElement,t),r.start(js(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ct(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ct(n=>{const{drag:r}=this.getProps();if(!Ar(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:l}=i.layout.layoutBox[n],d=s.get()||0;s.set(t[n]-we(a,l,.5)+d)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Tn(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ct(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const d=l.get();i[a]=K0({min:d,max:d},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ct(a=>{if(!Ar(a,t,null))return;const l=this.getAxisMotionValue(a),{min:d,max:c}=this.constraints[a];l.set(we(d,c,i[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Z0.set(this.visualElement,this);const t=this.visualElement.current,n=rr(t,"pointerdown",c=>{const{drag:u,dragListener:h=!0}=this.getProps(),m=c.target,p=m!==t&&Lx(m);u&&h&&!p&&this.start(c)});let r;const i=()=>{const{dragConstraints:c}=this.getProps();Tn(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=Q0(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,a=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ye.read(i);const l=ur(window,"resize",()=>this.scalePositionWithinConstraints()),d=s.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ct(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=c[h].translate,m.set(m.get()+c[h].translate))}),this.visualElement.render())}));return()=>{l(),n(),a(),d&&d(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:a=Po,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:a,dragMomentum:l}}}function Vl(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Q0(e,t,n){const r=Ka(e,Vl(n)),i=Ka(t,Vl(n));return()=>{r(),i()}}function Ar(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ey(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class ty extends Yt{constructor(t){super(t),this.removeGroupControls=ft,this.removeListeners=ft,this.controls=new J0(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ft}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Wi=e=>(t,n)=>{e&&ye.update(()=>e(t,n),!1,!0)};class ny extends Yt{constructor(){super(...arguments),this.removePointerDownListener=ft}onPointerDown(t){this.session=new uf(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:cf(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Wi(t),onStart:Wi(n),onMove:Wi(r),onEnd:(s,a)=>{delete this.session,i&&ye.postRender(()=>i(s,a))}}}mount(){this.removePointerDownListener=rr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Hi=!1;class ry extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),Hi&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),$r.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,{projection:a}=r;return a&&(a.isPresent=s,t.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),Hi=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?a.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?a.promote():a.relegate()||ye.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Fs.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;Hi=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function ff(e){const[t,n]=Qd(),r=k.useContext(us);return o.jsx(ry,{...e,layoutGroup:r,switchLayoutGroup:k.useContext(af),isPresent:t,safeToRemove:n})}const iy={pan:{Feature:ny},drag:{Feature:ty,ProjectionNode:Jd,MeasureLayout:ff}};function Wl(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&ye.postRender(()=>s(t,gr(t)))}class oy extends Yt{mount(){const{current:t}=this.node;t&&(this.unmount=Bx(t,(n,r)=>(Wl(this.node,r,"Start"),i=>Wl(this.node,i,"End"))))}unmount(){}}class sy extends Yt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=pr(ur(this.node.current,"focus",()=>this.onFocus()),ur(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Hl(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&ye.postRender(()=>s(t,gr(t)))}class ay extends Yt{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=Dx(t,(i,s)=>(Hl(this.node,s,"Start"),(a,{success:l})=>Hl(this.node,a,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Oo=new WeakMap,Ui=new WeakMap,ly=e=>{const t=Oo.get(e.target);t&&t(e)},cy=e=>{e.forEach(ly)};function uy({root:e,...t}){const n=e||document;Ui.has(n)||Ui.set(n,{});const r=Ui.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(cy,{root:e,...t})),r[i]}function dy(e,t,n){const r=uy(t);return Oo.set(e,n),r.observe(e),()=>{Oo.delete(e),r.unobserve(e)}}const fy={some:0,all:1};class hy extends Yt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var d;(d=this.stopObserver)==null||d.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:fy[i]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:h,onViewportLeave:m}=this.node.getProps(),p=u?h:m;p&&p(c)};this.stopObserver=dy(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(py(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function py({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const my={inView:{Feature:hy},tap:{Feature:ay},focus:{Feature:sy},hover:{Feature:oy}},xy={layout:{ProjectionNode:Jd,MeasureLayout:ff}},gy={...N0,...my,...iy,...xy},st=M0(gy,P0);function At({label:e,children:t,placement:n="top",...r}){const[i,s]=k.useState(!1),a=k.useRef(null),l=k.useMemo(()=>typeof window>"u"?!1:window.matchMedia("(pointer: coarse)").matches,[]);k.useEffect(()=>{if(!l||!i)return;const c=u=>{a.current&&!a.current.contains(u.target)&&s(!1)};return document.addEventListener("mousedown",c),document.addEventListener("touchstart",c,{passive:!0}),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("touchstart",c)}},[l,i]);const d=c=>{l&&(c.preventDefault(),c.stopPropagation(),s(u=>!u))};return o.jsxs(f.Tooltip.Root,{positioning:{placement:n},open:l?i:void 0,onOpenChange:l?c=>s(c.open):void 0,...r,children:[o.jsx(f.Tooltip.Trigger,{asChild:!0,children:o.jsx("span",{ref:a,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:d,children:t})}),o.jsx(f.Tooltip.Positioner,{children:o.jsx(f.Tooltip.Content,{bg:"gray.900",color:"white",borderRadius:"md",px:"3",py:"1.5",fontSize:"xs",fontFamily:"var(--font-body)",border:"1px solid",borderColor:"gray.700",boxShadow:"none",children:e})})]})}const yy={BASE_URL:"/",DEV:!1,MODE:"production",PACKAGE_VERSION:"0.1.25",PROD:!0,SSR:!1,VITE_STORYBOOK_URL:"https://medixdeck-ui.vercel.app",VITE_WHATSAPP_COMMUNITY_LINK:"https://medixdeck.com/whatsapp"},by={blue:{solid:"#0685FF",hoverBgLight:"rgba(6,133,255,0.08)",hoverBgDark:"rgba(6,133,255,0.12)",activeBgLight:"rgba(6,133,255,0.10)",activeBgDark:"rgba(6,133,255,0.15)",activeBgDarkStrong:"rgba(6,133,255,0.18)",chakraToken:"blue.500"},purple:{solid:"#7700CC",hoverBgLight:"rgba(119,0,204,0.08)",hoverBgDark:"rgba(119,0,204,0.12)",activeBgLight:"rgba(119,0,204,0.10)",activeBgDark:"rgba(119,0,204,0.15)",activeBgDarkStrong:"rgba(119,0,204,0.18)",chakraToken:"purple.500"}},Bt="#EF4444",zo="rgba(239,68,68,0.08)",hf=()=>o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),o.jsx("path",{d:"M9 3v18"}),o.jsx("path",{d:"m14 9-3 3 3 3"})]}),pf=()=>o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),o.jsx("path",{d:"M9 3v18"}),o.jsx("path",{d:"m12 15 3-3-3-3"})]}),vy=()=>o.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),o.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),o.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]}),ky=()=>o.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),mf=({open:e})=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"transform 0.2s ease",transform:e?"rotate(180deg)":"rotate(0deg)"},children:o.jsx("polyline",{points:"6 9 12 15 18 9"})}),_o=()=>o.jsxs("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4"}),o.jsx("polyline",{points:"16 17 21 12 16 7"}),o.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}),wy=()=>o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),o.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),Sy=()=>o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"3"}),o.jsx("path",{d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"})]}),Cy=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"4"}),o.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"4"}),o.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"22"}),o.jsx("line",{x1:"4.93",y1:"4.93",x2:"6.34",y2:"6.34"}),o.jsx("line",{x1:"17.66",y1:"17.66",x2:"19.07",y2:"19.07"}),o.jsx("line",{x1:"2",y1:"12",x2:"4",y2:"12"}),o.jsx("line",{x1:"20",y1:"12",x2:"22",y2:"12"}),o.jsx("line",{x1:"4.93",y1:"19.07",x2:"6.34",y2:"17.66"}),o.jsx("line",{x1:"17.66",y1:"6.34",x2:"19.07",y2:"4.93"})]}),jy=()=>o.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),Ty=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"12",rx:"2"}),o.jsx("line",{x1:"8",y1:"20",x2:"16",y2:"20"}),o.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"20"})]}),By=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M10 2v7.31a2 2 0 0 1-.37 1.17L4.22 18A3 3 0 0 0 6.78 22h10.44a3 3 0 0 0 2.56-4l-5.41-7.52A2 2 0 0 1 14 9.31V2"}),o.jsx("line",{x1:"8.5",y1:"2",x2:"15.5",y2:"2"}),o.jsx("path",{d:"M8.5 14h7"})]}),Ey=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),o.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),o.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),Fy=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),o.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),o.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),Ay=()=>o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),Ly=(e,t)=>o.jsx("a",{href:e.href,style:{textDecoration:"none",display:"block"},children:t});function Iy(){const e=new Date().getHours();return e<12?"Good morning":e<17?"Good afternoon":"Good evening"}const Ul={warning:{bg:"#FFFBEB",border:"#FDE68A",text:"#92400E",darkBg:"rgba(245,158,11,0.12)",darkBorder:"rgba(245,158,11,0.25)",darkText:"#FDE68A",badgeBg:"#F59E0B",badgeColor:"#FFFFFF"},info:{bg:"#EFF6FF",border:"#BFDBFE",text:"#1E40AF",darkBg:"rgba(6,133,255,0.12)",darkBorder:"rgba(6,133,255,0.25)",darkText:"#93C5FD",badgeBg:"#0685FF",badgeColor:"#FFFFFF"},error:{bg:"#FEF2F2",border:"#FECACA",text:"#991B1B",darkBg:"rgba(239,68,68,0.12)",darkBorder:"rgba(239,68,68,0.25)",darkText:"#FCA5A5",badgeBg:"#EF4444",badgeColor:"#FFFFFF"},neutral:{bg:"bg.surface",border:"var(--chakra-colors-border)",text:"text.body",darkBg:"bg.surface",darkBorder:"var(--chakra-colors-border)",darkText:"text.heading",badgeBg:"#6B7280",badgeColor:"#FFFFFF"}};function Dy(e){if(e&&e!=="auto")return{isNonProduction:e!=="production"&&e!=="live",detectedEnv:e};try{if(typeof process<"u"&&process&&process.env){const t=process.env.NODE_ENV,n=process.env.VERCEL_ENV||process.env.NEXT_PUBLIC_VERCEL_ENV,r=process.env.MEDIX_ENV||process.env.NEXT_PUBLIC_MEDIX_ENV||process.env.PUBLIC_MEDIX_ENV,i=process.env.CONTEXT;if(r){const s=String(r).toLowerCase();if(s==="sandbox")return{isNonProduction:!0,detectedEnv:"sandbox"};if(s==="staging")return{isNonProduction:!0,detectedEnv:"staging"};if(s==="test")return{isNonProduction:!0,detectedEnv:"test"};if(s==="dev"||s==="development")return{isNonProduction:!0,detectedEnv:"development"};if(s==="production"||s==="live")return{isNonProduction:!1,detectedEnv:"production"}}if(n==="preview")return{isNonProduction:!0,detectedEnv:"preview"};if(n==="development")return{isNonProduction:!0,detectedEnv:"development"};if(i==="deploy-preview"||i==="branch-deploy")return{isNonProduction:!0,detectedEnv:"preview"};if(t==="development")return{isNonProduction:!0,detectedEnv:"development"};if(t==="test")return{isNonProduction:!0,detectedEnv:"test"}}}catch{}try{if(typeof{url:typeof document>"u"?require("url").pathToFileURL(__filename).href:yn&&yn.tagName.toUpperCase()==="SCRIPT"&&yn.src||new URL("index.cjs",document.baseURI).href}<"u"&&{url:typeof document>"u"?require("url").pathToFileURL(__filename).href:yn&&yn.tagName.toUpperCase()==="SCRIPT"&&yn.src||new URL("index.cjs",document.baseURI).href}&&yy){const t="production"}}catch{}if(typeof window<"u"&&window.location&&window.location.hostname){const t=window.location.hostname.toLowerCase();if(t==="localhost"||t==="127.0.0.1"||t==="[::1]"||t==="0.0.0.0"||t.endsWith(".local")||t.endsWith(".test")||t.endsWith(".internal")||t.includes(".ngrok")||t.includes(".loca.lt"))return{isNonProduction:!0,detectedEnv:"development"};if(t.endsWith(".vercel.app")||t.endsWith(".netlify.app")||t.endsWith(".pages.dev")||t.endsWith(".amplifyapp.com")||t.endsWith(".onrender.com")||t.endsWith(".fly.dev")||t.endsWith(".azurestaticapps.net"))return{isNonProduction:!0,detectedEnv:"preview"};if(t.startsWith("sandbox.")||t.includes("-sandbox."))return{isNonProduction:!0,detectedEnv:"sandbox"};if(t.startsWith("staging.")||t.startsWith("stage.")||t.includes("-staging."))return{isNonProduction:!0,detectedEnv:"staging"};if(t.startsWith("test.")||t.startsWith("test-")||t.startsWith("qa.")||t.includes("-test."))return{isNonProduction:!0,detectedEnv:"test"};if(t.startsWith("dev.")||t.includes("-dev."))return{isNonProduction:!0,detectedEnv:"development"}}return{isNonProduction:!1,detectedEnv:"production"}}function Ry(e){switch(e){case"sandbox":return"SANDBOX ENVIRONMENT";case"staging":return"STAGING ENVIRONMENT";case"test":return"TEST ENVIRONMENT";case"preview":return"PREVIEW DEPLOYMENT";case"development":return"DEVELOPMENT MODE";default:return"NON-PRODUCTION ENVIRONMENT"}}function My({detectedEnv:e,config:t,onDismiss:n}){const r=t.status??(e==="staging"||e==="preview"?"info":e==="test"?"error":"warning"),i=Ul[r]??Ul.warning,s=t.badgeLabel??Ry(e),a=t.message??"You are in a non-production test/sandbox environment. Simulated patient records, transactions, and actions will not affect live data.",l=r==="info"?o.jsx(Ey,{}):r==="error"?o.jsx(Fy,{}):o.jsx(By,{});return o.jsxs(f.Box,{as:"aside",role:"status","aria-live":"polite","aria-label":`${s}: ${a}`,position:"sticky",top:"0",zIndex:"banner",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"3",px:{base:"3",md:"5"},py:"2",minH:"36px",borderBottom:"1px solid",borderColor:i.border,bg:i.bg,color:i.text,_dark:{bg:i.darkBg,borderColor:i.darkBorder,color:i.darkText},transition:"background 0.2s ease, border-color 0.2s ease",children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2.5",minW:"0",flex:"1",children:[o.jsx(f.Box,{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:i.badgeBg,children:l}),o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",px:"2",py:"0.5",borderRadius:"full",fontSize:"10px",fontWeight:"700",letterSpacing:"0.06em",textTransform:"uppercase",fontFamily:"var(--font-body)",lineHeight:"1",flexShrink:0,style:{background:i.badgeBg,color:i.badgeColor},children:s}),o.jsx(f.Box,{as:"span",fontSize:"xs",fontWeight:"500",fontFamily:"var(--font-body)",lineHeight:"1.4",color:"inherit",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},display:{base:"none",sm:"inline-block"},children:a})]}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2.5",flexShrink:0,children:[t.action,t.dismissible&&o.jsx(f.Box,{as:"button",type:"button",onClick:n,"aria-label":"Dismiss environment banner",display:"inline-flex",alignItems:"center",justifyContent:"center",w:"6",h:"6",borderRadius:"md",border:"none",bg:"transparent",color:"inherit",cursor:"pointer",opacity:.8,_hover:{opacity:1,bg:"blackAlpha.100"},_dark:{_hover:{bg:"whiteAlpha.100"}},_focusVisible:{outline:"2px solid",outlineColor:i.badgeBg,outlineOffset:"1px"},transition:"background 0.15s ease, opacity 0.15s ease",children:o.jsx(Ay,{})})]})]})}const Lr=[{value:"light",label:"Light mode",shortLabel:"Light",icon:o.jsx(Cy,{})},{value:"dark",label:"Dark mode",shortLabel:"Dark",icon:o.jsx(jy,{})},{value:"system",label:"System theme",shortLabel:"System",icon:o.jsx(Ty,{})}];function Py({scheme:e}){const{mounted:t,themeMode:n,themeSetting:r,setThemeMode:i}=hr(),[s,a]=k.useState(!1),l=k.useRef(null),d=t?r:void 0,c=Lr.find(m=>m.value===d)||Lr[0];k.useEffect(()=>{const m=p=>{l.current&&!l.current.contains(p.target)&&a(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);const u=o.jsx(f.Box,{display:{base:"none",md:"flex"},alignItems:"center",gap:"1",bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"full",p:"1","aria-label":"Theme mode switcher",children:Lr.map(m=>{const p=d===m.value,x=m.value==="dark"?e.activeBgDarkStrong:m.value==="system"?e.hoverBgDark:e.hoverBgLight;return o.jsxs(f.Box,{as:"button",onClick:()=>{t&&i(m.value)},"aria-pressed":p,"aria-label":m.label,title:t&&m.value==="system"?`System theme (currently ${n})`:m.label,display:"inline-flex",alignItems:"center",gap:"2",h:"9",px:"3",borderRadius:"full",border:"none",bg:p?x:"transparent",color:p?e.chakraToken:"text.muted",opacity:t?1:.6,cursor:t?"pointer":"default",transition:"background 0.18s ease, color 0.18s ease, opacity 0.18s ease",_hover:t?{bg:p?x:"bg",color:"text.heading"}:void 0,_focusVisible:{outline:"2px solid",outlineColor:e.chakraToken,outlineOffset:"2px"},children:[o.jsx(f.Box,{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,children:m.icon}),o.jsx(f.Box,{as:"span",fontSize:"xs",fontWeight:p?"700":"600",fontFamily:"var(--font-body)",whiteSpace:"nowrap",children:m.shortLabel})]},m.value)})}),h=o.jsxs(f.Box,{display:{base:"block",md:"none"},position:"relative",ref:l,children:[o.jsx(f.Box,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",w:"10",h:"10",borderRadius:"full",bg:"bg.surface",border:"1px solid",borderColor:"border",color:e.chakraToken,cursor:t?"pointer":"default",opacity:t?1:.6,_hover:t?{bg:"bg"}:void 0,onClick:()=>{t&&a(m=>!m)},"aria-label":"Theme mode switcher","aria-expanded":s,"aria-haspopup":"menu",children:c.icon}),s&&t&&o.jsx(f.Box,{role:"menu",position:"absolute",top:"calc(100% + 8px)",right:"0",minW:"150px",bg:"bg",border:"1px solid",borderColor:"border",borderRadius:"xl",boxShadow:"none",zIndex:"popover",overflow:"hidden",py:"1",children:Lr.map(m=>{const p=d===m.value;return o.jsxs(f.Box,{as:"button",role:"menuitem",display:"flex",alignItems:"center",gap:"2.5",w:"full",px:"4",py:"2.5",border:"none",bg:p?e.hoverBgLight:"transparent",color:p?e.chakraToken:"text.body",cursor:"pointer",textAlign:"left",onClick:()=>{i(m.value),a(!1)},_hover:{bg:e.hoverBgLight,color:e.chakraToken},_dark:{bg:p?e.hoverBgDark:"transparent",_hover:{bg:e.hoverBgDark}},children:[o.jsx(f.Box,{flexShrink:0,children:m.icon}),o.jsx(f.Box,{as:"span",fontSize:"sm",fontWeight:p?"600":"500",fontFamily:"var(--font-body)",children:m.label})]},m.value)})})]});return o.jsxs(o.Fragment,{children:[u,h]})}function No({item:e,renderLink:t,onClick:n,scheme:r,isCollapsed:i=!1,isSubItem:s=!1}){var B;const[a,l]=k.useState(!1),[d,c]=k.useState(!1),[u,h]=k.useState(!1),m=k.useRef(null),p=e.isActive??!1,x=((B=e.subItems)==null?void 0:B.some(C=>C.isActive))??!1,[g,v]=k.useState(p||x),y=!!(e.subItems&&e.subItems.length>0),j=k.useId();k.useEffect(()=>{v(p||x)},[p,x]),k.useEffect(()=>{if(!u)return;const C=E=>{m.current&&!m.current.contains(E.target)&&h(!1)},O=E=>{E.key==="Escape"&&h(!1)};return document.addEventListener("mousedown",C),document.addEventListener("keydown",O),()=>{document.removeEventListener("mousedown",C),document.removeEventListener("keydown",O)}},[u]);const w=p;if(i){if(y){const O=o.jsxs(f.Box,{as:"button","aria-label":e.label,"aria-haspopup":"menu","aria-expanded":u,onClick:()=>h(E=>!E),onFocus:E=>c(E.currentTarget.matches(":focus-visible")),onBlur:()=>c(!1),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),display:"flex",alignItems:"center",justifyContent:"center",w:"10",h:"10",mx:"auto",borderRadius:"lg",border:"none",cursor:"pointer",position:"relative",style:{background:p||x?r.activeBgLight:a||u?r.hoverBgLight:"transparent",outline:d?`2px solid ${r.solid}`:void 0,outlineOffset:d?"2px":void 0,transition:"background 0.15s ease"},_dark:{bg:p||x?r.activeBgDark:a||u?r.hoverBgDark:"transparent"},children:[e.icon&&o.jsx(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",style:{color:p||x?r.solid:void 0,opacity:p||x?1:a||u?.85:.6},color:p||x?r.chakraToken:"text.body",children:e.icon}),x&&o.jsx(f.Box,{as:"span",position:"absolute",top:"2px",right:"2px",w:"6px",h:"6px",borderRadius:"full",style:{background:r.solid},"aria-hidden":"true"})]});return o.jsxs(f.Box,{position:"relative",ref:m,my:"0.5",display:"flex",justifyContent:"center",style:{zIndex:u?100:1},children:[u?O:o.jsx(At,{label:e.label,placement:"right",children:O}),u&&o.jsx(st.div,{initial:{opacity:0,x:-6,scale:.98},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:-4,scale:.98},transition:{duration:.16,ease:[0,0,.2,1]},style:{position:"absolute",left:"calc(100% + 8px)",top:0,zIndex:1500},children:o.jsxs(f.Box,{role:"menu","aria-label":e.label,bg:"bg",border:"1px solid",borderColor:"border",borderRadius:"card",boxShadow:"none",py:"1.5",minW:"200px",maxW:"260px",children:[o.jsxs(f.Box,{px:"3.5",py:"1.5",fontSize:"xs",fontWeight:"700",color:"text.muted",fontFamily:"var(--font-heading)",borderBottom:"1px solid",borderColor:"border",mb:"1",display:"flex",alignItems:"center",gap:"2",children:[e.icon&&o.jsx(f.Box,{display:"inline-flex",alignItems:"center",justifyContent:"center",color:r.chakraToken,children:e.icon}),o.jsx(f.Box,{as:"span",children:e.label}),e.isNew&&o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",justifyContent:"center",px:"1.5",py:"0.5",borderRadius:"full",fontSize:"10px",fontWeight:"700",letterSpacing:"0.04em",lineHeight:"1",textTransform:"uppercase",fontFamily:"var(--font-heading)",flexShrink:0,style:{background:r.solid,color:"#fff"},children:"NEW"})]}),o.jsx(f.Box,{display:"flex",flexDirection:"column",gap:"0.5",px:"1",children:e.subItems.map(E=>o.jsx(No,{item:E,renderLink:t,onClick:()=>{h(!1),n==null||n()},scheme:r,isCollapsed:!1,isSubItem:!0},E.href))})]})})]})}const C=o.jsx(f.Box,{display:"flex",justifyContent:"center",alignItems:"center",w:"full",children:o.jsx(At,{label:e.isNew?`${e.label} (NEW)`:e.label,placement:"right",children:o.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",w:"10",h:"10",mx:"auto",my:"0.5",borderRadius:"lg",position:"relative","aria-label":e.label,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onClick:n,style:{background:p?r.activeBgLight:a?r.hoverBgLight:"transparent",outline:d?`2px solid ${r.solid}`:void 0,outlineOffset:d?"2px":void 0,transition:"background 0.15s ease"},_dark:{bg:p?r.activeBgDark:a?r.hoverBgDark:"transparent"},children:[e.icon&&o.jsx(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",style:{color:w?r.solid:void 0,opacity:w?1:a?.85:.6},color:w?r.chakraToken:"text.body",children:e.icon}),typeof e.badge=="number"&&o.jsx(f.Box,{as:"span",position:"absolute",top:"-2px",right:"-2px",minW:"16px",h:"16px",px:"1",borderRadius:"full",fontSize:"9px",fontWeight:"700",lineHeight:"1",display:"inline-flex",alignItems:"center",justifyContent:"center",style:{background:r.solid,color:"#fff"},children:e.badge>99?"99+":e.badge}),e.hasDot&&o.jsx(f.Box,{as:"span",position:"absolute",top:"2px",right:"2px",w:"6px",h:"6px",borderRadius:"full",style:{background:Bt},"aria-label":"New notification"}),e.isNew&&typeof e.badge!="number"&&!e.hasDot&&o.jsx(f.Box,{as:"span",position:"absolute",top:"2px",right:"2px",w:"6px",h:"6px",borderRadius:"full",style:{background:r.solid},"aria-label":"New feature"})]})})});return t(e,C)}const A=o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:s?"2.5":"3",px:s?"2":"3",py:s?"2":"2.5",borderRadius:"lg",borderLeftRadius:y?"lg":"none",borderTopLeftRadius:y?"lg":"none",borderBottomLeftRadius:y?"lg":"none",position:"relative",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onClick:y?void 0:n,style:{background:p?r.activeBgLight:a?r.hoverBgLight:"transparent",boxShadow:p&&!y?`inset 3px 0 0 ${r.solid}`:void 0,outline:d?`2px solid ${r.solid}`:void 0,outlineOffset:d?"2px":void 0,transition:"background 0.15s ease, box-shadow 0.15s ease"},_dark:{bg:p?r.activeBgDark:a?r.hoverBgDark:"transparent"},children:[e.icon&&o.jsx(f.Box,{flexShrink:0,style:{color:w?r.solid:void 0,opacity:w?1:a?.85:.6,transition:"color 0.15s ease, opacity 0.15s ease"},color:w?r.chakraToken:"text.body",children:e.icon}),o.jsx(f.Box,{as:"span",flex:"1",minW:"0",fontSize:"sm",fontWeight:w?"600":"500",fontFamily:"var(--font-body)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",style:{color:w?r.solid:void 0,transition:"color 0.15s ease"},color:w?r.chakraToken:"text.body",children:e.label}),typeof e.badge=="number"&&!y&&o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",justifyContent:"center",minW:"20px",h:"20px",px:"1",borderRadius:"full",fontSize:"xs",fontWeight:"700",lineHeight:"1",style:{background:r.solid,color:"#fff"},children:e.badge}),e.hasDot&&!y&&o.jsx(f.Box,{as:"span",display:"inline-block",w:"7px",h:"7px",borderRadius:"full",flexShrink:0,style:{background:Bt},"aria-label":"New notification"}),e.isNew&&o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",justifyContent:"center",px:"1.5",py:"0.5",borderRadius:"full",fontSize:"10px",fontWeight:"700",letterSpacing:"0.04em",lineHeight:"1",textTransform:"uppercase",fontFamily:"var(--font-heading)",flexShrink:0,style:{background:r.solid,color:"#fff"},children:"NEW"}),y&&o.jsx(f.Box,{flexShrink:0,color:"text.muted",children:o.jsx(mf,{open:g})})]});return o.jsxs(o.Fragment,{children:[y?o.jsx("button",{type:"button","aria-expanded":g,"aria-controls":j,onClick:()=>v(C=>!C),onFocus:C=>{c(C.currentTarget.matches(":focus-visible"))},onBlur:()=>c(!1),style:{display:"block",width:"100%",background:"none",border:"none",padding:0,cursor:"pointer",textAlign:"left"},children:A}):t(e,A),y&&o.jsx(st.div,{id:j,initial:!1,animate:g?{height:"auto",opacity:1}:{height:0,opacity:0},transition:{duration:.2,ease:[0,0,.2,1]},style:{overflow:"hidden"},"aria-hidden":!g,children:o.jsx(f.Box,{display:"flex",flexDirection:"column",gap:"0.5",pl:"3",mt:"0.5",mb:"1",children:e.subItems.map(C=>o.jsx(No,{item:C,renderLink:t,onClick:n,scheme:r,isCollapsed:!1,isSubItem:!0},C.href))})})]})}let $l=!1;function Oy(){if(typeof document>"u"||$l)return;const e=document.createElement("style");e.setAttribute("data-medixdeck","mobile-nav"),e.textContent=`
|
|
352
352
|
@keyframes medixMobileNavIn {
|
|
353
353
|
from { transform: translateY(100%); opacity: 0; }
|
|
354
354
|
to { transform: translateY(0); opacity: 1; }
|