@medixdeck/ui 0.1.25 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),k=require("react"),f=require("@chakra-ui/react"),ha=require("@tiptap/react"),jh=require("@tiptap/starter-kit"),Th=require("@tiptap/extension-link"),Bh=require("@tiptap/extension-underline"),Eh=require("@tiptap/extension-text-align"),Fh=require("@tiptap/extension-placeholder");var yn=typeof document<"u"?document.currentScript:null;function Ah(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const je=Ah(k);var Lh=(e,t,n,r,i,s,a,l)=>{let d=document.documentElement,c=["light","dark"];function u(p){(Array.isArray(e)?e:[e]).forEach(x=>{let g=x==="class",v=g&&s?i.map(y=>s[y]||y):i;g?(d.classList.remove(...v),d.classList.add(s&&s[p]?s[p]:p)):d.setAttribute(x,p)}),h(p)}function h(p){l&&c.includes(p)&&(d.style.colorScheme=p)}function m(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)u(r);else try{let p=localStorage.getItem(t)||n,x=a&&p==="system"?m():p;u(x)}catch{}},pa=["light","dark"],Zc="(prefers-color-scheme: dark)",Ih=typeof window>"u",ns=je.createContext(void 0),Dh={setTheme:e=>{},themes:[]},Rh=()=>{var e;return(e=je.useContext(ns))!=null?e:Dh},Mh=e=>je.useContext(ns)?je.createElement(je.Fragment,null,e.children):je.createElement(Oh,{...e}),Ph=["light","dark"],Oh=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i="theme",themes:s=Ph,defaultTheme:a=n?"system":"light",attribute:l="data-theme",value:d,children:c,nonce:u,scriptProps:h})=>{let[m,p]=je.useState(()=>_h(i,a)),[x,g]=je.useState(()=>m==="system"?Ti():m),v=d?Object.values(d):s,y=je.useCallback(B=>{let C=B;if(!C)return;B==="system"&&n&&(C=Ti());let O=d?d[C]:C,E=t?Nh(u):null,F=document.documentElement,L=R=>{R==="class"?(F.classList.remove(...v),O&&F.classList.add(O)):R.startsWith("data-")&&(O?F.setAttribute(R,O):F.removeAttribute(R))};if(Array.isArray(l)?l.forEach(L):L(l),r){let R=pa.includes(a)?a:null,D=pa.includes(C)?C:R;F.style.colorScheme=D}E==null||E()},[u]),j=je.useCallback(B=>{let C=typeof B=="function"?B(m):B;p(C);try{localStorage.setItem(i,C)}catch{}},[m]),w=je.useCallback(B=>{let C=Ti(B);g(C),m==="system"&&n&&!e&&y("system")},[m,e]);je.useEffect(()=>{let B=window.matchMedia(Zc);return B.addListener(w),w(B),()=>B.removeListener(w)},[w]),je.useEffect(()=>{let B=C=>{C.key===i&&(C.newValue?p(C.newValue):j(a))};return window.addEventListener("storage",B),()=>window.removeEventListener("storage",B)},[j]),je.useEffect(()=>{y(e??m)},[e,m]);let A=je.useMemo(()=>({theme:m,setTheme:j,forcedTheme:e,resolvedTheme:m==="system"?x:m,themes:n?[...s,"system"]:s,systemTheme:n?x:void 0}),[m,j,e,x,n,s]);return je.createElement(ns.Provider,{value:A},je.createElement(zh,{forcedTheme:e,storageKey:i,attribute:l,enableSystem:n,enableColorScheme:r,defaultTheme:a,value:d,themes:s,nonce:u,scriptProps:h}),c)},zh=je.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:s,value:a,themes:l,nonce:d,scriptProps:c})=>{let u=JSON.stringify([n,t,s,e,l,a,r,i]).slice(1,-1);return je.createElement("script",{...c,suppressHydrationWarning:!0,nonce:typeof window>"u"?d:"",dangerouslySetInnerHTML:{__html:`(${Lh.toString()})(${u})`}})}),_h=(e,t)=>{if(Ih)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},Nh=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},Ti=e=>(e||(e=window.matchMedia(Zc)),e.matches?"dark":"light");const V={blue:{50:{value:"#E8F3FF"},100:{value:"#D6EEFF"},200:{value:"#A8D4FF"},300:{value:"#70B6FF"},400:{value:"#3D98FF"},500:{value:"#0685FF"},600:{value:"#0066CC"},700:{value:"#004D99"},800:{value:"#003366"},900:{value:"#001A33"},gradient:{value:"#1A8FFF"}},purple:{50:{value:"#F9F0FF"},100:{value:"#EDD6FF"},200:{value:"#D9AAFF"},300:{value:"#BB77FF"},400:{value:"#9933FF"},500:{value:"#7700CC"},600:{value:"#5C00A3"},700:{value:"#44007A"},800:{value:"#2D0052"},900:{value:"#160029"}},neutralLight:{bg:{value:"#FEFEFE"},bg2:{value:"#F6F6F6"},surface:{value:"#F6F6F6"},white:{value:"#FFFFFF"},border:{value:"#E4E8F0"},muted:{value:"#9AAAB8"},heading:{value:"#111926"},body:{value:"#3D4F63"}},neutralDark:{bg:{value:"#0A1220"},bg2:{value:"#182337"},surface:{value:"#152035"},black:{value:"#000000"},border:{value:"#1E3050"},muted:{value:"#4A6480"},heading:{value:"#F0F6FF"},body:{value:"#ABC0D6"}},green:{50:{value:"#F0FDF4"},100:{value:"#DCFCE7"},500:{value:"#16A34A"},600:{value:"#166534"}},amber:{50:{value:"#FFFBEB"},100:{value:"#FEF3C7"},500:{value:"#D97706"},600:{value:"#B45309"}},red:{50:{value:"#FFF1F2"},100:{value:"#FFE4E6"},200:{value:"#FECDD3"},500:{value:"#DC2626"},600:{value:"#B91C1C"}}},Cn={fonts:{heading:{value:"'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"},body:{value:"'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"},mono:{value:"'JetBrains Mono', 'Fira Code', 'Fira Mono', monospace"}},fontSizes:{"2xs":{value:"clamp(0.5625rem, 0.5rem + 0.2vw, 0.625rem)"},xs:{value:"clamp(0.625rem, 0.5625rem + 0.25vw, 0.75rem)"},sm:{value:"clamp(0.6875rem, 0.625rem + 0.3vw, 0.8125rem)"},md:{value:"clamp(0.8125rem, 0.75rem + 0.35vw, 0.9375rem)"},lg:{value:"clamp(0.9375rem, 0.875rem + 0.4vw, 1.0625rem)"},xl:{value:"clamp(1rem, 0.9375rem + 0.5vw, 1.1875rem)"},"2xl":{value:"clamp(1.125rem, 1rem + 0.6vw, 1.4375rem)"},"3xl":{value:"clamp(1.25rem, 1.125rem + 0.75vw, 1.625rem)"},"4xl":{value:"clamp(1.5rem, 1.25rem + 1vw, 2rem)"},"5xl":{value:"clamp(1.75rem, 1.5rem + 1.5vw, 2.5rem)"},"6xl":{value:"clamp(2.25rem, 1.75rem + 2.5vw, 3.5rem)"}},fontWeights:{normal:{value:"400"},medium:{value:"500"},semibold:{value:"600"},bold:{value:"700"}},lineHeights:{none:{value:"1"},tight:{value:"1.1"},snug:{value:"1.2"},normal:{value:"1.3"},relaxed:{value:"1.4"},loose:{value:"1.6"}},letterSpacings:{tight:{value:"-0.01em"},normal:{value:"0em"},wide:{value:"0.05em"},wider:{value:"0.1em"}}},Jc={display:{value:{fontFamily:"var(--font-heading)",fontSize:"var(--font-size-6xl)",fontWeight:"var(--font-weight-bold)",lineHeight:"var(--line-height-tight)",letterSpacing:"var(--letter-spacing-tight)"}},h1:{value:{fontFamily:"var(--font-heading)",fontSize:"var(--font-size-5xl)",fontWeight:"var(--font-weight-semibold)",lineHeight:"var(--line-height-snug)",letterSpacing:"var(--letter-spacing-tight)"}},h2:{value:{fontFamily:"var(--font-heading)",fontSize:"var(--font-size-4xl)",fontWeight:"var(--font-weight-semibold)",lineHeight:"var(--line-height-normal)"}},h3:{value:{fontFamily:"var(--font-heading)",fontSize:"var(--font-size-2xl)",fontWeight:"var(--font-weight-medium)",lineHeight:"var(--line-height-relaxed)"}},body:{value:{fontFamily:"var(--font-body)",fontSize:"var(--font-size-md)",fontWeight:"var(--font-weight-normal)",lineHeight:"var(--line-height-loose)"}},small:{value:{fontFamily:"var(--font-body)",fontSize:"var(--font-size-sm)",fontWeight:"var(--font-weight-normal)",lineHeight:"var(--line-height-normal)"}},label:{value:{fontFamily:"var(--font-body)",fontSize:"var(--font-size-xs)",fontWeight:"var(--font-weight-medium)",letterSpacing:"var(--letter-spacing-wide)",textTransform:"uppercase"}},mono:{value:{fontFamily:"var(--font-mono)",fontSize:"var(--font-size-md)",fontWeight:"var(--font-weight-normal)"}}},Qc={0:{value:"0px"},1:{value:"4px"},2:{value:"8px"},3:{value:"12px"},4:{value:"16px"},6:{value:"24px"},8:{value:"32px"},12:{value:"48px"},16:{value:"64px"},20:{value:"80px"},24:{value:"96px"},32:{value:"128px"},40:{value:"160px"},48:{value:"192px"}},eu={none:{value:"0px"},badge:{value:"4px"},sm:{value:"4px"},md:{value:"8px"},card:{value:"12px"},lg:{value:"12px"},modal:{value:"16px"},xl:{value:"16px"},"2xl":{value:"20px"},"3xl":{value:"24px"},full:{value:"9999px"},circle:{value:"50%"}},tu={xs:{value:"0 1px 2px 0 rgba(0, 0, 0, 0.05)"},sm:{value:"0 1px 3px 0 rgba(0, 0, 0, 0.10), 0 1px 2px -1px rgba(0, 0, 0, 0.10)"},md:{value:"0 4px 6px -1px rgba(0, 0, 0, 0.10), 0 2px 4px -2px rgba(0, 0, 0, 0.10)"},lg:{value:"0 10px 15px -3px rgba(0, 0, 0, 0.10), 0 4px 6px -4px rgba(0, 0, 0, 0.10)"},xl:{value:"0 20px 25px -5px rgba(0, 0, 0, 0.10), 0 8px 10px -6px rgba(0, 0, 0, 0.10)"},"card-dark":{value:"none"},"card-light":{value:"none"},none:{value:"none"}},nu=f.defineConfig({globalCss:{"html, body":{fontFamily:"var(--font-body)"},"*":{boxSizing:"border-box"}},theme:{tokens:{colors:{brand:{blue:V.blue,purple:V.purple,green:V.green,amber:V.amber,red:V.red,neutralLight:V.neutralLight,neutralDark:V.neutralDark}},fonts:Cn.fonts,fontSizes:Cn.fontSizes,fontWeights:Cn.fontWeights,lineHeights:Cn.lineHeights,letterSpacings:Cn.letterSpacings,spacing:Qc,radii:eu,shadows:tu},semanticTokens:{colors:{"brand.solid":{value:{base:"{colors.brand.blue.500}",_dark:"{colors.brand.blue.500}"}},"brand.muted":{value:{base:"{colors.brand.blue.100}",_dark:"{colors.brand.blue.900}"}},"brand.contrast":{value:{base:"#FFFFFF",_dark:"#FFFFFF"}},bg:{value:{base:"{colors.brand.neutralLight.bg}",_dark:"{colors.brand.neutralDark.bg}"}},"bg.subtle":{value:{base:"{colors.brand.neutralLight.bg2}",_dark:"{colors.brand.neutralDark.bg2}"}},"bg.surface":{value:{base:"{colors.brand.neutralLight.surface}",_dark:"{colors.brand.neutralDark.surface}"}},"text.heading":{value:{base:"{colors.brand.neutralLight.heading}",_dark:"{colors.brand.neutralDark.heading}"}},"text.body":{value:{base:"{colors.brand.neutralLight.body}",_dark:"{colors.brand.neutralDark.body}"}},"text.muted":{value:{base:"{colors.brand.neutralLight.muted}",_dark:"{colors.brand.neutralDark.muted}"}},border:{value:{base:"{colors.brand.neutralLight.border}",_dark:"{colors.brand.neutralDark.border}"}},"status.success":{value:{base:"{colors.brand.green.500}",_dark:"{colors.brand.green.500}"}},"status.success.tint":{value:{base:"{colors.brand.green.100}",_dark:"rgba(27, 122, 56, 0.2)"}},"status.warning":{value:{base:"{colors.brand.amber.500}",_dark:"{colors.brand.amber.500}"}},"status.warning.tint":{value:{base:"{colors.brand.amber.100}",_dark:"rgba(217, 119, 6, 0.2)"}},"status.error":{value:{base:"{colors.brand.red.500}",_dark:"{colors.brand.red.500}"}},"status.error.tint":{value:{base:"{colors.brand.red.100}",_dark:"rgba(220, 38, 38, 0.2)"}},blue:{50:{value:{base:"{colors.brand.blue.50}"}},100:{value:{base:"{colors.brand.blue.100}"}},200:{value:{base:"{colors.brand.blue.200}"}},300:{value:{base:"{colors.brand.blue.300}"}},400:{value:{base:"{colors.brand.blue.400}"}},500:{value:{base:"{colors.brand.blue.500}"}},600:{value:{base:"{colors.brand.blue.600}"}},700:{value:{base:"{colors.brand.blue.700}"}},800:{value:{base:"{colors.brand.blue.800}"}},900:{value:{base:"{colors.brand.blue.900}"}},solid:{value:{base:"{colors.brand.blue.500}"}},contrast:{value:{base:"#FFFFFF"}},muted:{value:{base:"{colors.brand.blue.100}",_dark:"{colors.brand.blue.900}"}},subtle:{value:{base:"{colors.brand.blue.50}",_dark:"rgba(6, 133, 255, 0.1)"}},emphasized:{value:{base:"{colors.brand.blue.100}",_dark:"{colors.brand.blue.800}"}},fg:{value:{base:"{colors.brand.blue.700}",_dark:"{colors.brand.blue.300}"}},focusRing:{value:{base:"{colors.brand.blue.500}"}}},purple:{50:{value:{base:"{colors.brand.purple.50}"}},100:{value:{base:"{colors.brand.purple.100}"}},500:{value:{base:"{colors.brand.purple.500}"}},600:{value:{base:"{colors.brand.purple.600}"}},solid:{value:{base:"{colors.brand.purple.500}"}},contrast:{value:{base:"#FFFFFF"}},muted:{value:{base:"{colors.brand.purple.100}",_dark:"{colors.brand.purple.900}"}},subtle:{value:{base:"{colors.brand.purple.50}",_dark:"rgba(119, 0, 204, 0.1)"}},emphasized:{value:{base:"{colors.brand.purple.100}"}},fg:{value:{base:"{colors.brand.purple.700}",_dark:"{colors.brand.purple.300}"}},focusRing:{value:{base:"{colors.brand.purple.500}"}}}}},textStyles:Jc}}),ru=f.createSystem(f.defaultConfig,nu),Vh={info:{bg:"rgba(6, 133, 255, 0.08)",border:"rgba(6, 133, 255, 0.3)",color:"#0685FF",icon:"ℹ"},success:{bg:"rgba(27, 122, 56, 0.08)",border:"rgba(27, 122, 56, 0.3)",color:"#1B7A38",icon:"✓"},warning:{bg:"rgba(217, 119, 6, 0.08)",border:"rgba(217, 119, 6, 0.3)",color:"#D97706",icon:"⚠"},error:{bg:"rgba(220, 38, 38, 0.08)",border:"rgba(220, 38, 38, 0.3)",color:"#DC2626",icon:"✕"}},rs=k.forwardRef(({status:e="info",variant:t="subtle",title:n,description:r,icon:i,onClose:s,closable:a=!1,children:l,...d},c)=>{const u=Vh[e],h=t==="solid"?u.color:u.bg,m=t==="solid"?"white":"inherit",p=t==="left-accent"?`4px solid ${u.color}`:void 0,x=t==="subtle"?`1px solid ${u.border}`:void 0;return o.jsxs(f.Box,{ref:c,role:"alert",display:"flex",alignItems:"flex-start",gap:"3",p:"4",borderRadius:"md",bg:h,border:x,borderLeft:p,color:m,...d,children:[o.jsx(f.Box,{flexShrink:0,w:"5",h:"5",borderRadius:"full",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"xs",fontWeight:"bold",bg:t==="solid"?"rgba(255,255,255,0.2)":u.color,color:"white",mt:"0.5",children:i??u.icon}),o.jsxs(f.Box,{flex:"1",children:[n&&o.jsx(f.Box,{fontWeight:"semibold",fontSize:"sm",fontFamily:"var(--font-body)",color:t==="solid"?"white":u.color,children:n}),r&&o.jsx(f.Box,{mt:n?"0.5":"0",fontSize:"sm",fontFamily:"var(--font-body)",color:t==="solid"?"rgba(255,255,255,0.85)":"text.body",lineHeight:"1.5",children:r}),l]}),a&&o.jsx(f.Box,{as:"button",flexShrink:0,w:"6",h:"6",border:"none",bg:"transparent",cursor:"pointer",color:t==="solid"?"rgba(255,255,255,0.7)":"text.muted",fontSize:"lg",lineHeight:"1",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"sm",_hover:{color:t==="solid"?"white":"text.heading"},onClick:s,"aria-label":"Dismiss alert",children:"×"})]})});rs.displayName="MedixAlert";if(typeof document<"u"){const e="medix-toast-keyframes";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),k=require("react"),f=require("@chakra-ui/react"),pa=require("@tiptap/react"),Eh=require("@tiptap/starter-kit"),Fh=require("@tiptap/extension-link"),Ah=require("@tiptap/extension-underline"),Lh=require("@tiptap/extension-text-align"),Ih=require("@tiptap/extension-placeholder");var yn=typeof document<"u"?document.currentScript:null;function Dh(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const je=Dh(k);var Rh=(e,t,n,r,i,s,a,l)=>{let d=document.documentElement,c=["light","dark"];function u(p){(Array.isArray(e)?e:[e]).forEach(x=>{let g=x==="class",v=g&&s?i.map(y=>s[y]||y):i;g?(d.classList.remove(...v),d.classList.add(s&&s[p]?s[p]:p)):d.setAttribute(x,p)}),h(p)}function h(p){l&&c.includes(p)&&(d.style.colorScheme=p)}function m(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)u(r);else try{let p=localStorage.getItem(t)||n,x=a&&p==="system"?m():p;u(x)}catch{}},ma=["light","dark"],Jc="(prefers-color-scheme: dark)",Mh=typeof window>"u",rs=je.createContext(void 0),Ph={setTheme:e=>{},themes:[]},Oh=()=>{var e;return(e=je.useContext(rs))!=null?e:Ph},zh=e=>je.useContext(rs)?je.createElement(je.Fragment,null,e.children):je.createElement(Nh,{...e}),_h=["light","dark"],Nh=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i="theme",themes:s=_h,defaultTheme:a=n?"system":"light",attribute:l="data-theme",value:d,children:c,nonce:u,scriptProps:h})=>{let[m,p]=je.useState(()=>Wh(i,a)),[x,g]=je.useState(()=>m==="system"?Bi():m),v=d?Object.values(d):s,y=je.useCallback(B=>{let C=B;if(!C)return;B==="system"&&n&&(C=Bi());let O=d?d[C]:C,E=t?Hh(u):null,F=document.documentElement,L=R=>{R==="class"?(F.classList.remove(...v),O&&F.classList.add(O)):R.startsWith("data-")&&(O?F.setAttribute(R,O):F.removeAttribute(R))};if(Array.isArray(l)?l.forEach(L):L(l),r){let R=ma.includes(a)?a:null,D=ma.includes(C)?C:R;F.style.colorScheme=D}E==null||E()},[u]),j=je.useCallback(B=>{let C=typeof B=="function"?B(m):B;p(C);try{localStorage.setItem(i,C)}catch{}},[m]),w=je.useCallback(B=>{let C=Bi(B);g(C),m==="system"&&n&&!e&&y("system")},[m,e]);je.useEffect(()=>{let B=window.matchMedia(Jc);return B.addListener(w),w(B),()=>B.removeListener(w)},[w]),je.useEffect(()=>{let B=C=>{C.key===i&&(C.newValue?p(C.newValue):j(a))};return window.addEventListener("storage",B),()=>window.removeEventListener("storage",B)},[j]),je.useEffect(()=>{y(e??m)},[e,m]);let A=je.useMemo(()=>({theme:m,setTheme:j,forcedTheme:e,resolvedTheme:m==="system"?x:m,themes:n?[...s,"system"]:s,systemTheme:n?x:void 0}),[m,j,e,x,n,s]);return je.createElement(rs.Provider,{value:A},je.createElement(Vh,{forcedTheme:e,storageKey:i,attribute:l,enableSystem:n,enableColorScheme:r,defaultTheme:a,value:d,themes:s,nonce:u,scriptProps:h}),c)},Vh=je.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:s,value:a,themes:l,nonce:d,scriptProps:c})=>{let u=JSON.stringify([n,t,s,e,l,a,r,i]).slice(1,-1);return je.createElement("script",{...c,suppressHydrationWarning:!0,nonce:typeof window>"u"?d:"",dangerouslySetInnerHTML:{__html:`(${Rh.toString()})(${u})`}})}),Wh=(e,t)=>{if(Mh)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},Hh=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},Bi=e=>(e||(e=window.matchMedia(Jc)),e.matches?"dark":"light");const V={blue:{50:{value:"#E8F3FF"},100:{value:"#D6EEFF"},200:{value:"#A8D4FF"},300:{value:"#70B6FF"},400:{value:"#3D98FF"},500:{value:"#0685FF"},600:{value:"#0066CC"},700:{value:"#004D99"},800:{value:"#003366"},900:{value:"#001A33"},gradient:{value:"#1A8FFF"}},purple:{50:{value:"#F9F0FF"},100:{value:"#EDD6FF"},200:{value:"#D9AAFF"},300:{value:"#BB77FF"},400:{value:"#9933FF"},500:{value:"#7700CC"},600:{value:"#5C00A3"},700:{value:"#44007A"},800:{value:"#2D0052"},900:{value:"#160029"}},neutralLight:{bg:{value:"#FEFEFE"},bg2:{value:"#F6F6F6"},surface:{value:"#F6F6F6"},white:{value:"#FFFFFF"},border:{value:"#E4E8F0"},muted:{value:"#9AAAB8"},heading:{value:"#111926"},body:{value:"#3D4F63"}},neutralDark:{bg:{value:"#0A1220"},bg2:{value:"#182337"},surface:{value:"#152035"},black:{value:"#000000"},border:{value:"#1E3050"},muted:{value:"#4A6480"},heading:{value:"#F0F6FF"},body:{value:"#ABC0D6"}},green:{50:{value:"#F0FDF4"},100:{value:"#DCFCE7"},500:{value:"#16A34A"},600:{value:"#166534"}},amber:{50:{value:"#FFFBEB"},100:{value:"#FEF3C7"},500:{value:"#D97706"},600:{value:"#B45309"}},red:{50:{value:"#FFF1F2"},100:{value:"#FFE4E6"},200:{value:"#FECDD3"},500:{value:"#DC2626"},600:{value:"#B91C1C"}}},Cn={fonts:{heading:{value:"'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"},body:{value:"'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"},mono:{value:"'JetBrains Mono', 'Fira Code', 'Fira Mono', monospace"}},fontSizes:{"2xs":{value:"clamp(0.5625rem, 0.5rem + 0.2vw, 0.625rem)"},xs:{value:"clamp(0.625rem, 0.5625rem + 0.25vw, 0.75rem)"},sm:{value:"clamp(0.6875rem, 0.625rem + 0.3vw, 0.8125rem)"},md:{value:"clamp(0.8125rem, 0.75rem + 0.35vw, 0.9375rem)"},lg:{value:"clamp(0.9375rem, 0.875rem + 0.4vw, 1.0625rem)"},xl:{value:"clamp(1rem, 0.9375rem + 0.5vw, 1.1875rem)"},"2xl":{value:"clamp(1.125rem, 1rem + 0.6vw, 1.4375rem)"},"3xl":{value:"clamp(1.25rem, 1.125rem + 0.75vw, 1.625rem)"},"4xl":{value:"clamp(1.5rem, 1.25rem + 1vw, 2rem)"},"5xl":{value:"clamp(1.75rem, 1.5rem + 1.5vw, 2.5rem)"},"6xl":{value:"clamp(2.25rem, 1.75rem + 2.5vw, 3.5rem)"}},fontWeights:{normal:{value:"400"},medium:{value:"500"},semibold:{value:"600"},bold:{value:"700"}},lineHeights:{none:{value:"1"},tight:{value:"1.1"},snug:{value:"1.2"},normal:{value:"1.3"},relaxed:{value:"1.4"},loose:{value:"1.6"}},letterSpacings:{tight:{value:"-0.01em"},normal:{value:"0em"},wide:{value:"0.05em"},wider:{value:"0.1em"}}},Qc={display:{value:{fontFamily:"var(--font-heading)",fontSize:"var(--font-size-6xl)",fontWeight:"var(--font-weight-bold)",lineHeight:"var(--line-height-tight)",letterSpacing:"var(--letter-spacing-tight)"}},h1:{value:{fontFamily:"var(--font-heading)",fontSize:"var(--font-size-5xl)",fontWeight:"var(--font-weight-semibold)",lineHeight:"var(--line-height-snug)",letterSpacing:"var(--letter-spacing-tight)"}},h2:{value:{fontFamily:"var(--font-heading)",fontSize:"var(--font-size-4xl)",fontWeight:"var(--font-weight-semibold)",lineHeight:"var(--line-height-normal)"}},h3:{value:{fontFamily:"var(--font-heading)",fontSize:"var(--font-size-2xl)",fontWeight:"var(--font-weight-medium)",lineHeight:"var(--line-height-relaxed)"}},body:{value:{fontFamily:"var(--font-body)",fontSize:"var(--font-size-md)",fontWeight:"var(--font-weight-normal)",lineHeight:"var(--line-height-loose)"}},small:{value:{fontFamily:"var(--font-body)",fontSize:"var(--font-size-sm)",fontWeight:"var(--font-weight-normal)",lineHeight:"var(--line-height-normal)"}},label:{value:{fontFamily:"var(--font-body)",fontSize:"var(--font-size-xs)",fontWeight:"var(--font-weight-medium)",letterSpacing:"var(--letter-spacing-wide)",textTransform:"uppercase"}},mono:{value:{fontFamily:"var(--font-mono)",fontSize:"var(--font-size-md)",fontWeight:"var(--font-weight-normal)"}}},eu={0:{value:"0px"},1:{value:"4px"},2:{value:"8px"},3:{value:"12px"},4:{value:"16px"},6:{value:"24px"},8:{value:"32px"},12:{value:"48px"},16:{value:"64px"},20:{value:"80px"},24:{value:"96px"},32:{value:"128px"},40:{value:"160px"},48:{value:"192px"}},tu={none:{value:"0px"},badge:{value:"4px"},sm:{value:"4px"},md:{value:"8px"},card:{value:"12px"},lg:{value:"12px"},modal:{value:"16px"},xl:{value:"16px"},"2xl":{value:"20px"},"3xl":{value:"24px"},full:{value:"9999px"},circle:{value:"50%"}},nu={xs:{value:"0 1px 2px 0 rgba(0, 0, 0, 0.05)"},sm:{value:"0 1px 3px 0 rgba(0, 0, 0, 0.10), 0 1px 2px -1px rgba(0, 0, 0, 0.10)"},md:{value:"0 4px 6px -1px rgba(0, 0, 0, 0.10), 0 2px 4px -2px rgba(0, 0, 0, 0.10)"},lg:{value:"0 10px 15px -3px rgba(0, 0, 0, 0.10), 0 4px 6px -4px rgba(0, 0, 0, 0.10)"},xl:{value:"0 20px 25px -5px rgba(0, 0, 0, 0.10), 0 8px 10px -6px rgba(0, 0, 0, 0.10)"},"card-dark":{value:"none"},"card-light":{value:"none"},none:{value:"none"}},ru=f.defineConfig({globalCss:{"html, body":{fontFamily:"var(--font-body)"},"*":{boxSizing:"border-box"}},theme:{tokens:{colors:{brand:{blue:V.blue,purple:V.purple,green:V.green,amber:V.amber,red:V.red,neutralLight:V.neutralLight,neutralDark:V.neutralDark}},fonts:Cn.fonts,fontSizes:Cn.fontSizes,fontWeights:Cn.fontWeights,lineHeights:Cn.lineHeights,letterSpacings:Cn.letterSpacings,spacing:eu,radii:tu,shadows:nu},semanticTokens:{colors:{"brand.solid":{value:{base:"{colors.brand.blue.500}",_dark:"{colors.brand.blue.500}"}},"brand.muted":{value:{base:"{colors.brand.blue.100}",_dark:"{colors.brand.blue.900}"}},"brand.contrast":{value:{base:"#FFFFFF",_dark:"#FFFFFF"}},bg:{value:{base:"{colors.brand.neutralLight.bg}",_dark:"{colors.brand.neutralDark.bg}"}},"bg.subtle":{value:{base:"{colors.brand.neutralLight.bg2}",_dark:"{colors.brand.neutralDark.bg2}"}},"bg.surface":{value:{base:"{colors.brand.neutralLight.surface}",_dark:"{colors.brand.neutralDark.surface}"}},"text.heading":{value:{base:"{colors.brand.neutralLight.heading}",_dark:"{colors.brand.neutralDark.heading}"}},"text.body":{value:{base:"{colors.brand.neutralLight.body}",_dark:"{colors.brand.neutralDark.body}"}},"text.muted":{value:{base:"{colors.brand.neutralLight.muted}",_dark:"{colors.brand.neutralDark.muted}"}},border:{value:{base:"{colors.brand.neutralLight.border}",_dark:"{colors.brand.neutralDark.border}"}},"status.success":{value:{base:"{colors.brand.green.500}",_dark:"{colors.brand.green.500}"}},"status.success.tint":{value:{base:"{colors.brand.green.100}",_dark:"rgba(27, 122, 56, 0.2)"}},"status.warning":{value:{base:"{colors.brand.amber.500}",_dark:"{colors.brand.amber.500}"}},"status.warning.tint":{value:{base:"{colors.brand.amber.100}",_dark:"rgba(217, 119, 6, 0.2)"}},"status.error":{value:{base:"{colors.brand.red.500}",_dark:"{colors.brand.red.500}"}},"status.error.tint":{value:{base:"{colors.brand.red.100}",_dark:"rgba(220, 38, 38, 0.2)"}},blue:{50:{value:{base:"{colors.brand.blue.50}"}},100:{value:{base:"{colors.brand.blue.100}"}},200:{value:{base:"{colors.brand.blue.200}"}},300:{value:{base:"{colors.brand.blue.300}"}},400:{value:{base:"{colors.brand.blue.400}"}},500:{value:{base:"{colors.brand.blue.500}"}},600:{value:{base:"{colors.brand.blue.600}"}},700:{value:{base:"{colors.brand.blue.700}"}},800:{value:{base:"{colors.brand.blue.800}"}},900:{value:{base:"{colors.brand.blue.900}"}},solid:{value:{base:"{colors.brand.blue.500}"}},contrast:{value:{base:"#FFFFFF"}},muted:{value:{base:"{colors.brand.blue.100}",_dark:"{colors.brand.blue.900}"}},subtle:{value:{base:"{colors.brand.blue.50}",_dark:"rgba(6, 133, 255, 0.1)"}},emphasized:{value:{base:"{colors.brand.blue.100}",_dark:"{colors.brand.blue.800}"}},fg:{value:{base:"{colors.brand.blue.700}",_dark:"{colors.brand.blue.300}"}},focusRing:{value:{base:"{colors.brand.blue.500}"}}},purple:{50:{value:{base:"{colors.brand.purple.50}"}},100:{value:{base:"{colors.brand.purple.100}"}},500:{value:{base:"{colors.brand.purple.500}"}},600:{value:{base:"{colors.brand.purple.600}"}},solid:{value:{base:"{colors.brand.purple.500}"}},contrast:{value:{base:"#FFFFFF"}},muted:{value:{base:"{colors.brand.purple.100}",_dark:"{colors.brand.purple.900}"}},subtle:{value:{base:"{colors.brand.purple.50}",_dark:"rgba(119, 0, 204, 0.1)"}},emphasized:{value:{base:"{colors.brand.purple.100}"}},fg:{value:{base:"{colors.brand.purple.700}",_dark:"{colors.brand.purple.300}"}},focusRing:{value:{base:"{colors.brand.purple.500}"}}}}},textStyles:Qc}}),iu=f.createSystem(f.defaultConfig,ru),Uh={info:{bg:"rgba(6, 133, 255, 0.08)",border:"rgba(6, 133, 255, 0.3)",color:"#0685FF",icon:"ℹ"},success:{bg:"rgba(27, 122, 56, 0.08)",border:"rgba(27, 122, 56, 0.3)",color:"#1B7A38",icon:"✓"},warning:{bg:"rgba(217, 119, 6, 0.08)",border:"rgba(217, 119, 6, 0.3)",color:"#D97706",icon:"⚠"},error:{bg:"rgba(220, 38, 38, 0.08)",border:"rgba(220, 38, 38, 0.3)",color:"#DC2626",icon:"✕"}},is=k.forwardRef(({status:e="info",variant:t="subtle",title:n,description:r,icon:i,onClose:s,closable:a=!1,children:l,...d},c)=>{const u=Uh[e],h=t==="solid"?u.color:u.bg,m=t==="solid"?"white":"inherit",p=t==="left-accent"?`4px solid ${u.color}`:void 0,x=t==="subtle"?`1px solid ${u.border}`:void 0;return o.jsxs(f.Box,{ref:c,role:"alert",display:"flex",alignItems:"flex-start",gap:"3",p:"4",borderRadius:"md",bg:h,border:x,borderLeft:p,color:m,...d,children:[o.jsx(f.Box,{flexShrink:0,w:"5",h:"5",borderRadius:"full",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"xs",fontWeight:"bold",bg:t==="solid"?"rgba(255,255,255,0.2)":u.color,color:"white",mt:"0.5",children:i??u.icon}),o.jsxs(f.Box,{flex:"1",children:[n&&o.jsx(f.Box,{fontWeight:"semibold",fontSize:"sm",fontFamily:"var(--font-body)",color:t==="solid"?"white":u.color,children:n}),r&&o.jsx(f.Box,{mt:n?"0.5":"0",fontSize:"sm",fontFamily:"var(--font-body)",color:t==="solid"?"rgba(255,255,255,0.85)":"text.body",lineHeight:"1.5",children:r}),l]}),a&&o.jsx(f.Box,{as:"button",flexShrink:0,w:"6",h:"6",border:"none",bg:"transparent",cursor:"pointer",color:t==="solid"?"rgba(255,255,255,0.7)":"text.muted",fontSize:"lg",lineHeight:"1",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"sm",_hover:{color:t==="solid"?"white":"text.heading"},onClick:s,"aria-label":"Dismiss alert",children:"×"})]})});is.displayName="MedixAlert";if(typeof document<"u"){const e="medix-toast-keyframes";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=`
2
2
  @keyframes medixToastProgress {
3
3
  from { transform: scaleX(1); }
4
4
  to { transform: scaleX(0); }
5
5
  }
6
- `,document.head.appendChild(t)}}const In=f.createToaster({placement:"bottom-end",pauseOnPageIdle:!0,overlap:!0,gap:16,duration:4e3,removeDelay:200}),Zn=Object.assign(e=>In.create({title:e.title,description:e.description,type:e.type||"info",duration:e.duration??4e3}),{success:(e,t)=>Zn({title:e,type:"success",...t}),error:(e,t)=>Zn({title:e,type:"error",...t}),info:(e,t)=>Zn({title:e,type:"info",...t}),warning:(e,t)=>Zn({title:e,type:"warning",...t})}),Wh=e=>In.dismiss(e),Hh={success:"#16A34A",error:"#DC2626",warning:"#D97706",info:"#0685FF"};function Uh({toast:e}){var c;const[t,n]=k.useState(!1),r=((c=e.meta)==null?void 0:c.variant)||"subtle",i=e.duration??4e3,s=e.type||"info",a=Hh[s]||"#0685FF",l=()=>{n(!0),In.pause(e.id)},d=()=>{n(!1),In.resume(e.id)};return o.jsxs(f.ToastRoot,{bg:"bg.surface",p:"0",border:"none",borderRadius:"md",w:{base:"full",sm:"fit-content"},minW:{sm:"350px"},maxW:{base:"full",sm:"400px"},boxShadow:"none",pointerEvents:"auto",overflow:"hidden",position:"relative",onMouseEnter:l,onMouseLeave:d,children:[o.jsxs(rs,{status:s,variant:r,title:typeof e.title=="string"?e.title:void 0,description:typeof e.description=="string"?e.description:void 0,closable:!0,onClose:()=>In.dismiss(e.id),boxShadow:"none",w:"100%",children:[typeof e.title!="string"&&e.title,typeof e.description!="string"&&e.description]}),i!==1/0&&o.jsx("div",{"aria-hidden":"true",style:{position:"absolute",bottom:0,left:0,height:"3px",width:"100%",backgroundColor:a,opacity:.9,transformOrigin:"left",animationName:"medixToastProgress",animationDuration:`${i}ms`,animationTimingFunction:"linear",animationFillMode:"forwards",animationPlayState:t?"paused":"running"}})]},e.id)}const iu=()=>o.jsx(f.Toaster,{toaster:In,insetInline:{base:"4",md:"4"},insetBlock:{base:"4",md:"4"},pointerEvents:"none",children:e=>o.jsx(Uh,{toast:e},e.id)}),$h=["https://api.fontshare.com/v2/css?f[]=satoshi@400,500,600,700&display=swap","https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"],Gh=`
6
+ `,document.head.appendChild(t)}}const In=f.createToaster({placement:"bottom-end",pauseOnPageIdle:!0,overlap:!0,gap:16,duration:4e3,removeDelay:200}),Zn=Object.assign(e=>In.create({title:e.title,description:e.description,type:e.type||"info",duration:e.duration??4e3}),{success:(e,t)=>Zn({title:e,type:"success",...t}),error:(e,t)=>Zn({title:e,type:"error",...t}),info:(e,t)=>Zn({title:e,type:"info",...t}),warning:(e,t)=>Zn({title:e,type:"warning",...t})}),$h=e=>In.dismiss(e),Gh={success:"#16A34A",error:"#DC2626",warning:"#D97706",info:"#0685FF"};function Yh({toast:e}){var c;const[t,n]=k.useState(!1),r=((c=e.meta)==null?void 0:c.variant)||"subtle",i=e.duration??4e3,s=e.type||"info",a=Gh[s]||"#0685FF",l=()=>{n(!0),In.pause(e.id)},d=()=>{n(!1),In.resume(e.id)};return o.jsxs(f.ToastRoot,{bg:"bg.surface",p:"0",border:"none",borderRadius:"md",w:{base:"full",sm:"fit-content"},minW:{sm:"350px"},maxW:{base:"full",sm:"400px"},boxShadow:"none",pointerEvents:"auto",overflow:"hidden",position:"relative",onMouseEnter:l,onMouseLeave:d,children:[o.jsxs(is,{status:s,variant:r,title:typeof e.title=="string"?e.title:void 0,description:typeof e.description=="string"?e.description:void 0,closable:!0,onClose:()=>In.dismiss(e.id),boxShadow:"none",w:"100%",children:[typeof e.title!="string"&&e.title,typeof e.description!="string"&&e.description]}),i!==1/0&&o.jsx("div",{"aria-hidden":"true",style:{position:"absolute",bottom:0,left:0,height:"3px",width:"100%",backgroundColor:a,opacity:.9,transformOrigin:"left",animationName:"medixToastProgress",animationDuration:`${i}ms`,animationTimingFunction:"linear",animationFillMode:"forwards",animationPlayState:t?"paused":"running"}})]},e.id)}const ou=()=>o.jsx(f.Toaster,{toaster:In,insetInline:{base:"4",md:"4"},insetBlock:{base:"4",md:"4"},pointerEvents:"none",children:e=>o.jsx(Yh,{toast:e},e.id)}),Kh=["https://api.fontshare.com/v2/css?f[]=satoshi@400,500,600,700&display=swap","https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"],qh=`
7
7
  /* ── Fluid typography base ───────────────────────────────────────────────── */
8
8
  /* font-size: 100% keeps 1rem = user's browser preference (default 16px). */
9
9
  /* All token font sizes use clamp() so they scale fluidly between mobile and */
@@ -138,18 +138,18 @@
138
138
  @keyframes medix-spin {
139
139
  to { transform: rotate(360deg); }
140
140
  }
141
- `;let ma=!1,xa=!1;function Yh(){if(typeof document>"u"||ma)return;["https://api.fontshare.com","https://fonts.googleapis.com","https://fonts.gstatic.com"].forEach(t=>{if(document.head.querySelector(`link[href="${t}"]`))return;const n=document.createElement("link");n.rel="preconnect",n.href=t,t.includes("gstatic")&&(n.crossOrigin="anonymous"),document.head.appendChild(n)}),$h.forEach(t=>{if(document.head.querySelector(`link[href="${t}"]`))return;const n=document.createElement("link");n.rel="stylesheet",n.href=t,document.head.appendChild(n)}),ma=!0}function Kh(){if(typeof document>"u"||xa)return;const e=document.createElement("style");e.setAttribute("data-medixdeck","global"),e.textContent=Gh,document.head.insertBefore(e,document.head.firstChild),xa=!0}function qh({children:e,defaultColorMode:t="system",forcedColorMode:n}){return k.useEffect(()=>{Yh(),Kh()},[]),o.jsx(Mh,{attribute:"class",defaultTheme:t,forcedTheme:n,disableTransitionOnChange:!0,children:o.jsxs(f.ChakraProvider,{value:ru,children:[e,o.jsx(iu,{})]})})}function Xh(e){if(typeof document>"u")return()=>{};const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),document.body&&t.observe(document.body,{attributes:!0,attributeFilter:["class"]}),()=>t.disconnect()}function Zh(){return typeof document>"u"?!1:document.documentElement.classList.contains("dark")||document.body.classList.contains("dark")}function hr(){const{resolvedTheme:e,setTheme:t,theme:n}=Rh(),[r,i]=k.useState(!1),s=k.useSyncExternalStore(Xh,Zh,()=>!1);k.useEffect(()=>{i(!0)},[]);const l=e==="dark"||s?"dark":"light",d=n==="light"||n==="dark"||n==="system"?n:"system",c=k.useCallback(h=>{t(h)},[t]),u=k.useCallback(()=>{t(l==="dark"?"light":"dark")},[t,l]);return{mounted:r,themeMode:l,themeSetting:d,setThemeMode:c,toggleThemeMode:u}}function is(){const{themeMode:e}=hr();return e==="dark"}function Jh(e="blue"){const[t,n]=k.useState(e),r=k.useCallback(s=>{n(s)},[]),i=k.useCallback(()=>{n(s=>s==="blue"?"purple":"blue")},[]);return{colorScheme:t,setColorScheme:r,toggleColorScheme:i,isBlue:t==="blue",isPurple:t==="purple"}}const ga={blue:{solid:"#0685FF",solidHover:"#0575E6",solidActive:"#0562C2",tint:"#E8F3FF",tintHover:"#D6EEFF",fg:"#0685FF",fgHover:"#0562C2"},purple:{solid:"#7700CC",solidHover:"#6600B3",solidActive:"#550099",tint:"#F9F0FF",tintHover:"#EDD6FF",fg:"#7700CC",fgHover:"#550099"},green:{solid:"#1B7A38",solidHover:"#166530",solidActive:"#125429",tint:"#F0FDF4",tintHover:"#DCFCE7",fg:"#1B7A38",fgHover:"#125429"},red:{solid:"#DC2626",solidHover:"#C41F1F",solidActive:"#AC1919",tint:"#FFF1F2",tintHover:"#FFE4E6",fg:"#DC2626",fgHover:"#AC1919"},amber:{solid:"#D97706",solidHover:"#C26905",solidActive:"#A85B04",tint:"#FFFBEB",tintHover:"#FEF3C7",fg:"#D97706",fgHover:"#A85B04"},black:{solid:"#111926",solidHover:"#0D131D",solidActive:"#000000",tint:"#F3F4F6",tintHover:"#E5E7EB",fg:"#111926",fgHover:"#000000"},gray:{solid:"#4B5563",solidHover:"#374151",solidActive:"#1F2937",tint:"#F9FAFB",tintHover:"#F3F4F6",fg:"#4B5563",fgHover:"#1F2937"}},ya={xs:{height:"28px",px:"12px",fontSize:"11px"},sm:{height:"32px",px:"14px",fontSize:"13px"},md:{height:"40px",px:"18px",fontSize:"14px"},lg:{height:"48px",px:"24px",fontSize:"16px"}},Qe=k.forwardRef(({variant:e="solid",size:t="md",colorScheme:n="blue",isLoading:r=!1,leftIcon:i,rightIcon:s,disabled:a,children:l,style:d,as:c="button",href:u,target:h,rel:m,...p},x)=>{const g=ga[n]||ga.blue,v=ya[t]||ya.md,y={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"0.4rem",height:v.height,paddingLeft:v.px,paddingRight:v.px,fontSize:v.fontSize,fontWeight:600,fontFamily:"var(--font-body)",borderRadius:8,border:"none",cursor:a||r?"not-allowed":"pointer",opacity:a||r?.55:1,outline:"none",textDecoration:"none",whiteSpace:"nowrap",userSelect:"none",WebkitTapHighlightColor:"transparent",transition:"background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease"};let j={};switch(e){case"solid":j={background:g.solid,color:"#FFFFFF"};break;case"outline":j={background:"transparent",color:g.fg,border:`1.5px solid ${g.solid}`};break;case"ghost":j={background:"transparent",color:g.fg,border:"none"};break;case"secondary":j={background:g.tint,color:g.fg,border:"none"};break;case"link":j={background:"transparent",color:g.fg,border:"none",padding:0,height:"auto",fontSize:v.fontSize,textDecoration:"underline",textUnderlineOffset:"3px"};break}const[w,A]=k.useState(!1),[B,C]=k.useState(!1);let O={};if((w||B)&&!a&&!r)switch(e){case"solid":O={background:B?g.solidActive:g.solidHover,boxShadow:"none"};break;case"outline":O={background:g.tint,color:g.fgHover};break;case"ghost":O={background:g.tint};break;case"secondary":O={background:g.tintHover};break;case"link":O={color:g.fgHover};break}const E={...y,...j,...O,...d};return o.jsx(c,{ref:x,type:c==="button"?p.type??"button":void 0,href:u,target:h,rel:m,disabled:c==="button"?a||r:void 0,style:E,onMouseEnter:()=>A(!0),onMouseLeave:()=>{A(!1),C(!1)},onMouseDown:()=>C(!0),onMouseUp:()=>C(!1),onFocus:F=>{F.currentTarget.style.boxShadow="none"},onBlur:F=>{F.currentTarget.style.boxShadow="none"},...p,"aria-disabled":c!=="button"&&(a||r)?!0:p["aria-disabled"],onClick:F=>{var L;if(c!=="button"&&(a||r)){F.preventDefault();return}(L=p.onClick)==null||L.call(p,F)},children:r?o.jsx(f.Box,{as:"span",display:"inline-block",w:"1em",h:"1em",borderRadius:"full",border:"2px solid currentColor",borderTopColor:"transparent",style:{animation:"medix-spin 0.65s linear infinite"}}):o.jsxs(o.Fragment,{children:[i&&o.jsx("span",{style:{display:"inline-flex",flexShrink:0},children:i}),l,s&&o.jsx("span",{style:{display:"inline-flex",flexShrink:0},children:s})]})})});Qe.displayName="MedixButton";const Qh={blue:{solid:"#0685FF",solidHover:"#0575E6",solidActive:"#0562C2",tint:"#E8F3FF",tintHover:"#D6EEFF",fg:"#0685FF"},purple:{solid:"#7700CC",solidHover:"#6600B3",solidActive:"#550099",tint:"#F9F0FF",tintHover:"#EDD6FF",fg:"#7700CC"},green:{solid:"#1B7A38",solidHover:"#166530",solidActive:"#125429",tint:"#F0FDF4",tintHover:"#DCFCE7",fg:"#1B7A38"},red:{solid:"#DC2626",solidHover:"#C41F1F",solidActive:"#AC1919",tint:"#FFF1F2",tintHover:"#FFE4E6",fg:"#DC2626"},gray:{solid:"#6B7280",solidHover:"#4B5563",solidActive:"#374151",tint:"#F3F4F6",tintHover:"#E5E7EB",fg:"#374151"}},ep={xs:{width:24,height:24,fontSize:12,borderRadius:6},sm:{width:28,height:28,fontSize:14,borderRadius:6},md:{width:36,height:36,fontSize:16,borderRadius:8},lg:{width:44,height:44,fontSize:18,borderRadius:8}},ou=k.forwardRef(({variant:e="ghost",size:t="md",colorScheme:n="blue",isRound:r=!1,disabled:i,children:s,style:a,...l},d)=>{const c=Qh[n],u=ep[t],[h,m]=k.useState(!1),[p,x]=k.useState(!1);let g;switch(e){case"solid":g={background:h?p?c.solidActive:c.solidHover:c.solid,color:"#fff"};break;case"outline":g={background:h?c.tint:"transparent",color:c.fg,border:`1.5px solid ${c.solid}`};break;case"ghost":default:g={background:h?c.tint:"transparent",color:c.fg};break}return o.jsx("button",{ref:d,type:l.type??"button",disabled:i,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",border:"none",cursor:i?"not-allowed":"pointer",opacity:i?.55:1,outline:"none",flexShrink:0,transition:"background 0.15s ease, box-shadow 0.15s ease",...u,...r?{borderRadius:"50%"}:{},...g,...a},onMouseEnter:()=>m(!0),onMouseLeave:()=>{m(!1),x(!1)},onMouseDown:()=>x(!0),onMouseUp:()=>x(!1),onFocus:v=>{v.currentTarget.style.boxShadow="none"},onBlur:v=>{v.currentTarget.style.boxShadow="none"},...l,children:s})});ou.displayName="MedixIconButton";const tp={success:{solid:"#1B7A38",solidText:"#fff",tint:"#DCFCE7",tintText:"#1B7A38",border:"#1B7A38"},warning:{solid:"#D97706",solidText:"#fff",tint:"#FEF3C7",tintText:"#B45309",border:"#D97706"},error:{solid:"#DC2626",solidText:"#fff",tint:"#FFE4E6",tintText:"#B91C1C",border:"#DC2626"},info:{solid:"#0685FF",solidText:"#fff",tint:"#E8F3FF",tintText:"#0562C2",border:"#0685FF"},neutral:{solid:"#6B7280",solidText:"#fff",tint:"#F3F4F6",tintText:"#374151",border:"#9CA3AF"}},np={sm:{padding:"1px 6px",fontSize:10,lineHeight:"18px"},md:{padding:"2px 8px",fontSize:11,lineHeight:"20px"},lg:{padding:"3px 10px",fontSize:12,lineHeight:"22px"}},os=k.forwardRef(({variant:e="subtle",status:t="neutral",size:n="md",rounded:r,children:i,style:s,...a},l)=>{const d=tp[t],c=np[n];let u,h,m="1px solid transparent";switch(e){case"solid":u=d.solid,h=d.solidText;break;case"outline":u="transparent",h=d.tintText,m=`1px solid ${d.border}`;break;case"surface":u=d.tint,h=d.tintText,m=`1px solid ${d.border}20`;break;case"subtle":default:u=d.tint,h=d.tintText;break}const p={display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-body)",fontWeight:500,letterSpacing:"0.03em",textTransform:"none",borderRadius:r?"100px":4,border:m,background:u,color:h,whiteSpace:"nowrap",...c,...s};return o.jsx("span",{ref:l,style:p,...a,children:i})});os.displayName="MedixBadge";const su={xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"xl","2xl":"2xl"},ui=k.forwardRef(({src:e,name:t,size:n="md",showStatus:r=!1,statusColor:i="green",...s},a)=>o.jsxs(f.Avatar.Root,{ref:a,size:su[n],position:"relative",...s,children:[o.jsx(f.Avatar.Fallback,{name:t,bg:"blue.500",color:"white",fontFamily:"var(--font-body)"}),e&&o.jsx(f.Avatar.Image,{src:e,alt:t??""}),r&&o.jsx(f.Box,{position:"absolute",bottom:"0",right:"0",w:"3",h:"3",bg:i,borderRadius:"full",border:"2px solid",borderColor:"bg"})]}));ui.displayName="MedixAvatar";function rp({children:e,max:t,size:n="md"}){const r=k.Children.toArray(e),i=t?r.slice(0,t):r,s=t?Math.max(0,r.length-t):0,a=su[n];return o.jsxs(f.Box,{display:"flex",alignItems:"center",children:[i.map((l,d)=>o.jsx(f.Box,{ml:d===0?"0":"-2",position:"relative",zIndex:i.length-d,children:k.isValidElement(l)?k.cloneElement(l,{size:n}):l},d)),s>0&&o.jsxs(f.Box,{ml:"-2",w:a==="sm"?"8":a==="lg"?"12":"10",h:a==="sm"?"8":a==="lg"?"12":"10",borderRadius:"full",bg:"bg.surface",border:"2px solid",borderColor:"border",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"xs",fontWeight:"medium",color:"text.muted",children:["+",s]})]})}function au({size:e="md",label:t,color:n="blue.500",...r}){return o.jsxs(f.Box,{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"2",children:[o.jsx(f.Spinner,{size:e,color:n,borderWidth:"2px",...r}),t&&o.jsx(f.Text,{textStyle:"small",color:"text.muted",children:t})]})}function ip({label:e}){return o.jsx(f.Box,{position:"fixed",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",bg:"bg",zIndex:"overlay",children:o.jsx(au,{size:"xl",label:e??"Loading…"})})}const lu=k.forwardRef(({variant:e="subtle",colorScheme:t="blue",onClose:n,children:r,...i},s)=>o.jsxs(f.Box,{ref:s,as:"span",display:"inline-flex",alignItems:"center",gap:"1",px:"2.5",py:"1",borderRadius:"full",fontSize:"xs",fontWeight:"medium",fontFamily:"var(--font-body)",border:"1px solid",borderColor:e==="outline"?`${t}.400`:"transparent",bg:e==="solid"?`${t}.500`:e==="subtle"?`${t}.100`:"transparent",color:e==="solid"?"white":`${t}.700`,transition:"all 0.15s",cursor:n?"default":void 0,...i,children:[r,n&&o.jsx(f.Box,{as:"button",onClick:n,ml:"1",opacity:.7,_hover:{opacity:1},lineHeight:"1",fontSize:"md",cursor:"pointer",border:"none",bg:"transparent",padding:"0",display:"inline-flex",alignItems:"center",children:"×"})]}));lu.displayName="MedixTag";const cu=k.forwardRef(({orientation:e="horizontal",label:t,...n},r)=>t?o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",width:"100%"},children:[o.jsx("div",{style:{flex:1,height:"1px",background:"var(--chakra-colors-border)"}}),o.jsx("span",{style:{fontSize:"var(--chakra-font-sizes-sm)",color:"var(--chakra-colors-text-body)",whiteSpace:"nowrap",fontFamily:"var(--font-body)"},children:t}),o.jsx("div",{style:{flex:1,height:"1px",background:"var(--chakra-colors-border)"}})]}):o.jsx(f.Separator,{ref:r,orientation:e,borderColor:"border",...n}));cu.displayName="MedixDivider";const op="M394.335,2488.823C394.554,2488.998 394.639,2489.292 394.547,2489.557C394.454,2489.822 394.204,2490 393.924,2490C375.317,2490 225.88,2490 225.88,2490C199.437,2490 178,2468.563 178,2442.12L178,2005.88C178,1979.437 199.437,1958 225.88,1958L662.12,1958C688.563,1958 710,1979.437 710,2005.88L710,2229.103C705.9,2213.585 701.763,2198.117 697.603,2182.745C695.811,2176.086 692.135,2162.841 690.354,2156.167L686.684,2142.89C684.779,2136.191 679.606,2130.414 672.464,2128.176C661.192,2124.644 649.192,2130.918 645.661,2142.189C645.656,2142.2 640.542,2158.554 640.531,2158.562C621.999,2218.218 603.451,2279.044 585.808,2338.903C584.671,2342.744 583.273,2347.499 581.74,2352.732C581.67,2352.969 581.458,2353.137 581.212,2353.15C580.965,2353.163 580.736,2353.019 580.642,2352.79C564.661,2314.068 548.29,2275.087 532.023,2237.116C528.352,2226.577 513.846,2225.401 508.748,2235.524L500.846,2251.532C494.027,2265.509 486.438,2280.793 479.597,2295.008C479.597,2295.008 436.069,2383.443 431.51,2392.706C431.286,2393.161 431.413,2393.711 431.814,2394.021C433.263,2395.142 436.626,2397.742 438.275,2399.017C438.515,2399.203 438.824,2399.277 439.123,2399.222C439.422,2399.166 439.683,2398.985 439.84,2398.725C445.834,2388.818 493.319,2310.326 493.684,2309.731C500.84,2297.999 508.653,2285.339 516.051,2273.133C516.168,2272.939 516.387,2272.831 516.613,2272.856C516.838,2272.881 517.028,2273.034 517.101,2273.248C528.203,2306.041 540.617,2341.984 551.933,2374.266C556.929,2388.443 561.912,2402.625 566.966,2416.781C568.806,2421.847 572.884,2426.143 578.389,2427.989C588.248,2431.333 598.92,2425.683 601.835,2415.722L612.744,2383.232C630.147,2331.149 647.399,2278.183 664.218,2225.484C664.314,2225.186 664.593,2224.985 664.906,2224.99C665.219,2224.994 665.493,2225.203 665.579,2225.504C668.949,2237.233 672.331,2248.892 675.679,2260.287C685.796,2294.879 696.817,2331.451 707.457,2365.829C708.016,2368.018 708.889,2369.95 710,2371.619L710,2442.12C710,2468.563 688.563,2490 662.12,2490L477.453,2490C477.156,2490 476.867,2489.902 476.631,2489.722C457.299,2474.985 438.453,2459.752 421.161,2443.298C412.607,2435.236 403.479,2425.986 395.548,2417.282C379.508,2399.804 364.42,2381.572 352.559,2361.076C326.4,2316.618 312.562,2264.49 315.392,2212.886C316.216,2200.363 317.83,2187.671 320.751,2175.467C321.065,2174.238 321.893,2170.686 322.182,2169.527C322.553,2168.204 323.549,2165.048 323.922,2163.655C351.204,2075.514 443.187,2010.628 535.637,2015.16C561.342,2016.889 586.119,2025.438 609.443,2036.154C637.886,2049.35 664.476,2066.31 689.615,2085.03L693.462,2087.898L693.505,2087.932C695.324,2089.292 697.896,2089.328 699.78,2087.862C702.032,2086.104 702.434,2082.852 700.679,2080.598C686.502,2062.447 670.231,2045.755 652.687,2030.749C621.192,2004.201 584.741,1981.815 543.918,1973.331C465.886,1958.184 383.437,1988.87 327.543,2043.897C308.123,2063.018 291.777,2085.124 279.269,2109.433C278.071,2111.881 275.685,2116.914 274.502,2119.362C272.958,2122.749 271.137,2127.369 269.669,2130.806C267.99,2135.574 266.054,2140.322 264.652,2145.186L263.037,2150.496L262.236,2153.154L261.556,2155.849C260.836,2159.042 259.531,2163.44 258.978,2166.617C255.952,2180.668 254.15,2195.197 253.377,2209.543C251.4,2248.711 257.554,2288.211 270.508,2325.184C282.242,2358.498 299.504,2389.917 321.541,2417.523C328.923,2426.794 337.487,2436.055 345.675,2444.555C353.486,2452.676 362.788,2461.68 371.226,2469.229C378.696,2475.993 386.419,2482.518 394.335,2488.823Z",sp="M46.32 25H44.016V7.648H46.32L52.296 22.24L58.272 7.648H60.624V25H58.32V18.136C58.32 14.896 58.344 13.72 58.464 12.496L53.4 25H51.192L46.152 12.544C46.272 13.384 46.32 15.16 46.32 17.584V25ZM69.3444 25.288C65.8884 25.288 63.5124 22.792 63.5124 19.144C63.5124 15.472 65.8404 12.928 69.2484 12.928C72.5844 12.928 74.7684 15.232 74.7684 18.712V19.552L65.6964 19.576C65.8644 22.048 67.1604 23.416 69.3924 23.416C71.1444 23.416 72.2964 22.696 72.6804 21.352H74.7924C74.2164 23.872 72.2484 25.288 69.3444 25.288ZM69.2484 14.824C67.2804 14.824 66.0324 16 65.7444 18.064H72.5124C72.5124 16.12 71.2404 14.824 69.2484 14.824Z M81.9922 25.288C78.5843 25.288 76.5203 22.744 76.5203 19.168C76.5203 15.568 78.6083 12.928 82.0883 12.928C83.8883 12.928 85.4003 13.72 86.1923 15.16V7.336H88.4243V25H86.4083L86.2163 22.864C85.4483 24.472 83.8643 25.288 81.9922 25.288ZM82.4483 23.248C84.7523 23.248 86.1683 21.544 86.1683 19.096C86.1683 16.696 84.7523 14.968 82.4483 14.968C80.1443 14.968 78.8003 16.696 78.8003 19.096C78.8003 21.52 80.1443 23.248 82.4483 23.248Z M92.7829 10.48C91.9669 10.48 91.2949 9.808 91.2949 8.992C91.2949 8.152 91.9669 7.504 92.7829 7.504C93.5989 7.504 94.2709 8.152 94.2709 8.992C94.2709 9.808 93.5989 10.48 92.7829 10.48Z M91.6789 25V13.264H93.9349V25H91.6789Z M98.4101 25H95.8181L99.9221 19.192L95.8421 13.264H98.4581L101.434 17.632L104.338 13.264H106.906L102.826 19.192L106.834 25H104.218L101.29 20.704L98.4101 25Z M114.908 25H109.172V7.648H114.812C119.996 7.648 123.5 11.152 123.5 16.336C123.5 21.496 120.044 25 114.908 25ZM114.644 9.808H111.524V22.816H114.74C118.604 22.816 121.052 20.32 121.052 16.336C121.052 12.304 118.604 9.808 114.644 9.808Z M131.173 25.288C127.717 25.288 125.341 22.792 125.341 19.144C125.341 15.472 127.669 12.928 131.077 12.928C134.413 12.928 136.597 15.232 136.597 18.712V19.552L127.525 19.576C127.693 22.048 128.989 23.416 131.221 23.416C132.973 23.416 134.125 22.696 134.509 21.352H136.621C136.045 23.872 134.077 25.288 131.173 25.288ZM131.077 14.824C129.109 14.824 127.861 16 127.573 18.064H134.341C134.341 16.12 133.069 14.824 131.077 14.824Z M138.348 19.144C138.348 15.472 140.676 12.928 144.108 12.928C147.06 12.928 149.124 14.608 149.532 17.224H147.276C146.892 15.736 145.692 14.944 144.18 14.944C142.044 14.944 140.58 16.576 140.58 19.12C140.58 21.64 141.948 23.272 144.084 23.272C145.692 23.272 146.892 22.432 147.3 21.04H149.556C149.1 23.584 146.916 25.288 144.084 25.288C140.628 25.288 138.348 22.84 138.348 19.144Z M154.241 25H151.985V7.336H154.241V18.784L159.449 13.264H162.281L157.793 17.944L162.257 25H159.665L156.233 19.576L154.241 21.664V25Z";function ap({variant:e,type:t,height:n,markColor:r,textColor:i,downloadFileName:s}){if(typeof window>"u")return;const a=4,l=532,d=44,c=119,u=32,h=n,m=Math.round(n*.3),p=t==="full"?Math.round(c*(n/u)):0,g=(t==="full"?h+m+p:h)*a,v=n*a,y=h*a/l,j=v/u,w=`
141
+ `;let xa=!1,ga=!1;function Xh(){if(typeof document>"u"||xa)return;["https://api.fontshare.com","https://fonts.googleapis.com","https://fonts.gstatic.com"].forEach(t=>{if(document.head.querySelector(`link[href="${t}"]`))return;const n=document.createElement("link");n.rel="preconnect",n.href=t,t.includes("gstatic")&&(n.crossOrigin="anonymous"),document.head.appendChild(n)}),Kh.forEach(t=>{if(document.head.querySelector(`link[href="${t}"]`))return;const n=document.createElement("link");n.rel="stylesheet",n.href=t,document.head.appendChild(n)}),xa=!0}function Zh(){if(typeof document>"u"||ga)return;const e=document.createElement("style");e.setAttribute("data-medixdeck","global"),e.textContent=qh,document.head.insertBefore(e,document.head.firstChild),ga=!0}function Jh({children:e,defaultColorMode:t="system",forcedColorMode:n}){return k.useEffect(()=>{Xh(),Zh()},[]),o.jsx(zh,{attribute:"class",defaultTheme:t,forcedTheme:n,disableTransitionOnChange:!0,children:o.jsxs(f.ChakraProvider,{value:iu,children:[e,o.jsx(ou,{})]})})}function Qh(e){if(typeof document>"u")return()=>{};const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),document.body&&t.observe(document.body,{attributes:!0,attributeFilter:["class"]}),()=>t.disconnect()}function ep(){return typeof document>"u"?!1:document.documentElement.classList.contains("dark")||document.body.classList.contains("dark")}function hr(){const{resolvedTheme:e,setTheme:t,theme:n}=Oh(),[r,i]=k.useState(!1),s=k.useSyncExternalStore(Qh,ep,()=>!1);k.useEffect(()=>{i(!0)},[]);const l=e==="dark"||s?"dark":"light",d=n==="light"||n==="dark"||n==="system"?n:"system",c=k.useCallback(h=>{t(h)},[t]),u=k.useCallback(()=>{t(l==="dark"?"light":"dark")},[t,l]);return{mounted:r,themeMode:l,themeSetting:d,setThemeMode:c,toggleThemeMode:u}}function os(){const{themeMode:e}=hr();return e==="dark"}function tp(e="blue"){const[t,n]=k.useState(e),r=k.useCallback(s=>{n(s)},[]),i=k.useCallback(()=>{n(s=>s==="blue"?"purple":"blue")},[]);return{colorScheme:t,setColorScheme:r,toggleColorScheme:i,isBlue:t==="blue",isPurple:t==="purple"}}const ya={blue:{solid:"#0685FF",solidHover:"#0575E6",solidActive:"#0562C2",tint:"#E8F3FF",tintHover:"#D6EEFF",fg:"#0685FF",fgHover:"#0562C2"},purple:{solid:"#7700CC",solidHover:"#6600B3",solidActive:"#550099",tint:"#F9F0FF",tintHover:"#EDD6FF",fg:"#7700CC",fgHover:"#550099"},green:{solid:"#1B7A38",solidHover:"#166530",solidActive:"#125429",tint:"#F0FDF4",tintHover:"#DCFCE7",fg:"#1B7A38",fgHover:"#125429"},red:{solid:"#DC2626",solidHover:"#C41F1F",solidActive:"#AC1919",tint:"#FFF1F2",tintHover:"#FFE4E6",fg:"#DC2626",fgHover:"#AC1919"},amber:{solid:"#D97706",solidHover:"#C26905",solidActive:"#A85B04",tint:"#FFFBEB",tintHover:"#FEF3C7",fg:"#D97706",fgHover:"#A85B04"},black:{solid:"#111926",solidHover:"#0D131D",solidActive:"#000000",tint:"#F3F4F6",tintHover:"#E5E7EB",fg:"#111926",fgHover:"#000000"},gray:{solid:"#4B5563",solidHover:"#374151",solidActive:"#1F2937",tint:"#F9FAFB",tintHover:"#F3F4F6",fg:"#4B5563",fgHover:"#1F2937"}},ba={xs:{height:"28px",px:"12px",fontSize:"11px"},sm:{height:"32px",px:"14px",fontSize:"13px"},md:{height:"40px",px:"18px",fontSize:"14px"},lg:{height:"48px",px:"24px",fontSize:"16px"}},Qe=k.forwardRef(({variant:e="solid",size:t="md",colorScheme:n="blue",isLoading:r=!1,leftIcon:i,rightIcon:s,disabled:a,children:l,style:d,as:c="button",href:u,target:h,rel:m,...p},x)=>{const g=ya[n]||ya.blue,v=ba[t]||ba.md,y={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"0.4rem",height:v.height,paddingLeft:v.px,paddingRight:v.px,fontSize:v.fontSize,fontWeight:600,fontFamily:"var(--font-body)",borderRadius:8,border:"none",cursor:a||r?"not-allowed":"pointer",opacity:a||r?.55:1,outline:"none",textDecoration:"none",whiteSpace:"nowrap",userSelect:"none",WebkitTapHighlightColor:"transparent",transition:"background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease"};let j={};switch(e){case"solid":j={background:g.solid,color:"#FFFFFF"};break;case"outline":j={background:"transparent",color:g.fg,border:`1.5px solid ${g.solid}`};break;case"ghost":j={background:"transparent",color:g.fg,border:"none"};break;case"secondary":j={background:g.tint,color:g.fg,border:"none"};break;case"link":j={background:"transparent",color:g.fg,border:"none",padding:0,height:"auto",fontSize:v.fontSize,textDecoration:"underline",textUnderlineOffset:"3px"};break}const[w,A]=k.useState(!1),[B,C]=k.useState(!1);let O={};if((w||B)&&!a&&!r)switch(e){case"solid":O={background:B?g.solidActive:g.solidHover,boxShadow:"none"};break;case"outline":O={background:g.tint,color:g.fgHover};break;case"ghost":O={background:g.tint};break;case"secondary":O={background:g.tintHover};break;case"link":O={color:g.fgHover};break}const E={...y,...j,...O,...d};return o.jsx(c,{ref:x,type:c==="button"?p.type??"button":void 0,href:u,target:h,rel:m,disabled:c==="button"?a||r:void 0,style:E,onMouseEnter:()=>A(!0),onMouseLeave:()=>{A(!1),C(!1)},onMouseDown:()=>C(!0),onMouseUp:()=>C(!1),onFocus:F=>{F.currentTarget.style.boxShadow="none"},onBlur:F=>{F.currentTarget.style.boxShadow="none"},...p,"aria-disabled":c!=="button"&&(a||r)?!0:p["aria-disabled"],onClick:F=>{var L;if(c!=="button"&&(a||r)){F.preventDefault();return}(L=p.onClick)==null||L.call(p,F)},children:r?o.jsx(f.Box,{as:"span",display:"inline-block",w:"1em",h:"1em",borderRadius:"full",border:"2px solid currentColor",borderTopColor:"transparent",style:{animation:"medix-spin 0.65s linear infinite"}}):o.jsxs(o.Fragment,{children:[i&&o.jsx("span",{style:{display:"inline-flex",flexShrink:0},children:i}),l,s&&o.jsx("span",{style:{display:"inline-flex",flexShrink:0},children:s})]})})});Qe.displayName="MedixButton";const np={blue:{solid:"#0685FF",solidHover:"#0575E6",solidActive:"#0562C2",tint:"#E8F3FF",tintHover:"#D6EEFF",fg:"#0685FF"},purple:{solid:"#7700CC",solidHover:"#6600B3",solidActive:"#550099",tint:"#F9F0FF",tintHover:"#EDD6FF",fg:"#7700CC"},green:{solid:"#1B7A38",solidHover:"#166530",solidActive:"#125429",tint:"#F0FDF4",tintHover:"#DCFCE7",fg:"#1B7A38"},red:{solid:"#DC2626",solidHover:"#C41F1F",solidActive:"#AC1919",tint:"#FFF1F2",tintHover:"#FFE4E6",fg:"#DC2626"},gray:{solid:"#6B7280",solidHover:"#4B5563",solidActive:"#374151",tint:"#F3F4F6",tintHover:"#E5E7EB",fg:"#374151"}},rp={xs:{width:24,height:24,fontSize:12,borderRadius:6},sm:{width:28,height:28,fontSize:14,borderRadius:6},md:{width:36,height:36,fontSize:16,borderRadius:8},lg:{width:44,height:44,fontSize:18,borderRadius:8}},su=k.forwardRef(({variant:e="ghost",size:t="md",colorScheme:n="blue",isRound:r=!1,disabled:i,children:s,style:a,...l},d)=>{const c=np[n],u=rp[t],[h,m]=k.useState(!1),[p,x]=k.useState(!1);let g;switch(e){case"solid":g={background:h?p?c.solidActive:c.solidHover:c.solid,color:"#fff"};break;case"outline":g={background:h?c.tint:"transparent",color:c.fg,border:`1.5px solid ${c.solid}`};break;case"ghost":default:g={background:h?c.tint:"transparent",color:c.fg};break}return o.jsx("button",{ref:d,type:l.type??"button",disabled:i,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",border:"none",cursor:i?"not-allowed":"pointer",opacity:i?.55:1,outline:"none",flexShrink:0,transition:"background 0.15s ease, box-shadow 0.15s ease",...u,...r?{borderRadius:"50%"}:{},...g,...a},onMouseEnter:()=>m(!0),onMouseLeave:()=>{m(!1),x(!1)},onMouseDown:()=>x(!0),onMouseUp:()=>x(!1),onFocus:v=>{v.currentTarget.style.boxShadow="none"},onBlur:v=>{v.currentTarget.style.boxShadow="none"},...l,children:s})});su.displayName="MedixIconButton";const ip={success:{solid:"#1B7A38",solidText:"#fff",tint:"#DCFCE7",tintText:"#1B7A38",border:"#1B7A38"},warning:{solid:"#D97706",solidText:"#fff",tint:"#FEF3C7",tintText:"#B45309",border:"#D97706"},error:{solid:"#DC2626",solidText:"#fff",tint:"#FFE4E6",tintText:"#B91C1C",border:"#DC2626"},info:{solid:"#0685FF",solidText:"#fff",tint:"#E8F3FF",tintText:"#0562C2",border:"#0685FF"},neutral:{solid:"#6B7280",solidText:"#fff",tint:"#F3F4F6",tintText:"#374151",border:"#9CA3AF"}},op={sm:{padding:"1px 6px",fontSize:10,lineHeight:"18px"},md:{padding:"2px 8px",fontSize:11,lineHeight:"20px"},lg:{padding:"3px 10px",fontSize:12,lineHeight:"22px"}},ss=k.forwardRef(({variant:e="subtle",status:t="neutral",size:n="md",rounded:r,children:i,style:s,...a},l)=>{const d=ip[t],c=op[n];let u,h,m="1px solid transparent";switch(e){case"solid":u=d.solid,h=d.solidText;break;case"outline":u="transparent",h=d.tintText,m=`1px solid ${d.border}`;break;case"surface":u=d.tint,h=d.tintText,m=`1px solid ${d.border}20`;break;case"subtle":default:u=d.tint,h=d.tintText;break}const p={display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-body)",fontWeight:500,letterSpacing:"0.03em",textTransform:"none",borderRadius:r?"100px":4,border:m,background:u,color:h,whiteSpace:"nowrap",...c,...s};return o.jsx("span",{ref:l,style:p,...a,children:i})});ss.displayName="MedixBadge";const au={xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"xl","2xl":"2xl"},di=k.forwardRef(({src:e,name:t,size:n="md",showStatus:r=!1,statusColor:i="green",...s},a)=>o.jsxs(f.Avatar.Root,{ref:a,size:au[n],position:"relative",...s,children:[o.jsx(f.Avatar.Fallback,{name:t,bg:"blue.500",color:"white",fontFamily:"var(--font-body)"}),e&&o.jsx(f.Avatar.Image,{src:e,alt:t??""}),r&&o.jsx(f.Box,{position:"absolute",bottom:"0",right:"0",w:"3",h:"3",bg:i,borderRadius:"full",border:"2px solid",borderColor:"bg"})]}));di.displayName="MedixAvatar";function sp({children:e,max:t,size:n="md"}){const r=k.Children.toArray(e),i=t?r.slice(0,t):r,s=t?Math.max(0,r.length-t):0,a=au[n];return o.jsxs(f.Box,{display:"flex",alignItems:"center",children:[i.map((l,d)=>o.jsx(f.Box,{ml:d===0?"0":"-2",position:"relative",zIndex:i.length-d,children:k.isValidElement(l)?k.cloneElement(l,{size:n}):l},d)),s>0&&o.jsxs(f.Box,{ml:"-2",w:a==="sm"?"8":a==="lg"?"12":"10",h:a==="sm"?"8":a==="lg"?"12":"10",borderRadius:"full",bg:"bg.surface",border:"2px solid",borderColor:"border",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"xs",fontWeight:"medium",color:"text.muted",children:["+",s]})]})}function lu({size:e="md",label:t,color:n="blue.500",...r}){return o.jsxs(f.Box,{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"2",children:[o.jsx(f.Spinner,{size:e,color:n,borderWidth:"2px",...r}),t&&o.jsx(f.Text,{textStyle:"small",color:"text.muted",children:t})]})}function ap({label:e}){return o.jsx(f.Box,{position:"fixed",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",bg:"bg",zIndex:"overlay",children:o.jsx(lu,{size:"xl",label:e??"Loading…"})})}const cu=k.forwardRef(({variant:e="subtle",colorScheme:t="blue",onClose:n,children:r,...i},s)=>o.jsxs(f.Box,{ref:s,as:"span",display:"inline-flex",alignItems:"center",gap:"1",px:"2.5",py:"1",borderRadius:"full",fontSize:"xs",fontWeight:"medium",fontFamily:"var(--font-body)",border:"1px solid",borderColor:e==="outline"?`${t}.400`:"transparent",bg:e==="solid"?`${t}.500`:e==="subtle"?`${t}.100`:"transparent",color:e==="solid"?"white":`${t}.700`,transition:"all 0.15s",cursor:n?"default":void 0,...i,children:[r,n&&o.jsx(f.Box,{as:"button",onClick:n,ml:"1",opacity:.7,_hover:{opacity:1},lineHeight:"1",fontSize:"md",cursor:"pointer",border:"none",bg:"transparent",padding:"0",display:"inline-flex",alignItems:"center",children:"×"})]}));cu.displayName="MedixTag";const uu=k.forwardRef(({orientation:e="horizontal",label:t,...n},r)=>t?o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",width:"100%"},children:[o.jsx("div",{style:{flex:1,height:"1px",background:"var(--chakra-colors-border)"}}),o.jsx("span",{style:{fontSize:"var(--chakra-font-sizes-sm)",color:"var(--chakra-colors-text-body)",whiteSpace:"nowrap",fontFamily:"var(--font-body)"},children:t}),o.jsx("div",{style:{flex:1,height:"1px",background:"var(--chakra-colors-border)"}})]}):o.jsx(f.Separator,{ref:r,orientation:e,borderColor:"border",...n}));uu.displayName="MedixDivider";const lp="M394.335,2488.823C394.554,2488.998 394.639,2489.292 394.547,2489.557C394.454,2489.822 394.204,2490 393.924,2490C375.317,2490 225.88,2490 225.88,2490C199.437,2490 178,2468.563 178,2442.12L178,2005.88C178,1979.437 199.437,1958 225.88,1958L662.12,1958C688.563,1958 710,1979.437 710,2005.88L710,2229.103C705.9,2213.585 701.763,2198.117 697.603,2182.745C695.811,2176.086 692.135,2162.841 690.354,2156.167L686.684,2142.89C684.779,2136.191 679.606,2130.414 672.464,2128.176C661.192,2124.644 649.192,2130.918 645.661,2142.189C645.656,2142.2 640.542,2158.554 640.531,2158.562C621.999,2218.218 603.451,2279.044 585.808,2338.903C584.671,2342.744 583.273,2347.499 581.74,2352.732C581.67,2352.969 581.458,2353.137 581.212,2353.15C580.965,2353.163 580.736,2353.019 580.642,2352.79C564.661,2314.068 548.29,2275.087 532.023,2237.116C528.352,2226.577 513.846,2225.401 508.748,2235.524L500.846,2251.532C494.027,2265.509 486.438,2280.793 479.597,2295.008C479.597,2295.008 436.069,2383.443 431.51,2392.706C431.286,2393.161 431.413,2393.711 431.814,2394.021C433.263,2395.142 436.626,2397.742 438.275,2399.017C438.515,2399.203 438.824,2399.277 439.123,2399.222C439.422,2399.166 439.683,2398.985 439.84,2398.725C445.834,2388.818 493.319,2310.326 493.684,2309.731C500.84,2297.999 508.653,2285.339 516.051,2273.133C516.168,2272.939 516.387,2272.831 516.613,2272.856C516.838,2272.881 517.028,2273.034 517.101,2273.248C528.203,2306.041 540.617,2341.984 551.933,2374.266C556.929,2388.443 561.912,2402.625 566.966,2416.781C568.806,2421.847 572.884,2426.143 578.389,2427.989C588.248,2431.333 598.92,2425.683 601.835,2415.722L612.744,2383.232C630.147,2331.149 647.399,2278.183 664.218,2225.484C664.314,2225.186 664.593,2224.985 664.906,2224.99C665.219,2224.994 665.493,2225.203 665.579,2225.504C668.949,2237.233 672.331,2248.892 675.679,2260.287C685.796,2294.879 696.817,2331.451 707.457,2365.829C708.016,2368.018 708.889,2369.95 710,2371.619L710,2442.12C710,2468.563 688.563,2490 662.12,2490L477.453,2490C477.156,2490 476.867,2489.902 476.631,2489.722C457.299,2474.985 438.453,2459.752 421.161,2443.298C412.607,2435.236 403.479,2425.986 395.548,2417.282C379.508,2399.804 364.42,2381.572 352.559,2361.076C326.4,2316.618 312.562,2264.49 315.392,2212.886C316.216,2200.363 317.83,2187.671 320.751,2175.467C321.065,2174.238 321.893,2170.686 322.182,2169.527C322.553,2168.204 323.549,2165.048 323.922,2163.655C351.204,2075.514 443.187,2010.628 535.637,2015.16C561.342,2016.889 586.119,2025.438 609.443,2036.154C637.886,2049.35 664.476,2066.31 689.615,2085.03L693.462,2087.898L693.505,2087.932C695.324,2089.292 697.896,2089.328 699.78,2087.862C702.032,2086.104 702.434,2082.852 700.679,2080.598C686.502,2062.447 670.231,2045.755 652.687,2030.749C621.192,2004.201 584.741,1981.815 543.918,1973.331C465.886,1958.184 383.437,1988.87 327.543,2043.897C308.123,2063.018 291.777,2085.124 279.269,2109.433C278.071,2111.881 275.685,2116.914 274.502,2119.362C272.958,2122.749 271.137,2127.369 269.669,2130.806C267.99,2135.574 266.054,2140.322 264.652,2145.186L263.037,2150.496L262.236,2153.154L261.556,2155.849C260.836,2159.042 259.531,2163.44 258.978,2166.617C255.952,2180.668 254.15,2195.197 253.377,2209.543C251.4,2248.711 257.554,2288.211 270.508,2325.184C282.242,2358.498 299.504,2389.917 321.541,2417.523C328.923,2426.794 337.487,2436.055 345.675,2444.555C353.486,2452.676 362.788,2461.68 371.226,2469.229C378.696,2475.993 386.419,2482.518 394.335,2488.823Z",cp="M46.32 25H44.016V7.648H46.32L52.296 22.24L58.272 7.648H60.624V25H58.32V18.136C58.32 14.896 58.344 13.72 58.464 12.496L53.4 25H51.192L46.152 12.544C46.272 13.384 46.32 15.16 46.32 17.584V25ZM69.3444 25.288C65.8884 25.288 63.5124 22.792 63.5124 19.144C63.5124 15.472 65.8404 12.928 69.2484 12.928C72.5844 12.928 74.7684 15.232 74.7684 18.712V19.552L65.6964 19.576C65.8644 22.048 67.1604 23.416 69.3924 23.416C71.1444 23.416 72.2964 22.696 72.6804 21.352H74.7924C74.2164 23.872 72.2484 25.288 69.3444 25.288ZM69.2484 14.824C67.2804 14.824 66.0324 16 65.7444 18.064H72.5124C72.5124 16.12 71.2404 14.824 69.2484 14.824Z M81.9922 25.288C78.5843 25.288 76.5203 22.744 76.5203 19.168C76.5203 15.568 78.6083 12.928 82.0883 12.928C83.8883 12.928 85.4003 13.72 86.1923 15.16V7.336H88.4243V25H86.4083L86.2163 22.864C85.4483 24.472 83.8643 25.288 81.9922 25.288ZM82.4483 23.248C84.7523 23.248 86.1683 21.544 86.1683 19.096C86.1683 16.696 84.7523 14.968 82.4483 14.968C80.1443 14.968 78.8003 16.696 78.8003 19.096C78.8003 21.52 80.1443 23.248 82.4483 23.248Z M92.7829 10.48C91.9669 10.48 91.2949 9.808 91.2949 8.992C91.2949 8.152 91.9669 7.504 92.7829 7.504C93.5989 7.504 94.2709 8.152 94.2709 8.992C94.2709 9.808 93.5989 10.48 92.7829 10.48Z M91.6789 25V13.264H93.9349V25H91.6789Z M98.4101 25H95.8181L99.9221 19.192L95.8421 13.264H98.4581L101.434 17.632L104.338 13.264H106.906L102.826 19.192L106.834 25H104.218L101.29 20.704L98.4101 25Z M114.908 25H109.172V7.648H114.812C119.996 7.648 123.5 11.152 123.5 16.336C123.5 21.496 120.044 25 114.908 25ZM114.644 9.808H111.524V22.816H114.74C118.604 22.816 121.052 20.32 121.052 16.336C121.052 12.304 118.604 9.808 114.644 9.808Z M131.173 25.288C127.717 25.288 125.341 22.792 125.341 19.144C125.341 15.472 127.669 12.928 131.077 12.928C134.413 12.928 136.597 15.232 136.597 18.712V19.552L127.525 19.576C127.693 22.048 128.989 23.416 131.221 23.416C132.973 23.416 134.125 22.696 134.509 21.352H136.621C136.045 23.872 134.077 25.288 131.173 25.288ZM131.077 14.824C129.109 14.824 127.861 16 127.573 18.064H134.341C134.341 16.12 133.069 14.824 131.077 14.824Z M138.348 19.144C138.348 15.472 140.676 12.928 144.108 12.928C147.06 12.928 149.124 14.608 149.532 17.224H147.276C146.892 15.736 145.692 14.944 144.18 14.944C142.044 14.944 140.58 16.576 140.58 19.12C140.58 21.64 141.948 23.272 144.084 23.272C145.692 23.272 146.892 22.432 147.3 21.04H149.556C149.1 23.584 146.916 25.288 144.084 25.288C140.628 25.288 138.348 22.84 138.348 19.144Z M154.241 25H151.985V7.336H154.241V18.784L159.449 13.264H162.281L157.793 17.944L162.257 25H159.665L156.233 19.576L154.241 21.664V25Z";function up({variant:e,type:t,height:n,markColor:r,textColor:i,downloadFileName:s}){if(typeof window>"u")return;const a=4,l=532,d=44,c=119,u=32,h=n,m=Math.round(n*.3),p=t==="full"?Math.round(c*(n/u)):0,g=(t==="full"?h+m+p:h)*a,v=n*a,y=h*a/l,j=v/u,w=`
142
142
  <svg xmlns="http://www.w3.org/2000/svg" width="${g}" height="${v}" viewBox="0 0 ${g} ${v}">
143
143
  <g transform="scale(${y})">
144
- <path d="${op}" fill="${r}" fill-rule="evenodd" transform="translate(-178, -1958)"/>
144
+ <path d="${lp}" fill="${r}" fill-rule="evenodd" transform="translate(-178, -1958)"/>
145
145
  </g>
146
146
  ${t==="full"?`<g transform="translate(${(h+m)*a}, 0) scale(${j})">
147
147
  <svg viewBox="${d} 0 ${c} ${u}" width="${c}" height="${u}">
148
- <path d="${sp}" fill="${i}"/>
148
+ <path d="${cp}" fill="${i}"/>
149
149
  </svg>
150
150
  </g>`:""}
151
151
  </svg>
152
- `,A=new Blob([w],{type:"image/svg+xml;charset=utf-8"}),B=URL.createObjectURL(A),C=new Image;C.onload=()=>{const O=document.createElement("canvas");O.width=g,O.height=v;const E=O.getContext("2d");if(E){E.drawImage(C,0,0),URL.revokeObjectURL(B);const F=O.toDataURL("image/png"),L=document.createElement("a");L.href=F,L.download=s??`medixdeck-logo-${e}-${t}.png`,document.body.appendChild(L),L.click(),document.body.removeChild(L)}},C.src=B}function cn({variant:e="blue",type:t="full",height:n=32,downloadable:r=!1,downloadFileName:i,className:s,style:a}){const{themeMode:l}=hr(),d=l==="dark",c=d?cp[e]:lp[e],u=d?dp[e]:up[e],m={display:"inline-flex",alignItems:"center",gap:`${Math.round(n*.3)}px`,lineHeight:1,cursor:r?"pointer":"default",transition:"transform 0.15s ease, opacity 0.15s ease",...a},p=g=>{r&&(g.stopPropagation(),x())},x=()=>{ap({variant:e,type:t,height:n,markColor:c,textColor:u,downloadFileName:i})};return o.jsxs("span",{className:s,style:m,role:r?"button":"img",tabIndex:r?0:void 0,onClick:p,onKeyDown:g=>{r&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),x())},title:r?`Click to download MedixDeck logo (${e} ${t})`:void 0,"aria-label":"MedixDeck logo",suppressHydrationWarning:!0,children:[o.jsx(fp,{color:c,height:n}),t==="full"&&o.jsx(hp,{color:u,height:n})]})}const lp={blue:"#0685FF",purple:"#7700CC",black:"#111926",white:"#FFFFFF"},cp={blue:"#0685FF",purple:"#7700CC",black:"#FFFFFF",white:"#111926"},up={blue:"#111926",purple:"#111926",black:"#111926",white:"#FFFFFF"},dp={blue:"#FFFFFF",purple:"#FFFFFF",black:"#FFFFFF",white:"#111926"};function fp({color:e,height:t}){return o.jsx("svg",{width:t,height:t,viewBox:"0 0 532 532",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:{display:"block",flexShrink:0},children:o.jsx("g",{children:o.jsx("path",{d:`
152
+ `,A=new Blob([w],{type:"image/svg+xml;charset=utf-8"}),B=URL.createObjectURL(A),C=new Image;C.onload=()=>{const O=document.createElement("canvas");O.width=g,O.height=v;const E=O.getContext("2d");if(E){E.drawImage(C,0,0),URL.revokeObjectURL(B);const F=O.toDataURL("image/png"),L=document.createElement("a");L.href=F,L.download=s??`medixdeck-logo-${e}-${t}.png`,document.body.appendChild(L),L.click(),document.body.removeChild(L)}},C.src=B}function cn({variant:e="blue",type:t="full",height:n=32,downloadable:r=!1,downloadFileName:i,className:s,style:a}){const{themeMode:l}=hr(),d=l==="dark",c=d?fp[e]:dp[e],u=d?pp[e]:hp[e],m={display:"inline-flex",alignItems:"center",gap:`${Math.round(n*.3)}px`,lineHeight:1,cursor:r?"pointer":"default",transition:"transform 0.15s ease, opacity 0.15s ease",...a},p=g=>{r&&(g.stopPropagation(),x())},x=()=>{up({variant:e,type:t,height:n,markColor:c,textColor:u,downloadFileName:i})};return o.jsxs("span",{className:s,style:m,role:r?"button":"img",tabIndex:r?0:void 0,onClick:p,onKeyDown:g=>{r&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),x())},title:r?`Click to download MedixDeck logo (${e} ${t})`:void 0,"aria-label":"MedixDeck logo",suppressHydrationWarning:!0,children:[o.jsx(mp,{color:c,height:n}),t==="full"&&o.jsx(xp,{color:u,height:n})]})}const dp={blue:"#0685FF",purple:"#7700CC",black:"#111926",white:"#FFFFFF"},fp={blue:"#0685FF",purple:"#7700CC",black:"#FFFFFF",white:"#111926"},hp={blue:"#111926",purple:"#111926",black:"#111926",white:"#FFFFFF"},pp={blue:"#FFFFFF",purple:"#FFFFFF",black:"#FFFFFF",white:"#111926"};function mp({color:e,height:t}){return o.jsx("svg",{width:t,height:t,viewBox:"0 0 532 532",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:{display:"block",flexShrink:0},children:o.jsx("g",{children:o.jsx("path",{d:`
153
153
  M394.335,2488.823C394.554,2488.998 394.639,2489.292 394.547,2489.557
154
154
  C394.454,2489.822 394.204,2490 393.924,2490C375.317,2490 225.88,2490
155
155
  225.88,2490C199.437,2490 178,2468.563 178,2442.12L178,2005.88
@@ -214,7 +214,7 @@
214
214
  C328.923,2426.794 337.487,2436.055 345.675,2444.555
215
215
  C353.486,2452.676 362.788,2461.68 371.226,2469.229
216
216
  C378.696,2475.993 386.419,2482.518 394.335,2488.823Z
217
- `,fill:e,fillRule:"evenodd",transform:"translate(-178,-1958)"})})})}function hp({color:e,height:t}){const a=t/32,l=Math.round(119*a);return o.jsx("svg",{width:l,height:t,viewBox:"44 0 119 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:{display:"block",flexShrink:0},children:o.jsx("path",{d:`
217
+ `,fill:e,fillRule:"evenodd",transform:"translate(-178,-1958)"})})})}function xp({color:e,height:t}){const a=t/32,l=Math.round(119*a);return o.jsx("svg",{width:l,height:t,viewBox:"44 0 119 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:{display:"block",flexShrink:0},children:o.jsx("path",{d:`
218
218
  M46.32 25H44.016V7.648H46.32L52.296 22.24L58.272 7.648H60.624V25H58.32
219
219
  V18.136C58.32 14.896 58.344 13.72 58.464 12.496L53.4 25H51.192L46.152
220
220
  12.544C46.272 13.384 46.32 15.16 46.32 17.584V25Z
@@ -267,7 +267,7 @@
267
267
 
268
268
  M154.241 25H151.985V7.336H154.241V18.784L159.449 13.264H162.281
269
269
  L157.793 17.944L162.257 25H159.665L156.233 19.576L154.241 21.664V25Z
270
- `,fill:e})})}const Bi={sm:{h:"8",px:"3",fontSize:"sm"},md:{h:"10",px:"4",fontSize:"md"},lg:{h:"12",px:"4",fontSize:"lg"}},ss=k.forwardRef(({size:e="md",colorScheme:t="blue",leftElement:n,rightElement:r,isInvalid:i,errorMessage:s,...a},l)=>{const d=!!n,c=!!r,u=t==="purple"?"purple.500":"blue.500";return o.jsxs(f.Box,{w:"100%",children:[o.jsxs(f.Box,{position:"relative",children:[d&&o.jsx(f.Box,{position:"absolute",left:"3",top:"50%",transform:"translateY(-50%)",zIndex:"1",color:"text.muted",display:"flex",alignItems:"center",children:n}),o.jsx(f.Input,{ref:l,...Bi[e],pl:d?"10":Bi[e].px,pr:c?"10":Bi[e].px,bg:"bg.surface",border:"1px solid",borderColor:i?"red.500":"border",borderRadius:"md",color:"text.heading",fontFamily:"var(--font-body)",_placeholder:{color:"text.muted"},_focus:{borderColor:i?"red.500":u,boxShadow:"none",outline:"none"},_dark:{bg:"bg.surface",borderColor:i?"red.500":"border",color:"text.heading"},...a}),c&&o.jsx(f.Box,{position:"absolute",right:"3",top:"50%",transform:"translateY(-50%)",zIndex:"1",color:"text.muted",display:"flex",alignItems:"center",children:r})]}),i&&s&&o.jsx(f.Text,{mt:"1",fontSize:"xs",color:"red.500",fontFamily:"var(--font-body)",children:s})]})});ss.displayName="MedixInput";const as=k.forwardRef(({placeholder:e="Search…",...t},n)=>o.jsx(ss,{ref:n,type:"search",placeholder:e,leftElement:o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[o.jsx("circle",{cx:"11",cy:"11",r:"8"}),o.jsx("path",{d:"m21 21-4.35-4.35"})]}),...t}));as.displayName="MedixSearchInput";const un="medix_textarea_draft_";function uu(e,t,n,r){if(e)return e;if(t)return`id_${t}`;if(n)return`name_${n}`;if(r){const i=r.toLowerCase().trim().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"");if(i)return`ph_${i}`}return"default"}function du(e){if(!(typeof window>"u"))try{const t=e.startsWith(un)?e:`${un}${e}`;window.localStorage.removeItem(t)}catch{}}function fu(e,t){if(typeof window>"u")return null;try{const n=e.startsWith(un)?e:`${un}${e}`,r=window.localStorage.getItem(n);if(!r)return null;const i=JSON.parse(r);return!i||typeof i.content!="string"?null:t&&t>0&&i.updatedAt&&Date.now()-i.updatedAt>t?(window.localStorage.removeItem(n),null):i}catch{return null}}function co(e,t){if(!(typeof window>"u"))try{const n=e.startsWith(un)?e:`${un}${e}`;window.localStorage.setItem(n,JSON.stringify(t))}catch{}}const hu=k.forwardRef(({colorScheme:e="blue",isInvalid:t,errorMessage:n,maxLength:r,showCount:i=!1,onChange:s,value:a,defaultValue:l,storageKey:d,persistDraft:c=!0,debounceMs:u=400,draftMaxAgeMs:h=10080*60*1e3,showDraftStatus:m=!1,onDraftRestored:p,id:x,name:g,placeholder:v,disabled:y=!1,readOnly:j=!1,...w},A)=>{const B=a!==void 0,[C,O]=k.useState(()=>B&&typeof a=="string"?a:typeof l=="string"?l:""),E=B?typeof a=="string"?a:"":C,[F,L]=k.useState(E.length),[R,D]=k.useState("idle"),N=k.useRef(null);k.useImperativeHandle(A,()=>N.current);const P=k.useMemo(()=>uu(d,x,g,v),[d,x,g,v]),I=k.useRef(null),M=k.useRef(null),U=k.useRef(!1),G=k.useCallback(W=>{if(!c||y||j)return;if(!W||W.trim()===""){M.current&&(clearTimeout(M.current),M.current=null),I.current=null,du(P),D("idle");return}I.current=W,D("saving"),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{I.current!==null&&(co(P,{content:I.current,updatedAt:Date.now(),version:1}),I.current=null,D("saved"))},u)},[c,y,j,P,u]);k.useEffect(()=>{if(!c)return;const W=()=>{M.current&&(clearTimeout(M.current),M.current=null),I.current!==null&&(co(P,{content:I.current,updatedAt:Date.now(),version:1}),I.current=null,D("saved"))};return typeof window<"u"&&(window.addEventListener("beforeunload",W),window.addEventListener("pagehide",W)),()=>{typeof window<"u"&&(window.removeEventListener("beforeunload",W),window.removeEventListener("pagehide",W)),W()}},[c,P]),k.useEffect(()=>{if(U.current||!c||y||j)return;U.current=!0;const W=fu(P,h);if(!(!W||!W.content||W.content.trim()==="")&&!(B&&typeof a=="string"&&a.trim()!==""&&a===W.content)){if(B||O(W.content),L(W.content.length),N.current&&(N.current.value=W.content),s){const ne={target:{value:W.content,name:g},currentTarget:{value:W.content,name:g}};s(ne)}D("saved"),p==null||p(W)}},[c,y,j,P,h,B,a,g,s,p]),k.useEffect(()=>{B&&typeof a=="string"&&L(a.length)},[B,a]);const H=e==="purple"?"purple.500":"blue.500",b=W=>{const ne=W.target.value;B||O(ne),L(ne.length),s==null||s(W),G(ne)};return o.jsxs(f.Box,{w:"100%",children:[o.jsx(f.Textarea,{ref:N,id:x,name:g,placeholder:v,disabled:y,readOnly:j,bg:"bg.surface",border:"1px solid",borderColor:t?"red.500":"border",borderRadius:"md",color:"text.heading",fontFamily:"var(--font-body)",fontSize:"md",px:"4",py:"3",resize:"vertical",maxLength:r,value:B?a:C,onChange:b,_placeholder:{color:"text.muted"},_focus:{borderColor:t?"red.500":H,boxShadow:"none",outline:"none"},_dark:{bg:"bg.surface",borderColor:t?"red.500":"border",color:"text.heading",_placeholder:{color:"text.muted"}},...w}),o.jsxs(f.Box,{display:"flex",justifyContent:"space-between",mt:"1",children:[t&&n?o.jsx(f.Text,{fontSize:"xs",color:"red.500",fontFamily:"var(--font-body)",children:n}):m&&R!=="idle"?o.jsxs(f.Box,{display:"inline-flex",alignItems:"center",gap:"1.5",children:[o.jsx(f.Box,{w:"1.5",h:"1.5",borderRadius:"full",bg:R==="saving"?"orange.400":"green.500"}),o.jsx(f.Text,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:R==="saving"?"Saving draft...":"Draft saved"})]}):o.jsx("span",{}),i&&r&&o.jsxs(f.Text,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:[F,"/",r]})]})]})});hu.displayName="MedixTextarea";const pp={sm:{h:"8",px:"3",fontSize:"sm"},md:{h:"10",px:"4",fontSize:"md"},lg:{h:"12",px:"4",fontSize:"lg"}};function mp({options:e=[],placeholder:t="Select option...",isInvalid:n=!1,errorMessage:r,size:i="md",colorScheme:s="blue",icon:a,value:l,defaultValue:d,onChange:c,disabled:u=!1,name:h,id:m}){const[p,x]=k.useState(!1),[g,v]=k.useState(""),[y,j]=k.useState(()=>typeof d=="string"?d:Array.isArray(d)&&d.length>0?d[0]:""),w=k.useRef(null),A=k.useRef(null),B=l!==void 0,C=B?typeof l=="string"?l:Array.isArray(l)&&l.length>0?l[0]:"":y,O=e.find(N=>N.value===C);k.useEffect(()=>{function N(P){w.current&&!w.current.contains(P.target)&&x(!1)}return p&&document.addEventListener("mousedown",N),()=>{document.removeEventListener("mousedown",N)}},[p]),k.useEffect(()=>{if(p){const N=setTimeout(()=>{var P;return(P=A.current)==null?void 0:P.focus()},50);return()=>clearTimeout(N)}else v("")},[p]);const E=N=>{u||(B||j(N),c==null||c(N),x(!1))},F=k.useMemo(()=>{if(!g.trim())return e;const N=g.toLowerCase().trim();return e.filter(P=>P.label.toLowerCase().includes(N))},[e,g]),L=s==="purple"?"#7700CC":"#0685FF",R=n?"#DC2626":p?L:"var(--medix-form-border)",D=pp[i];return o.jsxs(f.Box,{w:"100%",position:"relative",zIndex:p?1e3:void 0,ref:w,children:[h&&o.jsx("input",{type:"hidden",name:h,id:m,value:C}),o.jsxs(f.Box,{onClick:()=>!u&&x(!p),display:"flex",alignItems:"center",justifyContent:"space-between",h:D.h,px:D.px,borderRadius:"md",bg:"bg.surface",cursor:u?"not-allowed":"pointer",opacity:u?.55:1,transition:"border-color 0.15s ease",style:{border:`1.5px solid ${R}`,boxShadow:"none",background:"var(--medix-form-bg)"},children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2.5",flex:"1",minW:"0",children:[a&&o.jsx(f.Box,{color:"text.muted",display:"flex",alignItems:"center",flexShrink:0,children:a}),O?o.jsx(f.Text,{fontSize:D.fontSize,color:"text.heading",fontFamily:"var(--font-body)",truncate:!0,fontWeight:"500",children:O.label}):o.jsx(f.Text,{fontSize:D.fontSize,color:"text.muted",fontFamily:"var(--font-body)",truncate:!0,children:t})]}),o.jsx(f.Box,{display:"flex",alignItems:"center",color:"text.muted",ml:"2",flexShrink:0,style:{transform:p?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s ease"},children:o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),p&&o.jsxs(f.Box,{position:"absolute",top:"100%",left:"0",right:"0",mt:"1.5",maxH:"280px",bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",zIndex:1e3,display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"none",children:[e.length>5&&o.jsx(f.Box,{p:"2",borderBottom:"1px solid",borderColor:"border",bg:"bg.surface",children:o.jsxs(f.Box,{position:"relative",display:"flex",alignItems:"center",children:[o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{position:"absolute",left:"10px",opacity:.5,pointerEvents:"none"},children:[o.jsx("circle",{cx:"11",cy:"11",r:"8"}),o.jsx("path",{d:"m21 21-4.35-4.35"})]}),o.jsx("input",{ref:A,type:"text",placeholder:"Search...",value:g,onChange:N=>v(N.target.value),style:{width:"100%",padding:"6px 10px 6px 30px",fontSize:"13px",fontFamily:"var(--font-body)",borderRadius:"6px",border:"1px solid var(--medix-form-border)",background:"var(--medix-form-bg)",color:"var(--medix-form-text)",outline:"none"}})]})}),o.jsx(f.Box,{overflowY:"auto",flex:"1",py:"1",children:F.length===0?o.jsx(f.Box,{px:"4",py:"3",fontSize:"xs",color:"text.muted",textAlign:"center",children:"No options found"}):F.map(N=>{const P=N.value===C;return o.jsxs("button",{type:"button",disabled:N.disabled,onClick:()=>E(N.value),style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between",padding:"8px 14px",background:P?"var(--medix-form-bg-subtle)":"transparent",border:"none",cursor:N.disabled?"not-allowed":"pointer",textAlign:"left",fontFamily:"var(--font-body)",fontSize:"13px",color:"var(--medix-form-text)",opacity:N.disabled?.5:1,transition:"background 0.1s ease"},onMouseEnter:I=>{N.disabled||(I.currentTarget.style.background="var(--medix-form-bg-subtle)")},onMouseLeave:I=>{N.disabled||(I.currentTarget.style.background=P?"var(--medix-form-bg-subtle)":"transparent")},children:[o.jsx("span",{style:{fontWeight:P?600:400},children:N.label}),P&&o.jsx("span",{style:{color:L,fontWeight:700,fontSize:"14px"},children:"✓"})]},N.value)})})]}),n&&r&&o.jsx(f.Text,{mt:"1",fontSize:"xs",color:"red.500",fontFamily:"var(--font-body)",children:r})]})}function xp({options:e=[],placeholder:t="Select options...",isInvalid:n=!1,errorMessage:r,size:i="md",colorScheme:s="blue",icon:a,value:l,defaultValue:d,onChange:c,disabled:u=!1,name:h,id:m}){const[p,x]=k.useState(!1),[g,v]=k.useState(""),[y,j]=k.useState(()=>Array.isArray(d)?d:typeof d=="string"&&d?[d]:[]),w=k.useRef(null),A=k.useRef(null),B=l!==void 0,C=B?Array.isArray(l)?l:typeof l=="string"&&l?[l]:[]:y;k.useEffect(()=>{function I(M){w.current&&!w.current.contains(M.target)&&x(!1)}return p&&document.addEventListener("mousedown",I),()=>{document.removeEventListener("mousedown",I)}},[p]),k.useEffect(()=>{if(p){const I=setTimeout(()=>{var M;return(M=A.current)==null?void 0:M.focus()},50);return()=>clearTimeout(I)}else v("")},[p]);const O=I=>{if(u)return;const U=C.includes(I)?C.filter(G=>G!==I):[...C,I];B||j(U),c==null||c(U)},E=(I,M)=>{if(M.stopPropagation(),u)return;const U=C.filter(G=>G!==I);B||j(U),c==null||c(U)},F=k.useMemo(()=>{if(!g.trim())return e;const I=g.toLowerCase().trim();return e.filter(M=>M.label.toLowerCase().includes(I))},[e,g]),L=s==="purple"?"#7700CC":"#0685FF",R=n?"#DC2626":p?L:"var(--medix-form-border)",D=s==="purple"?"purple.50":"blue.50",N=s==="purple"?"purple.700":"blue.700",P=s==="purple"?"purple.200":"blue.200";return o.jsxs(f.Box,{w:"100%",position:"relative",zIndex:p?1e3:void 0,ref:w,children:[h&&o.jsx("input",{type:"hidden",name:h,id:m,value:C.join(",")}),o.jsxs(f.Box,{onClick:()=>!u&&x(!p),display:"flex",alignItems:"center",justifyContent:"space-between",minH:i==="sm"?"34px":i==="lg"?"48px":"42px",py:"1.5",px:"3",borderRadius:"md",bg:"bg.surface",cursor:u?"not-allowed":"pointer",opacity:u?.55:1,transition:"border-color 0.15s ease",style:{border:`1.5px solid ${R}`,boxShadow:"none",background:"var(--medix-form-bg)"},children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"1.5",flex:"1",minW:"0",children:[a&&o.jsx(f.Box,{color:"text.muted",display:"flex",alignItems:"center",mr:"1",children:a}),C.length===0?o.jsx(f.Text,{fontSize:i==="sm"?"xs":"sm",color:"text.muted",fontFamily:"var(--font-body)",children:t}):C.map(I=>{const M=e.find(G=>G.value===I),U=M?M.label:I;return o.jsxs(f.Box,{as:"span",display:"inline-flex",alignItems:"center",gap:"1",px:"2.5",py:"0.5",borderRadius:"full",fontSize:"xs",fontWeight:"500",fontFamily:"var(--font-body)",bg:D,color:N,border:"1px solid",borderColor:P,_dark:{bg:s==="purple"?"rgba(119, 0, 204, 0.2)":"rgba(6, 133, 255, 0.2)",color:s==="purple"?"purple.300":"blue.300",borderColor:s==="purple"?"rgba(119, 0, 204, 0.4)":"rgba(6, 133, 255, 0.4)"},children:[o.jsx("span",{children:U}),!u&&o.jsx("button",{type:"button",onClick:G=>E(I,G),"aria-label":`Remove ${U}`,style:{background:"transparent",border:"none",padding:0,marginLeft:"2px",cursor:"pointer",color:"inherit",fontSize:"13px",lineHeight:1,opacity:.75},onMouseEnter:G=>G.currentTarget.style.opacity="1",onMouseLeave:G=>G.currentTarget.style.opacity="0.75",children:"×"})]},I)})]}),o.jsx(f.Box,{display:"flex",alignItems:"center",color:"text.muted",ml:"2",style:{transform:p?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s ease"},children:o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),p&&o.jsxs(f.Box,{position:"absolute",top:"100%",left:"0",right:"0",mt:"1.5",maxH:"280px",bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",zIndex:1e3,display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"none",children:[e.length>5&&o.jsx(f.Box,{p:"2",borderBottom:"1px solid",borderColor:"border",bg:"bg.surface",children:o.jsxs(f.Box,{position:"relative",display:"flex",alignItems:"center",children:[o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{position:"absolute",left:"10px",opacity:.5,pointerEvents:"none"},children:[o.jsx("circle",{cx:"11",cy:"11",r:"8"}),o.jsx("path",{d:"m21 21-4.35-4.35"})]}),o.jsx("input",{ref:A,type:"text",placeholder:"Search options...",value:g,onChange:I=>v(I.target.value),style:{width:"100%",padding:"6px 10px 6px 30px",fontSize:"13px",fontFamily:"var(--font-body)",borderRadius:"6px",border:"1px solid var(--medix-form-border)",background:"var(--medix-form-bg)",color:"var(--medix-form-text)",outline:"none"}})]})}),o.jsx(f.Box,{overflowY:"auto",flex:"1",py:"1",children:F.length===0?o.jsx(f.Box,{px:"4",py:"3",fontSize:"xs",color:"text.muted",textAlign:"center",children:"No options found"}):F.map(I=>{const M=C.includes(I.value);return o.jsxs("button",{type:"button",disabled:I.disabled,onClick:()=>O(I.value),style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between",padding:"8px 14px",background:M?"var(--medix-form-bg-subtle)":"transparent",border:"none",cursor:I.disabled?"not-allowed":"pointer",textAlign:"left",fontFamily:"var(--font-body)",fontSize:"13px",color:"var(--medix-form-text)",opacity:I.disabled?.5:1,transition:"background 0.1s ease"},onMouseEnter:U=>{I.disabled||(U.currentTarget.style.background="var(--medix-form-bg-subtle)")},onMouseLeave:U=>{I.disabled||(U.currentTarget.style.background=M?"var(--medix-form-bg-subtle)":"transparent")},children:[o.jsx("span",{style:{fontWeight:M?600:400},children:I.label}),M&&o.jsx("span",{style:{color:L,fontWeight:700,fontSize:"14px"},children:"✓"})]},I.value)})})]}),n&&r&&o.jsx(f.Text,{mt:"1",fontSize:"xs",color:"red.500",fontFamily:"var(--font-body)",children:r})]})}function gp(e){return e.multiple?o.jsx(xp,{...e}):o.jsx(mp,{...e})}const pu={blue:{solid:"#0685FF",ring:"rgba(6,133,255,0.30)",tint:"#E8F3FF"},purple:{solid:"#7700CC",ring:"rgba(119,0,204,0.25)",tint:"#F9F0FF"},green:{solid:"#1B7A38",ring:"rgba(27,122,56,0.25)",tint:"#F0FDF4"}},mu=k.forwardRef(({colorScheme:e="blue",checked:t,defaultChecked:n=!1,onChange:r,disabled:i=!1,indeterminate:s=!1,children:a,description:l,name:d,value:c,id:u},h)=>{const m=pu[e],p=u??k.useId(),[x,g]=k.useState(n),[v,y]=k.useState(!1),j=t!==void 0?t:x,w=B=>{t===void 0&&g(B.target.checked),r==null||r(B.target.checked)},A={width:18,height:18,borderRadius:4,border:`2px solid ${j||s?m.solid:"var(--medix-form-border, #CBD5E1)"}`,background:j||s?m.solid:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:2,transition:"background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease",boxShadow:"none",pointerEvents:"none"};return o.jsxs(f.Box,{opacity:i?.55:1,children:[o.jsxs("label",{htmlFor:p,style:{display:"inline-flex",alignItems:"flex-start",gap:10,cursor:i?"not-allowed":"pointer",userSelect:"none"},children:[o.jsx("input",{ref:h,id:p,type:"checkbox",name:d,value:c,checked:j,disabled:i,onChange:w,onFocus:()=>y(!0),onBlur:()=>y(!1),style:{position:"absolute",width:1,height:1,opacity:0,margin:0,padding:0,pointerEvents:"none"}}),o.jsx("span",{style:A,"aria-hidden":"true",children:s?o.jsx("svg",{width:"10",height:"2",viewBox:"0 0 10 2",fill:"none",children:o.jsx("rect",{width:"10",height:"2",rx:"1",fill:"#fff"})}):j?o.jsx("svg",{width:"11",height:"9",viewBox:"0 0 11 9",fill:"none",children:o.jsx("path",{d:"M1 4.5L4 7.5L10 1",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):null}),a&&o.jsxs(f.Box,{children:[o.jsx(f.Text,{as:"span",fontFamily:"var(--font-body)",fontSize:"md",color:"text.body",lineHeight:"1.5",children:a}),l&&o.jsx(f.Text,{display:"block",fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:l})]})]}),!a&&l&&o.jsx(f.Text,{mt:"1",ml:"7",fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:l})]})});mu.displayName="MedixCheckbox";function yp({name:e,value:t,onChange:n,options:r,colorScheme:i="blue",direction:s="column"}){const a=pu[i],[l,d]=k.useState(""),c=t!==void 0?t:l,u=h=>{t===void 0&&d(h),n==null||n(h)};return o.jsx(f.Box,{display:"flex",flexDirection:s,gap:s==="row"?"5":"3",role:"radiogroup",children:r.map(h=>{const m=c===h.value;return o.jsx(bp,{option:h,name:e,isSelected:m,onChange:u,solidColor:a.solid,ring:a.ring},h.value)})})}function bp({option:e,name:t,isSelected:n,onChange:r,solidColor:i,ring:s}){const[a,l]=k.useState(!1);return o.jsxs("label",{style:{display:"inline-flex",alignItems:"flex-start",gap:10,cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.55:1,userSelect:"none"},children:[o.jsx("input",{type:"radio",name:t,value:e.value,checked:n,disabled:e.disabled,onChange:()=>r(e.value),onFocus:()=>l(!0),onBlur:()=>l(!1),style:{position:"absolute",width:1,height:1,opacity:0,margin:0,padding:0,pointerEvents:"none"}}),o.jsx("span",{"aria-hidden":"true",style:{width:18,height:18,borderRadius:"50%",border:`2px solid ${n?i:"var(--medix-form-border, #CBD5E1)"}`,display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:2,transition:"border-color 0.15s ease, box-shadow 0.15s ease",boxShadow:"none",pointerEvents:"none"},children:o.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:i,transform:n?"scale(1)":"scale(0)",transition:"transform 0.15s ease"}})}),o.jsxs(f.Box,{children:[o.jsx(f.Text,{as:"span",fontFamily:"var(--font-body)",fontSize:"md",color:"text.body",lineHeight:"1.5",children:e.label}),e.description&&o.jsx(f.Text,{display:"block",fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:e.description})]})]})}const vp={blue:{solid:"#0685FF",ring:"rgba(6,133,255,0.30)",track:"#0685FF"},purple:{solid:"#7700CC",ring:"rgba(119,0,204,0.25)",track:"#7700CC"},green:{solid:"#1B7A38",ring:"rgba(27,122,56,0.25)",track:"#1B7A38"}},kp={sm:{width:32,height:18,thumbSize:12,thumbOffset:2},md:{width:42,height:24,thumbSize:16,thumbOffset:3},lg:{width:52,height:30,thumbSize:20,thumbOffset:4}},xu=k.forwardRef(({colorScheme:e="blue",size:t="md",checked:n,defaultChecked:r=!1,onChange:i,disabled:s=!1,label:a,description:l,name:d,id:c},u)=>{const h=vp[e],m=kp[t],p=c??k.useId(),[x,g]=k.useState(r),[v,y]=k.useState(!1),j=n!==void 0?n:x,w=C=>{n===void 0&&g(C.target.checked),i==null||i(C.target.checked)},A={position:"relative",display:"inline-flex",alignItems:"center",width:m.width,height:m.height,borderRadius:m.height,background:j?h.track:"var(--medix-form-border, #CBD5E1)",transition:"background 0.2s ease, box-shadow 0.2s ease",boxShadow:"none",cursor:s?"not-allowed":"pointer",flexShrink:0},B={position:"absolute",width:m.thumbSize,height:m.thumbSize,borderRadius:"50%",background:"#fff",boxShadow:"none",top:m.thumbOffset,left:j?m.width-m.thumbSize-m.thumbOffset:m.thumbOffset,transition:"left 0.18s ease"};return o.jsxs(f.Box,{display:"flex",alignItems:"flex-start",gap:"3",opacity:s?.55:1,children:[o.jsxs("label",{htmlFor:p,style:{display:"inline-flex",cursor:s?"not-allowed":"pointer"},children:[o.jsx("input",{ref:u,id:p,type:"checkbox",role:"switch",name:d,checked:j,disabled:s,onChange:w,onFocus:()=>y(!0),onBlur:()=>y(!1),style:{position:"absolute",width:1,height:1,opacity:0,margin:0,padding:0,pointerEvents:"none"}}),o.jsx("span",{style:A,"aria-hidden":"true",children:o.jsx("span",{style:B})})]}),(a||l)&&o.jsxs(f.Box,{children:[a&&o.jsx("label",{htmlFor:p,style:{display:"block",fontSize:"1rem",fontWeight:500,color:"inherit",fontFamily:"var(--font-body)",lineHeight:"1.4",cursor:s?"not-allowed":"pointer",userSelect:"none"},children:a}),l&&o.jsx(f.Text,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:l})]})]})});xu.displayName="MedixSwitch";function wp({id:e,label:t,helperText:n,errorMessage:r,isRequired:i=!1,isDisabled:s=!1,children:a}){const l=!!r;return o.jsxs(f.Box,{display:"flex",flexDirection:"column",gap:"1.5",opacity:s?.5:1,pointerEvents:s?"none":void 0,w:"100%",children:[t&&o.jsxs(f.Box,{as:"label",htmlFor:e,display:"flex",alignItems:"center",gap:"1",children:[o.jsx(f.Text,{as:"span",fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:t}),i&&o.jsx(f.Text,{as:"span",color:"red.500",fontSize:"sm",lineHeight:"1",children:"*"})]}),k.cloneElement(a,{id:e,isInvalid:l||void 0}),n&&!l&&o.jsx(f.Text,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:n}),l&&r&&o.jsx(f.Text,{fontSize:"xs",color:"red.500",fontFamily:"var(--font-body)",children:r})]})}function gu({length:e=6,value:t,defaultValue:n="",onChange:r,onComplete:i,colorScheme:s="blue",isInvalid:a=!1,isDisabled:l=!1,mask:d=!1,label:c,helperText:u,errorMessage:h}){const[m,p]=k.useState(n),[x,g]=k.useState(null),v=t!==void 0,j=(v?t:m).split("").slice(0,e),w=k.useRef([]),A=a?"#DC2626":"var(--medix-form-border, var(--chakra-colors-border, #E2E8F0))",B=a?"#DC2626":s==="purple"?"#7700CC":"#0685FF",C=(F,L)=>{var R,D,N;if(F.key==="Backspace"){F.preventDefault();const P=[...j];if(P[L]){P[L]="";const I=P.join("");v||p(I),r==null||r(I)}else if(L>0){(R=w.current[L-1])==null||R.focus(),P[L-1]="";const I=P.join("");v||p(I),r==null||r(I)}}else F.key==="ArrowLeft"&&L>0?(D=w.current[L-1])==null||D.focus():F.key==="ArrowRight"&&L<e-1&&((N=w.current[L+1])==null||N.focus())},O=(F,L)=>{var P;const R=F.target.value.replace(/\D/g,""),D=[...j];for(;D.length<e;)D.push("");if(!R){D[L]="";const I=D.join("");v||p(I),r==null||r(I);return}D[L]=R[0];const N=D.join("");v||p(N),r==null||r(N),L<e-1&&((P=w.current[L+1])==null||P.focus()),N.replace(/\s/g,"").length===e&&(i==null||i(N))},E=(F,L)=>{var M;F.preventDefault();const R=F.clipboardData.getData("text").replace(/\D/g,"");if(!R)return;const D=[...j];for(;D.length<e;)D.push("");const N=R.split("").slice(0,e-L);N.forEach((U,G)=>{D[L+G]=U});const P=D.join("");v||p(P),r==null||r(P);const I=P.replace(/\s/g,"").length===e?e-1:Math.min(L+N.length,e-1);(M=w.current[I])==null||M.focus(),P.replace(/\s/g,"").length===e&&(i==null||i(P))};return o.jsxs(f.Box,{w:"fit-content",children:[c&&o.jsx(f.Text,{mb:"2",fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:c}),o.jsx(f.Box,{display:"flex",gap:"2",alignItems:"center",children:Array.from({length:e}).map((F,L)=>o.jsx("input",{ref:R=>{w.current[L]=R},type:d?"password":"text",inputMode:"numeric",pattern:"\\d*",maxLength:1,value:j[L]??"",onChange:R=>O(R,L),onKeyDown:R=>C(R,L),onPaste:R=>E(R,L),onFocus:R=>{R.target.select(),g(L)},onBlur:()=>g(null),disabled:l,"aria-label":`Digit ${L+1} of ${e}`,style:{width:"48px",height:"48px",borderRadius:"10px",border:`1.5px solid ${x===L?B:A}`,boxShadow:"none",background:"var(--medix-form-bg, var(--chakra-colors-bg-surface, #FFFFFF))",color:"var(--medix-form-text, var(--chakra-colors-text-heading, #0F172A))",fontSize:"20px",fontWeight:600,textAlign:"center",fontFamily:"var(--font-body)",outline:"none",transition:"border-color 0.15s, box-shadow 0.15s",cursor:l?"not-allowed":"text",opacity:l?.5:1}},L))}),(u||h)&&o.jsx(f.Text,{mt:"2",fontSize:"xs",color:a?"red.500":"text.muted",fontFamily:"var(--font-body)",children:a?h:u})]})}const Sp=gu;function Yr(){return Yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yr.apply(this,arguments)}function Cp(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var jp=["cdnSuffix","cdnUrl","countryCode","style","svg"],Tp="https://cdn.jsdelivr.net/gh/lipis/flag-icons/flags/4x3/",Bp="svg",Ep=127397,ba=function(t){var n=t.cdnSuffix,r=n===void 0?Bp:n,i=t.cdnUrl,s=i===void 0?Tp:i,a=t.countryCode,l=t.style,d=t.svg,c=d===void 0?!1:d,u=Cp(t,jp);if(typeof a!="string")return null;if(c){var h=""+s+a.toLowerCase()+"."+r;return k.createElement("img",Object.assign({},u,{src:h,style:Yr({display:"inline-block",width:"1em",height:"1em",verticalAlign:"middle"},l)}))}var m=a.toUpperCase().replace(/./g,function(p){return String.fromCodePoint(p.charCodeAt(0)+Ep)});return k.createElement("span",Object.assign({role:"img"},u,{style:Yr({display:"inline-block",fontSize:"1em",lineHeight:"1em",verticalAlign:"middle"},l)}),m)};const Fp={"+1":"US","+7":"RU","+39":"IT","+44":"GB","+47":"NO","+212":"MA","+262":"RE","+290":"SH","+358":"FI","+590":"GP","+599":"CW"},Zt=[{country:"AF",code:"+93",name:"Afghanistan",flag:"🇦🇫"},{country:"AL",code:"+355",name:"Albania",flag:"🇦🇱"},{country:"DZ",code:"+213",name:"Algeria",flag:"🇩🇿"},{country:"AS",code:"+1",name:"American Samoa",flag:"🇦🇸"},{country:"AD",code:"+376",name:"Andorra",flag:"🇦🇩"},{country:"AO",code:"+244",name:"Angola",flag:"🇦🇴"},{country:"AI",code:"+1",name:"Anguilla",flag:"🇦🇮"},{country:"AG",code:"+1",name:"Antigua & Barbuda",flag:"🇦🇬"},{country:"AR",code:"+54",name:"Argentina",flag:"🇦🇷"},{country:"AM",code:"+374",name:"Armenia",flag:"🇦🇲"},{country:"AW",code:"+297",name:"Aruba",flag:"🇦🇼"},{country:"AU",code:"+61",name:"Australia",flag:"🇦🇺"},{country:"AT",code:"+43",name:"Austria",flag:"🇦🇹"},{country:"AZ",code:"+994",name:"Azerbaijan",flag:"🇦🇿"},{country:"BS",code:"+1",name:"Bahamas",flag:"🇧🇸"},{country:"BH",code:"+973",name:"Bahrain",flag:"🇧🇭"},{country:"BD",code:"+880",name:"Bangladesh",flag:"🇧🇩"},{country:"BB",code:"+1",name:"Barbados",flag:"🇧🇧"},{country:"BY",code:"+375",name:"Belarus",flag:"🇧🇾"},{country:"BE",code:"+32",name:"Belgium",flag:"🇧🇪"},{country:"BZ",code:"+501",name:"Belize",flag:"🇧🇿"},{country:"BJ",code:"+229",name:"Benin",flag:"🇧🇯"},{country:"BM",code:"+1",name:"Bermuda",flag:"🇧🇲"},{country:"BT",code:"+975",name:"Bhutan",flag:"🇧🇹"},{country:"BO",code:"+591",name:"Bolivia",flag:"🇧🇴"},{country:"BA",code:"+387",name:"Bosnia & Herzegovina",flag:"🇧🇦"},{country:"BW",code:"+267",name:"Botswana",flag:"🇧🇼"},{country:"BR",code:"+55",name:"Brazil",flag:"🇧🇷"},{country:"IO",code:"+246",name:"British Indian Ocean Territory",flag:"🇮🇴"},{country:"VG",code:"+1",name:"British Virgin Islands",flag:"🇻🇬"},{country:"BN",code:"+673",name:"Brunei",flag:"🇧🇳"},{country:"BG",code:"+359",name:"Bulgaria",flag:"🇧🇬"},{country:"BF",code:"+226",name:"Burkina Faso",flag:"🇧🇫"},{country:"BI",code:"+257",name:"Burundi",flag:"🇧🇮"},{country:"KH",code:"+855",name:"Cambodia",flag:"🇰🇭"},{country:"CM",code:"+237",name:"Cameroon",flag:"🇨🇲"},{country:"CA",code:"+1",name:"Canada",flag:"🇨🇦"},{country:"CV",code:"+238",name:"Cape Verde",flag:"🇨🇻"},{country:"BQ",code:"+599",name:"Caribbean Netherlands",flag:"🇧🇶"},{country:"KY",code:"+1",name:"Cayman Islands",flag:"🇰🇾"},{country:"CF",code:"+236",name:"Central African Republic",flag:"🇨🇫"},{country:"TD",code:"+235",name:"Chad",flag:"🇹🇩"},{country:"CL",code:"+56",name:"Chile",flag:"🇨🇱"},{country:"CN",code:"+86",name:"China",flag:"🇨🇳"},{country:"CO",code:"+57",name:"Colombia",flag:"🇨🇴"},{country:"KM",code:"+269",name:"Comoros",flag:"🇰🇲"},{country:"CD",code:"+243",name:"DR Congo",flag:"🇨🇩"},{country:"CG",code:"+242",name:"Congo",flag:"🇨🇬"},{country:"CK",code:"+682",name:"Cook Islands",flag:"🇨🇰"},{country:"CR",code:"+506",name:"Costa Rica",flag:"🇨🇷"},{country:"HR",code:"+385",name:"Croatia",flag:"🇭🇷"},{country:"CU",code:"+53",name:"Cuba",flag:"🇨🇺"},{country:"CW",code:"+599",name:"Curaçao",flag:"🇨🇼"},{country:"CY",code:"+357",name:"Cyprus",flag:"🇨🇾"},{country:"CZ",code:"+420",name:"Czech Republic",flag:"🇨🇿"},{country:"DK",code:"+45",name:"Denmark",flag:"🇩🇰"},{country:"DJ",code:"+253",name:"Djibouti",flag:"🇩🇯"},{country:"DM",code:"+1",name:"Dominica",flag:"🇩🇲"},{country:"DO",code:"+1",name:"Dominican Republic",flag:"🇩🇴"},{country:"EC",code:"+593",name:"Ecuador",flag:"🇪🇨"},{country:"EG",code:"+20",name:"Egypt",flag:"🇪🇬"},{country:"SV",code:"+503",name:"El Salvador",flag:"🇸🇻"},{country:"GQ",code:"+240",name:"Equatorial Guinea",flag:"🇬🇶"},{country:"ER",code:"+291",name:"Eritrea",flag:"🇪🇷"},{country:"EE",code:"+372",name:"Estonia",flag:"🇪🇪"},{country:"SZ",code:"+268",name:"Eswatini",flag:"🇸🇿"},{country:"ET",code:"+251",name:"Ethiopia",flag:"🇪🇹"},{country:"FK",code:"+500",name:"Falkland Islands",flag:"🇫🇰"},{country:"FO",code:"+298",name:"Faroe Islands",flag:"🇫🇴"},{country:"FJ",code:"+679",name:"Fiji",flag:"🇫🇯"},{country:"FI",code:"+358",name:"Finland",flag:"🇫🇮"},{country:"FR",code:"+33",name:"France",flag:"🇫🇷"},{country:"GF",code:"+594",name:"French Guiana",flag:"🇬🇫"},{country:"PF",code:"+689",name:"French Polynesia",flag:"🇵🇫"},{country:"GA",code:"+241",name:"Gabon",flag:"🇬🇦"},{country:"GM",code:"+220",name:"Gambia",flag:"🇬🇲"},{country:"GE",code:"+995",name:"Georgia",flag:"🇬🇪"},{country:"DE",code:"+49",name:"Germany",flag:"🇩🇪"},{country:"GH",code:"+233",name:"Ghana",flag:"🇬🇭"},{country:"GI",code:"+350",name:"Gibraltar",flag:"🇬🇮"},{country:"GR",code:"+30",name:"Greece",flag:"🇬🇷"},{country:"GL",code:"+299",name:"Greenland",flag:"🇬🇱"},{country:"GD",code:"+1",name:"Grenada",flag:"🇬🇩"},{country:"GP",code:"+590",name:"Guadeloupe",flag:"🇬🇵"},{country:"GU",code:"+1",name:"Guam",flag:"🇬🇺"},{country:"GT",code:"+502",name:"Guatemala",flag:"🇬🇹"},{country:"GG",code:"+44",name:"Guernsey",flag:"🇬🇬"},{country:"GN",code:"+224",name:"Guinea",flag:"🇬🇳"},{country:"GW",code:"+245",name:"Guinea-Bissau",flag:"🇬🇼"},{country:"GY",code:"+592",name:"Guyana",flag:"🇬🇾"},{country:"HT",code:"+509",name:"Haiti",flag:"🇭🇹"},{country:"HN",code:"+504",name:"Honduras",flag:"🇭🇳"},{country:"HK",code:"+852",name:"Hong Kong",flag:"🇭🇰"},{country:"HU",code:"+36",name:"Hungary",flag:"🇭🇺"},{country:"IS",code:"+354",name:"Iceland",flag:"🇮🇸"},{country:"IN",code:"+91",name:"India",flag:"🇮🇳"},{country:"ID",code:"+62",name:"Indonesia",flag:"🇮🇩"},{country:"IR",code:"+98",name:"Iran",flag:"🇮🇷"},{country:"IQ",code:"+964",name:"Iraq",flag:"🇮🇶"},{country:"IE",code:"+353",name:"Ireland",flag:"🇮🇪"},{country:"IM",code:"+44",name:"Isle of Man",flag:"🇮🇲"},{country:"IL",code:"+972",name:"Israel",flag:"🇮🇱"},{country:"IT",code:"+39",name:"Italy",flag:"🇮🇹"},{country:"CI",code:"+225",name:"Ivory Coast",flag:"🇨🇮"},{country:"JM",code:"+1",name:"Jamaica",flag:"🇯🇲"},{country:"JP",code:"+81",name:"Japan",flag:"🇯🇵"},{country:"JE",code:"+44",name:"Jersey",flag:"🇯🇪"},{country:"JO",code:"+962",name:"Jordan",flag:"🇯🇴"},{country:"KZ",code:"+7",name:"Kazakhstan",flag:"🇰🇿"},{country:"KE",code:"+254",name:"Kenya",flag:"🇰🇪"},{country:"KI",code:"+686",name:"Kiribati",flag:"🇰🇮"},{country:"XK",code:"+383",name:"Kosovo",flag:"🇽🇰"},{country:"KW",code:"+965",name:"Kuwait",flag:"🇰🇼"},{country:"KG",code:"+996",name:"Kyrgyzstan",flag:"🇰🇬"},{country:"LA",code:"+856",name:"Laos",flag:"🇱🇦"},{country:"LV",code:"+371",name:"Latvia",flag:"🇱🇻"},{country:"LB",code:"+961",name:"Lebanon",flag:"🇱🇧"},{country:"LS",code:"+266",name:"Lesotho",flag:"🇱🇸"},{country:"LR",code:"+231",name:"Liberia",flag:"🇱🇷"},{country:"LY",code:"+218",name:"Libya",flag:"🇱🇾"},{country:"LI",code:"+423",name:"Liechtenstein",flag:"🇱🇮"},{country:"LT",code:"+370",name:"Lithuania",flag:"🇱🇹"},{country:"LU",code:"+352",name:"Luxembourg",flag:"🇱🇺"},{country:"MO",code:"+853",name:"Macao",flag:"🇲🇴"},{country:"MK",code:"+389",name:"North Macedonia",flag:"🇲🇰"},{country:"MG",code:"+261",name:"Madagascar",flag:"🇲🇬"},{country:"MW",code:"+265",name:"Malawi",flag:"🇲🇼"},{country:"MY",code:"+60",name:"Malaysia",flag:"🇲🇾"},{country:"MV",code:"+960",name:"Maldives",flag:"🇲🇻"},{country:"ML",code:"+223",name:"Mali",flag:"🇲🇱"},{country:"MT",code:"+356",name:"Malta",flag:"🇲🇹"},{country:"MH",code:"+692",name:"Marshall Islands",flag:"🇲🇭"},{country:"MQ",code:"+596",name:"Martinique",flag:"🇲🇶"},{country:"MR",code:"+222",name:"Mauritania",flag:"🇲🇷"},{country:"MU",code:"+230",name:"Mauritius",flag:"🇲🇺"},{country:"YT",code:"+262",name:"Mayotte",flag:"🇾🇹"},{country:"MX",code:"+52",name:"Mexico",flag:"🇲🇽"},{country:"FM",code:"+691",name:"Micronesia",flag:"🇫🇲"},{country:"MD",code:"+373",name:"Moldova",flag:"🇲🇩"},{country:"MC",code:"+377",name:"Monaco",flag:"🇲🇨"},{country:"MN",code:"+976",name:"Mongolia",flag:"🇲🇳"},{country:"ME",code:"+382",name:"Montenegro",flag:"🇲🇪"},{country:"MS",code:"+1",name:"Montserrat",flag:"🇲🇸"},{country:"MA",code:"+212",name:"Morocco",flag:"🇲🇦"},{country:"MZ",code:"+258",name:"Mozambique",flag:"🇲🇿"},{country:"MM",code:"+95",name:"Myanmar",flag:"🇲🇲"},{country:"NA",code:"+264",name:"Namibia",flag:"🇳🇦"},{country:"NR",code:"+674",name:"Nauru",flag:"🇳🇷"},{country:"NP",code:"+977",name:"Nepal",flag:"🇳🇵"},{country:"NL",code:"+31",name:"Netherlands",flag:"🇳🇱"},{country:"NC",code:"+687",name:"New Caledonia",flag:"🇳🇨"},{country:"NZ",code:"+64",name:"New Zealand",flag:"🇳🇿"},{country:"NI",code:"+505",name:"Nicaragua",flag:"🇳🇮"},{country:"NE",code:"+227",name:"Niger",flag:"🇳🇪"},{country:"NG",code:"+234",name:"Nigeria",flag:"🇳🇬"},{country:"NU",code:"+683",name:"Niue",flag:"🇳🇺"},{country:"NF",code:"+672",name:"Norfolk Island",flag:"🇳🇫"},{country:"KP",code:"+850",name:"North Korea",flag:"🇰🇵"},{country:"MP",code:"+1",name:"Northern Mariana Islands",flag:"🇲🇵"},{country:"NO",code:"+47",name:"Norway",flag:"🇳🇴"},{country:"OM",code:"+968",name:"Oman",flag:"🇴🇲"},{country:"PK",code:"+92",name:"Pakistan",flag:"🇵🇰"},{country:"PW",code:"+680",name:"Palau",flag:"🇵🇼"},{country:"PS",code:"+970",name:"Palestine",flag:"🇵🇸"},{country:"PA",code:"+507",name:"Panama",flag:"🇵🇦"},{country:"PG",code:"+675",name:"Papua New Guinea",flag:"🇵🇬"},{country:"PY",code:"+595",name:"Paraguay",flag:"🇵🇾"},{country:"PE",code:"+51",name:"Peru",flag:"🇵🇪"},{country:"PH",code:"+63",name:"Philippines",flag:"🇵🇭"},{country:"PL",code:"+48",name:"Poland",flag:"🇵🇱"},{country:"PT",code:"+351",name:"Portugal",flag:"🇵🇹"},{country:"PR",code:"+1",name:"Puerto Rico",flag:"🇵🇷"},{country:"QA",code:"+974",name:"Qatar",flag:"🇶🇦"},{country:"RE",code:"+262",name:"Réunion",flag:"🇷🇪"},{country:"RO",code:"+40",name:"Romania",flag:"🇷🇴"},{country:"RU",code:"+7",name:"Russia",flag:"🇷🇺"},{country:"RW",code:"+250",name:"Rwanda",flag:"🇷🇼"},{country:"WS",code:"+685",name:"Samoa",flag:"🇼🇸"},{country:"SM",code:"+378",name:"San Marino",flag:"🇸🇲"},{country:"ST",code:"+239",name:"São Tomé & Príncipe",flag:"🇸🇹"},{country:"SA",code:"+966",name:"Saudi Arabia",flag:"🇸🇦"},{country:"SN",code:"+221",name:"Senegal",flag:"🇸🇳"},{country:"RS",code:"+381",name:"Serbia",flag:"🇷🇸"},{country:"SC",code:"+248",name:"Seychelles",flag:"🇸🇨"},{country:"SL",code:"+232",name:"Sierra Leone",flag:"🇸🇱"},{country:"SG",code:"+65",name:"Singapore",flag:"🇸🇬"},{country:"SX",code:"+1",name:"Sint Maarten",flag:"🇸🇽"},{country:"SK",code:"+421",name:"Slovakia",flag:"🇸🇰"},{country:"SI",code:"+386",name:"Slovenia",flag:"🇸🇮"},{country:"SB",code:"+677",name:"Solomon Islands",flag:"🇸🇧"},{country:"SO",code:"+252",name:"Somalia",flag:"🇸🇴"},{country:"ZA",code:"+27",name:"South Africa",flag:"🇿🇦"},{country:"KR",code:"+82",name:"South Korea",flag:"🇰🇷"},{country:"SS",code:"+211",name:"South Sudan",flag:"🇸🇸"},{country:"ES",code:"+34",name:"Spain",flag:"🇪🇸"},{country:"LK",code:"+94",name:"Sri Lanka",flag:"🇱🇰"},{country:"BL",code:"+590",name:"Saint Barthélemy",flag:"🇧🇱"},{country:"SH",code:"+290",name:"Saint Helena",flag:"🇸🇭"},{country:"KN",code:"+1",name:"Saint Kitts & Nevis",flag:"🇰🇳"},{country:"LC",code:"+1",name:"Saint Lucia",flag:"🇱🇨"},{country:"MF",code:"+590",name:"Saint Martin",flag:"🇲🇫"},{country:"PM",code:"+508",name:"Saint Pierre & Miquelon",flag:"🇵🇲"},{country:"VC",code:"+1",name:"Saint Vincent & Grenadines",flag:"🇻🇨"},{country:"SD",code:"+249",name:"Sudan",flag:"🇸🇩"},{country:"SR",code:"+597",name:"Suriname",flag:"🇸🇷"},{country:"SJ",code:"+47",name:"Svalbard & Jan Mayen",flag:"🇸🇯"},{country:"SE",code:"+46",name:"Sweden",flag:"🇸🇪"},{country:"CH",code:"+41",name:"Switzerland",flag:"🇨🇭"},{country:"SY",code:"+963",name:"Syria",flag:"🇸🇾"},{country:"TW",code:"+886",name:"Taiwan",flag:"🇹🇼"},{country:"TJ",code:"+992",name:"Tajikistan",flag:"🇹🇯"},{country:"TZ",code:"+255",name:"Tanzania",flag:"🇹🇿"},{country:"TH",code:"+66",name:"Thailand",flag:"🇹🇭"},{country:"TG",code:"+228",name:"Togo",flag:"🇹🇬"},{country:"TK",code:"+690",name:"Tokelau",flag:"🇹🇰"},{country:"TO",code:"+676",name:"Tonga",flag:"🇹🇴"},{country:"TT",code:"+1",name:"Trinidad & Tobago",flag:"🇹🇹"},{country:"TN",code:"+216",name:"Tunisia",flag:"🇹🇳"},{country:"TR",code:"+90",name:"Turkey",flag:"🇹🇷"},{country:"TM",code:"+993",name:"Turkmenistan",flag:"🇹🇲"},{country:"TC",code:"+1",name:"Turks & Caicos Islands",flag:"🇹🇨"},{country:"TV",code:"+688",name:"Tuvalu",flag:"🇹🇻"},{country:"VI",code:"+1",name:"US Virgin Islands",flag:"🇻🇮"},{country:"UG",code:"+256",name:"Uganda",flag:"🇺🇬"},{country:"UA",code:"+380",name:"Ukraine",flag:"🇺🇦"},{country:"AE",code:"+971",name:"United Arab Emirates",flag:"🇦🇪"},{country:"GB",code:"+44",name:"United Kingdom",flag:"🇬🇧"},{country:"US",code:"+1",name:"United States",flag:"🇺🇸"},{country:"UY",code:"+598",name:"Uruguay",flag:"🇺🇾"},{country:"UZ",code:"+998",name:"Uzbekistan",flag:"🇺🇿"},{country:"VU",code:"+678",name:"Vanuatu",flag:"🇻🇺"},{country:"VA",code:"+39",name:"Vatican City",flag:"🇻🇦"},{country:"VE",code:"+58",name:"Venezuela",flag:"🇻🇪"},{country:"VN",code:"+84",name:"Vietnam",flag:"🇻🇳"},{country:"WF",code:"+681",name:"Wallis & Futuna",flag:"🇼🇫"},{country:"EH",code:"+212",name:"Western Sahara",flag:"🇪🇭"},{country:"YE",code:"+967",name:"Yemen",flag:"🇾🇪"},{country:"ZM",code:"+260",name:"Zambia",flag:"🇿🇲"},{country:"ZW",code:"+263",name:"Zimbabwe",flag:"🇿🇼"},{country:"AX",code:"+358",name:"Åland Islands",flag:"🇦🇽"}];function Ap({value:e="",onChange:t,showCountryCode:n=!0,showCountryFlag:r=!0,defaultCountryCode:i="+234",defaultCountry:s,placeholder:a="80 000 0000",colorScheme:l="blue",isInvalid:d=!1,errorMessage:c,label:u,helperText:h,isDisabled:m=!1,id:p}){const x=k.useId(),g=p??x,v=s??(i?Fp[i]:void 0),y=(v?Zt.find(W=>W.country===v):void 0)??Zt.find(W=>W.code===i)??Zt.find(W=>W.country==="NG")??Zt[0],[j,w]=k.useState(y.country),[A,B]=k.useState(e),[C,O]=k.useState(!1),[E,F]=k.useState(!1),[L,R]=k.useState(""),D=k.useRef(null),N=k.useRef(null),P=Zt.find(W=>W.country===j)??y;k.useEffect(()=>{function W(ne){D.current&&!D.current.contains(ne.target)&&F(!1)}return E&&document.addEventListener("mousedown",W),()=>{document.removeEventListener("mousedown",W)}},[E]),k.useEffect(()=>{if(E){const W=setTimeout(()=>{var ne;(ne=N.current)==null||ne.focus()},50);return()=>clearTimeout(W)}else R("")},[E]);const I=k.useMemo(()=>{if(!L.trim())return Zt;const W=L.toLowerCase().trim();return Zt.filter(ne=>ne.name.toLowerCase().includes(W)||ne.code.toLowerCase().includes(W)||ne.country.toLowerCase().includes(W))},[L]),M=W=>{const ne=W.target.value.replace(/[^\d\s\-]/g,"");B(ne),t==null||t(`${P.code}${ne.replace(/\s/g,"")}`)},U=W=>{w(W.country),t==null||t(`${W.code}${A.replace(/\s/g,"")}`),F(!1)},H=d?"#DC2626":C||E?l==="purple"?"#7700CC":"#0685FF":"var(--medix-form-border)";return o.jsxs(f.Box,{w:"100%",children:[u&&o.jsx("label",{htmlFor:g,style:{display:"block",marginBottom:"6px",fontSize:"14px",fontWeight:500,color:"var(--medix-form-text)",fontFamily:"var(--font-body)"},children:u}),o.jsxs(f.Box,{display:"flex",alignItems:"center",borderRadius:"10px",transition:"border-color 0.15s, box-shadow 0.15s",opacity:m?.5:1,pointerEvents:m?"none":void 0,position:"relative",zIndex:E?1e3:void 0,style:{border:`1.5px solid ${H}`,boxShadow:"none",background:"var(--medix-form-bg)"},children:[n&&o.jsxs(f.Box,{position:"relative",ref:D,h:"full",children:[o.jsxs("button",{id:`${g}-country`,type:"button",onClick:()=>!m&&F(!E),disabled:m,"aria-label":"Select country code","aria-expanded":E,style:{display:"flex",alignItems:"center",gap:"6px",padding:"10px 12px",background:"var(--medix-form-bg-subtle)",border:"none",borderRight:"1px solid var(--medix-form-border)",borderTopLeftRadius:"8px",borderBottomLeftRadius:"8px",cursor:m?"not-allowed":"pointer",height:"100%",color:"var(--medix-form-text)",fontFamily:"var(--font-body)",fontSize:"14px",fontWeight:500},children:[r&&o.jsx(f.Box,{display:"flex",alignItems:"center",fontSize:"lg",lineHeight:"1",children:o.jsx(ba,{countryCode:P.country,svg:!0,style:{width:"1.2em",height:"1.2em",borderRadius:"2px"}})}),o.jsx("span",{children:P.code}),o.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:E?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s ease",opacity:.7},children:o.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),E&&o.jsxs(f.Box,{position:"absolute",top:"100%",left:"0",mt:"2",w:"280px",maxH:"320px",bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",zIndex:1e3,display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"none",children:[o.jsx(f.Box,{p:"2.5",color:"text.heading",borderBottom:"1px solid",borderColor:"border",bg:"bg.surface",children:o.jsxs(f.Box,{color:"text.heading",position:"relative",display:"flex",alignItems:"center",children:[o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{position:"absolute",left:"10px",opacity:.5,pointerEvents:"none"},children:[o.jsx("circle",{cx:"11",cy:"11",r:"8"}),o.jsx("path",{d:"m21 21-4.35-4.35"})]}),o.jsx("input",{ref:N,type:"text",placeholder:"Search country or code...",value:L,onChange:W=>R(W.target.value),style:{width:"100%",padding:"6px 10px 6px 30px",fontSize:"13px",fontFamily:"var(--font-body)",borderRadius:"6px",border:"1px solid var(--medix-form-border)",background:"var(--medix-form-bg)",color:"var(--medix-form-text)",outline:"none"}})]})}),o.jsx(f.Box,{overflowY:"auto",flex:"1",py:"1",children:I.length===0?o.jsx(f.Box,{px:"4",py:"3",fontSize:"xs",color:"text.muted",textAlign:"center",children:"No country found"}):I.map(W=>{const ne=W.country===P.country;return o.jsxs("button",{type:"button",onClick:()=>U(W),style:{display:"flex",width:"100%",alignItems:"center",gap:"10px",padding:"8px 14px",background:ne?"var(--medix-form-bg-subtle)":"transparent",border:"none",cursor:"pointer",textAlign:"left",fontFamily:"var(--font-body)",fontSize:"13px",color:"var(--medix-form-text)",transition:"background 0.1s ease"},onMouseEnter:T=>{T.currentTarget.style.background="var(--medix-form-bg-subtle)"},onMouseLeave:T=>{T.currentTarget.style.background=ne?"var(--medix-form-bg-subtle)":"transparent"},children:[o.jsx(f.Box,{display:"flex",alignItems:"center",fontSize:"md",flexShrink:0,children:o.jsx(ba,{countryCode:W.country,svg:!0,style:{width:"1.2em",height:"1.2em",borderRadius:"2px"}})}),o.jsx(f.Text,{flex:"1",truncate:!0,fontWeight:ne?"600":"400",children:W.name}),o.jsx(f.Text,{fontSize:"xs",color:"text.muted",flexShrink:0,children:W.code})]},`${W.country}-${W.code}`)})})]})]}),o.jsx("input",{id:g,type:"tel",value:A,onChange:M,onFocus:()=>O(!0),onBlur:()=>O(!1),placeholder:a,disabled:m,"aria-invalid":d,style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"15px",fontFamily:"var(--font-body)",color:"var(--medix-form-text)",padding:"10px 16px",minWidth:0}})]}),(h||c)&&o.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:d?"red.500":"text.muted",fontFamily:"var(--font-body)",children:d?c:h})]})}const Lp=["MON","TUES","WED","THURS","FRI","SAT","SUN"],Ip=["January","February","March","April","May","June","July","August","September","October","November","December"],Dp=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Un=12;function uo(e,t){return new Date(e,t+1,0).getDate()}function Rp(e,t){return new Date(e,t,1).getDay()}function Mp(e){return e===0?6:e-1}function va(e,t,n,r,i){const s=new Date(n,t,e);if(r){const a=new Date(r.getFullYear(),r.getMonth(),r.getDate());if(s<a)return!0}if(i){const a=new Date(i.getFullYear(),i.getMonth(),i.getDate());if(s>a)return!0}return!1}function Pp(e,t,n,r){const i=uo(t,e),s=new Date(t,e,1),a=new Date(t,e,i);if(n){const l=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(a<l)return!0}if(r){const l=new Date(r.getFullYear(),r.getMonth(),r.getDate());if(s>l)return!0}return!1}function Op(e,t,n){return!!(t&&e<t.getFullYear()||n&&e>n.getFullYear())}function ls({value:e,onChange:t,minDate:n,maxDate:r,colorScheme:i="blue",...s}){const a=i==="purple"?"#7700CC":"#0685FF",l=i==="purple"?"rgba(119,0,204,0.14)":"rgba(6,133,255,0.14)",[d,c]=k.useState(()=>e?new Date(e):new Date),[u,h]=k.useState("day"),[m,p]=k.useState(0);k.useEffect(()=>{e&&c(H=>{const b=new Date(e);return H.getFullYear()===b.getFullYear()&&H.getMonth()===b.getMonth()?H:b})},[e]);const x=d.getFullYear(),g=d.getMonth(),y=Math.floor(x/Un)*Un+m*Un,j=y+Un-1,w=!n||x>n.getFullYear()||x===n.getFullYear()&&g>n.getMonth(),A=!r||x<r.getFullYear()||x===r.getFullYear()&&g<r.getMonth(),B=()=>{c(new Date(x,g-1,1))},C=()=>{c(new Date(x,g+1,1))},O=()=>{const H=new Date;c(H),h("day"),t&&!va(H.getDate(),H.getMonth(),H.getFullYear(),n,r)&&t(H)},E=H=>{c(new Date(x,H,1)),h("day")},F=H=>{c(new Date(H,g,1)),p(0),h("month")},L=uo(x,g),R=Mp(Rp(x,g)),D=uo(x,g-1),P=(R+L>35?42:35)-(R+L),I=(H,b,W)=>e?e.getDate()===H&&e.getMonth()===b&&e.getFullYear()===W:!1,M=()=>{const H=[];for(let b=0;b<R;b++){const W=D-R+b+1;H.push(o.jsx(Ei,{day:W,isMuted:!0,accentColor:a},`prev-${b}`))}for(let b=1;b<=L;b++){const W=va(b,g,x,n,r);H.push(o.jsx(Ei,{day:b,isActive:I(b,g,x),isDisabled:W,accentColor:a,accentLight:l,onClick:W?void 0:()=>t==null?void 0:t(new Date(x,g,b))},`curr-${b}`))}for(let b=1;b<=P;b++)H.push(o.jsx(Ei,{day:b,isMuted:!0,accentColor:a},`next-${b}`));return H},U=()=>o.jsx(f.Box,{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2",p:"1",mt:"2",children:Dp.map((H,b)=>{const W=b===g,ne=Pp(b,x,n,r);return o.jsx(wa,{label:H,isActive:W,isDisabled:ne,accentColor:a,accentLight:l,onClick:()=>!ne&&E(b)},H)})}),G=()=>{const H=Array.from({length:Un},(b,W)=>y+W);return o.jsxs(o.Fragment,{children:[o.jsxs(f.Flex,{justify:"space-between",align:"center",mb:"3",children:[o.jsx(Cr,{direction:"prev",enabled:!0,accentColor:a,onClick:()=>p(b=>b-1),ariaLabel:"Previous years"}),o.jsxs(f.Text,{fontSize:"sm",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-body)",children:[y," – ",j]}),o.jsx(Cr,{direction:"next",enabled:!0,accentColor:a,onClick:()=>p(b=>b+1),ariaLabel:"Next years"})]}),o.jsx(f.Box,{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2",p:"1",children:H.map(b=>{const W=b===x,ne=Op(b,n,r);return o.jsx(wa,{label:String(b),isActive:W,isDisabled:ne,accentColor:a,accentLight:l,onClick:()=>!ne&&F(b)},b)})})]})};return o.jsxs(f.Box,{w:"100%",maxW:"360px",bg:"bg.surface",borderRadius:"card",p:"5",fontFamily:"var(--font-body)",...s,children:[o.jsxs(f.Flex,{justify:"space-between",align:"center",mb:u==="day"?"6":"4",children:[o.jsxs(f.Flex,{align:"center",gap:"1",children:[u==="day"&&o.jsx(Cr,{direction:"prev",enabled:w,accentColor:a,onClick:B,ariaLabel:"Go to previous month"}),o.jsx(ka,{label:Ip[g],isActive:u==="month",accentColor:a,accentLight:l,onClick:()=>{h(H=>H==="month"?"day":"month"),p(0)}}),o.jsx(ka,{label:String(x),isActive:u==="year",accentColor:a,accentLight:l,onClick:()=>{h(H=>H==="year"?"day":"year"),p(0)}}),u==="day"&&o.jsx(Cr,{direction:"next",enabled:A,accentColor:a,onClick:C,ariaLabel:"Go to next month"})]}),o.jsx(f.Box,{as:"button",type:"button",onClick:O,px:"3",py:"1",fontSize:"sm",fontWeight:"medium",borderRadius:"md",border:"1px solid",borderColor:"border",color:"text.heading",_hover:{bg:"bg.subtle"},children:"Today"})]}),u==="day"&&o.jsxs(o.Fragment,{children:[o.jsx(f.Flex,{mb:"3",children:Lp.map(H=>o.jsx(f.Box,{flex:"1",textAlign:"center",fontSize:"xs",fontWeight:"medium",color:"text.muted",children:H},H))}),o.jsx(f.Box,{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gapY:"2",children:M()})]}),u==="month"&&U(),u==="year"&&G()]})}function Cr({enabled:e,onClick:t,direction:n,accentColor:r,ariaLabel:i}){return o.jsx(f.Box,{as:"button",type:"button","aria-label":i??(n==="prev"?"Go to previous month":"Go to next month"),"aria-disabled":!e,disabled:!e,onClick:e?t:void 0,display:"flex",alignItems:"center",justifyContent:"center",w:"7",h:"7",borderRadius:"md",cursor:e?"pointer":"not-allowed",color:e?"text.heading":"text.muted",opacity:e?1:.35,p:"0",flexShrink:0,_hover:e?{color:r,bg:"bg.subtle"}:void 0,transition:"all 0.15s",children:o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n==="prev"?o.jsx("path",{d:"M15 18l-6-6 6-6"}):o.jsx("path",{d:"M9 18l6-6-6-6"})})})}function ka({label:e,isActive:t,accentColor:n,accentLight:r,onClick:i}){return o.jsxs(f.Box,{as:"button",type:"button",onClick:i,title:t?"Click to collapse":"Click to browse",display:"inline-flex",alignItems:"center",gap:"0.5",px:"2",py:"0.5",borderRadius:"md",bg:t?r:"transparent",color:t?n:"text.heading",fontWeight:"semibold",fontSize:"15px",fontFamily:"var(--font-body)",cursor:"pointer",lineHeight:"1.4",_hover:t?void 0:{bg:r,color:n},transition:"all 0.15s",children:[e,o.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:t?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",opacity:.7,marginTop:"1px"},children:o.jsx("path",{d:"M6 9l6 6 6-6"})})]})}function wa({label:e,isActive:t,isDisabled:n,accentColor:r,accentLight:i,onClick:s}){return o.jsx(f.Box,{as:"button",type:"button",onClick:n?void 0:s,disabled:n,display:"flex",alignItems:"center",justifyContent:"center",h:"10",borderRadius:"md",border:"1.5px solid",borderColor:t?r:"transparent",bg:t?r:"transparent",color:t?"white":n?"text.muted":"text.heading",fontSize:"13px",fontWeight:t?"semibold":"medium",fontFamily:"var(--font-body)",cursor:n?"not-allowed":"pointer",opacity:n?.35:1,_hover:!n&&!t?{bg:i,color:r,borderColor:r}:void 0,transition:"all 0.15s",children:e})}function Ei({day:e,isActive:t,isMuted:n,isDisabled:r,accentColor:i,accentLight:s,onClick:a}){return o.jsx(f.Flex,{justify:"center",align:"center",h:"10",children:o.jsx(f.Box,{as:"button",type:"button",display:"flex",alignItems:"center",justifyContent:"center",w:"9",h:"9",borderRadius:"full",fontSize:"sm",fontWeight:"medium",onClick:a,disabled:n||r,cursor:n?"default":r?"not-allowed":"pointer",opacity:r?.35:1,style:{background:t?i:"transparent",color:t?"#ffffff":void 0,transition:"background 0.15s, color 0.15s"},color:t?void 0:n||r?"text.muted":"text.heading",_hover:!n&&!r&&!t?{bg:s,color:i}:void 0,transition:"all 0.2s",children:e})})}function zp({value:e,onChange:t,min:n,max:r,label:i,helperText:s,errorMessage:a,colorScheme:l="blue",isInvalid:d=!1,isDisabled:c=!1,placeholder:u="Select date",id:h,includeTime:m=!1}){const[p,x]=k.useState(!1),g=k.useRef(null),v=F=>F!=null&&F.includes("T")&&F.split("T")[1].slice(0,5)||"00:00";k.useEffect(()=>{function F(L){g.current&&!g.current.contains(L.target)&&x(!1)}return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[]);const j=d?"#DC2626":p?l==="purple"?"#7700CC":"#0685FF":"var(--medix-form-border)",w="none",A=F=>{const L=F.getFullYear(),R=String(F.getMonth()+1).padStart(2,"0"),D=String(F.getDate()).padStart(2,"0");m?t==null||t(`${L}-${R}-${D}T${v(e)}`):(t==null||t(`${L}-${R}-${D}`),x(!1))},B=F=>{const L=F.target.value,R=(e==null?void 0:e.split("T")[0])??"";R&&(t==null||t(`${R}T${L}`))},C=F=>{if(!F)return;const[L,R,D]=F.split("-"),N=Number(L),P=Number(R),I=Number(D==null?void 0:D.split("T")[0]);if(!Number.isInteger(N)||!Number.isInteger(P)||!Number.isInteger(I))return;const M=new Date(N,P-1,I);if(!(M.getFullYear()!==N||M.getMonth()!==P-1||M.getDate()!==I))return M},O=C(e==null?void 0:e.split("T")[0]),E=O&&!isNaN(O.getTime())?m&&(e!=null&&e.includes("T"))?`${O.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})} ${e.split("T")[1].slice(0,5)}`:O.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"";return o.jsxs(f.Box,{w:"100%",position:"relative",zIndex:p?1e3:void 0,ref:g,children:[i&&o.jsx(f.Text,{mb:"1.5",fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:i}),o.jsxs(f.Box,{position:"relative",children:[o.jsx("input",{id:h,readOnly:!0,type:"text",value:E,placeholder:u,disabled:c,"aria-invalid":d,"aria-haspopup":"dialog","aria-expanded":p,onClick:()=>!c&&x(!p),onKeyDown:F=>{c||(F.key==="Enter"||F.key===" "||F.key==="ArrowDown"?(F.preventDefault(),x(!0)):F.key==="Escape"&&x(!1))},style:{width:"100%",height:"40px",padding:"0 40px 0 16px",borderRadius:"10px",border:`1.5px solid ${j}`,boxShadow:w,background:"var(--medix-form-bg)",color:"var(--medix-form-text)",fontSize:"15px",fontFamily:"var(--font-body)",outline:"none",transition:"border-color 0.15s, box-shadow 0.15s",cursor:c?"not-allowed":"pointer",opacity:c?.5:1,colorScheme:"auto"}}),o.jsx(f.Box,{position:"absolute",right:"3",top:"50%",transform:"translateY(-50%)",pointerEvents:"none",fontSize:"md",color:"text.muted",children: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",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),o.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),o.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),o.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})})]}),p&&o.jsxs(f.Box,{position:"absolute",top:"calc(100% + 8px)",left:"0",zIndex:1e3,boxShadow:"none",borderRadius:"card",border:"1px solid",borderColor:"border",bg:"bg.surface",overflow:"hidden",children:[o.jsx(ls,{value:O,onChange:A,minDate:C(n),maxDate:C(r),colorScheme:l}),m&&o.jsxs(f.Box,{px:"5",pb:"4",borderTop:"1px solid",borderColor:"border",children:[o.jsx(f.Text,{fontSize:"xs",fontWeight:"medium",color:"text.muted",mb:"1.5",fontFamily:"var(--font-body)",children:"Time"}),o.jsx("input",{type:"time",value:v(e),onChange:B,disabled:!O,style:{width:"100%",height:"36px",padding:"0 12px",borderRadius:"8px",border:"1.5px solid var(--medix-form-border)",background:"var(--medix-form-bg)",color:"var(--medix-form-text)",fontSize:"14px",fontFamily:"var(--font-body)",outline:"none",opacity:O?1:.4,cursor:O?"default":"not-allowed",colorScheme:"auto"}})]})]}),(s||a)&&o.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:d?"red.500":"text.muted",fontFamily:"var(--font-body)",children:d?a:s})]})}function _p({startValue:e,onStartChange:t,endValue:n,onEndChange:r,min:i,max:s,label:a,helperText:l,errorMessage:d,colorScheme:c="blue",isInvalid:u=!1,isDisabled:h=!1,startPlaceholder:m="Start date",endPlaceholder:p="End date",id:x}){const[g,v]=k.useState(null),y=k.useRef(null);k.useEffect(()=>{function M(U){y.current&&!y.current.contains(U.target)&&v(null)}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[]);const w=u?"#DC2626":g?c==="purple"?"#7700CC":"#0685FF":"var(--medix-form-border)",A="none",B={flex:1,height:"100%",padding:"0 10px",background:"transparent",color:"var(--medix-form-text)",fontSize:"15px",fontFamily:"var(--font-body)",border:"none",outline:"none",cursor:h?"not-allowed":"pointer",colorScheme:"auto",width:"100%"},C=M=>{const U=M.getFullYear(),G=String(M.getMonth()+1).padStart(2,"0"),H=String(M.getDate()).padStart(2,"0");return`${U}-${G}-${H}`},O=M=>i&&M<i?i:s&&M>s?s:M,E=M=>{const U=O(C(M));g==="start"?(t==null||t(U),n&&n<U&&(r==null||r("")),v("end")):g==="end"&&(r==null||r(U),e&&e>U&&(t==null||t("")),v(null))},F=M=>{if(!M)return;const[U,G,H]=M.split("-").map(Number);if(!U||G<1||G>12||H<1||H>31)return;const b=new Date(U,G-1,H);if(!(b.getFullYear()!==U||b.getMonth()!==G-1||b.getDate()!==H))return b},R=F(g==="start"?e:n),D=F(e),N=F(n),P=D?D.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"",I=N?N.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"";return o.jsxs(f.Box,{w:"100%",position:"relative",zIndex:g?1e3:void 0,ref:y,children:[a&&o.jsx(f.Text,{mb:"1.5",fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:a}),o.jsxs(f.Box,{display:"flex",alignItems:"center",position:"relative",style:{width:"100%",height:"40px",borderRadius:"10px",border:`1.5px solid ${w}`,boxShadow:A,background:"var(--medix-form-bg)",transition:"border-color 0.15s, box-shadow 0.15s",opacity:h?.5:1,overflow:"hidden"},children:[o.jsx("input",{id:x,readOnly:!0,type:"text",value:P,placeholder:m,disabled:h,"aria-invalid":u,"aria-haspopup":"dialog","aria-expanded":g==="start",onClick:()=>!h&&v("start"),onKeyDown:M=>{h||(M.key==="Enter"||M.key===" "||M.key==="ArrowDown"?(M.preventDefault(),v("start")):M.key==="Escape"&&v(null))},style:{...B,textAlign:"center"}}),o.jsx(f.Box,{color:"text.muted",px:"1",fontSize:"sm",children:"—"}),o.jsx("input",{readOnly:!0,type:"text",value:I,placeholder:p,disabled:h,"aria-invalid":u,"aria-haspopup":"dialog","aria-expanded":g==="end",onClick:()=>!h&&v("end"),onKeyDown:M=>{h||(M.key==="Enter"||M.key===" "||M.key==="ArrowDown"?(M.preventDefault(),v("end")):M.key==="Escape"&&v(null))},style:{...B,textAlign:"center"}})]}),g&&o.jsx(f.Box,{position:"absolute",top:"calc(100% + 8px)",left:"0",zIndex:1e3,boxShadow:"none",borderRadius:"card",border:"1px solid",borderColor:"border",bg:"bg.surface",overflow:"hidden",children:o.jsx(ls,{value:R,onChange:E,minDate:g==="end"?D??F(i):F(i),maxDate:F(s),colorScheme:c})}),(l||d)&&o.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:u?"red.500":"text.muted",fontFamily:"var(--font-body)",children:u?d:l})]})}const Np=o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("polyline",{points:"6 9 12 15 18 9"})});function Vp({options:e,value:t,onChange:n,placeholder:r="Search...",label:i,helperText:s,errorMessage:a,colorScheme:l="blue",isInvalid:d=!1,isDisabled:c=!1}){const[u,h]=k.useState(!1),[m,p]=k.useState(""),x=k.useRef(null);k.useEffect(()=>{if(t){const w=e.find(A=>A.value===t);w&&p(w.label)}},[t,e]),k.useEffect(()=>{function w(A){if(x.current&&!x.current.contains(A.target))if(h(!1),t){const B=e.find(C=>C.value===t);B&&p(B.label)}else p("")}return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[t,e]);const g=e.filter(w=>w.label.toLowerCase().includes(m.toLowerCase())),y=d?"#DC2626":u?l==="purple"?"#7700CC":"#0685FF":"var(--medix-form-border)";return o.jsxs(f.Box,{w:"100%",position:"relative",zIndex:u?1e3:void 0,ref:x,children:[i&&o.jsx(f.Text,{mb:"1.5",fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:i}),o.jsxs(f.Box,{position:"relative",children:[o.jsx("input",{type:"text",value:m,placeholder:r,disabled:c,onChange:w=>{p(w.target.value),h(!0),w.target.value||n==null||n("")},onFocus:()=>h(!0),style:{width:"100%",height:"40px",padding:"0 40px 0 16px",borderRadius:"10px",border:`1.5px solid ${y}`,boxShadow:"none",background:"var(--medix-form-bg)",color:"var(--medix-form-text)",fontSize:"15px",fontFamily:"var(--font-body)",outline:"none",transition:"border-color 0.15s, box-shadow 0.15s",cursor:c?"not-allowed":"text",opacity:c?.5:1}}),o.jsx(f.Box,{position:"absolute",right:"3",top:"50%",transform:"translateY(-50%)",pointerEvents:"none",color:"text.muted",children:Np})]}),u&&!c&&o.jsx(f.Box,{position:"absolute",zIndex:1e3,top:"100%",left:"0",right:"0",mt:"1",bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"md",boxShadow:"none",maxH:"200px",overflowY:"auto",py:"1",children:g.length>0?g.map(w=>o.jsx(f.Box,{px:"3",py:"2",fontSize:"sm",fontFamily:"var(--font-body)",color:"text.body",cursor:"pointer",_hover:{bg:"bg.subtle"},onClick:()=>{n==null||n(w.value),p(w.label),h(!1)},children:w.label},w.value)):o.jsx(f.Box,{px:"3",py:"2",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:"No options found"})}),(s||a)&&o.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:d?"red.500":"text.muted",fontFamily:"var(--font-body)",children:d?a:s})]})}const Wp=o.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),o.jsx("polyline",{points:"17 8 12 3 7 8"}),o.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]});function Hp({accept:e,multiple:t=!1,maxSize:n,label:r,helperText:i,errorMessage:s,colorScheme:a="blue",isInvalid:l=!1,isDisabled:d=!1,onChange:c,dropzoneTitle:u="Click or drag to upload",id:h}){const[m,p]=k.useState(!1),[x,g]=k.useState([]),v=k.useRef(null),y=D=>{D.preventDefault(),d||p(!0)},j=D=>{D.preventDefault(),d||p(!0)},w=D=>{D.preventDefault(),p(!1)},[A,B]=k.useState(null),C=D=>{if(!D||D.length===0)return;const N=Array.from(D);B(null);const P=N.find(M=>n&&M.size>n);if(P&&n){const M=Math.round(n/1048576);B(`File "${P.name}" exceeds the maximum limit of ${M}MB.`)}const I=N.filter(M=>!(n&&M.size>n));I.length>0&&(g(I.map(M=>M.name)),c==null||c(I))},O=D=>{D.preventDefault(),p(!1),!d&&C(D.dataTransfer.files)},E=D=>{C(D.target.files),D.target.value=""},F=a==="purple"?"purple.500":"blue.500",L=l?"red.500":m?F:"border",R=m?"bg.subtle":"transparent";return o.jsxs(f.Box,{w:"100%",children:[r&&o.jsx(f.Text,{mb:"1.5",fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:r}),o.jsxs(f.Box,{position:"relative",border:"1.5px dashed",borderColor:L,borderRadius:"xl",bg:R,px:"6",py:"8",textAlign:"center",transition:"all 0.2s ease",opacity:d?.5:1,cursor:d?"not-allowed":"pointer",_hover:d?void 0:{borderColor:F,bg:"bg.subtle"},onDragEnter:y,onDragOver:j,onDragLeave:w,onDrop:O,onClick:()=>{var D;return!d&&((D=v.current)==null?void 0:D.click())},children:[o.jsx("input",{ref:v,id:h,type:"file",accept:e,multiple:t,disabled:d,style:{display:"none"},onChange:E}),o.jsx(f.Box,{color:"text.muted",display:"flex",justifyContent:"center",mb:"3",children:Wp}),o.jsx(f.Text,{fontSize:"sm",fontWeight:"medium",color:m?"blue.500":"text.heading",fontFamily:"var(--font-body)",children:u}),o.jsxs(f.Text,{fontSize:"xs",color:"text.muted",mt:"1",fontFamily:"var(--font-body)",children:[e?`Accepts ${e}`:"All file types supported",n&&` up to ${Math.round(n/1024/1024)}MB`]}),x.length>0&&o.jsxs(f.Box,{mt:"4",pt:"3",borderTop:"1px solid",borderColor:"border",children:[o.jsxs(f.Text,{fontSize:"xs",fontWeight:"semibold",color:"text.heading",mb:"1",fontFamily:"var(--font-body)",children:["Selected file",x.length>1?"s":"",":"]}),x.map((D,N)=>o.jsx(f.Text,{fontSize:"xs",color:"text.muted",truncate:!0,fontFamily:"var(--font-body)",children:D},N))]})]}),(i||s||A)&&o.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:l||A?"red.500":"text.muted",fontFamily:"var(--font-body)",children:A||(l?s:i)})]})}const Sa={sm:{minH:"34px",py:"1",px:"2.5",fontSize:"13px",tagPy:"1px",tagPx:"2",tagFontSize:"12px"},md:{minH:"42px",py:"1.5",px:"3",fontSize:"14px",tagPy:"2px",tagPx:"2.5",tagFontSize:"12px"},lg:{minH:"48px",py:"2",px:"4",fontSize:"15px",tagPy:"3px",tagPx:"3",tagFontSize:"13px"}},Ca={blue:{focusBorder:"#0685FF",tagBgLight:"#EBF5FF",tagBgDark:"rgba(6, 133, 255, 0.18)",tagTextLight:"#0062CC",tagTextDark:"#60A5FA",tagBorderLight:"rgba(6, 133, 255, 0.25)",tagBorderDark:"rgba(6, 133, 255, 0.35)"},purple:{focusBorder:"#7700CC",tagBgLight:"#F3E8FF",tagBgDark:"rgba(119, 0, 204, 0.18)",tagTextLight:"#5B0099",tagTextDark:"#C084FC",tagBorderLight:"rgba(119, 0, 204, 0.25)",tagBorderDark:"rgba(119, 0, 204, 0.35)"}};function yu({value:e=[],onChange:t,placeholder:n="Add tag...",label:r,helperText:i,errorMessage:s,isInvalid:a=!1,colorScheme:l="blue",size:d="md",isDisabled:c=!1,isReadOnly:u=!1,maxTags:h,allowDuplicates:m=!1,addOnBlur:p=!1,delimiter:x=",",id:g,name:v,style:y,className:j}){const w=k.useId(),A=g??w,[B,C]=k.useState(""),[O,E]=k.useState(!1),F=k.useRef(null),L=Ca[l]??Ca.blue,R=Sa[d]??Sa.md,D=U=>{if(c||u)return;const G=U.trim();if(G&&!(h!=null&&e.length>=h)){if(!m&&e.includes(G)){C("");return}t([...e,G]),C("")}},N=U=>{c||u||t(e.filter((G,H)=>H!==U))},P=U=>{U.key==="Enter"||x&&U.key===x?(U.preventDefault(),D(B)):U.key==="Backspace"&&!B&&e.length>0&&N(e.length-1)},I=()=>{E(!1),p&&B.trim()&&D(B)},M=a?"#DC2626":O?L.focusBorder:"var(--medix-form-border)";return o.jsxs(f.Box,{w:"100%",style:y,className:j,children:[r&&o.jsx("label",{htmlFor:A,style:{display:"block",marginBottom:"6px",fontSize:"14px",fontWeight:500,color:"var(--medix-form-text)",fontFamily:"var(--font-body)"},children:r}),o.jsxs(f.Box,{onClick:()=>{var U;return!c&&((U=F.current)==null?void 0:U.focus())},display:"flex",flexWrap:"wrap",alignItems:"center",gap:"1.5",minH:R.minH,py:R.py,px:R.px,borderRadius:"10px",bg:"bg.surface",cursor:c?"not-allowed":"text",opacity:c?.55:1,transition:"border-color 0.15s ease",style:{border:`1.5px solid ${M}`,boxShadow:"none",background:"var(--medix-form-bg)"},children:[e.map((U,G)=>o.jsxs(f.Box,{as:"span",display:"inline-flex",alignItems:"center",gap:"1",px:R.tagPx,py:R.tagPy,borderRadius:"full",fontSize:R.tagFontSize,fontWeight:"500",fontFamily:"var(--font-body)",lineHeight:"1.4",whiteSpace:"nowrap",bg:l==="purple"?"purple.50":"blue.50",color:l==="purple"?"purple.700":"blue.700",border:"1px solid",borderColor:l==="purple"?"purple.200":"blue.200",_dark:{bg:l==="purple"?"rgba(119, 0, 204, 0.2)":"rgba(6, 133, 255, 0.2)",color:l==="purple"?"purple.300":"blue.300",borderColor:l==="purple"?"rgba(119, 0, 204, 0.4)":"rgba(6, 133, 255, 0.4)"},children:[o.jsx("span",{children:U}),!c&&!u&&o.jsx("button",{type:"button",onClick:H=>{H.stopPropagation(),N(G)},"aria-label":`Remove ${U}`,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",padding:"0",marginLeft:"2px",cursor:"pointer",opacity:.7,color:"inherit",fontSize:"14px",lineHeight:1,transition:"opacity 0.1s ease"},onMouseEnter:H=>{H.currentTarget.style.opacity="1"},onMouseLeave:H=>{H.currentTarget.style.opacity="0.7"},children:"×"})]},`${U}-${G}`)),!c&&!u&&o.jsx("input",{ref:F,id:A,name:v,type:"text",value:B,onChange:U=>C(U.target.value),onKeyDown:P,onFocus:()=>E(!0),onBlur:I,placeholder:e.length===0?n:"",disabled:c,readOnly:u,style:{flex:1,minWidth:"120px",border:"none",outline:"none",background:"transparent",fontSize:R.fontSize,fontFamily:"var(--font-body)",color:"var(--medix-form-text)",padding:0}})]}),(i||s)&&o.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:a?"red.500":"text.muted",fontFamily:"var(--font-body)",children:a?s:i})]})}const Up=yu;function jn(e){if(!e||typeof document>"u")return e||"";if(!/<[a-z][\s\S]*>/i.test(e))return e;const t=document.createElement("div");t.innerHTML=e;function n(r){if(r.nodeType===Node.TEXT_NODE)return r.textContent||"";if(r.nodeType!==Node.ELEMENT_NODE)return"";const i=r,s=i.tagName.toLowerCase(),a=Array.from(i.childNodes).map(n).join("");switch(s){case"h1":return`# ${a.trim()}
270
+ `,fill:e})})}const Ei={sm:{h:"8",px:"3",fontSize:"sm"},md:{h:"10",px:"4",fontSize:"md"},lg:{h:"12",px:"4",fontSize:"lg"}},as=k.forwardRef(({size:e="md",colorScheme:t="blue",leftElement:n,rightElement:r,isInvalid:i,errorMessage:s,...a},l)=>{const d=!!n,c=!!r,u=t==="purple"?"purple.500":"blue.500";return o.jsxs(f.Box,{w:"100%",children:[o.jsxs(f.Box,{position:"relative",children:[d&&o.jsx(f.Box,{position:"absolute",left:"3",top:"50%",transform:"translateY(-50%)",zIndex:"1",color:"text.muted",display:"flex",alignItems:"center",children:n}),o.jsx(f.Input,{ref:l,...Ei[e],pl:d?"10":Ei[e].px,pr:c?"10":Ei[e].px,bg:"bg.surface",border:"1px solid",borderColor:i?"red.500":"border",borderRadius:"md",color:"text.heading",fontFamily:"var(--font-body)",_placeholder:{color:"text.muted"},_focus:{borderColor:i?"red.500":u,boxShadow:"none",outline:"none"},_dark:{bg:"bg.surface",borderColor:i?"red.500":"border",color:"text.heading"},...a}),c&&o.jsx(f.Box,{position:"absolute",right:"3",top:"50%",transform:"translateY(-50%)",zIndex:"1",color:"text.muted",display:"flex",alignItems:"center",children:r})]}),i&&s&&o.jsx(f.Text,{mt:"1",fontSize:"xs",color:"red.500",fontFamily:"var(--font-body)",children:s})]})});as.displayName="MedixInput";const ls=k.forwardRef(({placeholder:e="Search…",...t},n)=>o.jsx(as,{ref:n,type:"search",placeholder:e,leftElement:o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[o.jsx("circle",{cx:"11",cy:"11",r:"8"}),o.jsx("path",{d:"m21 21-4.35-4.35"})]}),...t}));ls.displayName="MedixSearchInput";const un="medix_textarea_draft_";function du(e,t,n,r){if(e)return e;if(t)return`id_${t}`;if(n)return`name_${n}`;if(r){const i=r.toLowerCase().trim().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"");if(i)return`ph_${i}`}return"default"}function fu(e){if(!(typeof window>"u"))try{const t=e.startsWith(un)?e:`${un}${e}`;window.localStorage.removeItem(t)}catch{}}function hu(e,t){if(typeof window>"u")return null;try{const n=e.startsWith(un)?e:`${un}${e}`,r=window.localStorage.getItem(n);if(!r)return null;const i=JSON.parse(r);return!i||typeof i.content!="string"?null:t&&t>0&&i.updatedAt&&Date.now()-i.updatedAt>t?(window.localStorage.removeItem(n),null):i}catch{return null}}function uo(e,t){if(!(typeof window>"u"))try{const n=e.startsWith(un)?e:`${un}${e}`;window.localStorage.setItem(n,JSON.stringify(t))}catch{}}const pu=k.forwardRef(({colorScheme:e="blue",isInvalid:t,errorMessage:n,maxLength:r,showCount:i=!1,onChange:s,value:a,defaultValue:l,storageKey:d,persistDraft:c=!0,debounceMs:u=400,draftMaxAgeMs:h=10080*60*1e3,showDraftStatus:m=!1,onDraftRestored:p,id:x,name:g,placeholder:v,disabled:y=!1,readOnly:j=!1,...w},A)=>{const B=a!==void 0,[C,O]=k.useState(()=>B&&typeof a=="string"?a:typeof l=="string"?l:""),E=B?typeof a=="string"?a:"":C,[F,L]=k.useState(E.length),[R,D]=k.useState("idle"),N=k.useRef(null);k.useImperativeHandle(A,()=>N.current);const P=k.useMemo(()=>du(d,x,g,v),[d,x,g,v]),I=k.useRef(null),M=k.useRef(null),U=k.useRef(!1),G=k.useCallback(W=>{if(!c||y||j)return;if(!W||W.trim()===""){M.current&&(clearTimeout(M.current),M.current=null),I.current=null,fu(P),D("idle");return}I.current=W,D("saving"),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{I.current!==null&&(uo(P,{content:I.current,updatedAt:Date.now(),version:1}),I.current=null,D("saved"))},u)},[c,y,j,P,u]);k.useEffect(()=>{if(!c)return;const W=()=>{M.current&&(clearTimeout(M.current),M.current=null),I.current!==null&&(uo(P,{content:I.current,updatedAt:Date.now(),version:1}),I.current=null,D("saved"))};return typeof window<"u"&&(window.addEventListener("beforeunload",W),window.addEventListener("pagehide",W)),()=>{typeof window<"u"&&(window.removeEventListener("beforeunload",W),window.removeEventListener("pagehide",W)),W()}},[c,P]),k.useEffect(()=>{if(U.current||!c||y||j)return;U.current=!0;const W=hu(P,h);if(!(!W||!W.content||W.content.trim()==="")&&!(B&&typeof a=="string"&&a.trim()!==""&&a===W.content)){if(B||O(W.content),L(W.content.length),N.current&&(N.current.value=W.content),s){const ne={target:{value:W.content,name:g},currentTarget:{value:W.content,name:g}};s(ne)}D("saved"),p==null||p(W)}},[c,y,j,P,h,B,a,g,s,p]),k.useEffect(()=>{B&&typeof a=="string"&&L(a.length)},[B,a]);const H=e==="purple"?"purple.500":"blue.500",b=W=>{const ne=W.target.value;B||O(ne),L(ne.length),s==null||s(W),G(ne)};return o.jsxs(f.Box,{w:"100%",children:[o.jsx(f.Textarea,{ref:N,id:x,name:g,placeholder:v,disabled:y,readOnly:j,bg:"bg.surface",border:"1px solid",borderColor:t?"red.500":"border",borderRadius:"md",color:"text.heading",fontFamily:"var(--font-body)",fontSize:"md",px:"4",py:"3",resize:"vertical",maxLength:r,value:B?a:C,onChange:b,_placeholder:{color:"text.muted"},_focus:{borderColor:t?"red.500":H,boxShadow:"none",outline:"none"},_dark:{bg:"bg.surface",borderColor:t?"red.500":"border",color:"text.heading",_placeholder:{color:"text.muted"}},...w}),o.jsxs(f.Box,{display:"flex",justifyContent:"space-between",mt:"1",children:[t&&n?o.jsx(f.Text,{fontSize:"xs",color:"red.500",fontFamily:"var(--font-body)",children:n}):m&&R!=="idle"?o.jsxs(f.Box,{display:"inline-flex",alignItems:"center",gap:"1.5",children:[o.jsx(f.Box,{w:"1.5",h:"1.5",borderRadius:"full",bg:R==="saving"?"orange.400":"green.500"}),o.jsx(f.Text,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:R==="saving"?"Saving draft...":"Draft saved"})]}):o.jsx("span",{}),i&&r&&o.jsxs(f.Text,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:[F,"/",r]})]})]})});pu.displayName="MedixTextarea";const gp={sm:{h:"8",px:"3",fontSize:"sm"},md:{h:"10",px:"4",fontSize:"md"},lg:{h:"12",px:"4",fontSize:"lg"}};function yp({options:e=[],placeholder:t="Select option...",isInvalid:n=!1,errorMessage:r,size:i="md",colorScheme:s="blue",icon:a,value:l,defaultValue:d,onChange:c,disabled:u=!1,name:h,id:m}){const[p,x]=k.useState(!1),[g,v]=k.useState(""),[y,j]=k.useState(()=>typeof d=="string"?d:Array.isArray(d)&&d.length>0?d[0]:""),w=k.useRef(null),A=k.useRef(null),B=l!==void 0,C=B?typeof l=="string"?l:Array.isArray(l)&&l.length>0?l[0]:"":y,O=e.find(N=>N.value===C);k.useEffect(()=>{function N(P){w.current&&!w.current.contains(P.target)&&x(!1)}return p&&document.addEventListener("mousedown",N),()=>{document.removeEventListener("mousedown",N)}},[p]),k.useEffect(()=>{if(p){const N=setTimeout(()=>{var P;return(P=A.current)==null?void 0:P.focus()},50);return()=>clearTimeout(N)}else v("")},[p]);const E=N=>{u||(B||j(N),c==null||c(N),x(!1))},F=k.useMemo(()=>{if(!g.trim())return e;const N=g.toLowerCase().trim();return e.filter(P=>P.label.toLowerCase().includes(N))},[e,g]),L=s==="purple"?"#7700CC":"#0685FF",R=n?"#DC2626":p?L:"var(--medix-form-border)",D=gp[i];return o.jsxs(f.Box,{w:"100%",position:"relative",zIndex:p?1e3:void 0,ref:w,children:[h&&o.jsx("input",{type:"hidden",name:h,id:m,value:C}),o.jsxs(f.Box,{onClick:()=>!u&&x(!p),display:"flex",alignItems:"center",justifyContent:"space-between",h:D.h,px:D.px,borderRadius:"md",bg:"bg.surface",cursor:u?"not-allowed":"pointer",opacity:u?.55:1,transition:"border-color 0.15s ease",style:{border:`1.5px solid ${R}`,boxShadow:"none",background:"var(--medix-form-bg)"},children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2.5",flex:"1",minW:"0",children:[a&&o.jsx(f.Box,{color:"text.muted",display:"flex",alignItems:"center",flexShrink:0,children:a}),O?o.jsx(f.Text,{fontSize:D.fontSize,color:"text.heading",fontFamily:"var(--font-body)",truncate:!0,fontWeight:"500",children:O.label}):o.jsx(f.Text,{fontSize:D.fontSize,color:"text.muted",fontFamily:"var(--font-body)",truncate:!0,children:t})]}),o.jsx(f.Box,{display:"flex",alignItems:"center",color:"text.muted",ml:"2",flexShrink:0,style:{transform:p?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s ease"},children:o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),p&&o.jsxs(f.Box,{position:"absolute",top:"100%",left:"0",right:"0",mt:"1.5",maxH:"280px",bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",zIndex:1e3,display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"none",children:[e.length>5&&o.jsx(f.Box,{p:"2",borderBottom:"1px solid",borderColor:"border",bg:"bg.surface",children:o.jsxs(f.Box,{position:"relative",display:"flex",alignItems:"center",children:[o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{position:"absolute",left:"10px",opacity:.5,pointerEvents:"none"},children:[o.jsx("circle",{cx:"11",cy:"11",r:"8"}),o.jsx("path",{d:"m21 21-4.35-4.35"})]}),o.jsx("input",{ref:A,type:"text",placeholder:"Search...",value:g,onChange:N=>v(N.target.value),style:{width:"100%",padding:"6px 10px 6px 30px",fontSize:"13px",fontFamily:"var(--font-body)",borderRadius:"6px",border:"1px solid var(--medix-form-border)",background:"var(--medix-form-bg)",color:"var(--medix-form-text)",outline:"none"}})]})}),o.jsx(f.Box,{overflowY:"auto",flex:"1",py:"1",children:F.length===0?o.jsx(f.Box,{px:"4",py:"3",fontSize:"xs",color:"text.muted",textAlign:"center",children:"No options found"}):F.map(N=>{const P=N.value===C;return o.jsxs("button",{type:"button",disabled:N.disabled,onClick:()=>E(N.value),style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between",padding:"8px 14px",background:P?"var(--medix-form-bg-subtle)":"transparent",border:"none",cursor:N.disabled?"not-allowed":"pointer",textAlign:"left",fontFamily:"var(--font-body)",fontSize:"13px",color:"var(--medix-form-text)",opacity:N.disabled?.5:1,transition:"background 0.1s ease"},onMouseEnter:I=>{N.disabled||(I.currentTarget.style.background="var(--medix-form-bg-subtle)")},onMouseLeave:I=>{N.disabled||(I.currentTarget.style.background=P?"var(--medix-form-bg-subtle)":"transparent")},children:[o.jsx("span",{style:{fontWeight:P?600:400},children:N.label}),P&&o.jsx("span",{style:{color:L,fontWeight:700,fontSize:"14px"},children:"✓"})]},N.value)})})]}),n&&r&&o.jsx(f.Text,{mt:"1",fontSize:"xs",color:"red.500",fontFamily:"var(--font-body)",children:r})]})}function bp({options:e=[],placeholder:t="Select options...",isInvalid:n=!1,errorMessage:r,size:i="md",colorScheme:s="blue",icon:a,value:l,defaultValue:d,onChange:c,disabled:u=!1,name:h,id:m}){const[p,x]=k.useState(!1),[g,v]=k.useState(""),[y,j]=k.useState(()=>Array.isArray(d)?d:typeof d=="string"&&d?[d]:[]),w=k.useRef(null),A=k.useRef(null),B=l!==void 0,C=B?Array.isArray(l)?l:typeof l=="string"&&l?[l]:[]:y;k.useEffect(()=>{function I(M){w.current&&!w.current.contains(M.target)&&x(!1)}return p&&document.addEventListener("mousedown",I),()=>{document.removeEventListener("mousedown",I)}},[p]),k.useEffect(()=>{if(p){const I=setTimeout(()=>{var M;return(M=A.current)==null?void 0:M.focus()},50);return()=>clearTimeout(I)}else v("")},[p]);const O=I=>{if(u)return;const U=C.includes(I)?C.filter(G=>G!==I):[...C,I];B||j(U),c==null||c(U)},E=(I,M)=>{if(M.stopPropagation(),u)return;const U=C.filter(G=>G!==I);B||j(U),c==null||c(U)},F=k.useMemo(()=>{if(!g.trim())return e;const I=g.toLowerCase().trim();return e.filter(M=>M.label.toLowerCase().includes(I))},[e,g]),L=s==="purple"?"#7700CC":"#0685FF",R=n?"#DC2626":p?L:"var(--medix-form-border)",D=s==="purple"?"purple.50":"blue.50",N=s==="purple"?"purple.700":"blue.700",P=s==="purple"?"purple.200":"blue.200";return o.jsxs(f.Box,{w:"100%",position:"relative",zIndex:p?1e3:void 0,ref:w,children:[h&&o.jsx("input",{type:"hidden",name:h,id:m,value:C.join(",")}),o.jsxs(f.Box,{onClick:()=>!u&&x(!p),display:"flex",alignItems:"center",justifyContent:"space-between",minH:i==="sm"?"34px":i==="lg"?"48px":"42px",py:"1.5",px:"3",borderRadius:"md",bg:"bg.surface",cursor:u?"not-allowed":"pointer",opacity:u?.55:1,transition:"border-color 0.15s ease",style:{border:`1.5px solid ${R}`,boxShadow:"none",background:"var(--medix-form-bg)"},children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"1.5",flex:"1",minW:"0",children:[a&&o.jsx(f.Box,{color:"text.muted",display:"flex",alignItems:"center",mr:"1",children:a}),C.length===0?o.jsx(f.Text,{fontSize:i==="sm"?"xs":"sm",color:"text.muted",fontFamily:"var(--font-body)",children:t}):C.map(I=>{const M=e.find(G=>G.value===I),U=M?M.label:I;return o.jsxs(f.Box,{as:"span",display:"inline-flex",alignItems:"center",gap:"1",px:"2.5",py:"0.5",borderRadius:"full",fontSize:"xs",fontWeight:"500",fontFamily:"var(--font-body)",bg:D,color:N,border:"1px solid",borderColor:P,_dark:{bg:s==="purple"?"rgba(119, 0, 204, 0.2)":"rgba(6, 133, 255, 0.2)",color:s==="purple"?"purple.300":"blue.300",borderColor:s==="purple"?"rgba(119, 0, 204, 0.4)":"rgba(6, 133, 255, 0.4)"},children:[o.jsx("span",{children:U}),!u&&o.jsx("button",{type:"button",onClick:G=>E(I,G),"aria-label":`Remove ${U}`,style:{background:"transparent",border:"none",padding:0,marginLeft:"2px",cursor:"pointer",color:"inherit",fontSize:"13px",lineHeight:1,opacity:.75},onMouseEnter:G=>G.currentTarget.style.opacity="1",onMouseLeave:G=>G.currentTarget.style.opacity="0.75",children:"×"})]},I)})]}),o.jsx(f.Box,{display:"flex",alignItems:"center",color:"text.muted",ml:"2",style:{transform:p?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s ease"},children:o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),p&&o.jsxs(f.Box,{position:"absolute",top:"100%",left:"0",right:"0",mt:"1.5",maxH:"280px",bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",zIndex:1e3,display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"none",children:[e.length>5&&o.jsx(f.Box,{p:"2",borderBottom:"1px solid",borderColor:"border",bg:"bg.surface",children:o.jsxs(f.Box,{position:"relative",display:"flex",alignItems:"center",children:[o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{position:"absolute",left:"10px",opacity:.5,pointerEvents:"none"},children:[o.jsx("circle",{cx:"11",cy:"11",r:"8"}),o.jsx("path",{d:"m21 21-4.35-4.35"})]}),o.jsx("input",{ref:A,type:"text",placeholder:"Search options...",value:g,onChange:I=>v(I.target.value),style:{width:"100%",padding:"6px 10px 6px 30px",fontSize:"13px",fontFamily:"var(--font-body)",borderRadius:"6px",border:"1px solid var(--medix-form-border)",background:"var(--medix-form-bg)",color:"var(--medix-form-text)",outline:"none"}})]})}),o.jsx(f.Box,{overflowY:"auto",flex:"1",py:"1",children:F.length===0?o.jsx(f.Box,{px:"4",py:"3",fontSize:"xs",color:"text.muted",textAlign:"center",children:"No options found"}):F.map(I=>{const M=C.includes(I.value);return o.jsxs("button",{type:"button",disabled:I.disabled,onClick:()=>O(I.value),style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between",padding:"8px 14px",background:M?"var(--medix-form-bg-subtle)":"transparent",border:"none",cursor:I.disabled?"not-allowed":"pointer",textAlign:"left",fontFamily:"var(--font-body)",fontSize:"13px",color:"var(--medix-form-text)",opacity:I.disabled?.5:1,transition:"background 0.1s ease"},onMouseEnter:U=>{I.disabled||(U.currentTarget.style.background="var(--medix-form-bg-subtle)")},onMouseLeave:U=>{I.disabled||(U.currentTarget.style.background=M?"var(--medix-form-bg-subtle)":"transparent")},children:[o.jsx("span",{style:{fontWeight:M?600:400},children:I.label}),M&&o.jsx("span",{style:{color:L,fontWeight:700,fontSize:"14px"},children:"✓"})]},I.value)})})]}),n&&r&&o.jsx(f.Text,{mt:"1",fontSize:"xs",color:"red.500",fontFamily:"var(--font-body)",children:r})]})}function vp(e){return e.multiple?o.jsx(bp,{...e}):o.jsx(yp,{...e})}const mu={blue:{solid:"#0685FF",ring:"rgba(6,133,255,0.30)",tint:"#E8F3FF"},purple:{solid:"#7700CC",ring:"rgba(119,0,204,0.25)",tint:"#F9F0FF"},green:{solid:"#1B7A38",ring:"rgba(27,122,56,0.25)",tint:"#F0FDF4"}},xu=k.forwardRef(({colorScheme:e="blue",checked:t,defaultChecked:n=!1,onChange:r,disabled:i=!1,indeterminate:s=!1,children:a,description:l,name:d,value:c,id:u},h)=>{const m=mu[e],p=u??k.useId(),[x,g]=k.useState(n),[v,y]=k.useState(!1),j=t!==void 0?t:x,w=B=>{t===void 0&&g(B.target.checked),r==null||r(B.target.checked)},A={width:18,height:18,borderRadius:4,border:`2px solid ${j||s?m.solid:"var(--medix-form-border, #CBD5E1)"}`,background:j||s?m.solid:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:2,transition:"background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease",boxShadow:"none",pointerEvents:"none"};return o.jsxs(f.Box,{opacity:i?.55:1,children:[o.jsxs("label",{htmlFor:p,style:{display:"inline-flex",alignItems:"flex-start",gap:10,cursor:i?"not-allowed":"pointer",userSelect:"none"},children:[o.jsx("input",{ref:h,id:p,type:"checkbox",name:d,value:c,checked:j,disabled:i,onChange:w,onFocus:()=>y(!0),onBlur:()=>y(!1),style:{position:"absolute",width:1,height:1,opacity:0,margin:0,padding:0,pointerEvents:"none"}}),o.jsx("span",{style:A,"aria-hidden":"true",children:s?o.jsx("svg",{width:"10",height:"2",viewBox:"0 0 10 2",fill:"none",children:o.jsx("rect",{width:"10",height:"2",rx:"1",fill:"#fff"})}):j?o.jsx("svg",{width:"11",height:"9",viewBox:"0 0 11 9",fill:"none",children:o.jsx("path",{d:"M1 4.5L4 7.5L10 1",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):null}),a&&o.jsxs(f.Box,{children:[o.jsx(f.Text,{as:"span",fontFamily:"var(--font-body)",fontSize:"md",color:"text.body",lineHeight:"1.5",children:a}),l&&o.jsx(f.Text,{display:"block",fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:l})]})]}),!a&&l&&o.jsx(f.Text,{mt:"1",ml:"7",fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:l})]})});xu.displayName="MedixCheckbox";function kp({name:e,value:t,onChange:n,options:r,colorScheme:i="blue",direction:s="column"}){const a=mu[i],[l,d]=k.useState(""),c=t!==void 0?t:l,u=h=>{t===void 0&&d(h),n==null||n(h)};return o.jsx(f.Box,{display:"flex",flexDirection:s,gap:s==="row"?"5":"3",role:"radiogroup",children:r.map(h=>{const m=c===h.value;return o.jsx(wp,{option:h,name:e,isSelected:m,onChange:u,solidColor:a.solid,ring:a.ring},h.value)})})}function wp({option:e,name:t,isSelected:n,onChange:r,solidColor:i,ring:s}){const[a,l]=k.useState(!1);return o.jsxs("label",{style:{display:"inline-flex",alignItems:"flex-start",gap:10,cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.55:1,userSelect:"none"},children:[o.jsx("input",{type:"radio",name:t,value:e.value,checked:n,disabled:e.disabled,onChange:()=>r(e.value),onFocus:()=>l(!0),onBlur:()=>l(!1),style:{position:"absolute",width:1,height:1,opacity:0,margin:0,padding:0,pointerEvents:"none"}}),o.jsx("span",{"aria-hidden":"true",style:{width:18,height:18,borderRadius:"50%",border:`2px solid ${n?i:"var(--medix-form-border, #CBD5E1)"}`,display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:2,transition:"border-color 0.15s ease, box-shadow 0.15s ease",boxShadow:"none",pointerEvents:"none"},children:o.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:i,transform:n?"scale(1)":"scale(0)",transition:"transform 0.15s ease"}})}),o.jsxs(f.Box,{children:[o.jsx(f.Text,{as:"span",fontFamily:"var(--font-body)",fontSize:"md",color:"text.body",lineHeight:"1.5",children:e.label}),e.description&&o.jsx(f.Text,{display:"block",fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:e.description})]})]})}const Sp={blue:{solid:"#0685FF",ring:"rgba(6,133,255,0.30)",track:"#0685FF"},purple:{solid:"#7700CC",ring:"rgba(119,0,204,0.25)",track:"#7700CC"},green:{solid:"#1B7A38",ring:"rgba(27,122,56,0.25)",track:"#1B7A38"}},Cp={sm:{width:32,height:18,thumbSize:12,thumbOffset:2},md:{width:42,height:24,thumbSize:16,thumbOffset:3},lg:{width:52,height:30,thumbSize:20,thumbOffset:4}},gu=k.forwardRef(({colorScheme:e="blue",size:t="md",checked:n,defaultChecked:r=!1,onChange:i,disabled:s=!1,label:a,description:l,name:d,id:c},u)=>{const h=Sp[e],m=Cp[t],p=c??k.useId(),[x,g]=k.useState(r),[v,y]=k.useState(!1),j=n!==void 0?n:x,w=C=>{n===void 0&&g(C.target.checked),i==null||i(C.target.checked)},A={position:"relative",display:"inline-flex",alignItems:"center",width:m.width,height:m.height,borderRadius:m.height,background:j?h.track:"var(--medix-form-border, #CBD5E1)",transition:"background 0.2s ease, box-shadow 0.2s ease",boxShadow:"none",cursor:s?"not-allowed":"pointer",flexShrink:0},B={position:"absolute",width:m.thumbSize,height:m.thumbSize,borderRadius:"50%",background:"#fff",boxShadow:"none",top:m.thumbOffset,left:j?m.width-m.thumbSize-m.thumbOffset:m.thumbOffset,transition:"left 0.18s ease"};return o.jsxs(f.Box,{display:"flex",alignItems:"flex-start",gap:"3",opacity:s?.55:1,children:[o.jsxs("label",{htmlFor:p,style:{display:"inline-flex",cursor:s?"not-allowed":"pointer"},children:[o.jsx("input",{ref:u,id:p,type:"checkbox",role:"switch",name:d,checked:j,disabled:s,onChange:w,onFocus:()=>y(!0),onBlur:()=>y(!1),style:{position:"absolute",width:1,height:1,opacity:0,margin:0,padding:0,pointerEvents:"none"}}),o.jsx("span",{style:A,"aria-hidden":"true",children:o.jsx("span",{style:B})})]}),(a||l)&&o.jsxs(f.Box,{children:[a&&o.jsx("label",{htmlFor:p,style:{display:"block",fontSize:"1rem",fontWeight:500,color:"inherit",fontFamily:"var(--font-body)",lineHeight:"1.4",cursor:s?"not-allowed":"pointer",userSelect:"none"},children:a}),l&&o.jsx(f.Text,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:l})]})]})});gu.displayName="MedixSwitch";function jp({id:e,label:t,helperText:n,errorMessage:r,isRequired:i=!1,isDisabled:s=!1,children:a}){const l=!!r;return o.jsxs(f.Box,{display:"flex",flexDirection:"column",gap:"1.5",opacity:s?.5:1,pointerEvents:s?"none":void 0,w:"100%",children:[t&&o.jsxs(f.Box,{as:"label",htmlFor:e,display:"flex",alignItems:"center",gap:"1",children:[o.jsx(f.Text,{as:"span",fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:t}),i&&o.jsx(f.Text,{as:"span",color:"red.500",fontSize:"sm",lineHeight:"1",children:"*"})]}),k.cloneElement(a,{id:e,isInvalid:l||void 0}),n&&!l&&o.jsx(f.Text,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:n}),l&&r&&o.jsx(f.Text,{fontSize:"xs",color:"red.500",fontFamily:"var(--font-body)",children:r})]})}function yu({length:e=6,value:t,defaultValue:n="",onChange:r,onComplete:i,colorScheme:s="blue",isInvalid:a=!1,isDisabled:l=!1,mask:d=!1,label:c,helperText:u,errorMessage:h}){const[m,p]=k.useState(n),[x,g]=k.useState(null),v=t!==void 0,j=(v?t:m).split("").slice(0,e),w=k.useRef([]),A=a?"#DC2626":"var(--medix-form-border, var(--chakra-colors-border, #E2E8F0))",B=a?"#DC2626":s==="purple"?"#7700CC":"#0685FF",C=(F,L)=>{var R,D,N;if(F.key==="Backspace"){F.preventDefault();const P=[...j];if(P[L]){P[L]="";const I=P.join("");v||p(I),r==null||r(I)}else if(L>0){(R=w.current[L-1])==null||R.focus(),P[L-1]="";const I=P.join("");v||p(I),r==null||r(I)}}else F.key==="ArrowLeft"&&L>0?(D=w.current[L-1])==null||D.focus():F.key==="ArrowRight"&&L<e-1&&((N=w.current[L+1])==null||N.focus())},O=(F,L)=>{var P;const R=F.target.value.replace(/\D/g,""),D=[...j];for(;D.length<e;)D.push("");if(!R){D[L]="";const I=D.join("");v||p(I),r==null||r(I);return}D[L]=R[0];const N=D.join("");v||p(N),r==null||r(N),L<e-1&&((P=w.current[L+1])==null||P.focus()),N.replace(/\s/g,"").length===e&&(i==null||i(N))},E=(F,L)=>{var M;F.preventDefault();const R=F.clipboardData.getData("text").replace(/\D/g,"");if(!R)return;const D=[...j];for(;D.length<e;)D.push("");const N=R.split("").slice(0,e-L);N.forEach((U,G)=>{D[L+G]=U});const P=D.join("");v||p(P),r==null||r(P);const I=P.replace(/\s/g,"").length===e?e-1:Math.min(L+N.length,e-1);(M=w.current[I])==null||M.focus(),P.replace(/\s/g,"").length===e&&(i==null||i(P))};return o.jsxs(f.Box,{w:"fit-content",children:[c&&o.jsx(f.Text,{mb:"2",fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:c}),o.jsx(f.Box,{display:"flex",gap:"2",alignItems:"center",children:Array.from({length:e}).map((F,L)=>o.jsx("input",{ref:R=>{w.current[L]=R},type:d?"password":"text",inputMode:"numeric",pattern:"\\d*",maxLength:1,value:j[L]??"",onChange:R=>O(R,L),onKeyDown:R=>C(R,L),onPaste:R=>E(R,L),onFocus:R=>{R.target.select(),g(L)},onBlur:()=>g(null),disabled:l,"aria-label":`Digit ${L+1} of ${e}`,style:{width:"48px",height:"48px",borderRadius:"10px",border:`1.5px solid ${x===L?B:A}`,boxShadow:"none",background:"var(--medix-form-bg, var(--chakra-colors-bg-surface, #FFFFFF))",color:"var(--medix-form-text, var(--chakra-colors-text-heading, #0F172A))",fontSize:"20px",fontWeight:600,textAlign:"center",fontFamily:"var(--font-body)",outline:"none",transition:"border-color 0.15s, box-shadow 0.15s",cursor:l?"not-allowed":"text",opacity:l?.5:1}},L))}),(u||h)&&o.jsx(f.Text,{mt:"2",fontSize:"xs",color:a?"red.500":"text.muted",fontFamily:"var(--font-body)",children:a?h:u})]})}const Tp=yu;function Yr(){return Yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yr.apply(this,arguments)}function Bp(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Ep=["cdnSuffix","cdnUrl","countryCode","style","svg"],Fp="https://cdn.jsdelivr.net/gh/lipis/flag-icons/flags/4x3/",Ap="svg",Lp=127397,va=function(t){var n=t.cdnSuffix,r=n===void 0?Ap:n,i=t.cdnUrl,s=i===void 0?Fp:i,a=t.countryCode,l=t.style,d=t.svg,c=d===void 0?!1:d,u=Bp(t,Ep);if(typeof a!="string")return null;if(c){var h=""+s+a.toLowerCase()+"."+r;return k.createElement("img",Object.assign({},u,{src:h,style:Yr({display:"inline-block",width:"1em",height:"1em",verticalAlign:"middle"},l)}))}var m=a.toUpperCase().replace(/./g,function(p){return String.fromCodePoint(p.charCodeAt(0)+Lp)});return k.createElement("span",Object.assign({role:"img"},u,{style:Yr({display:"inline-block",fontSize:"1em",lineHeight:"1em",verticalAlign:"middle"},l)}),m)};const Ip={"+1":"US","+7":"RU","+39":"IT","+44":"GB","+47":"NO","+212":"MA","+262":"RE","+290":"SH","+358":"FI","+590":"GP","+599":"CW"},Zt=[{country:"AF",code:"+93",name:"Afghanistan",flag:"🇦🇫"},{country:"AL",code:"+355",name:"Albania",flag:"🇦🇱"},{country:"DZ",code:"+213",name:"Algeria",flag:"🇩🇿"},{country:"AS",code:"+1",name:"American Samoa",flag:"🇦🇸"},{country:"AD",code:"+376",name:"Andorra",flag:"🇦🇩"},{country:"AO",code:"+244",name:"Angola",flag:"🇦🇴"},{country:"AI",code:"+1",name:"Anguilla",flag:"🇦🇮"},{country:"AG",code:"+1",name:"Antigua & Barbuda",flag:"🇦🇬"},{country:"AR",code:"+54",name:"Argentina",flag:"🇦🇷"},{country:"AM",code:"+374",name:"Armenia",flag:"🇦🇲"},{country:"AW",code:"+297",name:"Aruba",flag:"🇦🇼"},{country:"AU",code:"+61",name:"Australia",flag:"🇦🇺"},{country:"AT",code:"+43",name:"Austria",flag:"🇦🇹"},{country:"AZ",code:"+994",name:"Azerbaijan",flag:"🇦🇿"},{country:"BS",code:"+1",name:"Bahamas",flag:"🇧🇸"},{country:"BH",code:"+973",name:"Bahrain",flag:"🇧🇭"},{country:"BD",code:"+880",name:"Bangladesh",flag:"🇧🇩"},{country:"BB",code:"+1",name:"Barbados",flag:"🇧🇧"},{country:"BY",code:"+375",name:"Belarus",flag:"🇧🇾"},{country:"BE",code:"+32",name:"Belgium",flag:"🇧🇪"},{country:"BZ",code:"+501",name:"Belize",flag:"🇧🇿"},{country:"BJ",code:"+229",name:"Benin",flag:"🇧🇯"},{country:"BM",code:"+1",name:"Bermuda",flag:"🇧🇲"},{country:"BT",code:"+975",name:"Bhutan",flag:"🇧🇹"},{country:"BO",code:"+591",name:"Bolivia",flag:"🇧🇴"},{country:"BA",code:"+387",name:"Bosnia & Herzegovina",flag:"🇧🇦"},{country:"BW",code:"+267",name:"Botswana",flag:"🇧🇼"},{country:"BR",code:"+55",name:"Brazil",flag:"🇧🇷"},{country:"IO",code:"+246",name:"British Indian Ocean Territory",flag:"🇮🇴"},{country:"VG",code:"+1",name:"British Virgin Islands",flag:"🇻🇬"},{country:"BN",code:"+673",name:"Brunei",flag:"🇧🇳"},{country:"BG",code:"+359",name:"Bulgaria",flag:"🇧🇬"},{country:"BF",code:"+226",name:"Burkina Faso",flag:"🇧🇫"},{country:"BI",code:"+257",name:"Burundi",flag:"🇧🇮"},{country:"KH",code:"+855",name:"Cambodia",flag:"🇰🇭"},{country:"CM",code:"+237",name:"Cameroon",flag:"🇨🇲"},{country:"CA",code:"+1",name:"Canada",flag:"🇨🇦"},{country:"CV",code:"+238",name:"Cape Verde",flag:"🇨🇻"},{country:"BQ",code:"+599",name:"Caribbean Netherlands",flag:"🇧🇶"},{country:"KY",code:"+1",name:"Cayman Islands",flag:"🇰🇾"},{country:"CF",code:"+236",name:"Central African Republic",flag:"🇨🇫"},{country:"TD",code:"+235",name:"Chad",flag:"🇹🇩"},{country:"CL",code:"+56",name:"Chile",flag:"🇨🇱"},{country:"CN",code:"+86",name:"China",flag:"🇨🇳"},{country:"CO",code:"+57",name:"Colombia",flag:"🇨🇴"},{country:"KM",code:"+269",name:"Comoros",flag:"🇰🇲"},{country:"CD",code:"+243",name:"DR Congo",flag:"🇨🇩"},{country:"CG",code:"+242",name:"Congo",flag:"🇨🇬"},{country:"CK",code:"+682",name:"Cook Islands",flag:"🇨🇰"},{country:"CR",code:"+506",name:"Costa Rica",flag:"🇨🇷"},{country:"HR",code:"+385",name:"Croatia",flag:"🇭🇷"},{country:"CU",code:"+53",name:"Cuba",flag:"🇨🇺"},{country:"CW",code:"+599",name:"Curaçao",flag:"🇨🇼"},{country:"CY",code:"+357",name:"Cyprus",flag:"🇨🇾"},{country:"CZ",code:"+420",name:"Czech Republic",flag:"🇨🇿"},{country:"DK",code:"+45",name:"Denmark",flag:"🇩🇰"},{country:"DJ",code:"+253",name:"Djibouti",flag:"🇩🇯"},{country:"DM",code:"+1",name:"Dominica",flag:"🇩🇲"},{country:"DO",code:"+1",name:"Dominican Republic",flag:"🇩🇴"},{country:"EC",code:"+593",name:"Ecuador",flag:"🇪🇨"},{country:"EG",code:"+20",name:"Egypt",flag:"🇪🇬"},{country:"SV",code:"+503",name:"El Salvador",flag:"🇸🇻"},{country:"GQ",code:"+240",name:"Equatorial Guinea",flag:"🇬🇶"},{country:"ER",code:"+291",name:"Eritrea",flag:"🇪🇷"},{country:"EE",code:"+372",name:"Estonia",flag:"🇪🇪"},{country:"SZ",code:"+268",name:"Eswatini",flag:"🇸🇿"},{country:"ET",code:"+251",name:"Ethiopia",flag:"🇪🇹"},{country:"FK",code:"+500",name:"Falkland Islands",flag:"🇫🇰"},{country:"FO",code:"+298",name:"Faroe Islands",flag:"🇫🇴"},{country:"FJ",code:"+679",name:"Fiji",flag:"🇫🇯"},{country:"FI",code:"+358",name:"Finland",flag:"🇫🇮"},{country:"FR",code:"+33",name:"France",flag:"🇫🇷"},{country:"GF",code:"+594",name:"French Guiana",flag:"🇬🇫"},{country:"PF",code:"+689",name:"French Polynesia",flag:"🇵🇫"},{country:"GA",code:"+241",name:"Gabon",flag:"🇬🇦"},{country:"GM",code:"+220",name:"Gambia",flag:"🇬🇲"},{country:"GE",code:"+995",name:"Georgia",flag:"🇬🇪"},{country:"DE",code:"+49",name:"Germany",flag:"🇩🇪"},{country:"GH",code:"+233",name:"Ghana",flag:"🇬🇭"},{country:"GI",code:"+350",name:"Gibraltar",flag:"🇬🇮"},{country:"GR",code:"+30",name:"Greece",flag:"🇬🇷"},{country:"GL",code:"+299",name:"Greenland",flag:"🇬🇱"},{country:"GD",code:"+1",name:"Grenada",flag:"🇬🇩"},{country:"GP",code:"+590",name:"Guadeloupe",flag:"🇬🇵"},{country:"GU",code:"+1",name:"Guam",flag:"🇬🇺"},{country:"GT",code:"+502",name:"Guatemala",flag:"🇬🇹"},{country:"GG",code:"+44",name:"Guernsey",flag:"🇬🇬"},{country:"GN",code:"+224",name:"Guinea",flag:"🇬🇳"},{country:"GW",code:"+245",name:"Guinea-Bissau",flag:"🇬🇼"},{country:"GY",code:"+592",name:"Guyana",flag:"🇬🇾"},{country:"HT",code:"+509",name:"Haiti",flag:"🇭🇹"},{country:"HN",code:"+504",name:"Honduras",flag:"🇭🇳"},{country:"HK",code:"+852",name:"Hong Kong",flag:"🇭🇰"},{country:"HU",code:"+36",name:"Hungary",flag:"🇭🇺"},{country:"IS",code:"+354",name:"Iceland",flag:"🇮🇸"},{country:"IN",code:"+91",name:"India",flag:"🇮🇳"},{country:"ID",code:"+62",name:"Indonesia",flag:"🇮🇩"},{country:"IR",code:"+98",name:"Iran",flag:"🇮🇷"},{country:"IQ",code:"+964",name:"Iraq",flag:"🇮🇶"},{country:"IE",code:"+353",name:"Ireland",flag:"🇮🇪"},{country:"IM",code:"+44",name:"Isle of Man",flag:"🇮🇲"},{country:"IL",code:"+972",name:"Israel",flag:"🇮🇱"},{country:"IT",code:"+39",name:"Italy",flag:"🇮🇹"},{country:"CI",code:"+225",name:"Ivory Coast",flag:"🇨🇮"},{country:"JM",code:"+1",name:"Jamaica",flag:"🇯🇲"},{country:"JP",code:"+81",name:"Japan",flag:"🇯🇵"},{country:"JE",code:"+44",name:"Jersey",flag:"🇯🇪"},{country:"JO",code:"+962",name:"Jordan",flag:"🇯🇴"},{country:"KZ",code:"+7",name:"Kazakhstan",flag:"🇰🇿"},{country:"KE",code:"+254",name:"Kenya",flag:"🇰🇪"},{country:"KI",code:"+686",name:"Kiribati",flag:"🇰🇮"},{country:"XK",code:"+383",name:"Kosovo",flag:"🇽🇰"},{country:"KW",code:"+965",name:"Kuwait",flag:"🇰🇼"},{country:"KG",code:"+996",name:"Kyrgyzstan",flag:"🇰🇬"},{country:"LA",code:"+856",name:"Laos",flag:"🇱🇦"},{country:"LV",code:"+371",name:"Latvia",flag:"🇱🇻"},{country:"LB",code:"+961",name:"Lebanon",flag:"🇱🇧"},{country:"LS",code:"+266",name:"Lesotho",flag:"🇱🇸"},{country:"LR",code:"+231",name:"Liberia",flag:"🇱🇷"},{country:"LY",code:"+218",name:"Libya",flag:"🇱🇾"},{country:"LI",code:"+423",name:"Liechtenstein",flag:"🇱🇮"},{country:"LT",code:"+370",name:"Lithuania",flag:"🇱🇹"},{country:"LU",code:"+352",name:"Luxembourg",flag:"🇱🇺"},{country:"MO",code:"+853",name:"Macao",flag:"🇲🇴"},{country:"MK",code:"+389",name:"North Macedonia",flag:"🇲🇰"},{country:"MG",code:"+261",name:"Madagascar",flag:"🇲🇬"},{country:"MW",code:"+265",name:"Malawi",flag:"🇲🇼"},{country:"MY",code:"+60",name:"Malaysia",flag:"🇲🇾"},{country:"MV",code:"+960",name:"Maldives",flag:"🇲🇻"},{country:"ML",code:"+223",name:"Mali",flag:"🇲🇱"},{country:"MT",code:"+356",name:"Malta",flag:"🇲🇹"},{country:"MH",code:"+692",name:"Marshall Islands",flag:"🇲🇭"},{country:"MQ",code:"+596",name:"Martinique",flag:"🇲🇶"},{country:"MR",code:"+222",name:"Mauritania",flag:"🇲🇷"},{country:"MU",code:"+230",name:"Mauritius",flag:"🇲🇺"},{country:"YT",code:"+262",name:"Mayotte",flag:"🇾🇹"},{country:"MX",code:"+52",name:"Mexico",flag:"🇲🇽"},{country:"FM",code:"+691",name:"Micronesia",flag:"🇫🇲"},{country:"MD",code:"+373",name:"Moldova",flag:"🇲🇩"},{country:"MC",code:"+377",name:"Monaco",flag:"🇲🇨"},{country:"MN",code:"+976",name:"Mongolia",flag:"🇲🇳"},{country:"ME",code:"+382",name:"Montenegro",flag:"🇲🇪"},{country:"MS",code:"+1",name:"Montserrat",flag:"🇲🇸"},{country:"MA",code:"+212",name:"Morocco",flag:"🇲🇦"},{country:"MZ",code:"+258",name:"Mozambique",flag:"🇲🇿"},{country:"MM",code:"+95",name:"Myanmar",flag:"🇲🇲"},{country:"NA",code:"+264",name:"Namibia",flag:"🇳🇦"},{country:"NR",code:"+674",name:"Nauru",flag:"🇳🇷"},{country:"NP",code:"+977",name:"Nepal",flag:"🇳🇵"},{country:"NL",code:"+31",name:"Netherlands",flag:"🇳🇱"},{country:"NC",code:"+687",name:"New Caledonia",flag:"🇳🇨"},{country:"NZ",code:"+64",name:"New Zealand",flag:"🇳🇿"},{country:"NI",code:"+505",name:"Nicaragua",flag:"🇳🇮"},{country:"NE",code:"+227",name:"Niger",flag:"🇳🇪"},{country:"NG",code:"+234",name:"Nigeria",flag:"🇳🇬"},{country:"NU",code:"+683",name:"Niue",flag:"🇳🇺"},{country:"NF",code:"+672",name:"Norfolk Island",flag:"🇳🇫"},{country:"KP",code:"+850",name:"North Korea",flag:"🇰🇵"},{country:"MP",code:"+1",name:"Northern Mariana Islands",flag:"🇲🇵"},{country:"NO",code:"+47",name:"Norway",flag:"🇳🇴"},{country:"OM",code:"+968",name:"Oman",flag:"🇴🇲"},{country:"PK",code:"+92",name:"Pakistan",flag:"🇵🇰"},{country:"PW",code:"+680",name:"Palau",flag:"🇵🇼"},{country:"PS",code:"+970",name:"Palestine",flag:"🇵🇸"},{country:"PA",code:"+507",name:"Panama",flag:"🇵🇦"},{country:"PG",code:"+675",name:"Papua New Guinea",flag:"🇵🇬"},{country:"PY",code:"+595",name:"Paraguay",flag:"🇵🇾"},{country:"PE",code:"+51",name:"Peru",flag:"🇵🇪"},{country:"PH",code:"+63",name:"Philippines",flag:"🇵🇭"},{country:"PL",code:"+48",name:"Poland",flag:"🇵🇱"},{country:"PT",code:"+351",name:"Portugal",flag:"🇵🇹"},{country:"PR",code:"+1",name:"Puerto Rico",flag:"🇵🇷"},{country:"QA",code:"+974",name:"Qatar",flag:"🇶🇦"},{country:"RE",code:"+262",name:"Réunion",flag:"🇷🇪"},{country:"RO",code:"+40",name:"Romania",flag:"🇷🇴"},{country:"RU",code:"+7",name:"Russia",flag:"🇷🇺"},{country:"RW",code:"+250",name:"Rwanda",flag:"🇷🇼"},{country:"WS",code:"+685",name:"Samoa",flag:"🇼🇸"},{country:"SM",code:"+378",name:"San Marino",flag:"🇸🇲"},{country:"ST",code:"+239",name:"São Tomé & Príncipe",flag:"🇸🇹"},{country:"SA",code:"+966",name:"Saudi Arabia",flag:"🇸🇦"},{country:"SN",code:"+221",name:"Senegal",flag:"🇸🇳"},{country:"RS",code:"+381",name:"Serbia",flag:"🇷🇸"},{country:"SC",code:"+248",name:"Seychelles",flag:"🇸🇨"},{country:"SL",code:"+232",name:"Sierra Leone",flag:"🇸🇱"},{country:"SG",code:"+65",name:"Singapore",flag:"🇸🇬"},{country:"SX",code:"+1",name:"Sint Maarten",flag:"🇸🇽"},{country:"SK",code:"+421",name:"Slovakia",flag:"🇸🇰"},{country:"SI",code:"+386",name:"Slovenia",flag:"🇸🇮"},{country:"SB",code:"+677",name:"Solomon Islands",flag:"🇸🇧"},{country:"SO",code:"+252",name:"Somalia",flag:"🇸🇴"},{country:"ZA",code:"+27",name:"South Africa",flag:"🇿🇦"},{country:"KR",code:"+82",name:"South Korea",flag:"🇰🇷"},{country:"SS",code:"+211",name:"South Sudan",flag:"🇸🇸"},{country:"ES",code:"+34",name:"Spain",flag:"🇪🇸"},{country:"LK",code:"+94",name:"Sri Lanka",flag:"🇱🇰"},{country:"BL",code:"+590",name:"Saint Barthélemy",flag:"🇧🇱"},{country:"SH",code:"+290",name:"Saint Helena",flag:"🇸🇭"},{country:"KN",code:"+1",name:"Saint Kitts & Nevis",flag:"🇰🇳"},{country:"LC",code:"+1",name:"Saint Lucia",flag:"🇱🇨"},{country:"MF",code:"+590",name:"Saint Martin",flag:"🇲🇫"},{country:"PM",code:"+508",name:"Saint Pierre & Miquelon",flag:"🇵🇲"},{country:"VC",code:"+1",name:"Saint Vincent & Grenadines",flag:"🇻🇨"},{country:"SD",code:"+249",name:"Sudan",flag:"🇸🇩"},{country:"SR",code:"+597",name:"Suriname",flag:"🇸🇷"},{country:"SJ",code:"+47",name:"Svalbard & Jan Mayen",flag:"🇸🇯"},{country:"SE",code:"+46",name:"Sweden",flag:"🇸🇪"},{country:"CH",code:"+41",name:"Switzerland",flag:"🇨🇭"},{country:"SY",code:"+963",name:"Syria",flag:"🇸🇾"},{country:"TW",code:"+886",name:"Taiwan",flag:"🇹🇼"},{country:"TJ",code:"+992",name:"Tajikistan",flag:"🇹🇯"},{country:"TZ",code:"+255",name:"Tanzania",flag:"🇹🇿"},{country:"TH",code:"+66",name:"Thailand",flag:"🇹🇭"},{country:"TG",code:"+228",name:"Togo",flag:"🇹🇬"},{country:"TK",code:"+690",name:"Tokelau",flag:"🇹🇰"},{country:"TO",code:"+676",name:"Tonga",flag:"🇹🇴"},{country:"TT",code:"+1",name:"Trinidad & Tobago",flag:"🇹🇹"},{country:"TN",code:"+216",name:"Tunisia",flag:"🇹🇳"},{country:"TR",code:"+90",name:"Turkey",flag:"🇹🇷"},{country:"TM",code:"+993",name:"Turkmenistan",flag:"🇹🇲"},{country:"TC",code:"+1",name:"Turks & Caicos Islands",flag:"🇹🇨"},{country:"TV",code:"+688",name:"Tuvalu",flag:"🇹🇻"},{country:"VI",code:"+1",name:"US Virgin Islands",flag:"🇻🇮"},{country:"UG",code:"+256",name:"Uganda",flag:"🇺🇬"},{country:"UA",code:"+380",name:"Ukraine",flag:"🇺🇦"},{country:"AE",code:"+971",name:"United Arab Emirates",flag:"🇦🇪"},{country:"GB",code:"+44",name:"United Kingdom",flag:"🇬🇧"},{country:"US",code:"+1",name:"United States",flag:"🇺🇸"},{country:"UY",code:"+598",name:"Uruguay",flag:"🇺🇾"},{country:"UZ",code:"+998",name:"Uzbekistan",flag:"🇺🇿"},{country:"VU",code:"+678",name:"Vanuatu",flag:"🇻🇺"},{country:"VA",code:"+39",name:"Vatican City",flag:"🇻🇦"},{country:"VE",code:"+58",name:"Venezuela",flag:"🇻🇪"},{country:"VN",code:"+84",name:"Vietnam",flag:"🇻🇳"},{country:"WF",code:"+681",name:"Wallis & Futuna",flag:"🇼🇫"},{country:"EH",code:"+212",name:"Western Sahara",flag:"🇪🇭"},{country:"YE",code:"+967",name:"Yemen",flag:"🇾🇪"},{country:"ZM",code:"+260",name:"Zambia",flag:"🇿🇲"},{country:"ZW",code:"+263",name:"Zimbabwe",flag:"🇿🇼"},{country:"AX",code:"+358",name:"Åland Islands",flag:"🇦🇽"}];function Dp({value:e="",onChange:t,showCountryCode:n=!0,showCountryFlag:r=!0,defaultCountryCode:i="+234",defaultCountry:s,placeholder:a="80 000 0000",colorScheme:l="blue",isInvalid:d=!1,errorMessage:c,label:u,helperText:h,isDisabled:m=!1,id:p}){const x=k.useId(),g=p??x,v=s??(i?Ip[i]:void 0),y=(v?Zt.find(W=>W.country===v):void 0)??Zt.find(W=>W.code===i)??Zt.find(W=>W.country==="NG")??Zt[0],[j,w]=k.useState(y.country),[A,B]=k.useState(e),[C,O]=k.useState(!1),[E,F]=k.useState(!1),[L,R]=k.useState(""),D=k.useRef(null),N=k.useRef(null),P=Zt.find(W=>W.country===j)??y;k.useEffect(()=>{function W(ne){D.current&&!D.current.contains(ne.target)&&F(!1)}return E&&document.addEventListener("mousedown",W),()=>{document.removeEventListener("mousedown",W)}},[E]),k.useEffect(()=>{if(E){const W=setTimeout(()=>{var ne;(ne=N.current)==null||ne.focus()},50);return()=>clearTimeout(W)}else R("")},[E]);const I=k.useMemo(()=>{if(!L.trim())return Zt;const W=L.toLowerCase().trim();return Zt.filter(ne=>ne.name.toLowerCase().includes(W)||ne.code.toLowerCase().includes(W)||ne.country.toLowerCase().includes(W))},[L]),M=W=>{const ne=W.target.value.replace(/[^\d\s\-]/g,"");B(ne),t==null||t(`${P.code}${ne.replace(/\s/g,"")}`)},U=W=>{w(W.country),t==null||t(`${W.code}${A.replace(/\s/g,"")}`),F(!1)},H=d?"#DC2626":C||E?l==="purple"?"#7700CC":"#0685FF":"var(--medix-form-border)";return o.jsxs(f.Box,{w:"100%",children:[u&&o.jsx("label",{htmlFor:g,style:{display:"block",marginBottom:"6px",fontSize:"14px",fontWeight:500,color:"var(--medix-form-text)",fontFamily:"var(--font-body)"},children:u}),o.jsxs(f.Box,{display:"flex",alignItems:"center",borderRadius:"10px",transition:"border-color 0.15s, box-shadow 0.15s",opacity:m?.5:1,pointerEvents:m?"none":void 0,position:"relative",zIndex:E?1e3:void 0,style:{border:`1.5px solid ${H}`,boxShadow:"none",background:"var(--medix-form-bg)"},children:[n&&o.jsxs(f.Box,{position:"relative",ref:D,h:"full",children:[o.jsxs("button",{id:`${g}-country`,type:"button",onClick:()=>!m&&F(!E),disabled:m,"aria-label":"Select country code","aria-expanded":E,style:{display:"flex",alignItems:"center",gap:"6px",padding:"10px 12px",background:"var(--medix-form-bg-subtle)",border:"none",borderRight:"1px solid var(--medix-form-border)",borderTopLeftRadius:"8px",borderBottomLeftRadius:"8px",cursor:m?"not-allowed":"pointer",height:"100%",color:"var(--medix-form-text)",fontFamily:"var(--font-body)",fontSize:"14px",fontWeight:500},children:[r&&o.jsx(f.Box,{display:"flex",alignItems:"center",fontSize:"lg",lineHeight:"1",children:o.jsx(va,{countryCode:P.country,svg:!0,style:{width:"1.2em",height:"1.2em",borderRadius:"2px"}})}),o.jsx("span",{children:P.code}),o.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:E?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s ease",opacity:.7},children:o.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),E&&o.jsxs(f.Box,{position:"absolute",top:"100%",left:"0",mt:"2",w:"280px",maxH:"320px",bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",zIndex:1e3,display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"none",children:[o.jsx(f.Box,{p:"2.5",color:"text.heading",borderBottom:"1px solid",borderColor:"border",bg:"bg.surface",children:o.jsxs(f.Box,{color:"text.heading",position:"relative",display:"flex",alignItems:"center",children:[o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{position:"absolute",left:"10px",opacity:.5,pointerEvents:"none"},children:[o.jsx("circle",{cx:"11",cy:"11",r:"8"}),o.jsx("path",{d:"m21 21-4.35-4.35"})]}),o.jsx("input",{ref:N,type:"text",placeholder:"Search country or code...",value:L,onChange:W=>R(W.target.value),style:{width:"100%",padding:"6px 10px 6px 30px",fontSize:"13px",fontFamily:"var(--font-body)",borderRadius:"6px",border:"1px solid var(--medix-form-border)",background:"var(--medix-form-bg)",color:"var(--medix-form-text)",outline:"none"}})]})}),o.jsx(f.Box,{overflowY:"auto",flex:"1",py:"1",children:I.length===0?o.jsx(f.Box,{px:"4",py:"3",fontSize:"xs",color:"text.muted",textAlign:"center",children:"No country found"}):I.map(W=>{const ne=W.country===P.country;return o.jsxs("button",{type:"button",onClick:()=>U(W),style:{display:"flex",width:"100%",alignItems:"center",gap:"10px",padding:"8px 14px",background:ne?"var(--medix-form-bg-subtle)":"transparent",border:"none",cursor:"pointer",textAlign:"left",fontFamily:"var(--font-body)",fontSize:"13px",color:"var(--medix-form-text)",transition:"background 0.1s ease"},onMouseEnter:T=>{T.currentTarget.style.background="var(--medix-form-bg-subtle)"},onMouseLeave:T=>{T.currentTarget.style.background=ne?"var(--medix-form-bg-subtle)":"transparent"},children:[o.jsx(f.Box,{display:"flex",alignItems:"center",fontSize:"md",flexShrink:0,children:o.jsx(va,{countryCode:W.country,svg:!0,style:{width:"1.2em",height:"1.2em",borderRadius:"2px"}})}),o.jsx(f.Text,{flex:"1",truncate:!0,fontWeight:ne?"600":"400",children:W.name}),o.jsx(f.Text,{fontSize:"xs",color:"text.muted",flexShrink:0,children:W.code})]},`${W.country}-${W.code}`)})})]})]}),o.jsx("input",{id:g,type:"tel",value:A,onChange:M,onFocus:()=>O(!0),onBlur:()=>O(!1),placeholder:a,disabled:m,"aria-invalid":d,style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"15px",fontFamily:"var(--font-body)",color:"var(--medix-form-text)",padding:"10px 16px",minWidth:0}})]}),(h||c)&&o.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:d?"red.500":"text.muted",fontFamily:"var(--font-body)",children:d?c:h})]})}const Rp=["MON","TUES","WED","THURS","FRI","SAT","SUN"],Mp=["January","February","March","April","May","June","July","August","September","October","November","December"],Pp=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Un=12;function fo(e,t){return new Date(e,t+1,0).getDate()}function Op(e,t){return new Date(e,t,1).getDay()}function zp(e){return e===0?6:e-1}function ka(e,t,n,r,i){const s=new Date(n,t,e);if(r){const a=new Date(r.getFullYear(),r.getMonth(),r.getDate());if(s<a)return!0}if(i){const a=new Date(i.getFullYear(),i.getMonth(),i.getDate());if(s>a)return!0}return!1}function _p(e,t,n,r){const i=fo(t,e),s=new Date(t,e,1),a=new Date(t,e,i);if(n){const l=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(a<l)return!0}if(r){const l=new Date(r.getFullYear(),r.getMonth(),r.getDate());if(s>l)return!0}return!1}function Np(e,t,n){return!!(t&&e<t.getFullYear()||n&&e>n.getFullYear())}function cs({value:e,onChange:t,minDate:n,maxDate:r,colorScheme:i="blue",...s}){const a=i==="purple"?"#7700CC":"#0685FF",l=i==="purple"?"rgba(119,0,204,0.14)":"rgba(6,133,255,0.14)",[d,c]=k.useState(()=>e?new Date(e):new Date),[u,h]=k.useState("day"),[m,p]=k.useState(0);k.useEffect(()=>{e&&c(H=>{const b=new Date(e);return H.getFullYear()===b.getFullYear()&&H.getMonth()===b.getMonth()?H:b})},[e]);const x=d.getFullYear(),g=d.getMonth(),y=Math.floor(x/Un)*Un+m*Un,j=y+Un-1,w=!n||x>n.getFullYear()||x===n.getFullYear()&&g>n.getMonth(),A=!r||x<r.getFullYear()||x===r.getFullYear()&&g<r.getMonth(),B=()=>{c(new Date(x,g-1,1))},C=()=>{c(new Date(x,g+1,1))},O=()=>{const H=new Date;c(H),h("day"),t&&!ka(H.getDate(),H.getMonth(),H.getFullYear(),n,r)&&t(H)},E=H=>{c(new Date(x,H,1)),h("day")},F=H=>{c(new Date(H,g,1)),p(0),h("month")},L=fo(x,g),R=zp(Op(x,g)),D=fo(x,g-1),P=(R+L>35?42:35)-(R+L),I=(H,b,W)=>e?e.getDate()===H&&e.getMonth()===b&&e.getFullYear()===W:!1,M=()=>{const H=[];for(let b=0;b<R;b++){const W=D-R+b+1;H.push(o.jsx(Fi,{day:W,isMuted:!0,accentColor:a},`prev-${b}`))}for(let b=1;b<=L;b++){const W=ka(b,g,x,n,r);H.push(o.jsx(Fi,{day:b,isActive:I(b,g,x),isDisabled:W,accentColor:a,accentLight:l,onClick:W?void 0:()=>t==null?void 0:t(new Date(x,g,b))},`curr-${b}`))}for(let b=1;b<=P;b++)H.push(o.jsx(Fi,{day:b,isMuted:!0,accentColor:a},`next-${b}`));return H},U=()=>o.jsx(f.Box,{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2",p:"1",mt:"2",children:Pp.map((H,b)=>{const W=b===g,ne=_p(b,x,n,r);return o.jsx(Sa,{label:H,isActive:W,isDisabled:ne,accentColor:a,accentLight:l,onClick:()=>!ne&&E(b)},H)})}),G=()=>{const H=Array.from({length:Un},(b,W)=>y+W);return o.jsxs(o.Fragment,{children:[o.jsxs(f.Flex,{justify:"space-between",align:"center",mb:"3",children:[o.jsx(Cr,{direction:"prev",enabled:!0,accentColor:a,onClick:()=>p(b=>b-1),ariaLabel:"Previous years"}),o.jsxs(f.Text,{fontSize:"sm",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-body)",children:[y," – ",j]}),o.jsx(Cr,{direction:"next",enabled:!0,accentColor:a,onClick:()=>p(b=>b+1),ariaLabel:"Next years"})]}),o.jsx(f.Box,{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2",p:"1",children:H.map(b=>{const W=b===x,ne=Np(b,n,r);return o.jsx(Sa,{label:String(b),isActive:W,isDisabled:ne,accentColor:a,accentLight:l,onClick:()=>!ne&&F(b)},b)})})]})};return o.jsxs(f.Box,{w:"100%",maxW:"360px",bg:"bg.surface",borderRadius:"card",p:"5",fontFamily:"var(--font-body)",...s,children:[o.jsxs(f.Flex,{justify:"space-between",align:"center",mb:u==="day"?"6":"4",children:[o.jsxs(f.Flex,{align:"center",gap:"1",children:[u==="day"&&o.jsx(Cr,{direction:"prev",enabled:w,accentColor:a,onClick:B,ariaLabel:"Go to previous month"}),o.jsx(wa,{label:Mp[g],isActive:u==="month",accentColor:a,accentLight:l,onClick:()=>{h(H=>H==="month"?"day":"month"),p(0)}}),o.jsx(wa,{label:String(x),isActive:u==="year",accentColor:a,accentLight:l,onClick:()=>{h(H=>H==="year"?"day":"year"),p(0)}}),u==="day"&&o.jsx(Cr,{direction:"next",enabled:A,accentColor:a,onClick:C,ariaLabel:"Go to next month"})]}),o.jsx(f.Box,{as:"button",type:"button",onClick:O,px:"3",py:"1",fontSize:"sm",fontWeight:"medium",borderRadius:"md",border:"1px solid",borderColor:"border",color:"text.heading",_hover:{bg:"bg.subtle"},children:"Today"})]}),u==="day"&&o.jsxs(o.Fragment,{children:[o.jsx(f.Flex,{mb:"3",children:Rp.map(H=>o.jsx(f.Box,{flex:"1",textAlign:"center",fontSize:"xs",fontWeight:"medium",color:"text.muted",children:H},H))}),o.jsx(f.Box,{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gapY:"2",children:M()})]}),u==="month"&&U(),u==="year"&&G()]})}function Cr({enabled:e,onClick:t,direction:n,accentColor:r,ariaLabel:i}){return o.jsx(f.Box,{as:"button",type:"button","aria-label":i??(n==="prev"?"Go to previous month":"Go to next month"),"aria-disabled":!e,disabled:!e,onClick:e?t:void 0,display:"flex",alignItems:"center",justifyContent:"center",w:"7",h:"7",borderRadius:"md",cursor:e?"pointer":"not-allowed",color:e?"text.heading":"text.muted",opacity:e?1:.35,p:"0",flexShrink:0,_hover:e?{color:r,bg:"bg.subtle"}:void 0,transition:"all 0.15s",children:o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n==="prev"?o.jsx("path",{d:"M15 18l-6-6 6-6"}):o.jsx("path",{d:"M9 18l6-6-6-6"})})})}function wa({label:e,isActive:t,accentColor:n,accentLight:r,onClick:i}){return o.jsxs(f.Box,{as:"button",type:"button",onClick:i,title:t?"Click to collapse":"Click to browse",display:"inline-flex",alignItems:"center",gap:"0.5",px:"2",py:"0.5",borderRadius:"md",bg:t?r:"transparent",color:t?n:"text.heading",fontWeight:"semibold",fontSize:"15px",fontFamily:"var(--font-body)",cursor:"pointer",lineHeight:"1.4",_hover:t?void 0:{bg:r,color:n},transition:"all 0.15s",children:[e,o.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:t?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",opacity:.7,marginTop:"1px"},children:o.jsx("path",{d:"M6 9l6 6 6-6"})})]})}function Sa({label:e,isActive:t,isDisabled:n,accentColor:r,accentLight:i,onClick:s}){return o.jsx(f.Box,{as:"button",type:"button",onClick:n?void 0:s,disabled:n,display:"flex",alignItems:"center",justifyContent:"center",h:"10",borderRadius:"md",border:"1.5px solid",borderColor:t?r:"transparent",bg:t?r:"transparent",color:t?"white":n?"text.muted":"text.heading",fontSize:"13px",fontWeight:t?"semibold":"medium",fontFamily:"var(--font-body)",cursor:n?"not-allowed":"pointer",opacity:n?.35:1,_hover:!n&&!t?{bg:i,color:r,borderColor:r}:void 0,transition:"all 0.15s",children:e})}function Fi({day:e,isActive:t,isMuted:n,isDisabled:r,accentColor:i,accentLight:s,onClick:a}){return o.jsx(f.Flex,{justify:"center",align:"center",h:"10",children:o.jsx(f.Box,{as:"button",type:"button",display:"flex",alignItems:"center",justifyContent:"center",w:"9",h:"9",borderRadius:"full",fontSize:"sm",fontWeight:"medium",onClick:a,disabled:n||r,cursor:n?"default":r?"not-allowed":"pointer",opacity:r?.35:1,style:{background:t?i:"transparent",color:t?"#ffffff":void 0,transition:"background 0.15s, color 0.15s"},color:t?void 0:n||r?"text.muted":"text.heading",_hover:!n&&!r&&!t?{bg:s,color:i}:void 0,transition:"all 0.2s",children:e})})}function Vp({value:e,onChange:t,min:n,max:r,label:i,helperText:s,errorMessage:a,colorScheme:l="blue",isInvalid:d=!1,isDisabled:c=!1,placeholder:u="Select date",id:h,includeTime:m=!1}){const[p,x]=k.useState(!1),g=k.useRef(null),v=F=>F!=null&&F.includes("T")&&F.split("T")[1].slice(0,5)||"00:00";k.useEffect(()=>{function F(L){g.current&&!g.current.contains(L.target)&&x(!1)}return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[]);const j=d?"#DC2626":p?l==="purple"?"#7700CC":"#0685FF":"var(--medix-form-border)",w="none",A=F=>{const L=F.getFullYear(),R=String(F.getMonth()+1).padStart(2,"0"),D=String(F.getDate()).padStart(2,"0");m?t==null||t(`${L}-${R}-${D}T${v(e)}`):(t==null||t(`${L}-${R}-${D}`),x(!1))},B=F=>{const L=F.target.value,R=(e==null?void 0:e.split("T")[0])??"";R&&(t==null||t(`${R}T${L}`))},C=F=>{if(!F)return;const[L,R,D]=F.split("-"),N=Number(L),P=Number(R),I=Number(D==null?void 0:D.split("T")[0]);if(!Number.isInteger(N)||!Number.isInteger(P)||!Number.isInteger(I))return;const M=new Date(N,P-1,I);if(!(M.getFullYear()!==N||M.getMonth()!==P-1||M.getDate()!==I))return M},O=C(e==null?void 0:e.split("T")[0]),E=O&&!isNaN(O.getTime())?m&&(e!=null&&e.includes("T"))?`${O.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})} ${e.split("T")[1].slice(0,5)}`:O.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"";return o.jsxs(f.Box,{w:"100%",position:"relative",zIndex:p?1e3:void 0,ref:g,children:[i&&o.jsx(f.Text,{mb:"1.5",fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:i}),o.jsxs(f.Box,{position:"relative",children:[o.jsx("input",{id:h,readOnly:!0,type:"text",value:E,placeholder:u,disabled:c,"aria-invalid":d,"aria-haspopup":"dialog","aria-expanded":p,onClick:()=>!c&&x(!p),onKeyDown:F=>{c||(F.key==="Enter"||F.key===" "||F.key==="ArrowDown"?(F.preventDefault(),x(!0)):F.key==="Escape"&&x(!1))},style:{width:"100%",height:"40px",padding:"0 40px 0 16px",borderRadius:"10px",border:`1.5px solid ${j}`,boxShadow:w,background:"var(--medix-form-bg)",color:"var(--medix-form-text)",fontSize:"15px",fontFamily:"var(--font-body)",outline:"none",transition:"border-color 0.15s, box-shadow 0.15s",cursor:c?"not-allowed":"pointer",opacity:c?.5:1,colorScheme:"auto"}}),o.jsx(f.Box,{position:"absolute",right:"3",top:"50%",transform:"translateY(-50%)",pointerEvents:"none",fontSize:"md",color:"text.muted",children: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",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),o.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),o.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),o.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})})]}),p&&o.jsxs(f.Box,{position:"absolute",top:"calc(100% + 8px)",left:"0",zIndex:1e3,boxShadow:"none",borderRadius:"card",border:"1px solid",borderColor:"border",bg:"bg.surface",overflow:"hidden",children:[o.jsx(cs,{value:O,onChange:A,minDate:C(n),maxDate:C(r),colorScheme:l}),m&&o.jsxs(f.Box,{px:"5",pb:"4",borderTop:"1px solid",borderColor:"border",children:[o.jsx(f.Text,{fontSize:"xs",fontWeight:"medium",color:"text.muted",mb:"1.5",fontFamily:"var(--font-body)",children:"Time"}),o.jsx("input",{type:"time",value:v(e),onChange:B,disabled:!O,style:{width:"100%",height:"36px",padding:"0 12px",borderRadius:"8px",border:"1.5px solid var(--medix-form-border)",background:"var(--medix-form-bg)",color:"var(--medix-form-text)",fontSize:"14px",fontFamily:"var(--font-body)",outline:"none",opacity:O?1:.4,cursor:O?"default":"not-allowed",colorScheme:"auto"}})]})]}),(s||a)&&o.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:d?"red.500":"text.muted",fontFamily:"var(--font-body)",children:d?a:s})]})}function Wp({startValue:e,onStartChange:t,endValue:n,onEndChange:r,min:i,max:s,label:a,helperText:l,errorMessage:d,colorScheme:c="blue",isInvalid:u=!1,isDisabled:h=!1,startPlaceholder:m="Start date",endPlaceholder:p="End date",id:x}){const[g,v]=k.useState(null),y=k.useRef(null);k.useEffect(()=>{function M(U){y.current&&!y.current.contains(U.target)&&v(null)}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[]);const w=u?"#DC2626":g?c==="purple"?"#7700CC":"#0685FF":"var(--medix-form-border)",A="none",B={flex:1,height:"100%",padding:"0 10px",background:"transparent",color:"var(--medix-form-text)",fontSize:"15px",fontFamily:"var(--font-body)",border:"none",outline:"none",cursor:h?"not-allowed":"pointer",colorScheme:"auto",width:"100%"},C=M=>{const U=M.getFullYear(),G=String(M.getMonth()+1).padStart(2,"0"),H=String(M.getDate()).padStart(2,"0");return`${U}-${G}-${H}`},O=M=>i&&M<i?i:s&&M>s?s:M,E=M=>{const U=O(C(M));g==="start"?(t==null||t(U),n&&n<U&&(r==null||r("")),v("end")):g==="end"&&(r==null||r(U),e&&e>U&&(t==null||t("")),v(null))},F=M=>{if(!M)return;const[U,G,H]=M.split("-").map(Number);if(!U||G<1||G>12||H<1||H>31)return;const b=new Date(U,G-1,H);if(!(b.getFullYear()!==U||b.getMonth()!==G-1||b.getDate()!==H))return b},R=F(g==="start"?e:n),D=F(e),N=F(n),P=D?D.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"",I=N?N.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"";return o.jsxs(f.Box,{w:"100%",position:"relative",zIndex:g?1e3:void 0,ref:y,children:[a&&o.jsx(f.Text,{mb:"1.5",fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:a}),o.jsxs(f.Box,{display:"flex",alignItems:"center",position:"relative",style:{width:"100%",height:"40px",borderRadius:"10px",border:`1.5px solid ${w}`,boxShadow:A,background:"var(--medix-form-bg)",transition:"border-color 0.15s, box-shadow 0.15s",opacity:h?.5:1,overflow:"hidden"},children:[o.jsx("input",{id:x,readOnly:!0,type:"text",value:P,placeholder:m,disabled:h,"aria-invalid":u,"aria-haspopup":"dialog","aria-expanded":g==="start",onClick:()=>!h&&v("start"),onKeyDown:M=>{h||(M.key==="Enter"||M.key===" "||M.key==="ArrowDown"?(M.preventDefault(),v("start")):M.key==="Escape"&&v(null))},style:{...B,textAlign:"center"}}),o.jsx(f.Box,{color:"text.muted",px:"1",fontSize:"sm",children:"—"}),o.jsx("input",{readOnly:!0,type:"text",value:I,placeholder:p,disabled:h,"aria-invalid":u,"aria-haspopup":"dialog","aria-expanded":g==="end",onClick:()=>!h&&v("end"),onKeyDown:M=>{h||(M.key==="Enter"||M.key===" "||M.key==="ArrowDown"?(M.preventDefault(),v("end")):M.key==="Escape"&&v(null))},style:{...B,textAlign:"center"}})]}),g&&o.jsx(f.Box,{position:"absolute",top:"calc(100% + 8px)",left:"0",zIndex:1e3,boxShadow:"none",borderRadius:"card",border:"1px solid",borderColor:"border",bg:"bg.surface",overflow:"hidden",children:o.jsx(cs,{value:R,onChange:E,minDate:g==="end"?D??F(i):F(i),maxDate:F(s),colorScheme:c})}),(l||d)&&o.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:u?"red.500":"text.muted",fontFamily:"var(--font-body)",children:u?d:l})]})}const Hp=o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("polyline",{points:"6 9 12 15 18 9"})});function Up({options:e,value:t,onChange:n,placeholder:r="Search...",label:i,helperText:s,errorMessage:a,colorScheme:l="blue",isInvalid:d=!1,isDisabled:c=!1}){const[u,h]=k.useState(!1),[m,p]=k.useState(""),x=k.useRef(null);k.useEffect(()=>{if(t){const w=e.find(A=>A.value===t);w&&p(w.label)}},[t,e]),k.useEffect(()=>{function w(A){if(x.current&&!x.current.contains(A.target))if(h(!1),t){const B=e.find(C=>C.value===t);B&&p(B.label)}else p("")}return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[t,e]);const g=e.filter(w=>w.label.toLowerCase().includes(m.toLowerCase())),y=d?"#DC2626":u?l==="purple"?"#7700CC":"#0685FF":"var(--medix-form-border)";return o.jsxs(f.Box,{w:"100%",position:"relative",zIndex:u?1e3:void 0,ref:x,children:[i&&o.jsx(f.Text,{mb:"1.5",fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:i}),o.jsxs(f.Box,{position:"relative",children:[o.jsx("input",{type:"text",value:m,placeholder:r,disabled:c,onChange:w=>{p(w.target.value),h(!0),w.target.value||n==null||n("")},onFocus:()=>h(!0),style:{width:"100%",height:"40px",padding:"0 40px 0 16px",borderRadius:"10px",border:`1.5px solid ${y}`,boxShadow:"none",background:"var(--medix-form-bg)",color:"var(--medix-form-text)",fontSize:"15px",fontFamily:"var(--font-body)",outline:"none",transition:"border-color 0.15s, box-shadow 0.15s",cursor:c?"not-allowed":"text",opacity:c?.5:1}}),o.jsx(f.Box,{position:"absolute",right:"3",top:"50%",transform:"translateY(-50%)",pointerEvents:"none",color:"text.muted",children:Hp})]}),u&&!c&&o.jsx(f.Box,{position:"absolute",zIndex:1e3,top:"100%",left:"0",right:"0",mt:"1",bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"md",boxShadow:"none",maxH:"200px",overflowY:"auto",py:"1",children:g.length>0?g.map(w=>o.jsx(f.Box,{px:"3",py:"2",fontSize:"sm",fontFamily:"var(--font-body)",color:"text.body",cursor:"pointer",_hover:{bg:"bg.subtle"},onClick:()=>{n==null||n(w.value),p(w.label),h(!1)},children:w.label},w.value)):o.jsx(f.Box,{px:"3",py:"2",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:"No options found"})}),(s||a)&&o.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:d?"red.500":"text.muted",fontFamily:"var(--font-body)",children:d?a:s})]})}const $p=o.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),o.jsx("polyline",{points:"17 8 12 3 7 8"}),o.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]});function Gp({accept:e,multiple:t=!1,maxSize:n,label:r,helperText:i,errorMessage:s,colorScheme:a="blue",isInvalid:l=!1,isDisabled:d=!1,onChange:c,dropzoneTitle:u="Click or drag to upload",id:h}){const[m,p]=k.useState(!1),[x,g]=k.useState([]),v=k.useRef(null),y=D=>{D.preventDefault(),d||p(!0)},j=D=>{D.preventDefault(),d||p(!0)},w=D=>{D.preventDefault(),p(!1)},[A,B]=k.useState(null),C=D=>{if(!D||D.length===0)return;const N=Array.from(D);B(null);const P=N.find(M=>n&&M.size>n);if(P&&n){const M=Math.round(n/1048576);B(`File "${P.name}" exceeds the maximum limit of ${M}MB.`)}const I=N.filter(M=>!(n&&M.size>n));I.length>0&&(g(I.map(M=>M.name)),c==null||c(I))},O=D=>{D.preventDefault(),p(!1),!d&&C(D.dataTransfer.files)},E=D=>{C(D.target.files),D.target.value=""},F=a==="purple"?"purple.500":"blue.500",L=l?"red.500":m?F:"border",R=m?"bg.subtle":"transparent";return o.jsxs(f.Box,{w:"100%",children:[r&&o.jsx(f.Text,{mb:"1.5",fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:r}),o.jsxs(f.Box,{position:"relative",border:"1.5px dashed",borderColor:L,borderRadius:"xl",bg:R,px:"6",py:"8",textAlign:"center",transition:"all 0.2s ease",opacity:d?.5:1,cursor:d?"not-allowed":"pointer",_hover:d?void 0:{borderColor:F,bg:"bg.subtle"},onDragEnter:y,onDragOver:j,onDragLeave:w,onDrop:O,onClick:()=>{var D;return!d&&((D=v.current)==null?void 0:D.click())},children:[o.jsx("input",{ref:v,id:h,type:"file",accept:e,multiple:t,disabled:d,style:{display:"none"},onChange:E}),o.jsx(f.Box,{color:"text.muted",display:"flex",justifyContent:"center",mb:"3",children:$p}),o.jsx(f.Text,{fontSize:"sm",fontWeight:"medium",color:m?"blue.500":"text.heading",fontFamily:"var(--font-body)",children:u}),o.jsxs(f.Text,{fontSize:"xs",color:"text.muted",mt:"1",fontFamily:"var(--font-body)",children:[e?`Accepts ${e}`:"All file types supported",n&&` up to ${Math.round(n/1024/1024)}MB`]}),x.length>0&&o.jsxs(f.Box,{mt:"4",pt:"3",borderTop:"1px solid",borderColor:"border",children:[o.jsxs(f.Text,{fontSize:"xs",fontWeight:"semibold",color:"text.heading",mb:"1",fontFamily:"var(--font-body)",children:["Selected file",x.length>1?"s":"",":"]}),x.map((D,N)=>o.jsx(f.Text,{fontSize:"xs",color:"text.muted",truncate:!0,fontFamily:"var(--font-body)",children:D},N))]})]}),(i||s||A)&&o.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:l||A?"red.500":"text.muted",fontFamily:"var(--font-body)",children:A||(l?s:i)})]})}const Ca={sm:{minH:"34px",py:"1",px:"2.5",fontSize:"13px",tagPy:"1px",tagPx:"2",tagFontSize:"12px"},md:{minH:"42px",py:"1.5",px:"3",fontSize:"14px",tagPy:"2px",tagPx:"2.5",tagFontSize:"12px"},lg:{minH:"48px",py:"2",px:"4",fontSize:"15px",tagPy:"3px",tagPx:"3",tagFontSize:"13px"}},ja={blue:{focusBorder:"#0685FF",tagBgLight:"#EBF5FF",tagBgDark:"rgba(6, 133, 255, 0.18)",tagTextLight:"#0062CC",tagTextDark:"#60A5FA",tagBorderLight:"rgba(6, 133, 255, 0.25)",tagBorderDark:"rgba(6, 133, 255, 0.35)"},purple:{focusBorder:"#7700CC",tagBgLight:"#F3E8FF",tagBgDark:"rgba(119, 0, 204, 0.18)",tagTextLight:"#5B0099",tagTextDark:"#C084FC",tagBorderLight:"rgba(119, 0, 204, 0.25)",tagBorderDark:"rgba(119, 0, 204, 0.35)"}};function bu({value:e=[],onChange:t,placeholder:n="Add tag...",label:r,helperText:i,errorMessage:s,isInvalid:a=!1,colorScheme:l="blue",size:d="md",isDisabled:c=!1,isReadOnly:u=!1,maxTags:h,allowDuplicates:m=!1,addOnBlur:p=!1,delimiter:x=",",id:g,name:v,style:y,className:j}){const w=k.useId(),A=g??w,[B,C]=k.useState(""),[O,E]=k.useState(!1),F=k.useRef(null),L=ja[l]??ja.blue,R=Ca[d]??Ca.md,D=U=>{if(c||u)return;const G=U.trim();if(G&&!(h!=null&&e.length>=h)){if(!m&&e.includes(G)){C("");return}t([...e,G]),C("")}},N=U=>{c||u||t(e.filter((G,H)=>H!==U))},P=U=>{U.key==="Enter"||x&&U.key===x?(U.preventDefault(),D(B)):U.key==="Backspace"&&!B&&e.length>0&&N(e.length-1)},I=()=>{E(!1),p&&B.trim()&&D(B)},M=a?"#DC2626":O?L.focusBorder:"var(--medix-form-border)";return o.jsxs(f.Box,{w:"100%",style:y,className:j,children:[r&&o.jsx("label",{htmlFor:A,style:{display:"block",marginBottom:"6px",fontSize:"14px",fontWeight:500,color:"var(--medix-form-text)",fontFamily:"var(--font-body)"},children:r}),o.jsxs(f.Box,{onClick:()=>{var U;return!c&&((U=F.current)==null?void 0:U.focus())},display:"flex",flexWrap:"wrap",alignItems:"center",gap:"1.5",minH:R.minH,py:R.py,px:R.px,borderRadius:"10px",bg:"bg.surface",cursor:c?"not-allowed":"text",opacity:c?.55:1,transition:"border-color 0.15s ease",style:{border:`1.5px solid ${M}`,boxShadow:"none",background:"var(--medix-form-bg)"},children:[e.map((U,G)=>o.jsxs(f.Box,{as:"span",display:"inline-flex",alignItems:"center",gap:"1",px:R.tagPx,py:R.tagPy,borderRadius:"full",fontSize:R.tagFontSize,fontWeight:"500",fontFamily:"var(--font-body)",lineHeight:"1.4",whiteSpace:"nowrap",bg:l==="purple"?"purple.50":"blue.50",color:l==="purple"?"purple.700":"blue.700",border:"1px solid",borderColor:l==="purple"?"purple.200":"blue.200",_dark:{bg:l==="purple"?"rgba(119, 0, 204, 0.2)":"rgba(6, 133, 255, 0.2)",color:l==="purple"?"purple.300":"blue.300",borderColor:l==="purple"?"rgba(119, 0, 204, 0.4)":"rgba(6, 133, 255, 0.4)"},children:[o.jsx("span",{children:U}),!c&&!u&&o.jsx("button",{type:"button",onClick:H=>{H.stopPropagation(),N(G)},"aria-label":`Remove ${U}`,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",padding:"0",marginLeft:"2px",cursor:"pointer",opacity:.7,color:"inherit",fontSize:"14px",lineHeight:1,transition:"opacity 0.1s ease"},onMouseEnter:H=>{H.currentTarget.style.opacity="1"},onMouseLeave:H=>{H.currentTarget.style.opacity="0.7"},children:"×"})]},`${U}-${G}`)),!c&&!u&&o.jsx("input",{ref:F,id:A,name:v,type:"text",value:B,onChange:U=>C(U.target.value),onKeyDown:P,onFocus:()=>E(!0),onBlur:I,placeholder:e.length===0?n:"",disabled:c,readOnly:u,style:{flex:1,minWidth:"120px",border:"none",outline:"none",background:"transparent",fontSize:R.fontSize,fontFamily:"var(--font-body)",color:"var(--medix-form-text)",padding:0}})]}),(i||s)&&o.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:a?"red.500":"text.muted",fontFamily:"var(--font-body)",children:a?s:i})]})}const Yp=bu;function jn(e){if(!e||typeof document>"u")return e||"";if(!/<[a-z][\s\S]*>/i.test(e))return e;const t=document.createElement("div");t.innerHTML=e;function n(r){if(r.nodeType===Node.TEXT_NODE)return r.textContent||"";if(r.nodeType!==Node.ELEMENT_NODE)return"";const i=r,s=i.tagName.toLowerCase(),a=Array.from(i.childNodes).map(n).join("");switch(s){case"h1":return`# ${a.trim()}
271
271
 
272
272
  `;case"h2":return`## ${a.trim()}
273
273
 
@@ -285,7 +285,7 @@
285
285
 
286
286
  `;case"li":return a;case"a":{const l=i.getAttribute("href")||"";return`[${a}](${l})`}case"br":return`
287
287
  `;default:return a}}return n(t).trim()}function Mt(e){if(!e)return"<p></p>";if(/<[a-z][\s\S]*>/i.test(e.trim()))return e;const t=e.split(`
288
- `),n=[];let r=!1,i=!1;const s=a=>a.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>').replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/__([^_]+)__/g,"<strong>$1</strong>").replace(/\*([^*]+)\*/g,"<em>$1</em>").replace(/_([^_]+)_/g,"<em>$1</em>").replace(/~~([^~]+)~~/g,"<s>$1</s>").replace(/<u>([^<]+)<\/u>/g,"<u>$1</u>");for(let a=0;a<t.length;a++){const l=t[a].trim();if(!l){r&&(n.push("</ul>"),r=!1),i&&(n.push("</ol>"),i=!1);continue}l.startsWith("# ")?(r&&(n.push("</ul>"),r=!1),i&&(n.push("</ol>"),i=!1),n.push(`<h1>${s(l.slice(2))}</h1>`)):l.startsWith("## ")?(r&&(n.push("</ul>"),r=!1),i&&(n.push("</ol>"),i=!1),n.push(`<h2>${s(l.slice(3))}</h2>`)):l.startsWith("### ")?(r&&(n.push("</ul>"),r=!1),i&&(n.push("</ol>"),i=!1),n.push(`<h3>${s(l.slice(4))}</h3>`)):l.startsWith("> ")?(r&&(n.push("</ul>"),r=!1),i&&(n.push("</ol>"),i=!1),n.push(`<blockquote>${s(l.slice(2))}</blockquote>`)):l.startsWith("- ")||l.startsWith("* ")?(i&&(n.push("</ol>"),i=!1),r||(n.push("<ul>"),r=!0),n.push(`<li>${s(l.slice(2))}</li>`)):/^\d+\.\s/.test(l)?(r&&(n.push("</ul>"),r=!1),i||(n.push("<ol>"),i=!0),n.push(`<li>${s(l.replace(/^\d+\.\s/,""))}</li>`)):(r&&(n.push("</ul>"),r=!1),i&&(n.push("</ol>"),i=!1),n.push(`<p>${s(l)}</p>`))}return r&&n.push("</ul>"),i&&n.push("</ol>"),n.join("")}const dn="medix_rte_draft_";function bu(e,t,n,r){if(e)return e;if(t)return`id_${t}`;if(n)return`name_${n}`;if(r){const i=r.toLowerCase().trim().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"");if(i)return`label_${i}`}return"default"}function vu(e){if(!(typeof window>"u"))try{const t=e.startsWith(dn)?e:`${dn}${e}`;window.localStorage.removeItem(t)}catch{}}function ku(e,t){if(typeof window>"u")return null;try{const n=e.startsWith(dn)?e:`${dn}${e}`,r=window.localStorage.getItem(n);if(!r)return null;const i=JSON.parse(r);return!i||typeof i.content!="string"?null:t&&t>0&&i.updatedAt&&Date.now()-i.updatedAt>t?(window.localStorage.removeItem(n),null):i}catch{return null}}function fo(e,t){if(!(typeof window>"u"))try{const n=e.startsWith(dn)?e:`${dn}${e}`;window.localStorage.setItem(n,JSON.stringify(t))}catch{}}const $p={blue:{base:"#0685FF",ring:"rgba(6, 133, 255, 0.18)",hover:"#057AE8"},purple:{base:"#7700CC",ring:"rgba(119, 0, 204, 0.18)",hover:"#6600B3"}};let ja=!1;function Gp(){if(ja||typeof document>"u")return;ja=!0;const e=document.createElement("style");e.id="medix-rte-styles",e.textContent=`
288
+ `),n=[];let r=!1,i=!1;const s=a=>a.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>').replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/__([^_]+)__/g,"<strong>$1</strong>").replace(/\*([^*]+)\*/g,"<em>$1</em>").replace(/_([^_]+)_/g,"<em>$1</em>").replace(/~~([^~]+)~~/g,"<s>$1</s>").replace(/<u>([^<]+)<\/u>/g,"<u>$1</u>");for(let a=0;a<t.length;a++){const l=t[a].trim();if(!l){r&&(n.push("</ul>"),r=!1),i&&(n.push("</ol>"),i=!1);continue}l.startsWith("# ")?(r&&(n.push("</ul>"),r=!1),i&&(n.push("</ol>"),i=!1),n.push(`<h1>${s(l.slice(2))}</h1>`)):l.startsWith("## ")?(r&&(n.push("</ul>"),r=!1),i&&(n.push("</ol>"),i=!1),n.push(`<h2>${s(l.slice(3))}</h2>`)):l.startsWith("### ")?(r&&(n.push("</ul>"),r=!1),i&&(n.push("</ol>"),i=!1),n.push(`<h3>${s(l.slice(4))}</h3>`)):l.startsWith("> ")?(r&&(n.push("</ul>"),r=!1),i&&(n.push("</ol>"),i=!1),n.push(`<blockquote>${s(l.slice(2))}</blockquote>`)):l.startsWith("- ")||l.startsWith("* ")?(i&&(n.push("</ol>"),i=!1),r||(n.push("<ul>"),r=!0),n.push(`<li>${s(l.slice(2))}</li>`)):/^\d+\.\s/.test(l)?(r&&(n.push("</ul>"),r=!1),i||(n.push("<ol>"),i=!0),n.push(`<li>${s(l.replace(/^\d+\.\s/,""))}</li>`)):(r&&(n.push("</ul>"),r=!1),i&&(n.push("</ol>"),i=!1),n.push(`<p>${s(l)}</p>`))}return r&&n.push("</ul>"),i&&n.push("</ol>"),n.join("")}const dn="medix_rte_draft_";function vu(e,t,n,r){if(e)return e;if(t)return`id_${t}`;if(n)return`name_${n}`;if(r){const i=r.toLowerCase().trim().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"");if(i)return`label_${i}`}return"default"}function ku(e){if(!(typeof window>"u"))try{const t=e.startsWith(dn)?e:`${dn}${e}`;window.localStorage.removeItem(t)}catch{}}function wu(e,t){if(typeof window>"u")return null;try{const n=e.startsWith(dn)?e:`${dn}${e}`,r=window.localStorage.getItem(n);if(!r)return null;const i=JSON.parse(r);return!i||typeof i.content!="string"?null:t&&t>0&&i.updatedAt&&Date.now()-i.updatedAt>t?(window.localStorage.removeItem(n),null):i}catch{return null}}function ho(e,t){if(!(typeof window>"u"))try{const n=e.startsWith(dn)?e:`${dn}${e}`;window.localStorage.setItem(n,JSON.stringify(t))}catch{}}const Kp={blue:{base:"#0685FF",ring:"rgba(6, 133, 255, 0.18)",hover:"#057AE8"},purple:{base:"#7700CC",ring:"rgba(119, 0, 204, 0.18)",hover:"#6600B3"}};let Ta=!1;function qp(){if(Ta||typeof document>"u")return;Ta=!0;const e=document.createElement("style");e.id="medix-rte-styles",e.textContent=`
289
289
  .medix-rte-content .tiptap {
290
290
  outline: none;
291
291
  padding: 12px 16px;
@@ -332,7 +332,7 @@
332
332
  .medix-rte-content .tiptap .text-center { text-align: center; }
333
333
  .medix-rte-content .tiptap .text-right { text-align: right; }
334
334
  .medix-rte-content .tiptap .text-justify { text-align: justify; }
335
- `,document.head.appendChild(e)}function Me({onClick:e,isActive:t,disabled:n,title:r,accentColor:i,children:s}){const[a,l]=k.useState(!1);return o.jsx("button",{type:"button",title:r,onMouseDown:d=>{d.preventDefault(),n||e()},onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),disabled:n,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",height:"28px",padding:"0 8px",borderRadius:"6px",border:"none",fontSize:"12px",fontWeight:600,fontFamily:"var(--font-body)",cursor:n?"not-allowed":"pointer",background:t?i:a?"var(--medix-form-bg-subtle, #F0F4F8)":"transparent",color:t?"#fff":"var(--medix-form-text)",opacity:n?.4:1,transition:"background 0.12s ease, color 0.12s ease",flexShrink:0},children:s})}function jr(){return o.jsx("div",{style:{width:"1px",height:"18px",background:"var(--medix-form-border)",flexShrink:0,alignSelf:"center",margin:"0 2px"}})}const Yp=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"})}),Kp=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"})}),qp=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z"})}),Xp=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"})}),Zp=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z"})}),Jp=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z"})}),Qp=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"})}),em=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"})}),tm=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M3.27 5L2 6.27l6.97 6.97L6.5 19h3l1.57-3.97L17.73 21 19 19.73 3.27 5zM6 5v.18L8.82 8h2.4l-.72 1.68 2.1 2.1L14.21 8H20V5H6z"})}),nm=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z"})}),rm=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z"})}),im=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z"})});function om({editor:e,accentColor:t,disabled:n}){if(!e)return null;const r=e.isActive("heading",{level:1})?"h1":e.isActive("heading",{level:2})?"h2":e.isActive("heading",{level:3})?"h3":"p",i=s=>{s.preventDefault();const a=s.target.value;if(a==="p")e.chain().focus().setParagraph().run();else{const l=parseInt(a.replace("h",""),10);e.chain().focus().toggleHeading({level:l}).run()}};return o.jsxs("select",{value:r,onChange:i,disabled:n,onMouseDown:s=>s.stopPropagation(),title:"Text style",style:{height:"28px",padding:"0 6px",borderRadius:"6px",border:"1px solid var(--medix-form-border)",background:"var(--medix-form-bg)",color:"var(--medix-form-text)",fontSize:"12px",fontFamily:"var(--font-body)",cursor:n?"not-allowed":"pointer",outline:"none",flexShrink:0},children:[o.jsx("option",{value:"p",children:"Paragraph"}),o.jsx("option",{value:"h1",children:"Heading 1"}),o.jsx("option",{value:"h2",children:"Heading 2"}),o.jsx("option",{value:"h3",children:"Heading 3"})]})}function sm({currentMode:e,onSelectMode:t,accentColor:n,disabled:r}){return o.jsxs(f.Box,{display:"inline-flex",alignItems:"center",p:"0.5",borderRadius:"md",bg:"bg.subtle",style:{background:"var(--medix-form-bg-subtle, #F0F4F8)",border:"1px solid var(--medix-form-border)"},ml:"auto",flexShrink:0,children:[o.jsx("button",{type:"button",disabled:r,onClick:()=>t("wysiwyg"),style:{padding:"2px 10px",fontSize:"11px",fontWeight:600,fontFamily:"var(--font-body)",borderRadius:"4px",border:"none",cursor:r?"not-allowed":"pointer",background:e==="wysiwyg"?n:"transparent",color:e==="wysiwyg"?"#ffffff":"var(--medix-form-text)",transition:"all 0.15s ease"},children:"Rich Text"}),o.jsx("button",{type:"button",disabled:r,onClick:()=>t("markdown"),style:{padding:"2px 10px",fontSize:"11px",fontWeight:600,fontFamily:"var(--font-body)",borderRadius:"4px",border:"none",cursor:r?"not-allowed":"pointer",background:e==="markdown"?n:"transparent",color:e==="markdown"?"#ffffff":"var(--medix-form-text)",transition:"all 0.15s ease"},children:"Markdown"})]})}function am({editor:e,accentColor:t,disabled:n,opts:r,mode:i,showModeToggle:s,onModeChange:a,onInsertMarkdown:l}){const d=()=>{if(!e)return;const c=e.getAttributes("link").href,u=window.prompt("Enter URL",c??"https://");if(u!==null){if(u===""){e.chain().focus().unsetLink().run();return}e.chain().focus().extendMarkRange("link").setLink({href:u,target:"_blank"}).run()}};return o.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"1",px:"2",py:"1.5",borderBottom:"1px solid",borderColor:"border",bg:"bg.surface",style:{background:"var(--medix-form-bg)",borderBottomColor:"var(--medix-form-border)"},children:[o.jsx(f.Box,{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"0.5",children:i==="wysiwyg"&&e?o.jsxs(o.Fragment,{children:[r.headings&&o.jsxs(o.Fragment,{children:[o.jsx(om,{editor:e,accentColor:t,disabled:n}),o.jsx(jr,{})]}),r.bold&&o.jsx(Me,{onClick:()=>e.chain().focus().toggleBold().run(),isActive:e.isActive("bold"),disabled:n,title:"Bold (Ctrl+B)",accentColor:t,children:o.jsx(Yp,{})}),r.italic&&o.jsx(Me,{onClick:()=>e.chain().focus().toggleItalic().run(),isActive:e.isActive("italic"),disabled:n,title:"Italic (Ctrl+I)",accentColor:t,children:o.jsx(Kp,{})}),r.underline&&o.jsx(Me,{onClick:()=>e.chain().focus().toggleUnderline().run(),isActive:e.isActive("underline"),disabled:n,title:"Underline (Ctrl+U)",accentColor:t,children:o.jsx(qp,{})}),r.strikethrough&&o.jsx(Me,{onClick:()=>e.chain().focus().toggleStrike().run(),isActive:e.isActive("strike"),disabled:n,title:"Strikethrough",accentColor:t,children:o.jsx(Xp,{})}),(r.bulletList||r.orderedList||r.quote)&&o.jsx(jr,{}),r.bulletList&&o.jsx(Me,{onClick:()=>e.chain().focus().toggleBulletList().run(),isActive:e.isActive("bulletList"),disabled:n,title:"Bullet List",accentColor:t,children:o.jsx(Zp,{})}),r.orderedList&&o.jsx(Me,{onClick:()=>e.chain().focus().toggleOrderedList().run(),isActive:e.isActive("orderedList"),disabled:n,title:"Ordered List",accentColor:t,children:o.jsx(Jp,{})}),r.quote&&o.jsx(Me,{onClick:()=>e.chain().focus().toggleBlockquote().run(),isActive:e.isActive("blockquote"),disabled:n,title:"Blockquote",accentColor:t,children:o.jsx(Qp,{})}),r.textAlign&&o.jsxs(o.Fragment,{children:[o.jsx(jr,{}),o.jsx(Me,{onClick:()=>e.chain().focus().setTextAlign("left").run(),isActive:e.isActive({textAlign:"left"}),disabled:n,title:"Align Left",accentColor:t,children:o.jsx(nm,{})}),o.jsx(Me,{onClick:()=>e.chain().focus().setTextAlign("center").run(),isActive:e.isActive({textAlign:"center"}),disabled:n,title:"Align Center",accentColor:t,children:o.jsx(rm,{})}),o.jsx(Me,{onClick:()=>e.chain().focus().setTextAlign("right").run(),isActive:e.isActive({textAlign:"right"}),disabled:n,title:"Align Right",accentColor:t,children:o.jsx(im,{})})]}),(r.link||r.clearFormat)&&o.jsx(jr,{}),r.link&&o.jsx(Me,{onClick:d,isActive:e.isActive("link"),disabled:n,title:"Insert / Edit Link",accentColor:t,children:o.jsx(em,{})}),r.clearFormat&&o.jsx(Me,{onClick:()=>e.chain().focus().unsetAllMarks().clearNodes().run(),disabled:n,title:"Clear Formatting",accentColor:t,children:o.jsx(tm,{})})]}):o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1",children:[o.jsx(Me,{onClick:()=>l==null?void 0:l("**bold text**"),disabled:n,title:"Markdown Bold",accentColor:t,children:"**B**"}),o.jsx(Me,{onClick:()=>l==null?void 0:l("*italic text*"),disabled:n,title:"Markdown Italic",accentColor:t,children:"*I*"}),o.jsx(Me,{onClick:()=>l==null?void 0:l(`
335
+ `,document.head.appendChild(e)}function Me({onClick:e,isActive:t,disabled:n,title:r,accentColor:i,children:s}){const[a,l]=k.useState(!1);return o.jsx("button",{type:"button",title:r,onMouseDown:d=>{d.preventDefault(),n||e()},onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),disabled:n,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",height:"28px",padding:"0 8px",borderRadius:"6px",border:"none",fontSize:"12px",fontWeight:600,fontFamily:"var(--font-body)",cursor:n?"not-allowed":"pointer",background:t?i:a?"var(--medix-form-bg-subtle, #F0F4F8)":"transparent",color:t?"#fff":"var(--medix-form-text)",opacity:n?.4:1,transition:"background 0.12s ease, color 0.12s ease",flexShrink:0},children:s})}function jr(){return o.jsx("div",{style:{width:"1px",height:"18px",background:"var(--medix-form-border)",flexShrink:0,alignSelf:"center",margin:"0 2px"}})}const Xp=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z"})}),Zp=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"})}),Jp=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z"})}),Qp=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"})}),em=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z"})}),tm=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z"})}),nm=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"})}),rm=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"})}),im=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M3.27 5L2 6.27l6.97 6.97L6.5 19h3l1.57-3.97L17.73 21 19 19.73 3.27 5zM6 5v.18L8.82 8h2.4l-.72 1.68 2.1 2.1L14.21 8H20V5H6z"})}),om=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z"})}),sm=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z"})}),am=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z"})});function lm({editor:e,accentColor:t,disabled:n}){if(!e)return null;const r=e.isActive("heading",{level:1})?"h1":e.isActive("heading",{level:2})?"h2":e.isActive("heading",{level:3})?"h3":"p",i=s=>{s.preventDefault();const a=s.target.value;if(a==="p")e.chain().focus().setParagraph().run();else{const l=parseInt(a.replace("h",""),10);e.chain().focus().toggleHeading({level:l}).run()}};return o.jsxs("select",{value:r,onChange:i,disabled:n,onMouseDown:s=>s.stopPropagation(),title:"Text style",style:{height:"28px",padding:"0 6px",borderRadius:"6px",border:"1px solid var(--medix-form-border)",background:"var(--medix-form-bg)",color:"var(--medix-form-text)",fontSize:"12px",fontFamily:"var(--font-body)",cursor:n?"not-allowed":"pointer",outline:"none",flexShrink:0},children:[o.jsx("option",{value:"p",children:"Paragraph"}),o.jsx("option",{value:"h1",children:"Heading 1"}),o.jsx("option",{value:"h2",children:"Heading 2"}),o.jsx("option",{value:"h3",children:"Heading 3"})]})}function cm({currentMode:e,onSelectMode:t,accentColor:n,disabled:r}){return o.jsxs(f.Box,{display:"inline-flex",alignItems:"center",p:"0.5",borderRadius:"md",bg:"bg.subtle",style:{background:"var(--medix-form-bg-subtle, #F0F4F8)",border:"1px solid var(--medix-form-border)"},ml:"auto",flexShrink:0,children:[o.jsx("button",{type:"button",disabled:r,onClick:()=>t("wysiwyg"),style:{padding:"2px 10px",fontSize:"11px",fontWeight:600,fontFamily:"var(--font-body)",borderRadius:"4px",border:"none",cursor:r?"not-allowed":"pointer",background:e==="wysiwyg"?n:"transparent",color:e==="wysiwyg"?"#ffffff":"var(--medix-form-text)",transition:"all 0.15s ease"},children:"Rich Text"}),o.jsx("button",{type:"button",disabled:r,onClick:()=>t("markdown"),style:{padding:"2px 10px",fontSize:"11px",fontWeight:600,fontFamily:"var(--font-body)",borderRadius:"4px",border:"none",cursor:r?"not-allowed":"pointer",background:e==="markdown"?n:"transparent",color:e==="markdown"?"#ffffff":"var(--medix-form-text)",transition:"all 0.15s ease"},children:"Markdown"})]})}function um({editor:e,accentColor:t,disabled:n,opts:r,mode:i,showModeToggle:s,onModeChange:a,onInsertMarkdown:l}){const d=()=>{if(!e)return;const c=e.getAttributes("link").href,u=window.prompt("Enter URL",c??"https://");if(u!==null){if(u===""){e.chain().focus().unsetLink().run();return}e.chain().focus().extendMarkRange("link").setLink({href:u,target:"_blank"}).run()}};return o.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"1",px:"2",py:"1.5",borderBottom:"1px solid",borderColor:"border",bg:"bg.surface",style:{background:"var(--medix-form-bg)",borderBottomColor:"var(--medix-form-border)"},children:[o.jsx(f.Box,{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"0.5",children:i==="wysiwyg"&&e?o.jsxs(o.Fragment,{children:[r.headings&&o.jsxs(o.Fragment,{children:[o.jsx(lm,{editor:e,accentColor:t,disabled:n}),o.jsx(jr,{})]}),r.bold&&o.jsx(Me,{onClick:()=>e.chain().focus().toggleBold().run(),isActive:e.isActive("bold"),disabled:n,title:"Bold (Ctrl+B)",accentColor:t,children:o.jsx(Xp,{})}),r.italic&&o.jsx(Me,{onClick:()=>e.chain().focus().toggleItalic().run(),isActive:e.isActive("italic"),disabled:n,title:"Italic (Ctrl+I)",accentColor:t,children:o.jsx(Zp,{})}),r.underline&&o.jsx(Me,{onClick:()=>e.chain().focus().toggleUnderline().run(),isActive:e.isActive("underline"),disabled:n,title:"Underline (Ctrl+U)",accentColor:t,children:o.jsx(Jp,{})}),r.strikethrough&&o.jsx(Me,{onClick:()=>e.chain().focus().toggleStrike().run(),isActive:e.isActive("strike"),disabled:n,title:"Strikethrough",accentColor:t,children:o.jsx(Qp,{})}),(r.bulletList||r.orderedList||r.quote)&&o.jsx(jr,{}),r.bulletList&&o.jsx(Me,{onClick:()=>e.chain().focus().toggleBulletList().run(),isActive:e.isActive("bulletList"),disabled:n,title:"Bullet List",accentColor:t,children:o.jsx(em,{})}),r.orderedList&&o.jsx(Me,{onClick:()=>e.chain().focus().toggleOrderedList().run(),isActive:e.isActive("orderedList"),disabled:n,title:"Ordered List",accentColor:t,children:o.jsx(tm,{})}),r.quote&&o.jsx(Me,{onClick:()=>e.chain().focus().toggleBlockquote().run(),isActive:e.isActive("blockquote"),disabled:n,title:"Blockquote",accentColor:t,children:o.jsx(nm,{})}),r.textAlign&&o.jsxs(o.Fragment,{children:[o.jsx(jr,{}),o.jsx(Me,{onClick:()=>e.chain().focus().setTextAlign("left").run(),isActive:e.isActive({textAlign:"left"}),disabled:n,title:"Align Left",accentColor:t,children:o.jsx(om,{})}),o.jsx(Me,{onClick:()=>e.chain().focus().setTextAlign("center").run(),isActive:e.isActive({textAlign:"center"}),disabled:n,title:"Align Center",accentColor:t,children:o.jsx(sm,{})}),o.jsx(Me,{onClick:()=>e.chain().focus().setTextAlign("right").run(),isActive:e.isActive({textAlign:"right"}),disabled:n,title:"Align Right",accentColor:t,children:o.jsx(am,{})})]}),(r.link||r.clearFormat)&&o.jsx(jr,{}),r.link&&o.jsx(Me,{onClick:d,isActive:e.isActive("link"),disabled:n,title:"Insert / Edit Link",accentColor:t,children:o.jsx(rm,{})}),r.clearFormat&&o.jsx(Me,{onClick:()=>e.chain().focus().unsetAllMarks().clearNodes().run(),disabled:n,title:"Clear Formatting",accentColor:t,children:o.jsx(im,{})})]}):o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1",children:[o.jsx(Me,{onClick:()=>l==null?void 0:l("**bold text**"),disabled:n,title:"Markdown Bold",accentColor:t,children:"**B**"}),o.jsx(Me,{onClick:()=>l==null?void 0:l("*italic text*"),disabled:n,title:"Markdown Italic",accentColor:t,children:"*I*"}),o.jsx(Me,{onClick:()=>l==null?void 0:l(`
336
336
  # Heading 1
337
337
  `),disabled:n,title:"Markdown H1",accentColor:t,children:"# H1"}),o.jsx(Me,{onClick:()=>l==null?void 0:l(`
338
338
  ## Heading 2
@@ -340,7 +340,7 @@
340
340
  - List item
341
341
  `),disabled:n,title:"Markdown Bullet List",accentColor:t,children:"- List"}),o.jsx(Me,{onClick:()=>l==null?void 0:l("[link text](https://example.com)"),disabled:n,title:"Markdown Link",accentColor:t,children:"[Link]"}),o.jsx(Me,{onClick:()=>l==null?void 0:l(`
342
342
  > Blockquote
343
- `),disabled:n,title:"Markdown Blockquote",accentColor:t,children:"> Quote"})]})}),s&&o.jsx(sm,{currentMode:i,onSelectMode:a,accentColor:t,disabled:n})]})}const lm={bold:!0,italic:!0,underline:!0,strikethrough:!0,headings:!0,bulletList:!0,orderedList:!0,quote:!0,link:!0,textAlign:!0,clearFormat:!0};function cs({id:e,name:t,value:n,defaultValue:r,onChange:i,onMarkdownChange:s,onHtmlChange:a,outputFormat:l="html",defaultMode:d="wysiwyg",mode:c,onModeChange:u,showModeToggle:h=!0,placeholder:m="Start typing...",label:p,helperText:x,errorMessage:g,isInvalid:v=!1,disabled:y=!1,colorScheme:j="blue",minHeight:w="180px",maxHeight:A="400px",maxLength:B,showCharCount:C=!1,toolbarOptions:O,className:E,storageKey:F,persistDraft:L=!0,debounceMs:R=400,draftMaxAgeMs:D=10080*60*1e3,showDraftStatus:N=!1,onDraftRestored:P}){const[I,M]=k.useState(!1),[U,G]=k.useState(d),H=c!==void 0?c:U,b=n!==void 0,W=$p[j],ne={...lm,...O},T=k.useMemo(()=>bu(F,e,t,p),[F,e,t,p]),[be,ke]=k.useState("idle"),J=k.useRef(null),X=k.useRef(null),te=k.useRef(!1),de=k.useCallback((Q,se,he)=>{if(!L||y)return;if(!Q||Q==="<p></p>"||Q.trim()===""){X.current&&(clearTimeout(X.current),X.current=null),J.current=null,vu(T),ke("idle");return}J.current={content:Q,mode:se,format:he},ke("saving"),X.current&&clearTimeout(X.current),X.current=setTimeout(()=>{J.current&&(fo(T,{content:J.current.content,mode:J.current.mode,format:J.current.format,updatedAt:Date.now(),version:1}),J.current=null,ke("saved"))},R)},[L,y,T,R]);k.useEffect(()=>{if(!L)return;const Q=()=>{X.current&&(clearTimeout(X.current),X.current=null),J.current&&(fo(T,{content:J.current.content,mode:J.current.mode,format:J.current.format,updatedAt:Date.now(),version:1}),J.current=null,ke("saved"))};return typeof window<"u"&&(window.addEventListener("beforeunload",Q),window.addEventListener("pagehide",Q)),()=>{typeof window<"u"&&(window.removeEventListener("beforeunload",Q),window.removeEventListener("pagehide",Q)),Q()}},[L,T]);const[ee,Ce]=k.useState(()=>{const Q=b?n:r??"";return l==="markdown"?Q:jn(Q)}),De=k.useRef(null);k.useEffect(()=>{Gp()},[]);const ue=ha.useEditor({extensions:[jh.configure({heading:{levels:[1,2,3]}}),Bh,Th.configure({openOnClick:!1,HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}}),Eh.configure({types:["heading","paragraph"]}),Fh.configure({placeholder:m})],content:b?l==="markdown"?Mt(n??""):n??"":r?l==="markdown"?Mt(r):r:"",editable:!y,editorProps:{attributes:{spellcheck:"true"}},onUpdate({editor:Q}){const se=Q.getHTML(),he=se==="<p></p>"?"":se,Se=jn(he);a==null||a(he),s==null||s(Se);const Oe=l==="markdown"?Se:he;B!==void 0&&Q.getText().length>B||(i==null||i(Oe),de(Oe,"wysiwyg",l))},onFocus(){M(!0)},onBlur(){M(!1)}});k.useEffect(()=>{if(!ue||te.current||!L||y)return;te.current=!0;const Q=ku(T,D);if(!Q||!Q.content||Q.content==="<p></p>"||Q.content.trim()===""||b&&n&&n.trim()!==""&&n!=="<p></p>"&&n===Q.content)return;const se=Q.format==="markdown",he=Q.content;if(se){const Se=Mt(he);Ce(he),ue.commands.setContent(Se,{emitUpdate:!1}),s==null||s(he),a==null||a(Se),i==null||i(l==="markdown"?he:Se)}else{const Se=he==="<p></p>"?"":he,Oe=jn(Se);Ce(Oe),ue.commands.setContent(Se,{emitUpdate:!1}),a==null||a(Se),s==null||s(Oe),i==null||i(l==="markdown"?Oe:Se)}Q.mode&&Q.mode!==H&&h&&(c===void 0&&G(Q.mode),u==null||u(Q.mode)),ke("saved"),P==null||P(Q)},[ue,L,y,T,D,b,n,l,H,h,c,i,a,s,u,P]);const hn=Q=>{if(Q!==H){if(Q==="markdown"){const se=ue?ue.getHTML():"",he=jn(se==="<p></p>"?"":se);Ce(he),L&&de(l==="markdown"?he:se,"markdown",l)}else{const se=Mt(ee);ue&&ue.commands.setContent(se,{emitUpdate:!1}),L&&de(l==="markdown"?ee:se,"wysiwyg",l)}c===void 0&&G(Q),u==null||u(Q)}},Ot=Q=>{const se=Q.target.value;Ce(se);const he=Mt(se);s==null||s(se),a==null||a(he);const Se=l==="markdown"?se:he;B!==void 0&&se.length>B||(i==null||i(Se),ue&&ue.commands.setContent(he,{emitUpdate:!1}),de(Se,"markdown",l))},qt=Q=>{const se=De.current;if(!se){Ce(Y=>{const re=Y+Q;return de(l==="markdown"?re:Mt(re),"markdown",l),re});return}const he=se.selectionStart,Se=se.selectionEnd,Oe=se.value,pt=Oe.substring(0,he)+Q+Oe.substring(Se);Ce(pt);const vt=Mt(pt);s==null||s(pt),a==null||a(vt);const z=l==="markdown"?pt:vt;i==null||i(z),ue&&ue.commands.setContent(vt,{emitUpdate:!1}),de(z,"markdown",l),setTimeout(()=>{se.focus(),se.setSelectionRange(he+Q.length,he+Q.length)},50)};k.useEffect(()=>{if(b)if(l==="markdown"){const Q=n??"";if(Ce(Q),ue){const se=Mt(Q);ue.getHTML()!==se&&ue.commands.setContent(se,{emitUpdate:!1})}}else{const Q=n===""?"<p></p>":n??"<p></p>";ue&&ue.getHTML()!==Q&&ue.commands.setContent(Q,{emitUpdate:!1}),Ce(jn(n??""))}},[ue,b,n,l]);const zt=H==="markdown"?ee.length:(ue==null?void 0:ue.getText().length)??0,lt=v?"#DC2626":I?W.base:"var(--medix-form-border)";return o.jsxs(f.Box,{w:"100%",className:E,children:[p&&o.jsx(f.Text,{mb:"1.5",fontSize:"sm",fontWeight:"500",fontFamily:"var(--font-body)",color:"text.heading",children:p}),o.jsxs(f.Box,{borderRadius:"md",overflow:"hidden",bg:"bg.surface",opacity:y?.6:1,style:{border:`1.5px solid ${lt}`,transition:"border-color 0.15s ease",boxShadow:"none",background:"var(--medix-form-bg)"},children:[o.jsx(am,{editor:ue,accentColor:W.base,disabled:y,opts:ne,mode:H,showModeToggle:h,onModeChange:hn,onInsertMarkdown:qt}),H==="wysiwyg"?o.jsx(f.Box,{className:"medix-rte-content",style:{minHeight:w,maxHeight:A,overflowY:"auto"},_dark:{color:"var(--medix-form-text)"},children:o.jsx(ha.EditorContent,{editor:ue})}):o.jsx("textarea",{ref:De,value:ee,onChange:Ot,placeholder:m,disabled:y,onFocus:()=>M(!0),onBlur:()=>M(!1),style:{width:"100%",minHeight:w,maxHeight:A,padding:"12px 16px",fontFamily:"var(--font-mono, monospace)",fontSize:"13px",lineHeight:"1.6",background:"var(--medix-form-bg)",color:"var(--medix-form-text)",border:"none",outline:"none",resize:"vertical"}}),(C||B||N&&be!=="idle")&&o.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:N&&be!=="idle"?"space-between":B?"flex-end":"flex-start",px:"3",py:"1.5",borderTop:"1px solid",borderColor:"border",style:{borderTopColor:"var(--medix-form-border)",background:"var(--medix-form-bg)"},children:[N&&be!=="idle"?o.jsxs(f.Box,{display:"inline-flex",alignItems:"center",gap:"1.5",children:[o.jsx(f.Box,{w:"1.5",h:"1.5",borderRadius:"full",bg:be==="saving"?"orange.400":"green.500"}),o.jsx(f.Text,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:be==="saving"?"Saving draft...":"Draft saved"})]}):o.jsx(f.Box,{}),(C||B)&&o.jsxs(f.Text,{fontSize:"xs",color:B&&zt>B?"red.500":"text.muted",fontFamily:"var(--font-body)",children:[zt,B?` / ${B}`:""," characters"]})]})]}),x&&!v&&o.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:x}),v&&g&&o.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:"red.500",fontFamily:"var(--font-body)",children:g})]})}const cm=cs;cs.displayName="MedixRichTextInput";const wu=k.forwardRef(({noPadding:e=!1,hoverable:t=!1,children:n,...r},i)=>o.jsx(f.Box,{ref:i,bg:"bg.surface",borderRadius:"card",border:"1px solid",borderColor:"border",boxShadow:"none",_dark:{boxShadow:"none"},overflow:"hidden",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",...t&&{_hover:{transform:"translateY(-2px)",boxShadow:"none",borderColor:"blue.200"},cursor:"pointer"},...r,children:k.Children.map(n,s=>s||null)}));wu.displayName="MedixCard";function um({title:e,subtitle:t,action:n,children:r,...i}){return o.jsxs(f.Box,{px:"6",py:"4",borderBottom:"1px solid",borderColor:"border",display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"4",...i,children:[o.jsxs(f.Box,{flex:"1",children:[e&&o.jsx(f.Box,{as:"h3",fontSize:"lg",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",lineHeight:"1.3",children:e}),t&&o.jsx(f.Box,{as:"p",mt:"0.5",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:t}),r]}),n&&o.jsx(f.Box,{flexShrink:0,children:n})]})}function dm({children:e,...t}){return o.jsx(f.Box,{px:"6",py:"5",...t,children:e})}function fm({children:e,...t}){return o.jsx(f.Box,{px:"6",py:"4",borderTop:"1px solid",borderColor:"border",display:"flex",alignItems:"center",gap:"3",...t,children:e})}const Su=k.forwardRef(({value:e,label:t,unit:n,change:r,trend:i,icon:s,accentColor:a="blue.500",...l},d)=>{const c=i??(r!==void 0?r>=0?"up":"down":"neutral"),u=c==="up"?"green.500":c==="down"?"red.500":"text.muted";return o.jsxs(f.Box,{ref:d,bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",p:"6",boxShadow:"none",_dark:{boxShadow:"none"},...l,children:[s&&o.jsx(f.Box,{w:"10",h:"10",borderRadius:"md",bg:`${a.split(".")[0]}.100`,color:a,display:"flex",alignItems:"center",justifyContent:"center",mb:"3",fontSize:"xl",children:s}),o.jsxs(f.Box,{fontSize:"4xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",lineHeight:"1.1",children:[e,n&&o.jsx(f.Box,{as:"span",fontSize:"xl",fontWeight:"medium",color:"text.muted",ml:"1",children:n})]}),o.jsx(f.Box,{mt:"1",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:t}),r!==void 0&&o.jsxs(f.Box,{mt:"2",display:"inline-flex",alignItems:"center",gap:"1",fontSize:"xs",fontWeight:"medium",color:u,children:[o.jsx(f.Box,{as:"span",children:c==="up"?"↑":c==="down"?"↓":"→"}),o.jsxs(f.Box,{as:"span",children:[Math.abs(r),"%"]})]})]})});Su.displayName="MedixStatCard";const hm={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1440px",full:"100%"},Cu=k.forwardRef(({maxWidth:e="xl",children:t,...n},r)=>o.jsx(f.Box,{ref:r,w:"100%",maxW:hm[e],mx:"auto",px:{base:"4",md:"6",lg:"8"},...n,children:t}));Cu.displayName="MedixContainer";function pm({eyebrow:e,title:t,description:n,align:r="center",action:i,eyebrowColor:s="blue.500",...a}){const l=r,d=r==="center"?"center":r==="right"?"flex-end":"flex-start";return o.jsxs(f.Box,{display:"flex",flexDirection:"column",alignItems:d,textAlign:l,gap:"3",...a,children:[e&&o.jsx(f.Box,{as:"span",fontSize:"md",fontWeight:"bold",color:s,letterSpacing:"wider",textTransform:"uppercase",fontFamily:"var(--font-body)",children:e}),o.jsx(f.Box,{as:"h2",fontSize:{base:"3xl",md:"4xl"},fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",lineHeight:"snug",maxW:r==="center"?"720px":void 0,children:t}),n&&o.jsx(f.Box,{as:"p",fontSize:"md",color:"text.body",fontFamily:"var(--font-body)",lineHeight:"loose",maxW:r==="center"?"640px":void 0,children:n}),i&&o.jsx(f.Box,{mt:"2",children:i})]})}const mm=["light","dark"],xm={light:{label:"Light mode",canvas:V.neutralLight.bg.value,surface:V.neutralLight.surface.value,border:V.neutralLight.border.value,text:V.neutralLight.heading.value,muted:V.neutralLight.body.value},dark:{label:"Dark mode",canvas:V.neutralDark.bg.value,surface:V.neutralDark.surface.value,border:V.neutralDark.border.value,text:V.neutralDark.heading.value,muted:V.neutralDark.body.value}};function Jt(e,t){return Object.entries(t).map(([n,r])=>({token:`${e}.${n}`,value:r.value}))}const gm=[{title:"Foundation semantics",description:"Core app backgrounds, text, borders, and brand tokens that shift with light and dark mode.",tokens:[{token:"bg",description:"Page background",preview:"fill",light:V.neutralLight.bg.value,dark:V.neutralDark.bg.value},{token:"bg.subtle",description:"Subtle background",preview:"fill",light:V.neutralLight.bg2.value,dark:V.neutralDark.bg2.value},{token:"bg.surface",description:"Surface and card background",preview:"fill",light:V.neutralLight.surface.value,dark:V.neutralDark.surface.value},{token:"text.heading",description:"Primary heading text",preview:"text",light:V.neutralLight.heading.value,dark:V.neutralDark.heading.value},{token:"text.body",description:"Default body text",preview:"text",light:V.neutralLight.body.value,dark:V.neutralDark.body.value},{token:"text.muted",description:"Muted helper text",preview:"text",light:V.neutralLight.muted.value,dark:V.neutralDark.muted.value},{token:"border",description:"Default border color",preview:"border",light:V.neutralLight.border.value,dark:V.neutralDark.border.value},{token:"brand.solid",description:"Primary accent fill",preview:"fill",light:V.blue[500].value,dark:V.blue[500].value},{token:"brand.muted",description:"Muted brand accent",preview:"fill",light:V.blue[100].value,dark:V.blue[900].value},{token:"brand.contrast",description:"High-contrast brand foreground",preview:"fill",light:"#FFFFFF",dark:"#FFFFFF"}]},{title:"Status semantics",description:"System feedback colors used for success, warning, and error states.",tokens:[{token:"status.success",description:"Success foreground",preview:"fill",light:V.green[500].value,dark:V.green[500].value},{token:"status.success.tint",description:"Success tint background",preview:"fill",light:V.green[100].value,dark:"rgba(27, 122, 56, 0.2)"},{token:"status.warning",description:"Warning foreground",preview:"fill",light:V.amber[500].value,dark:V.amber[500].value},{token:"status.warning.tint",description:"Warning tint background",preview:"fill",light:V.amber[100].value,dark:"rgba(217, 119, 6, 0.2)"},{token:"status.error",description:"Error foreground",preview:"fill",light:V.red[500].value,dark:V.red[500].value},{token:"status.error.tint",description:"Error tint background",preview:"fill",light:V.red[100].value,dark:"rgba(220, 38, 38, 0.2)"}]},{title:"Blue semantic palette",description:"Semantic blue scale and utility tokens used by Chakra-aware theme props.",tokens:[{token:"blue.50",description:"Blue scale 50",preview:"fill",light:V.blue[50].value,dark:V.blue[50].value},{token:"blue.100",description:"Blue scale 100",preview:"fill",light:V.blue[100].value,dark:V.blue[100].value},{token:"blue.200",description:"Blue scale 200",preview:"fill",light:V.blue[200].value,dark:V.blue[200].value},{token:"blue.300",description:"Blue scale 300",preview:"fill",light:V.blue[300].value,dark:V.blue[300].value},{token:"blue.400",description:"Blue scale 400",preview:"fill",light:V.blue[400].value,dark:V.blue[400].value},{token:"blue.500",description:"Blue scale 500",preview:"fill",light:V.blue[500].value,dark:V.blue[500].value},{token:"blue.600",description:"Blue scale 600",preview:"fill",light:V.blue[600].value,dark:V.blue[600].value},{token:"blue.700",description:"Blue scale 700",preview:"fill",light:V.blue[700].value,dark:V.blue[700].value},{token:"blue.800",description:"Blue scale 800",preview:"fill",light:V.blue[800].value,dark:V.blue[800].value},{token:"blue.900",description:"Blue scale 900",preview:"fill",light:V.blue[900].value,dark:V.blue[900].value},{token:"blue.solid",description:"Default solid blue accent",preview:"fill",light:V.blue[500].value,dark:V.blue[500].value},{token:"blue.contrast",description:"High-contrast content on blue",preview:"fill",light:"#FFFFFF",dark:"#FFFFFF"},{token:"blue.muted",description:"Muted blue background",preview:"fill",light:V.blue[100].value,dark:V.blue[900].value},{token:"blue.subtle",description:"Subtle blue background",preview:"fill",light:V.blue[50].value,dark:"rgba(6, 133, 255, 0.1)"},{token:"blue.emphasized",description:"Emphasized blue background",preview:"fill",light:V.blue[100].value,dark:V.blue[800].value},{token:"blue.fg",description:"Readable blue foreground",preview:"text",light:V.blue[700].value,dark:V.blue[300].value},{token:"blue.focusRing",description:"Blue focus ring",preview:"border",light:V.blue[500].value,dark:V.blue[500].value}]},{title:"Purple semantic palette",description:"Semantic purple scale and utility tokens used by Chakra-aware theme props.",tokens:[{token:"purple.50",description:"Purple scale 50",preview:"fill",light:V.purple[50].value,dark:V.purple[50].value},{token:"purple.100",description:"Purple scale 100",preview:"fill",light:V.purple[100].value,dark:V.purple[100].value},{token:"purple.500",description:"Purple scale 500",preview:"fill",light:V.purple[500].value,dark:V.purple[500].value},{token:"purple.600",description:"Purple scale 600",preview:"fill",light:V.purple[600].value,dark:V.purple[600].value},{token:"purple.solid",description:"Default solid purple accent",preview:"fill",light:V.purple[500].value,dark:V.purple[500].value},{token:"purple.contrast",description:"High-contrast content on purple",preview:"fill",light:"#FFFFFF",dark:"#FFFFFF"},{token:"purple.muted",description:"Muted purple background",preview:"fill",light:V.purple[100].value,dark:V.purple[900].value},{token:"purple.subtle",description:"Subtle purple background",preview:"fill",light:V.purple[50].value,dark:"rgba(119, 0, 204, 0.1)"},{token:"purple.emphasized",description:"Emphasized purple background",preview:"fill",light:V.purple[100].value,dark:V.purple[100].value},{token:"purple.fg",description:"Readable purple foreground",preview:"text",light:V.purple[700].value,dark:V.purple[300].value},{token:"purple.focusRing",description:"Purple focus ring",preview:"border",light:V.purple[500].value,dark:V.purple[500].value}]}],ym=[{title:"Brand blue tokens",description:"Raw MedixDeck primary blue scale.",tokens:Jt("brand.blue",V.blue)},{title:"Brand purple tokens",description:"Raw MedixDeck secondary purple scale.",tokens:Jt("brand.purple",V.purple)},{title:"Status green tokens",description:"Raw success scale tokens.",tokens:Jt("brand.green",V.green)},{title:"Status amber tokens",description:"Raw warning scale tokens.",tokens:Jt("brand.amber",V.amber)},{title:"Status red tokens",description:"Raw error scale tokens.",tokens:Jt("brand.red",V.red)},{title:"Neutral light tokens",description:"Raw light-mode neutrals.",tokens:Jt("brand.neutralLight",V.neutralLight)},{title:"Neutral dark tokens",description:"Raw dark-mode neutrals.",tokens:Jt("brand.neutralDark",V.neutralDark)}];function bm({mode:e,token:t}){const n=xm[e],r=e==="light"?t.light:t.dark,i={minH:"88px",borderRadius:"md",border:"1px solid",borderColor:n.border,bg:n.canvas,display:"flex",alignItems:"center",justifyContent:"center",px:"4"};return o.jsxs(f.Box,{border:"1px solid",borderColor:n.border,borderRadius:"lg",bg:n.surface,p:"3",children:[o.jsx(f.Text,{fontSize:"xs",fontWeight:"600",color:n.text,fontFamily:"var(--font-heading)",mb:"2",children:n.label}),t.preview==="text"?o.jsx(f.Box,{...i,children:o.jsx(f.Text,{color:r,fontSize:"sm",fontWeight:"600",fontFamily:"var(--font-heading)",children:"Aa MedixDeck"})}):t.preview==="border"?o.jsx(f.Box,{...i,children:o.jsx(f.Box,{w:"100%",maxW:"140px",h:"48px",borderRadius:"md",border:"2px solid",borderColor:r,bg:n.canvas})}):o.jsx(f.Box,{...i,bg:r,borderColor:r===n.canvas||r==="#FFFFFF"?n.border:"transparent"}),o.jsx(f.Text,{mt:"2",fontSize:"xs",color:n.muted,fontFamily:"var(--font-mono)",children:r})]})}const ju=k.forwardRef(({showSemanticTokens:e=!0,showPrimitiveTokens:t=!0,...n},r)=>o.jsxs(f.Box,{ref:r,display:"flex",flexDirection:"column",gap:"8",...n,children:[o.jsx(f.Box,{children:o.jsx(f.Text,{fontSize:"sm",color:"text.body",fontFamily:"var(--font-body)",maxW:"4xl",children:"Browse the full MedixDeck color system in one place. Semantic tokens are rendered side by side for light and dark mode, while raw palettes expose every underlying brand and status scale used by the theme."})}),e&&o.jsx(f.Box,{display:"flex",flexDirection:"column",gap:"6",children:gm.map(i=>o.jsxs(f.Box,{children:[o.jsx(f.Text,{fontSize:"lg",fontWeight:"600",color:"text.heading",fontFamily:"var(--font-heading)",children:i.title}),o.jsx(f.Text,{mt:"1",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:i.description}),o.jsx(f.SimpleGrid,{columns:{base:1,xl:2},gap:"4",mt:"4",children:i.tokens.map(s=>o.jsxs(f.Box,{border:"1px solid",borderColor:"border",borderRadius:"xl",bg:"bg.surface",p:"4",children:[o.jsx(f.Text,{fontSize:"sm",fontWeight:"700",color:"text.heading",fontFamily:"var(--font-heading)",children:s.token}),o.jsx(f.Text,{mt:"1",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:s.description}),o.jsx(f.SimpleGrid,{columns:{base:1,md:2},gap:"3",mt:"4",children:mm.map(a=>o.jsx(bm,{mode:a,token:s},`${s.token}-${a}`))})]},s.token))})]},i.title))}),t&&o.jsx(f.Box,{display:"flex",flexDirection:"column",gap:"6",children:ym.map(i=>o.jsxs(f.Box,{children:[o.jsx(f.Text,{fontSize:"lg",fontWeight:"600",color:"text.heading",fontFamily:"var(--font-heading)",children:i.title}),o.jsx(f.Text,{mt:"1",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:i.description}),o.jsx(f.SimpleGrid,{columns:{base:1,sm:2,lg:3,xl:4},gap:"4",mt:"4",children:i.tokens.map(s=>o.jsxs(f.Box,{border:"1px solid",borderColor:"border",borderRadius:"xl",overflow:"hidden",bg:"bg.surface",children:[o.jsx(f.Box,{h:"72px",bg:s.value,borderBottom:"1px solid",borderColor:s.value==="#FFFFFF"||s.value===V.neutralLight.bg.value?"border":"transparent"}),o.jsxs(f.Box,{p:"4",children:[o.jsx(f.Text,{fontSize:"sm",fontWeight:"600",color:"text.heading",fontFamily:"var(--font-heading)",children:s.token}),o.jsx(f.Text,{mt:"1",fontSize:"xs",color:"text.muted",fontFamily:"var(--font-mono)",children:s.value})]})]},s.token))})]},i.title))})]}));ju.displayName="MedixThemeColorPalette";const us=k.createContext({});function ds(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const vm=typeof window<"u",Tu=vm?k.useLayoutEffect:k.useEffect,di=k.createContext(null);function fs(e,t){e.indexOf(t)===-1&&e.push(t)}function Kr(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Lt=(e,t,n)=>n>t?t:n<e?e:n;function ho(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let On=()=>{},Pt=()=>{};var Xc;typeof process<"u"&&((Xc=process.env)==null?void 0:Xc.NODE_ENV)!=="production"&&(On=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(ho(t,n))},Pt=(e,t,n)=>{if(!e)throw new Error(ho(t,n))});const $t={},Bu=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Eu(e){return typeof e=="object"&&e!==null}const Fu=e=>/^0[^.\s]+$/u.test(e);function Au(e){let t;return()=>(t===void 0&&(t=e()),t)}const ft=e=>e,km=(e,t)=>n=>t(e(n)),pr=(...e)=>e.reduce(km),ar=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class hs{constructor(){this.subscriptions=[]}add(t){return fs(this.subscriptions,t),()=>Kr(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const a=this.subscriptions[s];a&&a(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const et=e=>e*1e3,dt=e=>e/1e3;function Lu(e,t){return t?e*(1e3/t):0}const Ta=new Set;function ps(e,t,n){e||Ta.has(t)||(console.warn(ho(t,n)),Ta.add(t))}const Iu=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,wm=1e-7,Sm=12;function Cm(e,t,n,r,i){let s,a,l=0;do a=t+(n-t)/2,s=Iu(a,r,i)-e,s>0?n=a:t=a;while(Math.abs(s)>wm&&++l<Sm);return a}function mr(e,t,n,r){if(e===t&&n===r)return ft;const i=s=>Cm(s,0,1,e,n);return s=>s===0||s===1?s:Iu(i(s),t,r)}const Du=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ru=e=>t=>1-e(1-t),Mu=mr(.33,1.53,.69,.99),ms=Ru(Mu),Pu=Du(ms),Ou=e=>e>=1?1:(e*=2)<1?.5*ms(e):.5*(2-Math.pow(2,-10*(e-1))),xs=e=>1-Math.sin(Math.acos(e)),zu=Ru(xs),_u=Du(xs),jm=mr(.42,0,1,1),Tm=mr(0,0,.58,1),Nu=mr(.42,0,.58,1),Bm=e=>Array.isArray(e)&&typeof e[0]!="number",Vu=e=>Array.isArray(e)&&typeof e[0]=="number",Ba={linear:ft,easeIn:jm,easeInOut:Nu,easeOut:Tm,circIn:xs,circInOut:_u,circOut:zu,backIn:ms,backInOut:Pu,backOut:Mu,anticipate:Ou},Em=e=>typeof e=="string",Ea=e=>{if(Vu(e)){Pt(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,i]=e;return mr(t,n,r,i)}else if(Em(e))return Pt(Ba[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Ba[e];return e},Tr=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Fm(e,t){let n=new Set,r=new Set,i=!1,s=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function d(u){a.has(u)&&(c.schedule(u),e()),u(l)}const c={schedule:(u,h=!1,m=!1)=>{const x=m&&i?n:r;return h&&a.add(u),x.add(u),u},cancel:u=>{r.delete(u),a.delete(u)},process:u=>{if(l=u,i){s=!0;return}i=!0;const h=n;n=r,r=h,n.forEach(d),n.clear(),i=!1,s&&(s=!1,c.process(u))}};return c}const Am=40;function Wu(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,a=Tr.reduce((w,A)=>(w[A]=Fm(s),w),{}),{setup:l,read:d,resolveKeyframes:c,preUpdate:u,update:h,preRender:m,render:p,postRender:x}=a,g=()=>{const w=$t.useManualTiming,A=w?i.timestamp:performance.now();n=!1,w||(i.delta=r?1e3/60:Math.max(Math.min(A-i.timestamp,Am),1)),i.timestamp=A,i.isProcessing=!0,l.process(i),d.process(i),c.process(i),u.process(i),h.process(i),m.process(i),p.process(i),x.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(g))},v=()=>{n=!0,r=!0,i.isProcessing||e(g)};return{schedule:Tr.reduce((w,A)=>{const B=a[A];return w[A]=(C,O=!1,E=!1)=>(n||v(),B.schedule(C,O,E)),w},{}),cancel:w=>{for(let A=0;A<Tr.length;A++)a[Tr[A]].cancel(w)},state:i,steps:a}}const{schedule:ye,cancel:Gt,state:He,steps:Fi}=Wu(typeof requestAnimationFrame<"u"?requestAnimationFrame:ft,!0);let zr;function Lm(){zr=void 0}const Ke={now:()=>(zr===void 0&&Ke.set(He.isProcessing||$t.useManualTiming?He.timestamp:performance.now()),zr),set:e=>{zr=e,queueMicrotask(Lm)}},Hu=e=>t=>typeof t=="string"&&t.startsWith(e),Uu=Hu("--"),Im=Hu("var(--"),gs=e=>Im(e)?Dm.test(e.split("/*")[0].trim()):!1,Dm=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Fa(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const zn={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},lr={...zn,transform:e=>Lt(0,1,e)},Br={...zn,default:1},tr=e=>Math.round(e*1e5)/1e5,ys=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Rm(e){return e==null}const Mm=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,bs=(e,t)=>n=>!!(typeof n=="string"&&Mm.test(n)&&n.startsWith(e)||t&&!Rm(n)&&Object.prototype.hasOwnProperty.call(n,t)),$u=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,a,l]=r.match(ys);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},Pm=e=>Lt(0,255,e),Ai={...zn,transform:e=>Math.round(Pm(e))},nn={test:bs("rgb","red"),parse:$u("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ai.transform(e)+", "+Ai.transform(t)+", "+Ai.transform(n)+", "+tr(lr.transform(r))+")"};function Om(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const po={test:bs("#"),parse:Om,transform:nn.transform},xr=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Wt=xr("deg"),Ft=xr("%"),q=xr("px"),zm=xr("vh"),_m=xr("vw"),Aa={...Ft,parse:e=>Ft.parse(e)/100,transform:e=>Ft.transform(e*100)},En={test:bs("hsl","hue"),parse:$u("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ft.transform(tr(t))+", "+Ft.transform(tr(n))+", "+tr(lr.transform(r))+")"},Ae={test:e=>nn.test(e)||po.test(e)||En.test(e),parse:e=>nn.test(e)?nn.parse(e):En.test(e)?En.parse(e):po.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?nn.transform(e):En.transform(e),getAnimatableNone:e=>{const t=Ae.parse(e);return t.alpha=0,Ae.transform(t)}},Nm=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Vm(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ys))==null?void 0:t.length)||0)+(((n=e.match(Nm))==null?void 0:n.length)||0)>0}const Gu="number",Yu="color",Wm="var",Hm="var(",La="${}",Um=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Mn(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const l=t.replace(Um,d=>(Ae.test(d)?(r.color.push(s),i.push(Yu),n.push(Ae.parse(d))):d.startsWith(Hm)?(r.var.push(s),i.push(Wm),n.push(d)):(r.number.push(s),i.push(Gu),n.push(parseFloat(d))),++s,La)).split(La);return{values:n,split:l,indexes:r,types:i}}function $m(e){return Mn(e).values}function Ku({split:e,types:t}){const n=e.length;return r=>{let i="";for(let s=0;s<n;s++)if(i+=e[s],r[s]!==void 0){const a=t[s];a===Gu?i+=tr(r[s]):a===Yu?i+=Ae.transform(r[s]):i+=r[s]}return i}}function Gm(e){return Ku(Mn(e))}const Ym=e=>typeof e=="number"?0:Ae.test(e)?Ae.getAnimatableNone(e):e,Km=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:Ym(e);function qm(e){const t=Mn(e);return Ku(t)(t.values.map((r,i)=>Km(r,t.split[i])))}const bt={test:Vm,parse:$m,createTransformer:Gm,getAnimatableNone:qm};function Li(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Xm({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,a=0;if(!t)i=s=a=n;else{const l=n<.5?n*(1+t):n+t-n*t,d=2*n-l;i=Li(d,l,e+1/3),s=Li(d,l,e),a=Li(d,l,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:r}}function qr(e,t){return n=>n>0?t:e}const we=(e,t,n)=>e+(t-e)*n,Ii=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Zm=[po,nn,En],Jm=e=>Zm.find(t=>t.test(e));function Ia(e){const t=Jm(e);if(On(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===En&&(n=Xm(n)),n}const Da=(e,t)=>{const n=Ia(e),r=Ia(t);if(!n||!r)return qr(e,t);const i={...n};return s=>(i.red=Ii(n.red,r.red,s),i.green=Ii(n.green,r.green,s),i.blue=Ii(n.blue,r.blue,s),i.alpha=we(n.alpha,r.alpha,s),nn.transform(i))},mo=new Set(["none","hidden"]);function Qm(e,t){return mo.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function e1(e,t){return n=>we(e,t,n)}function vs(e){return typeof e=="number"?e1:typeof e=="string"?gs(e)?qr:Ae.test(e)?Da:r1:Array.isArray(e)?qu:typeof e=="object"?Ae.test(e)?Da:t1:qr}function qu(e,t){const n=[...e],r=n.length,i=e.map((s,a)=>vs(s)(s,t[a]));return s=>{for(let a=0;a<r;a++)n[a]=i[a](s);return n}}function t1(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=vs(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function n1(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],a=e.indexes[s][r[s]],l=e.values[a]??0;n[i]=l,r[s]++}return n}const r1=(e,t)=>{const n=bt.createTransformer(t),r=Mn(e),i=Mn(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?mo.has(e)&&!i.values.length||mo.has(t)&&!r.values.length?Qm(e,t):pr(qu(n1(r,i),i.values),n):(On(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),qr(e,t))};function Xu(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?we(e,t,n):vs(e)(e,t)}const i1=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ye.update(t,n),stop:()=>Gt(t),now:()=>He.isProcessing?He.timestamp:Ke.now()}},Zu=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=Math.round(e(s/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Xr=2e4;function ks(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Xr;)t+=n,r=e.next(t);return t>=Xr?1/0:t}function o1(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(ks(r),Xr);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:dt(i)}}const Te={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function xo(e,t){return e*Math.sqrt(1-t*t)}const s1=12;function a1(e,t,n){let r=n;for(let i=1;i<s1;i++)r=r-e(r)/t(r);return r}const Di=.001;function l1({duration:e=Te.duration,bounce:t=Te.bounce,velocity:n=Te.velocity,mass:r=Te.mass}){let i,s;On(e<=et(Te.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-t;a=Lt(Te.minDamping,Te.maxDamping,a),e=Lt(Te.minDuration,Te.maxDuration,dt(e)),a<1?(i=c=>{const u=c*a,h=u*e,m=u-n,p=xo(c,a),x=Math.exp(-h);return Di-m/p*x},s=c=>{const h=c*a*e,m=h*n+n,p=Math.pow(a,2)*Math.pow(c,2)*e,x=Math.exp(-h),g=xo(Math.pow(c,2),a);return(-i(c)+Di>0?-1:1)*((m-p)*x)/g}):(i=c=>{const u=Math.exp(-c*e),h=(c-n)*e+1;return-Di+u*h},s=c=>{const u=Math.exp(-c*e),h=(n-c)*(e*e);return u*h});const l=5/e,d=a1(i,s,l);if(e=et(e),isNaN(d))return{stiffness:Te.stiffness,damping:Te.damping,duration:e};{const c=Math.pow(d,2)*r;return{stiffness:c,damping:a*2*Math.sqrt(r*c),duration:e}}}const c1=["duration","bounce"],u1=["stiffness","damping","mass"];function Ra(e,t){return t.some(n=>e[n]!==void 0)}function d1(e){let t={velocity:Te.velocity,stiffness:Te.stiffness,damping:Te.damping,mass:Te.mass,isResolvedFromDuration:!1,...e};if(!Ra(e,u1)&&Ra(e,c1))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Lt(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Te.mass,stiffness:i,damping:s}}else{const n=l1({...e,velocity:0});t={...t,...n,mass:Te.mass},t.isResolvedFromDuration=!0}return t}function Zr(e=Te.visualDuration,t=Te.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:s},{stiffness:d,damping:c,mass:u,duration:h,velocity:m,isResolvedFromDuration:p}=d1({...n,velocity:-dt(n.velocity||0)}),x=m||0,g=c/(2*Math.sqrt(d*u)),v=a-s,y=dt(Math.sqrt(d/u)),j=Math.abs(v)<5;r||(r=j?Te.restSpeed.granular:Te.restSpeed.default),i||(i=j?Te.restDelta.granular:Te.restDelta.default);let w,A,B,C,O,E;if(g<1)B=xo(y,g),C=(x+g*y*v)/B,w=L=>{const R=Math.exp(-g*y*L);return a-R*(C*Math.sin(B*L)+v*Math.cos(B*L))},O=g*y*C+v*B,E=g*y*v-C*B,A=L=>Math.exp(-g*y*L)*(O*Math.sin(B*L)+E*Math.cos(B*L));else if(g===1){w=R=>a-Math.exp(-y*R)*(v+(x+y*v)*R);const L=x+y*v;A=R=>Math.exp(-y*R)*(y*L*R-x)}else{const L=y*Math.sqrt(g*g-1);w=P=>{const I=Math.exp(-g*y*P),M=Math.min(L*P,300);return a-I*((x+g*y*v)*Math.sinh(M)+L*v*Math.cosh(M))/L};const R=(x+g*y*v)/L,D=g*y*R-v*L,N=g*y*v-R*L;A=P=>{const I=Math.exp(-g*y*P),M=Math.min(L*P,300);return I*(D*Math.sinh(M)+N*Math.cosh(M))}}const F={calculatedDuration:p&&h||null,velocity:L=>et(A(L)),next:L=>{if(!p&&g<1){const D=Math.exp(-g*y*L),N=Math.sin(B*L),P=Math.cos(B*L),I=a-D*(C*N+v*P),M=et(D*(O*N+E*P));return l.done=Math.abs(M)<=r&&Math.abs(a-I)<=i,l.value=l.done?a:I,l}const R=w(L);if(p)l.done=L>=h;else{const D=et(A(L));l.done=Math.abs(D)<=r&&Math.abs(a-R)<=i}return l.value=l.done?a:R,l},toString:()=>{const L=Math.min(ks(F),Xr),R=Zu(D=>F.next(L*D).value,L,30);return L+"ms "+R},toTransition:()=>{}};return F}Zr.applyToOptions=e=>{const t=o1(e,100,Zr);return e.ease=t.ease,e.duration=et(t.duration),e.type="keyframes",e};const f1=5;function Ju(e,t,n){const r=Math.max(t-f1,0);return Lu(n-e(r),t-r)}function go({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:a,min:l,max:d,restDelta:c=.5,restSpeed:u}){const h=e[0],m={done:!1,value:h},p=E=>l!==void 0&&E<l||d!==void 0&&E>d,x=E=>l===void 0?d:d===void 0||Math.abs(l-E)<Math.abs(d-E)?l:d;let g=n*t;const v=h+g,y=a===void 0?v:a(v);y!==v&&(g=y-h);const j=E=>-g*Math.exp(-E/r),w=E=>y+j(E),A=E=>{const F=j(E),L=w(E);m.done=Math.abs(F)<=c,m.value=m.done?y:L};let B,C;const O=E=>{p(m.value)&&(B=E,C=Zr({keyframes:[m.value,x(m.value)],velocity:Ju(w,E,m.value),damping:i,stiffness:s,restDelta:c,restSpeed:u}))};return O(0),{calculatedDuration:null,next:E=>{let F=!1;return!C&&B===void 0&&(F=!0,A(E),O(E)),B!==void 0&&E>=B?C.next(E-B):(!F&&A(E),m)}}}function h1(e,t,n){const r=[],i=n||$t.mix||Xu,s=e.length-1;for(let a=0;a<s;a++){let l=i(e[a],e[a+1]);if(t){const d=Array.isArray(t)?t[a]||ft:t;l=pr(d,l)}r.push(l)}return r}function p1(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(Pt(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=h1(t,r,i),d=l.length,c=u=>{if(a&&u<e[0])return t[0];let h=0;if(d>1)for(;h<e.length-2&&!(u<e[h+1]);h++);const m=ar(e[h],e[h+1],u);return l[h](m)};return n?u=>c(Lt(e[0],e[s-1],u)):c}function m1(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=ar(0,t,r);e.push(we(n,1,i))}}function x1(e){const t=[0];return m1(t,e.length-1),t}function g1(e,t){return e.map(n=>n*t)}function y1(e,t){return e.map(()=>t||Nu).splice(0,e.length-1)}function Fn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=Bm(r)?r.map(Ea):Ea(r),s={done:!1,value:t[0]},a=g1(n&&n.length===t.length?n:x1(t),e),l=p1(a,t,{ease:Array.isArray(i)?i:y1(t,i)});return{calculatedDuration:e,next:d=>(s.value=l(d),s.done=d>=e,s)}}const b1=e=>e!==null;function fi(e,{repeat:t,repeatType:n="loop"},r,i=1){const s=e.filter(b1),l=i<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!l||r===void 0?s[l]:r}const v1={decay:go,inertia:go,tween:Fn,keyframes:Fn,spring:Zr};function Qu(e){typeof e.type=="string"&&(e.type=v1[e.type])}class ws{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const k1=e=>e/100;class Jr extends ws{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,i;const{motionValue:n}=this.options;n&&n.updatedAt!==Ke.now()&&this.tick(Ke.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Qu(t);const{type:n=Fn,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:a=0}=t;let{keyframes:l}=t;const d=n||Fn;process.env.NODE_ENV!=="production"&&d!==Fn&&Pt(l.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${l}`,"spring-two-frames"),d!==Fn&&typeof l[0]!="number"&&(this.mixKeyframes=pr(k1,Xu(l[0],l[1])),l=[0,100]);const c=d({...t,keyframes:l});s==="mirror"&&(this.mirroredGenerator=d({...t,keyframes:[...l].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=ks(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:i,mixKeyframes:s,mirroredGenerator:a,resolvedDuration:l,calculatedDuration:d}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:m,repeatDelay:p,type:x,onUpdate:g,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),j=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let w=this.currentTime,A=r;if(h){const E=Math.min(this.currentTime,i)/l;let F=Math.floor(E),L=E%1;!L&&E>=1&&(L=1),L===1&&F--,F=Math.min(F,h+1),!!(F%2)&&(m==="reverse"?(L=1-L,p&&(L-=p/l)):m==="mirror"&&(A=a)),w=Lt(0,1,L)*l}let B;j?(this.delayState.value=u[0],B=this.delayState):B=A.next(w),s&&!j&&(B.value=s(B.value));let{done:C}=B;!j&&d!==null&&(C=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return O&&x!==go&&(B.value=fi(u,this.options,v,this.speed)),g&&g(B.value),O&&this.finish(),B}then(t,n){return this.finished.then(t,n)}get duration(){return dt(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+dt(t)}get time(){return dt(this.currentTime)}set time(t){t=et(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return Ju(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(Ke.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=dt(this.currentTime))}play(){var i,s;if(this.isStopped)return;const{driver:t=i1,startTime:n}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),(s=(i=this.options).onPlay)==null||s.call(i);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ke.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function w1(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const rn=e=>e*180/Math.PI,yo=e=>{const t=rn(Math.atan2(e[1],e[0]));return bo(t)},S1={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:yo,rotateZ:yo,skewX:e=>rn(Math.atan(e[1])),skewY:e=>rn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},bo=e=>(e=e%360,e<0&&(e+=360),e),Ma=yo,Pa=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Oa=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),C1={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Pa,scaleY:Oa,scale:e=>(Pa(e)+Oa(e))/2,rotateX:e=>bo(rn(Math.atan2(e[6],e[5]))),rotateY:e=>bo(rn(Math.atan2(-e[2],e[0]))),rotateZ:Ma,rotate:Ma,skewX:e=>rn(Math.atan(e[4])),skewY:e=>rn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function vo(e){return e.includes("scale")?1:0}function ko(e,t){if(!e||e==="none")return vo(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=C1,i=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=S1,i=l}if(!i)return vo(t);const s=r[t],a=i[1].split(",").map(T1);return typeof s=="function"?s(a):a[s]}const j1=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ko(n,t)};function T1(e){return parseFloat(e.trim())}const _n=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Nn=new Set(_n),za=e=>e===zn||e===q,B1=new Set(["x","y","z"]),E1=_n.filter(e=>!B1.has(e));function F1(e){const t=[];return E1.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Ut={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const i=e.max-e.min;return r==="border-box"?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const i=e.max-e.min;return r==="border-box"?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>ko(t,"x"),y:(e,{transform:t})=>ko(t,"y")};Ut.translateX=Ut.x;Ut.translateY=Ut.y;const sn=new Set;let wo=!1,So=!1,Co=!1;function ed(){if(So){const e=Array.from(sn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=F1(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,a])=>{var l;(l=r.getValue(s))==null||l.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}So=!1,wo=!1,sn.forEach(e=>e.complete(Co)),sn.clear()}function td(){sn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(So=!0)})}function A1(){Co=!0,td(),ed(),Co=!1}class Ss{constructor(t,n,r,i,s,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(sn.add(this),wo||(wo=!0,ye.read(td),ye.resolveKeyframes(ed))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const s=i==null?void 0:i.get(),a=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),i&&s===void 0&&i.set(t[0])}w1(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),sn.delete(this)}cancel(){this.state==="scheduled"&&(sn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const L1=e=>e.startsWith("--");function nd(e,t,n){L1(t)?e.style.setProperty(t,n):e.style[t]=n}const I1={};function rd(e,t){const n=Au(e);return()=>I1[t]??n()}const D1=rd(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),id=rd(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Jn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,_a={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Jn([0,.65,.55,1]),circOut:Jn([.55,0,1,.45]),backIn:Jn([.31,.01,.66,-.59]),backOut:Jn([.33,1.53,.69,.99])};function od(e,t){if(e)return typeof e=="function"?id()?Zu(e,t):"ease-out":Vu(e)?Jn(e):Array.isArray(e)?e.map(n=>od(n,t)||_a.easeOut):_a[e]}function R1(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:a="loop",ease:l="easeOut",times:d}={},c=void 0){const u={[t]:n};d&&(u.offset=d);const h=od(l,i);Array.isArray(h)&&(u.easing=h);const m={delay:r,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"};return c&&(m.pseudoElement=c),e.animate(u,m)}function sd(e){return typeof e=="function"&&"applyToOptions"in e}function M1({type:e,...t}){return sd(e)&&id()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class ad extends ws{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:s,allowFlatten:a=!1,finalKeyframe:l,onComplete:d}=t;this.isPseudoElement=!!s,this.allowFlatten=a,this.options=t,Pt(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=M1(t);this.animation=R1(n,r,i,c,s),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const u=fi(i,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(u),nd(n,r,u),this.animation.cancel()}d==null||d(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,i;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((i=(r=this.animation).commitStyles)==null||i.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return dt(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+dt(t)}get time(){return dt(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=et(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:i}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&D1()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),ft):i(this)}}const ld={anticipate:Ou,backInOut:Pu,circInOut:_u};function P1(e){return e in ld}function O1(e){typeof e.ease=="string"&&P1(e.ease)&&(e.ease=ld[e.ease])}const Ri=10;class z1 extends ad{constructor(t){O1(t),Qu(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:s,...a}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new Jr({...a,autoplay:!1}),d=Math.max(Ri,Ke.now()-this.startTime),c=Lt(0,Ri,d-Ri),u=l.sample(d).value,{name:h}=this.options;s&&h&&nd(s,h,u),n.setWithVelocity(l.sample(Math.max(0,d-c)).value,u,c),l.stop()}}const Na=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(bt.test(e)||e==="0")&&!e.startsWith("url("));function _1(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function N1(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],a=Na(i,t),l=Na(s,t);return On(a===l,`You are trying to animate ${t} from "${i}" to "${s}". "${a?s:i}" is not an animatable value.`,"value-not-animatable"),!a||!l?!1:_1(e)||(n==="spring"||sd(n))&&r}function jo(e){e.duration=0,e.type="keyframes"}const cd=new Set(["opacity","clipPath","filter","transform"]),V1=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function W1(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&V1.test(e[t]))return!0;return!1}const H1=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),U1=Au(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function $1(e){var h;const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:s,type:a,keyframes:l}=e;if(!(((h=t==null?void 0:t.owner)==null?void 0:h.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return U1()&&n&&(cd.has(n)||H1.has(n)&&W1(l))&&(n!=="transform"||!u)&&!c&&!r&&i!=="mirror"&&s!==0&&a!=="inertia"}const G1=40;class Y1 extends ws{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:a="loop",keyframes:l,name:d,motionValue:c,element:u,...h}){var x;super(),this.stop=()=>{var g,v;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=Ke.now();const m={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:a,name:d,motionValue:c,element:u,...h},p=(u==null?void 0:u.KeyframeResolver)||Ss;this.keyframeResolver=new p(l,(g,v,y)=>this.onKeyframesResolved(g,v,m,!y),d,c,u),(x=this.keyframeResolver)==null||x.scheduleResolve()}onKeyframesResolved(t,n,r,i){var y,j;this.keyframeResolver=void 0;const{name:s,type:a,velocity:l,delay:d,isHandoff:c,onUpdate:u}=r;this.resolvedAt=Ke.now();let h=!0;N1(t,s,a,l)||(h=!1,($t.instantAnimations||!d)&&(u==null||u(fi(t,r,n))),t[0]=t[t.length-1],jo(r),r.repeat=0);const p={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>G1?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},x=h&&!c&&$1(p),g=(j=(y=p.motionValue)==null?void 0:y.owner)==null?void 0:j.current;let v;if(x)try{v=new z1({...p,element:g})}catch{v=new Jr(p)}else v=new Jr(p);v.finished.then(()=>{this.notifyFinished()}).catch(ft),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),A1()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function ud(e,t,n,r=0,i=1){const s=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),a=e.size,l=(a-1)*r;return typeof n=="function"?n(s,a):i===1?s*r:l-s*r}const K1=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function q1(e){const t=K1.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}const X1=4;function dd(e,t,n=1){Pt(n<=X1,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,i]=q1(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const a=s.trim();return Bu(a)?parseFloat(a):a}return gs(i)?dd(i,t,n+1):i}const Z1={type:"spring",stiffness:500,damping:25,restSpeed:10},J1=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Q1={type:"keyframes",duration:.8},ex={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},tx=(e,{keyframes:t})=>t.length>2?Q1:Nn.has(e)?e.startsWith("scale")?J1(t[1]):Z1:ex;function fd(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Cs(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?fd(n,e):n}const nx=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function rx(e){for(const t in e)if(!nx.has(t))return!0;return!1}const js=(e,t,n,r={},i,s)=>a=>{const l=Cs(r,e)||{},d=l.delay||r.delay||0;let{elapsed:c=0}=r;c=c-et(d);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-c,onUpdate:m=>{t.set(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:s?void 0:i};rx(l)||Object.assign(u,tx(e,u)),u.duration&&(u.duration=et(u.duration)),u.repeatDelay&&(u.repeatDelay=et(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(jo(u),u.delay===0&&(h=!0)),($t.instantAnimations||$t.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(h=!0,jo(u),u.delay=0),u.allowFlatten=!l.type&&!l.ease,h&&!s&&t.get()!==void 0){const m=fi(u.keyframes,l);if(m!==void 0){ye.update(()=>{u.onUpdate(m),u.onComplete()});return}}return l.isSync?new Jr(u):new Y1(u)};function Va(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Ts(e,t,n,r){if(typeof t=="function"){const[i,s]=Va(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=Va(r);t=t(n!==void 0?n:e.custom,i,s)}return t}function an(e,t,n){const r=e.getProps();return Ts(r,t,n!==void 0?n:r.custom,e)}const hd=new Set(["width","height","top","left","right","bottom",..._n]),Wa=30,ix=e=>!isNaN(parseFloat(e));class ox{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const i=Ke.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ke.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=ix(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&ps(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new hs);const r=this.events[t].add(n);return t==="change"?()=>{r(),ye.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ke.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Wa)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Wa);return Lu(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Pn(e,t){return new ox(e,t)}const To=e=>Array.isArray(e);function sx(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Pn(n))}function ax(e){return To(e)?e[e.length-1]||0:e}function lx(e,t){const n=an(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const a in s){const l=ax(s[a]);sx(e,a,l)}}const Ue=e=>!!(e&&e.getVelocity);function cx(e){return!!(Ue(e)&&e.add)}function Bo(e,t){const n=e.getValue("willChange");if(cx(n))return n.add(t);if(!n&&$t.WillChange){const r=new $t.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Bs(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const ux="framerAppearId",pd="data-"+Bs(ux);function md(e){return e.props[pd]}function dx({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function xd(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s,transitionEnd:a,...l}=t;const d=e.getDefaultTransition();s=s?fd(s,d):d;const c=s==null?void 0:s.reduceMotion;r&&(s=r);const u=[],h=i&&e.animationState&&e.animationState.getState()[i];for(const m in l){const p=e.getValue(m,e.latestValues[m]??null),x=l[m];if(x===void 0||h&&dx(h,m))continue;const g={delay:n,...Cs(s||{},m)},v=p.get();if(v!==void 0&&!p.isAnimating()&&!Array.isArray(x)&&x===v&&!g.velocity){ye.update(()=>p.set(x));continue}let y=!1;if(window.MotionHandoffAnimation){const A=md(e);if(A){const B=window.MotionHandoffAnimation(A,m,ye);B!==null&&(g.startTime=B,y=!0)}}Bo(e,m);const j=c??e.shouldReduceMotion;p.start(js(m,p,x,j&&hd.has(m)?{type:!1}:g,e,y));const w=p.animation;w&&u.push(w)}if(a){const m=()=>ye.update(()=>{a&&lx(e,a)});u.length?Promise.all(u).then(m):m()}return u}function Eo(e,t,n={}){var d;const r=an(e,t,n.type==="exit"?(d=e.presenceContext)==null?void 0:d.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(xd(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:m}=i;return fx(e,t,c,u,h,m,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[c,u]=l==="beforeChildren"?[s,a]:[a,s];return c().then(()=>u())}else return Promise.all([s(),a(n.delay)])}function fx(e,t,n=0,r=0,i=0,s=1,a){const l=[];for(const d of e.variantChildren)d.notify("AnimationStart",t),l.push(Eo(d,t,{...a,delay:n+(typeof r=="function"?0:r)+ud(e.variantChildren,d,r,i,s)}).then(()=>d.notify("AnimationComplete",t)));return Promise.all(l)}function hx(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>Eo(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=Eo(e,t,n);else{const i=typeof t=="function"?an(e,t,n.custom):t;r=Promise.all(xd(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const px={test:e=>e==="auto",parse:e=>e},gd=e=>t=>t.test(e),yd=[zn,q,Ft,Wt,_m,zm,px],Ha=e=>yd.find(gd(e));function mx(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Fu(e):!0}const xx=new Set(["brightness","contrast","saturate","opacity"]);function gx(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(ys)||[];if(!r)return e;const i=n.replace(r,"");let s=xx.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const yx=/\b([a-z-]*)\(.*?\)/gu,Fo={...bt,getAnimatableNone:e=>{const t=e.match(yx);return t?t.map(gx).join(" "):e}},Ao={...bt,getAnimatableNone:e=>{const t=bt.parse(e);return bt.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},Ua={...zn,transform:Math.round},bx={rotate:Wt,rotateX:Wt,rotateY:Wt,rotateZ:Wt,scale:Br,scaleX:Br,scaleY:Br,scaleZ:Br,skew:Wt,skewX:Wt,skewY:Wt,distance:q,translateX:q,translateY:q,translateZ:q,x:q,y:q,z:q,perspective:q,transformPerspective:q,opacity:lr,originX:Aa,originY:Aa,originZ:q},Es={borderWidth:q,borderTopWidth:q,borderRightWidth:q,borderBottomWidth:q,borderLeftWidth:q,borderRadius:q,borderTopLeftRadius:q,borderTopRightRadius:q,borderBottomRightRadius:q,borderBottomLeftRadius:q,width:q,maxWidth:q,height:q,maxHeight:q,top:q,right:q,bottom:q,left:q,inset:q,insetBlock:q,insetBlockStart:q,insetBlockEnd:q,insetInline:q,insetInlineStart:q,insetInlineEnd:q,padding:q,paddingTop:q,paddingRight:q,paddingBottom:q,paddingLeft:q,paddingBlock:q,paddingBlockStart:q,paddingBlockEnd:q,paddingInline:q,paddingInlineStart:q,paddingInlineEnd:q,margin:q,marginTop:q,marginRight:q,marginBottom:q,marginLeft:q,marginBlock:q,marginBlockStart:q,marginBlockEnd:q,marginInline:q,marginInlineStart:q,marginInlineEnd:q,fontSize:q,backgroundPositionX:q,backgroundPositionY:q,...bx,zIndex:Ua,fillOpacity:lr,strokeOpacity:lr,numOctaves:Ua},vx={...Es,color:Ae,backgroundColor:Ae,outlineColor:Ae,fill:Ae,stroke:Ae,borderColor:Ae,borderTopColor:Ae,borderRightColor:Ae,borderBottomColor:Ae,borderLeftColor:Ae,filter:Fo,WebkitFilter:Fo,mask:Ao,WebkitMask:Ao},bd=e=>vx[e],kx=new Set([Fo,Ao]);function vd(e,t){let n=bd(e);return kx.has(n)||(n=bt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const wx=new Set(["auto","none","0"]);function Sx(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!wx.has(s)&&Mn(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=vd(n,i)}class Cx extends Ss{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let h=t[u];if(typeof h=="string"&&(h=h.trim(),gs(h))){const m=dd(h,n.current);m!==void 0&&(t[u]=m),u===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!hd.has(r)||t.length!==2)return;const[i,s]=t,a=Ha(i),l=Ha(s),d=Fa(i),c=Fa(s);if(d!==c&&Ut[r]){this.needsMeasurement=!0;return}if(a!==l)if(za(a)&&za(l))for(let u=0;u<t.length;u++){const h=t[u];typeof h=="string"&&(t[u]=parseFloat(h))}else Ut[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||mx(t[i]))&&r.push(i);r.length&&Sx(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ut[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,a=r[s];r[s]=Ut[n](t.measureViewportBox(),window.getComputedStyle(t.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([d,c])=>{t.getValue(d).set(c)}),this.resolveNoneKeyframes()}}function kd(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const i=(n==null?void 0:n[e])??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(r=>r!=null)}const wd=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function _r(e){return Eu(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Fs}=Wu(queueMicrotask,!1),yt={x:!1,y:!1};function Sd(){return yt.x||yt.y}function jx(e){return e==="x"||e==="y"?yt[e]?null:(yt[e]=!0,()=>{yt[e]=!1}):yt.x||yt.y?null:(yt.x=yt.y=!0,()=>{yt.x=yt.y=!1})}function Cd(e,t){const n=kd(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Tx(e){return!(e.pointerType==="touch"||Sd())}function Bx(e,t,n={}){const[r,i,s]=Cd(e,n);return r.forEach(a=>{let l=!1,d=!1,c;const u=()=>{a.removeEventListener("pointerleave",x)},h=v=>{c&&(c(v),c=void 0),u()},m=v=>{l=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),d&&(d=!1,h(v))},p=()=>{l=!0,window.addEventListener("pointerup",m,i),window.addEventListener("pointercancel",m,i)},x=v=>{if(v.pointerType!=="touch"){if(l){d=!0;return}h(v)}},g=v=>{if(!Tx(v))return;d=!1;const y=t(a,v);typeof y=="function"&&(c=y,a.addEventListener("pointerleave",x,i))};a.addEventListener("pointerenter",g,i),a.addEventListener("pointerdown",p,i)}),s}const jd=(e,t)=>t?e===t?!0:jd(e,t.parentElement):!1,As=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Ex=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Fx(e){return Ex.has(e.tagName)||e.isContentEditable===!0}const Ax=new Set(["INPUT","SELECT","TEXTAREA"]);function Lx(e){return Ax.has(e.tagName)||e.isContentEditable===!0}const Nr=new WeakSet;function $a(e){return t=>{t.key==="Enter"&&e(t)}}function Mi(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Ix=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=$a(()=>{if(Nr.has(n))return;Mi(n,"down");const i=$a(()=>{Mi(n,"up")}),s=()=>Mi(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Ga(e){return As(e)&&!Sd()}const Ya=new WeakSet;function Dx(e,t,n={}){const[r,i,s]=Cd(e,n),a=l=>{const d=l.currentTarget;if(!Ga(l)||Ya.has(l))return;Nr.add(d),n.stopPropagation&&Ya.add(l);const c=t(d,l),u=(p,x)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",m),Nr.has(d)&&Nr.delete(d),Ga(p)&&typeof c=="function"&&c(p,{success:x})},h=p=>{u(p,d===window||d===document||n.useGlobalTarget||jd(d,p.target))},m=p=>{u(p,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",m,i)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,i),_r(l)&&(l.addEventListener("focus",c=>Ix(c,i)),!Fx(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),s}function Ls(e){return Eu(e)&&"ownerSVGElement"in e}const Vr=new WeakMap;let Ht;const Td=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+"Size"]:Ls(r)&&"getBBox"in r?r.getBBox()[t]:r[n],Rx=Td("inline","width","offsetWidth"),Mx=Td("block","height","offsetHeight");function Px({target:e,borderBoxSize:t}){var n;(n=Vr.get(e))==null||n.forEach(r=>{r(e,{get width(){return Rx(e,t)},get height(){return Mx(e,t)}})})}function Ox(e){e.forEach(Px)}function zx(){typeof ResizeObserver>"u"||(Ht=new ResizeObserver(Ox))}function _x(e,t){Ht||zx();const n=kd(e);return n.forEach(r=>{let i=Vr.get(r);i||(i=new Set,Vr.set(r,i)),i.add(t),Ht==null||Ht.observe(r)}),()=>{n.forEach(r=>{const i=Vr.get(r);i==null||i.delete(t),i!=null&&i.size||Ht==null||Ht.unobserve(r)})}}const Wr=new Set;let An;function Nx(){An=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Wr.forEach(t=>t(e))},window.addEventListener("resize",An)}function Vx(e){return Wr.add(e),An||Nx(),()=>{Wr.delete(e),!Wr.size&&typeof An=="function"&&(window.removeEventListener("resize",An),An=void 0)}}function Ka(e,t){return typeof e=="function"?Vx(e):_x(e,t)}function Wx(e){return Ls(e)&&e.tagName==="svg"}const Hx=[...yd,Ae,bt],Ux=e=>Hx.find(gd(e)),qa=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ln=()=>({x:qa(),y:qa()}),Xa=()=>({min:0,max:0}),Pe=()=>({x:Xa(),y:Xa()}),$x=new WeakMap;function hi(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function cr(e){return typeof e=="string"||Array.isArray(e)}const Is=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ds=["initial",...Is];function pi(e){return hi(e.animate)||Ds.some(t=>cr(e[t]))}function Bd(e){return!!(pi(e)||e.variants)}function Gx(e,t,n){for(const r in t){const i=t[r],s=n[r];if(Ue(i))e.addValue(r,i);else if(Ue(s))e.addValue(r,Pn(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=e.getStaticValue(r);e.addValue(r,Pn(a!==void 0?a:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Lo={current:null},Ed={current:!1},Yx=typeof window<"u";function Kx(){if(Ed.current=!0,!!Yx)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Lo.current=e.matches;e.addEventListener("change",t),t()}else Lo.current=!1}const Za=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Qr={};function Fd(e){Qr=e}function qx(){return Qr}class Xx{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:a,visualState:l},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ss,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Ke.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,ye.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=l;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=d,this.blockInitialAnimation=!!a,this.isControllingVariants=pi(n),this.isVariantNode=Bd(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in m){const x=m[p];c[p]!==void 0&&Ue(x)&&x.set(c[p])}}mount(t){var n,r;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=t,$x.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,s)=>this.bindToMotionValue(s,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Ed.current||Kx(),this.shouldReduceMotion=Lo.current),process.env.NODE_ENV!=="production"&&ps(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Gt(this.notifyUpdate),Gt(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&cd.has(t)&&this.current instanceof HTMLElement){const{factory:a,keyframes:l,times:d,ease:c,duration:u}=n.accelerate,h=new ad({element:this.current,name:t,keyframes:l,times:d,ease:c,duration:et(u)}),m=a(h);this.valueSubscriptions.set(t,()=>{m(),h.cancel()});return}const r=Nn.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&ye.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Qr){const n=Qr[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Pe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Za.length;r++){const i=Za[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,a=t[s];a&&(this.propEventSubscriptions[i]=this.on(i,a))}this.prevMotionValues=Gx(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Pn(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Bu(r)||Fu(r))?r=parseFloat(r):!Ux(r)&&bt.test(n)&&(r=vd(t,n)),this.setBaseTarget(t,Ue(r)?r.get():r)),Ue(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=Ts(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);a&&(r=a[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Ue(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new hs),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Fs.render(this.render)}}class Ad extends Xx{constructor(){super(...arguments),this.KeyframeResolver=Cx}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ue(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Yt{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Ld({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Zx({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Jx(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Pi(e){return e===void 0||e===1}function Io({scale:e,scaleX:t,scaleY:n}){return!Pi(e)||!Pi(t)||!Pi(n)}function tn(e){return Io(e)||Id(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Id(e){return Ja(e.x)||Ja(e.y)}function Ja(e){return e&&e!=="0%"}function ei(e,t,n){const r=e-n,i=t*r;return n+i}function Qa(e,t,n,r,i){return i!==void 0&&(e=ei(e,i,r)),ei(e,n,r)+t}function Do(e,t=0,n=1,r,i){e.min=Qa(e.min,t,n,r,i),e.max=Qa(e.max,t,n,r,i)}function Dd(e,{x:t,y:n}){Do(e.x,t.translate,t.scale,t.originPoint),Do(e.y,n.translate,n.scale,n.originPoint)}const el=.999999999999,tl=1.0000000000001;function Qx(e,t,n,r=!1){var l;const i=n.length;if(!i)return;t.x=t.y=1;let s,a;for(let d=0;d<i;d++){s=n[d],a=s.projectionDelta;const{visualElement:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(Tt(e.x,-s.scroll.offset.x),Tt(e.y,-s.scroll.offset.y)),a&&(t.x*=a.x.scale,t.y*=a.y.scale,Dd(e,a)),r&&tn(s.latestValues)&&Hr(e,s.latestValues,(l=s.layout)==null?void 0:l.layoutBox))}t.x<tl&&t.x>el&&(t.x=1),t.y<tl&&t.y>el&&(t.y=1)}function Tt(e,t){e.min+=t,e.max+=t}function nl(e,t,n,r,i=.5){const s=we(e.min,e.max,i);Do(e,t,n,s,r)}function rl(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Hr(e,t,n){const r=n??e;nl(e.x,rl(t.x,r.x),t.scaleX,t.scale,t.originX),nl(e.y,rl(t.y,r.y),t.scaleY,t.scale,t.originY)}function Rd(e,t){return Ld(Jx(e.getBoundingClientRect(),t))}function eg(e,t,n){const r=Rd(e,n),{scroll:i}=t;return i&&(Tt(r.x,i.offset.x),Tt(r.y,i.offset.y)),r}const tg={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ng=_n.length;function rg(e,t,n){let r="",i=!0;for(let s=0;s<ng;s++){const a=_n[s],l=e[a];if(l===void 0)continue;let d=!0;if(typeof l=="number")d=l===(a.startsWith("scale")?1:0);else{const c=parseFloat(l);d=a.startsWith("scale")?c===1:c===0}if(!d||n){const c=wd(l,Es[a]);if(!d){i=!1;const u=tg[a]||a;r+=`${u}(${c}) `}n&&(t[a]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Rs(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let a=!1,l=!1;for(const d in t){const c=t[d];if(Nn.has(d)){a=!0;continue}else if(Uu(d)){i[d]=c;continue}else{const u=wd(c,Es[d]);d.startsWith("origin")?(l=!0,s[d]=u):r[d]=u}}if(t.transform||(a||n?r.transform=rg(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:d="50%",originY:c="50%",originZ:u=0}=s;r.transformOrigin=`${d} ${c} ${u}`}}function Md(e,{style:t,vars:n},r,i){const s=e.style;let a;for(a in t)s[a]=t[a];i==null||i.applyProjectionStyles(s,r);for(a in n)s.setProperty(a,n[a])}function il(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const $n={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(q.test(e))e=parseFloat(e);else return e;const n=il(e,t.target.x),r=il(e,t.target.y);return`${n}% ${r}%`}},ig={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=bt.parse(e);if(i.length>5)return r;const s=bt.createTransformer(e),a=typeof i[0]!="number"?1:0,l=n.x.scale*t.x,d=n.y.scale*t.y;i[0+a]/=l,i[1+a]/=d;const c=we(l,d,.5);return typeof i[2+a]=="number"&&(i[2+a]/=c),typeof i[3+a]=="number"&&(i[3+a]/=c),s(i)}},Ro={borderRadius:{...$n,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:$n,borderTopRightRadius:$n,borderBottomLeftRadius:$n,borderBottomRightRadius:$n,boxShadow:ig};function Pd(e,{layout:t,layoutId:n}){return Nn.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ro[e]||e==="opacity")}function Ms(e,t,n){var a;const r=e.style,i=t==null?void 0:t.style,s={};if(!r)return s;for(const l in r)(Ue(r[l])||i&&Ue(i[l])||Pd(l,e)||((a=n==null?void 0:n.getValue(l))==null?void 0:a.liveStyle)!==void 0)&&(s[l]=r[l]);return s}function og(e){return window.getComputedStyle(e)}class sg extends Ad{constructor(){super(...arguments),this.type="html",this.renderInstance=Md}readValueFromInstance(t,n){var r;if(Nn.has(n))return(r=this.projection)!=null&&r.isProjecting?vo(n):j1(t,n);{const i=og(t),s=(Uu(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Rd(t,n)}build(t,n,r){Rs(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Ms(t,n,r)}}const ag={offset:"stroke-dashoffset",array:"stroke-dasharray"},lg={offset:"strokeDashoffset",array:"strokeDasharray"};function cg(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?ag:lg;e[s.offset]=`${-r}`,e[s.array]=`${t} ${n}`}const ug=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Od(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:a=0,...l},d,c,u){if(Rs(e,l,c),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m}=e;h.transform&&(m.transform=h.transform,delete h.transform),(m.transform||h.transformOrigin)&&(m.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),m.transform&&(m.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete h.transformBox);for(const p of ug)h[p]!==void 0&&(m[p]=h[p],delete h[p]);t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),i!==void 0&&cg(h,i,s,a,!1)}const zd=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),_d=e=>typeof e=="string"&&e.toLowerCase()==="svg";function dg(e,t,n,r){Md(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(zd.has(i)?i:Bs(i),t.attrs[i])}function Nd(e,t,n){const r=Ms(e,t,n);for(const i in e)if(Ue(e[i])||Ue(t[i])){const s=_n.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}class fg extends Ad{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Pe}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Nn.has(n)){const r=bd(n);return r&&r.default||0}return n=zd.has(n)?n:Bs(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Nd(t,n,r)}build(t,n,r){Od(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){dg(t,n,r,i)}mount(t){this.isSVGTag=_d(t.tagName),super.mount(t)}}const hg=Ds.length;function Vd(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Vd(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<hg;n++){const r=Ds[n],i=e.props[r];(cr(i)||i===!1)&&(t[r]=i)}return t}function Wd(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const pg=[...Is].reverse(),mg=Is.length;function xg(e){return t=>Promise.all(t.map(({animation:n,options:r})=>hx(e,n,r)))}function gg(e){let t=xg(e),n=ol(),r=!0,i=!1;const s=c=>(u,h)=>{var p;const m=an(e,h,c==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(m){const{transition:x,transitionEnd:g,...v}=m;u={...u,...v,...g}}return u};function a(c){t=c(e)}function l(c){const{props:u}=e,h=Vd(e.parent)||{},m=[],p=new Set;let x={},g=1/0;for(let y=0;y<mg;y++){const j=pg[y],w=n[j],A=u[j]!==void 0?u[j]:h[j],B=cr(A),C=j===c?w.isActive:null;C===!1&&(g=y);let O=A===h[j]&&A!==u[j]&&B;if(O&&(r||i)&&e.manuallyAnimateOnMount&&(O=!1),w.protectedKeys={...x},!w.isActive&&C===null||!A&&!w.prevProp||hi(A)||typeof A=="boolean")continue;if(j==="exit"&&w.isActive&&C!==!0){w.prevResolvedValues&&(x={...x,...w.prevResolvedValues});continue}const E=yg(w.prevProp,A);let F=E||j===c&&w.isActive&&!O&&B||y>g&&B,L=!1;const R=Array.isArray(A)?A:[A];let D=R.reduce(s(j),{});C===!1&&(D={});const{prevResolvedValues:N={}}=w,P={...N,...D},I=G=>{F=!0,p.has(G)&&(L=!0,p.delete(G)),w.needsAnimating[G]=!0;const H=e.getValue(G);H&&(H.liveStyle=!1)};for(const G in P){const H=D[G],b=N[G];if(x.hasOwnProperty(G))continue;let W=!1;To(H)&&To(b)?W=!Wd(H,b):W=H!==b,W?H!=null?I(G):p.add(G):H!==void 0&&p.has(G)?I(G):w.protectedKeys[G]=!0}w.prevProp=A,w.prevResolvedValues=D,w.isActive&&(x={...x,...D}),(r||i)&&e.blockInitialAnimation&&(F=!1);const M=O&&E;F&&(!M||L)&&m.push(...R.map(G=>{const H={type:j};if(typeof G=="string"&&(r||i)&&!M&&e.manuallyAnimateOnMount&&e.parent){const{parent:b}=e,W=an(b,G);if(b.enteringChildren&&W){const{delayChildren:ne}=W.transition||{};H.delay=ud(b.enteringChildren,e,ne)}}return{animation:G,options:H}}))}if(p.size){const y={};if(typeof u.initial!="boolean"){const j=an(e,Array.isArray(u.initial)?u.initial[0]:u.initial);j&&j.transition&&(y.transition=j.transition)}p.forEach(j=>{const w=e.getBaseTarget(j),A=e.getValue(j);A&&(A.liveStyle=!0),y[j]=w??null}),m.push({animation:y})}let v=!!m.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,i=!1,v?t(m):Promise.resolve()}function d(c,u){var m;if(n[c].isActive===u)return Promise.resolve();(m=e.variantChildren)==null||m.forEach(p=>{var x;return(x=p.animationState)==null?void 0:x.setActive(c,u)}),n[c].isActive=u;const h=l(c);for(const p in n)n[p].protectedKeys={};return h}return{animateChanges:l,setActive:d,setAnimateFunction:a,getState:()=>n,reset:()=>{n=ol(),i=!0}}}function yg(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Wd(t,e):!1}function Qt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ol(){return{animate:Qt(!0),whileInView:Qt(),whileHover:Qt(),whileTap:Qt(),whileDrag:Qt(),whileFocus:Qt(),exit:Qt()}}function Mo(e,t){e.min=t.min,e.max=t.max}function gt(e,t){Mo(e.x,t.x),Mo(e.y,t.y)}function sl(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Hd=1e-4,bg=1-Hd,vg=1+Hd,Ud=.01,kg=0-Ud,wg=0+Ud;function qe(e){return e.max-e.min}function Sg(e,t,n){return Math.abs(e-t)<=n}function al(e,t,n,r=.5){e.origin=r,e.originPoint=we(t.min,t.max,e.origin),e.scale=qe(n)/qe(t),e.translate=we(n.min,n.max,e.origin)-e.originPoint,(e.scale>=bg&&e.scale<=vg||isNaN(e.scale))&&(e.scale=1),(e.translate>=kg&&e.translate<=wg||isNaN(e.translate))&&(e.translate=0)}function nr(e,t,n,r){al(e.x,t.x,n.x,r?r.originX:void 0),al(e.y,t.y,n.y,r?r.originY:void 0)}function ll(e,t,n,r=0){const i=r?we(n.min,n.max,r):n.min;e.min=i+t.min,e.max=e.min+qe(t)}function Cg(e,t,n,r){ll(e.x,t.x,n.x,r==null?void 0:r.x),ll(e.y,t.y,n.y,r==null?void 0:r.y)}function cl(e,t,n,r=0){const i=r?we(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+qe(t)}function ti(e,t,n,r){cl(e.x,t.x,n.x,r==null?void 0:r.x),cl(e.y,t.y,n.y,r==null?void 0:r.y)}function ul(e,t,n,r,i){return e-=t,e=ei(e,1/n,r),i!==void 0&&(e=ei(e,1/i,r)),e}function jg(e,t=0,n=1,r=.5,i,s=e,a=e){if(Ft.test(t)&&(t=parseFloat(t),t=we(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=we(s.min,s.max,r);e===s&&(l-=t),e.min=ul(e.min,t,n,l,i),e.max=ul(e.max,t,n,l,i)}function dl(e,t,[n,r,i],s,a){jg(e,t[n],t[r],t[i],t.scale,s,a)}const Tg=["x","scaleX","originX"],Bg=["y","scaleY","originY"];function fl(e,t,n,r){dl(e.x,t,Tg,n?n.x:void 0,r?r.x:void 0),dl(e.y,t,Bg,n?n.y:void 0,r?r.y:void 0)}function hl(e){return e.translate===0&&e.scale===1}function $d(e){return hl(e.x)&&hl(e.y)}function pl(e,t){return e.min===t.min&&e.max===t.max}function Eg(e,t){return pl(e.x,t.x)&&pl(e.y,t.y)}function ml(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Gd(e,t){return ml(e.x,t.x)&&ml(e.y,t.y)}function xl(e){return qe(e.x)/qe(e.y)}function gl(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Ct(e){return[e("x"),e("y")]}function Fg(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((i||s||a)&&(r=`translate3d(${i}px, ${s}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:h,rotateY:m,skewX:p,skewY:x}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),h&&(r+=`rotateX(${h}deg) `),m&&(r+=`rotateY(${m}deg) `),p&&(r+=`skewX(${p}deg) `),x&&(r+=`skewY(${x}deg) `)}const l=e.x.scale*t.x,d=e.y.scale*t.y;return(l!==1||d!==1)&&(r+=`scale(${l}, ${d})`),r||"none"}const Yd=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Ag=Yd.length,yl=e=>typeof e=="string"?parseFloat(e):e,bl=e=>typeof e=="number"||q.test(e);function Lg(e,t,n,r,i,s){i?(e.opacity=we(0,n.opacity??1,Ig(r)),e.opacityExit=we(t.opacity??1,0,Dg(r))):s&&(e.opacity=we(t.opacity??1,n.opacity??1,r));for(let a=0;a<Ag;a++){const l=Yd[a];let d=vl(t,l),c=vl(n,l);if(d===void 0&&c===void 0)continue;d||(d=0),c||(c=0),d===0||c===0||bl(d)===bl(c)?(e[l]=Math.max(we(yl(d),yl(c),r),0),(Ft.test(c)||Ft.test(d))&&(e[l]+="%")):e[l]=c}(t.rotate||n.rotate)&&(e.rotate=we(t.rotate||0,n.rotate||0,r))}function vl(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Ig=Kd(0,.5,zu),Dg=Kd(.5,.95,ft);function Kd(e,t,n){return r=>r<e?0:r>t?1:n(ar(e,t,r))}function Rg(e,t,n){const r=Ue(e)?e:Pn(e);return r.start(js("",r,t,n)),r.animation}function ur(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const Mg=(e,t)=>e.depth-t.depth;class Pg{constructor(){this.children=[],this.isDirty=!1}add(t){fs(this.children,t),this.isDirty=!0}remove(t){Kr(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Mg),this.isDirty=!1,this.children.forEach(t)}}function Og(e,t){const n=Ke.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(Gt(r),e(s-t))};return ye.setup(r,!0),()=>Gt(r)}function Ur(e){return Ue(e)?e.get():e}class zg{constructor(){this.members=[]}add(t){fs(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const i=r.instance;(!i||i.isConnected===!1)&&!r.snapshot&&(Kr(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Kr(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const i=this.members[r];if(i.isPresent!==!1&&((n=i.instance)==null?void 0:n.isConnected)!==!1)return this.promote(i),!0}return!1}promote(t,n){var i;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:s}=r.options,{layoutDependency:a}=t.options;(s===void 0||s!==a)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(i=t.root)!=null&&i.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,i,s,a;(r=(n=t.options).onExitComplete)==null||r.call(n),(a=(i=t.resumingFrom)==null?void 0:(s=i.options).onExitComplete)==null||a.call(s)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const $r={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Oi=["","X","Y","Z"],_g=1e3;let Ng=0;function zi(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function qd(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=md(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ye,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&qd(r)}function Xd({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a={},l=t==null?void 0:t()){this.id=Ng++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Hg),this.nodes.forEach(qg),this.nodes.forEach(Xg),this.nodes.forEach(Ug)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new Pg)}addEventListener(a,l){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new hs),this.eventHandlers.get(a).add(l)}notifyListeners(a,...l){const d=this.eventHandlers.get(a);d&&d.notify(...l)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=Ls(a)&&!Wx(a),this.instance=a;const{layoutId:l,layout:d,visualElement:c}=this.options;if(c&&!c.current&&c.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(d||l)&&(this.isLayoutDirty=!0),e){let u,h=0;const m=()=>this.root.updateBlockedByResize=!1;ye.read(()=>{h=window.innerWidth}),e(a,()=>{const p=window.innerWidth;p!==h&&(h=p,this.root.updateBlockedByResize=!0,u&&u(),u=Og(m,250),$r.hasAnimatedSinceResize&&($r.hasAnimatedSinceResize=!1,this.nodes.forEach(Sl)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||d)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||c.getDefaultTransition()||t0,{onLayoutAnimationStart:g,onLayoutAnimationComplete:v}=c.getProps(),y=!this.targetLayout||!Gd(this.targetLayout,p),j=!h&&m;if(this.options.layoutRoot||this.resumeFrom||j||h&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...Cs(x,"layout"),onPlay:g,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(u,j)}else h||Sl(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Gt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Zg),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qd(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:l,layout:d}=this.options;if(l===void 0&&!d)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const d=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),d&&this.nodes.forEach(Gg),this.nodes.forEach(kl);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(wl);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Yg),this.nodes.forEach(Kg),this.nodes.forEach(Vg),this.nodes.forEach(Wg)):this.nodes.forEach(wl),this.clearAllSnapshots();const l=Ke.now();He.delta=Lt(0,1e3/60,l-He.timestamp),He.timestamp=l,He.isProcessing=!0,Fi.update.process(He),Fi.preRender.process(He),Fi.render.process(He),He.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Fs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach($g),this.sharedNodes.forEach(Jg)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ye.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ye.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!qe(this.snapshot.measuredBox.x)&&!qe(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d<this.path.length;d++)this.path[d].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Pe()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(l=!1),l&&this.instance){const d=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:d,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!i)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!$d(this.projectionDelta),d=this.getTransformTemplate(),c=d?d(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;a&&this.instance&&(l||tn(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const l=this.measurePageBox();let d=this.removeElementScroll(l);return a&&(d=this.removeTransform(d)),n0(d),{animationId:this.root.animationId,measuredBox:l,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:a}=this.options;if(!a)return Pe();const l=a.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(r0))){const{scroll:u}=this.root;u&&(Tt(l.x,u.offset.x),Tt(l.y,u.offset.y))}return l}removeElementScroll(a){var d;const l=Pe();if(gt(l,a),(d=this.scroll)!=null&&d.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:h,options:m}=u;u!==this.root&&h&&m.layoutScroll&&(h.wasRoot&&gt(l,a),Tt(l.x,h.offset.x),Tt(l.y,h.offset.y))}return l}applyTransform(a,l=!1,d){var u,h;const c=d||Pe();gt(c,a);for(let m=0;m<this.path.length;m++){const p=this.path[m];!l&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(Tt(c.x,-p.scroll.offset.x),Tt(c.y,-p.scroll.offset.y)),tn(p.latestValues)&&Hr(c,p.latestValues,(u=p.layout)==null?void 0:u.layoutBox)}return tn(this.latestValues)&&Hr(c,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),c}removeTransform(a){var d;const l=Pe();gt(l,a);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!tn(u.latestValues))continue;let h;u.instance&&(Io(u.latestValues)&&u.updateSnapshot(),h=Pe(),gt(h,u.measurePageBox())),fl(l,u.latestValues,(d=u.snapshot)==null?void 0:d.layoutBox,h)}return tn(this.latestValues)&&fl(l,this.latestValues),l}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==He.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var p;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const d=!!this.resumingFrom||this!==l;if(!(a||d&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:h}=this.options;if(!this.layout||!(u||h))return;this.resolvedRelativeTargetAt=He.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Pe(),this.targetWithTransforms=Pe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Cg(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):gt(this.target,this.layout.layoutBox),Dd(this.target,this.targetDelta)):gt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Io(this.parent.latestValues)||Id(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,l,d){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Pe(),this.relativeTargetOrigin=Pe(),ti(this.relativeTargetOrigin,l,d,this.options.layoutAnchor||void 0),gt(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var x;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let d=!0;if((this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty)&&(d=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(d=!1),this.resolvedRelativeTargetAt===He.timestamp&&(d=!1),d)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;gt(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;Qx(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=Pe());const{target:p}=a;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(sl(this.prevProjectionDelta.x,this.projectionDelta.x),sl(this.prevProjectionDelta.y,this.projectionDelta.y)),nr(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!gl(this.projectionDelta.x,this.prevProjectionDelta.x)||!gl(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),a){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ln(),this.projectionDelta=Ln(),this.projectionDeltaWithTransform=Ln()}setAnimationOrigin(a,l=!1){const d=this.snapshot,c=d?d.latestValues:{},u={...this.latestValues},h=Ln();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const m=Pe(),p=d?d.source:void 0,x=this.layout?this.layout.source:void 0,g=p!==x,v=this.getStack(),y=!v||v.members.length<=1,j=!!(g&&!y&&this.options.crossfade===!0&&!this.path.some(e0));this.animationProgress=0;let w;this.mixTargetDelta=A=>{const B=A/1e3;Cl(h.x,a.x,B),Cl(h.y,a.y,B),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ti(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Qg(this.relativeTarget,this.relativeTargetOrigin,m,B),w&&Eg(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Pe()),gt(w,this.relativeTarget)),g&&(this.animationValues=u,Lg(u,c,this.latestValues,B,j,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=B},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var l,d,c;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(c=(d=this.resumingFrom)==null?void 0:d.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Gt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ye.update(()=>{$r.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Pn(0)),this.motionValue.jump(0,!1),this.currentAnimation=Rg(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),a.onUpdate&&a.onUpdate(u)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(_g),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:d,layout:c,latestValues:u}=a;if(!(!l||!d||!c)){if(this!==a&&this.layout&&c&&Zd(this.options.animationType,this.layout.layoutBox,c.layoutBox)){d=this.target||Pe();const h=qe(this.layout.layoutBox.x);d.x.min=a.target.x.min,d.x.max=d.x.min+h;const m=qe(this.layout.layoutBox.y);d.y.min=a.target.y.min,d.y.max=d.y.min+m}gt(l,d),Hr(l,u),nr(this.projectionDeltaWithTransform,this.layoutCorrected,l,u)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new zg),this.sharedNodes.get(a).add(l);const c=l.options.initialPromotionConfig;l.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(l):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var l;const{layoutId:a}=this.options;return a?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:a}=this.options;return a?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:l,preserveFollowOpacity:d}={}){const c=this.getStack();c&&c.promote(this,d),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const{latestValues:d}=a;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(l=!0),!l)return;const c={};d.z&&zi("z",a,c,this.animationValues);for(let u=0;u<Oi.length;u++)zi(`rotate${Oi[u]}`,a,c,this.animationValues),zi(`skew${Oi[u]}`,a,c,this.animationValues);a.render();for(const u in c)a.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);a.scheduleRender()}applyProjectionStyles(a,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const d=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=Ur(l==null?void 0:l.pointerEvents)||"",a.transform=d?d(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=Ur(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!tn(this.latestValues)&&(a.transform=d?d({},""):"none",this.hasProjected=!1);return}a.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let h=Fg(this.projectionDeltaWithTransform,this.treeScale,u);d&&(h=d(u,h)),a.transform=h;const{x:m,y:p}=this.projectionDelta;a.transformOrigin=`${m.origin*100}% ${p.origin*100}% 0`,c.animationValues?a.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:a.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const x in Ro){if(u[x]===void 0)continue;const{correct:g,applyTo:v,isCSSVariable:y}=Ro[x],j=h==="none"?u[x]:g(u[x],c);if(v){const w=v.length;for(let A=0;A<w;A++)a[v[A]]=j}else y?this.options.visualElement.renderState.vars[x]=j:a[x]=j}this.options.layoutId&&(a.pointerEvents=c===this?Ur(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var l;return(l=a.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(kl),this.root.sharedNodes.clear()}}}function Vg(e){e.updateLayout()}function Wg(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,a=t.source!==e.layout.source;if(s==="size")Ct(h=>{const m=a?t.measuredBox[h]:t.layoutBox[h],p=qe(m);m.min=r[h].min,m.max=m.min+p});else if(s==="x"||s==="y"){const h=s==="x"?"y":"x";Mo(a?t.measuredBox[h]:t.layoutBox[h],r[h])}else Zd(s,t.layoutBox,r)&&Ct(h=>{const m=a?t.measuredBox[h]:t.layoutBox[h],p=qe(r[h]);m.max=m.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+p)});const l=Ln();nr(l,r,t.layoutBox);const d=Ln();a?nr(d,e.applyTransform(i,!0),t.measuredBox):nr(d,r,t.layoutBox);const c=!$d(l);let u=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:m,layout:p}=h;if(m&&p){const x=e.options.layoutAnchor||void 0,g=Pe();ti(g,t.layoutBox,m.layoutBox,x);const v=Pe();ti(v,r,p.layoutBox,x),Gd(g,v)||(u=!0),h.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=g,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:d,layoutDelta:l,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Hg(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Ug(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function $g(e){e.clearSnapshot()}function kl(e){e.clearMeasurements()}function Gg(e){e.isLayoutDirty=!0,e.updateLayout()}function wl(e){e.isLayoutDirty=!1}function Yg(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Kg(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Sl(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function qg(e){e.resolveTargetDelta()}function Xg(e){e.calcProjection()}function Zg(e){e.resetSkewAndRotation()}function Jg(e){e.removeLeadSnapshot()}function Cl(e,t,n){e.translate=we(t.translate,0,n),e.scale=we(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function jl(e,t,n,r){e.min=we(t.min,n.min,r),e.max=we(t.max,n.max,r)}function Qg(e,t,n,r){jl(e.x,t.x,n.x,r),jl(e.y,t.y,n.y,r)}function e0(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const t0={duration:.45,ease:[.4,0,.1,1]},Tl=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Bl=Tl("applewebkit/")&&!Tl("chrome/")?Math.round:ft;function El(e){e.min=Bl(e.min),e.max=Bl(e.max)}function n0(e){El(e.x),El(e.y)}function Zd(e,t,n){return e==="position"||e==="preserve-aspect"&&!Sg(xl(t),xl(n),.2)}function r0(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const i0=Xd({attachResizeListener:(e,t)=>ur(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),_i={current:void 0},Jd=Xd({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!_i.current){const e=new i0({});e.mount(window),e.setOptions({layoutScroll:!0}),_i.current=e}return _i.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ps=k.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Fl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function o0(...e){return t=>{let n=!1;const r=e.map(i=>{const s=Fl(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():Fl(e[i],null)}}}}function s0(...e){return je.useCallback(o0(...e),e)}class a0 extends je.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(_r(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,i=_r(r)&&r.offsetWidth||0,s=_r(r)&&r.offsetHeight||0,a=getComputedStyle(n),l=this.props.sizeRef.current;l.height=parseFloat(a.height),l.width=parseFloat(a.width),l.top=n.offsetTop,l.left=n.offsetLeft,l.right=i-l.width-l.left,l.bottom=s-l.height-l.top}return null}componentDidUpdate(){}render(){return this.props.children}}function l0({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:s}){var m;const a=k.useId(),l=k.useRef(null),d=k.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=k.useContext(Ps),u=((m=e.props)==null?void 0:m.ref)??(e==null?void 0:e.ref),h=s0(l,u);return k.useInsertionEffect(()=>{const{width:p,height:x,top:g,left:v,right:y,bottom:j}=d.current;if(t||s===!1||!l.current||!p||!x)return;const w=n==="left"?`left: ${v}`:`right: ${y}`,A=r==="bottom"?`bottom: ${j}`:`top: ${g}`;l.current.dataset.motionPopId=a;const B=document.createElement("style");c&&(B.nonce=c);const C=i??document.head;return C.appendChild(B),B.sheet&&B.sheet.insertRule(`
343
+ `),disabled:n,title:"Markdown Blockquote",accentColor:t,children:"> Quote"})]})}),s&&o.jsx(cm,{currentMode:i,onSelectMode:a,accentColor:t,disabled:n})]})}const dm={bold:!0,italic:!0,underline:!0,strikethrough:!0,headings:!0,bulletList:!0,orderedList:!0,quote:!0,link:!0,textAlign:!0,clearFormat:!0};function us({id:e,name:t,value:n,defaultValue:r,onChange:i,onMarkdownChange:s,onHtmlChange:a,outputFormat:l="html",defaultMode:d="wysiwyg",mode:c,onModeChange:u,showModeToggle:h=!0,placeholder:m="Start typing...",label:p,helperText:x,errorMessage:g,isInvalid:v=!1,disabled:y=!1,colorScheme:j="blue",minHeight:w="180px",maxHeight:A="400px",maxLength:B,showCharCount:C=!1,toolbarOptions:O,className:E,storageKey:F,persistDraft:L=!0,debounceMs:R=400,draftMaxAgeMs:D=10080*60*1e3,showDraftStatus:N=!1,onDraftRestored:P}){const[I,M]=k.useState(!1),[U,G]=k.useState(d),H=c!==void 0?c:U,b=n!==void 0,W=Kp[j],ne={...dm,...O},T=k.useMemo(()=>vu(F,e,t,p),[F,e,t,p]),[be,ke]=k.useState("idle"),J=k.useRef(null),X=k.useRef(null),te=k.useRef(!1),de=k.useCallback((Q,se,he)=>{if(!L||y)return;if(!Q||Q==="<p></p>"||Q.trim()===""){X.current&&(clearTimeout(X.current),X.current=null),J.current=null,ku(T),ke("idle");return}J.current={content:Q,mode:se,format:he},ke("saving"),X.current&&clearTimeout(X.current),X.current=setTimeout(()=>{J.current&&(ho(T,{content:J.current.content,mode:J.current.mode,format:J.current.format,updatedAt:Date.now(),version:1}),J.current=null,ke("saved"))},R)},[L,y,T,R]);k.useEffect(()=>{if(!L)return;const Q=()=>{X.current&&(clearTimeout(X.current),X.current=null),J.current&&(ho(T,{content:J.current.content,mode:J.current.mode,format:J.current.format,updatedAt:Date.now(),version:1}),J.current=null,ke("saved"))};return typeof window<"u"&&(window.addEventListener("beforeunload",Q),window.addEventListener("pagehide",Q)),()=>{typeof window<"u"&&(window.removeEventListener("beforeunload",Q),window.removeEventListener("pagehide",Q)),Q()}},[L,T]);const[ee,Ce]=k.useState(()=>{const Q=b?n:r??"";return l==="markdown"?Q:jn(Q)}),De=k.useRef(null);k.useEffect(()=>{qp()},[]);const ue=pa.useEditor({extensions:[Eh.configure({heading:{levels:[1,2,3]}}),Ah,Fh.configure({openOnClick:!1,HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}}),Lh.configure({types:["heading","paragraph"]}),Ih.configure({placeholder:m})],content:b?l==="markdown"?Mt(n??""):n??"":r?l==="markdown"?Mt(r):r:"",editable:!y,editorProps:{attributes:{spellcheck:"true"}},onUpdate({editor:Q}){const se=Q.getHTML(),he=se==="<p></p>"?"":se,Se=jn(he);a==null||a(he),s==null||s(Se);const Oe=l==="markdown"?Se:he;B!==void 0&&Q.getText().length>B||(i==null||i(Oe),de(Oe,"wysiwyg",l))},onFocus(){M(!0)},onBlur(){M(!1)}});k.useEffect(()=>{if(!ue||te.current||!L||y)return;te.current=!0;const Q=wu(T,D);if(!Q||!Q.content||Q.content==="<p></p>"||Q.content.trim()===""||b&&n&&n.trim()!==""&&n!=="<p></p>"&&n===Q.content)return;const se=Q.format==="markdown",he=Q.content;if(se){const Se=Mt(he);Ce(he),ue.commands.setContent(Se,{emitUpdate:!1}),s==null||s(he),a==null||a(Se),i==null||i(l==="markdown"?he:Se)}else{const Se=he==="<p></p>"?"":he,Oe=jn(Se);Ce(Oe),ue.commands.setContent(Se,{emitUpdate:!1}),a==null||a(Se),s==null||s(Oe),i==null||i(l==="markdown"?Oe:Se)}Q.mode&&Q.mode!==H&&h&&(c===void 0&&G(Q.mode),u==null||u(Q.mode)),ke("saved"),P==null||P(Q)},[ue,L,y,T,D,b,n,l,H,h,c,i,a,s,u,P]);const hn=Q=>{if(Q!==H){if(Q==="markdown"){const se=ue?ue.getHTML():"",he=jn(se==="<p></p>"?"":se);Ce(he),L&&de(l==="markdown"?he:se,"markdown",l)}else{const se=Mt(ee);ue&&ue.commands.setContent(se,{emitUpdate:!1}),L&&de(l==="markdown"?ee:se,"wysiwyg",l)}c===void 0&&G(Q),u==null||u(Q)}},Ot=Q=>{const se=Q.target.value;Ce(se);const he=Mt(se);s==null||s(se),a==null||a(he);const Se=l==="markdown"?se:he;B!==void 0&&se.length>B||(i==null||i(Se),ue&&ue.commands.setContent(he,{emitUpdate:!1}),de(Se,"markdown",l))},qt=Q=>{const se=De.current;if(!se){Ce(Y=>{const re=Y+Q;return de(l==="markdown"?re:Mt(re),"markdown",l),re});return}const he=se.selectionStart,Se=se.selectionEnd,Oe=se.value,pt=Oe.substring(0,he)+Q+Oe.substring(Se);Ce(pt);const vt=Mt(pt);s==null||s(pt),a==null||a(vt);const z=l==="markdown"?pt:vt;i==null||i(z),ue&&ue.commands.setContent(vt,{emitUpdate:!1}),de(z,"markdown",l),setTimeout(()=>{se.focus(),se.setSelectionRange(he+Q.length,he+Q.length)},50)};k.useEffect(()=>{if(b)if(l==="markdown"){const Q=n??"";if(Ce(Q),ue){const se=Mt(Q);ue.getHTML()!==se&&ue.commands.setContent(se,{emitUpdate:!1})}}else{const Q=n===""?"<p></p>":n??"<p></p>";ue&&ue.getHTML()!==Q&&ue.commands.setContent(Q,{emitUpdate:!1}),Ce(jn(n??""))}},[ue,b,n,l]);const zt=H==="markdown"?ee.length:(ue==null?void 0:ue.getText().length)??0,lt=v?"#DC2626":I?W.base:"var(--medix-form-border)";return o.jsxs(f.Box,{w:"100%",className:E,children:[p&&o.jsx(f.Text,{mb:"1.5",fontSize:"sm",fontWeight:"500",fontFamily:"var(--font-body)",color:"text.heading",children:p}),o.jsxs(f.Box,{borderRadius:"md",overflow:"hidden",bg:"bg.surface",opacity:y?.6:1,style:{border:`1.5px solid ${lt}`,transition:"border-color 0.15s ease",boxShadow:"none",background:"var(--medix-form-bg)"},children:[o.jsx(um,{editor:ue,accentColor:W.base,disabled:y,opts:ne,mode:H,showModeToggle:h,onModeChange:hn,onInsertMarkdown:qt}),H==="wysiwyg"?o.jsx(f.Box,{className:"medix-rte-content",style:{minHeight:w,maxHeight:A,overflowY:"auto"},_dark:{color:"var(--medix-form-text)"},children:o.jsx(pa.EditorContent,{editor:ue})}):o.jsx("textarea",{ref:De,value:ee,onChange:Ot,placeholder:m,disabled:y,onFocus:()=>M(!0),onBlur:()=>M(!1),style:{width:"100%",minHeight:w,maxHeight:A,padding:"12px 16px",fontFamily:"var(--font-mono, monospace)",fontSize:"13px",lineHeight:"1.6",background:"var(--medix-form-bg)",color:"var(--medix-form-text)",border:"none",outline:"none",resize:"vertical"}}),(C||B||N&&be!=="idle")&&o.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:N&&be!=="idle"?"space-between":B?"flex-end":"flex-start",px:"3",py:"1.5",borderTop:"1px solid",borderColor:"border",style:{borderTopColor:"var(--medix-form-border)",background:"var(--medix-form-bg)"},children:[N&&be!=="idle"?o.jsxs(f.Box,{display:"inline-flex",alignItems:"center",gap:"1.5",children:[o.jsx(f.Box,{w:"1.5",h:"1.5",borderRadius:"full",bg:be==="saving"?"orange.400":"green.500"}),o.jsx(f.Text,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:be==="saving"?"Saving draft...":"Draft saved"})]}):o.jsx(f.Box,{}),(C||B)&&o.jsxs(f.Text,{fontSize:"xs",color:B&&zt>B?"red.500":"text.muted",fontFamily:"var(--font-body)",children:[zt,B?` / ${B}`:""," characters"]})]})]}),x&&!v&&o.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:x}),v&&g&&o.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:"red.500",fontFamily:"var(--font-body)",children:g})]})}const fm=us;us.displayName="MedixRichTextInput";const Su=k.forwardRef(({noPadding:e=!1,hoverable:t=!1,children:n,...r},i)=>o.jsx(f.Box,{ref:i,bg:"bg.surface",borderRadius:"card",border:"1px solid",borderColor:"border",boxShadow:"none",_dark:{boxShadow:"none"},overflow:"hidden",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",...t&&{_hover:{transform:"translateY(-2px)",boxShadow:"none",borderColor:"blue.200"},cursor:"pointer"},...r,children:k.Children.map(n,s=>s||null)}));Su.displayName="MedixCard";function hm({title:e,subtitle:t,action:n,children:r,...i}){return o.jsxs(f.Box,{px:"6",py:"4",borderBottom:"1px solid",borderColor:"border",display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"4",...i,children:[o.jsxs(f.Box,{flex:"1",children:[e&&o.jsx(f.Box,{as:"h3",fontSize:"lg",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",lineHeight:"1.3",children:e}),t&&o.jsx(f.Box,{as:"p",mt:"0.5",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:t}),r]}),n&&o.jsx(f.Box,{flexShrink:0,children:n})]})}function pm({children:e,...t}){return o.jsx(f.Box,{px:"6",py:"5",...t,children:e})}function mm({children:e,...t}){return o.jsx(f.Box,{px:"6",py:"4",borderTop:"1px solid",borderColor:"border",display:"flex",alignItems:"center",gap:"3",...t,children:e})}const Cu=k.forwardRef(({value:e,label:t,unit:n,change:r,trend:i,icon:s,accentColor:a="blue.500",...l},d)=>{const c=i??(r!==void 0?r>=0?"up":"down":"neutral"),u=c==="up"?"green.500":c==="down"?"red.500":"text.muted";return o.jsxs(f.Box,{ref:d,bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",p:"6",boxShadow:"none",_dark:{boxShadow:"none"},...l,children:[s&&o.jsx(f.Box,{w:"10",h:"10",borderRadius:"md",bg:`${a.split(".")[0]}.100`,color:a,display:"flex",alignItems:"center",justifyContent:"center",mb:"3",fontSize:"xl",children:s}),o.jsxs(f.Box,{fontSize:"4xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",lineHeight:"1.1",children:[e,n&&o.jsx(f.Box,{as:"span",fontSize:"xl",fontWeight:"medium",color:"text.muted",ml:"1",children:n})]}),o.jsx(f.Box,{mt:"1",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:t}),r!==void 0&&o.jsxs(f.Box,{mt:"2",display:"inline-flex",alignItems:"center",gap:"1",fontSize:"xs",fontWeight:"medium",color:u,children:[o.jsx(f.Box,{as:"span",children:c==="up"?"↑":c==="down"?"↓":"→"}),o.jsxs(f.Box,{as:"span",children:[Math.abs(r),"%"]})]})]})});Cu.displayName="MedixStatCard";const xm={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1440px",full:"100%"},ju=k.forwardRef(({maxWidth:e="xl",children:t,...n},r)=>o.jsx(f.Box,{ref:r,w:"100%",maxW:xm[e],mx:"auto",px:{base:"4",md:"6",lg:"8"},...n,children:t}));ju.displayName="MedixContainer";function gm({eyebrow:e,title:t,description:n,align:r="center",action:i,eyebrowColor:s="blue.500",...a}){const l=r,d=r==="center"?"center":r==="right"?"flex-end":"flex-start";return o.jsxs(f.Box,{display:"flex",flexDirection:"column",alignItems:d,textAlign:l,gap:"3",...a,children:[e&&o.jsx(f.Box,{as:"span",fontSize:"md",fontWeight:"bold",color:s,letterSpacing:"wider",textTransform:"uppercase",fontFamily:"var(--font-body)",children:e}),o.jsx(f.Box,{as:"h2",fontSize:{base:"3xl",md:"4xl"},fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",lineHeight:"snug",maxW:r==="center"?"720px":void 0,children:t}),n&&o.jsx(f.Box,{as:"p",fontSize:"md",color:"text.body",fontFamily:"var(--font-body)",lineHeight:"loose",maxW:r==="center"?"640px":void 0,children:n}),i&&o.jsx(f.Box,{mt:"2",children:i})]})}const ym=["light","dark"],bm={light:{label:"Light mode",canvas:V.neutralLight.bg.value,surface:V.neutralLight.surface.value,border:V.neutralLight.border.value,text:V.neutralLight.heading.value,muted:V.neutralLight.body.value},dark:{label:"Dark mode",canvas:V.neutralDark.bg.value,surface:V.neutralDark.surface.value,border:V.neutralDark.border.value,text:V.neutralDark.heading.value,muted:V.neutralDark.body.value}};function Jt(e,t){return Object.entries(t).map(([n,r])=>({token:`${e}.${n}`,value:r.value}))}const vm=[{title:"Foundation semantics",description:"Core app backgrounds, text, borders, and brand tokens that shift with light and dark mode.",tokens:[{token:"bg",description:"Page background",preview:"fill",light:V.neutralLight.bg.value,dark:V.neutralDark.bg.value},{token:"bg.subtle",description:"Subtle background",preview:"fill",light:V.neutralLight.bg2.value,dark:V.neutralDark.bg2.value},{token:"bg.surface",description:"Surface and card background",preview:"fill",light:V.neutralLight.surface.value,dark:V.neutralDark.surface.value},{token:"text.heading",description:"Primary heading text",preview:"text",light:V.neutralLight.heading.value,dark:V.neutralDark.heading.value},{token:"text.body",description:"Default body text",preview:"text",light:V.neutralLight.body.value,dark:V.neutralDark.body.value},{token:"text.muted",description:"Muted helper text",preview:"text",light:V.neutralLight.muted.value,dark:V.neutralDark.muted.value},{token:"border",description:"Default border color",preview:"border",light:V.neutralLight.border.value,dark:V.neutralDark.border.value},{token:"brand.solid",description:"Primary accent fill",preview:"fill",light:V.blue[500].value,dark:V.blue[500].value},{token:"brand.muted",description:"Muted brand accent",preview:"fill",light:V.blue[100].value,dark:V.blue[900].value},{token:"brand.contrast",description:"High-contrast brand foreground",preview:"fill",light:"#FFFFFF",dark:"#FFFFFF"}]},{title:"Status semantics",description:"System feedback colors used for success, warning, and error states.",tokens:[{token:"status.success",description:"Success foreground",preview:"fill",light:V.green[500].value,dark:V.green[500].value},{token:"status.success.tint",description:"Success tint background",preview:"fill",light:V.green[100].value,dark:"rgba(27, 122, 56, 0.2)"},{token:"status.warning",description:"Warning foreground",preview:"fill",light:V.amber[500].value,dark:V.amber[500].value},{token:"status.warning.tint",description:"Warning tint background",preview:"fill",light:V.amber[100].value,dark:"rgba(217, 119, 6, 0.2)"},{token:"status.error",description:"Error foreground",preview:"fill",light:V.red[500].value,dark:V.red[500].value},{token:"status.error.tint",description:"Error tint background",preview:"fill",light:V.red[100].value,dark:"rgba(220, 38, 38, 0.2)"}]},{title:"Blue semantic palette",description:"Semantic blue scale and utility tokens used by Chakra-aware theme props.",tokens:[{token:"blue.50",description:"Blue scale 50",preview:"fill",light:V.blue[50].value,dark:V.blue[50].value},{token:"blue.100",description:"Blue scale 100",preview:"fill",light:V.blue[100].value,dark:V.blue[100].value},{token:"blue.200",description:"Blue scale 200",preview:"fill",light:V.blue[200].value,dark:V.blue[200].value},{token:"blue.300",description:"Blue scale 300",preview:"fill",light:V.blue[300].value,dark:V.blue[300].value},{token:"blue.400",description:"Blue scale 400",preview:"fill",light:V.blue[400].value,dark:V.blue[400].value},{token:"blue.500",description:"Blue scale 500",preview:"fill",light:V.blue[500].value,dark:V.blue[500].value},{token:"blue.600",description:"Blue scale 600",preview:"fill",light:V.blue[600].value,dark:V.blue[600].value},{token:"blue.700",description:"Blue scale 700",preview:"fill",light:V.blue[700].value,dark:V.blue[700].value},{token:"blue.800",description:"Blue scale 800",preview:"fill",light:V.blue[800].value,dark:V.blue[800].value},{token:"blue.900",description:"Blue scale 900",preview:"fill",light:V.blue[900].value,dark:V.blue[900].value},{token:"blue.solid",description:"Default solid blue accent",preview:"fill",light:V.blue[500].value,dark:V.blue[500].value},{token:"blue.contrast",description:"High-contrast content on blue",preview:"fill",light:"#FFFFFF",dark:"#FFFFFF"},{token:"blue.muted",description:"Muted blue background",preview:"fill",light:V.blue[100].value,dark:V.blue[900].value},{token:"blue.subtle",description:"Subtle blue background",preview:"fill",light:V.blue[50].value,dark:"rgba(6, 133, 255, 0.1)"},{token:"blue.emphasized",description:"Emphasized blue background",preview:"fill",light:V.blue[100].value,dark:V.blue[800].value},{token:"blue.fg",description:"Readable blue foreground",preview:"text",light:V.blue[700].value,dark:V.blue[300].value},{token:"blue.focusRing",description:"Blue focus ring",preview:"border",light:V.blue[500].value,dark:V.blue[500].value}]},{title:"Purple semantic palette",description:"Semantic purple scale and utility tokens used by Chakra-aware theme props.",tokens:[{token:"purple.50",description:"Purple scale 50",preview:"fill",light:V.purple[50].value,dark:V.purple[50].value},{token:"purple.100",description:"Purple scale 100",preview:"fill",light:V.purple[100].value,dark:V.purple[100].value},{token:"purple.500",description:"Purple scale 500",preview:"fill",light:V.purple[500].value,dark:V.purple[500].value},{token:"purple.600",description:"Purple scale 600",preview:"fill",light:V.purple[600].value,dark:V.purple[600].value},{token:"purple.solid",description:"Default solid purple accent",preview:"fill",light:V.purple[500].value,dark:V.purple[500].value},{token:"purple.contrast",description:"High-contrast content on purple",preview:"fill",light:"#FFFFFF",dark:"#FFFFFF"},{token:"purple.muted",description:"Muted purple background",preview:"fill",light:V.purple[100].value,dark:V.purple[900].value},{token:"purple.subtle",description:"Subtle purple background",preview:"fill",light:V.purple[50].value,dark:"rgba(119, 0, 204, 0.1)"},{token:"purple.emphasized",description:"Emphasized purple background",preview:"fill",light:V.purple[100].value,dark:V.purple[100].value},{token:"purple.fg",description:"Readable purple foreground",preview:"text",light:V.purple[700].value,dark:V.purple[300].value},{token:"purple.focusRing",description:"Purple focus ring",preview:"border",light:V.purple[500].value,dark:V.purple[500].value}]}],km=[{title:"Brand blue tokens",description:"Raw MedixDeck primary blue scale.",tokens:Jt("brand.blue",V.blue)},{title:"Brand purple tokens",description:"Raw MedixDeck secondary purple scale.",tokens:Jt("brand.purple",V.purple)},{title:"Status green tokens",description:"Raw success scale tokens.",tokens:Jt("brand.green",V.green)},{title:"Status amber tokens",description:"Raw warning scale tokens.",tokens:Jt("brand.amber",V.amber)},{title:"Status red tokens",description:"Raw error scale tokens.",tokens:Jt("brand.red",V.red)},{title:"Neutral light tokens",description:"Raw light-mode neutrals.",tokens:Jt("brand.neutralLight",V.neutralLight)},{title:"Neutral dark tokens",description:"Raw dark-mode neutrals.",tokens:Jt("brand.neutralDark",V.neutralDark)}];function wm({mode:e,token:t}){const n=bm[e],r=e==="light"?t.light:t.dark,i={minH:"88px",borderRadius:"md",border:"1px solid",borderColor:n.border,bg:n.canvas,display:"flex",alignItems:"center",justifyContent:"center",px:"4"};return o.jsxs(f.Box,{border:"1px solid",borderColor:n.border,borderRadius:"lg",bg:n.surface,p:"3",children:[o.jsx(f.Text,{fontSize:"xs",fontWeight:"600",color:n.text,fontFamily:"var(--font-heading)",mb:"2",children:n.label}),t.preview==="text"?o.jsx(f.Box,{...i,children:o.jsx(f.Text,{color:r,fontSize:"sm",fontWeight:"600",fontFamily:"var(--font-heading)",children:"Aa MedixDeck"})}):t.preview==="border"?o.jsx(f.Box,{...i,children:o.jsx(f.Box,{w:"100%",maxW:"140px",h:"48px",borderRadius:"md",border:"2px solid",borderColor:r,bg:n.canvas})}):o.jsx(f.Box,{...i,bg:r,borderColor:r===n.canvas||r==="#FFFFFF"?n.border:"transparent"}),o.jsx(f.Text,{mt:"2",fontSize:"xs",color:n.muted,fontFamily:"var(--font-mono)",children:r})]})}const Tu=k.forwardRef(({showSemanticTokens:e=!0,showPrimitiveTokens:t=!0,...n},r)=>o.jsxs(f.Box,{ref:r,display:"flex",flexDirection:"column",gap:"8",...n,children:[o.jsx(f.Box,{children:o.jsx(f.Text,{fontSize:"sm",color:"text.body",fontFamily:"var(--font-body)",maxW:"4xl",children:"Browse the full MedixDeck color system in one place. Semantic tokens are rendered side by side for light and dark mode, while raw palettes expose every underlying brand and status scale used by the theme."})}),e&&o.jsx(f.Box,{display:"flex",flexDirection:"column",gap:"6",children:vm.map(i=>o.jsxs(f.Box,{children:[o.jsx(f.Text,{fontSize:"lg",fontWeight:"600",color:"text.heading",fontFamily:"var(--font-heading)",children:i.title}),o.jsx(f.Text,{mt:"1",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:i.description}),o.jsx(f.SimpleGrid,{columns:{base:1,xl:2},gap:"4",mt:"4",children:i.tokens.map(s=>o.jsxs(f.Box,{border:"1px solid",borderColor:"border",borderRadius:"xl",bg:"bg.surface",p:"4",children:[o.jsx(f.Text,{fontSize:"sm",fontWeight:"700",color:"text.heading",fontFamily:"var(--font-heading)",children:s.token}),o.jsx(f.Text,{mt:"1",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:s.description}),o.jsx(f.SimpleGrid,{columns:{base:1,md:2},gap:"3",mt:"4",children:ym.map(a=>o.jsx(wm,{mode:a,token:s},`${s.token}-${a}`))})]},s.token))})]},i.title))}),t&&o.jsx(f.Box,{display:"flex",flexDirection:"column",gap:"6",children:km.map(i=>o.jsxs(f.Box,{children:[o.jsx(f.Text,{fontSize:"lg",fontWeight:"600",color:"text.heading",fontFamily:"var(--font-heading)",children:i.title}),o.jsx(f.Text,{mt:"1",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:i.description}),o.jsx(f.SimpleGrid,{columns:{base:1,sm:2,lg:3,xl:4},gap:"4",mt:"4",children:i.tokens.map(s=>o.jsxs(f.Box,{border:"1px solid",borderColor:"border",borderRadius:"xl",overflow:"hidden",bg:"bg.surface",children:[o.jsx(f.Box,{h:"72px",bg:s.value,borderBottom:"1px solid",borderColor:s.value==="#FFFFFF"||s.value===V.neutralLight.bg.value?"border":"transparent"}),o.jsxs(f.Box,{p:"4",children:[o.jsx(f.Text,{fontSize:"sm",fontWeight:"600",color:"text.heading",fontFamily:"var(--font-heading)",children:s.token}),o.jsx(f.Text,{mt:"1",fontSize:"xs",color:"text.muted",fontFamily:"var(--font-mono)",children:s.value})]})]},s.token))})]},i.title))})]}));Tu.displayName="MedixThemeColorPalette";const ds=k.createContext({});function fs(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const Sm=typeof window<"u",Bu=Sm?k.useLayoutEffect:k.useEffect,fi=k.createContext(null);function hs(e,t){e.indexOf(t)===-1&&e.push(t)}function Kr(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Lt=(e,t,n)=>n>t?t:n<e?e:n;function po(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let On=()=>{},Pt=()=>{};var Zc;typeof process<"u"&&((Zc=process.env)==null?void 0:Zc.NODE_ENV)!=="production"&&(On=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(po(t,n))},Pt=(e,t,n)=>{if(!e)throw new Error(po(t,n))});const $t={},Eu=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Fu(e){return typeof e=="object"&&e!==null}const Au=e=>/^0[^.\s]+$/u.test(e);function Lu(e){let t;return()=>(t===void 0&&(t=e()),t)}const ft=e=>e,Cm=(e,t)=>n=>t(e(n)),pr=(...e)=>e.reduce(Cm),ar=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class ps{constructor(){this.subscriptions=[]}add(t){return hs(this.subscriptions,t),()=>Kr(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const a=this.subscriptions[s];a&&a(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const et=e=>e*1e3,dt=e=>e/1e3;function Iu(e,t){return t?e*(1e3/t):0}const Ba=new Set;function ms(e,t,n){e||Ba.has(t)||(console.warn(po(t,n)),Ba.add(t))}const Du=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,jm=1e-7,Tm=12;function Bm(e,t,n,r,i){let s,a,l=0;do a=t+(n-t)/2,s=Du(a,r,i)-e,s>0?n=a:t=a;while(Math.abs(s)>jm&&++l<Tm);return a}function mr(e,t,n,r){if(e===t&&n===r)return ft;const i=s=>Bm(s,0,1,e,n);return s=>s===0||s===1?s:Du(i(s),t,r)}const Ru=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Mu=e=>t=>1-e(1-t),Pu=mr(.33,1.53,.69,.99),xs=Mu(Pu),Ou=Ru(xs),zu=e=>e>=1?1:(e*=2)<1?.5*xs(e):.5*(2-Math.pow(2,-10*(e-1))),gs=e=>1-Math.sin(Math.acos(e)),_u=Mu(gs),Nu=Ru(gs),Em=mr(.42,0,1,1),Fm=mr(0,0,.58,1),Vu=mr(.42,0,.58,1),Am=e=>Array.isArray(e)&&typeof e[0]!="number",Wu=e=>Array.isArray(e)&&typeof e[0]=="number",Ea={linear:ft,easeIn:Em,easeInOut:Vu,easeOut:Fm,circIn:gs,circInOut:Nu,circOut:_u,backIn:xs,backInOut:Ou,backOut:Pu,anticipate:zu},Lm=e=>typeof e=="string",Fa=e=>{if(Wu(e)){Pt(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,i]=e;return mr(t,n,r,i)}else if(Lm(e))return Pt(Ea[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Ea[e];return e},Tr=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Im(e,t){let n=new Set,r=new Set,i=!1,s=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function d(u){a.has(u)&&(c.schedule(u),e()),u(l)}const c={schedule:(u,h=!1,m=!1)=>{const x=m&&i?n:r;return h&&a.add(u),x.add(u),u},cancel:u=>{r.delete(u),a.delete(u)},process:u=>{if(l=u,i){s=!0;return}i=!0;const h=n;n=r,r=h,n.forEach(d),n.clear(),i=!1,s&&(s=!1,c.process(u))}};return c}const Dm=40;function Hu(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,a=Tr.reduce((w,A)=>(w[A]=Im(s),w),{}),{setup:l,read:d,resolveKeyframes:c,preUpdate:u,update:h,preRender:m,render:p,postRender:x}=a,g=()=>{const w=$t.useManualTiming,A=w?i.timestamp:performance.now();n=!1,w||(i.delta=r?1e3/60:Math.max(Math.min(A-i.timestamp,Dm),1)),i.timestamp=A,i.isProcessing=!0,l.process(i),d.process(i),c.process(i),u.process(i),h.process(i),m.process(i),p.process(i),x.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(g))},v=()=>{n=!0,r=!0,i.isProcessing||e(g)};return{schedule:Tr.reduce((w,A)=>{const B=a[A];return w[A]=(C,O=!1,E=!1)=>(n||v(),B.schedule(C,O,E)),w},{}),cancel:w=>{for(let A=0;A<Tr.length;A++)a[Tr[A]].cancel(w)},state:i,steps:a}}const{schedule:ye,cancel:Gt,state:He,steps:Ai}=Hu(typeof requestAnimationFrame<"u"?requestAnimationFrame:ft,!0);let zr;function Rm(){zr=void 0}const Ke={now:()=>(zr===void 0&&Ke.set(He.isProcessing||$t.useManualTiming?He.timestamp:performance.now()),zr),set:e=>{zr=e,queueMicrotask(Rm)}},Uu=e=>t=>typeof t=="string"&&t.startsWith(e),$u=Uu("--"),Mm=Uu("var(--"),ys=e=>Mm(e)?Pm.test(e.split("/*")[0].trim()):!1,Pm=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Aa(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const zn={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},lr={...zn,transform:e=>Lt(0,1,e)},Br={...zn,default:1},tr=e=>Math.round(e*1e5)/1e5,bs=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Om(e){return e==null}const zm=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,vs=(e,t)=>n=>!!(typeof n=="string"&&zm.test(n)&&n.startsWith(e)||t&&!Om(n)&&Object.prototype.hasOwnProperty.call(n,t)),Gu=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,a,l]=r.match(bs);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},_m=e=>Lt(0,255,e),Li={...zn,transform:e=>Math.round(_m(e))},nn={test:vs("rgb","red"),parse:Gu("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Li.transform(e)+", "+Li.transform(t)+", "+Li.transform(n)+", "+tr(lr.transform(r))+")"};function Nm(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const mo={test:vs("#"),parse:Nm,transform:nn.transform},xr=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Wt=xr("deg"),Ft=xr("%"),q=xr("px"),Vm=xr("vh"),Wm=xr("vw"),La={...Ft,parse:e=>Ft.parse(e)/100,transform:e=>Ft.transform(e*100)},En={test:vs("hsl","hue"),parse:Gu("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ft.transform(tr(t))+", "+Ft.transform(tr(n))+", "+tr(lr.transform(r))+")"},Ae={test:e=>nn.test(e)||mo.test(e)||En.test(e),parse:e=>nn.test(e)?nn.parse(e):En.test(e)?En.parse(e):mo.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?nn.transform(e):En.transform(e),getAnimatableNone:e=>{const t=Ae.parse(e);return t.alpha=0,Ae.transform(t)}},Hm=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Um(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(bs))==null?void 0:t.length)||0)+(((n=e.match(Hm))==null?void 0:n.length)||0)>0}const Yu="number",Ku="color",$m="var",Gm="var(",Ia="${}",Ym=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Mn(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const l=t.replace(Ym,d=>(Ae.test(d)?(r.color.push(s),i.push(Ku),n.push(Ae.parse(d))):d.startsWith(Gm)?(r.var.push(s),i.push($m),n.push(d)):(r.number.push(s),i.push(Yu),n.push(parseFloat(d))),++s,Ia)).split(Ia);return{values:n,split:l,indexes:r,types:i}}function Km(e){return Mn(e).values}function qu({split:e,types:t}){const n=e.length;return r=>{let i="";for(let s=0;s<n;s++)if(i+=e[s],r[s]!==void 0){const a=t[s];a===Yu?i+=tr(r[s]):a===Ku?i+=Ae.transform(r[s]):i+=r[s]}return i}}function qm(e){return qu(Mn(e))}const Xm=e=>typeof e=="number"?0:Ae.test(e)?Ae.getAnimatableNone(e):e,Zm=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:Xm(e);function Jm(e){const t=Mn(e);return qu(t)(t.values.map((r,i)=>Zm(r,t.split[i])))}const bt={test:Um,parse:Km,createTransformer:qm,getAnimatableNone:Jm};function Ii(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Qm({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,a=0;if(!t)i=s=a=n;else{const l=n<.5?n*(1+t):n+t-n*t,d=2*n-l;i=Ii(d,l,e+1/3),s=Ii(d,l,e),a=Ii(d,l,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:r}}function qr(e,t){return n=>n>0?t:e}const we=(e,t,n)=>e+(t-e)*n,Di=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},e1=[mo,nn,En],t1=e=>e1.find(t=>t.test(e));function Da(e){const t=t1(e);if(On(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===En&&(n=Qm(n)),n}const Ra=(e,t)=>{const n=Da(e),r=Da(t);if(!n||!r)return qr(e,t);const i={...n};return s=>(i.red=Di(n.red,r.red,s),i.green=Di(n.green,r.green,s),i.blue=Di(n.blue,r.blue,s),i.alpha=we(n.alpha,r.alpha,s),nn.transform(i))},xo=new Set(["none","hidden"]);function n1(e,t){return xo.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function r1(e,t){return n=>we(e,t,n)}function ks(e){return typeof e=="number"?r1:typeof e=="string"?ys(e)?qr:Ae.test(e)?Ra:s1:Array.isArray(e)?Xu:typeof e=="object"?Ae.test(e)?Ra:i1:qr}function Xu(e,t){const n=[...e],r=n.length,i=e.map((s,a)=>ks(s)(s,t[a]));return s=>{for(let a=0;a<r;a++)n[a]=i[a](s);return n}}function i1(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=ks(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function o1(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],a=e.indexes[s][r[s]],l=e.values[a]??0;n[i]=l,r[s]++}return n}const s1=(e,t)=>{const n=bt.createTransformer(t),r=Mn(e),i=Mn(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?xo.has(e)&&!i.values.length||xo.has(t)&&!r.values.length?n1(e,t):pr(Xu(o1(r,i),i.values),n):(On(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),qr(e,t))};function Zu(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?we(e,t,n):ks(e)(e,t)}const a1=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ye.update(t,n),stop:()=>Gt(t),now:()=>He.isProcessing?He.timestamp:Ke.now()}},Ju=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=Math.round(e(s/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Xr=2e4;function ws(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Xr;)t+=n,r=e.next(t);return t>=Xr?1/0:t}function l1(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(ws(r),Xr);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:dt(i)}}const Te={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function go(e,t){return e*Math.sqrt(1-t*t)}const c1=12;function u1(e,t,n){let r=n;for(let i=1;i<c1;i++)r=r-e(r)/t(r);return r}const Ri=.001;function d1({duration:e=Te.duration,bounce:t=Te.bounce,velocity:n=Te.velocity,mass:r=Te.mass}){let i,s;On(e<=et(Te.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-t;a=Lt(Te.minDamping,Te.maxDamping,a),e=Lt(Te.minDuration,Te.maxDuration,dt(e)),a<1?(i=c=>{const u=c*a,h=u*e,m=u-n,p=go(c,a),x=Math.exp(-h);return Ri-m/p*x},s=c=>{const h=c*a*e,m=h*n+n,p=Math.pow(a,2)*Math.pow(c,2)*e,x=Math.exp(-h),g=go(Math.pow(c,2),a);return(-i(c)+Ri>0?-1:1)*((m-p)*x)/g}):(i=c=>{const u=Math.exp(-c*e),h=(c-n)*e+1;return-Ri+u*h},s=c=>{const u=Math.exp(-c*e),h=(n-c)*(e*e);return u*h});const l=5/e,d=u1(i,s,l);if(e=et(e),isNaN(d))return{stiffness:Te.stiffness,damping:Te.damping,duration:e};{const c=Math.pow(d,2)*r;return{stiffness:c,damping:a*2*Math.sqrt(r*c),duration:e}}}const f1=["duration","bounce"],h1=["stiffness","damping","mass"];function Ma(e,t){return t.some(n=>e[n]!==void 0)}function p1(e){let t={velocity:Te.velocity,stiffness:Te.stiffness,damping:Te.damping,mass:Te.mass,isResolvedFromDuration:!1,...e};if(!Ma(e,h1)&&Ma(e,f1))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Lt(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Te.mass,stiffness:i,damping:s}}else{const n=d1({...e,velocity:0});t={...t,...n,mass:Te.mass},t.isResolvedFromDuration=!0}return t}function Zr(e=Te.visualDuration,t=Te.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:s},{stiffness:d,damping:c,mass:u,duration:h,velocity:m,isResolvedFromDuration:p}=p1({...n,velocity:-dt(n.velocity||0)}),x=m||0,g=c/(2*Math.sqrt(d*u)),v=a-s,y=dt(Math.sqrt(d/u)),j=Math.abs(v)<5;r||(r=j?Te.restSpeed.granular:Te.restSpeed.default),i||(i=j?Te.restDelta.granular:Te.restDelta.default);let w,A,B,C,O,E;if(g<1)B=go(y,g),C=(x+g*y*v)/B,w=L=>{const R=Math.exp(-g*y*L);return a-R*(C*Math.sin(B*L)+v*Math.cos(B*L))},O=g*y*C+v*B,E=g*y*v-C*B,A=L=>Math.exp(-g*y*L)*(O*Math.sin(B*L)+E*Math.cos(B*L));else if(g===1){w=R=>a-Math.exp(-y*R)*(v+(x+y*v)*R);const L=x+y*v;A=R=>Math.exp(-y*R)*(y*L*R-x)}else{const L=y*Math.sqrt(g*g-1);w=P=>{const I=Math.exp(-g*y*P),M=Math.min(L*P,300);return a-I*((x+g*y*v)*Math.sinh(M)+L*v*Math.cosh(M))/L};const R=(x+g*y*v)/L,D=g*y*R-v*L,N=g*y*v-R*L;A=P=>{const I=Math.exp(-g*y*P),M=Math.min(L*P,300);return I*(D*Math.sinh(M)+N*Math.cosh(M))}}const F={calculatedDuration:p&&h||null,velocity:L=>et(A(L)),next:L=>{if(!p&&g<1){const D=Math.exp(-g*y*L),N=Math.sin(B*L),P=Math.cos(B*L),I=a-D*(C*N+v*P),M=et(D*(O*N+E*P));return l.done=Math.abs(M)<=r&&Math.abs(a-I)<=i,l.value=l.done?a:I,l}const R=w(L);if(p)l.done=L>=h;else{const D=et(A(L));l.done=Math.abs(D)<=r&&Math.abs(a-R)<=i}return l.value=l.done?a:R,l},toString:()=>{const L=Math.min(ws(F),Xr),R=Ju(D=>F.next(L*D).value,L,30);return L+"ms "+R},toTransition:()=>{}};return F}Zr.applyToOptions=e=>{const t=l1(e,100,Zr);return e.ease=t.ease,e.duration=et(t.duration),e.type="keyframes",e};const m1=5;function Qu(e,t,n){const r=Math.max(t-m1,0);return Iu(n-e(r),t-r)}function yo({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:a,min:l,max:d,restDelta:c=.5,restSpeed:u}){const h=e[0],m={done:!1,value:h},p=E=>l!==void 0&&E<l||d!==void 0&&E>d,x=E=>l===void 0?d:d===void 0||Math.abs(l-E)<Math.abs(d-E)?l:d;let g=n*t;const v=h+g,y=a===void 0?v:a(v);y!==v&&(g=y-h);const j=E=>-g*Math.exp(-E/r),w=E=>y+j(E),A=E=>{const F=j(E),L=w(E);m.done=Math.abs(F)<=c,m.value=m.done?y:L};let B,C;const O=E=>{p(m.value)&&(B=E,C=Zr({keyframes:[m.value,x(m.value)],velocity:Qu(w,E,m.value),damping:i,stiffness:s,restDelta:c,restSpeed:u}))};return O(0),{calculatedDuration:null,next:E=>{let F=!1;return!C&&B===void 0&&(F=!0,A(E),O(E)),B!==void 0&&E>=B?C.next(E-B):(!F&&A(E),m)}}}function x1(e,t,n){const r=[],i=n||$t.mix||Zu,s=e.length-1;for(let a=0;a<s;a++){let l=i(e[a],e[a+1]);if(t){const d=Array.isArray(t)?t[a]||ft:t;l=pr(d,l)}r.push(l)}return r}function g1(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(Pt(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=x1(t,r,i),d=l.length,c=u=>{if(a&&u<e[0])return t[0];let h=0;if(d>1)for(;h<e.length-2&&!(u<e[h+1]);h++);const m=ar(e[h],e[h+1],u);return l[h](m)};return n?u=>c(Lt(e[0],e[s-1],u)):c}function y1(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=ar(0,t,r);e.push(we(n,1,i))}}function b1(e){const t=[0];return y1(t,e.length-1),t}function v1(e,t){return e.map(n=>n*t)}function k1(e,t){return e.map(()=>t||Vu).splice(0,e.length-1)}function Fn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=Am(r)?r.map(Fa):Fa(r),s={done:!1,value:t[0]},a=v1(n&&n.length===t.length?n:b1(t),e),l=g1(a,t,{ease:Array.isArray(i)?i:k1(t,i)});return{calculatedDuration:e,next:d=>(s.value=l(d),s.done=d>=e,s)}}const w1=e=>e!==null;function hi(e,{repeat:t,repeatType:n="loop"},r,i=1){const s=e.filter(w1),l=i<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!l||r===void 0?s[l]:r}const S1={decay:yo,inertia:yo,tween:Fn,keyframes:Fn,spring:Zr};function ed(e){typeof e.type=="string"&&(e.type=S1[e.type])}class Ss{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const C1=e=>e/100;class Jr extends Ss{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,i;const{motionValue:n}=this.options;n&&n.updatedAt!==Ke.now()&&this.tick(Ke.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;ed(t);const{type:n=Fn,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:a=0}=t;let{keyframes:l}=t;const d=n||Fn;process.env.NODE_ENV!=="production"&&d!==Fn&&Pt(l.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${l}`,"spring-two-frames"),d!==Fn&&typeof l[0]!="number"&&(this.mixKeyframes=pr(C1,Zu(l[0],l[1])),l=[0,100]);const c=d({...t,keyframes:l});s==="mirror"&&(this.mirroredGenerator=d({...t,keyframes:[...l].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=ws(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:i,mixKeyframes:s,mirroredGenerator:a,resolvedDuration:l,calculatedDuration:d}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:m,repeatDelay:p,type:x,onUpdate:g,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),j=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let w=this.currentTime,A=r;if(h){const E=Math.min(this.currentTime,i)/l;let F=Math.floor(E),L=E%1;!L&&E>=1&&(L=1),L===1&&F--,F=Math.min(F,h+1),!!(F%2)&&(m==="reverse"?(L=1-L,p&&(L-=p/l)):m==="mirror"&&(A=a)),w=Lt(0,1,L)*l}let B;j?(this.delayState.value=u[0],B=this.delayState):B=A.next(w),s&&!j&&(B.value=s(B.value));let{done:C}=B;!j&&d!==null&&(C=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return O&&x!==yo&&(B.value=hi(u,this.options,v,this.speed)),g&&g(B.value),O&&this.finish(),B}then(t,n){return this.finished.then(t,n)}get duration(){return dt(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+dt(t)}get time(){return dt(this.currentTime)}set time(t){t=et(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return Qu(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(Ke.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=dt(this.currentTime))}play(){var i,s;if(this.isStopped)return;const{driver:t=a1,startTime:n}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),(s=(i=this.options).onPlay)==null||s.call(i);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ke.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function j1(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const rn=e=>e*180/Math.PI,bo=e=>{const t=rn(Math.atan2(e[1],e[0]));return vo(t)},T1={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:bo,rotateZ:bo,skewX:e=>rn(Math.atan(e[1])),skewY:e=>rn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},vo=e=>(e=e%360,e<0&&(e+=360),e),Pa=bo,Oa=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),za=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),B1={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Oa,scaleY:za,scale:e=>(Oa(e)+za(e))/2,rotateX:e=>vo(rn(Math.atan2(e[6],e[5]))),rotateY:e=>vo(rn(Math.atan2(-e[2],e[0]))),rotateZ:Pa,rotate:Pa,skewX:e=>rn(Math.atan(e[4])),skewY:e=>rn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ko(e){return e.includes("scale")?1:0}function wo(e,t){if(!e||e==="none")return ko(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=B1,i=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=T1,i=l}if(!i)return ko(t);const s=r[t],a=i[1].split(",").map(F1);return typeof s=="function"?s(a):a[s]}const E1=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return wo(n,t)};function F1(e){return parseFloat(e.trim())}const _n=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Nn=new Set(_n),_a=e=>e===zn||e===q,A1=new Set(["x","y","z"]),L1=_n.filter(e=>!A1.has(e));function I1(e){const t=[];return L1.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Ut={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const i=e.max-e.min;return r==="border-box"?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const i=e.max-e.min;return r==="border-box"?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>wo(t,"x"),y:(e,{transform:t})=>wo(t,"y")};Ut.translateX=Ut.x;Ut.translateY=Ut.y;const sn=new Set;let So=!1,Co=!1,jo=!1;function td(){if(Co){const e=Array.from(sn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=I1(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,a])=>{var l;(l=r.getValue(s))==null||l.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Co=!1,So=!1,sn.forEach(e=>e.complete(jo)),sn.clear()}function nd(){sn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Co=!0)})}function D1(){jo=!0,nd(),td(),jo=!1}class Cs{constructor(t,n,r,i,s,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(sn.add(this),So||(So=!0,ye.read(nd),ye.resolveKeyframes(td))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const s=i==null?void 0:i.get(),a=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),i&&s===void 0&&i.set(t[0])}j1(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),sn.delete(this)}cancel(){this.state==="scheduled"&&(sn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const R1=e=>e.startsWith("--");function rd(e,t,n){R1(t)?e.style.setProperty(t,n):e.style[t]=n}const M1={};function id(e,t){const n=Lu(e);return()=>M1[t]??n()}const P1=id(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),od=id(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Jn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Na={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Jn([0,.65,.55,1]),circOut:Jn([.55,0,1,.45]),backIn:Jn([.31,.01,.66,-.59]),backOut:Jn([.33,1.53,.69,.99])};function sd(e,t){if(e)return typeof e=="function"?od()?Ju(e,t):"ease-out":Wu(e)?Jn(e):Array.isArray(e)?e.map(n=>sd(n,t)||Na.easeOut):Na[e]}function O1(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:a="loop",ease:l="easeOut",times:d}={},c=void 0){const u={[t]:n};d&&(u.offset=d);const h=sd(l,i);Array.isArray(h)&&(u.easing=h);const m={delay:r,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"};return c&&(m.pseudoElement=c),e.animate(u,m)}function ad(e){return typeof e=="function"&&"applyToOptions"in e}function z1({type:e,...t}){return ad(e)&&od()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class ld extends Ss{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:s,allowFlatten:a=!1,finalKeyframe:l,onComplete:d}=t;this.isPseudoElement=!!s,this.allowFlatten=a,this.options=t,Pt(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=z1(t);this.animation=O1(n,r,i,c,s),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const u=hi(i,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(u),rd(n,r,u),this.animation.cancel()}d==null||d(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,i;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((i=(r=this.animation).commitStyles)==null||i.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return dt(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+dt(t)}get time(){return dt(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=et(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:i}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&P1()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),ft):i(this)}}const cd={anticipate:zu,backInOut:Ou,circInOut:Nu};function _1(e){return e in cd}function N1(e){typeof e.ease=="string"&&_1(e.ease)&&(e.ease=cd[e.ease])}const Mi=10;class V1 extends ld{constructor(t){N1(t),ed(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:s,...a}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new Jr({...a,autoplay:!1}),d=Math.max(Mi,Ke.now()-this.startTime),c=Lt(0,Mi,d-Mi),u=l.sample(d).value,{name:h}=this.options;s&&h&&rd(s,h,u),n.setWithVelocity(l.sample(Math.max(0,d-c)).value,u,c),l.stop()}}const Va=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(bt.test(e)||e==="0")&&!e.startsWith("url("));function W1(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function H1(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],a=Va(i,t),l=Va(s,t);return On(a===l,`You are trying to animate ${t} from "${i}" to "${s}". "${a?s:i}" is not an animatable value.`,"value-not-animatable"),!a||!l?!1:W1(e)||(n==="spring"||ad(n))&&r}function To(e){e.duration=0,e.type="keyframes"}const ud=new Set(["opacity","clipPath","filter","transform"]),U1=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function $1(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&U1.test(e[t]))return!0;return!1}const G1=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Y1=Lu(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function K1(e){var h;const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:s,type:a,keyframes:l}=e;if(!(((h=t==null?void 0:t.owner)==null?void 0:h.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return Y1()&&n&&(ud.has(n)||G1.has(n)&&$1(l))&&(n!=="transform"||!u)&&!c&&!r&&i!=="mirror"&&s!==0&&a!=="inertia"}const q1=40;class X1 extends Ss{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:a="loop",keyframes:l,name:d,motionValue:c,element:u,...h}){var x;super(),this.stop=()=>{var g,v;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=Ke.now();const m={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:a,name:d,motionValue:c,element:u,...h},p=(u==null?void 0:u.KeyframeResolver)||Cs;this.keyframeResolver=new p(l,(g,v,y)=>this.onKeyframesResolved(g,v,m,!y),d,c,u),(x=this.keyframeResolver)==null||x.scheduleResolve()}onKeyframesResolved(t,n,r,i){var y,j;this.keyframeResolver=void 0;const{name:s,type:a,velocity:l,delay:d,isHandoff:c,onUpdate:u}=r;this.resolvedAt=Ke.now();let h=!0;H1(t,s,a,l)||(h=!1,($t.instantAnimations||!d)&&(u==null||u(hi(t,r,n))),t[0]=t[t.length-1],To(r),r.repeat=0);const p={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>q1?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},x=h&&!c&&K1(p),g=(j=(y=p.motionValue)==null?void 0:y.owner)==null?void 0:j.current;let v;if(x)try{v=new V1({...p,element:g})}catch{v=new Jr(p)}else v=new Jr(p);v.finished.then(()=>{this.notifyFinished()}).catch(ft),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),D1()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function dd(e,t,n,r=0,i=1){const s=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),a=e.size,l=(a-1)*r;return typeof n=="function"?n(s,a):i===1?s*r:l-s*r}const Z1=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function J1(e){const t=Z1.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}const Q1=4;function fd(e,t,n=1){Pt(n<=Q1,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,i]=J1(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const a=s.trim();return Eu(a)?parseFloat(a):a}return ys(i)?fd(i,t,n+1):i}const ex={type:"spring",stiffness:500,damping:25,restSpeed:10},tx=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),nx={type:"keyframes",duration:.8},rx={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ix=(e,{keyframes:t})=>t.length>2?nx:Nn.has(e)?e.startsWith("scale")?tx(t[1]):ex:rx;function hd(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function js(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?hd(n,e):n}const ox=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function sx(e){for(const t in e)if(!ox.has(t))return!0;return!1}const Ts=(e,t,n,r={},i,s)=>a=>{const l=js(r,e)||{},d=l.delay||r.delay||0;let{elapsed:c=0}=r;c=c-et(d);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-c,onUpdate:m=>{t.set(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:s?void 0:i};sx(l)||Object.assign(u,ix(e,u)),u.duration&&(u.duration=et(u.duration)),u.repeatDelay&&(u.repeatDelay=et(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(To(u),u.delay===0&&(h=!0)),($t.instantAnimations||$t.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(h=!0,To(u),u.delay=0),u.allowFlatten=!l.type&&!l.ease,h&&!s&&t.get()!==void 0){const m=hi(u.keyframes,l);if(m!==void 0){ye.update(()=>{u.onUpdate(m),u.onComplete()});return}}return l.isSync?new Jr(u):new X1(u)};function Wa(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Bs(e,t,n,r){if(typeof t=="function"){const[i,s]=Wa(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=Wa(r);t=t(n!==void 0?n:e.custom,i,s)}return t}function an(e,t,n){const r=e.getProps();return Bs(r,t,n!==void 0?n:r.custom,e)}const pd=new Set(["width","height","top","left","right","bottom",..._n]),Ha=30,ax=e=>!isNaN(parseFloat(e));class lx{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const i=Ke.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ke.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=ax(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&ms(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new ps);const r=this.events[t].add(n);return t==="change"?()=>{r(),ye.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ke.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Ha)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Ha);return Iu(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Pn(e,t){return new lx(e,t)}const Bo=e=>Array.isArray(e);function cx(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Pn(n))}function ux(e){return Bo(e)?e[e.length-1]||0:e}function dx(e,t){const n=an(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const a in s){const l=ux(s[a]);cx(e,a,l)}}const Ue=e=>!!(e&&e.getVelocity);function fx(e){return!!(Ue(e)&&e.add)}function Eo(e,t){const n=e.getValue("willChange");if(fx(n))return n.add(t);if(!n&&$t.WillChange){const r=new $t.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Es(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const hx="framerAppearId",md="data-"+Es(hx);function xd(e){return e.props[md]}function px({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function gd(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s,transitionEnd:a,...l}=t;const d=e.getDefaultTransition();s=s?hd(s,d):d;const c=s==null?void 0:s.reduceMotion;r&&(s=r);const u=[],h=i&&e.animationState&&e.animationState.getState()[i];for(const m in l){const p=e.getValue(m,e.latestValues[m]??null),x=l[m];if(x===void 0||h&&px(h,m))continue;const g={delay:n,...js(s||{},m)},v=p.get();if(v!==void 0&&!p.isAnimating()&&!Array.isArray(x)&&x===v&&!g.velocity){ye.update(()=>p.set(x));continue}let y=!1;if(window.MotionHandoffAnimation){const A=xd(e);if(A){const B=window.MotionHandoffAnimation(A,m,ye);B!==null&&(g.startTime=B,y=!0)}}Eo(e,m);const j=c??e.shouldReduceMotion;p.start(Ts(m,p,x,j&&pd.has(m)?{type:!1}:g,e,y));const w=p.animation;w&&u.push(w)}if(a){const m=()=>ye.update(()=>{a&&dx(e,a)});u.length?Promise.all(u).then(m):m()}return u}function Fo(e,t,n={}){var d;const r=an(e,t,n.type==="exit"?(d=e.presenceContext)==null?void 0:d.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(gd(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:m}=i;return mx(e,t,c,u,h,m,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[c,u]=l==="beforeChildren"?[s,a]:[a,s];return c().then(()=>u())}else return Promise.all([s(),a(n.delay)])}function mx(e,t,n=0,r=0,i=0,s=1,a){const l=[];for(const d of e.variantChildren)d.notify("AnimationStart",t),l.push(Fo(d,t,{...a,delay:n+(typeof r=="function"?0:r)+dd(e.variantChildren,d,r,i,s)}).then(()=>d.notify("AnimationComplete",t)));return Promise.all(l)}function xx(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>Fo(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=Fo(e,t,n);else{const i=typeof t=="function"?an(e,t,n.custom):t;r=Promise.all(gd(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const gx={test:e=>e==="auto",parse:e=>e},yd=e=>t=>t.test(e),bd=[zn,q,Ft,Wt,Wm,Vm,gx],Ua=e=>bd.find(yd(e));function yx(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Au(e):!0}const bx=new Set(["brightness","contrast","saturate","opacity"]);function vx(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(bs)||[];if(!r)return e;const i=n.replace(r,"");let s=bx.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const kx=/\b([a-z-]*)\(.*?\)/gu,Ao={...bt,getAnimatableNone:e=>{const t=e.match(kx);return t?t.map(vx).join(" "):e}},Lo={...bt,getAnimatableNone:e=>{const t=bt.parse(e);return bt.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},$a={...zn,transform:Math.round},wx={rotate:Wt,rotateX:Wt,rotateY:Wt,rotateZ:Wt,scale:Br,scaleX:Br,scaleY:Br,scaleZ:Br,skew:Wt,skewX:Wt,skewY:Wt,distance:q,translateX:q,translateY:q,translateZ:q,x:q,y:q,z:q,perspective:q,transformPerspective:q,opacity:lr,originX:La,originY:La,originZ:q},Fs={borderWidth:q,borderTopWidth:q,borderRightWidth:q,borderBottomWidth:q,borderLeftWidth:q,borderRadius:q,borderTopLeftRadius:q,borderTopRightRadius:q,borderBottomRightRadius:q,borderBottomLeftRadius:q,width:q,maxWidth:q,height:q,maxHeight:q,top:q,right:q,bottom:q,left:q,inset:q,insetBlock:q,insetBlockStart:q,insetBlockEnd:q,insetInline:q,insetInlineStart:q,insetInlineEnd:q,padding:q,paddingTop:q,paddingRight:q,paddingBottom:q,paddingLeft:q,paddingBlock:q,paddingBlockStart:q,paddingBlockEnd:q,paddingInline:q,paddingInlineStart:q,paddingInlineEnd:q,margin:q,marginTop:q,marginRight:q,marginBottom:q,marginLeft:q,marginBlock:q,marginBlockStart:q,marginBlockEnd:q,marginInline:q,marginInlineStart:q,marginInlineEnd:q,fontSize:q,backgroundPositionX:q,backgroundPositionY:q,...wx,zIndex:$a,fillOpacity:lr,strokeOpacity:lr,numOctaves:$a},Sx={...Fs,color:Ae,backgroundColor:Ae,outlineColor:Ae,fill:Ae,stroke:Ae,borderColor:Ae,borderTopColor:Ae,borderRightColor:Ae,borderBottomColor:Ae,borderLeftColor:Ae,filter:Ao,WebkitFilter:Ao,mask:Lo,WebkitMask:Lo},vd=e=>Sx[e],Cx=new Set([Ao,Lo]);function kd(e,t){let n=vd(e);return Cx.has(n)||(n=bt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const jx=new Set(["auto","none","0"]);function Tx(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!jx.has(s)&&Mn(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=kd(n,i)}class Bx extends Cs{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let h=t[u];if(typeof h=="string"&&(h=h.trim(),ys(h))){const m=fd(h,n.current);m!==void 0&&(t[u]=m),u===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!pd.has(r)||t.length!==2)return;const[i,s]=t,a=Ua(i),l=Ua(s),d=Aa(i),c=Aa(s);if(d!==c&&Ut[r]){this.needsMeasurement=!0;return}if(a!==l)if(_a(a)&&_a(l))for(let u=0;u<t.length;u++){const h=t[u];typeof h=="string"&&(t[u]=parseFloat(h))}else Ut[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||yx(t[i]))&&r.push(i);r.length&&Tx(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ut[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,a=r[s];r[s]=Ut[n](t.measureViewportBox(),window.getComputedStyle(t.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([d,c])=>{t.getValue(d).set(c)}),this.resolveNoneKeyframes()}}function wd(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const i=(n==null?void 0:n[e])??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(r=>r!=null)}const Sd=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function _r(e){return Fu(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:As}=Hu(queueMicrotask,!1),yt={x:!1,y:!1};function Cd(){return yt.x||yt.y}function Ex(e){return e==="x"||e==="y"?yt[e]?null:(yt[e]=!0,()=>{yt[e]=!1}):yt.x||yt.y?null:(yt.x=yt.y=!0,()=>{yt.x=yt.y=!1})}function jd(e,t){const n=wd(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Fx(e){return!(e.pointerType==="touch"||Cd())}function Ax(e,t,n={}){const[r,i,s]=jd(e,n);return r.forEach(a=>{let l=!1,d=!1,c;const u=()=>{a.removeEventListener("pointerleave",x)},h=v=>{c&&(c(v),c=void 0),u()},m=v=>{l=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),d&&(d=!1,h(v))},p=()=>{l=!0,window.addEventListener("pointerup",m,i),window.addEventListener("pointercancel",m,i)},x=v=>{if(v.pointerType!=="touch"){if(l){d=!0;return}h(v)}},g=v=>{if(!Fx(v))return;d=!1;const y=t(a,v);typeof y=="function"&&(c=y,a.addEventListener("pointerleave",x,i))};a.addEventListener("pointerenter",g,i),a.addEventListener("pointerdown",p,i)}),s}const Td=(e,t)=>t?e===t?!0:Td(e,t.parentElement):!1,Ls=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Lx=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ix(e){return Lx.has(e.tagName)||e.isContentEditable===!0}const Dx=new Set(["INPUT","SELECT","TEXTAREA"]);function Rx(e){return Dx.has(e.tagName)||e.isContentEditable===!0}const Nr=new WeakSet;function Ga(e){return t=>{t.key==="Enter"&&e(t)}}function Pi(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Mx=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Ga(()=>{if(Nr.has(n))return;Pi(n,"down");const i=Ga(()=>{Pi(n,"up")}),s=()=>Pi(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Ya(e){return Ls(e)&&!Cd()}const Ka=new WeakSet;function Px(e,t,n={}){const[r,i,s]=jd(e,n),a=l=>{const d=l.currentTarget;if(!Ya(l)||Ka.has(l))return;Nr.add(d),n.stopPropagation&&Ka.add(l);const c=t(d,l),u=(p,x)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",m),Nr.has(d)&&Nr.delete(d),Ya(p)&&typeof c=="function"&&c(p,{success:x})},h=p=>{u(p,d===window||d===document||n.useGlobalTarget||Td(d,p.target))},m=p=>{u(p,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",m,i)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,i),_r(l)&&(l.addEventListener("focus",c=>Mx(c,i)),!Ix(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),s}function Is(e){return Fu(e)&&"ownerSVGElement"in e}const Vr=new WeakMap;let Ht;const Bd=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+"Size"]:Is(r)&&"getBBox"in r?r.getBBox()[t]:r[n],Ox=Bd("inline","width","offsetWidth"),zx=Bd("block","height","offsetHeight");function _x({target:e,borderBoxSize:t}){var n;(n=Vr.get(e))==null||n.forEach(r=>{r(e,{get width(){return Ox(e,t)},get height(){return zx(e,t)}})})}function Nx(e){e.forEach(_x)}function Vx(){typeof ResizeObserver>"u"||(Ht=new ResizeObserver(Nx))}function Wx(e,t){Ht||Vx();const n=wd(e);return n.forEach(r=>{let i=Vr.get(r);i||(i=new Set,Vr.set(r,i)),i.add(t),Ht==null||Ht.observe(r)}),()=>{n.forEach(r=>{const i=Vr.get(r);i==null||i.delete(t),i!=null&&i.size||Ht==null||Ht.unobserve(r)})}}const Wr=new Set;let An;function Hx(){An=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Wr.forEach(t=>t(e))},window.addEventListener("resize",An)}function Ux(e){return Wr.add(e),An||Hx(),()=>{Wr.delete(e),!Wr.size&&typeof An=="function"&&(window.removeEventListener("resize",An),An=void 0)}}function qa(e,t){return typeof e=="function"?Ux(e):Wx(e,t)}function $x(e){return Is(e)&&e.tagName==="svg"}const Gx=[...bd,Ae,bt],Yx=e=>Gx.find(yd(e)),Xa=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ln=()=>({x:Xa(),y:Xa()}),Za=()=>({min:0,max:0}),Pe=()=>({x:Za(),y:Za()}),Kx=new WeakMap;function pi(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function cr(e){return typeof e=="string"||Array.isArray(e)}const Ds=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Rs=["initial",...Ds];function mi(e){return pi(e.animate)||Rs.some(t=>cr(e[t]))}function Ed(e){return!!(mi(e)||e.variants)}function qx(e,t,n){for(const r in t){const i=t[r],s=n[r];if(Ue(i))e.addValue(r,i);else if(Ue(s))e.addValue(r,Pn(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=e.getStaticValue(r);e.addValue(r,Pn(a!==void 0?a:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Io={current:null},Fd={current:!1},Xx=typeof window<"u";function Zx(){if(Fd.current=!0,!!Xx)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Io.current=e.matches;e.addEventListener("change",t),t()}else Io.current=!1}const Ja=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Qr={};function Ad(e){Qr=e}function Jx(){return Qr}class Qx{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:a,visualState:l},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Cs,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Ke.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,ye.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=l;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=d,this.blockInitialAnimation=!!a,this.isControllingVariants=mi(n),this.isVariantNode=Ed(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in m){const x=m[p];c[p]!==void 0&&Ue(x)&&x.set(c[p])}}mount(t){var n,r;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=t,Kx.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,s)=>this.bindToMotionValue(s,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Fd.current||Zx(),this.shouldReduceMotion=Io.current),process.env.NODE_ENV!=="production"&&ms(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Gt(this.notifyUpdate),Gt(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&ud.has(t)&&this.current instanceof HTMLElement){const{factory:a,keyframes:l,times:d,ease:c,duration:u}=n.accelerate,h=new ld({element:this.current,name:t,keyframes:l,times:d,ease:c,duration:et(u)}),m=a(h);this.valueSubscriptions.set(t,()=>{m(),h.cancel()});return}const r=Nn.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&ye.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Qr){const n=Qr[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Pe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Ja.length;r++){const i=Ja[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,a=t[s];a&&(this.propEventSubscriptions[i]=this.on(i,a))}this.prevMotionValues=qx(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Pn(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Eu(r)||Au(r))?r=parseFloat(r):!Yx(r)&&bt.test(n)&&(r=kd(t,n)),this.setBaseTarget(t,Ue(r)?r.get():r)),Ue(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=Bs(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);a&&(r=a[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Ue(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new ps),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){As.render(this.render)}}class Ld extends Qx{constructor(){super(...arguments),this.KeyframeResolver=Bx}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ue(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Yt{constructor(t){this.isMounted=!1,this.node=t}update(){}}function Id({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function eg({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function tg(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Oi(e){return e===void 0||e===1}function Do({scale:e,scaleX:t,scaleY:n}){return!Oi(e)||!Oi(t)||!Oi(n)}function tn(e){return Do(e)||Dd(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Dd(e){return Qa(e.x)||Qa(e.y)}function Qa(e){return e&&e!=="0%"}function ei(e,t,n){const r=e-n,i=t*r;return n+i}function el(e,t,n,r,i){return i!==void 0&&(e=ei(e,i,r)),ei(e,n,r)+t}function Ro(e,t=0,n=1,r,i){e.min=el(e.min,t,n,r,i),e.max=el(e.max,t,n,r,i)}function Rd(e,{x:t,y:n}){Ro(e.x,t.translate,t.scale,t.originPoint),Ro(e.y,n.translate,n.scale,n.originPoint)}const tl=.999999999999,nl=1.0000000000001;function ng(e,t,n,r=!1){var l;const i=n.length;if(!i)return;t.x=t.y=1;let s,a;for(let d=0;d<i;d++){s=n[d],a=s.projectionDelta;const{visualElement:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(Tt(e.x,-s.scroll.offset.x),Tt(e.y,-s.scroll.offset.y)),a&&(t.x*=a.x.scale,t.y*=a.y.scale,Rd(e,a)),r&&tn(s.latestValues)&&Hr(e,s.latestValues,(l=s.layout)==null?void 0:l.layoutBox))}t.x<nl&&t.x>tl&&(t.x=1),t.y<nl&&t.y>tl&&(t.y=1)}function Tt(e,t){e.min+=t,e.max+=t}function rl(e,t,n,r,i=.5){const s=we(e.min,e.max,i);Ro(e,t,n,s,r)}function il(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Hr(e,t,n){const r=n??e;rl(e.x,il(t.x,r.x),t.scaleX,t.scale,t.originX),rl(e.y,il(t.y,r.y),t.scaleY,t.scale,t.originY)}function Md(e,t){return Id(tg(e.getBoundingClientRect(),t))}function rg(e,t,n){const r=Md(e,n),{scroll:i}=t;return i&&(Tt(r.x,i.offset.x),Tt(r.y,i.offset.y)),r}const ig={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},og=_n.length;function sg(e,t,n){let r="",i=!0;for(let s=0;s<og;s++){const a=_n[s],l=e[a];if(l===void 0)continue;let d=!0;if(typeof l=="number")d=l===(a.startsWith("scale")?1:0);else{const c=parseFloat(l);d=a.startsWith("scale")?c===1:c===0}if(!d||n){const c=Sd(l,Fs[a]);if(!d){i=!1;const u=ig[a]||a;r+=`${u}(${c}) `}n&&(t[a]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Ms(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let a=!1,l=!1;for(const d in t){const c=t[d];if(Nn.has(d)){a=!0;continue}else if($u(d)){i[d]=c;continue}else{const u=Sd(c,Fs[d]);d.startsWith("origin")?(l=!0,s[d]=u):r[d]=u}}if(t.transform||(a||n?r.transform=sg(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:d="50%",originY:c="50%",originZ:u=0}=s;r.transformOrigin=`${d} ${c} ${u}`}}function Pd(e,{style:t,vars:n},r,i){const s=e.style;let a;for(a in t)s[a]=t[a];i==null||i.applyProjectionStyles(s,r);for(a in n)s.setProperty(a,n[a])}function ol(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const $n={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(q.test(e))e=parseFloat(e);else return e;const n=ol(e,t.target.x),r=ol(e,t.target.y);return`${n}% ${r}%`}},ag={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=bt.parse(e);if(i.length>5)return r;const s=bt.createTransformer(e),a=typeof i[0]!="number"?1:0,l=n.x.scale*t.x,d=n.y.scale*t.y;i[0+a]/=l,i[1+a]/=d;const c=we(l,d,.5);return typeof i[2+a]=="number"&&(i[2+a]/=c),typeof i[3+a]=="number"&&(i[3+a]/=c),s(i)}},Mo={borderRadius:{...$n,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:$n,borderTopRightRadius:$n,borderBottomLeftRadius:$n,borderBottomRightRadius:$n,boxShadow:ag};function Od(e,{layout:t,layoutId:n}){return Nn.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Mo[e]||e==="opacity")}function Ps(e,t,n){var a;const r=e.style,i=t==null?void 0:t.style,s={};if(!r)return s;for(const l in r)(Ue(r[l])||i&&Ue(i[l])||Od(l,e)||((a=n==null?void 0:n.getValue(l))==null?void 0:a.liveStyle)!==void 0)&&(s[l]=r[l]);return s}function lg(e){return window.getComputedStyle(e)}class cg extends Ld{constructor(){super(...arguments),this.type="html",this.renderInstance=Pd}readValueFromInstance(t,n){var r;if(Nn.has(n))return(r=this.projection)!=null&&r.isProjecting?ko(n):E1(t,n);{const i=lg(t),s=($u(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Md(t,n)}build(t,n,r){Ms(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Ps(t,n,r)}}const ug={offset:"stroke-dashoffset",array:"stroke-dasharray"},dg={offset:"strokeDashoffset",array:"strokeDasharray"};function fg(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?ug:dg;e[s.offset]=`${-r}`,e[s.array]=`${t} ${n}`}const hg=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function zd(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:a=0,...l},d,c,u){if(Ms(e,l,c),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m}=e;h.transform&&(m.transform=h.transform,delete h.transform),(m.transform||h.transformOrigin)&&(m.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),m.transform&&(m.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete h.transformBox);for(const p of hg)h[p]!==void 0&&(m[p]=h[p],delete h[p]);t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),i!==void 0&&fg(h,i,s,a,!1)}const _d=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Nd=e=>typeof e=="string"&&e.toLowerCase()==="svg";function pg(e,t,n,r){Pd(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(_d.has(i)?i:Es(i),t.attrs[i])}function Vd(e,t,n){const r=Ps(e,t,n);for(const i in e)if(Ue(e[i])||Ue(t[i])){const s=_n.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}class mg extends Ld{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Pe}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Nn.has(n)){const r=vd(n);return r&&r.default||0}return n=_d.has(n)?n:Es(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Vd(t,n,r)}build(t,n,r){zd(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){pg(t,n,r,i)}mount(t){this.isSVGTag=Nd(t.tagName),super.mount(t)}}const xg=Rs.length;function Wd(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Wd(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<xg;n++){const r=Rs[n],i=e.props[r];(cr(i)||i===!1)&&(t[r]=i)}return t}function Hd(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const gg=[...Ds].reverse(),yg=Ds.length;function bg(e){return t=>Promise.all(t.map(({animation:n,options:r})=>xx(e,n,r)))}function vg(e){let t=bg(e),n=sl(),r=!0,i=!1;const s=c=>(u,h)=>{var p;const m=an(e,h,c==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(m){const{transition:x,transitionEnd:g,...v}=m;u={...u,...v,...g}}return u};function a(c){t=c(e)}function l(c){const{props:u}=e,h=Wd(e.parent)||{},m=[],p=new Set;let x={},g=1/0;for(let y=0;y<yg;y++){const j=gg[y],w=n[j],A=u[j]!==void 0?u[j]:h[j],B=cr(A),C=j===c?w.isActive:null;C===!1&&(g=y);let O=A===h[j]&&A!==u[j]&&B;if(O&&(r||i)&&e.manuallyAnimateOnMount&&(O=!1),w.protectedKeys={...x},!w.isActive&&C===null||!A&&!w.prevProp||pi(A)||typeof A=="boolean")continue;if(j==="exit"&&w.isActive&&C!==!0){w.prevResolvedValues&&(x={...x,...w.prevResolvedValues});continue}const E=kg(w.prevProp,A);let F=E||j===c&&w.isActive&&!O&&B||y>g&&B,L=!1;const R=Array.isArray(A)?A:[A];let D=R.reduce(s(j),{});C===!1&&(D={});const{prevResolvedValues:N={}}=w,P={...N,...D},I=G=>{F=!0,p.has(G)&&(L=!0,p.delete(G)),w.needsAnimating[G]=!0;const H=e.getValue(G);H&&(H.liveStyle=!1)};for(const G in P){const H=D[G],b=N[G];if(x.hasOwnProperty(G))continue;let W=!1;Bo(H)&&Bo(b)?W=!Hd(H,b):W=H!==b,W?H!=null?I(G):p.add(G):H!==void 0&&p.has(G)?I(G):w.protectedKeys[G]=!0}w.prevProp=A,w.prevResolvedValues=D,w.isActive&&(x={...x,...D}),(r||i)&&e.blockInitialAnimation&&(F=!1);const M=O&&E;F&&(!M||L)&&m.push(...R.map(G=>{const H={type:j};if(typeof G=="string"&&(r||i)&&!M&&e.manuallyAnimateOnMount&&e.parent){const{parent:b}=e,W=an(b,G);if(b.enteringChildren&&W){const{delayChildren:ne}=W.transition||{};H.delay=dd(b.enteringChildren,e,ne)}}return{animation:G,options:H}}))}if(p.size){const y={};if(typeof u.initial!="boolean"){const j=an(e,Array.isArray(u.initial)?u.initial[0]:u.initial);j&&j.transition&&(y.transition=j.transition)}p.forEach(j=>{const w=e.getBaseTarget(j),A=e.getValue(j);A&&(A.liveStyle=!0),y[j]=w??null}),m.push({animation:y})}let v=!!m.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,i=!1,v?t(m):Promise.resolve()}function d(c,u){var m;if(n[c].isActive===u)return Promise.resolve();(m=e.variantChildren)==null||m.forEach(p=>{var x;return(x=p.animationState)==null?void 0:x.setActive(c,u)}),n[c].isActive=u;const h=l(c);for(const p in n)n[p].protectedKeys={};return h}return{animateChanges:l,setActive:d,setAnimateFunction:a,getState:()=>n,reset:()=>{n=sl(),i=!0}}}function kg(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Hd(t,e):!1}function Qt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function sl(){return{animate:Qt(!0),whileInView:Qt(),whileHover:Qt(),whileTap:Qt(),whileDrag:Qt(),whileFocus:Qt(),exit:Qt()}}function Po(e,t){e.min=t.min,e.max=t.max}function gt(e,t){Po(e.x,t.x),Po(e.y,t.y)}function al(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Ud=1e-4,wg=1-Ud,Sg=1+Ud,$d=.01,Cg=0-$d,jg=0+$d;function qe(e){return e.max-e.min}function Tg(e,t,n){return Math.abs(e-t)<=n}function ll(e,t,n,r=.5){e.origin=r,e.originPoint=we(t.min,t.max,e.origin),e.scale=qe(n)/qe(t),e.translate=we(n.min,n.max,e.origin)-e.originPoint,(e.scale>=wg&&e.scale<=Sg||isNaN(e.scale))&&(e.scale=1),(e.translate>=Cg&&e.translate<=jg||isNaN(e.translate))&&(e.translate=0)}function nr(e,t,n,r){ll(e.x,t.x,n.x,r?r.originX:void 0),ll(e.y,t.y,n.y,r?r.originY:void 0)}function cl(e,t,n,r=0){const i=r?we(n.min,n.max,r):n.min;e.min=i+t.min,e.max=e.min+qe(t)}function Bg(e,t,n,r){cl(e.x,t.x,n.x,r==null?void 0:r.x),cl(e.y,t.y,n.y,r==null?void 0:r.y)}function ul(e,t,n,r=0){const i=r?we(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+qe(t)}function ti(e,t,n,r){ul(e.x,t.x,n.x,r==null?void 0:r.x),ul(e.y,t.y,n.y,r==null?void 0:r.y)}function dl(e,t,n,r,i){return e-=t,e=ei(e,1/n,r),i!==void 0&&(e=ei(e,1/i,r)),e}function Eg(e,t=0,n=1,r=.5,i,s=e,a=e){if(Ft.test(t)&&(t=parseFloat(t),t=we(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=we(s.min,s.max,r);e===s&&(l-=t),e.min=dl(e.min,t,n,l,i),e.max=dl(e.max,t,n,l,i)}function fl(e,t,[n,r,i],s,a){Eg(e,t[n],t[r],t[i],t.scale,s,a)}const Fg=["x","scaleX","originX"],Ag=["y","scaleY","originY"];function hl(e,t,n,r){fl(e.x,t,Fg,n?n.x:void 0,r?r.x:void 0),fl(e.y,t,Ag,n?n.y:void 0,r?r.y:void 0)}function pl(e){return e.translate===0&&e.scale===1}function Gd(e){return pl(e.x)&&pl(e.y)}function ml(e,t){return e.min===t.min&&e.max===t.max}function Lg(e,t){return ml(e.x,t.x)&&ml(e.y,t.y)}function xl(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Yd(e,t){return xl(e.x,t.x)&&xl(e.y,t.y)}function gl(e){return qe(e.x)/qe(e.y)}function yl(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Ct(e){return[e("x"),e("y")]}function Ig(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((i||s||a)&&(r=`translate3d(${i}px, ${s}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:h,rotateY:m,skewX:p,skewY:x}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),h&&(r+=`rotateX(${h}deg) `),m&&(r+=`rotateY(${m}deg) `),p&&(r+=`skewX(${p}deg) `),x&&(r+=`skewY(${x}deg) `)}const l=e.x.scale*t.x,d=e.y.scale*t.y;return(l!==1||d!==1)&&(r+=`scale(${l}, ${d})`),r||"none"}const Kd=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Dg=Kd.length,bl=e=>typeof e=="string"?parseFloat(e):e,vl=e=>typeof e=="number"||q.test(e);function Rg(e,t,n,r,i,s){i?(e.opacity=we(0,n.opacity??1,Mg(r)),e.opacityExit=we(t.opacity??1,0,Pg(r))):s&&(e.opacity=we(t.opacity??1,n.opacity??1,r));for(let a=0;a<Dg;a++){const l=Kd[a];let d=kl(t,l),c=kl(n,l);if(d===void 0&&c===void 0)continue;d||(d=0),c||(c=0),d===0||c===0||vl(d)===vl(c)?(e[l]=Math.max(we(bl(d),bl(c),r),0),(Ft.test(c)||Ft.test(d))&&(e[l]+="%")):e[l]=c}(t.rotate||n.rotate)&&(e.rotate=we(t.rotate||0,n.rotate||0,r))}function kl(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Mg=qd(0,.5,_u),Pg=qd(.5,.95,ft);function qd(e,t,n){return r=>r<e?0:r>t?1:n(ar(e,t,r))}function Og(e,t,n){const r=Ue(e)?e:Pn(e);return r.start(Ts("",r,t,n)),r.animation}function ur(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const zg=(e,t)=>e.depth-t.depth;class _g{constructor(){this.children=[],this.isDirty=!1}add(t){hs(this.children,t),this.isDirty=!0}remove(t){Kr(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(zg),this.isDirty=!1,this.children.forEach(t)}}function Ng(e,t){const n=Ke.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(Gt(r),e(s-t))};return ye.setup(r,!0),()=>Gt(r)}function Ur(e){return Ue(e)?e.get():e}class Vg{constructor(){this.members=[]}add(t){hs(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const i=r.instance;(!i||i.isConnected===!1)&&!r.snapshot&&(Kr(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Kr(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const i=this.members[r];if(i.isPresent!==!1&&((n=i.instance)==null?void 0:n.isConnected)!==!1)return this.promote(i),!0}return!1}promote(t,n){var i;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:s}=r.options,{layoutDependency:a}=t.options;(s===void 0||s!==a)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(i=t.root)!=null&&i.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,i,s,a;(r=(n=t.options).onExitComplete)==null||r.call(n),(a=(i=t.resumingFrom)==null?void 0:(s=i.options).onExitComplete)==null||a.call(s)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const $r={hasAnimatedSinceResize:!0,hasEverUpdated:!1},zi=["","X","Y","Z"],Wg=1e3;let Hg=0;function _i(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Xd(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=xd(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ye,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Xd(r)}function Zd({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a={},l=t==null?void 0:t()){this.id=Hg++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Gg),this.nodes.forEach(Jg),this.nodes.forEach(Qg),this.nodes.forEach(Yg)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new _g)}addEventListener(a,l){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new ps),this.eventHandlers.get(a).add(l)}notifyListeners(a,...l){const d=this.eventHandlers.get(a);d&&d.notify(...l)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=Is(a)&&!$x(a),this.instance=a;const{layoutId:l,layout:d,visualElement:c}=this.options;if(c&&!c.current&&c.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(d||l)&&(this.isLayoutDirty=!0),e){let u,h=0;const m=()=>this.root.updateBlockedByResize=!1;ye.read(()=>{h=window.innerWidth}),e(a,()=>{const p=window.innerWidth;p!==h&&(h=p,this.root.updateBlockedByResize=!0,u&&u(),u=Ng(m,250),$r.hasAnimatedSinceResize&&($r.hasAnimatedSinceResize=!1,this.nodes.forEach(Cl)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||d)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||c.getDefaultTransition()||i0,{onLayoutAnimationStart:g,onLayoutAnimationComplete:v}=c.getProps(),y=!this.targetLayout||!Yd(this.targetLayout,p),j=!h&&m;if(this.options.layoutRoot||this.resumeFrom||j||h&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...js(x,"layout"),onPlay:g,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(u,j)}else h||Cl(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Gt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(e0),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Xd(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:l,layout:d}=this.options;if(l===void 0&&!d)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const d=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),d&&this.nodes.forEach(qg),this.nodes.forEach(wl);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Sl);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Xg),this.nodes.forEach(Zg),this.nodes.forEach(Ug),this.nodes.forEach($g)):this.nodes.forEach(Sl),this.clearAllSnapshots();const l=Ke.now();He.delta=Lt(0,1e3/60,l-He.timestamp),He.timestamp=l,He.isProcessing=!0,Ai.update.process(He),Ai.preRender.process(He),Ai.render.process(He),He.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,As.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Kg),this.sharedNodes.forEach(t0)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ye.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ye.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!qe(this.snapshot.measuredBox.x)&&!qe(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d<this.path.length;d++)this.path[d].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Pe()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(l=!1),l&&this.instance){const d=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:d,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!i)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!Gd(this.projectionDelta),d=this.getTransformTemplate(),c=d?d(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;a&&this.instance&&(l||tn(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const l=this.measurePageBox();let d=this.removeElementScroll(l);return a&&(d=this.removeTransform(d)),o0(d),{animationId:this.root.animationId,measuredBox:l,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:a}=this.options;if(!a)return Pe();const l=a.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(s0))){const{scroll:u}=this.root;u&&(Tt(l.x,u.offset.x),Tt(l.y,u.offset.y))}return l}removeElementScroll(a){var d;const l=Pe();if(gt(l,a),(d=this.scroll)!=null&&d.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:h,options:m}=u;u!==this.root&&h&&m.layoutScroll&&(h.wasRoot&&gt(l,a),Tt(l.x,h.offset.x),Tt(l.y,h.offset.y))}return l}applyTransform(a,l=!1,d){var u,h;const c=d||Pe();gt(c,a);for(let m=0;m<this.path.length;m++){const p=this.path[m];!l&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(Tt(c.x,-p.scroll.offset.x),Tt(c.y,-p.scroll.offset.y)),tn(p.latestValues)&&Hr(c,p.latestValues,(u=p.layout)==null?void 0:u.layoutBox)}return tn(this.latestValues)&&Hr(c,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),c}removeTransform(a){var d;const l=Pe();gt(l,a);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!tn(u.latestValues))continue;let h;u.instance&&(Do(u.latestValues)&&u.updateSnapshot(),h=Pe(),gt(h,u.measurePageBox())),hl(l,u.latestValues,(d=u.snapshot)==null?void 0:d.layoutBox,h)}return tn(this.latestValues)&&hl(l,this.latestValues),l}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==He.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var p;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const d=!!this.resumingFrom||this!==l;if(!(a||d&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:h}=this.options;if(!this.layout||!(u||h))return;this.resolvedRelativeTargetAt=He.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Pe(),this.targetWithTransforms=Pe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Bg(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):gt(this.target,this.layout.layoutBox),Rd(this.target,this.targetDelta)):gt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Do(this.parent.latestValues)||Dd(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,l,d){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Pe(),this.relativeTargetOrigin=Pe(),ti(this.relativeTargetOrigin,l,d,this.options.layoutAnchor||void 0),gt(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var x;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let d=!0;if((this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty)&&(d=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(d=!1),this.resolvedRelativeTargetAt===He.timestamp&&(d=!1),d)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;gt(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;ng(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=Pe());const{target:p}=a;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(al(this.prevProjectionDelta.x,this.projectionDelta.x),al(this.prevProjectionDelta.y,this.projectionDelta.y)),nr(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!yl(this.projectionDelta.x,this.prevProjectionDelta.x)||!yl(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),a){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ln(),this.projectionDelta=Ln(),this.projectionDeltaWithTransform=Ln()}setAnimationOrigin(a,l=!1){const d=this.snapshot,c=d?d.latestValues:{},u={...this.latestValues},h=Ln();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const m=Pe(),p=d?d.source:void 0,x=this.layout?this.layout.source:void 0,g=p!==x,v=this.getStack(),y=!v||v.members.length<=1,j=!!(g&&!y&&this.options.crossfade===!0&&!this.path.some(r0));this.animationProgress=0;let w;this.mixTargetDelta=A=>{const B=A/1e3;jl(h.x,a.x,B),jl(h.y,a.y,B),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ti(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),n0(this.relativeTarget,this.relativeTargetOrigin,m,B),w&&Lg(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Pe()),gt(w,this.relativeTarget)),g&&(this.animationValues=u,Rg(u,c,this.latestValues,B,j,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=B},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var l,d,c;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(c=(d=this.resumingFrom)==null?void 0:d.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Gt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ye.update(()=>{$r.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Pn(0)),this.motionValue.jump(0,!1),this.currentAnimation=Og(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),a.onUpdate&&a.onUpdate(u)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Wg),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:d,layout:c,latestValues:u}=a;if(!(!l||!d||!c)){if(this!==a&&this.layout&&c&&Jd(this.options.animationType,this.layout.layoutBox,c.layoutBox)){d=this.target||Pe();const h=qe(this.layout.layoutBox.x);d.x.min=a.target.x.min,d.x.max=d.x.min+h;const m=qe(this.layout.layoutBox.y);d.y.min=a.target.y.min,d.y.max=d.y.min+m}gt(l,d),Hr(l,u),nr(this.projectionDeltaWithTransform,this.layoutCorrected,l,u)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new Vg),this.sharedNodes.get(a).add(l);const c=l.options.initialPromotionConfig;l.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(l):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var l;const{layoutId:a}=this.options;return a?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:a}=this.options;return a?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:l,preserveFollowOpacity:d}={}){const c=this.getStack();c&&c.promote(this,d),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const{latestValues:d}=a;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(l=!0),!l)return;const c={};d.z&&_i("z",a,c,this.animationValues);for(let u=0;u<zi.length;u++)_i(`rotate${zi[u]}`,a,c,this.animationValues),_i(`skew${zi[u]}`,a,c,this.animationValues);a.render();for(const u in c)a.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);a.scheduleRender()}applyProjectionStyles(a,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const d=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=Ur(l==null?void 0:l.pointerEvents)||"",a.transform=d?d(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=Ur(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!tn(this.latestValues)&&(a.transform=d?d({},""):"none",this.hasProjected=!1);return}a.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let h=Ig(this.projectionDeltaWithTransform,this.treeScale,u);d&&(h=d(u,h)),a.transform=h;const{x:m,y:p}=this.projectionDelta;a.transformOrigin=`${m.origin*100}% ${p.origin*100}% 0`,c.animationValues?a.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:a.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const x in Mo){if(u[x]===void 0)continue;const{correct:g,applyTo:v,isCSSVariable:y}=Mo[x],j=h==="none"?u[x]:g(u[x],c);if(v){const w=v.length;for(let A=0;A<w;A++)a[v[A]]=j}else y?this.options.visualElement.renderState.vars[x]=j:a[x]=j}this.options.layoutId&&(a.pointerEvents=c===this?Ur(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var l;return(l=a.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(wl),this.root.sharedNodes.clear()}}}function Ug(e){e.updateLayout()}function $g(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,a=t.source!==e.layout.source;if(s==="size")Ct(h=>{const m=a?t.measuredBox[h]:t.layoutBox[h],p=qe(m);m.min=r[h].min,m.max=m.min+p});else if(s==="x"||s==="y"){const h=s==="x"?"y":"x";Po(a?t.measuredBox[h]:t.layoutBox[h],r[h])}else Jd(s,t.layoutBox,r)&&Ct(h=>{const m=a?t.measuredBox[h]:t.layoutBox[h],p=qe(r[h]);m.max=m.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+p)});const l=Ln();nr(l,r,t.layoutBox);const d=Ln();a?nr(d,e.applyTransform(i,!0),t.measuredBox):nr(d,r,t.layoutBox);const c=!Gd(l);let u=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:m,layout:p}=h;if(m&&p){const x=e.options.layoutAnchor||void 0,g=Pe();ti(g,t.layoutBox,m.layoutBox,x);const v=Pe();ti(v,r,p.layoutBox,x),Yd(g,v)||(u=!0),h.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=g,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:d,layoutDelta:l,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Gg(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Yg(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Kg(e){e.clearSnapshot()}function wl(e){e.clearMeasurements()}function qg(e){e.isLayoutDirty=!0,e.updateLayout()}function Sl(e){e.isLayoutDirty=!1}function Xg(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Zg(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Cl(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Jg(e){e.resolveTargetDelta()}function Qg(e){e.calcProjection()}function e0(e){e.resetSkewAndRotation()}function t0(e){e.removeLeadSnapshot()}function jl(e,t,n){e.translate=we(t.translate,0,n),e.scale=we(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Tl(e,t,n,r){e.min=we(t.min,n.min,r),e.max=we(t.max,n.max,r)}function n0(e,t,n,r){Tl(e.x,t.x,n.x,r),Tl(e.y,t.y,n.y,r)}function r0(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const i0={duration:.45,ease:[.4,0,.1,1]},Bl=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),El=Bl("applewebkit/")&&!Bl("chrome/")?Math.round:ft;function Fl(e){e.min=El(e.min),e.max=El(e.max)}function o0(e){Fl(e.x),Fl(e.y)}function Jd(e,t,n){return e==="position"||e==="preserve-aspect"&&!Tg(gl(t),gl(n),.2)}function s0(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const a0=Zd({attachResizeListener:(e,t)=>ur(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Ni={current:void 0},Qd=Zd({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ni.current){const e=new a0({});e.mount(window),e.setOptions({layoutScroll:!0}),Ni.current=e}return Ni.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Os=k.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Al(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function l0(...e){return t=>{let n=!1;const r=e.map(i=>{const s=Al(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():Al(e[i],null)}}}}function c0(...e){return je.useCallback(l0(...e),e)}class u0 extends je.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(_r(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,i=_r(r)&&r.offsetWidth||0,s=_r(r)&&r.offsetHeight||0,a=getComputedStyle(n),l=this.props.sizeRef.current;l.height=parseFloat(a.height),l.width=parseFloat(a.width),l.top=n.offsetTop,l.left=n.offsetLeft,l.right=i-l.width-l.left,l.bottom=s-l.height-l.top}return null}componentDidUpdate(){}render(){return this.props.children}}function d0({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:s}){var m;const a=k.useId(),l=k.useRef(null),d=k.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=k.useContext(Os),u=((m=e.props)==null?void 0:m.ref)??(e==null?void 0:e.ref),h=c0(l,u);return k.useInsertionEffect(()=>{const{width:p,height:x,top:g,left:v,right:y,bottom:j}=d.current;if(t||s===!1||!l.current||!p||!x)return;const w=n==="left"?`left: ${v}`:`right: ${y}`,A=r==="bottom"?`bottom: ${j}`:`top: ${g}`;l.current.dataset.motionPopId=a;const B=document.createElement("style");c&&(B.nonce=c);const C=i??document.head;return C.appendChild(B),B.sheet&&B.sheet.insertRule(`
344
344
  [data-motion-pop-id="${a}"] {
345
345
  position: absolute !important;
346
346
  width: ${p}px !important;
@@ -348,22 +348,22 @@
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.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=`
351
+ `),()=>{var O;(O=l.current)==null||O.removeAttribute("data-motion-pop-id"),C.contains(B)&&C.removeChild(B)}},[t]),o.jsx(u0,{isPresent:t,childRef:l,sizeRef:d,pop:s,children:s===!1?e:je.cloneElement(e,{ref:h})})}const f0=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a,anchorX:l,anchorY:d,root:c})=>{const u=fs(h0),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(d0,{pop:a==="popLayout",isPresent:n,anchorX:l,anchorY:d,root:c,children:e}),o.jsx(fi.Provider,{value:p,children:e})};function h0(){return new Map}function ef(e=!0){const t=k.useContext(fi);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 Ll(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]=ef(a),m=k.useMemo(()=>Ll(e),[e]),p=a&&!u?[]:m.map(Er),x=k.useRef(!0),g=k.useRef(m),v=fs(()=>new Map),y=k.useRef(new Set),[j,w]=k.useState(m),[A,B]=k.useState(m);Bu(()=>{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(Ll(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(ds);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(f0,{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)})})},tf=k.createContext({strict:!1}),Il={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 Dl=!1;function p0(){if(Dl)return;const e={};for(const t in Il)e[t]={isEnabled:n=>Il[t].some(r=>!!n[r])};Ad(e),Dl=!0}function nf(){return p0(),Jx()}function m0(e){const t=nf();for(const n in e)t[n]={...t[n],...e[n]};Ad(t)}const x0=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")||x0.has(e)}let rf=e=>!ni(e);function g0(e){typeof e=="function"&&(rf=t=>t.startsWith("on")?!ni(t):e(t))}try{g0(require("@emotion/is-prop-valid").default)}catch{}function y0(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||Ue(e[i])||(rf(i)||n===!0&&ni(i)||!t&&!ni(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const xi=k.createContext({});function b0(e,t){if(mi(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 v0(e){const{initial:t,animate:n}=b0(e,k.useContext(xi));return k.useMemo(()=>({initial:t,animate:n}),[Rl(t),Rl(n)])}function Rl(e){return Array.isArray(e)?e.join(" "):e}const zs=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function of(e,t,n){for(const r in t)!Ue(t[r])&&!Od(r,n)&&(e[r]=t[r])}function k0({transformTemplate:e},t){return k.useMemo(()=>{const n=zs();return Ms(n,t,e),Object.assign({},n.vars,n.style)},[t])}function w0(e,t){const n=e.style||{},r={};return of(r,n,e),Object.assign(r,k0(e,t)),r}function S0(e,t){const n={},r=w0(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 sf=()=>({...zs(),attrs:{}});function C0(e,t,n,r){const i=k.useMemo(()=>{const s=sf();return zd(s,t,Nd(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};of(s,e.style,e),i.style={...s,...i.style}}return i}const j0=["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 _s(e){return typeof e!="string"||e.includes("-")?!1:!!(j0.indexOf(e)>-1||/[A-Z]/u.test(e))}function T0(e,t,n,{latestValues:r},i,s=!1,a){const d=(a??_s(e)?C0:S0)(t,r,i,e),c=y0(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 B0({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:E0(n,r,i,e),renderState:t()}}function E0(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=mi(e),c=Ed(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"&&!pi(h)){const m=Array.isArray(h)?h:[h];for(let p=0;p<m.length;p++){const x=Bs(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 af=e=>(t,n)=>{const r=k.useContext(xi),i=k.useContext(fi),s=()=>B0(e,t,r,i);return n?s():fs(s)},F0=af({scrapeMotionValuesFromProps:Ps,createRenderState:zs}),A0=af({scrapeMotionValuesFromProps:Vd,createRenderState:sf}),L0=Symbol.for("motionComponentSymbol");function I0(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 lf=k.createContext({});function Tn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function D0(e,t,n,r,i,s){var w,A;const{visualElement:a}=k.useContext(xi),l=k.useContext(tf),d=k.useContext(fi),c=k.useContext(Os),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(lf);x&&!x.projection&&i&&(x.type==="html"||x.type==="svg")&&R0(m.current,n,i,g);const v=k.useRef(!1);k.useInsertionEffect(()=>{x&&v.current&&x.update(n,d)});const y=n[md],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 Bu(()=>{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 R0(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:cf(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 cf(e){if(e)return e.options.allowProjection!==!1?e.projection:cf(e.parent)}function Vi(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&m0(r);const s=n?n==="svg":_s(e),a=s?A0:F0;function l(c,u){let h;const m={...k.useContext(Os),...c,layoutId:M0(c)},{isStatic:p}=m,x=v0(c),g=a(c,p);if(!p&&typeof window<"u"){P0(m,r);const v=O0(m);h=v.MeasureLayout,x.visualElement=D0(e,g,m,i,v.ProjectionNode,s)}return o.jsxs(xi.Provider,{value:x,children:[h&&x.visualElement?o.jsx(h,{visualElement:x.visualElement,...m}):null,T0(e,c,I0(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[L0]=e,d}function M0({layoutId:e}){const t=k.useContext(ds).id;return t&&e!==void 0?t+"-"+e:e}function P0(e,t){const n=k.useContext(tf).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 O0(e){const t=nf(),{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 z0(e,t){if(typeof Proxy>"u")return Vi;const n=new Map,r=(s,a)=>Vi(s,a,e,t),i=(s,a)=>(process.env.NODE_ENV!=="production"&&ms(!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,Vi(a,void 0,e,t)),n.get(a))})}const _0=(e,t)=>t.isSVG??_s(e)?new mg(t):new cg(t,{allowProjection:e!==k.Fragment});class N0 extends Yt{constructor(t){super(t),t.animationState||(t.animationState=vg(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();pi(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 V0=0;class W0 extends Yt{constructor(){super(...arguments),this.id=V0++,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 H0={animation:{Feature:N0},exit:{Feature:W0}};function gr(e){return{point:{x:e.pageX,y:e.pageY}}}const U0=e=>t=>Ls(t)&&e(t,gr(t));function rr(e,t,n,r){return ur(e,t,U0(n),r)}const uf=({current:e})=>e?e.ownerDocument.defaultView:null,Ml=(e,t)=>Math.abs(e-t);function $0(e,t){const n=Ml(e.x,t.x),r=Ml(e.y,t.y);return Math.sqrt(n**2+r**2)}const Pl=new Set(["auto","scroll"]);class df{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=Wi(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,g=$0(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=Wi(p.type==="pointercancel"?this.lastMoveEventInfo:Fr(x,this.transformPagePoint),this.history);this.startEvent&&g&&g(p,j),v&&v(p,j)},!Ls(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,Wi(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);(Pl.has(r.overflowX)||Pl.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 Ol(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Wi({point:e},t){return{point:e,delta:Ol(e,ff(t)),offset:Ol(e,G0(t)),velocity:Y0(t,.1)}}function G0(e){return e[0]}function ff(e){return e[e.length-1]}function Y0(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=ff(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 K0(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 zl(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 q0(e,{top:t,left:n,bottom:r,right:i}){return{x:zl(e.x,n,i),y:zl(e.y,t,r)}}function _l(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 X0(e,t){return{x:_l(e.x,t.x),y:_l(e.y,t.y)}}function Z0(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 J0(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 Oo=.35;function Q0(e=Oo){return e===!1?e=0:e===!0&&(e=Oo),{x:Nl(e,"left","right"),y:Nl(e,"top","bottom")}}function Nl(e,t,n){return{min:Vl(e,t),max:Vl(e,n)}}function Vl(e,t){return typeof e=="number"?e:e[t]||0}const ey=new WeakMap;class ty{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=Ex(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),Eo(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=ry(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 df(t,{onSessionStart:s,onStart:a,onMove:l,onSessionEnd:d,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:uf(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=K0(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=q0(r.layoutBox,t):this.constraints=!1,this.elastic=Q0(n),i!==this.constraints&&!Tn(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Ct(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=J0(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=rg(r,i.root,this.visualElement.getTransformPagePoint());let a=X0(i.layout.layoutBox,s);if(n){const l=n(eg(a));this.hasMutatedConstraints=!!l,l&&(a=Id(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 Eo(this.visualElement,t),r.start(Ts(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]=Z0({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;ey.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&&Rx(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=ny(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=Oo,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:a,dragMomentum:l}}}function Wl(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function ny(e,t,n){const r=qa(e,Wl(n)),i=qa(t,Wl(n));return()=>{r(),i()}}function Ar(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ry(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class iy extends Yt{constructor(t){super(t),this.removeGroupControls=ft,this.removeListeners=ft,this.controls=new ty(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 Hi=e=>(t,n)=>{e&&ye.update(()=>e(t,n),!1,!0)};class oy extends Yt{constructor(){super(...arguments),this.removePointerDownListener=ft}onPointerDown(t){this.session=new df(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:uf(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Hi(t),onStart:Hi(n),onMove:Hi(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 Ui=!1;class sy 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),Ui&&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}),Ui=!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(),As.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;Ui=!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 hf(e){const[t,n]=ef(),r=k.useContext(ds);return o.jsx(sy,{...e,layoutGroup:r,switchLayoutGroup:k.useContext(lf),isPresent:t,safeToRemove:n})}const ay={pan:{Feature:oy},drag:{Feature:iy,ProjectionNode:Qd,MeasureLayout:hf}};function Hl(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 ly extends Yt{mount(){const{current:t}=this.node;t&&(this.unmount=Ax(t,(n,r)=>(Hl(this.node,r,"Start"),i=>Hl(this.node,i,"End"))))}unmount(){}}class cy 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 Ul(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 uy extends Yt{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=Px(t,(i,s)=>(Ul(this.node,s,"Start"),(a,{success:l})=>Ul(this.node,a,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const zo=new WeakMap,$i=new WeakMap,dy=e=>{const t=zo.get(e.target);t&&t(e)},fy=e=>{e.forEach(dy)};function hy({root:e,...t}){const n=e||document;$i.has(n)||$i.set(n,{});const r=$i.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(fy,{root:e,...t})),r[i]}function py(e,t,n){const r=hy(t);return zo.set(e,n),r.observe(e),()=>{zo.delete(e),r.unobserve(e)}}const my={some:0,all:1};class xy 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:my[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=py(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(gy(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function gy({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const yy={inView:{Feature:xy},tap:{Feature:uy},focus:{Feature:cy},hover:{Feature:ly}},by={layout:{ProjectionNode:Qd,MeasureLayout:hf}},vy={...H0,...yy,...ay,...by},st=z0(vy,_0);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 ky={BASE_URL:"/",DEV:!1,MODE:"production",PACKAGE_VERSION:"0.1.26",PROD:!0,SSR:!1,VITE_STORYBOOK_URL:"https://medixdeck-ui.vercel.app",VITE_WHATSAPP_COMMUNITY_LINK:"https://medixdeck.com/whatsapp"},wy={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",_o="rgba(239,68,68,0.08)",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:"m14 9-3 3 3 3"})]}),mf=()=>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"})]}),Sy=()=>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"})]}),Cy=()=>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"})]}),xf=({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"})}),No=()=>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"})]}),jy=()=>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"})]}),Ty=()=>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"})]}),By=()=>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"})]}),Ey=()=>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"})}),Fy=()=>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"})]}),Ay=()=>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"})]}),Ly=()=>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"})]}),Iy=()=>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"})]}),Dy=()=>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"})]}),Ry=(e,t)=>o.jsx("a",{href:e.href,style:{textDecoration:"none",display:"block"},children:t});function My(){const e=new Date().getHours();return e<12?"Good morning":e<17?"Good afternoon":"Good evening"}const $l={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 Py(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}&&ky){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 Oy(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 zy({detectedEnv:e,config:t,onDismiss:n}){const r=t.status??(e==="staging"||e==="preview"?"info":e==="test"?"error":"warning"),i=$l[r]??$l.warning,s=t.badgeLabel??Oy(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(Ly,{}):r==="error"?o.jsx(Iy,{}):o.jsx(Ay,{});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(Dy,{})})]})]})}const Lr=[{value:"light",label:"Light mode",shortLabel:"Light",icon:o.jsx(By,{})},{value:"dark",label:"Dark mode",shortLabel:"Dark",icon:o.jsx(Ey,{})},{value:"system",label:"System theme",shortLabel:"System",icon:o.jsx(Fy,{})}];function _y({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 Vo({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(Vo,{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(xf,{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(Vo,{item:C,renderLink:t,onClick:n,scheme:r,isCollapsed:!1,isSubItem:!0},C.href))})})]})}let Gl=!1;function Ny(){if(typeof document>"u"||Gl)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; }
355
355
  }
356
- `,document.head.appendChild(e),$l=!0}function zy({items:e,renderLink:t,scheme:n}){return k.useEffect(()=>{Oy()},[]),o.jsx(f.Box,{as:"nav","aria-label":"Mobile bottom navigation",display:{base:"flex",md:"none"},position:"fixed",bottom:"0",left:"0",right:"0",zIndex:"docked",bg:"bg",borderTop:"1px solid",borderColor:"border",alignItems:"center",style:{minHeight:64,paddingBottom:"env(safe-area-inset-bottom, 0px)",boxShadow:"none",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)",animation:"medixMobileNavIn 0.42s cubic-bezier(0.22,1,0.36,1) both"},children:e.slice(0,5).map(r=>{const i=r.isActive??!1,s=o.jsxs(st.div,{whileTap:{scale:.82},transition:{type:"spring",stiffness:500,damping:30,mass:.7},style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flex:1,height:"100%",padding:"6px 4px 4px",cursor:"pointer",position:"relative",gap:4,textDecoration:"none",WebkitTapHighlightColor:"transparent"},children:[o.jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:7,left:"50%",width:44,height:28,borderRadius:14,background:n.activeBgLight,transform:`translateX(-50%) scaleX(${i?1:0})`,opacity:i?1:0,transition:"transform 0.3s cubic-bezier(0.22,1,0.36,1), opacity 0.2s ease",pointerEvents:"none"}}),o.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",position:"relative",zIndex:1,color:i?n.chakraToken:"text.muted",style:{transition:"color 0.18s ease",opacity:i?1:.6},children:[r.icon,typeof r.badge=="number"&&r.badge>0&&o.jsx("span",{"aria-label":`${r.badge} unread`,style:{position:"absolute",top:-5,right:-6,minWidth:16,height:16,borderRadius:8,background:n.solid,color:"#fff",fontSize:9,fontWeight:700,fontFamily:"var(--font-body)",display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"0 3px",lineHeight:1,boxShadow:"0 0 0 2px var(--chakra-colors-bg, #fff)",pointerEvents:"none"},children:r.badge>99?"99+":r.badge}),r.isNew&&(!r.badge||r.badge<=0)&&o.jsx("span",{"aria-label":"New feature",style:{position:"absolute",top:-2,right:-2,width:6,height:6,borderRadius:3,background:n.solid,boxShadow:"0 0 0 2px var(--chakra-colors-bg, #fff)",pointerEvents:"none"}})]}),o.jsx(f.Box,{as:"span",fontSize:"2xs",fontWeight:i?"700":"500",fontFamily:"var(--font-body)",textAlign:"center",lineHeight:"1",position:"relative",zIndex:1,color:i?n.chakraToken:"text.muted",style:{transition:"color 0.18s ease",letterSpacing:i?"-0.01em":"0"},children:r.label})]}),a={label:r.label,href:r.href,isActive:r.isActive};return o.jsx(f.Box,{flex:"1",display:"flex",alignItems:"stretch",justifyContent:"center",h:"16",style:{textDecoration:"none"},children:t(a,s)},r.href)})})}const _y={bronze:{label:"Bronze Clinician",color:"#92400E",ring:"#D97706",bg:"rgba(217,119,6,0.10)"},silver:{label:"Silver Clinician",color:"#475569",ring:"#94A3B8",bg:"rgba(148,163,184,0.10)"},gold:{label:"Gold Clinician",color:"#D97706",ring:"#F59E0B",bg:"rgba(245,158,11,0.10)"},platinum:{label:"Platinum Clinician",color:"#0284C7",ring:"#38BDF8",bg:"rgba(56,189,248,0.10)"},diamond:{label:"Diamond Clinician",color:"#7C3AED",ring:"#A78BFA",bg:"rgba(167,139,250,0.10)"}},Ny=({color:e})=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"8",r:"6"}),o.jsx("path",{d:"M15.477 12.89L17 22l-5-3-5 3 1.523-9.11"})]}),Vy=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("polyline",{points:"9 18 15 12 9 6"})});function Wy({data:e,renderLink:t,isCollapsed:n=!1}){const r=_y[e.tier],i=e.name.split(" ").map(a=>a[0]).join("").slice(0,2).toUpperCase();if(n){const a=o.jsx(f.Box,{display:"flex",justifyContent:"center",alignItems:"center",w:"full",my:"2",children:o.jsx(At,{label:`${e.role} — ${e.name} (${r.label}, ${e.medixScore} pts)`,placement:"right",children:o.jsx(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",w:"36px",h:"36px",mx:"auto","aria-label":`${e.role} ${e.name}`,cursor:e.link?"pointer":"default",children:o.jsx("div",{style:{flexShrink:0,padding:2,borderRadius:"50%",background:`linear-gradient(135deg, ${r.ring}, ${r.color})`},children:e.avatarSrc?o.jsx("img",{src:e.avatarSrc,alt:e.name,style:{width:36,height:36,borderRadius:"50%",objectFit:"cover",display:"block"}}):o.jsx("div",{style:{width:36,height:36,borderRadius:"50%",background:r.bg,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:700,color:r.color,fontFamily:"var(--font-heading)"},children:i})})})})});return e.link?o.jsx(o.Fragment,{children:t({label:e.role,href:e.link},a)}):o.jsx(o.Fragment,{children:a})}const s=o.jsxs(f.Box,{mx:"3",my:"4",borderRadius:"card",border:"1px solid",borderColor:"border",bg:"bg",overflow:"hidden",style:{cursor:e.link?"pointer":"default"},_hover:e.link?{borderColor:r.ring,boxShadow:`0 0 0 1px ${r.ring}40`}:void 0,transition:"border-color 0.15s ease, box-shadow 0.15s ease",children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"3",px:"3",pt:"3",pb:"2.5",children:[o.jsx("div",{style:{flexShrink:0,padding:2,borderRadius:"50%",background:`linear-gradient(135deg, ${r.ring}, ${r.color})`},children:e.avatarSrc?o.jsx("img",{src:e.avatarSrc,alt:e.name,style:{width:40,height:40,borderRadius:"50%",objectFit:"cover",display:"block"}}):o.jsx("div",{style:{width:40,height:40,borderRadius:"50%",background:r.bg,display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,fontWeight:700,color:r.color,fontFamily:"var(--font-heading)"},children:i})}),o.jsxs(f.Box,{flex:"1",minW:"0",children:[o.jsx(f.Box,{fontSize:"sm",fontWeight:"700",fontFamily:"var(--font-heading)",color:"text.heading",lineHeight:"1.2",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.role}),o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",lineHeight:"1.3",mt:"0.5",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.name})]}),e.link&&o.jsx(f.Box,{color:"text.muted",flexShrink:0,children:o.jsx(Vy,{})})]}),o.jsx(f.Box,{borderTop:"1px solid",borderColor:"border"}),o.jsxs(f.Box,{px:"3",pt:"2",pb:"2.5",children:[o.jsx(f.Box,{fontSize:"10px",fontWeight:"600",letterSpacing:"wider",color:"text.muted",fontFamily:"var(--font-body)",mb:"1",children:"MedixScore"}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",flexWrap:"nowrap",children:[o.jsx(Ny,{color:r.color}),o.jsx(f.Box,{fontSize:"sm",fontWeight:"500",fontFamily:"var(--font-body)",style:{color:r.color,whiteSpace:"nowrap"},children:r.label}),o.jsxs(f.Box,{fontSize:"sm",fontWeight:"500",color:"text.heading",fontFamily:"var(--font-body)",ml:"1",style:{whiteSpace:"nowrap"},children:[e.medixScore.toLocaleString()," ",Number(e.medixScore)===1?"pt":"pts"]})]})]})]});return e.link?o.jsx(o.Fragment,{children:t({label:e.role,href:e.link},s)}):o.jsx(o.Fragment,{children:s})}function Hy({logo:e,collapsedLogo:t,navGroups:n,isOpen:r,onClose:i,onLogout:s,renderLink:a,sidebarWidth:l,collapsedSidebarWidth:d,isCollapsed:c,collapsible:u,onToggleCollapse:h,collapseTogglePlacement:m,scheme:p,scoreCard:x}){const[g,v]=k.useState(!1);return o.jsxs(o.Fragment,{children:[r&&o.jsx(f.Box,{display:{base:"block",md:"none"},position:"fixed",inset:"0",zIndex:"overlay",bg:"blackAlpha.500",onClick:i,"aria-hidden":"true"}),o.jsxs(f.Box,{as:"aside","aria-label":"Main navigation",position:"fixed",top:"0",left:"0",bottom:"0",w:{base:`${l}px`,md:`${c?d:l}px`},zIndex:{base:"modal",md:c?1200:"sticky"},bg:"bg",borderRight:"1px solid",borderColor:"border",display:"flex",flexDirection:"column",transform:{base:r?"translateX(0)":`translateX(-${l+10}px)`,md:"translateX(0)"},transition:"transform 0.25s cubic-bezier(0.22,1,0.36,1), width 0.22s cubic-bezier(0.2,0,0,1)",children:[o.jsxs(f.Box,{h:c?{base:"16",md:"auto"}:"16",minH:c?{base:"16",md:"84px"}:"16",px:c?{base:"5",md:"2"}:"5",py:c?{base:"0",md:"3"}:"0",flexShrink:0,borderBottom:"1px solid",borderColor:"border",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",children:[o.jsxs(f.Box,{display:{base:"none",md:c?"flex":"none"},flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"2",w:"full",children:[o.jsx(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",children:t??o.jsx(cn,{type:"icon",variant:p.chakraToken==="blue.500"?"blue":"purple",height:26})}),u&&(m==="sidebar-header"||m==="both")&&o.jsx(At,{label:"Expand sidebar",placement:"right",children:o.jsx(f.Box,{as:"button",display:"inline-flex",alignItems:"center",justifyContent:"center",w:"8",h:"8",p:"0",borderRadius:"md",border:"none",bg:"transparent",color:"text.muted",cursor:"pointer",_hover:{bg:"bg.subtle",color:"text.heading"},onClick:h,"aria-label":"Expand sidebar",transition:"background 0.15s ease, color 0.15s ease",children:o.jsx(pf,{})})})]}),o.jsxs(f.Box,{display:{base:"flex",md:c?"none":"flex"},alignItems:"center",justifyContent:"space-between",w:"full",minW:"0",children:[o.jsx(f.Box,{flex:"1",minW:"0",overflow:"hidden",children:e}),u&&(m==="sidebar-header"||m==="both")&&o.jsx(At,{label:"Collapse sidebar",placement:"bottom",children:o.jsx(f.Box,{as:"button",display:{base:"none",md:"inline-flex"},alignItems:"center",justifyContent:"center",w:"8",h:"8",p:"0",borderRadius:"md",border:"none",bg:"transparent",color:"text.muted",cursor:"pointer",_hover:{bg:"bg.subtle",color:"text.heading"},onClick:h,"aria-label":"Collapse sidebar",transition:"background 0.15s ease, color 0.15s ease",children:o.jsx(hf,{})})})]})]}),x&&o.jsx(f.Box,{display:{base:"none",md:c?"flex":"block"},justifyContent:c?"center":void 0,alignItems:c?"center":void 0,w:"full",flexShrink:0,pt:c?"1":"3",children:o.jsx(Wy,{data:x,renderLink:a,isCollapsed:c})}),o.jsx(f.Box,{flex:"1",overflowY:c?"visible":"auto",overflowX:c?"visible":"hidden",position:"relative",py:"3",px:c?"2":"3",children:n.map((y,j)=>o.jsxs(f.Box,{mb:c?"2":"4",children:[y.groupLabel&&(c?j>0?o.jsx(f.Box,{h:"1px",bg:"border",mx:"2",my:"2"}):null:o.jsx(f.Box,{px:"3",pb:"2",pt:j>0?"2":void 0,fontSize:"10px",fontWeight:"700",letterSpacing:"widest",textTransform:"uppercase",color:"text.muted",fontFamily:"var(--font-body)",children:y.groupLabel})),o.jsx(f.Box,{display:"flex",flexDirection:"column",gap:c?"1.5":"0.5",children:y.items.map(w=>o.jsx(No,{item:w,renderLink:a,onClick:i,scheme:p,isCollapsed:c},w.href))})]},j))}),o.jsx(f.Box,{px:c?"2":"3",pb:"4",pt:"2",flexShrink:0,borderTop:"1px solid",borderColor:"border",display:c?"flex":"block",justifyContent:c?"center":void 0,alignItems:c?"center":void 0,w:"full",children:c?o.jsx(At,{label:"Log out",placement:"right",children:o.jsx(f.Box,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",w:"10",h:"10",mx:"auto",borderRadius:"lg",border:"none",bg:"transparent",cursor:"pointer","aria-label":"Log out",onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),onClick:()=>{i(),s==null||s()},style:{background:g?zo:"transparent",color:Bt,transition:"background 0.15s ease"},children:o.jsx(f.Box,{flexShrink:0,style:{color:Bt},children:o.jsx(_o,{})})})}):o.jsxs(f.Box,{as:"button",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"3",w:"full",px:"3",py:"2.5",borderRadius:"lg",border:"none",bg:"transparent",cursor:"pointer","aria-label":"Log out",onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),onClick:()=>{i(),s==null||s()},style:{background:g?zo:"transparent",color:Bt,transition:"background 0.15s ease"},children:[o.jsx(f.Box,{flexShrink:0,style:{color:Bt},children:o.jsx(_o,{})}),o.jsx(f.Box,{as:"span",fontSize:"sm",fontWeight:"500",fontFamily:"var(--font-body)",style:{color:Bt},children:"Log out"})]})})]})]})}function Uy({user:e,greeting:t,greetingSubtext:n,isSidebarOpen:r,onMenuToggle:i,sidebarWidth:s,topBarSlot:a,dropdownItems:l,onLogout:d,scheme:c,collapsible:u=!0,isCollapsed:h=!1,onToggleCollapse:m,collapseTogglePlacement:p="sidebar-header"}){const[x,g]=k.useState(!1),v=k.useRef(null),y=k.useId(),j=`user-menu-button-${y}`,w=`user-menu-dropdown-${y}`;return k.useEffect(()=>{const A=B=>{v.current&&!v.current.contains(B.target)&&g(!1)};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[]),o.jsxs(f.Box,{as:"header",role:"banner",position:"sticky",top:"0",zIndex:"docked",bg:"bg",borderBottom:"1px solid",borderColor:"border",h:"16",minH:"16",maxH:"16",flexShrink:0,display:"flex",alignItems:"center",px:{base:"4",md:"6"},gap:"4",children:[o.jsx(f.Box,{as:"button",display:{base:"flex",md:"none"},alignItems:"center",justifyContent:"center",border:"none",bg:"transparent",p:"1",cursor:"pointer",color:"text.body",borderRadius:"md",_hover:{bg:"bg.subtle"},onClick:i,"aria-label":r?"Close navigation menu":"Open navigation menu","aria-expanded":r,children:r?o.jsx(ky,{}):o.jsx(vy,{})}),u&&(p==="topbar"||p==="both")&&o.jsx(At,{label:h?"Expand sidebar":"Collapse sidebar",placement:"bottom",children:o.jsx(f.Box,{as:"button",display:{base:"none",md:"inline-flex"},alignItems:"center",justifyContent:"center",w:"8",h:"8",p:"0",borderRadius:"md",border:"none",bg:"transparent",color:"text.muted",cursor:"pointer",_hover:{bg:"bg.subtle",color:"text.heading"},onClick:m,"aria-label":h?"Expand sidebar":"Collapse sidebar",transition:"background 0.15s ease, color 0.15s ease",children:h?o.jsx(pf,{}):o.jsx(hf,{})})}),o.jsxs(f.Box,{flex:"1",minW:"0",children:[o.jsxs(f.Box,{as:"p",fontSize:{base:"sm",md:"md"},fontWeight:"700",fontFamily:"var(--font-body)",color:"text.heading",lineHeight:"1.3",children:[t,","," ",o.jsx(f.Box,{as:"span",fontWeight:"700",color:"text.heading",children:e.name})]}),n&&o.jsx(f.Box,{as:"p",fontSize:{base:"2xs",md:"xs"},fontWeight:"400",fontFamily:"var(--font-body)",color:"text.heading",mt:"0.5",lineHeight:"1.4",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n})]}),a,o.jsx(Py,{scheme:c}),o.jsxs(f.Box,{position:"relative",ref:v,children:[o.jsxs(f.Box,{as:"button",id:j,display:"flex",alignItems:"center",gap:"2",bg:"transparent",border:"none",cursor:"pointer",borderRadius:"full",p:"1",_hover:{bg:"bg.subtle"},onClick:()=>g(A=>!A),"aria-haspopup":"menu","aria-expanded":x,"aria-controls":x?w:void 0,"aria-label":"User menu",children:[o.jsx(ui,{name:e.name,src:e.avatarSrc,size:"sm"}),o.jsx(f.Box,{color:"text.muted",children:o.jsx(mf,{open:x})})]}),x&&o.jsxs(f.Box,{role:"menu","aria-labelledby":j,id:w,position:"absolute",top:"calc(100% + 8px)",right:"0",minW:"200px",bg:"bg",border:"1px solid",borderColor:"border",borderRadius:"xl",boxShadow:"none",zIndex:"popover",overflow:"hidden",py:"1",children:[o.jsxs(f.Box,{px:"4",py:"3",borderBottom:"1px solid",borderColor:"border",children:[o.jsx(f.Box,{fontSize:"sm",fontWeight:"700",color:"text.heading",fontFamily:"var(--font-body)",children:e.name}),e.email&&o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:e.email})]}),!l&&o.jsxs(o.Fragment,{children:[o.jsx(Ir,{icon:o.jsx(wy,{}),label:"My Profile",onClick:()=>g(!1),scheme:c}),o.jsx(Ir,{icon:o.jsx(Sy,{}),label:"Settings",onClick:()=>g(!1),scheme:c})]}),l==null?void 0:l.map((A,B)=>o.jsx(Ir,{icon:A.icon,label:A.label,isDanger:A.isDanger,onClick:()=>{var C;g(!1),(C=A.onClick)==null||C.call(A)},scheme:c},B)),o.jsx(f.Box,{borderTop:"1px solid",borderColor:"border",my:"1"}),o.jsx(Ir,{icon:o.jsx(_o,{}),label:"Log out",isDanger:!0,onClick:()=>{g(!1),d==null||d()},scheme:c})]})]})]})}function Ir({icon:e,label:t,isDanger:n,onClick:r,scheme:i}){const[s,a]=k.useState(!1);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:"transparent",cursor:"pointer",textAlign:"left",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onClick:r,style:{background:s?n?zo:i.hoverBgLight:"transparent",color:n?Bt:void 0,transition:"background 0.12s ease"},children:[e&&o.jsx(f.Box,{flexShrink:0,style:{color:n?Bt:void 0},color:"text.muted",children:e}),o.jsx(f.Box,{as:"span",fontSize:"sm",fontWeight:"500",fontFamily:"var(--font-body)",style:{color:n?Bt:void 0},color:n?void 0:"text.body",children:t})]})}function xf({children:e,logo:t,navGroups:n,user:r,greeting:i,greetingSubtext:s,onLogout:a,renderLink:l=Ly,dropdownItems:d,topBarSlot:c,sidebarWidth:u=220,collapsedSidebarWidth:h=68,collapsible:m=!0,defaultCollapsed:p=!1,isCollapsed:x,onCollapseChange:g,collapsedLogo:v,collapseTogglePlacement:y="sidebar-header",colorScheme:j="blue",mobileNavItems:w,scoreCard:A,environment:B="auto",showEnvironmentBanner:C,environmentBanner:O,environmentBannerSlot:E,...F}){const[L,R]=k.useState(!1),[D,N]=k.useState(p),[P,I]=k.useState(!1),[M,U]=k.useState(!1);k.useEffect(()=>{U(!0)},[]);const G=m&&(x!==void 0?x:D),H=()=>{if(!m)return;const ee=!G;x===void 0&&N(ee),g==null||g(ee)},b=by[j],W=!!(w&&w.length>0),ne=i??Iy(),T=t??o.jsx(cn,{variant:j,height:26}),be=v??o.jsx(cn,{type:"icon",variant:j,height:26}),ke=O||{},J=ke.environment||B,{isNonProduction:X,detectedEnv:te}=Dy(J),de=!P&&(C!==void 0?C:M?X:J!=="production"&&J!=="live");return o.jsxs(f.Box,{display:"flex",minH:"100vh",bg:"bg",...F,children:[o.jsx(Hy,{logo:T,collapsedLogo:be,navGroups:n,isOpen:L,onClose:()=>R(!1),onLogout:a,renderLink:l,sidebarWidth:u,collapsedSidebarWidth:h,isCollapsed:G,collapsible:m,onToggleCollapse:H,collapseTogglePlacement:y,scheme:b,scoreCard:A}),o.jsxs(f.Box,{flex:"1",display:"flex",flexDirection:"column",minW:"0",ml:{base:"0",md:`${G?h:u}px`},transition:"margin-left 0.22s cubic-bezier(0.2,0,0,1)",children:[de&&(E??o.jsx(My,{detectedEnv:te,config:ke,onDismiss:()=>{var ee;I(!0),(ee=ke.onDismiss)==null||ee.call(ke)}})),o.jsx(Uy,{user:r,greeting:ne,greetingSubtext:s,isSidebarOpen:L,onMenuToggle:()=>R(ee=>!ee),sidebarWidth:u,topBarSlot:c,dropdownItems:d,onLogout:a,scheme:b,collapsible:m,isCollapsed:G,onToggleCollapse:H,collapseTogglePlacement:y}),o.jsx(f.Box,{as:"main",id:"main-content",role:"main",flex:"1",overflowY:"auto",bg:"bg.subtle",p:{base:"4",md:"6",lg:"8"},pb:W?{base:"20",md:"6",lg:"8"}:{base:"4",md:"6",lg:"8"},children:e})]}),W&&o.jsx(zy,{items:w,renderLink:l,scheme:b})]})}xf.displayName="MedixDashboardLayout";const ri=[0,0,.2,1],_s=[.4,0,1,1],Ns=[.22,1,.36,1],$y={hidden:{opacity:0,y:-8,scaleY:.96,transformOrigin:"top"},visible:{opacity:1,y:0,scaleY:1,transformOrigin:"top",transition:{duration:.22,ease:Ns}},exit:{opacity:0,y:-6,scaleY:.97,transformOrigin:"top",transition:{duration:.16,ease:_s}}},Gy={hidden:{},visible:{transition:{staggerChildren:.045,delayChildren:.06}}},Gl={hidden:{opacity:0,x:-10},visible:{opacity:1,x:0,transition:{duration:.2,ease:ri}}},Yy={hidden:{opacity:0,y:10},visible:{opacity:1,y:0,transition:{duration:.22,ease:ri,delay:.18}}},Ky={hidden:{opacity:0,y:-6,scale:.98,transformOrigin:"top"},visible:{opacity:1,y:0,scale:1,transformOrigin:"top",transition:{duration:.18,ease:Ns}},exit:{opacity:0,y:-4,scale:.98,transformOrigin:"top",transition:{duration:.12,ease:_s}}},qy={hidden:{opacity:0,height:0,overflow:"hidden"},visible:{opacity:1,height:"auto",overflow:"hidden",transition:{duration:.22,ease:Ns}},exit:{opacity:0,height:0,overflow:"hidden",transition:{duration:.16,ease:_s}}},Xy={blue:{solid:"#0685FF",hover:"#0685FF",hoverBg:"blue.50",hoverBgDark:"rgba(6,133,255,0.12)",badgeBg:"#EFF6FF",badgeColor:"#0685FF",badgeBgDark:"rgba(6,133,255,0.20)",badgeColorDark:"#60A5FA"},purple:{solid:"#7700CC",hover:"#7700CC",hoverBg:"purple.50",hoverBgDark:"rgba(119,0,204,0.12)",badgeBg:"#FAF5FF",badgeColor:"#7700CC",badgeBgDark:"rgba(119,0,204,0.20)",badgeColorDark:"#C084FC"}},Zy=()=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("line",{x1:"7",y1:"17",x2:"17",y2:"7"}),o.jsx("polyline",{points:"7 7 17 7 17 17"})]});function gf({isOpen:e}){return 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 cubic-bezier(0.22, 1, 0.36, 1)",transform:e?"rotate(180deg)":"rotate(0deg)",flexShrink:0},children:o.jsx("polyline",{points:"6 9 12 15 18 9"})})}function ii(){return o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{opacity:.65,flexShrink:0},children:[o.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),o.jsx("polyline",{points:"15 3 21 3 21 9"}),o.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})}function Jy({color:e}){return o.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{width:"32",height:"32",rx:"8",fill:e}),o.jsx("path",{d:"M9.25 10.75H22.75",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("path",{d:"M9.25 16H22.75",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("path",{d:"M9.25 21.25H22.75",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Qy({color:e}){return o.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{width:"32",height:"32",rx:"8",fill:e}),o.jsx("path",{d:"M13.8801 16.71L8.93005 21.66L10.3401 23.07L13.1701 20.24L16.0001 17.41L18.1201 19.54L21.6601 23.07L23.0701 21.66L18.1201 16.71L17.4101 16L23.0701 10.34L21.6601 8.92999L16.0001 14.59L10.3401 8.92999L8.93005 10.34L14.5901 16L13.8801 16.71Z",fill:"white"})]})}const e2=(e,t)=>{const n=e.href??"#",r=e.target??(e.isExternal?"_blank":void 0),i=e.rel??(e.isExternal?"noopener noreferrer":void 0);return n==="#"&&!e.onClick?o.jsx("span",{style:{textDecoration:"none",display:"contents"},children:t}):o.jsx("a",{href:n,target:r,rel:i,onClick:e.onClick,style:{textDecoration:"none",display:"contents"},children:t})};function Dn({badge:e,scheme:t}){return e?k.isValidElement(e)?e:o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",px:"1.5",py:"0.5",fontSize:"10px",fontWeight:"semibold",lineHeight:"1",borderRadius:"badge",bg:t.badgeBg,color:t.badgeColor,_dark:{bg:t.badgeBgDark,color:t.badgeColorDark},border:"1px solid",borderColor:t.badgeColor,style:{borderColor:"currentColor",opacity:.9},children:e}):null}function t2({item:e,scheme:t,renderLink:n}){var u;const[r,i]=k.useState(!1),s=k.useRef(null),a=k.useRef(null),l=!!(e.children&&e.children.length>0);k.useEffect(()=>{if(!r)return;function h(p){s.current&&!s.current.contains(p.target)&&i(!1)}function m(p){p.key==="Escape"&&i(!1)}return document.addEventListener("mousedown",h),document.addEventListener("keydown",m),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",m)}},[r]);const d=()=>{a.current&&(clearTimeout(a.current),a.current=null),l&&i(!0)},c=()=>{l&&(a.current=setTimeout(()=>{i(!1)},150))};return l?o.jsxs(f.Box,{as:"li",ref:s,listStyleType:"none",position:"relative",onMouseEnter:d,onMouseLeave:c,children:[o.jsxs(f.Box,{as:"button","aria-haspopup":"menu","aria-expanded":r,onClick:()=>i(!r),display:"inline-flex",alignItems:"center",gap:"1.5",px:"3",py:"2",fontSize:"sm",fontWeight:"medium",fontFamily:"var(--font-body)",color:e.isActive||r?t.hover:"text.body",bg:r?t.hoverBg:"transparent",_dark:{color:e.isActive||r?t.hover:"text.body",bg:r?t.hoverBgDark:"transparent",_hover:{color:t.hover,bg:t.hoverBgDark}},borderRadius:"md",border:"none",cursor:"pointer",transition:"all 0.15s",_hover:{color:t.hover,bg:t.hoverBg},children:[e.icon&&o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",flexShrink:0,children:e.icon}),o.jsx("span",{children:e.label}),o.jsx(Dn,{badge:e.badge,scheme:t}),o.jsx(gf,{isOpen:r})]}),o.jsx(dr,{children:r&&o.jsx(st.div,{variants:Ky,initial:"hidden",animate:"visible",exit:"exit",style:{position:"absolute",top:"calc(100% + 6px)",left:0,zIndex:1e3},children:o.jsx(f.Box,{bg:"bg",border:"1px solid",borderColor:"border",borderRadius:"card",p:"2",minW:"260px",maxW:"380px",display:"flex",flexDirection:"column",gap:"1",role:"menu","aria-label":e.label,children:(u=e.children)==null?void 0:u.map((h,m)=>o.jsx(f.Box,{as:"div",role:"none",children:n(h,o.jsxs(f.Box,{as:"span",role:"menuitem",display:"flex",alignItems:"flex-start",gap:"3",p:"2.5",borderRadius:"md",cursor:"pointer",transition:"all 0.15s ease",color:"text.heading",_hover:{bg:t.hoverBg,color:t.hover},_dark:{color:"text.heading",_hover:{bg:t.hoverBgDark,color:t.hover}},onClick:()=>i(!1),children:[h.icon&&o.jsx(f.Box,{as:"span",w:"8",h:"8",borderRadius:"md",bg:"bg.subtle",display:"flex",alignItems:"center",justifyContent:"center",color:t.solid,flexShrink:0,mt:"0.5",children:h.icon}),o.jsxs(f.Box,{flex:"1",minW:"0",children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1.5",justifyContent:"space-between",children:[o.jsxs(f.Box,{as:"span",display:"inline-flex",alignItems:"center",gap:"1.5",fontSize:"sm",fontWeight:"semibold",fontFamily:"var(--font-heading)",children:[o.jsx("span",{children:h.label}),h.isExternal&&o.jsx(ii,{})]}),o.jsx(Dn,{badge:h.badge,scheme:t})]}),h.description&&o.jsx(f.Box,{as:"span",display:"block",fontSize:"xs",color:"text.body",_dark:{color:"text.body"},fontFamily:"var(--font-body)",mt:"0.5",lineHeight:"1.4",children:h.description})]})]}))},h.href||`${h.label}-${m}`))})})})]}):o.jsx(f.Box,{as:"li",listStyleType:"none",children:n(e,o.jsxs(f.Box,{as:"span",display:"inline-flex",alignItems:"center",gap:"1.5",px:"3",py:"2",fontSize:"sm",fontWeight:"medium",fontFamily:"var(--font-body)",color:e.isActive?t.hover:"text.body",_dark:{color:e.isActive?t.hover:"text.body",_hover:{bg:t.hoverBgDark,color:t.hover}},borderRadius:"md",transition:"all 0.15s",_hover:{color:t.hover,bg:t.hoverBg},cursor:"pointer",children:[e.icon&&o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",flexShrink:0,children:e.icon}),o.jsx("span",{children:e.label}),o.jsx(Dn,{badge:e.badge,scheme:t}),e.isExternal&&o.jsx(ii,{})]}))})}function n2({item:e,scheme:t,renderLink:n,onCloseMenu:r}){var l;const[i,s]=k.useState(!1);return!(e.children&&e.children.length>0)?o.jsx(st.li,{variants:Gl,children:n(e,o.jsxs(f.Box,{as:"span",display:"flex",alignItems:"center",justifyContent:"space-between",px:"3",py:"2.5",fontSize:"md",fontWeight:"medium",fontFamily:"var(--font-body)",color:e.isActive?t.hover:"text.body",_dark:{color:e.isActive?t.hover:"text.body",_hover:{color:t.hover,bg:"bg.subtle"}},borderRadius:"md",_hover:{color:t.hover,bg:"bg.subtle"},cursor:"pointer",onClick:r,children:[o.jsxs(f.Box,{as:"span",display:"inline-flex",alignItems:"center",gap:"2",children:[e.icon&&o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",color:t.solid,children:e.icon}),o.jsx("span",{children:e.label})]}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1.5",children:[o.jsx(Dn,{badge:e.badge,scheme:t}),e.isExternal&&o.jsx(ii,{})]})]}))}):o.jsxs(st.li,{variants:Gl,style:{listStyle:"none"},children:[o.jsxs(f.Box,{as:"button",onClick:()=>s(!i),"aria-expanded":i,display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",px:"3",py:"2.5",fontSize:"md",fontWeight:"medium",fontFamily:"var(--font-body)",color:e.isActive||i?t.hover:"text.body",bg:i?"bg.subtle":"transparent",_dark:{color:e.isActive||i?t.hover:"text.body",bg:i?"bg.subtle":"transparent",_hover:{color:t.hover,bg:"bg.subtle"}},borderRadius:"md",border:"none",cursor:"pointer",textAlign:"left",transition:"background 0.15s ease, color 0.15s ease",_hover:{color:t.hover,bg:"bg.subtle"},children:[o.jsxs(f.Box,{as:"span",display:"inline-flex",alignItems:"center",gap:"2",children:[e.icon&&o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",color:t.solid,children:e.icon}),o.jsx("span",{children:e.label})]}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",children:[o.jsx(Dn,{badge:e.badge,scheme:t}),o.jsx(gf,{isOpen:i})]})]}),o.jsx(dr,{children:i&&o.jsx(st.div,{variants:qy,initial:"hidden",animate:"visible",exit:"exit",children:o.jsx(f.Box,{pl:"4",pr:"2",py:"1.5",display:"flex",flexDirection:"column",gap:"1",borderLeft:"2px solid",borderColor:"border",ml:"4",my:"1",children:(l=e.children)==null?void 0:l.map((d,c)=>o.jsx(f.Box,{as:"div",children:n(d,o.jsxs(f.Box,{as:"span",display:"flex",alignItems:"flex-start",gap:"2.5",px:"2.5",py:"2",borderRadius:"md",color:"text.body",_dark:{color:"text.body",_hover:{color:t.hover,bg:"bg.subtle"}},_hover:{color:t.hover,bg:"bg.subtle"},cursor:"pointer",onClick:r,children:[d.icon&&o.jsx(f.Box,{as:"span",w:"6",h:"6",borderRadius:"md",bg:"bg.subtle",display:"flex",alignItems:"center",justifyContent:"center",color:t.solid,flexShrink:0,mt:"0.5",children:d.icon}),o.jsxs(f.Box,{flex:"1",minW:"0",children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"1",children:[o.jsxs(f.Box,{as:"span",display:"inline-flex",alignItems:"center",gap:"1",fontSize:"sm",fontWeight:"medium",fontFamily:"var(--font-heading)",children:[o.jsx("span",{children:d.label}),d.isExternal&&o.jsx(ii,{})]}),o.jsx(Dn,{badge:d.badge,scheme:t})]}),d.description&&o.jsx(f.Box,{as:"span",display:"block",fontSize:"xs",color:"text.muted",_dark:{color:"text.muted"},fontFamily:"var(--font-body)",mt:"0.5",lineHeight:"1.3",children:d.description})]})]}))},d.href||`${d.label}-${c}`))})})})]})}function r2({logo:e,navItems:t=[],navItemsAlign:n="center",ctaLabel:r="Get Started",ctaHref:i,onCtaClick:s,ctaIconHref:a,onCtaIconClick:l,secondaryCtaLabel:d,secondaryCtaHref:c,onSecondaryCtaClick:u,ctaSlot:h,renderLink:m=e2,isSticky:p=!1,colorScheme:x="blue",variant:g="solid",...v}){const[y,j]=k.useState(!1),w=Xy[x],A=a??i,B=l??s,C=g==="blur"?{background:"rgba(10,18,32,0.85)",backdropFilter:"blur(12px)"}:{},O=({mobile:E=!1})=>o.jsxs(f.Box,{display:"flex",gap:"2",alignItems:"center",flexDirection:E?"column":"row",children:[d&&o.jsx(Qe,{as:c?"a":"button",href:c,variant:E?"outline":"ghost",colorScheme:x,size:E?"md":"sm",onClick:()=>{u==null||u(),E&&j(!1)},style:E?{width:"100%"}:void 0,children:d}),o.jsx(Qe,{as:i?"a":"button",href:i,variant:"solid",colorScheme:x,size:E?"md":"sm",onClick:()=>{s==null||s(),E&&j(!1)},style:E?{width:"100%"}:void 0,children:r}),!E&&o.jsx(Qe,{as:A?"a":"button",href:A,target:A&&A!==i?"_blank":void 0,rel:A&&A!==i?"noopener noreferrer":void 0,variant:"solid",colorScheme:x,size:"sm",onClick:B,"aria-label":"Open",style:{width:34,height:34,padding:0,borderRadius:8,flexShrink:0},children:o.jsx(Zy,{})})]});return o.jsxs(f.Box,{as:"nav",role:"navigation","aria-label":"Main navigation",position:p?"sticky":"relative",top:p?"0":void 0,zIndex:p?"sticky":40,bg:g==="transparent"?"transparent":g==="blur"?void 0:"bg",style:C,borderBottom:"1px solid",borderColor:g==="transparent"?"transparent":"border",transition:"background 0.2s ease, border-color 0.2s ease",...v,children:[o.jsxs(f.Box,{maxW:"1280px",mx:"auto",px:{base:"4",md:"6",lg:"8"},h:"16",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8",children:[o.jsx(f.Box,{flexShrink:0,children:e??o.jsx(cn,{variant:x==="blue"?"blue":"purple",height:28})}),o.jsx(f.Box,{as:"ul",display:{base:"none",md:"flex"},alignItems:"center",justifyContent:n==="left"?"flex-start":n==="right"?"flex-end":"center",gap:"1",listStyleType:"none",m:"0",p:"0",flex:"1",children:t.map((E,F)=>o.jsx(t2,{item:E,scheme:w,renderLink:m},E.href||`${E.label}-${F}`))}),o.jsx(f.Box,{display:{base:"none",md:"flex"},alignItems:"center",flexShrink:0,children:h??o.jsx(O,{})}),o.jsx(f.Box,{as:"button",display:{base:"flex",md:"none"},alignItems:"center",justifyContent:"center",border:"none",bg:"transparent",p:"0",cursor:"pointer",onClick:()=>j(!y),"aria-label":y?"Close menu":"Open menu","aria-expanded":y,position:"relative",width:"32px",height:"32px",flexShrink:0,children:o.jsx(dr,{mode:"wait",initial:!1,children:y?o.jsx(st.span,{initial:{opacity:0,rotate:-45,scale:.7},animate:{opacity:1,rotate:0,scale:1},exit:{opacity:0,rotate:45,scale:.7},transition:{duration:.18,ease:ri},style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(Qy,{color:w.solid})},"close"):o.jsx(st.span,{initial:{opacity:0,rotate:45,scale:.7},animate:{opacity:1,rotate:0,scale:1},exit:{opacity:0,rotate:-45,scale:.7},transition:{duration:.18,ease:ri},style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(Jy,{color:w.solid})},"hamburger")})})]}),o.jsx(dr,{children:y&&o.jsx(st.div,{variants:$y,initial:"hidden",animate:"visible",exit:"exit",style:{overflow:"hidden"},children:o.jsxs(f.Box,{display:{base:"block",md:"none"},bg:"bg",borderTop:"1px solid",borderColor:"border",py:"4",px:"4",children:[o.jsx(st.ul,{variants:Gy,initial:"hidden",animate:"visible",style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:4},children:t.map((E,F)=>o.jsx(n2,{item:E,scheme:w,renderLink:m,onCloseMenu:()=>j(!1)},E.href||`${E.label}-${F}`))}),o.jsx(st.div,{variants:Yy,initial:"hidden",animate:"visible",children:o.jsx(f.Box,{mt:"4",children:h??o.jsx(O,{mobile:!0})})})]})},"mobile-menu")})]})}const i2={blue:{solid:"#0685FF",solidHover:"#0066CC",token:"blue.500",focusRing:"var(--chakra-colors-blue-500)"},purple:{solid:"#7700CC",solidHover:"#5C00A3",token:"purple.500",focusRing:"var(--chakra-colors-purple-500)"}},o2=e=>({facebook:o.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),o.jsx("g",{clipPath:"url(#clip0_1217_192)",children:o.jsx("path",{d:"M11.0972 21V13.4923H9.112V10.7892H11.0972V8.4804C11.0972 6.66611 12.2698 5 14.9719 5C16.0659 5 16.8749 5.10488 16.8749 5.10488L16.8111 7.62914C16.8111 7.62914 15.9861 7.6211 15.0858 7.6211C14.1114 7.6211 13.9553 8.07014 13.9553 8.81544V10.7892H16.8886L16.761 13.4923H13.9553V21H11.0972Z",fill:"white"})}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1217_192",children:o.jsx("rect",{width:"8",height:"16",fill:"white",transform:"translate(9 5)"})})})]}),twitter:o.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),o.jsx("g",{clipPath:"url(#clip0_1217_186)",children:o.jsx("path",{d:"M14.8963 11.3512L20.3606 5H19.0656L14.3213 10.515L10.5319 5H6.16125L11.8913 13.3394L6.16125 20H7.45625L12.4663 14.1763L16.4681 20H20.8388L14.8963 11.3512ZM13.1231 13.4131L12.5425 12.5825L7.9225 5.975H9.91125L13.6394 11.3075L14.22 12.1381L19.0663 19.0694H17.0775L13.1231 13.4131Z",fill:"white"})}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1217_186",children:o.jsx("rect",{width:"15",height:"15",fill:"white",transform:"translate(6 5)"})})})]}),linkedin:o.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),o.jsx("g",{clipPath:"url(#clip0_1217_198)",children:o.jsx("path",{d:"M18.4298 5.31982H7.57025C6.97368 5.32059 6.40177 5.55791 5.97993 5.97975C5.55809 6.40158 5.32077 6.9735 5.32001 7.57006V18.4296C5.32077 19.0262 5.55809 19.5981 5.97993 20.0199C6.40177 20.4417 6.97368 20.6791 7.57025 20.6798H18.4298C19.0263 20.6791 19.5982 20.4417 20.0201 20.0199C20.4419 19.5981 20.6792 19.0262 20.68 18.4296V7.57006C20.6792 6.9735 20.4419 6.40158 20.0201 5.97975C19.5982 5.55791 19.0263 5.32059 18.4298 5.31982ZM10.7498 17.5003H8.94977V11.1998H10.7498V17.5003ZM10.7498 10.3003H8.94977V8.5003H10.7498V10.3003ZM17.0502 17.5003H15.2502V13.9003C15.2372 13.6704 15.1367 13.4542 14.9694 13.2961C14.802 13.1379 14.5805 13.0498 14.3502 13.0498C14.12 13.0498 13.8985 13.1379 13.7311 13.2961C13.5637 13.4542 13.4633 13.6704 13.4502 13.9003V17.5003H11.6502V11.1998H13.4502V11.5387C13.9216 11.3928 14.2278 11.1998 14.8 11.1998C16.0211 11.2008 17.0502 12.2961 17.0502 13.5902V17.5003Z",fill:"white"})}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1217_198",children:o.jsx("rect",{width:"16",height:"16",fill:"white",transform:"translate(5 5)"})})})]}),instagram:o.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),o.jsx("g",{clipPath:"url(#clip0_1217_183)",children:o.jsx("path",{d:"M10.3938 5.05251C9.5958 5.09014 9.05086 5.21751 8.57443 5.40464C8.08143 5.59682 7.66349 5.85464 7.24768 6.27195C6.83193 6.68926 6.5758 7.10745 6.38505 7.60132C6.20043 8.0787 6.0753 8.62414 6.04005 9.42257C6.0048 10.221 5.99699 10.4777 6.00093 12.5144C6.0048 14.5511 6.0138 14.8064 6.05249 15.6065C6.09061 16.4043 6.21749 16.9491 6.40468 17.4257C6.59718 17.9188 6.85468 18.3365 7.27218 18.7524C7.68961 19.1684 8.10749 19.4239 8.60249 19.6149C9.07949 19.7993 9.62505 19.925 10.4234 19.9599C11.2217 19.9949 11.4786 20.0031 13.5147 19.9991C15.5509 19.9953 15.8072 19.9862 16.6071 19.9483C17.4071 19.9103 17.949 19.7825 18.4257 19.5962C18.9188 19.4033 19.3369 19.1462 19.7525 18.7286C20.1681 18.311 20.4241 17.8925 20.6147 17.3984C20.7995 16.9214 20.925 16.3759 20.9597 15.5781C20.9947 14.7776 21.0029 14.522 20.9991 12.4856C20.9951 10.4492 20.9859 10.1939 20.948 9.39407C20.9101 8.59426 20.783 8.05114 20.5959 7.57426C20.4032 7.0812 20.1459 6.66376 19.7287 6.24751C19.3114 5.83126 18.8925 5.57551 18.3986 5.38532C17.9212 5.20064 17.3761 5.07482 16.5777 5.04032C15.7794 5.00582 15.5225 4.99689 13.4856 5.00089C11.4487 5.00476 11.1937 5.01351 10.3938 5.05251ZM10.4814 18.6107C9.75018 18.5789 9.35311 18.4574 9.08849 18.3557C8.73811 18.2207 8.48849 18.0575 8.2248 17.7963C7.96105 17.5352 7.79911 17.2847 7.6623 16.9351C7.55955 16.6704 7.4358 16.2738 7.40161 15.5426C7.36443 14.7523 7.35661 14.5149 7.35224 12.5126C7.34786 10.5103 7.35555 10.2732 7.39018 9.48257C7.42143 8.75195 7.54368 8.35445 7.64518 8.08995C7.78018 7.73914 7.9428 7.48995 8.20455 7.22645C8.4663 6.96289 8.71605 6.80057 9.06599 6.66376C9.33036 6.56057 9.72693 6.43789 10.4579 6.40307C11.2488 6.36557 11.4858 6.35807 13.4879 6.3537C15.4899 6.34932 15.7275 6.35682 16.5188 6.3917C17.2494 6.42345 17.6471 6.54451 17.9113 6.6467C18.2618 6.7817 18.5113 6.94382 18.7748 7.20607C19.0384 7.4682 19.2008 7.71707 19.3376 8.06776C19.4409 8.33132 19.5637 8.72776 19.5982 9.4592C19.6358 10.2501 19.6444 10.4873 19.6479 12.4892C19.6516 14.4911 19.6445 14.7288 19.6098 15.5192C19.5779 16.2504 19.4567 16.6476 19.3548 16.9126C19.2198 17.2628 19.0571 17.5126 18.7952 17.7759C18.5333 18.0394 18.2839 18.2016 17.9337 18.3384C17.6697 18.4415 17.2727 18.5645 16.5424 18.5993C15.7514 18.6365 15.5144 18.6443 13.5116 18.6487C11.5087 18.6531 11.2724 18.6449 10.4814 18.6107ZM16.5956 8.49151C16.5959 8.66953 16.649 8.84346 16.7481 8.99131C16.8473 9.13916 16.9881 9.25428 17.1527 9.32211C17.3173 9.38994 17.4983 9.40744 17.6728 9.37239C17.8473 9.33735 18.0076 9.25132 18.1332 9.12521C18.2588 8.9991 18.3443 8.83855 18.3787 8.66389C18.413 8.48922 18.3949 8.30828 18.3264 8.14395C18.258 7.97962 18.1423 7.83927 17.9941 7.74067C17.8459 7.64207 17.6718 7.58964 17.4937 7.59001C17.2551 7.59051 17.0264 7.68575 16.858 7.85481C16.6896 8.02386 16.5952 8.25288 16.5956 8.49151ZM9.64905 12.5075C9.65324 14.6345 11.3807 16.3548 13.5072 16.3508C15.6338 16.3468 17.3553 14.6195 17.3513 12.4925C17.3472 10.3655 15.6194 8.6447 13.4926 8.64889C11.3657 8.65307 9.64505 10.3808 9.64905 12.5075ZM11 12.5048C10.999 12.0104 11.1447 11.5267 11.4186 11.1151C11.6925 10.7034 12.0823 10.3822 12.5387 10.1921C12.9951 10.002 13.4977 9.95146 13.9828 10.047C14.468 10.1425 14.9139 10.3797 15.2642 10.7286C15.6146 11.0775 15.8535 11.5225 15.951 12.0073C16.0484 12.492 15.9999 12.9948 15.8116 13.452C15.6233 13.9092 15.3036 14.3003 14.8931 14.5758C14.4825 14.8513 13.9994 14.9989 13.505 14.9999C13.1767 15.0006 12.8514 14.9366 12.5478 14.8116C12.2443 14.6865 11.9683 14.5029 11.7357 14.2712C11.503 14.0395 11.3183 13.7643 11.1921 13.4612C11.0659 13.1581 11.0006 12.8331 11 12.5048Z",fill:"white"})}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1217_183",children:o.jsx("rect",{width:"15",height:"15",fill:"white",transform:"translate(6 5)"})})})]}),youtube:o.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),o.jsx("g",{clipPath:"url(#clip0_1217_195)",children:o.jsx("path",{d:"M20.6653 9.12395C20.5749 8.78346 20.3967 8.47271 20.1484 8.22279C19.9001 7.97287 19.5905 7.79258 19.2507 7.69995C18.0033 7.36328 13 7.36328 13 7.36328C13 7.36328 7.99667 7.36328 6.74867 7.69995C6.40894 7.79274 6.09953 7.9731 5.85139 8.223C5.60324 8.4729 5.42506 8.78357 5.33467 9.12395C5 10.3799 5 12.9999 5 12.9999C5 12.9999 5 15.6199 5.33467 16.8759C5.42506 17.2164 5.60332 17.5272 5.85159 17.7771C6.09987 18.027 6.40945 18.2073 6.74933 18.2999C7.99667 18.6366 13 18.6366 13 18.6366C13 18.6366 18.0033 18.6366 19.2513 18.2999C19.5912 18.2074 19.9009 18.0271 20.1491 17.7772C20.3974 17.5273 20.5757 17.2165 20.666 16.8759C21 15.6199 21 12.9999 21 12.9999C21 12.9999 21 10.3799 20.6653 9.12395ZM11.3633 15.3786V10.6213L15.5453 12.9999L11.3633 15.3786Z",fill:"white"})}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1217_195",children:o.jsx("rect",{width:"16",height:"12",fill:"white",transform:"translate(5 7)"})})})]}),threads:o.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),o.jsx("g",{clipPath:"url(#clip0_1217_189)",children:o.jsx("path",{d:"M13.6162 20H13.6119C11.3737 19.985 9.65312 19.2469 8.49687 17.8069C7.46875 16.525 6.9375 14.7413 6.92 12.5063V12.4956C6.93875 10.2587 7.46937 8.47688 8.49812 7.19438C9.65312 5.75312 11.375 5.015 13.6125 5H13.6212C15.3375 5.0125 16.7731 5.45312 17.8875 6.31125C18.9356 7.1175 19.6737 8.2675 20.0806 9.72813L18.8056 10.0837C18.1156 7.60875 16.3694 6.34375 13.6156 6.32437C11.7969 6.33812 10.4219 6.90937 9.52812 8.0225C8.69187 9.065 8.26 10.5712 8.24312 12.5C8.26 14.4288 8.69187 15.935 9.52875 16.9775C10.4225 18.0919 11.7981 18.6638 13.6162 18.6756C15.2556 18.6631 16.34 18.2812 17.2412 17.3975C18.2706 16.3894 18.2525 15.1519 17.9225 14.3988C17.7287 13.955 17.3769 13.5863 16.9012 13.305C16.7812 14.15 16.5125 14.8337 16.0987 15.35C15.545 16.0387 14.7612 16.415 13.7675 16.4688C13.0162 16.5094 12.2919 16.3325 11.7306 15.9681C11.0662 15.5375 10.6775 14.8806 10.6356 14.1156C10.595 13.3719 10.8906 12.6875 11.4669 12.1894C12.0169 11.7144 12.7912 11.435 13.7062 11.3825C14.3368 11.3431 14.9697 11.3729 15.5937 11.4713C15.515 11.0075 15.3594 10.6388 15.125 10.3731C14.8044 10.0069 14.3075 9.82125 13.6506 9.81687H13.6325C13.105 9.81687 12.3875 9.96188 11.9319 10.6419L10.8337 9.90438C11.4462 8.99563 12.4387 8.49437 13.6325 8.49437H13.66C15.6562 8.50688 16.8456 9.72875 16.9644 11.8619C17.0319 11.8906 17.0994 11.9206 17.165 11.9506C18.0962 12.3881 18.7775 13.0513 19.1362 13.8694C19.6344 15.0069 19.6806 16.8631 18.1687 18.3431C17.0125 19.4744 15.61 19.9856 13.6206 19.9994L13.6162 20ZM14.2431 12.6938C14.0919 12.6938 13.9387 12.6981 13.7812 12.7069C12.6337 12.7713 11.9187 13.2981 11.9587 14.0463C12.0006 14.8313 12.8662 15.1956 13.6987 15.1506C14.4637 15.11 15.46 14.8112 15.6275 12.8319C15.1722 12.7369 14.7082 12.6906 14.2431 12.6938Z",fill:"white"})}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1217_189",children:o.jsx("rect",{width:"15",height:"15",fill:"white",transform:"translate(6 5)"})})})]}),whatsapp:o.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),o.jsx("g",{transform:"translate(5.5, 5.5) scale(0.625)",children:o.jsx("path",{d:"M13.601 2.326A10.454 10.454 0 0 0 3.17 12.784c0 1.896.496 3.743 1.442 5.378L3 24l5.968-1.564a10.428 10.428 0 0 0 4.633 1.082c5.76 0 10.44-4.683 10.44-10.446a10.45 10.45 0 0 0-10.44-10.746zm0 17.584c-1.579 0-3.125-.425-4.48-1.228l-.322-.191-3.332.874.887-3.25-.21-.334A8.75 8.75 0 0 1 4.843 12.78c0-4.832 3.93-8.766 8.761-8.766 2.342 0 4.542.912 6.196 2.569 1.654 1.657 2.566 3.86 2.566 6.205 0 4.836-3.931 8.769-8.765 8.769zm4.811-6.577c-.264-.132-1.564-.772-1.807-.86-.242-.088-.419-.132-.596.132-.176.264-.683.86-.838 1.036-.154.176-.309.198-.573.066-1.545-.774-2.73-1.874-3.593-3.32-.11-.186.11-.176.368-.693.088-.176.044-.33-.022-.462-.066-.132-.596-1.436-.816-1.966-.214-.515-.433-.445-.596-.453-.154-.008-.33-.01-.507-.01-.176 0-.463.066-.705.33-.242.264-.925.904-.925 2.204 0 1.3.947 2.556 1.08 2.732.132.176 1.862 2.844 4.512 3.987 1.84.795 2.52.848 3.424.717.925-.134 2.835-1.157 3.232-2.274.396-1.117.396-2.072.275-2.274-.12-.202-.44-.323-.705-.455z",fill:"white"})})]}),tiktok:o.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),o.jsx("g",{transform:"translate(5.5, 5.5) scale(0.625)",children:o.jsx("path",{d:"M19.589 6.686a4.793 4.793 0 0 1-3.77-4.245V2h-3.445v13.672a2.896 2.896 0 0 1-2.891 2.89 2.895 2.895 0 0 1-2.892-2.89 2.895 2.895 0 0 1 2.892-2.89 2.87 2.87 0 0 1 1.002.18V9.45a6.335 6.335 0 0 0-1.002-.08 6.336 6.336 0 0 0-6.336 6.336 6.336 6.336 0 0 0 6.336 6.336 6.336 6.336 0 0 0 6.336-6.336V8.514a8.216 8.216 0 0 0 4.768 1.512V6.581a4.819 4.819 0 0 1-.998.105z",fill:"white"})})]})}),s2="Nigeria's leading digital platform for specialist healthcare. Bridging the gap between expert care and patient convenience.",a2=[{title:"COMPANY",links:[{label:"About",href:"/about"},{label:"Team",href:"/team"},{label:"Careers",href:"/careers"},{label:"Contact",href:"/contact"}]},{title:"PRODUCT",links:[{label:"For Doctors",href:"/doctors"},{label:"For Businesses",href:"/business"},{label:"For Patients",href:"/patients"},{label:"Homecare",href:"/homecare"}]},{title:"RESOURCES",links:[{label:"Blog",href:"/blog"}]}],l2=[{platform:"instagram",href:"https://instagram.com/medixdeck"},{platform:"twitter",href:"https://twitter.com/medixdeck"},{platform:"whatsapp",href:"https://medixdeck.com/whatsapp"},{platform:"threads",href:"https://threads.net/@medixdeck"},{platform:"facebook",href:"https://facebook.com/medixdeck"},{platform:"youtube",href:"https://youtube.com/@medixdeck"},{platform:"tiktok",href:"https://tiktok.com/@medixdeck"},{platform:"linkedin",href:"https://linkedin.com/company/medixdeck"}],c2=[{label:"Terms",href:"/terms"},{label:"Privacy",href:"/privacy"},{label:"Cookies",href:"/cookies"}],u2=(e,t)=>o.jsx("a",{href:e.href,target:e.isExternal?"_blank":void 0,rel:e.isExternal?"noopener noreferrer":void 0,style:{textDecoration:"none"},children:t});function yf({description:e=s2,logo:t,sections:n=a2,socialLinks:r=l2,copyright:i,bottomLinks:s=c2,newsletter:a,renderLink:l=u2,colorScheme:d="blue",certifications:c,...u}){const h=new Date().getFullYear(),m=i??`© ${h} MedixDeck Health Solutions Ltd. All Rights Reserved.`,[p,x]=k.useState(""),[g,v]=k.useState(!1),[y,j]=k.useState(!1),w=i2[d],{mounted:A,themeMode:B,toggleThemeMode:C}=hr(),O=E=>{E.preventDefault(),a!=null&&a.onSubmit&&p&&(a.onSubmit(p),x(""))};return o.jsx(f.Box,{as:"footer",bg:"bg",py:{base:12,md:16},...u,children:o.jsxs(f.Container,{maxWidth:"7xl",children:[o.jsxs(f.Grid,{templateColumns:{base:"1fr",lg:"1.5fr 1fr 1.5fr"},gap:{base:12,lg:16},mb:16,children:[o.jsxs(f.Box,{children:[o.jsx(f.Box,{mb:4,children:o.jsx(f.Link,{href:"/",children:t??o.jsx(cn,{variant:d==="blue"?"blue":"purple",height:28})})}),o.jsx(f.Text,{fontSize:"sm",color:"text.body",maxW:"320px",lineHeight:"1.6",fontFamily:"var(--font-body)",children:e}),o.jsx(f.HStack,{mt:6,gap:2,flexWrap:"wrap",children:(()=>{const E=o2(w.solid);return r.map(F=>o.jsx(f.Link,{href:F.href,target:"_blank",rel:"noopener noreferrer",display:"inline-flex",transition:"transform 0.2s ease, opacity 0.2s ease",_hover:{transform:"translateY(-2px)",opacity:.9},title:F.platform,"aria-label":F.platform,children:E[F.platform]},F.platform))})()})]}),o.jsx(f.Grid,{templateColumns:"1fr 1fr",gap:8,children:n.map(E=>o.jsxs(f.Box,{children:[o.jsx(f.Text,{fontWeight:"700",color:"text.heading",mb:4,fontSize:"xs",fontFamily:"var(--font-heading)",letterSpacing:"0.05em",textTransform:"uppercase",children:E.title}),o.jsx(f.VStack,{align:"flex-start",gap:3,children:E.links.map(F=>o.jsx(f.Box,{w:"full",children:l(F,o.jsx(f.Box,{as:"span",fontSize:"sm",color:"text.body",fontFamily:"var(--font-body)",_hover:{color:w.token},transition:"color 0.2s ease",cursor:"pointer",display:"block",children:F.label}))},F.label))})]},E.title))}),!(a!=null&&a.hide)&&o.jsx(f.Box,{children:o.jsxs(f.Box,{p:6,borderRadius:"2xl",border:"1px solid",borderColor:"border",bg:"bg",_dark:{bg:"rgba(255,255,255,0.02)"},children:[o.jsx(f.Text,{fontWeight:"700",color:"text.heading",mb:2,fontSize:"md",fontFamily:"var(--font-heading)",children:(a==null?void 0:a.title)??"Newsletter"}),o.jsx(f.Text,{fontSize:"sm",color:"text.body",mb:5,fontFamily:"var(--font-body)",lineHeight:"1.5",children:(a==null?void 0:a.description)??"Get monthly health tips from our verified specialists."}),o.jsxs(f.Box,{as:"form",onSubmit:O,position:"relative",display:"flex",children:[o.jsx(f.Box,{as:"input",type:"email",value:p,onChange:E=>x(E.target.value),placeholder:(a==null?void 0:a.placeholder)??"email@address.com",w:"full",h:"44px",pl:4,pr:"50px",borderRadius:"lg",border:"1px solid",borderColor:"border",bg:"bg.surface",fontSize:"sm",fontFamily:"var(--font-body)",color:"text.body",_placeholder:{color:"text.body"},_focus:{outline:"none",borderColor:w.token,boxShadow:`0 0 0 1px ${w.solid}`},transition:"all 0.2s",required:!0}),o.jsx("button",{type:"submit",style:{position:"absolute",right:"4px",top:"4px",bottom:"4px",width:"36px",height:"36px",padding:0,background:g?w.solidHover:w.solid,color:"white",borderRadius:"6px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",border:"none",boxShadow:y?`0 0 0 3px ${w.focusRing}`:"none",transition:"background 0.2s ease, box-shadow 0.2s ease"},onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),onFocus:()=>j(!0),onBlur:()=>j(!1),"aria-label":"Subscribe",children:(a==null?void 0:a.buttonIcon)??o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),o.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]})]})})]}),o.jsx(f.Box,{borderTop:"1px solid",borderColor:"border",pt:6,children:o.jsxs(f.Flex,{justify:"space-between",align:{base:"center",md:"flex-start"},flexDir:{base:"column-reverse",md:"row"},gap:4,children:[o.jsx(f.Text,{fontSize:"xs",color:"text.body",fontFamily:"var(--font-body)",textAlign:{base:"center",md:"left"},children:m}),o.jsxs(f.HStack,{gap:6,flexWrap:"wrap",justify:"center",alignItems:"center",children:[s.map(E=>o.jsx(f.Box,{children:l(E,o.jsx(f.Box,{as:"span",fontSize:"xs",color:"text.body",fontFamily:"var(--font-body)",_hover:{color:"text.heading"},transition:"color 0.2s ease",cursor:"pointer",children:E.label}))},E.label)),A&&o.jsx(f.Box,{as:"button",onClick:C,display:"inline-flex",alignItems:"center",justifyContent:"center",w:"28px",h:"28px",borderRadius:"full",bg:"bg.surface",border:"1px solid",borderColor:"border",color:"text.body",_hover:{color:"text.heading",bg:"bg"},cursor:"pointer",transition:"all 0.2s","aria-label":"Toggle theme",ml:2,children:B==="dark"?o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"5"}),o.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),o.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),o.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),o.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),o.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),o.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),o.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),o.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}):o.jsx("svg",{width:"14",height:"14",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"})})})]})]})}),c&&c.length>0&&o.jsx(f.Box,{borderTop:"1px solid",borderColor:"border",pt:6,mt:6,pb:0,children:o.jsx(f.Flex,{gap:{base:6,md:10},flexWrap:"wrap",justify:{base:"center",md:"center"},align:"center",children:c.map(E=>{const F=o.jsxs(f.Flex,{align:"center",gap:"3",opacity:.75,_hover:{opacity:1},transition:"opacity 0.2s ease",style:{cursor:E.href?"pointer":"default"},children:[E.imageSrc?o.jsx("img",{src:E.imageSrc,alt:E.name,style:{height:28,width:"auto",objectFit:"contain",display:"block"}}):o.jsx(f.Box,{color:"text.muted",flexShrink:0,children:o.jsx("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",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(f.Text,{fontSize:"xs",fontWeight:"600",fontFamily:"var(--font-body)",color:"text.muted",style:{whiteSpace:"nowrap"},children:E.name})]},E.name);return E.href?o.jsx(f.Box,{children:l({href:E.href,isExternal:E.isExternal??!0},F)},E.name):o.jsx(f.Box,{children:F},E.name)})})})]})})}yf.displayName="MedixFooter";const d2=o.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"m9 18 6-6-6-6"})}),f2=(e,t)=>e.href?o.jsx("a",{href:e.href,style:{textDecoration:"none"},children:t}):o.jsx(o.Fragment,{children:t});function h2({items:e,separator:t=d2,renderLink:n=f2,...r}){return o.jsx(f.Box,{as:"nav","aria-label":"Breadcrumb",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"1.5",...r,children:e.map((i,s)=>{const a=s===e.length-1;return o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1.5",children:[n(i,o.jsx(f.Box,{as:"span",display:"inline-block",lineHeight:"1.2",fontSize:"sm",fontFamily:"var(--font-body)",fontWeight:a?"medium":"normal",color:a?"text.heading":"text.muted",_hover:a?void 0:{color:"blue.500"},cursor:!a&&i.href?"pointer":"default",transition:"color 0.15s",wordBreak:"break-word",whiteSpace:a?"normal":"nowrap",children:i.label})),!a&&o.jsx(f.Box,{color:"text.muted",display:"flex",alignItems:"center",flexShrink:0,mt:"0.5",children:t})]},s)})})}const p2={sm:{px:"3",py:"1.5",fontSize:"sm"},md:{px:"4",py:"2",fontSize:"md"},lg:{px:"5",py:"2.5",fontSize:"lg"}};function m2({tabs:e,defaultActiveId:t,activeId:n,onChange:r,variant:i="line",size:s="md",renderContent:a=!0,...l}){var x;const[d,c]=k.useState(t??((x=e[0])==null?void 0:x.id)),u=n??d,h=g=>{c(g),r==null||r(g)},m=e.find(g=>g.id===u),p=p2[s];return o.jsxs(f.Box,{...l,children:[o.jsx(f.Box,{role:"tablist",display:"flex",gap:i==="pill"?"1":"0",borderBottom:i==="line"?"1px solid":"none",border:i==="pill"?"1px solid":"none",borderColor:"border",bg:i==="pill"?"bg.subtle":"transparent",p:i==="pill"?"1":"0",borderRadius:i==="pill"?"full":"none",overflowX:"auto",flexWrap:"nowrap",style:{scrollbarWidth:"none"},children:e.map(g=>{const v=g.id===u;return o.jsxs(f.Box,{role:"tab","aria-selected":v,"aria-disabled":g.disabled,tabIndex:g.disabled?-1:0,onClick:()=>!g.disabled&&h(g.id),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&!g.disabled&&h(g.id)},display:"flex",alignItems:"center",gap:"2",justifyContent:"center",px:i==="pill"?"4":p.px,py:i==="pill"?"3":p.py,fontFamily:"var(--font-body)",fontWeight:v?"semibold":"medium",fontSize:i==="pill"?"sm":p.fontSize,color:g.disabled?"text.muted":i==="pill"?v?"text.heading":"text.body":v?"blue.500":"text.body",cursor:g.disabled?"not-allowed":"pointer",opacity:g.disabled?.5:1,transition:"all 0.2s ease",whiteSpace:"nowrap",flex:i==="pill"?"1":void 0,flexShrink:i==="pill"?1:0,bg:i==="pill"?v?"bg":"bg.surface":"transparent",borderRadius:i==="pill"?"full":"none",boxShadow:"none",borderBottom:i==="line"?"2px solid":"none",borderColor:i==="line"?v?"blue.500":"transparent":void 0,mb:i==="line"?"-1px":"0",_hover:g.disabled?void 0:i==="line"?{color:"blue.500"}:{bg:v?"bg":"bg.subtle",color:"text.heading"},_focusVisible:{outline:"2px solid",outlineColor:"blue.500",outlineOffset:"2px",borderRadius:i==="pill"?"full":"sm"},children:[o.jsx(f.Text,{fontSize:"inherit",fontWeight:"inherit",color:"inherit",children:g.label}),g.badge!==void 0&&o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",justifyContent:"center",minW:"5",h:"5",px:"1",borderRadius:"full",fontSize:"2xs",fontWeight:"bold",bg:i==="pill"?v?"bg.subtle":"bg":v?"blue.100":"bg.subtle",color:i==="pill"?v?"text.heading":"text.muted":v?"blue.700":"text.muted",children:g.badge})]},g.id)})}),a&&(m==null?void 0:m.content)&&o.jsx(f.Box,{role:"tabpanel",mt:"4",children:m.content})]})}function x2(e,t,n){if(n*2+5>=t)return Array.from({length:t},(d,c)=>c+1);const i=Math.max(e-n,1),s=Math.min(e+n,t),a=i>2,l=s<t-2;if(!a&&l){const d=3+2*n;return[...Array.from({length:d},(c,u)=>u+1),"...",t]}if(a&&!l){const d=3+2*n;return[1,"...",...Array.from({length:d},(c,u)=>t-d+1+u)]}return[1,"...",...Array.from({length:s-i+1},(d,c)=>i+c),"...",t]}function bf({total:e,pageSize:t=10,currentPage:n=1,onChange:r,siblingCount:i=1,showEdges:s=!0,compact:a=!1,...l}){const d=Math.ceil(e/t);if(d<=1)return null;const c=x2(n,d,i),u={display:"inline-flex",alignItems:"center",justifyContent:"center",w:"8",h:"8",borderRadius:"md",fontSize:"sm",fontFamily:"var(--font-body)",fontWeight:"semibold",cursor:"pointer",transition:"all 0.15s",border:"none",userSelect:"none"},h=({children:x,disabled:g,onClick:v,label:y,icon:j,isNext:w})=>o.jsxs(f.Box,{as:"button",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"1.5",h:"8",px:"2",borderRadius:"md",fontSize:"sm",fontFamily:"var(--font-body)",fontWeight:"medium",cursor:"pointer",transition:"all 0.15s",userSelect:"none",border:"none",bg:"transparent",color:"text.muted",opacity:g?.4:1,pointerEvents:g?"none":void 0,onClick:v,"aria-label":y,_hover:{color:"blue.500"},children:[!w&&j&&o.jsx(f.Box,{as:"span",display:"flex",alignItems:"center",children:j}),x,w&&j&&o.jsx(f.Box,{as:"span",display:"flex",alignItems:"center",children:j})]}),m=o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M15 18l-6-6 6-6"})}),p=o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M9 18l6-6-6-6"})});return o.jsxs(f.Box,{as:"nav",role:"navigation","aria-label":"Pagination",display:"flex",alignItems:"center",gap:"2",flexWrap:"wrap",...l,children:[s&&o.jsx(h,{disabled:n===1,onClick:()=>r==null?void 0:r(1),label:"First page",icon:m,children:"First"}),o.jsx(h,{disabled:n===1,onClick:()=>r==null?void 0:r(n-1),label:"Previous page",icon:m,children:"Prev"}),!a&&c.map((x,g)=>x==="..."?o.jsx(f.Box,{...u,bg:"transparent",color:"text.muted",cursor:"default",pointerEvents:"none",children:"…"},`dots-${g}`):o.jsx(f.Box,{as:"button",...u,bg:n===x?"blue.500":"blue.100",color:n===x?"white":"blue.500",_dark:{bg:n===x?"blue.500":"rgba(6, 133, 255, 0.12)",color:n===x?"white":"blue.200"},onClick:()=>r==null?void 0:r(x),"aria-label":`Page ${x}`,"aria-current":n===x?"page":void 0,_hover:n!==x?{bg:"blue.200",_dark:{bg:"rgba(6, 133, 255, 0.2)"}}:void 0,children:x},x)),a&&o.jsxs(f.Box,{px:"3",fontSize:"sm",color:"text.body",fontFamily:"var(--font-body)",whiteSpace:"nowrap",children:[n," / ",d]}),o.jsx(h,{disabled:n===d,onClick:()=>r==null?void 0:r(n+1),label:"Next page",icon:p,isNext:!0,children:"Next"}),s&&o.jsx(h,{disabled:n===d,onClick:()=>r==null?void 0:r(d),label:"Last page",icon:p,isNext:!0,children:"Last"})]})}const Yl=o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M2 7L5.5 10.5L12 4",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});function g2({steps:e,currentStep:t,variant:n="default",orientation:r="horizontal",colorScheme:i="blue",...s}){const a=i==="blue"?"#0685FF":"#7700CC",l=i==="blue"?"rgba(6,133,255,0.10)":"rgba(119,0,204,0.10)";return r==="vertical"?o.jsx(f.Box,{display:"flex",flexDirection:"column",alignItems:"flex-start",...s,children:e.map((c,u)=>{const h=u+1<t,m=u+1===t,p=u===e.length-1,x=h||m?a:"var(--chakra-colors-border, #E2E8F0)";return o.jsxs(f.Box,{display:"flex",flexDirection:"row",alignItems:"flex-start",gap:"3",children:[o.jsxs(f.Box,{display:"flex",flexDirection:"column",alignItems:"center",children:[o.jsx(f.Box,{w:"8",h:"8",borderRadius:"full",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",bg:h||m?a:"bg.subtle",border:"2px solid",borderColor:x,color:"white",fontSize:"sm",fontWeight:"bold",fontFamily:"var(--font-body)",transition:"all 0.25s",children:h?Yl:c.icon??u+1}),!p&&o.jsx(f.Box,{w:"2px",flex:"1",minH:"8",bg:h?a:"border",my:"1",transition:"background 0.25s"})]}),n!=="compact"&&o.jsxs(f.Box,{pt:"1",pb:p?"0":"8",children:[o.jsx(f.Box,{fontSize:"sm",fontWeight:m?"semibold":"medium",color:h||m?a:"text.muted",fontFamily:"var(--font-body)",transition:"color 0.25s",children:c.title}),c.description&&o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:c.description})]})]},c.id)})}):o.jsx(f.Box,{display:"inline-flex",alignItems:"center",gap:"0",role:"list","aria-label":"Progress steps",...s,children:e.map((c,u)=>{const h=u+1<t,m=u+1===t,p=u+1>t,x=u===e.length-1,g=p?"bg.subtle":a,v=h?Yl:c.icon?c.icon:o.jsx(f.Box,{as:"span",fontSize:"13px",fontWeight:"700",fontFamily:"var(--font-body)",color:p?"text.muted":"white",lineHeight:"1",children:u+1}),y=!p&&n!=="compact",j=p?"text.muted":a;return o.jsxs(k.Fragment,{children:[o.jsx(f.Box,{role:"listitem","aria-current":m?"step":void 0,display:"inline-flex",alignItems:"center",gap:"0",children:o.jsxs(f.Box,{display:"inline-flex",alignItems:"center",gap:"2",px:y?"2":"0",py:y?"1.5":"0",bg:y?l:"transparent",borderRadius:"full",transition:"all 0.25s ease",children:[o.jsx(f.Box,{w:"7",h:"7",borderRadius:"full",flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center",bg:g,border:p?"1.5px solid":"none",borderColor:"var(--chakra-colors-border, #E2E8F0)",transition:"all 0.25s ease",flexDirection:"row",children:v}),n!=="compact"&&o.jsx(f.Box,{as:"span",fontSize:"sm",fontWeight:m||h?"semibold":"medium",fontFamily:"var(--font-body)",color:j,whiteSpace:"nowrap",transition:"color 0.25s",children:c.title})]})}),!x&&o.jsx(f.Box,{display:"inline-flex",alignItems:"center",px:"1",flexShrink:0,children:o.jsx(f.Box,{h:"1.5px",w:"10",bg:h?a:"var(--chakra-colors-border, #E2E8F0)",borderRadius:"full",transition:"background 0.25s ease"})})]},c.id)})})}const y2=`
356
+ `,document.head.appendChild(e),Gl=!0}function Vy({items:e,renderLink:t,scheme:n}){return k.useEffect(()=>{Ny()},[]),o.jsx(f.Box,{as:"nav","aria-label":"Mobile bottom navigation",display:{base:"flex",md:"none"},position:"fixed",bottom:"0",left:"0",right:"0",zIndex:"docked",bg:"bg",borderTop:"1px solid",borderColor:"border",alignItems:"center",style:{minHeight:64,paddingBottom:"env(safe-area-inset-bottom, 0px)",boxShadow:"none",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)",animation:"medixMobileNavIn 0.42s cubic-bezier(0.22,1,0.36,1) both"},children:e.slice(0,5).map(r=>{const i=r.isActive??!1,s=o.jsxs(st.div,{whileTap:{scale:.82},transition:{type:"spring",stiffness:500,damping:30,mass:.7},style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flex:1,height:"100%",padding:"6px 4px 4px",cursor:"pointer",position:"relative",gap:4,textDecoration:"none",WebkitTapHighlightColor:"transparent"},children:[o.jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:7,left:"50%",width:44,height:28,borderRadius:14,background:n.activeBgLight,transform:`translateX(-50%) scaleX(${i?1:0})`,opacity:i?1:0,transition:"transform 0.3s cubic-bezier(0.22,1,0.36,1), opacity 0.2s ease",pointerEvents:"none"}}),o.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",position:"relative",zIndex:1,color:i?n.chakraToken:"text.muted",style:{transition:"color 0.18s ease",opacity:i?1:.6},children:[r.icon,typeof r.badge=="number"&&r.badge>0&&o.jsx("span",{"aria-label":`${r.badge} unread`,style:{position:"absolute",top:-5,right:-6,minWidth:16,height:16,borderRadius:8,background:n.solid,color:"#fff",fontSize:9,fontWeight:700,fontFamily:"var(--font-body)",display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"0 3px",lineHeight:1,boxShadow:"0 0 0 2px var(--chakra-colors-bg, #fff)",pointerEvents:"none"},children:r.badge>99?"99+":r.badge}),r.isNew&&(!r.badge||r.badge<=0)&&o.jsx("span",{"aria-label":"New feature",style:{position:"absolute",top:-2,right:-2,width:6,height:6,borderRadius:3,background:n.solid,boxShadow:"0 0 0 2px var(--chakra-colors-bg, #fff)",pointerEvents:"none"}})]}),o.jsx(f.Box,{as:"span",fontSize:"2xs",fontWeight:i?"700":"500",fontFamily:"var(--font-body)",textAlign:"center",lineHeight:"1",position:"relative",zIndex:1,color:i?n.chakraToken:"text.muted",style:{transition:"color 0.18s ease",letterSpacing:i?"-0.01em":"0"},children:r.label})]}),a={label:r.label,href:r.href,isActive:r.isActive};return o.jsx(f.Box,{flex:"1",display:"flex",alignItems:"stretch",justifyContent:"center",h:"16",style:{textDecoration:"none"},children:t(a,s)},r.href)})})}const ri={bronze:{label:"Bronze Clinician",level:1,minScore:0,maxScore:999,color:"#92400E",ring:"#D97706",bg:"rgba(217,119,6,0.10)"},silver:{label:"Silver Clinician",level:2,minScore:1e3,maxScore:4999,color:"#475569",ring:"#94A3B8",bg:"rgba(148,163,184,0.10)"},gold:{label:"Gold Clinician",level:3,minScore:5e3,maxScore:14999,color:"#D97706",ring:"#F59E0B",bg:"rgba(245,158,11,0.10)"},platinum:{label:"Platinum Clinician",level:4,minScore:15e3,maxScore:39999,color:"#0284C7",ring:"#38BDF8",bg:"rgba(56,189,248,0.10)"},"elite-i":{label:"Elite I",level:5,minScore:4e4,maxScore:59999,color:"#6D28D9",ring:"#8B5CF6",bg:"rgba(139,92,246,0.12)"},"elite-ii":{label:"Elite II",level:6,minScore:6e4,maxScore:79999,color:"#7C3AED",ring:"#A78BFA",bg:"rgba(167,139,250,0.12)"},"elite-iii":{label:"Elite III",level:7,minScore:8e4,maxScore:119999,color:"#7700CC",ring:"#A855F7",bg:"rgba(119,0,204,0.12)"},"elite-iv":{label:"Elite IV",level:8,minScore:12e4,maxScore:199999,color:"#5B21B6",ring:"#7C3AED",bg:"rgba(124,58,237,0.12)"},"elite-v":{label:"Elite V",level:9,minScore:2e5,maxScore:null,color:"#4C1D95",ring:"#6D28D9",bg:"rgba(109,40,217,0.14)"}},gf=["bronze","silver","gold","platinum","elite-i","elite-ii","elite-iii","elite-iv","elite-v"];function Wy(e){const t=typeof e=="number"&&Number.isFinite(e)?Math.floor(e):0;if(t<0)return"bronze";for(const n of gf){const r=ri[n];if(r.maxScore===null?t>=r.minScore:t<=r.maxScore)return n}return"elite-v"}function yf(e){return ri[e]??ri.bronze}const Hy=({color:e})=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"8",r:"6"}),o.jsx("path",{d:"M15.477 12.89L17 22l-5-3-5 3 1.523-9.11"})]}),Uy=()=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("polyline",{points:"9 18 15 12 9 6"})});function $y({data:e,renderLink:t,isCollapsed:n=!1}){const r=yf(e.tier),i=e.name.split(" ").map(a=>a[0]).join("").slice(0,2).toUpperCase();if(n){const a=o.jsx(f.Box,{display:"flex",justifyContent:"center",alignItems:"center",w:"full",my:"2",children:o.jsx(At,{label:`${e.role} — ${e.name} (${r.label}, ${e.medixScore} pts)`,placement:"right",children:o.jsx(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",w:"36px",h:"36px",mx:"auto","aria-label":`${e.role} ${e.name}`,cursor:e.link?"pointer":"default",children:o.jsx("div",{style:{flexShrink:0,padding:2,borderRadius:"50%",background:`linear-gradient(135deg, ${r.ring}, ${r.color})`},children:e.avatarSrc?o.jsx("img",{src:e.avatarSrc,alt:e.name,style:{width:36,height:36,borderRadius:"50%",objectFit:"cover",display:"block"}}):o.jsx("div",{style:{width:36,height:36,borderRadius:"50%",background:r.bg,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:700,color:r.color,fontFamily:"var(--font-heading)"},children:i})})})})});return e.link?o.jsx(o.Fragment,{children:t({label:e.role,href:e.link},a)}):o.jsx(o.Fragment,{children:a})}const s=o.jsxs(f.Box,{mx:"3",my:"4",borderRadius:"card",border:"1px solid",borderColor:"border",bg:"bg",overflow:"hidden",style:{cursor:e.link?"pointer":"default"},_hover:e.link?{borderColor:r.ring,boxShadow:`0 0 0 1px ${r.ring}40`}:void 0,transition:"border-color 0.15s ease, box-shadow 0.15s ease",children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"3",px:"3",pt:"3",pb:"2.5",children:[o.jsx("div",{style:{flexShrink:0,padding:2,borderRadius:"50%",background:`linear-gradient(135deg, ${r.ring}, ${r.color})`},children:e.avatarSrc?o.jsx("img",{src:e.avatarSrc,alt:e.name,style:{width:40,height:40,borderRadius:"50%",objectFit:"cover",display:"block"}}):o.jsx("div",{style:{width:40,height:40,borderRadius:"50%",background:r.bg,display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,fontWeight:700,color:r.color,fontFamily:"var(--font-heading)"},children:i})}),o.jsxs(f.Box,{flex:"1",minW:"0",children:[o.jsx(f.Box,{fontSize:"sm",fontWeight:"700",fontFamily:"var(--font-heading)",color:"text.heading",lineHeight:"1.2",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.role}),o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",lineHeight:"1.3",mt:"0.5",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.name})]}),e.link&&o.jsx(f.Box,{color:"text.muted",flexShrink:0,children:o.jsx(Uy,{})})]}),o.jsx(f.Box,{borderTop:"1px solid",borderColor:"border"}),o.jsxs(f.Box,{px:"3",pt:"2",pb:"2.5",children:[o.jsx(f.Box,{fontSize:"10px",fontWeight:"600",letterSpacing:"wider",color:"text.muted",fontFamily:"var(--font-body)",mb:"1",children:"MedixScore"}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",flexWrap:"nowrap",children:[o.jsx(Hy,{color:r.color}),o.jsx(f.Box,{fontSize:"sm",fontWeight:"500",fontFamily:"var(--font-body)",style:{color:r.color,whiteSpace:"nowrap"},children:r.label}),o.jsxs(f.Box,{fontSize:"sm",fontWeight:"500",color:"text.heading",fontFamily:"var(--font-body)",ml:"1",style:{whiteSpace:"nowrap"},children:[e.medixScore.toLocaleString()," ",Number(e.medixScore)===1?"pt":"pts"]})]})]})]});return e.link?o.jsx(o.Fragment,{children:t({label:e.role,href:e.link},s)}):o.jsx(o.Fragment,{children:s})}function Gy({logo:e,collapsedLogo:t,navGroups:n,isOpen:r,onClose:i,onLogout:s,renderLink:a,sidebarWidth:l,collapsedSidebarWidth:d,isCollapsed:c,collapsible:u,onToggleCollapse:h,collapseTogglePlacement:m,scheme:p,scoreCard:x}){const[g,v]=k.useState(!1);return o.jsxs(o.Fragment,{children:[r&&o.jsx(f.Box,{display:{base:"block",md:"none"},position:"fixed",inset:"0",zIndex:"overlay",bg:"blackAlpha.500",onClick:i,"aria-hidden":"true"}),o.jsxs(f.Box,{as:"aside","aria-label":"Main navigation",position:"fixed",top:"0",left:"0",bottom:"0",w:{base:`${l}px`,md:`${c?d:l}px`},zIndex:{base:"modal",md:c?1200:"sticky"},bg:"bg",borderRight:"1px solid",borderColor:"border",display:"flex",flexDirection:"column",transform:{base:r?"translateX(0)":`translateX(-${l+10}px)`,md:"translateX(0)"},transition:"transform 0.25s cubic-bezier(0.22,1,0.36,1), width 0.22s cubic-bezier(0.2,0,0,1)",children:[o.jsxs(f.Box,{h:c?{base:"16",md:"auto"}:"16",minH:c?{base:"16",md:"84px"}:"16",px:c?{base:"5",md:"2"}:"5",py:c?{base:"0",md:"3"}:"0",flexShrink:0,borderBottom:"1px solid",borderColor:"border",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",children:[o.jsxs(f.Box,{display:{base:"none",md:c?"flex":"none"},flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"2",w:"full",children:[o.jsx(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",children:t??o.jsx(cn,{type:"icon",variant:p.chakraToken==="blue.500"?"blue":"purple",height:26})}),u&&(m==="sidebar-header"||m==="both")&&o.jsx(At,{label:"Expand sidebar",placement:"right",children:o.jsx(f.Box,{as:"button",display:"inline-flex",alignItems:"center",justifyContent:"center",w:"8",h:"8",p:"0",borderRadius:"md",border:"none",bg:"transparent",color:"text.muted",cursor:"pointer",_hover:{bg:"bg.subtle",color:"text.heading"},onClick:h,"aria-label":"Expand sidebar",transition:"background 0.15s ease, color 0.15s ease",children:o.jsx(mf,{})})})]}),o.jsxs(f.Box,{display:{base:"flex",md:c?"none":"flex"},alignItems:"center",justifyContent:"space-between",w:"full",minW:"0",children:[o.jsx(f.Box,{flex:"1",minW:"0",overflow:"hidden",children:e}),u&&(m==="sidebar-header"||m==="both")&&o.jsx(At,{label:"Collapse sidebar",placement:"bottom",children:o.jsx(f.Box,{as:"button",display:{base:"none",md:"inline-flex"},alignItems:"center",justifyContent:"center",w:"8",h:"8",p:"0",borderRadius:"md",border:"none",bg:"transparent",color:"text.muted",cursor:"pointer",_hover:{bg:"bg.subtle",color:"text.heading"},onClick:h,"aria-label":"Collapse sidebar",transition:"background 0.15s ease, color 0.15s ease",children:o.jsx(pf,{})})})]})]}),x&&o.jsx(f.Box,{display:{base:"none",md:c?"flex":"block"},justifyContent:c?"center":void 0,alignItems:c?"center":void 0,w:"full",flexShrink:0,pt:c?"1":"3",children:o.jsx($y,{data:x,renderLink:a,isCollapsed:c})}),o.jsx(f.Box,{flex:"1",overflowY:c?"visible":"auto",overflowX:c?"visible":"hidden",position:"relative",py:"3",px:c?"2":"3",children:n.map((y,j)=>o.jsxs(f.Box,{mb:c?"2":"4",children:[y.groupLabel&&(c?j>0?o.jsx(f.Box,{h:"1px",bg:"border",mx:"2",my:"2"}):null:o.jsx(f.Box,{px:"3",pb:"2",pt:j>0?"2":void 0,fontSize:"10px",fontWeight:"700",letterSpacing:"widest",textTransform:"uppercase",color:"text.muted",fontFamily:"var(--font-body)",children:y.groupLabel})),o.jsx(f.Box,{display:"flex",flexDirection:"column",gap:c?"1.5":"0.5",children:y.items.map(w=>o.jsx(Vo,{item:w,renderLink:a,onClick:i,scheme:p,isCollapsed:c},w.href))})]},j))}),o.jsx(f.Box,{px:c?"2":"3",pb:"4",pt:"2",flexShrink:0,borderTop:"1px solid",borderColor:"border",display:c?"flex":"block",justifyContent:c?"center":void 0,alignItems:c?"center":void 0,w:"full",children:c?o.jsx(At,{label:"Log out",placement:"right",children:o.jsx(f.Box,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",w:"10",h:"10",mx:"auto",borderRadius:"lg",border:"none",bg:"transparent",cursor:"pointer","aria-label":"Log out",onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),onClick:()=>{i(),s==null||s()},style:{background:g?_o:"transparent",color:Bt,transition:"background 0.15s ease"},children:o.jsx(f.Box,{flexShrink:0,style:{color:Bt},children:o.jsx(No,{})})})}):o.jsxs(f.Box,{as:"button",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"3",w:"full",px:"3",py:"2.5",borderRadius:"lg",border:"none",bg:"transparent",cursor:"pointer","aria-label":"Log out",onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),onClick:()=>{i(),s==null||s()},style:{background:g?_o:"transparent",color:Bt,transition:"background 0.15s ease"},children:[o.jsx(f.Box,{flexShrink:0,style:{color:Bt},children:o.jsx(No,{})}),o.jsx(f.Box,{as:"span",fontSize:"sm",fontWeight:"500",fontFamily:"var(--font-body)",style:{color:Bt},children:"Log out"})]})})]})]})}function Yy({user:e,greeting:t,greetingSubtext:n,isSidebarOpen:r,onMenuToggle:i,sidebarWidth:s,topBarSlot:a,dropdownItems:l,onLogout:d,scheme:c,collapsible:u=!0,isCollapsed:h=!1,onToggleCollapse:m,collapseTogglePlacement:p="sidebar-header"}){const[x,g]=k.useState(!1),v=k.useRef(null),y=k.useId(),j=`user-menu-button-${y}`,w=`user-menu-dropdown-${y}`;return k.useEffect(()=>{const A=B=>{v.current&&!v.current.contains(B.target)&&g(!1)};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[]),o.jsxs(f.Box,{as:"header",role:"banner",position:"sticky",top:"0",zIndex:"docked",bg:"bg",borderBottom:"1px solid",borderColor:"border",h:"16",minH:"16",maxH:"16",flexShrink:0,display:"flex",alignItems:"center",px:{base:"4",md:"6"},gap:"4",children:[o.jsx(f.Box,{as:"button",display:{base:"flex",md:"none"},alignItems:"center",justifyContent:"center",border:"none",bg:"transparent",p:"1",cursor:"pointer",color:"text.body",borderRadius:"md",_hover:{bg:"bg.subtle"},onClick:i,"aria-label":r?"Close navigation menu":"Open navigation menu","aria-expanded":r,children:r?o.jsx(Cy,{}):o.jsx(Sy,{})}),u&&(p==="topbar"||p==="both")&&o.jsx(At,{label:h?"Expand sidebar":"Collapse sidebar",placement:"bottom",children:o.jsx(f.Box,{as:"button",display:{base:"none",md:"inline-flex"},alignItems:"center",justifyContent:"center",w:"8",h:"8",p:"0",borderRadius:"md",border:"none",bg:"transparent",color:"text.muted",cursor:"pointer",_hover:{bg:"bg.subtle",color:"text.heading"},onClick:m,"aria-label":h?"Expand sidebar":"Collapse sidebar",transition:"background 0.15s ease, color 0.15s ease",children:h?o.jsx(mf,{}):o.jsx(pf,{})})}),o.jsxs(f.Box,{flex:"1",minW:"0",children:[o.jsxs(f.Box,{as:"p",fontSize:{base:"sm",md:"md"},fontWeight:"700",fontFamily:"var(--font-body)",color:"text.heading",lineHeight:"1.3",children:[t,","," ",o.jsx(f.Box,{as:"span",fontWeight:"700",color:"text.heading",children:e.name})]}),n&&o.jsx(f.Box,{as:"p",fontSize:{base:"2xs",md:"xs"},fontWeight:"400",fontFamily:"var(--font-body)",color:"text.heading",mt:"0.5",lineHeight:"1.4",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n})]}),a,o.jsx(_y,{scheme:c}),o.jsxs(f.Box,{position:"relative",ref:v,children:[o.jsxs(f.Box,{as:"button",id:j,display:"flex",alignItems:"center",gap:"2",bg:"transparent",border:"none",cursor:"pointer",borderRadius:"full",p:"1",_hover:{bg:"bg.subtle"},onClick:()=>g(A=>!A),"aria-haspopup":"menu","aria-expanded":x,"aria-controls":x?w:void 0,"aria-label":"User menu",children:[o.jsx(di,{name:e.name,src:e.avatarSrc,size:"sm"}),o.jsx(f.Box,{color:"text.muted",children:o.jsx(xf,{open:x})})]}),x&&o.jsxs(f.Box,{role:"menu","aria-labelledby":j,id:w,position:"absolute",top:"calc(100% + 8px)",right:"0",minW:"200px",bg:"bg",border:"1px solid",borderColor:"border",borderRadius:"xl",boxShadow:"none",zIndex:"popover",overflow:"hidden",py:"1",children:[o.jsxs(f.Box,{px:"4",py:"3",borderBottom:"1px solid",borderColor:"border",children:[o.jsx(f.Box,{fontSize:"sm",fontWeight:"700",color:"text.heading",fontFamily:"var(--font-body)",children:e.name}),e.email&&o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:e.email})]}),!l&&o.jsxs(o.Fragment,{children:[o.jsx(Ir,{icon:o.jsx(jy,{}),label:"My Profile",onClick:()=>g(!1),scheme:c}),o.jsx(Ir,{icon:o.jsx(Ty,{}),label:"Settings",onClick:()=>g(!1),scheme:c})]}),l==null?void 0:l.map((A,B)=>o.jsx(Ir,{icon:A.icon,label:A.label,isDanger:A.isDanger,onClick:()=>{var C;g(!1),(C=A.onClick)==null||C.call(A)},scheme:c},B)),o.jsx(f.Box,{borderTop:"1px solid",borderColor:"border",my:"1"}),o.jsx(Ir,{icon:o.jsx(No,{}),label:"Log out",isDanger:!0,onClick:()=>{g(!1),d==null||d()},scheme:c})]})]})]})}function Ir({icon:e,label:t,isDanger:n,onClick:r,scheme:i}){const[s,a]=k.useState(!1);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:"transparent",cursor:"pointer",textAlign:"left",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onClick:r,style:{background:s?n?_o:i.hoverBgLight:"transparent",color:n?Bt:void 0,transition:"background 0.12s ease"},children:[e&&o.jsx(f.Box,{flexShrink:0,style:{color:n?Bt:void 0},color:"text.muted",children:e}),o.jsx(f.Box,{as:"span",fontSize:"sm",fontWeight:"500",fontFamily:"var(--font-body)",style:{color:n?Bt:void 0},color:n?void 0:"text.body",children:t})]})}function bf({children:e,logo:t,navGroups:n,user:r,greeting:i,greetingSubtext:s,onLogout:a,renderLink:l=Ry,dropdownItems:d,topBarSlot:c,sidebarWidth:u=220,collapsedSidebarWidth:h=68,collapsible:m=!0,defaultCollapsed:p=!1,isCollapsed:x,onCollapseChange:g,collapsedLogo:v,collapseTogglePlacement:y="sidebar-header",colorScheme:j="blue",mobileNavItems:w,scoreCard:A,environment:B="auto",showEnvironmentBanner:C,environmentBanner:O,environmentBannerSlot:E,...F}){const[L,R]=k.useState(!1),[D,N]=k.useState(p),[P,I]=k.useState(!1),[M,U]=k.useState(!1);k.useEffect(()=>{U(!0)},[]);const G=m&&(x!==void 0?x:D),H=()=>{if(!m)return;const ee=!G;x===void 0&&N(ee),g==null||g(ee)},b=wy[j],W=!!(w&&w.length>0),ne=i??My(),T=t??o.jsx(cn,{variant:j,height:26}),be=v??o.jsx(cn,{type:"icon",variant:j,height:26}),ke=O||{},J=ke.environment||B,{isNonProduction:X,detectedEnv:te}=Py(J),de=!P&&(C!==void 0?C:M?X:J!=="production"&&J!=="live");return o.jsxs(f.Box,{display:"flex",minH:"100vh",bg:"bg",...F,children:[o.jsx(Gy,{logo:T,collapsedLogo:be,navGroups:n,isOpen:L,onClose:()=>R(!1),onLogout:a,renderLink:l,sidebarWidth:u,collapsedSidebarWidth:h,isCollapsed:G,collapsible:m,onToggleCollapse:H,collapseTogglePlacement:y,scheme:b,scoreCard:A}),o.jsxs(f.Box,{flex:"1",display:"flex",flexDirection:"column",minW:"0",ml:{base:"0",md:`${G?h:u}px`},transition:"margin-left 0.22s cubic-bezier(0.2,0,0,1)",children:[de&&(E??o.jsx(zy,{detectedEnv:te,config:ke,onDismiss:()=>{var ee;I(!0),(ee=ke.onDismiss)==null||ee.call(ke)}})),o.jsx(Yy,{user:r,greeting:ne,greetingSubtext:s,isSidebarOpen:L,onMenuToggle:()=>R(ee=>!ee),sidebarWidth:u,topBarSlot:c,dropdownItems:d,onLogout:a,scheme:b,collapsible:m,isCollapsed:G,onToggleCollapse:H,collapseTogglePlacement:y}),o.jsx(f.Box,{as:"main",id:"main-content",role:"main",flex:"1",overflowY:"auto",bg:"bg.subtle",p:{base:"4",md:"6",lg:"8"},pb:W?{base:"20",md:"6",lg:"8"}:{base:"4",md:"6",lg:"8"},children:e})]}),W&&o.jsx(Vy,{items:w,renderLink:l,scheme:b})]})}bf.displayName="MedixDashboardLayout";const ii=[0,0,.2,1],Ns=[.4,0,1,1],Vs=[.22,1,.36,1],Ky={hidden:{opacity:0,y:-8,scaleY:.96,transformOrigin:"top"},visible:{opacity:1,y:0,scaleY:1,transformOrigin:"top",transition:{duration:.22,ease:Vs}},exit:{opacity:0,y:-6,scaleY:.97,transformOrigin:"top",transition:{duration:.16,ease:Ns}}},qy={hidden:{},visible:{transition:{staggerChildren:.045,delayChildren:.06}}},Yl={hidden:{opacity:0,x:-10},visible:{opacity:1,x:0,transition:{duration:.2,ease:ii}}},Xy={hidden:{opacity:0,y:10},visible:{opacity:1,y:0,transition:{duration:.22,ease:ii,delay:.18}}},Zy={hidden:{opacity:0,y:-6,scale:.98,transformOrigin:"top"},visible:{opacity:1,y:0,scale:1,transformOrigin:"top",transition:{duration:.18,ease:Vs}},exit:{opacity:0,y:-4,scale:.98,transformOrigin:"top",transition:{duration:.12,ease:Ns}}},Jy={hidden:{opacity:0,height:0,overflow:"hidden"},visible:{opacity:1,height:"auto",overflow:"hidden",transition:{duration:.22,ease:Vs}},exit:{opacity:0,height:0,overflow:"hidden",transition:{duration:.16,ease:Ns}}},Qy={blue:{solid:"#0685FF",hover:"#0685FF",hoverBg:"blue.50",hoverBgDark:"rgba(6,133,255,0.12)",badgeBg:"#EFF6FF",badgeColor:"#0685FF",badgeBgDark:"rgba(6,133,255,0.20)",badgeColorDark:"#60A5FA"},purple:{solid:"#7700CC",hover:"#7700CC",hoverBg:"purple.50",hoverBgDark:"rgba(119,0,204,0.12)",badgeBg:"#FAF5FF",badgeColor:"#7700CC",badgeBgDark:"rgba(119,0,204,0.20)",badgeColorDark:"#C084FC"}},e2=()=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("line",{x1:"7",y1:"17",x2:"17",y2:"7"}),o.jsx("polyline",{points:"7 7 17 7 17 17"})]});function vf({isOpen:e}){return 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 cubic-bezier(0.22, 1, 0.36, 1)",transform:e?"rotate(180deg)":"rotate(0deg)",flexShrink:0},children:o.jsx("polyline",{points:"6 9 12 15 18 9"})})}function oi(){return o.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{opacity:.65,flexShrink:0},children:[o.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),o.jsx("polyline",{points:"15 3 21 3 21 9"}),o.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})}function t2({color:e}){return o.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{width:"32",height:"32",rx:"8",fill:e}),o.jsx("path",{d:"M9.25 10.75H22.75",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("path",{d:"M9.25 16H22.75",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("path",{d:"M9.25 21.25H22.75",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function n2({color:e}){return o.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{width:"32",height:"32",rx:"8",fill:e}),o.jsx("path",{d:"M13.8801 16.71L8.93005 21.66L10.3401 23.07L13.1701 20.24L16.0001 17.41L18.1201 19.54L21.6601 23.07L23.0701 21.66L18.1201 16.71L17.4101 16L23.0701 10.34L21.6601 8.92999L16.0001 14.59L10.3401 8.92999L8.93005 10.34L14.5901 16L13.8801 16.71Z",fill:"white"})]})}const r2=(e,t)=>{const n=e.href??"#",r=e.target??(e.isExternal?"_blank":void 0),i=e.rel??(e.isExternal?"noopener noreferrer":void 0);return n==="#"&&!e.onClick?o.jsx("span",{style:{textDecoration:"none",display:"contents"},children:t}):o.jsx("a",{href:n,target:r,rel:i,onClick:e.onClick,style:{textDecoration:"none",display:"contents"},children:t})};function Dn({badge:e,scheme:t}){return e?k.isValidElement(e)?e:o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",px:"1.5",py:"0.5",fontSize:"10px",fontWeight:"semibold",lineHeight:"1",borderRadius:"badge",bg:t.badgeBg,color:t.badgeColor,_dark:{bg:t.badgeBgDark,color:t.badgeColorDark},border:"1px solid",borderColor:t.badgeColor,style:{borderColor:"currentColor",opacity:.9},children:e}):null}function i2({item:e,scheme:t,renderLink:n}){var u;const[r,i]=k.useState(!1),s=k.useRef(null),a=k.useRef(null),l=!!(e.children&&e.children.length>0);k.useEffect(()=>{if(!r)return;function h(p){s.current&&!s.current.contains(p.target)&&i(!1)}function m(p){p.key==="Escape"&&i(!1)}return document.addEventListener("mousedown",h),document.addEventListener("keydown",m),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",m)}},[r]);const d=()=>{a.current&&(clearTimeout(a.current),a.current=null),l&&i(!0)},c=()=>{l&&(a.current=setTimeout(()=>{i(!1)},150))};return l?o.jsxs(f.Box,{as:"li",ref:s,listStyleType:"none",position:"relative",onMouseEnter:d,onMouseLeave:c,children:[o.jsxs(f.Box,{as:"button","aria-haspopup":"menu","aria-expanded":r,onClick:()=>i(!r),display:"inline-flex",alignItems:"center",gap:"1.5",px:"3",py:"2",fontSize:"sm",fontWeight:"medium",fontFamily:"var(--font-body)",color:e.isActive||r?t.hover:"text.body",bg:r?t.hoverBg:"transparent",_dark:{color:e.isActive||r?t.hover:"text.body",bg:r?t.hoverBgDark:"transparent",_hover:{color:t.hover,bg:t.hoverBgDark}},borderRadius:"md",border:"none",cursor:"pointer",transition:"all 0.15s",_hover:{color:t.hover,bg:t.hoverBg},children:[e.icon&&o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",flexShrink:0,children:e.icon}),o.jsx("span",{children:e.label}),o.jsx(Dn,{badge:e.badge,scheme:t}),o.jsx(vf,{isOpen:r})]}),o.jsx(dr,{children:r&&o.jsx(st.div,{variants:Zy,initial:"hidden",animate:"visible",exit:"exit",style:{position:"absolute",top:"calc(100% + 6px)",left:0,zIndex:1e3},children:o.jsx(f.Box,{bg:"bg",border:"1px solid",borderColor:"border",borderRadius:"card",p:"2",minW:"260px",maxW:"380px",display:"flex",flexDirection:"column",gap:"1",role:"menu","aria-label":e.label,children:(u=e.children)==null?void 0:u.map((h,m)=>o.jsx(f.Box,{as:"div",role:"none",children:n(h,o.jsxs(f.Box,{as:"span",role:"menuitem",display:"flex",alignItems:"flex-start",gap:"3",p:"2.5",borderRadius:"md",cursor:"pointer",transition:"all 0.15s ease",color:"text.heading",_hover:{bg:t.hoverBg,color:t.hover},_dark:{color:"text.heading",_hover:{bg:t.hoverBgDark,color:t.hover}},onClick:()=>i(!1),children:[h.icon&&o.jsx(f.Box,{as:"span",w:"8",h:"8",borderRadius:"md",bg:"bg.subtle",display:"flex",alignItems:"center",justifyContent:"center",color:t.solid,flexShrink:0,mt:"0.5",children:h.icon}),o.jsxs(f.Box,{flex:"1",minW:"0",children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1.5",justifyContent:"space-between",children:[o.jsxs(f.Box,{as:"span",display:"inline-flex",alignItems:"center",gap:"1.5",fontSize:"sm",fontWeight:"semibold",fontFamily:"var(--font-heading)",children:[o.jsx("span",{children:h.label}),h.isExternal&&o.jsx(oi,{})]}),o.jsx(Dn,{badge:h.badge,scheme:t})]}),h.description&&o.jsx(f.Box,{as:"span",display:"block",fontSize:"xs",color:"text.body",_dark:{color:"text.body"},fontFamily:"var(--font-body)",mt:"0.5",lineHeight:"1.4",children:h.description})]})]}))},h.href||`${h.label}-${m}`))})})})]}):o.jsx(f.Box,{as:"li",listStyleType:"none",children:n(e,o.jsxs(f.Box,{as:"span",display:"inline-flex",alignItems:"center",gap:"1.5",px:"3",py:"2",fontSize:"sm",fontWeight:"medium",fontFamily:"var(--font-body)",color:e.isActive?t.hover:"text.body",_dark:{color:e.isActive?t.hover:"text.body",_hover:{bg:t.hoverBgDark,color:t.hover}},borderRadius:"md",transition:"all 0.15s",_hover:{color:t.hover,bg:t.hoverBg},cursor:"pointer",children:[e.icon&&o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",flexShrink:0,children:e.icon}),o.jsx("span",{children:e.label}),o.jsx(Dn,{badge:e.badge,scheme:t}),e.isExternal&&o.jsx(oi,{})]}))})}function o2({item:e,scheme:t,renderLink:n,onCloseMenu:r}){var l;const[i,s]=k.useState(!1);return!(e.children&&e.children.length>0)?o.jsx(st.li,{variants:Yl,children:n(e,o.jsxs(f.Box,{as:"span",display:"flex",alignItems:"center",justifyContent:"space-between",px:"3",py:"2.5",fontSize:"md",fontWeight:"medium",fontFamily:"var(--font-body)",color:e.isActive?t.hover:"text.body",_dark:{color:e.isActive?t.hover:"text.body",_hover:{color:t.hover,bg:"bg.subtle"}},borderRadius:"md",_hover:{color:t.hover,bg:"bg.subtle"},cursor:"pointer",onClick:r,children:[o.jsxs(f.Box,{as:"span",display:"inline-flex",alignItems:"center",gap:"2",children:[e.icon&&o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",color:t.solid,children:e.icon}),o.jsx("span",{children:e.label})]}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1.5",children:[o.jsx(Dn,{badge:e.badge,scheme:t}),e.isExternal&&o.jsx(oi,{})]})]}))}):o.jsxs(st.li,{variants:Yl,style:{listStyle:"none"},children:[o.jsxs(f.Box,{as:"button",onClick:()=>s(!i),"aria-expanded":i,display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",px:"3",py:"2.5",fontSize:"md",fontWeight:"medium",fontFamily:"var(--font-body)",color:e.isActive||i?t.hover:"text.body",bg:i?"bg.subtle":"transparent",_dark:{color:e.isActive||i?t.hover:"text.body",bg:i?"bg.subtle":"transparent",_hover:{color:t.hover,bg:"bg.subtle"}},borderRadius:"md",border:"none",cursor:"pointer",textAlign:"left",transition:"background 0.15s ease, color 0.15s ease",_hover:{color:t.hover,bg:"bg.subtle"},children:[o.jsxs(f.Box,{as:"span",display:"inline-flex",alignItems:"center",gap:"2",children:[e.icon&&o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",color:t.solid,children:e.icon}),o.jsx("span",{children:e.label})]}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",children:[o.jsx(Dn,{badge:e.badge,scheme:t}),o.jsx(vf,{isOpen:i})]})]}),o.jsx(dr,{children:i&&o.jsx(st.div,{variants:Jy,initial:"hidden",animate:"visible",exit:"exit",children:o.jsx(f.Box,{pl:"4",pr:"2",py:"1.5",display:"flex",flexDirection:"column",gap:"1",borderLeft:"2px solid",borderColor:"border",ml:"4",my:"1",children:(l=e.children)==null?void 0:l.map((d,c)=>o.jsx(f.Box,{as:"div",children:n(d,o.jsxs(f.Box,{as:"span",display:"flex",alignItems:"flex-start",gap:"2.5",px:"2.5",py:"2",borderRadius:"md",color:"text.body",_dark:{color:"text.body",_hover:{color:t.hover,bg:"bg.subtle"}},_hover:{color:t.hover,bg:"bg.subtle"},cursor:"pointer",onClick:r,children:[d.icon&&o.jsx(f.Box,{as:"span",w:"6",h:"6",borderRadius:"md",bg:"bg.subtle",display:"flex",alignItems:"center",justifyContent:"center",color:t.solid,flexShrink:0,mt:"0.5",children:d.icon}),o.jsxs(f.Box,{flex:"1",minW:"0",children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"1",children:[o.jsxs(f.Box,{as:"span",display:"inline-flex",alignItems:"center",gap:"1",fontSize:"sm",fontWeight:"medium",fontFamily:"var(--font-heading)",children:[o.jsx("span",{children:d.label}),d.isExternal&&o.jsx(oi,{})]}),o.jsx(Dn,{badge:d.badge,scheme:t})]}),d.description&&o.jsx(f.Box,{as:"span",display:"block",fontSize:"xs",color:"text.muted",_dark:{color:"text.muted"},fontFamily:"var(--font-body)",mt:"0.5",lineHeight:"1.3",children:d.description})]})]}))},d.href||`${d.label}-${c}`))})})})]})}function s2({logo:e,navItems:t=[],navItemsAlign:n="center",ctaLabel:r="Get Started",ctaHref:i,onCtaClick:s,ctaIconHref:a,onCtaIconClick:l,secondaryCtaLabel:d,secondaryCtaHref:c,onSecondaryCtaClick:u,ctaSlot:h,renderLink:m=r2,isSticky:p=!1,colorScheme:x="blue",variant:g="solid",...v}){const[y,j]=k.useState(!1),w=Qy[x],A=a??i,B=l??s,C=g==="blur"?{background:"rgba(10,18,32,0.85)",backdropFilter:"blur(12px)"}:{},O=({mobile:E=!1})=>o.jsxs(f.Box,{display:"flex",gap:"2",alignItems:"center",flexDirection:E?"column":"row",children:[d&&o.jsx(Qe,{as:c?"a":"button",href:c,variant:E?"outline":"ghost",colorScheme:x,size:E?"md":"sm",onClick:()=>{u==null||u(),E&&j(!1)},style:E?{width:"100%"}:void 0,children:d}),o.jsx(Qe,{as:i?"a":"button",href:i,variant:"solid",colorScheme:x,size:E?"md":"sm",onClick:()=>{s==null||s(),E&&j(!1)},style:E?{width:"100%"}:void 0,children:r}),!E&&o.jsx(Qe,{as:A?"a":"button",href:A,target:A&&A!==i?"_blank":void 0,rel:A&&A!==i?"noopener noreferrer":void 0,variant:"solid",colorScheme:x,size:"sm",onClick:B,"aria-label":"Open",style:{width:34,height:34,padding:0,borderRadius:8,flexShrink:0},children:o.jsx(e2,{})})]});return o.jsxs(f.Box,{as:"nav",role:"navigation","aria-label":"Main navigation",position:p?"sticky":"relative",top:p?"0":void 0,zIndex:p?"sticky":40,bg:g==="transparent"?"transparent":g==="blur"?void 0:"bg",style:C,borderBottom:"1px solid",borderColor:g==="transparent"?"transparent":"border",transition:"background 0.2s ease, border-color 0.2s ease",...v,children:[o.jsxs(f.Box,{maxW:"1280px",mx:"auto",px:{base:"4",md:"6",lg:"8"},h:"16",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8",children:[o.jsx(f.Box,{flexShrink:0,children:e??o.jsx(cn,{variant:x==="blue"?"blue":"purple",height:28})}),o.jsx(f.Box,{as:"ul",display:{base:"none",md:"flex"},alignItems:"center",justifyContent:n==="left"?"flex-start":n==="right"?"flex-end":"center",gap:"1",listStyleType:"none",m:"0",p:"0",flex:"1",children:t.map((E,F)=>o.jsx(i2,{item:E,scheme:w,renderLink:m},E.href||`${E.label}-${F}`))}),o.jsx(f.Box,{display:{base:"none",md:"flex"},alignItems:"center",flexShrink:0,children:h??o.jsx(O,{})}),o.jsx(f.Box,{as:"button",display:{base:"flex",md:"none"},alignItems:"center",justifyContent:"center",border:"none",bg:"transparent",p:"0",cursor:"pointer",onClick:()=>j(!y),"aria-label":y?"Close menu":"Open menu","aria-expanded":y,position:"relative",width:"32px",height:"32px",flexShrink:0,children:o.jsx(dr,{mode:"wait",initial:!1,children:y?o.jsx(st.span,{initial:{opacity:0,rotate:-45,scale:.7},animate:{opacity:1,rotate:0,scale:1},exit:{opacity:0,rotate:45,scale:.7},transition:{duration:.18,ease:ii},style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(n2,{color:w.solid})},"close"):o.jsx(st.span,{initial:{opacity:0,rotate:45,scale:.7},animate:{opacity:1,rotate:0,scale:1},exit:{opacity:0,rotate:-45,scale:.7},transition:{duration:.18,ease:ii},style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(t2,{color:w.solid})},"hamburger")})})]}),o.jsx(dr,{children:y&&o.jsx(st.div,{variants:Ky,initial:"hidden",animate:"visible",exit:"exit",style:{overflow:"hidden"},children:o.jsxs(f.Box,{display:{base:"block",md:"none"},bg:"bg",borderTop:"1px solid",borderColor:"border",py:"4",px:"4",children:[o.jsx(st.ul,{variants:qy,initial:"hidden",animate:"visible",style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:4},children:t.map((E,F)=>o.jsx(o2,{item:E,scheme:w,renderLink:m,onCloseMenu:()=>j(!1)},E.href||`${E.label}-${F}`))}),o.jsx(st.div,{variants:Xy,initial:"hidden",animate:"visible",children:o.jsx(f.Box,{mt:"4",children:h??o.jsx(O,{mobile:!0})})})]})},"mobile-menu")})]})}const a2={blue:{solid:"#0685FF",solidHover:"#0066CC",token:"blue.500",focusRing:"var(--chakra-colors-blue-500)"},purple:{solid:"#7700CC",solidHover:"#5C00A3",token:"purple.500",focusRing:"var(--chakra-colors-purple-500)"}},l2=e=>({facebook:o.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),o.jsx("g",{clipPath:"url(#clip0_1217_192)",children:o.jsx("path",{d:"M11.0972 21V13.4923H9.112V10.7892H11.0972V8.4804C11.0972 6.66611 12.2698 5 14.9719 5C16.0659 5 16.8749 5.10488 16.8749 5.10488L16.8111 7.62914C16.8111 7.62914 15.9861 7.6211 15.0858 7.6211C14.1114 7.6211 13.9553 8.07014 13.9553 8.81544V10.7892H16.8886L16.761 13.4923H13.9553V21H11.0972Z",fill:"white"})}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1217_192",children:o.jsx("rect",{width:"8",height:"16",fill:"white",transform:"translate(9 5)"})})})]}),twitter:o.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),o.jsx("g",{clipPath:"url(#clip0_1217_186)",children:o.jsx("path",{d:"M14.8963 11.3512L20.3606 5H19.0656L14.3213 10.515L10.5319 5H6.16125L11.8913 13.3394L6.16125 20H7.45625L12.4663 14.1763L16.4681 20H20.8388L14.8963 11.3512ZM13.1231 13.4131L12.5425 12.5825L7.9225 5.975H9.91125L13.6394 11.3075L14.22 12.1381L19.0663 19.0694H17.0775L13.1231 13.4131Z",fill:"white"})}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1217_186",children:o.jsx("rect",{width:"15",height:"15",fill:"white",transform:"translate(6 5)"})})})]}),linkedin:o.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),o.jsx("g",{clipPath:"url(#clip0_1217_198)",children:o.jsx("path",{d:"M18.4298 5.31982H7.57025C6.97368 5.32059 6.40177 5.55791 5.97993 5.97975C5.55809 6.40158 5.32077 6.9735 5.32001 7.57006V18.4296C5.32077 19.0262 5.55809 19.5981 5.97993 20.0199C6.40177 20.4417 6.97368 20.6791 7.57025 20.6798H18.4298C19.0263 20.6791 19.5982 20.4417 20.0201 20.0199C20.4419 19.5981 20.6792 19.0262 20.68 18.4296V7.57006C20.6792 6.9735 20.4419 6.40158 20.0201 5.97975C19.5982 5.55791 19.0263 5.32059 18.4298 5.31982ZM10.7498 17.5003H8.94977V11.1998H10.7498V17.5003ZM10.7498 10.3003H8.94977V8.5003H10.7498V10.3003ZM17.0502 17.5003H15.2502V13.9003C15.2372 13.6704 15.1367 13.4542 14.9694 13.2961C14.802 13.1379 14.5805 13.0498 14.3502 13.0498C14.12 13.0498 13.8985 13.1379 13.7311 13.2961C13.5637 13.4542 13.4633 13.6704 13.4502 13.9003V17.5003H11.6502V11.1998H13.4502V11.5387C13.9216 11.3928 14.2278 11.1998 14.8 11.1998C16.0211 11.2008 17.0502 12.2961 17.0502 13.5902V17.5003Z",fill:"white"})}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1217_198",children:o.jsx("rect",{width:"16",height:"16",fill:"white",transform:"translate(5 5)"})})})]}),instagram:o.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),o.jsx("g",{clipPath:"url(#clip0_1217_183)",children:o.jsx("path",{d:"M10.3938 5.05251C9.5958 5.09014 9.05086 5.21751 8.57443 5.40464C8.08143 5.59682 7.66349 5.85464 7.24768 6.27195C6.83193 6.68926 6.5758 7.10745 6.38505 7.60132C6.20043 8.0787 6.0753 8.62414 6.04005 9.42257C6.0048 10.221 5.99699 10.4777 6.00093 12.5144C6.0048 14.5511 6.0138 14.8064 6.05249 15.6065C6.09061 16.4043 6.21749 16.9491 6.40468 17.4257C6.59718 17.9188 6.85468 18.3365 7.27218 18.7524C7.68961 19.1684 8.10749 19.4239 8.60249 19.6149C9.07949 19.7993 9.62505 19.925 10.4234 19.9599C11.2217 19.9949 11.4786 20.0031 13.5147 19.9991C15.5509 19.9953 15.8072 19.9862 16.6071 19.9483C17.4071 19.9103 17.949 19.7825 18.4257 19.5962C18.9188 19.4033 19.3369 19.1462 19.7525 18.7286C20.1681 18.311 20.4241 17.8925 20.6147 17.3984C20.7995 16.9214 20.925 16.3759 20.9597 15.5781C20.9947 14.7776 21.0029 14.522 20.9991 12.4856C20.9951 10.4492 20.9859 10.1939 20.948 9.39407C20.9101 8.59426 20.783 8.05114 20.5959 7.57426C20.4032 7.0812 20.1459 6.66376 19.7287 6.24751C19.3114 5.83126 18.8925 5.57551 18.3986 5.38532C17.9212 5.20064 17.3761 5.07482 16.5777 5.04032C15.7794 5.00582 15.5225 4.99689 13.4856 5.00089C11.4487 5.00476 11.1937 5.01351 10.3938 5.05251ZM10.4814 18.6107C9.75018 18.5789 9.35311 18.4574 9.08849 18.3557C8.73811 18.2207 8.48849 18.0575 8.2248 17.7963C7.96105 17.5352 7.79911 17.2847 7.6623 16.9351C7.55955 16.6704 7.4358 16.2738 7.40161 15.5426C7.36443 14.7523 7.35661 14.5149 7.35224 12.5126C7.34786 10.5103 7.35555 10.2732 7.39018 9.48257C7.42143 8.75195 7.54368 8.35445 7.64518 8.08995C7.78018 7.73914 7.9428 7.48995 8.20455 7.22645C8.4663 6.96289 8.71605 6.80057 9.06599 6.66376C9.33036 6.56057 9.72693 6.43789 10.4579 6.40307C11.2488 6.36557 11.4858 6.35807 13.4879 6.3537C15.4899 6.34932 15.7275 6.35682 16.5188 6.3917C17.2494 6.42345 17.6471 6.54451 17.9113 6.6467C18.2618 6.7817 18.5113 6.94382 18.7748 7.20607C19.0384 7.4682 19.2008 7.71707 19.3376 8.06776C19.4409 8.33132 19.5637 8.72776 19.5982 9.4592C19.6358 10.2501 19.6444 10.4873 19.6479 12.4892C19.6516 14.4911 19.6445 14.7288 19.6098 15.5192C19.5779 16.2504 19.4567 16.6476 19.3548 16.9126C19.2198 17.2628 19.0571 17.5126 18.7952 17.7759C18.5333 18.0394 18.2839 18.2016 17.9337 18.3384C17.6697 18.4415 17.2727 18.5645 16.5424 18.5993C15.7514 18.6365 15.5144 18.6443 13.5116 18.6487C11.5087 18.6531 11.2724 18.6449 10.4814 18.6107ZM16.5956 8.49151C16.5959 8.66953 16.649 8.84346 16.7481 8.99131C16.8473 9.13916 16.9881 9.25428 17.1527 9.32211C17.3173 9.38994 17.4983 9.40744 17.6728 9.37239C17.8473 9.33735 18.0076 9.25132 18.1332 9.12521C18.2588 8.9991 18.3443 8.83855 18.3787 8.66389C18.413 8.48922 18.3949 8.30828 18.3264 8.14395C18.258 7.97962 18.1423 7.83927 17.9941 7.74067C17.8459 7.64207 17.6718 7.58964 17.4937 7.59001C17.2551 7.59051 17.0264 7.68575 16.858 7.85481C16.6896 8.02386 16.5952 8.25288 16.5956 8.49151ZM9.64905 12.5075C9.65324 14.6345 11.3807 16.3548 13.5072 16.3508C15.6338 16.3468 17.3553 14.6195 17.3513 12.4925C17.3472 10.3655 15.6194 8.6447 13.4926 8.64889C11.3657 8.65307 9.64505 10.3808 9.64905 12.5075ZM11 12.5048C10.999 12.0104 11.1447 11.5267 11.4186 11.1151C11.6925 10.7034 12.0823 10.3822 12.5387 10.1921C12.9951 10.002 13.4977 9.95146 13.9828 10.047C14.468 10.1425 14.9139 10.3797 15.2642 10.7286C15.6146 11.0775 15.8535 11.5225 15.951 12.0073C16.0484 12.492 15.9999 12.9948 15.8116 13.452C15.6233 13.9092 15.3036 14.3003 14.8931 14.5758C14.4825 14.8513 13.9994 14.9989 13.505 14.9999C13.1767 15.0006 12.8514 14.9366 12.5478 14.8116C12.2443 14.6865 11.9683 14.5029 11.7357 14.2712C11.503 14.0395 11.3183 13.7643 11.1921 13.4612C11.0659 13.1581 11.0006 12.8331 11 12.5048Z",fill:"white"})}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1217_183",children:o.jsx("rect",{width:"15",height:"15",fill:"white",transform:"translate(6 5)"})})})]}),youtube:o.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),o.jsx("g",{clipPath:"url(#clip0_1217_195)",children:o.jsx("path",{d:"M20.6653 9.12395C20.5749 8.78346 20.3967 8.47271 20.1484 8.22279C19.9001 7.97287 19.5905 7.79258 19.2507 7.69995C18.0033 7.36328 13 7.36328 13 7.36328C13 7.36328 7.99667 7.36328 6.74867 7.69995C6.40894 7.79274 6.09953 7.9731 5.85139 8.223C5.60324 8.4729 5.42506 8.78357 5.33467 9.12395C5 10.3799 5 12.9999 5 12.9999C5 12.9999 5 15.6199 5.33467 16.8759C5.42506 17.2164 5.60332 17.5272 5.85159 17.7771C6.09987 18.027 6.40945 18.2073 6.74933 18.2999C7.99667 18.6366 13 18.6366 13 18.6366C13 18.6366 18.0033 18.6366 19.2513 18.2999C19.5912 18.2074 19.9009 18.0271 20.1491 17.7772C20.3974 17.5273 20.5757 17.2165 20.666 16.8759C21 15.6199 21 12.9999 21 12.9999C21 12.9999 21 10.3799 20.6653 9.12395ZM11.3633 15.3786V10.6213L15.5453 12.9999L11.3633 15.3786Z",fill:"white"})}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1217_195",children:o.jsx("rect",{width:"16",height:"12",fill:"white",transform:"translate(5 7)"})})})]}),threads:o.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),o.jsx("g",{clipPath:"url(#clip0_1217_189)",children:o.jsx("path",{d:"M13.6162 20H13.6119C11.3737 19.985 9.65312 19.2469 8.49687 17.8069C7.46875 16.525 6.9375 14.7413 6.92 12.5063V12.4956C6.93875 10.2587 7.46937 8.47688 8.49812 7.19438C9.65312 5.75312 11.375 5.015 13.6125 5H13.6212C15.3375 5.0125 16.7731 5.45312 17.8875 6.31125C18.9356 7.1175 19.6737 8.2675 20.0806 9.72813L18.8056 10.0837C18.1156 7.60875 16.3694 6.34375 13.6156 6.32437C11.7969 6.33812 10.4219 6.90937 9.52812 8.0225C8.69187 9.065 8.26 10.5712 8.24312 12.5C8.26 14.4288 8.69187 15.935 9.52875 16.9775C10.4225 18.0919 11.7981 18.6638 13.6162 18.6756C15.2556 18.6631 16.34 18.2812 17.2412 17.3975C18.2706 16.3894 18.2525 15.1519 17.9225 14.3988C17.7287 13.955 17.3769 13.5863 16.9012 13.305C16.7812 14.15 16.5125 14.8337 16.0987 15.35C15.545 16.0387 14.7612 16.415 13.7675 16.4688C13.0162 16.5094 12.2919 16.3325 11.7306 15.9681C11.0662 15.5375 10.6775 14.8806 10.6356 14.1156C10.595 13.3719 10.8906 12.6875 11.4669 12.1894C12.0169 11.7144 12.7912 11.435 13.7062 11.3825C14.3368 11.3431 14.9697 11.3729 15.5937 11.4713C15.515 11.0075 15.3594 10.6388 15.125 10.3731C14.8044 10.0069 14.3075 9.82125 13.6506 9.81687H13.6325C13.105 9.81687 12.3875 9.96188 11.9319 10.6419L10.8337 9.90438C11.4462 8.99563 12.4387 8.49437 13.6325 8.49437H13.66C15.6562 8.50688 16.8456 9.72875 16.9644 11.8619C17.0319 11.8906 17.0994 11.9206 17.165 11.9506C18.0962 12.3881 18.7775 13.0513 19.1362 13.8694C19.6344 15.0069 19.6806 16.8631 18.1687 18.3431C17.0125 19.4744 15.61 19.9856 13.6206 19.9994L13.6162 20ZM14.2431 12.6938C14.0919 12.6938 13.9387 12.6981 13.7812 12.7069C12.6337 12.7713 11.9187 13.2981 11.9587 14.0463C12.0006 14.8313 12.8662 15.1956 13.6987 15.1506C14.4637 15.11 15.46 14.8112 15.6275 12.8319C15.1722 12.7369 14.7082 12.6906 14.2431 12.6938Z",fill:"white"})}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1217_189",children:o.jsx("rect",{width:"15",height:"15",fill:"white",transform:"translate(6 5)"})})})]}),whatsapp:o.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),o.jsx("g",{transform:"translate(5.5, 5.5) scale(0.625)",children:o.jsx("path",{d:"M13.601 2.326A10.454 10.454 0 0 0 3.17 12.784c0 1.896.496 3.743 1.442 5.378L3 24l5.968-1.564a10.428 10.428 0 0 0 4.633 1.082c5.76 0 10.44-4.683 10.44-10.446a10.45 10.45 0 0 0-10.44-10.746zm0 17.584c-1.579 0-3.125-.425-4.48-1.228l-.322-.191-3.332.874.887-3.25-.21-.334A8.75 8.75 0 0 1 4.843 12.78c0-4.832 3.93-8.766 8.761-8.766 2.342 0 4.542.912 6.196 2.569 1.654 1.657 2.566 3.86 2.566 6.205 0 4.836-3.931 8.769-8.765 8.769zm4.811-6.577c-.264-.132-1.564-.772-1.807-.86-.242-.088-.419-.132-.596.132-.176.264-.683.86-.838 1.036-.154.176-.309.198-.573.066-1.545-.774-2.73-1.874-3.593-3.32-.11-.186.11-.176.368-.693.088-.176.044-.33-.022-.462-.066-.132-.596-1.436-.816-1.966-.214-.515-.433-.445-.596-.453-.154-.008-.33-.01-.507-.01-.176 0-.463.066-.705.33-.242.264-.925.904-.925 2.204 0 1.3.947 2.556 1.08 2.732.132.176 1.862 2.844 4.512 3.987 1.84.795 2.52.848 3.424.717.925-.134 2.835-1.157 3.232-2.274.396-1.117.396-2.072.275-2.274-.12-.202-.44-.323-.705-.455z",fill:"white"})})]}),tiktok:o.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),o.jsx("g",{transform:"translate(5.5, 5.5) scale(0.625)",children:o.jsx("path",{d:"M19.589 6.686a4.793 4.793 0 0 1-3.77-4.245V2h-3.445v13.672a2.896 2.896 0 0 1-2.891 2.89 2.895 2.895 0 0 1-2.892-2.89 2.895 2.895 0 0 1 2.892-2.89 2.87 2.87 0 0 1 1.002.18V9.45a6.335 6.335 0 0 0-1.002-.08 6.336 6.336 0 0 0-6.336 6.336 6.336 6.336 0 0 0 6.336 6.336 6.336 6.336 0 0 0 6.336-6.336V8.514a8.216 8.216 0 0 0 4.768 1.512V6.581a4.819 4.819 0 0 1-.998.105z",fill:"white"})})]})}),c2="Nigeria's leading digital platform for specialist healthcare. Bridging the gap between expert care and patient convenience.",u2=[{title:"COMPANY",links:[{label:"About",href:"/about"},{label:"Team",href:"/team"},{label:"Careers",href:"/careers"},{label:"Contact",href:"/contact"}]},{title:"PRODUCT",links:[{label:"For Doctors",href:"/doctors"},{label:"For Businesses",href:"/business"},{label:"For Patients",href:"/patients"},{label:"Homecare",href:"/homecare"}]},{title:"RESOURCES",links:[{label:"Blog",href:"/blog"}]}],d2=[{platform:"instagram",href:"https://instagram.com/medixdeck"},{platform:"twitter",href:"https://twitter.com/medixdeck"},{platform:"whatsapp",href:"https://medixdeck.com/whatsapp"},{platform:"threads",href:"https://threads.net/@medixdeck"},{platform:"facebook",href:"https://facebook.com/medixdeck"},{platform:"youtube",href:"https://youtube.com/@medixdeck"},{platform:"tiktok",href:"https://tiktok.com/@medixdeck"},{platform:"linkedin",href:"https://linkedin.com/company/medixdeck"}],f2=[{label:"Terms",href:"/terms"},{label:"Privacy",href:"/privacy"},{label:"Cookies",href:"/cookies"}],h2=(e,t)=>o.jsx("a",{href:e.href,target:e.isExternal?"_blank":void 0,rel:e.isExternal?"noopener noreferrer":void 0,style:{textDecoration:"none"},children:t});function kf({description:e=c2,logo:t,sections:n=u2,socialLinks:r=d2,copyright:i,bottomLinks:s=f2,newsletter:a,renderLink:l=h2,colorScheme:d="blue",certifications:c,...u}){const h=new Date().getFullYear(),m=i??`© ${h} MedixDeck Health Solutions Ltd. All Rights Reserved.`,[p,x]=k.useState(""),[g,v]=k.useState(!1),[y,j]=k.useState(!1),w=a2[d],{mounted:A,themeMode:B,toggleThemeMode:C}=hr(),O=E=>{E.preventDefault(),a!=null&&a.onSubmit&&p&&(a.onSubmit(p),x(""))};return o.jsx(f.Box,{as:"footer",bg:"bg",py:{base:12,md:16},...u,children:o.jsxs(f.Container,{maxWidth:"7xl",children:[o.jsxs(f.Grid,{templateColumns:{base:"1fr",lg:"1.5fr 1fr 1.5fr"},gap:{base:12,lg:16},mb:16,children:[o.jsxs(f.Box,{children:[o.jsx(f.Box,{mb:4,children:o.jsx(f.Link,{href:"/",children:t??o.jsx(cn,{variant:d==="blue"?"blue":"purple",height:28})})}),o.jsx(f.Text,{fontSize:"sm",color:"text.body",maxW:"320px",lineHeight:"1.6",fontFamily:"var(--font-body)",children:e}),o.jsx(f.HStack,{mt:6,gap:2,flexWrap:"wrap",children:(()=>{const E=l2(w.solid);return r.map(F=>o.jsx(f.Link,{href:F.href,target:"_blank",rel:"noopener noreferrer",display:"inline-flex",transition:"transform 0.2s ease, opacity 0.2s ease",_hover:{transform:"translateY(-2px)",opacity:.9},title:F.platform,"aria-label":F.platform,children:E[F.platform]},F.platform))})()})]}),o.jsx(f.Grid,{templateColumns:"1fr 1fr",gap:8,children:n.map(E=>o.jsxs(f.Box,{children:[o.jsx(f.Text,{fontWeight:"700",color:"text.heading",mb:4,fontSize:"xs",fontFamily:"var(--font-heading)",letterSpacing:"0.05em",textTransform:"uppercase",children:E.title}),o.jsx(f.VStack,{align:"flex-start",gap:3,children:E.links.map(F=>o.jsx(f.Box,{w:"full",children:l(F,o.jsx(f.Box,{as:"span",fontSize:"sm",color:"text.body",fontFamily:"var(--font-body)",_hover:{color:w.token},transition:"color 0.2s ease",cursor:"pointer",display:"block",children:F.label}))},F.label))})]},E.title))}),!(a!=null&&a.hide)&&o.jsx(f.Box,{children:o.jsxs(f.Box,{p:6,borderRadius:"2xl",border:"1px solid",borderColor:"border",bg:"bg",_dark:{bg:"rgba(255,255,255,0.02)"},children:[o.jsx(f.Text,{fontWeight:"700",color:"text.heading",mb:2,fontSize:"md",fontFamily:"var(--font-heading)",children:(a==null?void 0:a.title)??"Newsletter"}),o.jsx(f.Text,{fontSize:"sm",color:"text.body",mb:5,fontFamily:"var(--font-body)",lineHeight:"1.5",children:(a==null?void 0:a.description)??"Get monthly health tips from our verified specialists."}),o.jsxs(f.Box,{as:"form",onSubmit:O,position:"relative",display:"flex",children:[o.jsx(f.Box,{as:"input",type:"email",value:p,onChange:E=>x(E.target.value),placeholder:(a==null?void 0:a.placeholder)??"email@address.com",w:"full",h:"44px",pl:4,pr:"50px",borderRadius:"lg",border:"1px solid",borderColor:"border",bg:"bg.surface",fontSize:"sm",fontFamily:"var(--font-body)",color:"text.body",_placeholder:{color:"text.body"},_focus:{outline:"none",borderColor:w.token,boxShadow:`0 0 0 1px ${w.solid}`},transition:"all 0.2s",required:!0}),o.jsx("button",{type:"submit",style:{position:"absolute",right:"4px",top:"4px",bottom:"4px",width:"36px",height:"36px",padding:0,background:g?w.solidHover:w.solid,color:"white",borderRadius:"6px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",border:"none",boxShadow:y?`0 0 0 3px ${w.focusRing}`:"none",transition:"background 0.2s ease, box-shadow 0.2s ease"},onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),onFocus:()=>j(!0),onBlur:()=>j(!1),"aria-label":"Subscribe",children:(a==null?void 0:a.buttonIcon)??o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),o.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]})]})})]}),o.jsx(f.Box,{borderTop:"1px solid",borderColor:"border",pt:6,children:o.jsxs(f.Flex,{justify:"space-between",align:{base:"center",md:"flex-start"},flexDir:{base:"column-reverse",md:"row"},gap:4,children:[o.jsx(f.Text,{fontSize:"xs",color:"text.body",fontFamily:"var(--font-body)",textAlign:{base:"center",md:"left"},children:m}),o.jsxs(f.HStack,{gap:6,flexWrap:"wrap",justify:"center",alignItems:"center",children:[s.map(E=>o.jsx(f.Box,{children:l(E,o.jsx(f.Box,{as:"span",fontSize:"xs",color:"text.body",fontFamily:"var(--font-body)",_hover:{color:"text.heading"},transition:"color 0.2s ease",cursor:"pointer",children:E.label}))},E.label)),A&&o.jsx(f.Box,{as:"button",onClick:C,display:"inline-flex",alignItems:"center",justifyContent:"center",w:"28px",h:"28px",borderRadius:"full",bg:"bg.surface",border:"1px solid",borderColor:"border",color:"text.body",_hover:{color:"text.heading",bg:"bg"},cursor:"pointer",transition:"all 0.2s","aria-label":"Toggle theme",ml:2,children:B==="dark"?o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"5"}),o.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),o.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),o.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),o.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),o.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),o.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),o.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),o.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}):o.jsx("svg",{width:"14",height:"14",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"})})})]})]})}),c&&c.length>0&&o.jsx(f.Box,{borderTop:"1px solid",borderColor:"border",pt:6,mt:6,pb:0,children:o.jsx(f.Flex,{gap:{base:6,md:10},flexWrap:"wrap",justify:{base:"center",md:"center"},align:"center",children:c.map(E=>{const F=o.jsxs(f.Flex,{align:"center",gap:"3",opacity:.75,_hover:{opacity:1},transition:"opacity 0.2s ease",style:{cursor:E.href?"pointer":"default"},children:[E.imageSrc?o.jsx("img",{src:E.imageSrc,alt:E.name,style:{height:28,width:"auto",objectFit:"contain",display:"block"}}):o.jsx(f.Box,{color:"text.muted",flexShrink:0,children:o.jsx("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",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(f.Text,{fontSize:"xs",fontWeight:"600",fontFamily:"var(--font-body)",color:"text.muted",style:{whiteSpace:"nowrap"},children:E.name})]},E.name);return E.href?o.jsx(f.Box,{children:l({href:E.href,isExternal:E.isExternal??!0},F)},E.name):o.jsx(f.Box,{children:F},E.name)})})})]})})}kf.displayName="MedixFooter";const p2=o.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"m9 18 6-6-6-6"})}),m2=(e,t)=>e.href?o.jsx("a",{href:e.href,style:{textDecoration:"none"},children:t}):o.jsx(o.Fragment,{children:t});function x2({items:e,separator:t=p2,renderLink:n=m2,...r}){return o.jsx(f.Box,{as:"nav","aria-label":"Breadcrumb",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"1.5",...r,children:e.map((i,s)=>{const a=s===e.length-1;return o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1.5",children:[n(i,o.jsx(f.Box,{as:"span",display:"inline-block",lineHeight:"1.2",fontSize:"sm",fontFamily:"var(--font-body)",fontWeight:a?"medium":"normal",color:a?"text.heading":"text.muted",_hover:a?void 0:{color:"blue.500"},cursor:!a&&i.href?"pointer":"default",transition:"color 0.15s",wordBreak:"break-word",whiteSpace:a?"normal":"nowrap",children:i.label})),!a&&o.jsx(f.Box,{color:"text.muted",display:"flex",alignItems:"center",flexShrink:0,mt:"0.5",children:t})]},s)})})}const g2={sm:{px:"3",py:"1.5",fontSize:"sm"},md:{px:"4",py:"2",fontSize:"md"},lg:{px:"5",py:"2.5",fontSize:"lg"}};function y2({tabs:e,defaultActiveId:t,activeId:n,onChange:r,variant:i="line",size:s="md",renderContent:a=!0,...l}){var x;const[d,c]=k.useState(t??((x=e[0])==null?void 0:x.id)),u=n??d,h=g=>{c(g),r==null||r(g)},m=e.find(g=>g.id===u),p=g2[s];return o.jsxs(f.Box,{...l,children:[o.jsx(f.Box,{role:"tablist",display:"flex",gap:i==="pill"?"1":"0",borderBottom:i==="line"?"1px solid":"none",border:i==="pill"?"1px solid":"none",borderColor:"border",bg:i==="pill"?"bg.subtle":"transparent",p:i==="pill"?"1":"0",borderRadius:i==="pill"?"full":"none",overflowX:"auto",flexWrap:"nowrap",style:{scrollbarWidth:"none"},children:e.map(g=>{const v=g.id===u;return o.jsxs(f.Box,{role:"tab","aria-selected":v,"aria-disabled":g.disabled,tabIndex:g.disabled?-1:0,onClick:()=>!g.disabled&&h(g.id),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&!g.disabled&&h(g.id)},display:"flex",alignItems:"center",gap:"2",justifyContent:"center",px:i==="pill"?"4":p.px,py:i==="pill"?"3":p.py,fontFamily:"var(--font-body)",fontWeight:v?"semibold":"medium",fontSize:i==="pill"?"sm":p.fontSize,color:g.disabled?"text.muted":i==="pill"?v?"text.heading":"text.body":v?"blue.500":"text.body",cursor:g.disabled?"not-allowed":"pointer",opacity:g.disabled?.5:1,transition:"all 0.2s ease",whiteSpace:"nowrap",flex:i==="pill"?"1":void 0,flexShrink:i==="pill"?1:0,bg:i==="pill"?v?"bg":"bg.surface":"transparent",borderRadius:i==="pill"?"full":"none",boxShadow:"none",borderBottom:i==="line"?"2px solid":"none",borderColor:i==="line"?v?"blue.500":"transparent":void 0,mb:i==="line"?"-1px":"0",_hover:g.disabled?void 0:i==="line"?{color:"blue.500"}:{bg:v?"bg":"bg.subtle",color:"text.heading"},_focusVisible:{outline:"2px solid",outlineColor:"blue.500",outlineOffset:"2px",borderRadius:i==="pill"?"full":"sm"},children:[o.jsx(f.Text,{fontSize:"inherit",fontWeight:"inherit",color:"inherit",children:g.label}),g.badge!==void 0&&o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",justifyContent:"center",minW:"5",h:"5",px:"1",borderRadius:"full",fontSize:"2xs",fontWeight:"bold",bg:i==="pill"?v?"bg.subtle":"bg":v?"blue.100":"bg.subtle",color:i==="pill"?v?"text.heading":"text.muted":v?"blue.700":"text.muted",children:g.badge})]},g.id)})}),a&&(m==null?void 0:m.content)&&o.jsx(f.Box,{role:"tabpanel",mt:"4",children:m.content})]})}function b2(e,t,n){if(n*2+5>=t)return Array.from({length:t},(d,c)=>c+1);const i=Math.max(e-n,1),s=Math.min(e+n,t),a=i>2,l=s<t-2;if(!a&&l){const d=3+2*n;return[...Array.from({length:d},(c,u)=>u+1),"...",t]}if(a&&!l){const d=3+2*n;return[1,"...",...Array.from({length:d},(c,u)=>t-d+1+u)]}return[1,"...",...Array.from({length:s-i+1},(d,c)=>i+c),"...",t]}function wf({total:e,pageSize:t=10,currentPage:n=1,onChange:r,siblingCount:i=1,showEdges:s=!0,compact:a=!1,...l}){const d=Math.ceil(e/t);if(d<=1)return null;const c=b2(n,d,i),u={display:"inline-flex",alignItems:"center",justifyContent:"center",w:"8",h:"8",borderRadius:"md",fontSize:"sm",fontFamily:"var(--font-body)",fontWeight:"semibold",cursor:"pointer",transition:"all 0.15s",border:"none",userSelect:"none"},h=({children:x,disabled:g,onClick:v,label:y,icon:j,isNext:w})=>o.jsxs(f.Box,{as:"button",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"1.5",h:"8",px:"2",borderRadius:"md",fontSize:"sm",fontFamily:"var(--font-body)",fontWeight:"medium",cursor:"pointer",transition:"all 0.15s",userSelect:"none",border:"none",bg:"transparent",color:"text.muted",opacity:g?.4:1,pointerEvents:g?"none":void 0,onClick:v,"aria-label":y,_hover:{color:"blue.500"},children:[!w&&j&&o.jsx(f.Box,{as:"span",display:"flex",alignItems:"center",children:j}),x,w&&j&&o.jsx(f.Box,{as:"span",display:"flex",alignItems:"center",children:j})]}),m=o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M15 18l-6-6 6-6"})}),p=o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M9 18l6-6-6-6"})});return o.jsxs(f.Box,{as:"nav",role:"navigation","aria-label":"Pagination",display:"flex",alignItems:"center",gap:"2",flexWrap:"wrap",...l,children:[s&&o.jsx(h,{disabled:n===1,onClick:()=>r==null?void 0:r(1),label:"First page",icon:m,children:"First"}),o.jsx(h,{disabled:n===1,onClick:()=>r==null?void 0:r(n-1),label:"Previous page",icon:m,children:"Prev"}),!a&&c.map((x,g)=>x==="..."?o.jsx(f.Box,{...u,bg:"transparent",color:"text.muted",cursor:"default",pointerEvents:"none",children:"…"},`dots-${g}`):o.jsx(f.Box,{as:"button",...u,bg:n===x?"blue.500":"blue.100",color:n===x?"white":"blue.500",_dark:{bg:n===x?"blue.500":"rgba(6, 133, 255, 0.12)",color:n===x?"white":"blue.200"},onClick:()=>r==null?void 0:r(x),"aria-label":`Page ${x}`,"aria-current":n===x?"page":void 0,_hover:n!==x?{bg:"blue.200",_dark:{bg:"rgba(6, 133, 255, 0.2)"}}:void 0,children:x},x)),a&&o.jsxs(f.Box,{px:"3",fontSize:"sm",color:"text.body",fontFamily:"var(--font-body)",whiteSpace:"nowrap",children:[n," / ",d]}),o.jsx(h,{disabled:n===d,onClick:()=>r==null?void 0:r(n+1),label:"Next page",icon:p,isNext:!0,children:"Next"}),s&&o.jsx(h,{disabled:n===d,onClick:()=>r==null?void 0:r(d),label:"Last page",icon:p,isNext:!0,children:"Last"})]})}const Kl=o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M2 7L5.5 10.5L12 4",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});function v2({steps:e,currentStep:t,variant:n="default",orientation:r="horizontal",colorScheme:i="blue",...s}){const a=i==="blue"?"#0685FF":"#7700CC",l=i==="blue"?"rgba(6,133,255,0.10)":"rgba(119,0,204,0.10)";return r==="vertical"?o.jsx(f.Box,{display:"flex",flexDirection:"column",alignItems:"flex-start",...s,children:e.map((c,u)=>{const h=u+1<t,m=u+1===t,p=u===e.length-1,x=h||m?a:"var(--chakra-colors-border, #E2E8F0)";return o.jsxs(f.Box,{display:"flex",flexDirection:"row",alignItems:"flex-start",gap:"3",children:[o.jsxs(f.Box,{display:"flex",flexDirection:"column",alignItems:"center",children:[o.jsx(f.Box,{w:"8",h:"8",borderRadius:"full",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",bg:h||m?a:"bg.subtle",border:"2px solid",borderColor:x,color:"white",fontSize:"sm",fontWeight:"bold",fontFamily:"var(--font-body)",transition:"all 0.25s",children:h?Kl:c.icon??u+1}),!p&&o.jsx(f.Box,{w:"2px",flex:"1",minH:"8",bg:h?a:"border",my:"1",transition:"background 0.25s"})]}),n!=="compact"&&o.jsxs(f.Box,{pt:"1",pb:p?"0":"8",children:[o.jsx(f.Box,{fontSize:"sm",fontWeight:m?"semibold":"medium",color:h||m?a:"text.muted",fontFamily:"var(--font-body)",transition:"color 0.25s",children:c.title}),c.description&&o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:c.description})]})]},c.id)})}):o.jsx(f.Box,{display:"inline-flex",alignItems:"center",gap:"0",role:"list","aria-label":"Progress steps",...s,children:e.map((c,u)=>{const h=u+1<t,m=u+1===t,p=u+1>t,x=u===e.length-1,g=p?"bg.subtle":a,v=h?Kl:c.icon?c.icon:o.jsx(f.Box,{as:"span",fontSize:"13px",fontWeight:"700",fontFamily:"var(--font-body)",color:p?"text.muted":"white",lineHeight:"1",children:u+1}),y=!p&&n!=="compact",j=p?"text.muted":a;return o.jsxs(k.Fragment,{children:[o.jsx(f.Box,{role:"listitem","aria-current":m?"step":void 0,display:"inline-flex",alignItems:"center",gap:"0",children:o.jsxs(f.Box,{display:"inline-flex",alignItems:"center",gap:"2",px:y?"2":"0",py:y?"1.5":"0",bg:y?l:"transparent",borderRadius:"full",transition:"all 0.25s ease",children:[o.jsx(f.Box,{w:"7",h:"7",borderRadius:"full",flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center",bg:g,border:p?"1.5px solid":"none",borderColor:"var(--chakra-colors-border, #E2E8F0)",transition:"all 0.25s ease",flexDirection:"row",children:v}),n!=="compact"&&o.jsx(f.Box,{as:"span",fontSize:"sm",fontWeight:m||h?"semibold":"medium",fontFamily:"var(--font-body)",color:j,whiteSpace:"nowrap",transition:"color 0.25s",children:c.title})]})}),!x&&o.jsx(f.Box,{display:"inline-flex",alignItems:"center",px:"1",flexShrink:0,children:o.jsx(f.Box,{h:"1.5px",w:"10",bg:h?a:"var(--chakra-colors-border, #E2E8F0)",borderRadius:"full",transition:"background 0.25s ease"})})]},c.id)})})}const k2=`
357
357
  @keyframes medix-shimmer {
358
358
  0% { transform: translateX(-100%); }
359
359
  100% { transform: translateX(100%); }
360
360
  }
361
- `;if(typeof document<"u"){const e="medix-skeleton-keyframes";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=y2,document.head.appendChild(t)}}const on=k.forwardRef(({isLoaded:e=!1,children:t,...n},r)=>e?o.jsx(o.Fragment,{children:t}):o.jsx(f.Box,{ref:r,position:"relative",overflow:"hidden",borderRadius:"md",bg:"#E2E8F0",_dark:{bg:"rgba(255,255,255,0.08)"},_before:{content:'""',position:"absolute",inset:"0",backgroundImage:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.65) 50%, transparent 100%)",animation:"medix-shimmer 1.6s ease-in-out infinite",transform:"translateX(-100%)"},...n}));on.displayName="MedixSkeleton";function vf({lines:e=3,spacing:t="3",lastLineWidth:n="60%",...r}){return o.jsx(f.Box,{display:"flex",flexDirection:"column",gap:t,...r,children:Array.from({length:e}).map((i,s)=>o.jsx(on,{h:"3",w:s===e-1?n:"100%",borderRadius:"full"},s))})}function b2({...e}){return o.jsxs(f.Box,{bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",p:"5",...e,children:[o.jsx(on,{h:"48",borderRadius:"md",mb:"4"}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"3",mb:"3",children:[o.jsx(on,{w:"10",h:"10",borderRadius:"full"}),o.jsxs(f.Box,{flex:"1",children:[o.jsx(on,{h:"3",w:"60%",borderRadius:"full",mb:"2"}),o.jsx(on,{h:"2.5",w:"40%",borderRadius:"full"})]})]}),o.jsx(vf,{lines:2})]})}const v2={blue:"#0685FF",purple:"#7700CC",green:"#1B7A38",amber:"#D97706",red:"#DC2626"},k2={xs:"2px",sm:"4px",md:"8px",lg:"12px"};if(typeof document<"u"){const e="medix-progress-keyframes";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=`
361
+ `;if(typeof document<"u"){const e="medix-skeleton-keyframes";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=k2,document.head.appendChild(t)}}const on=k.forwardRef(({isLoaded:e=!1,children:t,...n},r)=>e?o.jsx(o.Fragment,{children:t}):o.jsx(f.Box,{ref:r,position:"relative",overflow:"hidden",borderRadius:"md",bg:"#E2E8F0",_dark:{bg:"rgba(255,255,255,0.08)"},_before:{content:'""',position:"absolute",inset:"0",backgroundImage:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.65) 50%, transparent 100%)",animation:"medix-shimmer 1.6s ease-in-out infinite",transform:"translateX(-100%)"},...n}));on.displayName="MedixSkeleton";function Sf({lines:e=3,spacing:t="3",lastLineWidth:n="60%",...r}){return o.jsx(f.Box,{display:"flex",flexDirection:"column",gap:t,...r,children:Array.from({length:e}).map((i,s)=>o.jsx(on,{h:"3",w:s===e-1?n:"100%",borderRadius:"full"},s))})}function w2({...e}){return o.jsxs(f.Box,{bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",p:"5",...e,children:[o.jsx(on,{h:"48",borderRadius:"md",mb:"4"}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"3",mb:"3",children:[o.jsx(on,{w:"10",h:"10",borderRadius:"full"}),o.jsxs(f.Box,{flex:"1",children:[o.jsx(on,{h:"3",w:"60%",borderRadius:"full",mb:"2"}),o.jsx(on,{h:"2.5",w:"40%",borderRadius:"full"})]})]}),o.jsx(Sf,{lines:2})]})}const S2={blue:"#0685FF",purple:"#7700CC",green:"#1B7A38",amber:"#D97706",red:"#DC2626"},C2={xs:"2px",sm:"4px",md:"8px",lg:"12px"};if(typeof document<"u"){const e="medix-progress-keyframes";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=`
362
362
  @keyframes medix-indeterminate {
363
363
  0% { left: -40%; }
364
364
  100% { left: 100%; }
365
365
  }
366
- `,document.head.appendChild(t)}}const kf=k.forwardRef(({value:e,colorScheme:t="blue",size:n="md",showLabel:r=!1,animated:i=!0,isIndeterminate:s=!1,...a},l)=>{const d=Math.min(100,Math.max(0,e)),c=v2[t],u=k2[n];return o.jsxs(f.Box,{ref:l,w:"100%",...a,children:[r&&o.jsxs(f.Box,{display:"flex",justifyContent:"space-between",mb:"1",fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:[o.jsx("span",{children:"Progress"}),o.jsxs("span",{children:[d,"%"]})]}),o.jsx(f.Box,{w:"100%",h:u,bg:"bg.subtle",borderRadius:"full",overflow:"hidden",position:"relative",children:s?o.jsx(f.Box,{position:"absolute",h:"100%",w:"40%",bg:c,borderRadius:"full",style:{animation:"medix-indeterminate 1.5s linear infinite"}}):o.jsx(f.Box,{h:"100%",w:`${d}%`,bg:c,borderRadius:"full",transition:i?"width 0.6s cubic-bezier(0.4, 0, 0.2, 1)":"none",position:"relative"})})]})});kf.displayName="MedixProgress";const w2={xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"xl",full:"full"};let Kl=!1;function S2(){if(typeof document>"u"||Kl)return;const e=document.createElement("style");e.textContent=`
366
+ `,document.head.appendChild(t)}}const Cf=k.forwardRef(({value:e,colorScheme:t="blue",size:n="md",showLabel:r=!1,animated:i=!0,isIndeterminate:s=!1,...a},l)=>{const d=Math.min(100,Math.max(0,e)),c=S2[t],u=C2[n];return o.jsxs(f.Box,{ref:l,w:"100%",...a,children:[r&&o.jsxs(f.Box,{display:"flex",justifyContent:"space-between",mb:"1",fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:[o.jsx("span",{children:"Progress"}),o.jsxs("span",{children:[d,"%"]})]}),o.jsx(f.Box,{w:"100%",h:u,bg:"bg.subtle",borderRadius:"full",overflow:"hidden",position:"relative",children:s?o.jsx(f.Box,{position:"absolute",h:"100%",w:"40%",bg:c,borderRadius:"full",style:{animation:"medix-indeterminate 1.5s linear infinite"}}):o.jsx(f.Box,{h:"100%",w:`${d}%`,bg:c,borderRadius:"full",transition:i?"width 0.6s cubic-bezier(0.4, 0, 0.2, 1)":"none",position:"relative"})})]})});Cf.displayName="MedixProgress";const j2={xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"xl",full:"full"};let ql=!1;function T2(){if(typeof document>"u"||ql)return;const e=document.createElement("style");e.textContent=`
367
367
  @keyframes medixBottomSheetIn {
368
368
  from { transform: translateY(100%); }
369
369
  to { transform: translateY(0); }
@@ -372,7 +372,7 @@
372
372
  from { transform: translateY(0); }
373
373
  to { transform: translateY(100%); }
374
374
  }
375
- `,document.head.appendChild(e),Kl=!0}function C2({isOpen:e,onClose:t,title:n,description:r,size:i="md",closeOnOverlayClick:s=!0,closeOnEscape:a=!0,footer:l,children:d,mobileVariant:c="bottom-sheet"}){const u=!!(n||r);k.useEffect(()=>{S2()},[]);const h=c==="bottom-sheet";return o.jsxs(f.DialogRoot,{open:e,onOpenChange:m=>{m.open||t()},closeOnInteractOutside:s,closeOnEscape:a,size:w2[i],children:[o.jsx(f.DialogBackdrop,{bg:"rgba(10, 18, 32, 0.7)",backdropFilter:"blur(4px)"}),o.jsx(f.DialogPositioner,{display:"flex",alignItems:h?{base:"flex-end",md:"center"}:"center",justifyContent:"center",children:o.jsxs(f.DialogContent,{bg:"bg.surface",border:"1px solid",borderColor:"border",boxShadow:"none",borderRadius:{base:h?"none":"modal",md:"modal"},w:{base:h?"full":void 0,md:void 0},borderTopRadius:h?{base:"modal",md:"modal"}:"modal",style:h?{"--bottom-sheet-animation":e?"medixBottomSheetIn 0.35s cubic-bezier(0.32,0.72,0,1) both":void 0}:void 0,children:[o.jsxs(f.DialogHeader,{borderBottom:u?"1px solid":"none",borderColor:"border",px:"6",py:"4",display:"flex",flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",position:"relative",minH:u?void 0:"12",children:[h&&o.jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:10,left:"50%",transform:"translateX(-50%)",width:36,height:4,borderRadius:2,background:"var(--chakra-colors-border, #E2E8F0)",display:"none"},className:"medix-bs-handle"}),u&&o.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,paddingRight:"2rem"},children:[n&&o.jsx(f.DialogTitle,{fontFamily:"var(--font-heading)",fontSize:"xl",fontWeight:"semibold",color:"text.heading",children:n}),r&&o.jsx(f.DialogDescription,{mt:"1",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:r})]}),o.jsx(f.DialogCloseTrigger,{position:"absolute",top:"4",right:"4",w:"8",h:"8",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"md",color:"text.muted",_hover:{bg:"bg.subtle",color:"text.heading"},transition:"all 0.15s","aria-label":"Close modal",type:"button",cursor:"pointer",children:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",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"})]})})]}),o.jsx(f.DialogBody,{px:"6",py:"5",children:d}),l&&o.jsx(f.DialogFooter,{borderTop:"1px solid",borderColor:"border",px:"6",py:"4",display:"flex",justifyContent:"flex-end",gap:"3",marginY:"1rem",style:h?{paddingBottom:"env(safe-area-inset-bottom, 16px)"}:void 0,children:l})]})})]})}function j2({icon:e,title:t,description:n,actionLabel:r,onAction:i,secondaryLabel:s,onSecondaryAction:a,...l}){return o.jsxs(f.Box,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",py:"16",px:"8",gap:"4",...l,children:[e&&o.jsx(f.Box,{w:"16",h:"16",borderRadius:"full",bg:"bg.subtle",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"3xl",color:"text.muted",mb:"2",children:e}),o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"xl",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",mb:"2",children:t}),n&&o.jsx(f.Box,{fontSize:"md",color:"text.muted",fontFamily:"var(--font-body)",maxW:"360px",lineHeight:"loose",children:n})]}),(r||s)&&o.jsxs(f.Box,{display:"flex",gap:"3",mt:"2",children:[r&&o.jsx(Qe,{variant:"solid",colorScheme:"blue",onClick:i,children:r}),s&&o.jsx(Qe,{variant:"ghost",colorScheme:"blue",onClick:a,children:s})]})]})}function T2({title:e="Page Not Found",description:t="The page you are looking for doesn't exist or has been moved.",errorMessage:n,actionLabel:r="Go back home",onAction:i,secondaryLabel:s,onSecondaryAction:a,...l}){return o.jsxs(f.Box,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",minH:"100vh",px:"6",bg:"bg",...l,children:[o.jsx(f.Box,{fontSize:"8xl",fontWeight:"bold",color:"blue.500",fontFamily:"var(--font-heading)",lineHeight:"1",mb:"4",opacity:.15,children:"404"}),o.jsx(f.Text,{fontSize:"2xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",mb:"3",children:e}),o.jsx(f.Text,{fontSize:"md",color:"text.muted",fontFamily:"var(--font-body)",maxW:"400px",mb:n?"4":"8",children:t}),n&&process.env.NODE_ENV==="development"&&o.jsx(f.Box,{bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"md",p:"3",mb:"8",maxW:"500px",w:"100%",textAlign:"left",overflowX:"auto",fontFamily:"var(--font-mono)",fontSize:"sm",color:"text.muted",children:n}),o.jsxs(f.Box,{display:"flex",gap:"4",children:[r&&o.jsx(Qe,{variant:"solid",colorScheme:"blue",onClick:i,children:r}),s&&o.jsx(Qe,{variant:"outline",colorScheme:"blue",onClick:a,children:s})]})]})}function B2({title:e="Something went wrong",description:t="An unexpected error occurred on our end. Please try again later.",errorMessage:n,actionLabel:r="Try again",onAction:i,secondaryLabel:s,onSecondaryAction:a,...l}){return o.jsxs(f.Box,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",minH:"100vh",px:"6",bg:"bg",...l,children:[o.jsx(f.Box,{w:"20",h:"20",borderRadius:"full",bg:"red.50",_dark:{bg:"rgba(220, 38, 38, 0.1)"},display:"flex",alignItems:"center",justifyContent:"center",color:"red.500",mb:"6",children:o.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"10"}),o.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),o.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),o.jsx(f.Text,{fontSize:"2xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",mb:"3",children:e}),o.jsx(f.Text,{fontSize:"md",color:"text.muted",fontFamily:"var(--font-body)",maxW:"400px",mb:n?"4":"8",children:t}),n&&process.env.NODE_ENV==="development"&&o.jsx(f.Box,{bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"md",p:"3",mb:"8",maxW:"500px",w:"100%",textAlign:"left",overflowX:"auto",fontFamily:"var(--font-mono)",fontSize:"sm",color:"text.muted",children:n}),o.jsxs(f.Box,{display:"flex",gap:"4",children:[r&&o.jsx(Qe,{variant:"solid",colorScheme:"blue",onClick:i,children:r}),s&&o.jsx(Qe,{variant:"outline",colorScheme:"blue",onClick:a,children:s})]})]})}const E2={left:"start",right:"end",top:"top",bottom:"bottom"};function F2({isOpen:e,onClose:t,title:n,placement:r="right",size:i="md",closeOnOverlayClick:s=!0,closeOnEscape:a=!0,footer:l,children:d}){const c=E2[r]??"end";return o.jsxs(f.DrawerRoot,{open:e,onOpenChange:u=>{u.open||t()},placement:c,size:i,closeOnInteractOutside:s,closeOnEscape:a,children:[o.jsx(f.DrawerBackdrop,{bg:"rgba(10, 18, 32, 0.7)",backdropFilter:"blur(4px)"}),o.jsx(f.DrawerPositioner,{children:o.jsxs(f.DrawerContent,{bg:"bg.surface",border:"1px solid",borderColor:"border",boxShadow:"none",children:[o.jsxs(f.DrawerHeader,{borderBottom:n?"1px solid":"none",borderColor:"border",px:"6",py:"4",position:"relative",minH:n?void 0:"12",children:[n&&o.jsx(f.DrawerTitle,{fontFamily:"var(--font-heading)",fontSize:"xl",fontWeight:"semibold",color:"text.heading",pr:"8",children:n}),o.jsx(f.DrawerCloseTrigger,{position:"absolute",top:"4",right:"4",w:"8",h:"8",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"md",color:"text.muted",_hover:{bg:"bg.subtle",color:"text.heading"},transition:"all 0.15s","aria-label":"Close drawer",type:"button",cursor:"pointer",children:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",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"})]})})]}),o.jsx(f.DrawerBody,{px:"6",py:"5",children:d}),l&&o.jsx(f.DrawerFooter,{borderTop:"1px solid",borderColor:"border",px:"6",py:"4",display:"flex",justifyContent:"flex-end",gap:"3",children:l})]})})]})}/*! js-cookie v3.0.5 | MIT */function Dr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var A2={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Vo(e,t){function n(i,s,a){if(!(typeof document>"u")){a=Dr({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var d in a)a[d]&&(l+="; "+d,a[d]!==!0&&(l+="="+a[d].split(";")[0]));return document.cookie=i+"="+e.write(s,i)+l}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var s=document.cookie?document.cookie.split("; "):[],a={},l=0;l<s.length;l++){var d=s[l].split("="),c=d.slice(1).join("=");try{var u=decodeURIComponent(d[0]);if(a[u]=e.read(c,u),i===u)break}catch{}}return i?a[i]:a}}return Object.create({set:n,get:r,remove:function(i,s){n(i,"",Dr({},s,{expires:-1}))},withAttributes:function(i){return Vo(this.converter,Dr({},this.attributes,i))},withConverter:function(i){return Vo(Dr({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var oi=Vo(A2,{path:"/"});const L2=({condition:e,wrapper:t,children:n})=>e?t(n):n,Wo={TOP:"top",BOTTOM:"bottom"};var Vs=(e=>(e.STRICT="strict",e.LAX="lax",e.NONE="none",e))(Vs||{});const Ho={HIDDEN:"hidden",BY_COOKIE_VALUE:"byCookieValue"},wf="CookieConsent",I2=({children:e,...t})=>k.createElement("button",{...t},e),Qn={disableStyles:!1,hideOnAccept:!0,hideOnDecline:!0,location:Wo.BOTTOM,visible:Ho.BY_COOKIE_VALUE,onAccept:e=>{},onDecline:()=>{},cookieName:wf,cookieValue:"true",declineCookieValue:"false",setDeclineCookie:!0,buttonText:"I understand",declineButtonText:"I decline",debug:!1,expires:365,containerClasses:"CookieConsent",contentClasses:"",buttonClasses:"",buttonWrapperClasses:"",declineButtonClasses:"",buttonId:"rcc-confirm-button",declineButtonId:"rcc-decline-button",extraCookieOptions:{},disableButtonStyles:!1,enableDeclineButton:!1,flipButtons:!1,sameSite:Vs.LAX,ButtonComponent:I2,overlay:!1,overlayClasses:"",onOverlayClick:()=>{},acceptOnOverlayClick:!1,ariaAcceptLabel:"Accept cookies",ariaDeclineLabel:"Decline cookies",acceptOnScroll:!1,acceptOnScrollPercentage:25,customContentAttributes:{},customContainerAttributes:{},customButtonProps:{},customDeclineButtonProps:{},customButtonWrapperAttributes:{},style:{},buttonStyle:{},declineButtonStyle:{},contentStyle:{},overlayStyle:{}},D2={visible:!1,style:{alignItems:"baseline",background:"#353535",color:"white",display:"flex",flexWrap:"wrap",justifyContent:"space-between",left:"0",position:"fixed",width:"100%",zIndex:"999"},buttonStyle:{background:"#ffd42d",border:"0",borderRadius:"0px",boxShadow:"none",color:"black",cursor:"pointer",flex:"0 0 auto",padding:"5px 10px",margin:"15px"},declineButtonStyle:{background:"#c12a2a",border:"0",borderRadius:"0px",boxShadow:"none",color:"#e5e5e5",cursor:"pointer",flex:"0 0 auto",padding:"5px 10px",margin:"15px"},contentStyle:{flex:"1 0 300px",margin:"15px"},overlayStyle:{position:"fixed",left:0,top:0,width:"100%",height:"100%",zIndex:"999",backgroundColor:"rgba(0,0,0,0.3)"}},R2=(e=wf)=>{const t=oi.get(e);return t===void 0?oi.get(Sf(e)):t},Sf=e=>`${e}-legacy`,Cf=class extends k.Component{constructor(){super(...arguments),this.state=D2,this.handleScroll=()=>{const{acceptOnScrollPercentage:t}={...Qn,...this.props},n=document.documentElement,r=document.body,i="scrollTop",s="scrollHeight";(n[i]||r[i])/((n[s]||r[s])-n.clientHeight)*100>t&&this.accept(!0)},this.removeScrollListener=()=>{const{acceptOnScroll:t}=this.props;t&&globalThis.removeEventListener("scroll",this.handleScroll)}}componentDidMount(){const{debug:t}=this.props;(this.getCookieValue()===void 0||t)&&(this.setState({visible:!0}),this.props.acceptOnScroll&&globalThis.addEventListener("scroll",this.handleScroll,{passive:!0}))}componentWillUnmount(){this.removeScrollListener()}accept(t=!1){const{cookieName:n,cookieValue:r,hideOnAccept:i,onAccept:s}={...Qn,...this.props};this.setCookie(n,r),s(t??!1),i&&(this.setState({visible:!1}),this.removeScrollListener())}overlayClick(){const{acceptOnOverlayClick:t,onOverlayClick:n}={...Qn,...this.props};t&&this.accept(),n()}decline(){const{cookieName:t,declineCookieValue:n,hideOnDecline:r,onDecline:i,setDeclineCookie:s}={...Qn,...this.props};s&&this.setCookie(t,n),i(),r&&this.setState({visible:!1})}setCookie(t,n){const{extraCookieOptions:r,expires:i,sameSite:s}=this.props;let{cookieSecurity:a}=this.props;a===void 0&&(a=globalThis.location?globalThis.location.protocol==="https:":!0);const l={expires:i,...r,sameSite:s,secure:a};s===Vs.NONE&&oi.set(Sf(t),n,l),oi.set(t,n,l)}getCookieValue(){const{cookieName:t}=this.props;return R2(t)}render(){switch(this.props.visible){case Ho.HIDDEN:return null;case Ho.BY_COOKIE_VALUE:if(!this.state.visible)return null;break}const{location:t,style:n,buttonStyle:r,declineButtonStyle:i,contentStyle:s,disableStyles:a,buttonText:l,declineButtonText:d,containerClasses:c,contentClasses:u,buttonClasses:h,buttonWrapperClasses:m,declineButtonClasses:p,buttonId:x,declineButtonId:g,disableButtonStyles:v,enableDeclineButton:y,flipButtons:j,ButtonComponent:w,overlay:A,overlayClasses:B,overlayStyle:C,ariaAcceptLabel:O,ariaDeclineLabel:E,customContainerAttributes:F,customContentAttributes:L,customButtonProps:R,customDeclineButtonProps:D,customButtonWrapperAttributes:N}=this.props;let P={},I={},M={},U={},G={};switch(a?(P=Object.assign({},n),I=Object.assign({},r),M=Object.assign({},i),U=Object.assign({},s),G=Object.assign({},C)):(P=Object.assign({},{...this.state.style,...n}),U=Object.assign({},{...this.state.contentStyle,...s}),G=Object.assign({},{...this.state.overlayStyle,...C}),v?(I=Object.assign({},r),M=Object.assign({},i)):(I=Object.assign({},{...this.state.buttonStyle,...r}),M=Object.assign({},{...this.state.declineButtonStyle,...i}))),t){case Wo.TOP:P.top="0";break;case Wo.BOTTOM:P.bottom="0";break}const H=[];return y&&H.push(k.createElement(w,{key:"declineButton",style:M,className:p,id:g,"aria-label":E,onClick:()=>{this.decline()},...D},d)),H.push(k.createElement(w,{key:"acceptButton",style:I,className:h,id:x,"aria-label":O,onClick:()=>{this.accept()},...R},l)),j&&H.reverse(),k.createElement(L2,{condition:A,wrapper:b=>k.createElement("div",{style:G,className:B,onClick:()=>{this.overlayClick()},onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),this.overlayClick())},role:"button",tabIndex:0,"aria-label":"Close cookie consent banner"},b)},k.createElement("div",{className:`${c}`,style:P,...F},k.createElement("div",{style:U,className:u,...L},this.props.children),k.createElement("div",{className:`${m}`,...N},H.map(b=>b))))}};Cf.defaultProps=Qn;let M2=Cf;function jf({title:e="We value your privacy",acceptText:t="Accept All",declineText:n="Reject Non-Essential",enableDeclineButton:r=!0,children:i,...s}){const a=is(),l=a?"#152035":"#F6F6F6",d=a?"#ABC0D6":"#3D4F63",c=a?"#1E3050":"#E4E8F0";return o.jsxs(o.Fragment,{children:[o.jsx("style",{children:`
375
+ `,document.head.appendChild(e),ql=!0}function B2({isOpen:e,onClose:t,title:n,description:r,size:i="md",closeOnOverlayClick:s=!0,closeOnEscape:a=!0,footer:l,children:d,mobileVariant:c="bottom-sheet"}){const u=!!(n||r);k.useEffect(()=>{T2()},[]);const h=c==="bottom-sheet";return o.jsxs(f.DialogRoot,{open:e,onOpenChange:m=>{m.open||t()},closeOnInteractOutside:s,closeOnEscape:a,size:j2[i],children:[o.jsx(f.DialogBackdrop,{bg:"rgba(10, 18, 32, 0.7)",backdropFilter:"blur(4px)"}),o.jsx(f.DialogPositioner,{display:"flex",alignItems:h?{base:"flex-end",md:"center"}:"center",justifyContent:"center",children:o.jsxs(f.DialogContent,{bg:"bg.surface",border:"1px solid",borderColor:"border",boxShadow:"none",borderRadius:{base:h?"none":"modal",md:"modal"},w:{base:h?"full":void 0,md:void 0},borderTopRadius:h?{base:"modal",md:"modal"}:"modal",style:h?{"--bottom-sheet-animation":e?"medixBottomSheetIn 0.35s cubic-bezier(0.32,0.72,0,1) both":void 0}:void 0,children:[o.jsxs(f.DialogHeader,{borderBottom:u?"1px solid":"none",borderColor:"border",px:"6",py:"4",display:"flex",flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",position:"relative",minH:u?void 0:"12",children:[h&&o.jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:10,left:"50%",transform:"translateX(-50%)",width:36,height:4,borderRadius:2,background:"var(--chakra-colors-border, #E2E8F0)",display:"none"},className:"medix-bs-handle"}),u&&o.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,paddingRight:"2rem"},children:[n&&o.jsx(f.DialogTitle,{fontFamily:"var(--font-heading)",fontSize:"xl",fontWeight:"semibold",color:"text.heading",children:n}),r&&o.jsx(f.DialogDescription,{mt:"1",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:r})]}),o.jsx(f.DialogCloseTrigger,{position:"absolute",top:"4",right:"4",w:"8",h:"8",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"md",color:"text.muted",_hover:{bg:"bg.subtle",color:"text.heading"},transition:"all 0.15s","aria-label":"Close modal",type:"button",cursor:"pointer",children:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",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"})]})})]}),o.jsx(f.DialogBody,{px:"6",py:"5",children:d}),l&&o.jsx(f.DialogFooter,{borderTop:"1px solid",borderColor:"border",px:"6",py:"4",display:"flex",justifyContent:"flex-end",gap:"3",marginY:"1rem",style:h?{paddingBottom:"env(safe-area-inset-bottom, 16px)"}:void 0,children:l})]})})]})}function E2({icon:e,title:t,description:n,actionLabel:r,onAction:i,secondaryLabel:s,onSecondaryAction:a,...l}){return o.jsxs(f.Box,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",py:"16",px:"8",gap:"4",...l,children:[e&&o.jsx(f.Box,{w:"16",h:"16",borderRadius:"full",bg:"bg.subtle",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"3xl",color:"text.muted",mb:"2",children:e}),o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"xl",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",mb:"2",children:t}),n&&o.jsx(f.Box,{fontSize:"md",color:"text.muted",fontFamily:"var(--font-body)",maxW:"360px",lineHeight:"loose",children:n})]}),(r||s)&&o.jsxs(f.Box,{display:"flex",gap:"3",mt:"2",children:[r&&o.jsx(Qe,{variant:"solid",colorScheme:"blue",onClick:i,children:r}),s&&o.jsx(Qe,{variant:"ghost",colorScheme:"blue",onClick:a,children:s})]})]})}function F2({title:e="Page Not Found",description:t="The page you are looking for doesn't exist or has been moved.",errorMessage:n,actionLabel:r="Go back home",onAction:i,secondaryLabel:s,onSecondaryAction:a,...l}){return o.jsxs(f.Box,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",minH:"100vh",px:"6",bg:"bg",...l,children:[o.jsx(f.Box,{fontSize:"8xl",fontWeight:"bold",color:"blue.500",fontFamily:"var(--font-heading)",lineHeight:"1",mb:"4",opacity:.15,children:"404"}),o.jsx(f.Text,{fontSize:"2xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",mb:"3",children:e}),o.jsx(f.Text,{fontSize:"md",color:"text.muted",fontFamily:"var(--font-body)",maxW:"400px",mb:n?"4":"8",children:t}),n&&process.env.NODE_ENV==="development"&&o.jsx(f.Box,{bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"md",p:"3",mb:"8",maxW:"500px",w:"100%",textAlign:"left",overflowX:"auto",fontFamily:"var(--font-mono)",fontSize:"sm",color:"text.muted",children:n}),o.jsxs(f.Box,{display:"flex",gap:"4",children:[r&&o.jsx(Qe,{variant:"solid",colorScheme:"blue",onClick:i,children:r}),s&&o.jsx(Qe,{variant:"outline",colorScheme:"blue",onClick:a,children:s})]})]})}function A2({title:e="Something went wrong",description:t="An unexpected error occurred on our end. Please try again later.",errorMessage:n,actionLabel:r="Try again",onAction:i,secondaryLabel:s,onSecondaryAction:a,...l}){return o.jsxs(f.Box,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",minH:"100vh",px:"6",bg:"bg",...l,children:[o.jsx(f.Box,{w:"20",h:"20",borderRadius:"full",bg:"red.50",_dark:{bg:"rgba(220, 38, 38, 0.1)"},display:"flex",alignItems:"center",justifyContent:"center",color:"red.500",mb:"6",children:o.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"10"}),o.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),o.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),o.jsx(f.Text,{fontSize:"2xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",mb:"3",children:e}),o.jsx(f.Text,{fontSize:"md",color:"text.muted",fontFamily:"var(--font-body)",maxW:"400px",mb:n?"4":"8",children:t}),n&&process.env.NODE_ENV==="development"&&o.jsx(f.Box,{bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"md",p:"3",mb:"8",maxW:"500px",w:"100%",textAlign:"left",overflowX:"auto",fontFamily:"var(--font-mono)",fontSize:"sm",color:"text.muted",children:n}),o.jsxs(f.Box,{display:"flex",gap:"4",children:[r&&o.jsx(Qe,{variant:"solid",colorScheme:"blue",onClick:i,children:r}),s&&o.jsx(Qe,{variant:"outline",colorScheme:"blue",onClick:a,children:s})]})]})}const L2={left:"start",right:"end",top:"top",bottom:"bottom"};function I2({isOpen:e,onClose:t,title:n,placement:r="right",size:i="md",closeOnOverlayClick:s=!0,closeOnEscape:a=!0,footer:l,children:d}){const c=L2[r]??"end";return o.jsxs(f.DrawerRoot,{open:e,onOpenChange:u=>{u.open||t()},placement:c,size:i,closeOnInteractOutside:s,closeOnEscape:a,children:[o.jsx(f.DrawerBackdrop,{bg:"rgba(10, 18, 32, 0.7)",backdropFilter:"blur(4px)"}),o.jsx(f.DrawerPositioner,{children:o.jsxs(f.DrawerContent,{bg:"bg.surface",border:"1px solid",borderColor:"border",boxShadow:"none",children:[o.jsxs(f.DrawerHeader,{borderBottom:n?"1px solid":"none",borderColor:"border",px:"6",py:"4",position:"relative",minH:n?void 0:"12",children:[n&&o.jsx(f.DrawerTitle,{fontFamily:"var(--font-heading)",fontSize:"xl",fontWeight:"semibold",color:"text.heading",pr:"8",children:n}),o.jsx(f.DrawerCloseTrigger,{position:"absolute",top:"4",right:"4",w:"8",h:"8",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"md",color:"text.muted",_hover:{bg:"bg.subtle",color:"text.heading"},transition:"all 0.15s","aria-label":"Close drawer",type:"button",cursor:"pointer",children:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",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"})]})})]}),o.jsx(f.DrawerBody,{px:"6",py:"5",children:d}),l&&o.jsx(f.DrawerFooter,{borderTop:"1px solid",borderColor:"border",px:"6",py:"4",display:"flex",justifyContent:"flex-end",gap:"3",children:l})]})})]})}/*! js-cookie v3.0.5 | MIT */function Dr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var D2={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Wo(e,t){function n(i,s,a){if(!(typeof document>"u")){a=Dr({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var d in a)a[d]&&(l+="; "+d,a[d]!==!0&&(l+="="+a[d].split(";")[0]));return document.cookie=i+"="+e.write(s,i)+l}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var s=document.cookie?document.cookie.split("; "):[],a={},l=0;l<s.length;l++){var d=s[l].split("="),c=d.slice(1).join("=");try{var u=decodeURIComponent(d[0]);if(a[u]=e.read(c,u),i===u)break}catch{}}return i?a[i]:a}}return Object.create({set:n,get:r,remove:function(i,s){n(i,"",Dr({},s,{expires:-1}))},withAttributes:function(i){return Wo(this.converter,Dr({},this.attributes,i))},withConverter:function(i){return Wo(Dr({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var si=Wo(D2,{path:"/"});const R2=({condition:e,wrapper:t,children:n})=>e?t(n):n,Ho={TOP:"top",BOTTOM:"bottom"};var Ws=(e=>(e.STRICT="strict",e.LAX="lax",e.NONE="none",e))(Ws||{});const Uo={HIDDEN:"hidden",BY_COOKIE_VALUE:"byCookieValue"},jf="CookieConsent",M2=({children:e,...t})=>k.createElement("button",{...t},e),Qn={disableStyles:!1,hideOnAccept:!0,hideOnDecline:!0,location:Ho.BOTTOM,visible:Uo.BY_COOKIE_VALUE,onAccept:e=>{},onDecline:()=>{},cookieName:jf,cookieValue:"true",declineCookieValue:"false",setDeclineCookie:!0,buttonText:"I understand",declineButtonText:"I decline",debug:!1,expires:365,containerClasses:"CookieConsent",contentClasses:"",buttonClasses:"",buttonWrapperClasses:"",declineButtonClasses:"",buttonId:"rcc-confirm-button",declineButtonId:"rcc-decline-button",extraCookieOptions:{},disableButtonStyles:!1,enableDeclineButton:!1,flipButtons:!1,sameSite:Ws.LAX,ButtonComponent:M2,overlay:!1,overlayClasses:"",onOverlayClick:()=>{},acceptOnOverlayClick:!1,ariaAcceptLabel:"Accept cookies",ariaDeclineLabel:"Decline cookies",acceptOnScroll:!1,acceptOnScrollPercentage:25,customContentAttributes:{},customContainerAttributes:{},customButtonProps:{},customDeclineButtonProps:{},customButtonWrapperAttributes:{},style:{},buttonStyle:{},declineButtonStyle:{},contentStyle:{},overlayStyle:{}},P2={visible:!1,style:{alignItems:"baseline",background:"#353535",color:"white",display:"flex",flexWrap:"wrap",justifyContent:"space-between",left:"0",position:"fixed",width:"100%",zIndex:"999"},buttonStyle:{background:"#ffd42d",border:"0",borderRadius:"0px",boxShadow:"none",color:"black",cursor:"pointer",flex:"0 0 auto",padding:"5px 10px",margin:"15px"},declineButtonStyle:{background:"#c12a2a",border:"0",borderRadius:"0px",boxShadow:"none",color:"#e5e5e5",cursor:"pointer",flex:"0 0 auto",padding:"5px 10px",margin:"15px"},contentStyle:{flex:"1 0 300px",margin:"15px"},overlayStyle:{position:"fixed",left:0,top:0,width:"100%",height:"100%",zIndex:"999",backgroundColor:"rgba(0,0,0,0.3)"}},O2=(e=jf)=>{const t=si.get(e);return t===void 0?si.get(Tf(e)):t},Tf=e=>`${e}-legacy`,Bf=class extends k.Component{constructor(){super(...arguments),this.state=P2,this.handleScroll=()=>{const{acceptOnScrollPercentage:t}={...Qn,...this.props},n=document.documentElement,r=document.body,i="scrollTop",s="scrollHeight";(n[i]||r[i])/((n[s]||r[s])-n.clientHeight)*100>t&&this.accept(!0)},this.removeScrollListener=()=>{const{acceptOnScroll:t}=this.props;t&&globalThis.removeEventListener("scroll",this.handleScroll)}}componentDidMount(){const{debug:t}=this.props;(this.getCookieValue()===void 0||t)&&(this.setState({visible:!0}),this.props.acceptOnScroll&&globalThis.addEventListener("scroll",this.handleScroll,{passive:!0}))}componentWillUnmount(){this.removeScrollListener()}accept(t=!1){const{cookieName:n,cookieValue:r,hideOnAccept:i,onAccept:s}={...Qn,...this.props};this.setCookie(n,r),s(t??!1),i&&(this.setState({visible:!1}),this.removeScrollListener())}overlayClick(){const{acceptOnOverlayClick:t,onOverlayClick:n}={...Qn,...this.props};t&&this.accept(),n()}decline(){const{cookieName:t,declineCookieValue:n,hideOnDecline:r,onDecline:i,setDeclineCookie:s}={...Qn,...this.props};s&&this.setCookie(t,n),i(),r&&this.setState({visible:!1})}setCookie(t,n){const{extraCookieOptions:r,expires:i,sameSite:s}=this.props;let{cookieSecurity:a}=this.props;a===void 0&&(a=globalThis.location?globalThis.location.protocol==="https:":!0);const l={expires:i,...r,sameSite:s,secure:a};s===Ws.NONE&&si.set(Tf(t),n,l),si.set(t,n,l)}getCookieValue(){const{cookieName:t}=this.props;return O2(t)}render(){switch(this.props.visible){case Uo.HIDDEN:return null;case Uo.BY_COOKIE_VALUE:if(!this.state.visible)return null;break}const{location:t,style:n,buttonStyle:r,declineButtonStyle:i,contentStyle:s,disableStyles:a,buttonText:l,declineButtonText:d,containerClasses:c,contentClasses:u,buttonClasses:h,buttonWrapperClasses:m,declineButtonClasses:p,buttonId:x,declineButtonId:g,disableButtonStyles:v,enableDeclineButton:y,flipButtons:j,ButtonComponent:w,overlay:A,overlayClasses:B,overlayStyle:C,ariaAcceptLabel:O,ariaDeclineLabel:E,customContainerAttributes:F,customContentAttributes:L,customButtonProps:R,customDeclineButtonProps:D,customButtonWrapperAttributes:N}=this.props;let P={},I={},M={},U={},G={};switch(a?(P=Object.assign({},n),I=Object.assign({},r),M=Object.assign({},i),U=Object.assign({},s),G=Object.assign({},C)):(P=Object.assign({},{...this.state.style,...n}),U=Object.assign({},{...this.state.contentStyle,...s}),G=Object.assign({},{...this.state.overlayStyle,...C}),v?(I=Object.assign({},r),M=Object.assign({},i)):(I=Object.assign({},{...this.state.buttonStyle,...r}),M=Object.assign({},{...this.state.declineButtonStyle,...i}))),t){case Ho.TOP:P.top="0";break;case Ho.BOTTOM:P.bottom="0";break}const H=[];return y&&H.push(k.createElement(w,{key:"declineButton",style:M,className:p,id:g,"aria-label":E,onClick:()=>{this.decline()},...D},d)),H.push(k.createElement(w,{key:"acceptButton",style:I,className:h,id:x,"aria-label":O,onClick:()=>{this.accept()},...R},l)),j&&H.reverse(),k.createElement(R2,{condition:A,wrapper:b=>k.createElement("div",{style:G,className:B,onClick:()=>{this.overlayClick()},onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),this.overlayClick())},role:"button",tabIndex:0,"aria-label":"Close cookie consent banner"},b)},k.createElement("div",{className:`${c}`,style:P,...F},k.createElement("div",{style:U,className:u,...L},this.props.children),k.createElement("div",{className:`${m}`,...N},H.map(b=>b))))}};Bf.defaultProps=Qn;let z2=Bf;function Ef({title:e="We value your privacy",acceptText:t="Accept All",declineText:n="Reject Non-Essential",enableDeclineButton:r=!0,children:i,...s}){const a=os(),l=a?"#152035":"#F6F6F6",d=a?"#ABC0D6":"#3D4F63",c=a?"#1E3050":"#E4E8F0";return o.jsxs(o.Fragment,{children:[o.jsx("style",{children:`
376
376
  .medixdeck-cookie-banner {
377
377
  background-color: ${l} !important;
378
378
  color: ${d} !important;
@@ -409,20 +409,20 @@
409
409
  align-items: center !important;
410
410
  flex-wrap: wrap !important;
411
411
  }
412
- `}),o.jsx(M2,{location:"bottom",buttonText:t,declineButtonText:n,enableDeclineButton:r,disableStyles:!0,containerClasses:"medixdeck-cookie-banner",contentClasses:"medixdeck-cookie-content",buttonWrapperClasses:"medixdeck-cookie-buttons",ButtonComponent:u=>o.jsx(Qe,{variant:"solid",colorScheme:"blue",size:"sm",onClick:u.onClick,id:u.id,children:u.children}),...s,children:o.jsxs(f.Box,{children:[e&&o.jsx(f.Text,{fontWeight:"700",color:"text.heading",mb:1,fontFamily:"var(--font-heading)",children:e}),o.jsx(f.Text,{fontSize:"sm",color:"text.heading",lineHeight:"1.5",children:i||`We use cookies to securely manage your session, enhance your browsing experience, and analyze our platform's performance. By clicking "Accept All", you consent to our use of cookies.`})]})})]})}jf.displayName="MedixCookieConsentBanner";const Tf="medixdeck_pwa_dismissed",P2=14,O2=[.4,0,.2,1];function z2(){if(typeof window>"u")return!1;const e=window.matchMedia("(display-mode: standalone)").matches,t=window.navigator.standalone===!0;return e||t}function _2(){return typeof navigator>"u"?!1:/iPhone|iPad|iPod/.test(navigator.userAgent)&&!window.MSStream}function N2(e){if(typeof localStorage>"u")return!1;try{const t=localStorage.getItem(Tf);if(!t)return!1;const n=e*24*60*60*1e3;return Date.now()-Number(t)<n}catch{return!1}}function V2(){try{localStorage.setItem(Tf,String(Date.now()))}catch{}}function W2({size:e=18,color:t="#0685FF"}){return o.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),o.jsx("polyline",{points:"16 6 12 2 8 6"}),o.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"15"})]})}function H2(){return o.jsx(f.Box,{flexShrink:0,children:o.jsx(cn,{type:"icon",height:44})})}function Bf({title:e="Install this app",description:t="Add this app to your home screen for faster access and a better experience.",installLabel:n="Install",dismissLabel:r="Not now",cooldownDays:i=P2,onInstall:s,onDismiss:a,appName:l="this app",icon:d,position:c="bottom",delaySeconds:u=0,forceVisible:h,forceIOS:m}){const p=is(),[x,g]=k.useState(!1),[v,y]=k.useState(!1),j=k.useRef(null),w=k.useRef(null);k.useEffect(()=>{const E=()=>{u>0?w.current=setTimeout(()=>g(!0),u*1e3):g(!0)},F=()=>{w.current&&clearTimeout(w.current)};if(h)return m&&y(!0),E(),F;if(z2()||N2(i))return F;if(_2())return y(!0),E(),F;const L=D=>{D.preventDefault(),j.current=D,E()};window.addEventListener("beforeinstallprompt",L);const R=()=>g(!1);return window.addEventListener("appinstalled",R),()=>{window.removeEventListener("beforeinstallprompt",L),window.removeEventListener("appinstalled",R),F()}},[i,u,h,m]);const A=k.useCallback(async()=>{if(j.current){try{await j.current.prompt(),(await j.current.userChoice).outcome==="accepted"&&(s==null||s())}catch{}j.current=null}g(!1)},[s]),B=k.useCallback(()=>{V2(),g(!1),a==null||a()},[a]),C=p?"#152035":"#FFFFFF",O=p?"#1E3050":"#E4E8F0";return o.jsx(dr,{children:x&&o.jsx(st.div,{initial:{opacity:0,y:c==="bottom"?80:-80,x:"-50%"},animate:{opacity:1,y:0,x:"-50%"},exit:{opacity:0,y:c==="bottom"?80:-80,x:"-50%"},transition:{duration:.35,ease:O2},style:{position:"fixed",[c]:16,left:"50%",zIndex:1e3,width:"calc(100% - 32px)",maxWidth:480,pointerEvents:"auto"},children:o.jsx(f.Box,{borderRadius:"16px",p:{base:"4",md:"5"},style:{background:C,border:`1px solid ${O}`,boxShadow:"none"},children:o.jsxs(f.Flex,{gap:"4",align:"flex-start",children:[d??o.jsx(H2,{}),o.jsxs(f.Box,{flex:"1",minW:"0",children:[o.jsx(f.Text,{fontWeight:"700",fontSize:"md",color:"text.heading",fontFamily:"var(--font-heading)",mb:"1",children:e}),v?o.jsxs(f.Box,{children:[o.jsxs(f.Text,{fontSize:"sm",color:"text.muted",lineHeight:"1.5",fontFamily:"var(--font-body)",mb:"3",children:["To install ",l,", tap the"," ",o.jsx("span",{style:{display:"inline-flex",verticalAlign:"middle",margin:"0 2px"},children:o.jsx(W2,{size:16,color:p?"#70B6FF":"#0685FF"})})," ","Share button in Safari, then select"," ",o.jsx("span",{style:{fontWeight:700,color:p?"#F0F6FF":"#111926"},children:'"Add to Home Screen"'}),"."]}),o.jsx(f.Flex,{gap:"3",mb:"3",flexWrap:"wrap",children:[{step:"1",text:"Tap Share"},{step:"2",text:"Add to Home Screen"}].map(E=>o.jsxs(f.Flex,{align:"center",gap:"2",px:"3",py:"1.5",borderRadius:"8px",bg:"bg.subtle",children:[o.jsx(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",w:"20px",h:"20px",borderRadius:"full",flexShrink:0,style:{background:"#0685FF",color:"#FFFFFF",fontSize:"11px",fontWeight:700,fontFamily:"var(--font-body)"},children:E.step}),o.jsx(f.Text,{fontSize:"xs",fontWeight:"600",color:"text.body",fontFamily:"var(--font-body)",children:E.text})]},E.step))})]}):o.jsx(f.Text,{fontSize:"sm",color:"text.muted",lineHeight:"1.5",fontFamily:"var(--font-body)",mb:"3",children:t}),o.jsxs(f.Flex,{gap:"3",align:"center",children:[!v&&o.jsx(Qe,{variant:"solid",colorScheme:"blue",size:"sm",onClick:A,children:n}),o.jsx(Qe,{variant:"ghost",colorScheme:"gray",size:"sm",onClick:B,children:v?"Got it":r})]})]}),o.jsx(f.Box,{as:"button","aria-label":"Close install prompt",onClick:B,display:"flex",alignItems:"center",justifyContent:"center",w:"28px",h:"28px",borderRadius:"full",bg:"bg.subtle",color:"text.muted",flexShrink:0,cursor:"pointer",_hover:{color:"text.heading",bg:"bg.surface"},style:{border:"none",transition:"all 0.2s ease"},mt:"-1",children:o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",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"})]})})]})})})})}Bf.displayName="MedixPWAInstallPrompt";/*! @license DOMPurify 3.4.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.8/LICENSE */function ql(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function U2(e){if(Array.isArray(e))return e}function $2(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,l=[],d=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(d=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);d=!0);}catch(u){c=!0,i=u}finally{try{if(!d&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return l}}function G2(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
413
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Y2(e,t){return U2(e)||$2(e,t)||K2(e,t)||G2()}function K2(e,t){if(e){if(typeof e=="string")return ql(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ql(e,t):void 0}}const Ef=Object.entries,Xl=Object.setPrototypeOf,q2=Object.isFrozen,X2=Object.getPrototypeOf,Z2=Object.getOwnPropertyDescriptor;let Xe=Object.freeze,ht=Object.seal,Bn=Object.create,Ff=typeof Reflect<"u"&&Reflect,Uo=Ff.apply,$o=Ff.construct;Xe||(Xe=function(t){return t});ht||(ht=function(t){return t});Uo||(Uo=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];return t.apply(n,i)});$o||($o=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new t(...r)});const en=Le(Array.prototype.forEach),J2=Le(Array.prototype.lastIndexOf),Zl=Le(Array.prototype.pop),bn=Le(Array.prototype.push),Q2=Le(Array.prototype.splice),Ye=Array.isArray,er=Le(String.prototype.toLowerCase),$i=Le(String.prototype.toString),Jl=Le(String.prototype.match),vn=Le(String.prototype.replace),Ql=Le(String.prototype.indexOf),eb=Le(String.prototype.trim),tb=Le(Number.prototype.toString),nb=Le(Boolean.prototype.toString),ec=typeof BigInt>"u"?null:Le(BigInt.prototype.toString),tc=typeof Symbol>"u"?null:Le(Symbol.prototype.toString),Be=Le(Object.prototype.hasOwnProperty),Gn=Le(Object.prototype.toString),We=Le(RegExp.prototype.test),kn=rb(TypeError);function Le(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Uo(e,t,r)}}function rb(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return $o(e,n)}}function ae(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:er;if(Xl&&Xl(e,null),!Ye(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(q2(t)||(t[r]=s),i=s)}e[i]=!0}return e}function ib(e){for(let t=0;t<e.length;t++)Be(e,t)||(e[t]=null);return e}function $e(e){const t=Bn(null);for(const r of Ef(e)){var n=Y2(r,2);const i=n[0],s=n[1];Be(e,i)&&(Ye(s)?t[i]=ib(s):s&&typeof s=="object"&&s.constructor===Object?t[i]=$e(s):t[i]=s)}return t}function ob(e){switch(typeof e){case"string":return e;case"number":return tb(e);case"boolean":return nb(e);case"bigint":return ec?ec(e):"0";case"symbol":return tc?tc(e):"Symbol()";case"undefined":return Gn(e);case"function":case"object":{if(e===null)return Gn(e);const t=e,n=St(t,"toString");if(typeof n=="function"){const r=n(t);return typeof r=="string"?r:Gn(r)}return Gn(e)}default:return Gn(e)}}function St(e,t){for(;e!==null;){const r=Z2(e,t);if(r){if(r.get)return Le(r.get);if(typeof r.value=="function")return Le(r.value)}e=X2(e)}function n(){return null}return n}function sb(e){try{return We(e,""),!0}catch{return!1}}const nc=Xe(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Gi=Xe(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Yi=Xe(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),ab=Xe(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ki=Xe(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),lb=Xe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),rc=Xe(["#text"]),ic=Xe(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),qi=Xe(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),oc=Xe(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Rr=Xe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),cb=ht(/{{[\w\W]*|^[\w\W]*}}/g),ub=ht(/<%[\w\W]*|^[\w\W]*%>/g),db=ht(/\${[\w\W]*/g),fb=ht(/^data-[\-\w.\u00B7-\uFFFF]+$/),hb=ht(/^aria-[\-\w]+$/),sc=ht(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),pb=ht(/^(?:\w+script|data):/i),mb=ht(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),xb=ht(/^html$/i),gb=ht(/^[a-z][.\w]*(-[.\w]+)+$/i),wt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},yb=function(){return typeof window>"u"?null:window},bb=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const s="dompurify"+(r?"#"+r:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},ac=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Af(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yb();const t=Z=>Af(Z);if(t.version="3.4.8",t.removed=[],!e||!e.document||e.document.nodeType!==wt.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const r=n,i=r.currentScript;e.DocumentFragment;const s=e.HTMLTemplateElement,a=e.Node,l=e.Element,d=e.NodeFilter,c=e.NamedNodeMap;c===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const u=e.DOMParser,h=e.trustedTypes,m=l.prototype,p=St(m,"cloneNode"),x=St(m,"remove"),g=St(m,"nextSibling"),v=St(m,"childNodes"),y=St(m,"parentNode"),j=St(m,"shadowRoot"),w=St(m,"attributes"),A=a&&a.prototype?St(a.prototype,"nodeType"):null,B=a&&a.prototype?St(a.prototype,"nodeName"):null;if(typeof s=="function"){const Z=n.createElement("template");Z.content&&Z.content.ownerDocument&&(n=Z.content.ownerDocument)}let C,O="",E=0;const F=function(S){if(E>0)throw kn('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');E++;try{return C.createHTML(S)}finally{E--}},L=n,R=L.implementation,D=L.createNodeIterator,N=L.createDocumentFragment,P=L.getElementsByTagName,I=r.importNode;let M=ac();t.isSupported=typeof Ef=="function"&&typeof y=="function"&&R&&R.createHTMLDocument!==void 0;const U=cb,G=ub,H=db,b=fb,W=hb,ne=pb,T=mb,be=gb;let ke=sc,J=null;const X=ae({},[...nc,...Gi,...Yi,...Ki,...rc]);let te=null;const de=ae({},[...ic,...qi,...oc,...Rr]);let ee=Object.seal(Bn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ce=null,De=null;const ue=Object.seal(Bn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let hn=!0,Ot=!0,qt=!1,zt=!0,lt=!1,Q=!0,se=!1,he=!1,Se=!1,Oe=!1,pt=!1,vt=!1,z=!0,Y=!1;const re="user-content-";let le=!0,fe=!1,ze={},_e=null;const it=ae({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let _t=null;const Nt=ae({},["audio","video","img","source","image","track"]);let Ve=null;const Dt=ae({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ze="http://www.w3.org/1998/Math/MathML",vr="http://www.w3.org/2000/svg",kt="http://www.w3.org/1999/xhtml";let pn=kt,bi=!1,vi=null;const yh=ae({},[Ze,vr,kt],$i);let ki=ae({},["mi","mo","mn","ms","mtext"]),wi=ae({},["annotation-xml"]);const bh=ae({},["title","style","font","a","script"]);let Hn=null;const vh=["application/xhtml+xml","text/html"],kh="text/html";let Ee=null,mn=null;const wh=n.createElement("form"),na=function(S){return S instanceof RegExp||S instanceof Function},Si=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(mn&&mn===S)return;(!S||typeof S!="object")&&(S={}),S=$e(S),Hn=vh.indexOf(S.PARSER_MEDIA_TYPE)===-1?kh:S.PARSER_MEDIA_TYPE,Ee=Hn==="application/xhtml+xml"?$i:er,J=Be(S,"ALLOWED_TAGS")&&Ye(S.ALLOWED_TAGS)?ae({},S.ALLOWED_TAGS,Ee):X,te=Be(S,"ALLOWED_ATTR")&&Ye(S.ALLOWED_ATTR)?ae({},S.ALLOWED_ATTR,Ee):de,vi=Be(S,"ALLOWED_NAMESPACES")&&Ye(S.ALLOWED_NAMESPACES)?ae({},S.ALLOWED_NAMESPACES,$i):yh,Ve=Be(S,"ADD_URI_SAFE_ATTR")&&Ye(S.ADD_URI_SAFE_ATTR)?ae($e(Dt),S.ADD_URI_SAFE_ATTR,Ee):Dt,_t=Be(S,"ADD_DATA_URI_TAGS")&&Ye(S.ADD_DATA_URI_TAGS)?ae($e(Nt),S.ADD_DATA_URI_TAGS,Ee):Nt,_e=Be(S,"FORBID_CONTENTS")&&Ye(S.FORBID_CONTENTS)?ae({},S.FORBID_CONTENTS,Ee):it,Ce=Be(S,"FORBID_TAGS")&&Ye(S.FORBID_TAGS)?ae({},S.FORBID_TAGS,Ee):$e({}),De=Be(S,"FORBID_ATTR")&&Ye(S.FORBID_ATTR)?ae({},S.FORBID_ATTR,Ee):$e({}),ze=Be(S,"USE_PROFILES")?S.USE_PROFILES&&typeof S.USE_PROFILES=="object"?$e(S.USE_PROFILES):S.USE_PROFILES:!1,hn=S.ALLOW_ARIA_ATTR!==!1,Ot=S.ALLOW_DATA_ATTR!==!1,qt=S.ALLOW_UNKNOWN_PROTOCOLS||!1,zt=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,lt=S.SAFE_FOR_TEMPLATES||!1,Q=S.SAFE_FOR_XML!==!1,se=S.WHOLE_DOCUMENT||!1,Oe=S.RETURN_DOM||!1,pt=S.RETURN_DOM_FRAGMENT||!1,vt=S.RETURN_TRUSTED_TYPE||!1,Se=S.FORCE_BODY||!1,z=S.SANITIZE_DOM!==!1,Y=S.SANITIZE_NAMED_PROPS||!1,le=S.KEEP_CONTENT!==!1,fe=S.IN_PLACE||!1,ke=sb(S.ALLOWED_URI_REGEXP)?S.ALLOWED_URI_REGEXP:sc,pn=typeof S.NAMESPACE=="string"?S.NAMESPACE:kt,ki=Be(S,"MATHML_TEXT_INTEGRATION_POINTS")&&S.MATHML_TEXT_INTEGRATION_POINTS&&typeof S.MATHML_TEXT_INTEGRATION_POINTS=="object"?$e(S.MATHML_TEXT_INTEGRATION_POINTS):ae({},["mi","mo","mn","ms","mtext"]),wi=Be(S,"HTML_INTEGRATION_POINTS")&&S.HTML_INTEGRATION_POINTS&&typeof S.HTML_INTEGRATION_POINTS=="object"?$e(S.HTML_INTEGRATION_POINTS):ae({},["annotation-xml"]);const _=Be(S,"CUSTOM_ELEMENT_HANDLING")&&S.CUSTOM_ELEMENT_HANDLING&&typeof S.CUSTOM_ELEMENT_HANDLING=="object"?$e(S.CUSTOM_ELEMENT_HANDLING):Bn(null);if(ee=Bn(null),Be(_,"tagNameCheck")&&na(_.tagNameCheck)&&(ee.tagNameCheck=_.tagNameCheck),Be(_,"attributeNameCheck")&&na(_.attributeNameCheck)&&(ee.attributeNameCheck=_.attributeNameCheck),Be(_,"allowCustomizedBuiltInElements")&&typeof _.allowCustomizedBuiltInElements=="boolean"&&(ee.allowCustomizedBuiltInElements=_.allowCustomizedBuiltInElements),lt&&(Ot=!1),pt&&(Oe=!0),ze&&(J=ae({},rc),te=Bn(null),ze.html===!0&&(ae(J,nc),ae(te,ic)),ze.svg===!0&&(ae(J,Gi),ae(te,qi),ae(te,Rr)),ze.svgFilters===!0&&(ae(J,Yi),ae(te,qi),ae(te,Rr)),ze.mathMl===!0&&(ae(J,Ki),ae(te,oc),ae(te,Rr))),ue.tagCheck=null,ue.attributeCheck=null,Be(S,"ADD_TAGS")&&(typeof S.ADD_TAGS=="function"?ue.tagCheck=S.ADD_TAGS:Ye(S.ADD_TAGS)&&(J===X&&(J=$e(J)),ae(J,S.ADD_TAGS,Ee))),Be(S,"ADD_ATTR")&&(typeof S.ADD_ATTR=="function"?ue.attributeCheck=S.ADD_ATTR:Ye(S.ADD_ATTR)&&(te===de&&(te=$e(te)),ae(te,S.ADD_ATTR,Ee))),Be(S,"ADD_URI_SAFE_ATTR")&&Ye(S.ADD_URI_SAFE_ATTR)&&ae(Ve,S.ADD_URI_SAFE_ATTR,Ee),Be(S,"FORBID_CONTENTS")&&Ye(S.FORBID_CONTENTS)&&(_e===it&&(_e=$e(_e)),ae(_e,S.FORBID_CONTENTS,Ee)),Be(S,"ADD_FORBID_CONTENTS")&&Ye(S.ADD_FORBID_CONTENTS)&&(_e===it&&(_e=$e(_e)),ae(_e,S.ADD_FORBID_CONTENTS,Ee)),le&&(J["#text"]=!0),se&&ae(J,["html","head","body"]),J.table&&(ae(J,["tbody"]),delete Ce.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw kn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw kn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const K=C;C=S.TRUSTED_TYPES_POLICY;try{O=F("")}catch(pe){throw C=K,pe}}else C===void 0&&S.TRUSTED_TYPES_POLICY!==null&&(C=bb(h,i)),C&&typeof O=="string"&&(O=F(""));(M.uponSanitizeElement.length>0||M.uponSanitizeAttribute.length>0)&&J===X&&(J=$e(J)),M.uponSanitizeAttribute.length>0&&te===de&&(te=$e(te)),Xe&&Xe(S),mn=S},ra=ae({},[...Gi,...Yi,...ab]),ia=ae({},[...Ki,...lb]),Sh=function(S){let _=y(S);(!_||!_.tagName)&&(_={namespaceURI:pn,tagName:"template"});const K=er(S.tagName),pe=er(_.tagName);return vi[S.namespaceURI]?S.namespaceURI===vr?_.namespaceURI===kt?K==="svg":_.namespaceURI===Ze?K==="svg"&&(pe==="annotation-xml"||ki[pe]):!!ra[K]:S.namespaceURI===Ze?_.namespaceURI===kt?K==="math":_.namespaceURI===vr?K==="math"&&wi[pe]:!!ia[K]:S.namespaceURI===kt?_.namespaceURI===vr&&!wi[pe]||_.namespaceURI===Ze&&!ki[pe]?!1:!ia[K]&&(bh[K]||!ra[K]):!!(Hn==="application/xhtml+xml"&&vi[S.namespaceURI]):!1},mt=function(S){bn(t.removed,{element:S});try{y(S).removeChild(S)}catch{x(S)}},Xt=function(S,_){try{bn(t.removed,{attribute:_.getAttributeNode(S),from:_})}catch{bn(t.removed,{attribute:null,from:_})}if(_.removeAttribute(S),S==="is")if(Oe||pt)try{mt(_)}catch{}else try{_.setAttribute(S,"")}catch{}},oa=function(S){let _=null,K=null;if(Se)S="<remove></remove>"+S;else{const xe=Jl(S,/^[\r\n\t ]+/);K=xe&&xe[0]}Hn==="application/xhtml+xml"&&pn===kt&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");const pe=C?F(S):S;if(pn===kt)try{_=new u().parseFromString(pe,Hn)}catch{}if(!_||!_.documentElement){_=R.createDocument(pn,"template",null);try{_.documentElement.innerHTML=bi?O:pe}catch{}}const ce=_.body||_.documentElement;return S&&K&&ce.insertBefore(n.createTextNode(K),ce.childNodes[0]||null),pn===kt?P.call(_,se?"html":"body")[0]:se?_.documentElement:ce},sa=function(S){return D.call(S.ownerDocument||S,S,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Ci=function(S){var _,K;S.normalize();const pe=D.call(S.ownerDocument||S,S,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let ce=pe.nextNode();for(;ce;){let Re=ce.data;en([U,G,H],ct=>{Re=vn(Re,ct," ")}),ce.data=Re,ce=pe.nextNode()}const xe=(_=(K=S.querySelectorAll)===null||K===void 0?void 0:K.call(S,"template"))!==null&&_!==void 0?_:[];en(Array.from(xe),Re=>{xn(Re.content)&&Ci(Re.content)})},kr=function(S){const _=B?B(S):null;return typeof _!="string"||Ee(_)!=="form"?!1:typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||S.attributes!==w(S)||typeof S.removeAttribute!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function"||S.nodeType!==A(S)||S.childNodes!==v(S)},xn=function(S){if(!A||typeof S!="object"||S===null)return!1;try{return A(S)===wt.documentFragment}catch{return!1}},wr=function(S){if(!A||typeof S!="object"||S===null)return!1;try{return typeof A(S)=="number"}catch{return!1}};function Rt(Z,S,_){en(Z,K=>{K.call(t,S,_,mn)})}const aa=function(S){let _=null;if(Rt(M.beforeSanitizeElements,S,null),kr(S))return mt(S),!0;const K=Ee(B?B(S):S.nodeName);if(Rt(M.uponSanitizeElement,S,{tagName:K,allowedTags:J}),Q&&S.hasChildNodes()&&!wr(S.firstElementChild)&&We(/<[/\w!]/g,S.innerHTML)&&We(/<[/\w!]/g,S.textContent)||Q&&S.namespaceURI===kt&&K==="style"&&wr(S.firstElementChild)||S.nodeType===wt.progressingInstruction||Q&&S.nodeType===wt.comment&&We(/<[/\w]/g,S.data))return mt(S),!0;if(Ce[K]||!(ue.tagCheck instanceof Function&&ue.tagCheck(K))&&!J[K]){if(!Ce[K]&&ca(K)&&(ee.tagNameCheck instanceof RegExp&&We(ee.tagNameCheck,K)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(K)))return!1;if(le&&!_e[K]){const ce=y(S),xe=v(S);if(xe&&ce){const Re=xe.length;for(let ct=Re-1;ct>=0;--ct){const xt=p(xe[ct],!0);ce.insertBefore(xt,g(S))}}}return mt(S),!0}return(A?A(S):S.nodeType)===wt.element&&!Sh(S)||(K==="noscript"||K==="noembed"||K==="noframes")&&We(/<\/no(script|embed|frames)/i,S.innerHTML)?(mt(S),!0):(lt&&S.nodeType===wt.text&&(_=S.textContent,en([U,G,H],ce=>{_=vn(_,ce," ")}),S.textContent!==_&&(bn(t.removed,{element:S.cloneNode()}),S.textContent=_)),Rt(M.afterSanitizeElements,S,null),!1)},la=function(S,_,K){if(De[_]||z&&(_==="id"||_==="name")&&(K in n||K in wh))return!1;const pe=te[_]||ue.attributeCheck instanceof Function&&ue.attributeCheck(_,S);if(!(Ot&&!De[_]&&We(b,_))){if(!(hn&&We(W,_))){if(!pe||De[_]){if(!(ca(S)&&(ee.tagNameCheck instanceof RegExp&&We(ee.tagNameCheck,S)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(S))&&(ee.attributeNameCheck instanceof RegExp&&We(ee.attributeNameCheck,_)||ee.attributeNameCheck instanceof Function&&ee.attributeNameCheck(_,S))||_==="is"&&ee.allowCustomizedBuiltInElements&&(ee.tagNameCheck instanceof RegExp&&We(ee.tagNameCheck,K)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(K))))return!1}else if(!Ve[_]){if(!We(ke,vn(K,T,""))){if(!((_==="src"||_==="xlink:href"||_==="href")&&S!=="script"&&Ql(K,"data:")===0&&_t[S])){if(!(qt&&!We(ne,vn(K,T,"")))){if(K)return!1}}}}}}return!0},Ch=ae({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ca=function(S){return!Ch[er(S)]&&We(be,S)},ua=function(S){Rt(M.beforeSanitizeAttributes,S,null);const _=S.attributes;if(!_||kr(S))return;const K={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:te,forceKeepAttr:void 0};let pe=_.length;for(;pe--;){const ce=_[pe],xe=ce.name,Re=ce.namespaceURI,ct=ce.value,xt=Ee(xe),ji=ct;let Ne=xe==="value"?ji:eb(ji);if(K.attrName=xt,K.attrValue=Ne,K.keepAttr=!0,K.forceKeepAttr=void 0,Rt(M.uponSanitizeAttribute,S,K),Ne=K.attrValue,Y&&(xt==="id"||xt==="name")&&Ql(Ne,re)!==0&&(Xt(xe,S),Ne=re+Ne),Q&&We(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ne)){Xt(xe,S);continue}if(xt==="attributename"&&Jl(Ne,"href")){Xt(xe,S);continue}if(K.forceKeepAttr)continue;if(!K.keepAttr){Xt(xe,S);continue}if(!zt&&We(/\/>/i,Ne)){Xt(xe,S);continue}lt&&en([U,G,H],fa=>{Ne=vn(Ne,fa," ")});const da=Ee(S.nodeName);if(!la(da,xt,Ne)){Xt(xe,S);continue}if(C&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!Re)switch(h.getAttributeType(da,xt)){case"TrustedHTML":{Ne=F(Ne);break}case"TrustedScriptURL":{Ne=C.createScriptURL(Ne);break}}if(Ne!==ji)try{Re?S.setAttributeNS(Re,xe,Ne):S.setAttribute(xe,Ne),kr(S)?mt(S):Zl(t.removed)}catch{Xt(xe,S)}}Rt(M.afterSanitizeAttributes,S,null)},Sr=function(S){let _=null;const K=sa(S);for(Rt(M.beforeSanitizeShadowDOM,S,null);_=K.nextNode();)if(Rt(M.uponSanitizeShadowNode,_,null),aa(_),ua(_),xn(_.content)&&Sr(_.content),(A?A(_):_.nodeType)===wt.element){const ce=j?j(_):_.shadowRoot;xn(ce)&&(gn(ce),Sr(ce))}Rt(M.afterSanitizeShadowDOM,S,null)},gn=function(S){const _=A?A(S):S.nodeType;if(_===wt.element){const ce=j?j(S):S.shadowRoot;xn(ce)&&(gn(ce),Sr(ce))}const K=v?v(S):S.childNodes;if(!K)return;const pe=[];en(K,ce=>{bn(pe,ce)});for(const ce of pe)gn(ce);if(_===wt.element){const ce=B?B(S):null;if(typeof ce=="string"&&Ee(ce)==="template"){const xe=S.content;xn(xe)&&gn(xe)}}};return t.sanitize=function(Z){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_=null,K=null,pe=null,ce=null;if(bi=!Z,bi&&(Z="<!-->"),typeof Z!="string"&&!wr(Z)&&(Z=ob(Z),typeof Z!="string"))throw kn("dirty is not a string, aborting");if(!t.isSupported)return Z;if(he||Si(S),t.removed=[],typeof Z=="string"&&(fe=!1),fe){const ct=B?B(Z):Z.nodeName;if(typeof ct=="string"){const xt=Ee(ct);if(!J[xt]||Ce[xt])throw kn("root node is forbidden and cannot be sanitized in-place")}if(kr(Z))throw kn("root node is clobbered and cannot be sanitized in-place");gn(Z)}else if(wr(Z))_=oa("<!---->"),K=_.ownerDocument.importNode(Z,!0),K.nodeType===wt.element&&K.nodeName==="BODY"||K.nodeName==="HTML"?_=K:_.appendChild(K),gn(K);else{if(!Oe&&!lt&&!se&&Z.indexOf("<")===-1)return C&&vt?F(Z):Z;if(_=oa(Z),!_)return Oe?null:vt?O:""}_&&Se&&mt(_.firstChild);const xe=sa(fe?Z:_);for(;pe=xe.nextNode();)aa(pe),ua(pe),xn(pe.content)&&Sr(pe.content);if(fe)return lt&&Ci(Z),Z;if(Oe){if(lt&&Ci(_),pt)for(ce=N.call(_.ownerDocument);_.firstChild;)ce.appendChild(_.firstChild);else ce=_;return(te.shadowroot||te.shadowrootmode)&&(ce=I.call(r,ce,!0)),ce}let Re=se?_.outerHTML:_.innerHTML;return se&&J["!doctype"]&&_.ownerDocument&&_.ownerDocument.doctype&&_.ownerDocument.doctype.name&&We(xb,_.ownerDocument.doctype.name)&&(Re="<!DOCTYPE "+_.ownerDocument.doctype.name+`>
414
- `+Re),lt&&en([U,G,H],ct=>{Re=vn(Re,ct," ")}),C&&vt?F(Re):Re},t.setConfig=function(){let Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Si(Z),he=!0},t.clearConfig=function(){mn=null,he=!1},t.isValidAttribute=function(Z,S,_){mn||Si({});const K=Ee(Z),pe=Ee(S);return la(K,pe,_)},t.addHook=function(Z,S){typeof S=="function"&&bn(M[Z],S)},t.removeHook=function(Z,S){if(S!==void 0){const _=J2(M[Z],S);return _===-1?void 0:Q2(M[Z],_,1)[0]}return Zl(M[Z])},t.removeHooks=function(Z){M[Z]=[]},t.removeAllHooks=function(){M=ac()},t}var Ie=Af(),vb=Ie;Ie.sanitize.bind(Ie);Ie.isSupported;Ie.addHook.bind(Ie);Ie.removeHook.bind(Ie);Ie.removeHooks.bind(Ie);Ie.removeAllHooks.bind(Ie);Ie.setConfig.bind(Ie);Ie.clearConfig.bind(Ie);Ie.isValidAttribute.bind(Ie);Ie.version;Ie.removed;function kb(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const wb=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Sb=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Cb={};function lc(e,t){return(Cb.jsx?Sb:wb).test(e)}const jb=/[ \t\n\f\r]/g;function Tb(e){return typeof e=="object"?e.type==="text"?cc(e.value):!1:cc(e)}function cc(e){return e.replace(jb,"")===""}class yr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}yr.prototype.normal={};yr.prototype.property={};yr.prototype.space=void 0;function Lf(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new yr(n,r,t)}function Go(e){return e.toLowerCase()}class nt{constructor(t,n){this.attribute=n,this.property=t}}nt.prototype.attribute="";nt.prototype.booleanish=!1;nt.prototype.boolean=!1;nt.prototype.commaOrSpaceSeparated=!1;nt.prototype.commaSeparated=!1;nt.prototype.defined=!1;nt.prototype.mustUseProperty=!1;nt.prototype.number=!1;nt.prototype.overloadedBoolean=!1;nt.prototype.property="";nt.prototype.spaceSeparated=!1;nt.prototype.space=void 0;let Bb=0;const oe=fn(),Fe=fn(),Yo=fn(),$=fn(),ge=fn(),ln=fn(),ot=fn();function fn(){return 2**++Bb}const Ko=Object.freeze(Object.defineProperty({__proto__:null,boolean:oe,booleanish:Fe,commaOrSpaceSeparated:ot,commaSeparated:ln,number:$,overloadedBoolean:Yo,spaceSeparated:ge},Symbol.toStringTag,{value:"Module"})),Xi=Object.keys(Ko);class Ws extends nt{constructor(t,n,r,i){let s=-1;if(super(t,n),uc(this,"space",i),typeof r=="number")for(;++s<Xi.length;){const a=Xi[s];uc(this,Xi[s],(r&Ko[a])===Ko[a])}}}Ws.prototype.defined=!0;function uc(e,t,n){n&&(e[t]=n)}function Vn(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new Ws(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Go(r)]=r,n[Go(s.attribute)]=r}return new yr(t,n,e.space)}const If=Vn({properties:{ariaActiveDescendant:null,ariaAtomic:Fe,ariaAutoComplete:null,ariaBusy:Fe,ariaChecked:Fe,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:ge,ariaCurrent:null,ariaDescribedBy:ge,ariaDetails:null,ariaDisabled:Fe,ariaDropEffect:ge,ariaErrorMessage:null,ariaExpanded:Fe,ariaFlowTo:ge,ariaGrabbed:Fe,ariaHasPopup:null,ariaHidden:Fe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ge,ariaLevel:$,ariaLive:null,ariaModal:Fe,ariaMultiLine:Fe,ariaMultiSelectable:Fe,ariaOrientation:null,ariaOwns:ge,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:Fe,ariaReadOnly:Fe,ariaRelevant:null,ariaRequired:Fe,ariaRoleDescription:ge,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:Fe,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Df(e,t){return t in e?e[t]:t}function Rf(e,t){return Df(e,t.toLowerCase())}const Eb=Vn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ln,acceptCharset:ge,accessKey:ge,action:null,allow:null,allowFullScreen:oe,allowPaymentRequest:oe,allowUserMedia:oe,alpha:oe,alt:null,as:null,async:oe,autoCapitalize:null,autoComplete:ge,autoFocus:oe,autoPlay:oe,blocking:ge,capture:null,charSet:null,checked:oe,cite:null,className:ge,closedBy:null,colorSpace:null,cols:$,colSpan:$,command:null,commandFor:null,content:null,contentEditable:Fe,controls:oe,controlsList:ge,coords:$|ln,crossOrigin:null,data:null,dateTime:null,decoding:null,default:oe,defer:oe,dir:null,dirName:null,disabled:oe,download:Yo,draggable:Fe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:oe,formTarget:null,headers:ge,height:$,hidden:Yo,high:$,href:null,hrefLang:null,htmlFor:ge,httpEquiv:ge,id:null,imageSizes:null,imageSrcSet:null,inert:oe,inputMode:null,integrity:null,is:null,isMap:oe,itemId:null,itemProp:ge,itemRef:ge,itemScope:oe,itemType:ge,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:oe,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:oe,muted:oe,name:null,nonce:null,noModule:oe,noValidate:oe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:oe,optimum:$,pattern:null,ping:ge,placeholder:null,playsInline:oe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:oe,referrerPolicy:null,rel:ge,required:oe,reversed:oe,rows:$,rowSpan:$,sandbox:ge,scope:null,scoped:oe,seamless:oe,selected:oe,shadowRootClonable:oe,shadowRootCustomElementRegistry:oe,shadowRootDelegatesFocus:oe,shadowRootMode:null,shadowRootSerializable:oe,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:Fe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:oe,useMap:null,value:Fe,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ge,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:oe,declare:oe,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:oe,noHref:oe,noShade:oe,noWrap:oe,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:Fe,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:oe,disablePictureInPicture:oe,disableRemotePlayback:oe,exportParts:ln,part:ge,prefix:null,property:null,results:$,security:null,unselectable:null},space:"html",transform:Rf}),Fb=Vn({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ot,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:ge,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:oe,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ln,g2:ln,glyphName:ln,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:ot,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:$,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ge,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ot,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ot,rev:ot,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ot,requiredFeatures:ot,requiredFonts:ot,requiredFormats:ot,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:ot,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ot,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ot,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Df}),Mf=Vn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Pf=Vn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Rf}),Of=Vn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Ab={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Lb=/[A-Z]/g,dc=/-[a-z]/g,Ib=/^data[-\w.:]+$/i;function Db(e,t){const n=Go(t);let r=t,i=nt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ib.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(dc,Mb);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!dc.test(s)){let a=s.replace(Lb,Rb);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Ws}return new i(r,t)}function Rb(e){return"-"+e.toLowerCase()}function Mb(e){return e.charAt(1).toUpperCase()}const Pb=Lf([If,Eb,Mf,Pf,Of],"html"),Hs=Lf([If,Fb,Mf,Pf,Of],"svg");function Ob(e){return e.join(" ").trim()}function zf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wn={},Zi,fc;function zb(){if(fc)return Zi;fc=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,d=`
415
- `,c="/",u="*",h="",m="comment",p="declaration";function x(v,y){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];y=y||{};var j=1,w=1;function A(P){var I=P.match(t);I&&(j+=I.length);var M=P.lastIndexOf(d);w=~M?P.length-M:w+P.length}function B(){var P={line:j,column:w};return function(I){return I.position=new C(P),F(),I}}function C(P){this.start=P,this.end={line:j,column:w},this.source=y.source}C.prototype.content=v;function O(P){var I=new Error(y.source+":"+j+":"+w+": "+P);if(I.reason=P,I.filename=y.source,I.line=j,I.column=w,I.source=v,!y.silent)throw I}function E(P){var I=P.exec(v);if(I){var M=I[0];return A(M),v=v.slice(M.length),I}}function F(){E(n)}function L(P){var I;for(P=P||[];I=R();)I!==!1&&P.push(I);return P}function R(){var P=B();if(!(c!=v.charAt(0)||u!=v.charAt(1))){for(var I=2;h!=v.charAt(I)&&(u!=v.charAt(I)||c!=v.charAt(I+1));)++I;if(I+=2,h===v.charAt(I-1))return O("End of comment missing");var M=v.slice(2,I-2);return w+=2,A(M),v=v.slice(I),w+=2,P({type:m,comment:M})}}function D(){var P=B(),I=E(r);if(I){if(R(),!E(i))return O("property missing ':'");var M=E(s),U=P({type:p,property:g(I[0].replace(e,h)),value:M?g(M[0].replace(e,h)):h});return E(a),U}}function N(){var P=[];L(P);for(var I;I=D();)I!==!1&&(P.push(I),L(P));return P}return F(),N()}function g(v){return v?v.replace(l,h):h}return Zi=x,Zi}var hc;function _b(){if(hc)return wn;hc=1;var e=wn&&wn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wn,"__esModule",{value:!0}),wn.default=n;const t=e(zb());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const a=(0,t.default)(r),l=typeof i=="function";return a.forEach(d=>{if(d.type!=="declaration")return;const{property:c,value:u}=d;l?i(c,u,d):u&&(s=s||{},s[c]=u)}),s}return wn}var Yn={},pc;function Nb(){if(pc)return Yn;pc=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(c){return!c||n.test(c)||e.test(c)},a=function(c,u){return u.toUpperCase()},l=function(c,u){return"".concat(u,"-")},d=function(c,u){return u===void 0&&(u={}),s(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(i,l):c=c.replace(r,l),c.replace(t,a))};return Yn.camelCase=d,Yn}var Kn,mc;function Vb(){if(mc)return Kn;mc=1;var e=Kn&&Kn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(_b()),n=Nb();function r(i,s){var a={};return!i||typeof i!="string"||(0,t.default)(i,function(l,d){l&&d&&(a[(0,n.camelCase)(l,s)]=d)}),a}return r.default=r,Kn=r,Kn}var Wb=Vb();const Hb=zf(Wb),_f=Nf("end"),Us=Nf("start");function Nf(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Ub(e){const t=Us(e),n=_f(e);if(t&&n)return{start:t,end:n}}function ir(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?xc(e.position):"start"in e||"end"in e?xc(e):"line"in e||"column"in e?qo(e):""}function qo(e){return gc(e&&e.line)+":"+gc(e&&e.column)}function xc(e){return qo(e&&e.start)+"-"+qo(e&&e.end)}function gc(e){return e&&typeof e=="number"?e:1}class Ge extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?s.ruleId=r:(s.source=r.slice(0,d),s.ruleId=r.slice(d+1))}if(!s.place&&s.ancestors&&s.ancestors){const d=s.ancestors[s.ancestors.length-1];d&&(s.place=d.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=ir(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ge.prototype.file="";Ge.prototype.name="";Ge.prototype.reason="";Ge.prototype.message="";Ge.prototype.stack="";Ge.prototype.column=void 0;Ge.prototype.line=void 0;Ge.prototype.ancestors=void 0;Ge.prototype.cause=void 0;Ge.prototype.fatal=void 0;Ge.prototype.place=void 0;Ge.prototype.ruleId=void 0;Ge.prototype.source=void 0;const $s={}.hasOwnProperty,$b=new Map,Gb=/[A-Z]/g,Yb=new Set(["table","tbody","thead","tfoot","tr"]),Kb=new Set(["td","th"]),Vf="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function qb(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=r5(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=n5(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Hs:Pb,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=Wf(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function Wf(e,t,n){if(t.type==="element")return Xb(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Zb(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Qb(e,t,n);if(t.type==="mdxjsEsm")return Jb(e,t);if(t.type==="root")return e5(e,t,n);if(t.type==="text")return t5(e,t)}function Xb(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Hs,e.schema=i),e.ancestors.push(t);const s=Uf(e,t.tagName,!1),a=i5(e,t);let l=Ys(e,t);return Yb.has(t.tagName)&&(l=l.filter(function(d){return typeof d=="string"?!Tb(d):!0})),Hf(e,a,s,t),Gs(a,l),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function Zb(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}fr(e,t.position)}function Jb(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);fr(e,t.position)}function Qb(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Hs,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Uf(e,t.name,!0),a=o5(e,t),l=Ys(e,t);return Hf(e,a,s,t),Gs(a,l),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function e5(e,t,n){const r={};return Gs(r,Ys(e,t)),e.create(t,e.Fragment,r,n)}function t5(e,t){return t.value}function Hf(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Gs(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function n5(e,t,n){return r;function r(i,s,a,l){const c=Array.isArray(a.children)?n:t;return l?c(s,a,l):c(s,a)}}function r5(e,t){return n;function n(r,i,s,a){const l=Array.isArray(s.children),d=Us(r);return t(i,s,a,l,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function i5(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&$s.call(t.properties,i)){const s=s5(e,i,t.properties[i]);if(s){const[a,l]=s;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&Kb.has(t.tagName)?r=l:n[a]=l}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function o5(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else fr(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else fr(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Ys(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:$b;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys){const d=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(d){const c=i.get(d)||0;a=d+"-"+c,i.set(d,c+1)}}const l=Wf(e,s,a);l!==void 0&&n.push(l)}return n}function s5(e,t,n){const r=Db(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?kb(n):Ob(n)),r.property==="style"){let i=typeof n=="object"?n:a5(e,String(n));return e.stylePropertyNameCase==="css"&&(i=l5(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Ab[r.property]||r.property:r.attribute,n]}}function a5(e,t){try{return Hb(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Ge("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Vf+"#cannot-parse-style-attribute",i}}function Uf(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,a;for(;++s<i.length;){const l=lc(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:l,computed:!!(s&&l.type==="Literal"),optional:!1}:l}r=a}else r=lc(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return $s.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);fr(e)}function fr(e,t){const n=new Ge("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Vf+"#cannot-handle-mdx-estrees-without-createevaluater",n}function l5(e){const t={};let n;for(n in e)$s.call(e,n)&&(t[c5(n)]=e[n]);return t}function c5(e){let t=e.replace(Gb,u5);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function u5(e){return"-"+e.toLowerCase()}const Ji={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},d5={};function f5(e,t){const n=d5,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return $f(e,r,i)}function $f(e,t,n){if(h5(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return yc(e.children,t,n)}return Array.isArray(e)?yc(e,t,n):""}function yc(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=$f(e[i],t,n);return r.join("")}function h5(e){return!!(e&&typeof e=="object")}const bc=document.createElement("i");function Ks(e){const t="&"+e+";";bc.innerHTML=t;const n=bc.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function It(e,t,n,r){const i=e.length;let s=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function ut(e,t){return e.length>0?(It(e,e.length,0,t),e):t}const vc={}.hasOwnProperty;function p5(e){const t={};let n=-1;for(;++n<e.length;)m5(t,e[n]);return t}function m5(e,t){let n;for(n in t){const i=(vc.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){vc.call(i,a)||(i[a]=[]);const l=s[a];x5(i[a],Array.isArray(l)?l:l?[l]:[])}}}function x5(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);It(e,0,0,r)}function Gf(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Rn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Et=Kt(/[A-Za-z]/),at=Kt(/[\dA-Za-z]/),g5=Kt(/[#-'*+\--9=?A-Z^-~]/);function Xo(e){return e!==null&&(e<32||e===127)}const Zo=Kt(/\d/),y5=Kt(/[\dA-Fa-f]/),b5=Kt(/[!-/:-@[-`{-~]/);function ie(e){return e!==null&&e<-2}function tt(e){return e!==null&&(e<0||e===32)}function me(e){return e===-2||e===-1||e===32}const v5=Kt(new RegExp("\\p{P}|\\p{S}","u")),k5=Kt(/\s/);function Kt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Wn(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&at(e.charCodeAt(n+1))&&at(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(a=String.fromCharCode(s,l),i=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ve(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(d){return me(d)?(e.enter(n),l(d)):t(d)}function l(d){return me(d)&&s++<i?(e.consume(d),l):(e.exit(n),t(d))}}const w5={tokenize:S5};function S5(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ve(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),s(l)}function s(l){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,a(l)}function a(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return ie(l)?(e.consume(l),e.exit("chunkText"),s):(e.consume(l),a)}}const C5={tokenize:j5},kc={tokenize:T5};function j5(e){const t=this,n=[];let r=0,i,s,a;return l;function l(w){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,d,c)(w)}return c(w)}function d(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&j();const A=t.events.length;let B=A,C;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){C=t.events[B][1].end;break}y(r);let O=A;for(;O<t.events.length;)t.events[O][1].end={...C},O++;return It(t.events,B+1,0,t.events.slice(A)),t.events.length=O,c(w)}return l(w)}function c(w){if(r===n.length){if(!i)return m(w);if(i.currentConstruct&&i.currentConstruct.concrete)return x(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(kc,u,h)(w)}function u(w){return i&&j(),y(r),m(w)}function h(w){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,x(w)}function m(w){return t.containerState={},e.attempt(kc,p,x)(w)}function p(w){return r++,n.push([t.currentConstruct,t.containerState]),m(w)}function x(w){if(w===null){i&&j(),y(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),g(w)}function g(w){if(w===null){v(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return ie(w)?(e.consume(w),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(w),g)}function v(w,A){const B=t.sliceStream(w);if(A&&B.push(null),w.previous=s,s&&(s.next=w),s=w,i.defineSkip(w.start),i.write(B),t.parser.lazy[w.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<a&&(!i.events[C][1].end||i.events[C][1].end.offset>a))return;const O=t.events.length;let E=O,F,L;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(F){L=t.events[E][1].end;break}F=!0}for(y(r),C=O;C<t.events.length;)t.events[C][1].end={...L},C++;It(t.events,E+1,0,t.events.slice(O)),t.events.length=C}}function y(w){let A=n.length;for(;A-- >w;){const B=n[A];t.containerState=B[1],B[0].exit.call(t,e)}n.length=w}function j(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function T5(e,t,n){return ve(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wc(e){if(e===null||tt(e)||k5(e))return 1;if(v5(e))return 2}function qs(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Jo={name:"attention",resolveAll:B5,tokenize:E5};function B5(e,t){let n=-1,r,i,s,a,l,d,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},m={...e[n][1].start};Sc(h,-d),Sc(m,d),a={type:d>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},l={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},s={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...a.start},end:{...l.end}},e[r][1].end={...a.start},e[n][1].start={...l.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ut(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ut(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),c=ut(c,qs(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ut(c,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=ut(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,It(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function E5(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=wc(r);let s;return a;function a(d){return s=d,e.enter("attentionSequence"),l(d)}function l(d){if(d===s)return e.consume(d),l;const c=e.exit("attentionSequence"),u=wc(d),h=!u||u===2&&i||n.includes(d),m=!i||i===2&&u||n.includes(r);return c._open=!!(s===42?h:h&&(i||!m)),c._close=!!(s===42?m:m&&(u||!h)),t(d)}}function Sc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const F5={name:"autolink",tokenize:A5};function A5(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return Et(p)?(e.consume(p),a):p===64?n(p):c(p)}function a(p){return p===43||p===45||p===46||at(p)?(r=1,l(p)):c(p)}function l(p){return p===58?(e.consume(p),r=0,d):(p===43||p===45||p===46||at(p))&&r++<32?(e.consume(p),l):(r=0,c(p))}function d(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Xo(p)?n(p):(e.consume(p),d)}function c(p){return p===64?(e.consume(p),u):g5(p)?(e.consume(p),c):n(p)}function u(p){return at(p)?h(p):n(p)}function h(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):m(p)}function m(p){if((p===45||at(p))&&r++<63){const x=p===45?m:h;return e.consume(p),x}return n(p)}}const xi={partial:!0,tokenize:L5};function L5(e,t,n){return r;function r(s){return me(s)?ve(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||ie(s)?t(s):n(s)}}const Yf={continuation:{tokenize:D5},exit:R5,name:"blockQuote",tokenize:I5};function I5(e,t,n){const r=this;return i;function i(a){if(a===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),s}return n(a)}function s(a){return me(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function D5(e,t,n){const r=this;return i;function i(a){return me(a)?ve(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(Yf,t,n)(a)}}function R5(e){e.exit("blockQuote")}const Kf={name:"characterEscape",tokenize:M5};function M5(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return b5(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const qf={name:"characterReference",tokenize:P5};function P5(e,t,n){const r=this;let i=0,s,a;return l;function l(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),d}function d(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,a=at,u(h))}function c(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=y5,u):(e.enter("characterReferenceValue"),s=7,a=Zo,u(h))}function u(h){if(h===59&&i){const m=e.exit("characterReferenceValue");return a===at&&!Ks(r.sliceSerialize(m))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(h)&&i++<s?(e.consume(h),u):n(h)}}const Cc={partial:!0,tokenize:z5},jc={concrete:!0,name:"codeFenced",tokenize:O5};function O5(e,t,n){const r=this,i={partial:!0,tokenize:B};let s=0,a=0,l;return d;function d(C){return c(C)}function c(C){const O=r.events[r.events.length-1];return s=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,l=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(C)}function u(C){return C===l?(a++,e.consume(C),u):a<3?n(C):(e.exit("codeFencedFenceSequence"),me(C)?ve(e,h,"whitespace")(C):h(C))}function h(C){return C===null||ie(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(Cc,g,A)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||ie(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(C)):me(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ve(e,p,"whitespace")(C)):C===96&&C===l?n(C):(e.consume(C),m)}function p(C){return C===null||ie(C)?h(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(C))}function x(C){return C===null||ie(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(C)):C===96&&C===l?n(C):(e.consume(C),x)}function g(C){return e.attempt(i,A,v)(C)}function v(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),y}function y(C){return s>0&&me(C)?ve(e,j,"linePrefix",s+1)(C):j(C)}function j(C){return C===null||ie(C)?e.check(Cc,g,A)(C):(e.enter("codeFlowValue"),w(C))}function w(C){return C===null||ie(C)?(e.exit("codeFlowValue"),j(C)):(e.consume(C),w)}function A(C){return e.exit("codeFenced"),t(C)}function B(C,O,E){let F=0;return L;function L(I){return C.enter("lineEnding"),C.consume(I),C.exit("lineEnding"),R}function R(I){return C.enter("codeFencedFence"),me(I)?ve(C,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):D(I)}function D(I){return I===l?(C.enter("codeFencedFenceSequence"),N(I)):E(I)}function N(I){return I===l?(F++,C.consume(I),N):F>=a?(C.exit("codeFencedFenceSequence"),me(I)?ve(C,P,"whitespace")(I):P(I)):E(I)}function P(I){return I===null||ie(I)?(C.exit("codeFencedFence"),O(I)):E(I)}}}function z5(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Qi={name:"codeIndented",tokenize:N5},_5={partial:!0,tokenize:V5};function N5(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ve(e,s,"linePrefix",5)(c)}function s(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?d(c):ie(c)?e.attempt(_5,a,d)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||ie(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),l)}function d(c){return e.exit("codeIndented"),t(c)}}function V5(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):ie(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):ve(e,s,"linePrefix",5)(a)}function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):ie(a)?i(a):n(a)}}const W5={name:"codeText",previous:U5,resolve:H5,tokenize:$5};function H5(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function U5(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function $5(e,t,n){let r=0,i,s;return a;function a(h){return e.enter("codeText"),e.enter("codeTextSequence"),l(h)}function l(h){return h===96?(e.consume(h),r++,l):(e.exit("codeTextSequence"),d(h))}function d(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),d):h===96?(s=e.enter("codeTextSequence"),i=0,u(h)):ie(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),d):(e.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||ie(h)?(e.exit("codeTextData"),d(h)):(e.consume(h),c)}function u(h){return h===96?(e.consume(h),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(s.type="codeTextData",c(h))}}class G5{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&qn(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),qn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),qn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);qn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);qn(this.left,n.reverse())}}}function qn(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Xf(e){const t={};let n=-1,r,i,s,a,l,d,c;const u=new G5(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,s=0,s<d.length&&d[s][1].type==="lineEndingBlank"&&(s+=2),s<d.length&&d[s][1].type==="content"))for(;++s<d.length&&d[s][1].type!=="content";)d[s][1].type==="chunkText"&&(d[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Y5(u,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=u.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},l=u.slice(i,n),l.unshift(r),u.splice(i,n-i+1,l))}}return It(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function Y5(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const l=a.events,d=[],c={};let u,h,m=-1,p=n,x=0,g=0;const v=[g];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),h&&a.defineSkip(p.start),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=p,p=p.next}for(p=n;++m<l.length;)l[m][0]==="exit"&&l[m-1][0]==="enter"&&l[m][1].type===l[m-1][1].type&&l[m][1].start.line!==l[m][1].end.line&&(g=m+1,v.push(g),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(a.events=[],p?(p._tokenizer=void 0,p.previous=void 0):v.pop(),m=v.length;m--;){const y=l.slice(v[m],v[m+1]),j=s.pop();d.push([j,j+y.length-1]),e.splice(j,2,y)}for(d.reverse(),m=-1;++m<d.length;)c[x+d[m][0]]=x+d[m][1],x+=d[m][1]-d[m][0]-1;return c}const K5={resolve:X5,tokenize:Z5},q5={partial:!0,tokenize:J5};function X5(e){return Xf(e),e}function Z5(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?s(l):ie(l)?e.check(q5,a,s)(l):(e.consume(l),i)}function s(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function a(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function J5(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ve(e,s,"linePrefix")}function s(a){if(a===null||ie(a))return n(a);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function Zf(e,t,n,r,i,s,a,l,d){const c=d||Number.POSITIVE_INFINITY;let u=0;return h;function h(y){return y===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(y),e.exit(s),m):y===null||y===32||y===41||Xo(y)?n(y):(e.enter(r),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(y))}function m(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(l),m(y)):y===null||y===60||ie(y)?n(y):(e.consume(y),y===92?x:p)}function x(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function g(y){return!u&&(y===null||y===41||tt(y))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(r),t(y)):u<c&&y===40?(e.consume(y),u++,g):y===41?(e.consume(y),u--,g):y===null||y===32||y===40||Xo(y)?n(y):(e.consume(y),y===92?v:g)}function v(y){return y===40||y===41||y===92?(e.consume(y),g):g(y)}}function Jf(e,t,n,r,i,s){const a=this;let l=0,d;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(s),u}function u(p){return l>999||p===null||p===91||p===93&&!d||p===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(e.exit(s),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):ie(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===null||p===91||p===93||ie(p)||l++>999?(e.exit("chunkString"),u(p)):(e.consume(p),d||(d=!me(p)),p===92?m:h)}function m(p){return p===91||p===92||p===93?(e.consume(p),l++,h):h(p)}}function Qf(e,t,n,r,i,s){let a;return l;function l(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),a=m===40?41:m,d):n(m)}function d(m){return m===a?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(s),c(m))}function c(m){return m===a?(e.exit(s),d(a)):m===null?n(m):ie(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),ve(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(m))}function u(m){return m===a||m===null||ie(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?h:u)}function h(m){return m===a||m===92?(e.consume(m),u):u(m)}}function or(e,t){let n;return r;function r(i){return ie(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):me(i)?ve(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Q5={name:"definition",tokenize:tv},ev={partial:!0,tokenize:nv};function tv(e,t,n){const r=this;let i;return s;function s(p){return e.enter("definition"),a(p)}function a(p){return Jf.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return i=Rn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),d):n(p)}function d(p){return tt(p)?or(e,c)(p):c(p)}function c(p){return Zf(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(ev,h,h)(p)}function h(p){return me(p)?ve(e,m,"whitespace")(p):m(p)}function m(p){return p===null||ie(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function nv(e,t,n){return r;function r(l){return tt(l)?or(e,i)(l):n(l)}function i(l){return Qf(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return me(l)?ve(e,a,"whitespace")(l):a(l)}function a(l){return l===null||ie(l)?t(l):n(l)}}const rv={name:"hardBreakEscape",tokenize:iv};function iv(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return ie(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const ov={name:"headingAtx",resolve:sv,tokenize:av};function sv(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},It(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function av(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),s(u)}function s(u){return e.enter("atxHeadingSequence"),a(u)}function a(u){return u===35&&r++<6?(e.consume(u),a):u===null||tt(u)?(e.exit("atxHeadingSequence"),l(u)):n(u)}function l(u){return u===35?(e.enter("atxHeadingSequence"),d(u)):u===null||ie(u)?(e.exit("atxHeading"),t(u)):me(u)?ve(e,l,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function d(u){return u===35?(e.consume(u),d):(e.exit("atxHeadingSequence"),l(u))}function c(u){return u===null||u===35||tt(u)?(e.exit("atxHeadingText"),l(u)):(e.consume(u),c)}}const lv=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Tc=["pre","script","style","textarea"],cv={concrete:!0,name:"htmlFlow",resolveTo:fv,tokenize:hv},uv={partial:!0,tokenize:mv},dv={partial:!0,tokenize:pv};function fv(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function hv(e,t,n){const r=this;let i,s,a,l,d;return c;function c(T){return u(T)}function u(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),h}function h(T){return T===33?(e.consume(T),m):T===47?(e.consume(T),s=!0,g):T===63?(e.consume(T),i=3,r.interrupt?t:b):Et(T)?(e.consume(T),a=String.fromCharCode(T),v):n(T)}function m(T){return T===45?(e.consume(T),i=2,p):T===91?(e.consume(T),i=5,l=0,x):Et(T)?(e.consume(T),i=4,r.interrupt?t:b):n(T)}function p(T){return T===45?(e.consume(T),r.interrupt?t:b):n(T)}function x(T){const be="CDATA[";return T===be.charCodeAt(l++)?(e.consume(T),l===be.length?r.interrupt?t:D:x):n(T)}function g(T){return Et(T)?(e.consume(T),a=String.fromCharCode(T),v):n(T)}function v(T){if(T===null||T===47||T===62||tt(T)){const be=T===47,ke=a.toLowerCase();return!be&&!s&&Tc.includes(ke)?(i=1,r.interrupt?t(T):D(T)):lv.includes(a.toLowerCase())?(i=6,be?(e.consume(T),y):r.interrupt?t(T):D(T)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(T):s?j(T):w(T))}return T===45||at(T)?(e.consume(T),a+=String.fromCharCode(T),v):n(T)}function y(T){return T===62?(e.consume(T),r.interrupt?t:D):n(T)}function j(T){return me(T)?(e.consume(T),j):L(T)}function w(T){return T===47?(e.consume(T),L):T===58||T===95||Et(T)?(e.consume(T),A):me(T)?(e.consume(T),w):L(T)}function A(T){return T===45||T===46||T===58||T===95||at(T)?(e.consume(T),A):B(T)}function B(T){return T===61?(e.consume(T),C):me(T)?(e.consume(T),B):w(T)}function C(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),d=T,O):me(T)?(e.consume(T),C):E(T)}function O(T){return T===d?(e.consume(T),d=null,F):T===null||ie(T)?n(T):(e.consume(T),O)}function E(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||tt(T)?B(T):(e.consume(T),E)}function F(T){return T===47||T===62||me(T)?w(T):n(T)}function L(T){return T===62?(e.consume(T),R):n(T)}function R(T){return T===null||ie(T)?D(T):me(T)?(e.consume(T),R):n(T)}function D(T){return T===45&&i===2?(e.consume(T),M):T===60&&i===1?(e.consume(T),U):T===62&&i===4?(e.consume(T),W):T===63&&i===3?(e.consume(T),b):T===93&&i===5?(e.consume(T),H):ie(T)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(uv,ne,N)(T)):T===null||ie(T)?(e.exit("htmlFlowData"),N(T)):(e.consume(T),D)}function N(T){return e.check(dv,P,ne)(T)}function P(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),I}function I(T){return T===null||ie(T)?N(T):(e.enter("htmlFlowData"),D(T))}function M(T){return T===45?(e.consume(T),b):D(T)}function U(T){return T===47?(e.consume(T),a="",G):D(T)}function G(T){if(T===62){const be=a.toLowerCase();return Tc.includes(be)?(e.consume(T),W):D(T)}return Et(T)&&a.length<8?(e.consume(T),a+=String.fromCharCode(T),G):D(T)}function H(T){return T===93?(e.consume(T),b):D(T)}function b(T){return T===62?(e.consume(T),W):T===45&&i===2?(e.consume(T),b):D(T)}function W(T){return T===null||ie(T)?(e.exit("htmlFlowData"),ne(T)):(e.consume(T),W)}function ne(T){return e.exit("htmlFlow"),t(T)}}function pv(e,t,n){const r=this;return i;function i(a){return ie(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function mv(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(xi,t,n)}}const xv={name:"htmlText",tokenize:gv};function gv(e,t,n){const r=this;let i,s,a;return l;function l(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),d}function d(b){return b===33?(e.consume(b),c):b===47?(e.consume(b),B):b===63?(e.consume(b),w):Et(b)?(e.consume(b),E):n(b)}function c(b){return b===45?(e.consume(b),u):b===91?(e.consume(b),s=0,x):Et(b)?(e.consume(b),j):n(b)}function u(b){return b===45?(e.consume(b),p):n(b)}function h(b){return b===null?n(b):b===45?(e.consume(b),m):ie(b)?(a=h,U(b)):(e.consume(b),h)}function m(b){return b===45?(e.consume(b),p):h(b)}function p(b){return b===62?M(b):b===45?m(b):h(b)}function x(b){const W="CDATA[";return b===W.charCodeAt(s++)?(e.consume(b),s===W.length?g:x):n(b)}function g(b){return b===null?n(b):b===93?(e.consume(b),v):ie(b)?(a=g,U(b)):(e.consume(b),g)}function v(b){return b===93?(e.consume(b),y):g(b)}function y(b){return b===62?M(b):b===93?(e.consume(b),y):g(b)}function j(b){return b===null||b===62?M(b):ie(b)?(a=j,U(b)):(e.consume(b),j)}function w(b){return b===null?n(b):b===63?(e.consume(b),A):ie(b)?(a=w,U(b)):(e.consume(b),w)}function A(b){return b===62?M(b):w(b)}function B(b){return Et(b)?(e.consume(b),C):n(b)}function C(b){return b===45||at(b)?(e.consume(b),C):O(b)}function O(b){return ie(b)?(a=O,U(b)):me(b)?(e.consume(b),O):M(b)}function E(b){return b===45||at(b)?(e.consume(b),E):b===47||b===62||tt(b)?F(b):n(b)}function F(b){return b===47?(e.consume(b),M):b===58||b===95||Et(b)?(e.consume(b),L):ie(b)?(a=F,U(b)):me(b)?(e.consume(b),F):M(b)}function L(b){return b===45||b===46||b===58||b===95||at(b)?(e.consume(b),L):R(b)}function R(b){return b===61?(e.consume(b),D):ie(b)?(a=R,U(b)):me(b)?(e.consume(b),R):F(b)}function D(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),i=b,N):ie(b)?(a=D,U(b)):me(b)?(e.consume(b),D):(e.consume(b),P)}function N(b){return b===i?(e.consume(b),i=void 0,I):b===null?n(b):ie(b)?(a=N,U(b)):(e.consume(b),N)}function P(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||tt(b)?F(b):(e.consume(b),P)}function I(b){return b===47||b===62||tt(b)?F(b):n(b)}function M(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function U(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),G}function G(b){return me(b)?ve(e,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):H(b)}function H(b){return e.enter("htmlTextData"),a(b)}}const Xs={name:"labelEnd",resolveAll:kv,resolveTo:wv,tokenize:Sv},yv={tokenize:Cv},bv={tokenize:jv},vv={tokenize:Tv};function kv(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&It(e,0,e.length,n),e}function wv(e,t){let n=e.length,r=0,i,s,a,l;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const d={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[a][1].end}},u={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[a-2][1].start}};return l=[["enter",d,t],["enter",c,t]],l=ut(l,e.slice(s+1,s+r+3)),l=ut(l,[["enter",u,t]]),l=ut(l,qs(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),l=ut(l,[["exit",u,t],e[a-2],e[a-1],["exit",c,t]]),l=ut(l,e.slice(a+1)),l=ut(l,[["exit",d,t]]),It(e,s,e.length,l),e}function Sv(e,t,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return l;function l(m){return s?s._inactive?h(m):(a=r.parser.defined.includes(Rn(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),d):n(m)}function d(m){return m===40?e.attempt(yv,u,a?u:h)(m):m===91?e.attempt(bv,u,a?c:h)(m):a?u(m):h(m)}function c(m){return e.attempt(vv,u,h)(m)}function u(m){return t(m)}function h(m){return s._balanced=!0,n(m)}}function Cv(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return tt(h)?or(e,s)(h):s(h)}function s(h){return h===41?u(h):Zf(e,a,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return tt(h)?or(e,d)(h):u(h)}function l(h){return n(h)}function d(h){return h===34||h===39||h===40?Qf(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):u(h)}function c(h){return tt(h)?or(e,u)(h):u(h)}function u(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function jv(e,t,n){const r=this;return i;function i(l){return Jf.call(r,e,s,a,"reference","referenceMarker","referenceString")(l)}function s(l){return r.parser.defined.includes(Rn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function a(l){return n(l)}}function Tv(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const Bv={name:"labelStartImage",resolveAll:Xs.resolveAll,tokenize:Ev};function Ev(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),s}function s(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),a):n(l)}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Fv={name:"labelStartLink",resolveAll:Xs.resolveAll,tokenize:Av};function Av(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const eo={name:"lineEnding",tokenize:Lv};function Lv(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ve(e,t,"linePrefix")}}const Gr={name:"thematicBreak",tokenize:Iv};function Iv(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,l(c)}function l(c){return c===i?(e.enter("thematicBreakSequence"),d(c)):r>=3&&(c===null||ie(c))?(e.exit("thematicBreak"),t(c)):n(c)}function d(c){return c===i?(e.consume(c),r++,d):(e.exit("thematicBreakSequence"),me(c)?ve(e,l,"whitespace")(c):l(c))}}const Je={continuation:{tokenize:Pv},exit:zv,name:"list",tokenize:Mv},Dv={partial:!0,tokenize:_v},Rv={partial:!0,tokenize:Ov};function Mv(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return l;function l(p){const x=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Zo(p)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Gr,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(p)}return n(p)}function d(p){return Zo(p)&&++a<10?(e.consume(p),d):(!r.interrupt||a<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(xi,r.interrupt?n:u,e.attempt(Dv,m,h))}function u(p){return r.containerState.initialBlankLine=!0,s++,m(p)}function h(p){return me(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),m):n(p)}function m(p){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Pv(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(xi,i,s);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ve(e,t,"listItemIndent",r.containerState.size+1)(l)}function s(l){return r.containerState.furtherBlankLines||!me(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Rv,t,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,ve(e,e.attempt(Je,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Ov(e,t,n){const r=this;return ve(e,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(s):n(s)}}function zv(e){e.exit(this.containerState.type)}function _v(e,t,n){const r=this;return ve(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!me(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Bc={name:"setextUnderline",resolveTo:Nv,tokenize:Vv};function Nv(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function Vv(e,t,n){const r=this;let i;return s;function s(c){let u=r.events.length,h;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){h=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===i?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),me(c)?ve(e,d,"lineSuffix")(c):d(c))}function d(c){return c===null||ie(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Wv={tokenize:Hv};function Hv(e){const t=this,n=e.attempt(xi,r,e.attempt(this.parser.constructs.flowInitial,i,ve(e,e.attempt(this.parser.constructs.flow,i,e.attempt(K5,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Uv={resolveAll:th()},$v=eh("string"),Gv=eh("text");function eh(e){return{resolveAll:th(e==="text"?Yv:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,l);return a;function a(u){return c(u)?s(u):l(u)}function l(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),d}function d(u){return c(u)?(n.exit("data"),s(u)):(n.consume(u),d)}function c(u){if(u===null)return!0;const h=i[u];let m=-1;if(h)for(;++m<h.length;){const p=h[m];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function th(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function Yv(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,a=-1,l=0,d;for(;s--;){const c=i[s];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)l++,a--;if(a)break;a=-1}else if(c===-2)d=!0,l++;else if(c!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const c={type:n===e.length||d||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const Kv={42:Je,43:Je,45:Je,48:Je,49:Je,50:Je,51:Je,52:Je,53:Je,54:Je,55:Je,56:Je,57:Je,62:Yf},qv={91:Q5},Xv={[-2]:Qi,[-1]:Qi,32:Qi},Zv={35:ov,42:Gr,45:[Bc,Gr],60:cv,61:Bc,95:Gr,96:jc,126:jc},Jv={38:qf,92:Kf},Qv={[-5]:eo,[-4]:eo,[-3]:eo,33:Bv,38:qf,42:Jo,60:[F5,xv],91:Fv,92:[rv,Kf],93:Xs,95:Jo,96:W5},e4={null:[Jo,Uv]},t4={null:[42,95]},n4={null:[]},r4=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:t4,contentInitial:qv,disable:n4,document:Kv,flow:Zv,flowInitial:Xv,insideSpan:e4,string:Jv,text:Qv},Symbol.toStringTag,{value:"Module"}));function i4(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],l=[];const d={attempt:O(B),check:O(C),consume:j,enter:w,exit:A,interrupt:O(C,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:x,parser:e,previous:null,sliceSerialize:m,sliceStream:p,write:h};let u=t.tokenize.call(c,d);return t.resolveAll&&s.push(t),c;function h(R){return a=ut(a,R),v(),a[a.length-1]!==null?[]:(E(t,0),c.events=qs(s,c.events,c),c.events)}function m(R,D){return s4(p(R),D)}function p(R){return o4(a,R)}function x(){const{_bufferIndex:R,_index:D,line:N,column:P,offset:I}=r;return{_bufferIndex:R,_index:D,line:N,column:P,offset:I}}function g(R){i[R.line]=R.column,L()}function v(){let R;for(;r._index<a.length;){const D=a[r._index];if(typeof D=="string")for(R=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===R&&r._bufferIndex<D.length;)y(D.charCodeAt(r._bufferIndex));else y(D)}}function y(R){u=u(R)}function j(R){ie(R)?(r.line++,r.column=1,r.offset+=R===-3?2:1,L()):R!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=R}function w(R,D){const N=D||{};return N.type=R,N.start=x(),c.events.push(["enter",N,c]),l.push(N),N}function A(R){const D=l.pop();return D.end=x(),c.events.push(["exit",D,c]),D}function B(R,D){E(R,D.from)}function C(R,D){D.restore()}function O(R,D){return N;function N(P,I,M){let U,G,H,b;return Array.isArray(P)?ne(P):"tokenize"in P?ne([P]):W(P);function W(J){return X;function X(te){const de=te!==null&&J[te],ee=te!==null&&J.null,Ce=[...Array.isArray(de)?de:de?[de]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return ne(Ce)(te)}}function ne(J){return U=J,G=0,J.length===0?M:T(J[G])}function T(J){return X;function X(te){return b=F(),H=J,J.partial||(c.currentConstruct=J),J.name&&c.parser.constructs.disable.null.includes(J.name)?ke():J.tokenize.call(D?Object.assign(Object.create(c),D):c,d,be,ke)(te)}}function be(J){return R(H,b),I}function ke(J){return b.restore(),++G<U.length?T(U[G]):M}}}function E(R,D){R.resolveAll&&!s.includes(R)&&s.push(R),R.resolve&&It(c.events,D,c.events.length-D,R.resolve(c.events.slice(D),c)),R.resolveTo&&(c.events=R.resolveTo(c.events,c))}function F(){const R=x(),D=c.previous,N=c.currentConstruct,P=c.events.length,I=Array.from(l);return{from:P,restore:M};function M(){r=R,c.previous=D,c.currentConstruct=N,c.events.length=P,l=I,L()}}function L(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function o4(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,s)];else{if(a=e.slice(n,i),r>-1){const l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function s4(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
412
+ `}),o.jsx(z2,{location:"bottom",buttonText:t,declineButtonText:n,enableDeclineButton:r,disableStyles:!0,containerClasses:"medixdeck-cookie-banner",contentClasses:"medixdeck-cookie-content",buttonWrapperClasses:"medixdeck-cookie-buttons",ButtonComponent:u=>o.jsx(Qe,{variant:"solid",colorScheme:"blue",size:"sm",onClick:u.onClick,id:u.id,children:u.children}),...s,children:o.jsxs(f.Box,{children:[e&&o.jsx(f.Text,{fontWeight:"700",color:"text.heading",mb:1,fontFamily:"var(--font-heading)",children:e}),o.jsx(f.Text,{fontSize:"sm",color:"text.heading",lineHeight:"1.5",children:i||`We use cookies to securely manage your session, enhance your browsing experience, and analyze our platform's performance. By clicking "Accept All", you consent to our use of cookies.`})]})})]})}Ef.displayName="MedixCookieConsentBanner";const Ff="medixdeck_pwa_dismissed",_2=14,N2=[.4,0,.2,1];function V2(){if(typeof window>"u")return!1;const e=window.matchMedia("(display-mode: standalone)").matches,t=window.navigator.standalone===!0;return e||t}function W2(){return typeof navigator>"u"?!1:/iPhone|iPad|iPod/.test(navigator.userAgent)&&!window.MSStream}function H2(e){if(typeof localStorage>"u")return!1;try{const t=localStorage.getItem(Ff);if(!t)return!1;const n=e*24*60*60*1e3;return Date.now()-Number(t)<n}catch{return!1}}function U2(){try{localStorage.setItem(Ff,String(Date.now()))}catch{}}function $2({size:e=18,color:t="#0685FF"}){return o.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),o.jsx("polyline",{points:"16 6 12 2 8 6"}),o.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"15"})]})}function G2(){return o.jsx(f.Box,{flexShrink:0,children:o.jsx(cn,{type:"icon",height:44})})}function Af({title:e="Install this app",description:t="Add this app to your home screen for faster access and a better experience.",installLabel:n="Install",dismissLabel:r="Not now",cooldownDays:i=_2,onInstall:s,onDismiss:a,appName:l="this app",icon:d,position:c="bottom",delaySeconds:u=0,forceVisible:h,forceIOS:m}){const p=os(),[x,g]=k.useState(!1),[v,y]=k.useState(!1),j=k.useRef(null),w=k.useRef(null);k.useEffect(()=>{const E=()=>{u>0?w.current=setTimeout(()=>g(!0),u*1e3):g(!0)},F=()=>{w.current&&clearTimeout(w.current)};if(h)return m&&y(!0),E(),F;if(V2()||H2(i))return F;if(W2())return y(!0),E(),F;const L=D=>{D.preventDefault(),j.current=D,E()};window.addEventListener("beforeinstallprompt",L);const R=()=>g(!1);return window.addEventListener("appinstalled",R),()=>{window.removeEventListener("beforeinstallprompt",L),window.removeEventListener("appinstalled",R),F()}},[i,u,h,m]);const A=k.useCallback(async()=>{if(j.current){try{await j.current.prompt(),(await j.current.userChoice).outcome==="accepted"&&(s==null||s())}catch{}j.current=null}g(!1)},[s]),B=k.useCallback(()=>{U2(),g(!1),a==null||a()},[a]),C=p?"#152035":"#FFFFFF",O=p?"#1E3050":"#E4E8F0";return o.jsx(dr,{children:x&&o.jsx(st.div,{initial:{opacity:0,y:c==="bottom"?80:-80,x:"-50%"},animate:{opacity:1,y:0,x:"-50%"},exit:{opacity:0,y:c==="bottom"?80:-80,x:"-50%"},transition:{duration:.35,ease:N2},style:{position:"fixed",[c]:16,left:"50%",zIndex:1e3,width:"calc(100% - 32px)",maxWidth:480,pointerEvents:"auto"},children:o.jsx(f.Box,{borderRadius:"16px",p:{base:"4",md:"5"},style:{background:C,border:`1px solid ${O}`,boxShadow:"none"},children:o.jsxs(f.Flex,{gap:"4",align:"flex-start",children:[d??o.jsx(G2,{}),o.jsxs(f.Box,{flex:"1",minW:"0",children:[o.jsx(f.Text,{fontWeight:"700",fontSize:"md",color:"text.heading",fontFamily:"var(--font-heading)",mb:"1",children:e}),v?o.jsxs(f.Box,{children:[o.jsxs(f.Text,{fontSize:"sm",color:"text.muted",lineHeight:"1.5",fontFamily:"var(--font-body)",mb:"3",children:["To install ",l,", tap the"," ",o.jsx("span",{style:{display:"inline-flex",verticalAlign:"middle",margin:"0 2px"},children:o.jsx($2,{size:16,color:p?"#70B6FF":"#0685FF"})})," ","Share button in Safari, then select"," ",o.jsx("span",{style:{fontWeight:700,color:p?"#F0F6FF":"#111926"},children:'"Add to Home Screen"'}),"."]}),o.jsx(f.Flex,{gap:"3",mb:"3",flexWrap:"wrap",children:[{step:"1",text:"Tap Share"},{step:"2",text:"Add to Home Screen"}].map(E=>o.jsxs(f.Flex,{align:"center",gap:"2",px:"3",py:"1.5",borderRadius:"8px",bg:"bg.subtle",children:[o.jsx(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",w:"20px",h:"20px",borderRadius:"full",flexShrink:0,style:{background:"#0685FF",color:"#FFFFFF",fontSize:"11px",fontWeight:700,fontFamily:"var(--font-body)"},children:E.step}),o.jsx(f.Text,{fontSize:"xs",fontWeight:"600",color:"text.body",fontFamily:"var(--font-body)",children:E.text})]},E.step))})]}):o.jsx(f.Text,{fontSize:"sm",color:"text.muted",lineHeight:"1.5",fontFamily:"var(--font-body)",mb:"3",children:t}),o.jsxs(f.Flex,{gap:"3",align:"center",children:[!v&&o.jsx(Qe,{variant:"solid",colorScheme:"blue",size:"sm",onClick:A,children:n}),o.jsx(Qe,{variant:"ghost",colorScheme:"gray",size:"sm",onClick:B,children:v?"Got it":r})]})]}),o.jsx(f.Box,{as:"button","aria-label":"Close install prompt",onClick:B,display:"flex",alignItems:"center",justifyContent:"center",w:"28px",h:"28px",borderRadius:"full",bg:"bg.subtle",color:"text.muted",flexShrink:0,cursor:"pointer",_hover:{color:"text.heading",bg:"bg.surface"},style:{border:"none",transition:"all 0.2s ease"},mt:"-1",children:o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",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"})]})})]})})})})}Af.displayName="MedixPWAInstallPrompt";/*! @license DOMPurify 3.4.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.8/LICENSE */function Xl(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Y2(e){if(Array.isArray(e))return e}function K2(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,l=[],d=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(d=(r=s.call(n)).done)&&(l.push(r.value),l.length!==t);d=!0);}catch(u){c=!0,i=u}finally{try{if(!d&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return l}}function q2(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
413
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X2(e,t){return Y2(e)||K2(e,t)||Z2(e,t)||q2()}function Z2(e,t){if(e){if(typeof e=="string")return Xl(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xl(e,t):void 0}}const Lf=Object.entries,Zl=Object.setPrototypeOf,J2=Object.isFrozen,Q2=Object.getPrototypeOf,eb=Object.getOwnPropertyDescriptor;let Xe=Object.freeze,ht=Object.seal,Bn=Object.create,If=typeof Reflect<"u"&&Reflect,$o=If.apply,Go=If.construct;Xe||(Xe=function(t){return t});ht||(ht=function(t){return t});$o||($o=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];return t.apply(n,i)});Go||(Go=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new t(...r)});const en=Le(Array.prototype.forEach),tb=Le(Array.prototype.lastIndexOf),Jl=Le(Array.prototype.pop),bn=Le(Array.prototype.push),nb=Le(Array.prototype.splice),Ye=Array.isArray,er=Le(String.prototype.toLowerCase),Gi=Le(String.prototype.toString),Ql=Le(String.prototype.match),vn=Le(String.prototype.replace),ec=Le(String.prototype.indexOf),rb=Le(String.prototype.trim),ib=Le(Number.prototype.toString),ob=Le(Boolean.prototype.toString),tc=typeof BigInt>"u"?null:Le(BigInt.prototype.toString),nc=typeof Symbol>"u"?null:Le(Symbol.prototype.toString),Be=Le(Object.prototype.hasOwnProperty),Gn=Le(Object.prototype.toString),We=Le(RegExp.prototype.test),kn=sb(TypeError);function Le(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return $o(e,t,r)}}function sb(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Go(e,n)}}function ae(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:er;if(Zl&&Zl(e,null),!Ye(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(J2(t)||(t[r]=s),i=s)}e[i]=!0}return e}function ab(e){for(let t=0;t<e.length;t++)Be(e,t)||(e[t]=null);return e}function $e(e){const t=Bn(null);for(const r of Lf(e)){var n=X2(r,2);const i=n[0],s=n[1];Be(e,i)&&(Ye(s)?t[i]=ab(s):s&&typeof s=="object"&&s.constructor===Object?t[i]=$e(s):t[i]=s)}return t}function lb(e){switch(typeof e){case"string":return e;case"number":return ib(e);case"boolean":return ob(e);case"bigint":return tc?tc(e):"0";case"symbol":return nc?nc(e):"Symbol()";case"undefined":return Gn(e);case"function":case"object":{if(e===null)return Gn(e);const t=e,n=St(t,"toString");if(typeof n=="function"){const r=n(t);return typeof r=="string"?r:Gn(r)}return Gn(e)}default:return Gn(e)}}function St(e,t){for(;e!==null;){const r=eb(e,t);if(r){if(r.get)return Le(r.get);if(typeof r.value=="function")return Le(r.value)}e=Q2(e)}function n(){return null}return n}function cb(e){try{return We(e,""),!0}catch{return!1}}const rc=Xe(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Yi=Xe(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ki=Xe(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),ub=Xe(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),qi=Xe(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),db=Xe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ic=Xe(["#text"]),oc=Xe(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Xi=Xe(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),sc=Xe(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Rr=Xe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),fb=ht(/{{[\w\W]*|^[\w\W]*}}/g),hb=ht(/<%[\w\W]*|^[\w\W]*%>/g),pb=ht(/\${[\w\W]*/g),mb=ht(/^data-[\-\w.\u00B7-\uFFFF]+$/),xb=ht(/^aria-[\-\w]+$/),ac=ht(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),gb=ht(/^(?:\w+script|data):/i),yb=ht(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),bb=ht(/^html$/i),vb=ht(/^[a-z][.\w]*(-[.\w]+)+$/i),wt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},kb=function(){return typeof window>"u"?null:window},wb=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const s="dompurify"+(r?"#"+r:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},lc=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Df(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:kb();const t=Z=>Df(Z);if(t.version="3.4.8",t.removed=[],!e||!e.document||e.document.nodeType!==wt.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const r=n,i=r.currentScript;e.DocumentFragment;const s=e.HTMLTemplateElement,a=e.Node,l=e.Element,d=e.NodeFilter,c=e.NamedNodeMap;c===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const u=e.DOMParser,h=e.trustedTypes,m=l.prototype,p=St(m,"cloneNode"),x=St(m,"remove"),g=St(m,"nextSibling"),v=St(m,"childNodes"),y=St(m,"parentNode"),j=St(m,"shadowRoot"),w=St(m,"attributes"),A=a&&a.prototype?St(a.prototype,"nodeType"):null,B=a&&a.prototype?St(a.prototype,"nodeName"):null;if(typeof s=="function"){const Z=n.createElement("template");Z.content&&Z.content.ownerDocument&&(n=Z.content.ownerDocument)}let C,O="",E=0;const F=function(S){if(E>0)throw kn('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');E++;try{return C.createHTML(S)}finally{E--}},L=n,R=L.implementation,D=L.createNodeIterator,N=L.createDocumentFragment,P=L.getElementsByTagName,I=r.importNode;let M=lc();t.isSupported=typeof Lf=="function"&&typeof y=="function"&&R&&R.createHTMLDocument!==void 0;const U=fb,G=hb,H=pb,b=mb,W=xb,ne=gb,T=yb,be=vb;let ke=ac,J=null;const X=ae({},[...rc,...Yi,...Ki,...qi,...ic]);let te=null;const de=ae({},[...oc,...Xi,...sc,...Rr]);let ee=Object.seal(Bn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ce=null,De=null;const ue=Object.seal(Bn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let hn=!0,Ot=!0,qt=!1,zt=!0,lt=!1,Q=!0,se=!1,he=!1,Se=!1,Oe=!1,pt=!1,vt=!1,z=!0,Y=!1;const re="user-content-";let le=!0,fe=!1,ze={},_e=null;const it=ae({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let _t=null;const Nt=ae({},["audio","video","img","source","image","track"]);let Ve=null;const Dt=ae({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ze="http://www.w3.org/1998/Math/MathML",vr="http://www.w3.org/2000/svg",kt="http://www.w3.org/1999/xhtml";let pn=kt,vi=!1,ki=null;const kh=ae({},[Ze,vr,kt],Gi);let wi=ae({},["mi","mo","mn","ms","mtext"]),Si=ae({},["annotation-xml"]);const wh=ae({},["title","style","font","a","script"]);let Hn=null;const Sh=["application/xhtml+xml","text/html"],Ch="text/html";let Ee=null,mn=null;const jh=n.createElement("form"),ra=function(S){return S instanceof RegExp||S instanceof Function},Ci=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(mn&&mn===S)return;(!S||typeof S!="object")&&(S={}),S=$e(S),Hn=Sh.indexOf(S.PARSER_MEDIA_TYPE)===-1?Ch:S.PARSER_MEDIA_TYPE,Ee=Hn==="application/xhtml+xml"?Gi:er,J=Be(S,"ALLOWED_TAGS")&&Ye(S.ALLOWED_TAGS)?ae({},S.ALLOWED_TAGS,Ee):X,te=Be(S,"ALLOWED_ATTR")&&Ye(S.ALLOWED_ATTR)?ae({},S.ALLOWED_ATTR,Ee):de,ki=Be(S,"ALLOWED_NAMESPACES")&&Ye(S.ALLOWED_NAMESPACES)?ae({},S.ALLOWED_NAMESPACES,Gi):kh,Ve=Be(S,"ADD_URI_SAFE_ATTR")&&Ye(S.ADD_URI_SAFE_ATTR)?ae($e(Dt),S.ADD_URI_SAFE_ATTR,Ee):Dt,_t=Be(S,"ADD_DATA_URI_TAGS")&&Ye(S.ADD_DATA_URI_TAGS)?ae($e(Nt),S.ADD_DATA_URI_TAGS,Ee):Nt,_e=Be(S,"FORBID_CONTENTS")&&Ye(S.FORBID_CONTENTS)?ae({},S.FORBID_CONTENTS,Ee):it,Ce=Be(S,"FORBID_TAGS")&&Ye(S.FORBID_TAGS)?ae({},S.FORBID_TAGS,Ee):$e({}),De=Be(S,"FORBID_ATTR")&&Ye(S.FORBID_ATTR)?ae({},S.FORBID_ATTR,Ee):$e({}),ze=Be(S,"USE_PROFILES")?S.USE_PROFILES&&typeof S.USE_PROFILES=="object"?$e(S.USE_PROFILES):S.USE_PROFILES:!1,hn=S.ALLOW_ARIA_ATTR!==!1,Ot=S.ALLOW_DATA_ATTR!==!1,qt=S.ALLOW_UNKNOWN_PROTOCOLS||!1,zt=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,lt=S.SAFE_FOR_TEMPLATES||!1,Q=S.SAFE_FOR_XML!==!1,se=S.WHOLE_DOCUMENT||!1,Oe=S.RETURN_DOM||!1,pt=S.RETURN_DOM_FRAGMENT||!1,vt=S.RETURN_TRUSTED_TYPE||!1,Se=S.FORCE_BODY||!1,z=S.SANITIZE_DOM!==!1,Y=S.SANITIZE_NAMED_PROPS||!1,le=S.KEEP_CONTENT!==!1,fe=S.IN_PLACE||!1,ke=cb(S.ALLOWED_URI_REGEXP)?S.ALLOWED_URI_REGEXP:ac,pn=typeof S.NAMESPACE=="string"?S.NAMESPACE:kt,wi=Be(S,"MATHML_TEXT_INTEGRATION_POINTS")&&S.MATHML_TEXT_INTEGRATION_POINTS&&typeof S.MATHML_TEXT_INTEGRATION_POINTS=="object"?$e(S.MATHML_TEXT_INTEGRATION_POINTS):ae({},["mi","mo","mn","ms","mtext"]),Si=Be(S,"HTML_INTEGRATION_POINTS")&&S.HTML_INTEGRATION_POINTS&&typeof S.HTML_INTEGRATION_POINTS=="object"?$e(S.HTML_INTEGRATION_POINTS):ae({},["annotation-xml"]);const _=Be(S,"CUSTOM_ELEMENT_HANDLING")&&S.CUSTOM_ELEMENT_HANDLING&&typeof S.CUSTOM_ELEMENT_HANDLING=="object"?$e(S.CUSTOM_ELEMENT_HANDLING):Bn(null);if(ee=Bn(null),Be(_,"tagNameCheck")&&ra(_.tagNameCheck)&&(ee.tagNameCheck=_.tagNameCheck),Be(_,"attributeNameCheck")&&ra(_.attributeNameCheck)&&(ee.attributeNameCheck=_.attributeNameCheck),Be(_,"allowCustomizedBuiltInElements")&&typeof _.allowCustomizedBuiltInElements=="boolean"&&(ee.allowCustomizedBuiltInElements=_.allowCustomizedBuiltInElements),lt&&(Ot=!1),pt&&(Oe=!0),ze&&(J=ae({},ic),te=Bn(null),ze.html===!0&&(ae(J,rc),ae(te,oc)),ze.svg===!0&&(ae(J,Yi),ae(te,Xi),ae(te,Rr)),ze.svgFilters===!0&&(ae(J,Ki),ae(te,Xi),ae(te,Rr)),ze.mathMl===!0&&(ae(J,qi),ae(te,sc),ae(te,Rr))),ue.tagCheck=null,ue.attributeCheck=null,Be(S,"ADD_TAGS")&&(typeof S.ADD_TAGS=="function"?ue.tagCheck=S.ADD_TAGS:Ye(S.ADD_TAGS)&&(J===X&&(J=$e(J)),ae(J,S.ADD_TAGS,Ee))),Be(S,"ADD_ATTR")&&(typeof S.ADD_ATTR=="function"?ue.attributeCheck=S.ADD_ATTR:Ye(S.ADD_ATTR)&&(te===de&&(te=$e(te)),ae(te,S.ADD_ATTR,Ee))),Be(S,"ADD_URI_SAFE_ATTR")&&Ye(S.ADD_URI_SAFE_ATTR)&&ae(Ve,S.ADD_URI_SAFE_ATTR,Ee),Be(S,"FORBID_CONTENTS")&&Ye(S.FORBID_CONTENTS)&&(_e===it&&(_e=$e(_e)),ae(_e,S.FORBID_CONTENTS,Ee)),Be(S,"ADD_FORBID_CONTENTS")&&Ye(S.ADD_FORBID_CONTENTS)&&(_e===it&&(_e=$e(_e)),ae(_e,S.ADD_FORBID_CONTENTS,Ee)),le&&(J["#text"]=!0),se&&ae(J,["html","head","body"]),J.table&&(ae(J,["tbody"]),delete Ce.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw kn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw kn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const K=C;C=S.TRUSTED_TYPES_POLICY;try{O=F("")}catch(pe){throw C=K,pe}}else C===void 0&&S.TRUSTED_TYPES_POLICY!==null&&(C=wb(h,i)),C&&typeof O=="string"&&(O=F(""));(M.uponSanitizeElement.length>0||M.uponSanitizeAttribute.length>0)&&J===X&&(J=$e(J)),M.uponSanitizeAttribute.length>0&&te===de&&(te=$e(te)),Xe&&Xe(S),mn=S},ia=ae({},[...Yi,...Ki,...ub]),oa=ae({},[...qi,...db]),Th=function(S){let _=y(S);(!_||!_.tagName)&&(_={namespaceURI:pn,tagName:"template"});const K=er(S.tagName),pe=er(_.tagName);return ki[S.namespaceURI]?S.namespaceURI===vr?_.namespaceURI===kt?K==="svg":_.namespaceURI===Ze?K==="svg"&&(pe==="annotation-xml"||wi[pe]):!!ia[K]:S.namespaceURI===Ze?_.namespaceURI===kt?K==="math":_.namespaceURI===vr?K==="math"&&Si[pe]:!!oa[K]:S.namespaceURI===kt?_.namespaceURI===vr&&!Si[pe]||_.namespaceURI===Ze&&!wi[pe]?!1:!oa[K]&&(wh[K]||!ia[K]):!!(Hn==="application/xhtml+xml"&&ki[S.namespaceURI]):!1},mt=function(S){bn(t.removed,{element:S});try{y(S).removeChild(S)}catch{x(S)}},Xt=function(S,_){try{bn(t.removed,{attribute:_.getAttributeNode(S),from:_})}catch{bn(t.removed,{attribute:null,from:_})}if(_.removeAttribute(S),S==="is")if(Oe||pt)try{mt(_)}catch{}else try{_.setAttribute(S,"")}catch{}},sa=function(S){let _=null,K=null;if(Se)S="<remove></remove>"+S;else{const xe=Ql(S,/^[\r\n\t ]+/);K=xe&&xe[0]}Hn==="application/xhtml+xml"&&pn===kt&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");const pe=C?F(S):S;if(pn===kt)try{_=new u().parseFromString(pe,Hn)}catch{}if(!_||!_.documentElement){_=R.createDocument(pn,"template",null);try{_.documentElement.innerHTML=vi?O:pe}catch{}}const ce=_.body||_.documentElement;return S&&K&&ce.insertBefore(n.createTextNode(K),ce.childNodes[0]||null),pn===kt?P.call(_,se?"html":"body")[0]:se?_.documentElement:ce},aa=function(S){return D.call(S.ownerDocument||S,S,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},ji=function(S){var _,K;S.normalize();const pe=D.call(S.ownerDocument||S,S,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let ce=pe.nextNode();for(;ce;){let Re=ce.data;en([U,G,H],ct=>{Re=vn(Re,ct," ")}),ce.data=Re,ce=pe.nextNode()}const xe=(_=(K=S.querySelectorAll)===null||K===void 0?void 0:K.call(S,"template"))!==null&&_!==void 0?_:[];en(Array.from(xe),Re=>{xn(Re.content)&&ji(Re.content)})},kr=function(S){const _=B?B(S):null;return typeof _!="string"||Ee(_)!=="form"?!1:typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||S.attributes!==w(S)||typeof S.removeAttribute!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function"||S.nodeType!==A(S)||S.childNodes!==v(S)},xn=function(S){if(!A||typeof S!="object"||S===null)return!1;try{return A(S)===wt.documentFragment}catch{return!1}},wr=function(S){if(!A||typeof S!="object"||S===null)return!1;try{return typeof A(S)=="number"}catch{return!1}};function Rt(Z,S,_){en(Z,K=>{K.call(t,S,_,mn)})}const la=function(S){let _=null;if(Rt(M.beforeSanitizeElements,S,null),kr(S))return mt(S),!0;const K=Ee(B?B(S):S.nodeName);if(Rt(M.uponSanitizeElement,S,{tagName:K,allowedTags:J}),Q&&S.hasChildNodes()&&!wr(S.firstElementChild)&&We(/<[/\w!]/g,S.innerHTML)&&We(/<[/\w!]/g,S.textContent)||Q&&S.namespaceURI===kt&&K==="style"&&wr(S.firstElementChild)||S.nodeType===wt.progressingInstruction||Q&&S.nodeType===wt.comment&&We(/<[/\w]/g,S.data))return mt(S),!0;if(Ce[K]||!(ue.tagCheck instanceof Function&&ue.tagCheck(K))&&!J[K]){if(!Ce[K]&&ua(K)&&(ee.tagNameCheck instanceof RegExp&&We(ee.tagNameCheck,K)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(K)))return!1;if(le&&!_e[K]){const ce=y(S),xe=v(S);if(xe&&ce){const Re=xe.length;for(let ct=Re-1;ct>=0;--ct){const xt=p(xe[ct],!0);ce.insertBefore(xt,g(S))}}}return mt(S),!0}return(A?A(S):S.nodeType)===wt.element&&!Th(S)||(K==="noscript"||K==="noembed"||K==="noframes")&&We(/<\/no(script|embed|frames)/i,S.innerHTML)?(mt(S),!0):(lt&&S.nodeType===wt.text&&(_=S.textContent,en([U,G,H],ce=>{_=vn(_,ce," ")}),S.textContent!==_&&(bn(t.removed,{element:S.cloneNode()}),S.textContent=_)),Rt(M.afterSanitizeElements,S,null),!1)},ca=function(S,_,K){if(De[_]||z&&(_==="id"||_==="name")&&(K in n||K in jh))return!1;const pe=te[_]||ue.attributeCheck instanceof Function&&ue.attributeCheck(_,S);if(!(Ot&&!De[_]&&We(b,_))){if(!(hn&&We(W,_))){if(!pe||De[_]){if(!(ua(S)&&(ee.tagNameCheck instanceof RegExp&&We(ee.tagNameCheck,S)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(S))&&(ee.attributeNameCheck instanceof RegExp&&We(ee.attributeNameCheck,_)||ee.attributeNameCheck instanceof Function&&ee.attributeNameCheck(_,S))||_==="is"&&ee.allowCustomizedBuiltInElements&&(ee.tagNameCheck instanceof RegExp&&We(ee.tagNameCheck,K)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(K))))return!1}else if(!Ve[_]){if(!We(ke,vn(K,T,""))){if(!((_==="src"||_==="xlink:href"||_==="href")&&S!=="script"&&ec(K,"data:")===0&&_t[S])){if(!(qt&&!We(ne,vn(K,T,"")))){if(K)return!1}}}}}}return!0},Bh=ae({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ua=function(S){return!Bh[er(S)]&&We(be,S)},da=function(S){Rt(M.beforeSanitizeAttributes,S,null);const _=S.attributes;if(!_||kr(S))return;const K={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:te,forceKeepAttr:void 0};let pe=_.length;for(;pe--;){const ce=_[pe],xe=ce.name,Re=ce.namespaceURI,ct=ce.value,xt=Ee(xe),Ti=ct;let Ne=xe==="value"?Ti:rb(Ti);if(K.attrName=xt,K.attrValue=Ne,K.keepAttr=!0,K.forceKeepAttr=void 0,Rt(M.uponSanitizeAttribute,S,K),Ne=K.attrValue,Y&&(xt==="id"||xt==="name")&&ec(Ne,re)!==0&&(Xt(xe,S),Ne=re+Ne),Q&&We(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ne)){Xt(xe,S);continue}if(xt==="attributename"&&Ql(Ne,"href")){Xt(xe,S);continue}if(K.forceKeepAttr)continue;if(!K.keepAttr){Xt(xe,S);continue}if(!zt&&We(/\/>/i,Ne)){Xt(xe,S);continue}lt&&en([U,G,H],ha=>{Ne=vn(Ne,ha," ")});const fa=Ee(S.nodeName);if(!ca(fa,xt,Ne)){Xt(xe,S);continue}if(C&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!Re)switch(h.getAttributeType(fa,xt)){case"TrustedHTML":{Ne=F(Ne);break}case"TrustedScriptURL":{Ne=C.createScriptURL(Ne);break}}if(Ne!==Ti)try{Re?S.setAttributeNS(Re,xe,Ne):S.setAttribute(xe,Ne),kr(S)?mt(S):Jl(t.removed)}catch{Xt(xe,S)}}Rt(M.afterSanitizeAttributes,S,null)},Sr=function(S){let _=null;const K=aa(S);for(Rt(M.beforeSanitizeShadowDOM,S,null);_=K.nextNode();)if(Rt(M.uponSanitizeShadowNode,_,null),la(_),da(_),xn(_.content)&&Sr(_.content),(A?A(_):_.nodeType)===wt.element){const ce=j?j(_):_.shadowRoot;xn(ce)&&(gn(ce),Sr(ce))}Rt(M.afterSanitizeShadowDOM,S,null)},gn=function(S){const _=A?A(S):S.nodeType;if(_===wt.element){const ce=j?j(S):S.shadowRoot;xn(ce)&&(gn(ce),Sr(ce))}const K=v?v(S):S.childNodes;if(!K)return;const pe=[];en(K,ce=>{bn(pe,ce)});for(const ce of pe)gn(ce);if(_===wt.element){const ce=B?B(S):null;if(typeof ce=="string"&&Ee(ce)==="template"){const xe=S.content;xn(xe)&&gn(xe)}}};return t.sanitize=function(Z){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_=null,K=null,pe=null,ce=null;if(vi=!Z,vi&&(Z="<!-->"),typeof Z!="string"&&!wr(Z)&&(Z=lb(Z),typeof Z!="string"))throw kn("dirty is not a string, aborting");if(!t.isSupported)return Z;if(he||Ci(S),t.removed=[],typeof Z=="string"&&(fe=!1),fe){const ct=B?B(Z):Z.nodeName;if(typeof ct=="string"){const xt=Ee(ct);if(!J[xt]||Ce[xt])throw kn("root node is forbidden and cannot be sanitized in-place")}if(kr(Z))throw kn("root node is clobbered and cannot be sanitized in-place");gn(Z)}else if(wr(Z))_=sa("<!---->"),K=_.ownerDocument.importNode(Z,!0),K.nodeType===wt.element&&K.nodeName==="BODY"||K.nodeName==="HTML"?_=K:_.appendChild(K),gn(K);else{if(!Oe&&!lt&&!se&&Z.indexOf("<")===-1)return C&&vt?F(Z):Z;if(_=sa(Z),!_)return Oe?null:vt?O:""}_&&Se&&mt(_.firstChild);const xe=aa(fe?Z:_);for(;pe=xe.nextNode();)la(pe),da(pe),xn(pe.content)&&Sr(pe.content);if(fe)return lt&&ji(Z),Z;if(Oe){if(lt&&ji(_),pt)for(ce=N.call(_.ownerDocument);_.firstChild;)ce.appendChild(_.firstChild);else ce=_;return(te.shadowroot||te.shadowrootmode)&&(ce=I.call(r,ce,!0)),ce}let Re=se?_.outerHTML:_.innerHTML;return se&&J["!doctype"]&&_.ownerDocument&&_.ownerDocument.doctype&&_.ownerDocument.doctype.name&&We(bb,_.ownerDocument.doctype.name)&&(Re="<!DOCTYPE "+_.ownerDocument.doctype.name+`>
414
+ `+Re),lt&&en([U,G,H],ct=>{Re=vn(Re,ct," ")}),C&&vt?F(Re):Re},t.setConfig=function(){let Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ci(Z),he=!0},t.clearConfig=function(){mn=null,he=!1},t.isValidAttribute=function(Z,S,_){mn||Ci({});const K=Ee(Z),pe=Ee(S);return ca(K,pe,_)},t.addHook=function(Z,S){typeof S=="function"&&bn(M[Z],S)},t.removeHook=function(Z,S){if(S!==void 0){const _=tb(M[Z],S);return _===-1?void 0:nb(M[Z],_,1)[0]}return Jl(M[Z])},t.removeHooks=function(Z){M[Z]=[]},t.removeAllHooks=function(){M=lc()},t}var Ie=Df(),Sb=Ie;Ie.sanitize.bind(Ie);Ie.isSupported;Ie.addHook.bind(Ie);Ie.removeHook.bind(Ie);Ie.removeHooks.bind(Ie);Ie.removeAllHooks.bind(Ie);Ie.setConfig.bind(Ie);Ie.clearConfig.bind(Ie);Ie.isValidAttribute.bind(Ie);Ie.version;Ie.removed;function Cb(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const jb=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Tb=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Bb={};function cc(e,t){return(Bb.jsx?Tb:jb).test(e)}const Eb=/[ \t\n\f\r]/g;function Fb(e){return typeof e=="object"?e.type==="text"?uc(e.value):!1:uc(e)}function uc(e){return e.replace(Eb,"")===""}class yr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}yr.prototype.normal={};yr.prototype.property={};yr.prototype.space=void 0;function Rf(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new yr(n,r,t)}function Yo(e){return e.toLowerCase()}class nt{constructor(t,n){this.attribute=n,this.property=t}}nt.prototype.attribute="";nt.prototype.booleanish=!1;nt.prototype.boolean=!1;nt.prototype.commaOrSpaceSeparated=!1;nt.prototype.commaSeparated=!1;nt.prototype.defined=!1;nt.prototype.mustUseProperty=!1;nt.prototype.number=!1;nt.prototype.overloadedBoolean=!1;nt.prototype.property="";nt.prototype.spaceSeparated=!1;nt.prototype.space=void 0;let Ab=0;const oe=fn(),Fe=fn(),Ko=fn(),$=fn(),ge=fn(),ln=fn(),ot=fn();function fn(){return 2**++Ab}const qo=Object.freeze(Object.defineProperty({__proto__:null,boolean:oe,booleanish:Fe,commaOrSpaceSeparated:ot,commaSeparated:ln,number:$,overloadedBoolean:Ko,spaceSeparated:ge},Symbol.toStringTag,{value:"Module"})),Zi=Object.keys(qo);class Hs extends nt{constructor(t,n,r,i){let s=-1;if(super(t,n),dc(this,"space",i),typeof r=="number")for(;++s<Zi.length;){const a=Zi[s];dc(this,Zi[s],(r&qo[a])===qo[a])}}}Hs.prototype.defined=!0;function dc(e,t,n){n&&(e[t]=n)}function Vn(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new Hs(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Yo(r)]=r,n[Yo(s.attribute)]=r}return new yr(t,n,e.space)}const Mf=Vn({properties:{ariaActiveDescendant:null,ariaAtomic:Fe,ariaAutoComplete:null,ariaBusy:Fe,ariaChecked:Fe,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:ge,ariaCurrent:null,ariaDescribedBy:ge,ariaDetails:null,ariaDisabled:Fe,ariaDropEffect:ge,ariaErrorMessage:null,ariaExpanded:Fe,ariaFlowTo:ge,ariaGrabbed:Fe,ariaHasPopup:null,ariaHidden:Fe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ge,ariaLevel:$,ariaLive:null,ariaModal:Fe,ariaMultiLine:Fe,ariaMultiSelectable:Fe,ariaOrientation:null,ariaOwns:ge,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:Fe,ariaReadOnly:Fe,ariaRelevant:null,ariaRequired:Fe,ariaRoleDescription:ge,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:Fe,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Pf(e,t){return t in e?e[t]:t}function Of(e,t){return Pf(e,t.toLowerCase())}const Lb=Vn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ln,acceptCharset:ge,accessKey:ge,action:null,allow:null,allowFullScreen:oe,allowPaymentRequest:oe,allowUserMedia:oe,alpha:oe,alt:null,as:null,async:oe,autoCapitalize:null,autoComplete:ge,autoFocus:oe,autoPlay:oe,blocking:ge,capture:null,charSet:null,checked:oe,cite:null,className:ge,closedBy:null,colorSpace:null,cols:$,colSpan:$,command:null,commandFor:null,content:null,contentEditable:Fe,controls:oe,controlsList:ge,coords:$|ln,crossOrigin:null,data:null,dateTime:null,decoding:null,default:oe,defer:oe,dir:null,dirName:null,disabled:oe,download:Ko,draggable:Fe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:oe,formTarget:null,headers:ge,height:$,hidden:Ko,high:$,href:null,hrefLang:null,htmlFor:ge,httpEquiv:ge,id:null,imageSizes:null,imageSrcSet:null,inert:oe,inputMode:null,integrity:null,is:null,isMap:oe,itemId:null,itemProp:ge,itemRef:ge,itemScope:oe,itemType:ge,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:oe,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:oe,muted:oe,name:null,nonce:null,noModule:oe,noValidate:oe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:oe,optimum:$,pattern:null,ping:ge,placeholder:null,playsInline:oe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:oe,referrerPolicy:null,rel:ge,required:oe,reversed:oe,rows:$,rowSpan:$,sandbox:ge,scope:null,scoped:oe,seamless:oe,selected:oe,shadowRootClonable:oe,shadowRootCustomElementRegistry:oe,shadowRootDelegatesFocus:oe,shadowRootMode:null,shadowRootSerializable:oe,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:Fe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:oe,useMap:null,value:Fe,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ge,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:oe,declare:oe,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:oe,noHref:oe,noShade:oe,noWrap:oe,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:Fe,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:oe,disablePictureInPicture:oe,disableRemotePlayback:oe,exportParts:ln,part:ge,prefix:null,property:null,results:$,security:null,unselectable:null},space:"html",transform:Of}),Ib=Vn({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ot,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:ge,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:oe,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ln,g2:ln,glyphName:ln,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:ot,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:$,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ge,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ot,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ot,rev:ot,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ot,requiredFeatures:ot,requiredFonts:ot,requiredFormats:ot,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:ot,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ot,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ot,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Pf}),zf=Vn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),_f=Vn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Of}),Nf=Vn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Db={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Rb=/[A-Z]/g,fc=/-[a-z]/g,Mb=/^data[-\w.:]+$/i;function Pb(e,t){const n=Yo(t);let r=t,i=nt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Mb.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(fc,zb);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!fc.test(s)){let a=s.replace(Rb,Ob);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Hs}return new i(r,t)}function Ob(e){return"-"+e.toLowerCase()}function zb(e){return e.charAt(1).toUpperCase()}const _b=Rf([Mf,Lb,zf,_f,Nf],"html"),Us=Rf([Mf,Ib,zf,_f,Nf],"svg");function Nb(e){return e.join(" ").trim()}function Vf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wn={},Ji,hc;function Vb(){if(hc)return Ji;hc=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,d=`
415
+ `,c="/",u="*",h="",m="comment",p="declaration";function x(v,y){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];y=y||{};var j=1,w=1;function A(P){var I=P.match(t);I&&(j+=I.length);var M=P.lastIndexOf(d);w=~M?P.length-M:w+P.length}function B(){var P={line:j,column:w};return function(I){return I.position=new C(P),F(),I}}function C(P){this.start=P,this.end={line:j,column:w},this.source=y.source}C.prototype.content=v;function O(P){var I=new Error(y.source+":"+j+":"+w+": "+P);if(I.reason=P,I.filename=y.source,I.line=j,I.column=w,I.source=v,!y.silent)throw I}function E(P){var I=P.exec(v);if(I){var M=I[0];return A(M),v=v.slice(M.length),I}}function F(){E(n)}function L(P){var I;for(P=P||[];I=R();)I!==!1&&P.push(I);return P}function R(){var P=B();if(!(c!=v.charAt(0)||u!=v.charAt(1))){for(var I=2;h!=v.charAt(I)&&(u!=v.charAt(I)||c!=v.charAt(I+1));)++I;if(I+=2,h===v.charAt(I-1))return O("End of comment missing");var M=v.slice(2,I-2);return w+=2,A(M),v=v.slice(I),w+=2,P({type:m,comment:M})}}function D(){var P=B(),I=E(r);if(I){if(R(),!E(i))return O("property missing ':'");var M=E(s),U=P({type:p,property:g(I[0].replace(e,h)),value:M?g(M[0].replace(e,h)):h});return E(a),U}}function N(){var P=[];L(P);for(var I;I=D();)I!==!1&&(P.push(I),L(P));return P}return F(),N()}function g(v){return v?v.replace(l,h):h}return Ji=x,Ji}var pc;function Wb(){if(pc)return wn;pc=1;var e=wn&&wn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wn,"__esModule",{value:!0}),wn.default=n;const t=e(Vb());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const a=(0,t.default)(r),l=typeof i=="function";return a.forEach(d=>{if(d.type!=="declaration")return;const{property:c,value:u}=d;l?i(c,u,d):u&&(s=s||{},s[c]=u)}),s}return wn}var Yn={},mc;function Hb(){if(mc)return Yn;mc=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(c){return!c||n.test(c)||e.test(c)},a=function(c,u){return u.toUpperCase()},l=function(c,u){return"".concat(u,"-")},d=function(c,u){return u===void 0&&(u={}),s(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(i,l):c=c.replace(r,l),c.replace(t,a))};return Yn.camelCase=d,Yn}var Kn,xc;function Ub(){if(xc)return Kn;xc=1;var e=Kn&&Kn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Wb()),n=Hb();function r(i,s){var a={};return!i||typeof i!="string"||(0,t.default)(i,function(l,d){l&&d&&(a[(0,n.camelCase)(l,s)]=d)}),a}return r.default=r,Kn=r,Kn}var $b=Ub();const Gb=Vf($b),Wf=Hf("end"),$s=Hf("start");function Hf(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Yb(e){const t=$s(e),n=Wf(e);if(t&&n)return{start:t,end:n}}function ir(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?gc(e.position):"start"in e||"end"in e?gc(e):"line"in e||"column"in e?Xo(e):""}function Xo(e){return yc(e&&e.line)+":"+yc(e&&e.column)}function gc(e){return Xo(e&&e.start)+"-"+Xo(e&&e.end)}function yc(e){return e&&typeof e=="number"?e:1}class Ge extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?s.ruleId=r:(s.source=r.slice(0,d),s.ruleId=r.slice(d+1))}if(!s.place&&s.ancestors&&s.ancestors){const d=s.ancestors[s.ancestors.length-1];d&&(s.place=d.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=ir(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ge.prototype.file="";Ge.prototype.name="";Ge.prototype.reason="";Ge.prototype.message="";Ge.prototype.stack="";Ge.prototype.column=void 0;Ge.prototype.line=void 0;Ge.prototype.ancestors=void 0;Ge.prototype.cause=void 0;Ge.prototype.fatal=void 0;Ge.prototype.place=void 0;Ge.prototype.ruleId=void 0;Ge.prototype.source=void 0;const Gs={}.hasOwnProperty,Kb=new Map,qb=/[A-Z]/g,Xb=new Set(["table","tbody","thead","tfoot","tr"]),Zb=new Set(["td","th"]),Uf="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Jb(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=s5(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=o5(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Us:_b,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=$f(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function $f(e,t,n){if(t.type==="element")return Qb(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return e5(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return n5(e,t,n);if(t.type==="mdxjsEsm")return t5(e,t);if(t.type==="root")return r5(e,t,n);if(t.type==="text")return i5(e,t)}function Qb(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Us,e.schema=i),e.ancestors.push(t);const s=Yf(e,t.tagName,!1),a=a5(e,t);let l=Ks(e,t);return Xb.has(t.tagName)&&(l=l.filter(function(d){return typeof d=="string"?!Fb(d):!0})),Gf(e,a,s,t),Ys(a,l),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function e5(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}fr(e,t.position)}function t5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);fr(e,t.position)}function n5(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Us,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Yf(e,t.name,!0),a=l5(e,t),l=Ks(e,t);return Gf(e,a,s,t),Ys(a,l),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function r5(e,t,n){const r={};return Ys(r,Ks(e,t)),e.create(t,e.Fragment,r,n)}function i5(e,t){return t.value}function Gf(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ys(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function o5(e,t,n){return r;function r(i,s,a,l){const c=Array.isArray(a.children)?n:t;return l?c(s,a,l):c(s,a)}}function s5(e,t){return n;function n(r,i,s,a){const l=Array.isArray(s.children),d=$s(r);return t(i,s,a,l,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function a5(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Gs.call(t.properties,i)){const s=c5(e,i,t.properties[i]);if(s){const[a,l]=s;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&Zb.has(t.tagName)?r=l:n[a]=l}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function l5(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else fr(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else fr(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Ks(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Kb;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys){const d=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(d){const c=i.get(d)||0;a=d+"-"+c,i.set(d,c+1)}}const l=$f(e,s,a);l!==void 0&&n.push(l)}return n}function c5(e,t,n){const r=Pb(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Cb(n):Nb(n)),r.property==="style"){let i=typeof n=="object"?n:u5(e,String(n));return e.stylePropertyNameCase==="css"&&(i=d5(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Db[r.property]||r.property:r.attribute,n]}}function u5(e,t){try{return Gb(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Ge("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Uf+"#cannot-parse-style-attribute",i}}function Yf(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,a;for(;++s<i.length;){const l=cc(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:l,computed:!!(s&&l.type==="Literal"),optional:!1}:l}r=a}else r=cc(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Gs.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);fr(e)}function fr(e,t){const n=new Ge("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Uf+"#cannot-handle-mdx-estrees-without-createevaluater",n}function d5(e){const t={};let n;for(n in e)Gs.call(e,n)&&(t[f5(n)]=e[n]);return t}function f5(e){let t=e.replace(qb,h5);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function h5(e){return"-"+e.toLowerCase()}const Qi={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},p5={};function m5(e,t){const n=p5,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Kf(e,r,i)}function Kf(e,t,n){if(x5(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return bc(e.children,t,n)}return Array.isArray(e)?bc(e,t,n):""}function bc(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Kf(e[i],t,n);return r.join("")}function x5(e){return!!(e&&typeof e=="object")}const vc=document.createElement("i");function qs(e){const t="&"+e+";";vc.innerHTML=t;const n=vc.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function It(e,t,n,r){const i=e.length;let s=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function ut(e,t){return e.length>0?(It(e,e.length,0,t),e):t}const kc={}.hasOwnProperty;function g5(e){const t={};let n=-1;for(;++n<e.length;)y5(t,e[n]);return t}function y5(e,t){let n;for(n in t){const i=(kc.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){kc.call(i,a)||(i[a]=[]);const l=s[a];b5(i[a],Array.isArray(l)?l:l?[l]:[])}}}function b5(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);It(e,0,0,r)}function qf(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Rn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Et=Kt(/[A-Za-z]/),at=Kt(/[\dA-Za-z]/),v5=Kt(/[#-'*+\--9=?A-Z^-~]/);function Zo(e){return e!==null&&(e<32||e===127)}const Jo=Kt(/\d/),k5=Kt(/[\dA-Fa-f]/),w5=Kt(/[!-/:-@[-`{-~]/);function ie(e){return e!==null&&e<-2}function tt(e){return e!==null&&(e<0||e===32)}function me(e){return e===-2||e===-1||e===32}const S5=Kt(new RegExp("\\p{P}|\\p{S}","u")),C5=Kt(/\s/);function Kt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Wn(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&at(e.charCodeAt(n+1))&&at(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(a=String.fromCharCode(s,l),i=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ve(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(d){return me(d)?(e.enter(n),l(d)):t(d)}function l(d){return me(d)&&s++<i?(e.consume(d),l):(e.exit(n),t(d))}}const j5={tokenize:T5};function T5(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ve(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),s(l)}function s(l){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,a(l)}function a(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return ie(l)?(e.consume(l),e.exit("chunkText"),s):(e.consume(l),a)}}const B5={tokenize:E5},wc={tokenize:F5};function E5(e){const t=this,n=[];let r=0,i,s,a;return l;function l(w){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,d,c)(w)}return c(w)}function d(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&j();const A=t.events.length;let B=A,C;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){C=t.events[B][1].end;break}y(r);let O=A;for(;O<t.events.length;)t.events[O][1].end={...C},O++;return It(t.events,B+1,0,t.events.slice(A)),t.events.length=O,c(w)}return l(w)}function c(w){if(r===n.length){if(!i)return m(w);if(i.currentConstruct&&i.currentConstruct.concrete)return x(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(wc,u,h)(w)}function u(w){return i&&j(),y(r),m(w)}function h(w){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,x(w)}function m(w){return t.containerState={},e.attempt(wc,p,x)(w)}function p(w){return r++,n.push([t.currentConstruct,t.containerState]),m(w)}function x(w){if(w===null){i&&j(),y(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),g(w)}function g(w){if(w===null){v(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return ie(w)?(e.consume(w),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(w),g)}function v(w,A){const B=t.sliceStream(w);if(A&&B.push(null),w.previous=s,s&&(s.next=w),s=w,i.defineSkip(w.start),i.write(B),t.parser.lazy[w.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<a&&(!i.events[C][1].end||i.events[C][1].end.offset>a))return;const O=t.events.length;let E=O,F,L;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(F){L=t.events[E][1].end;break}F=!0}for(y(r),C=O;C<t.events.length;)t.events[C][1].end={...L},C++;It(t.events,E+1,0,t.events.slice(O)),t.events.length=C}}function y(w){let A=n.length;for(;A-- >w;){const B=n[A];t.containerState=B[1],B[0].exit.call(t,e)}n.length=w}function j(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function F5(e,t,n){return ve(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Sc(e){if(e===null||tt(e)||C5(e))return 1;if(S5(e))return 2}function Xs(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Qo={name:"attention",resolveAll:A5,tokenize:L5};function A5(e,t){let n=-1,r,i,s,a,l,d,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},m={...e[n][1].start};Cc(h,-d),Cc(m,d),a={type:d>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},l={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},s={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...a.start},end:{...l.end}},e[r][1].end={...a.start},e[n][1].start={...l.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ut(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ut(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),c=ut(c,Xs(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ut(c,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=ut(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,It(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function L5(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Sc(r);let s;return a;function a(d){return s=d,e.enter("attentionSequence"),l(d)}function l(d){if(d===s)return e.consume(d),l;const c=e.exit("attentionSequence"),u=Sc(d),h=!u||u===2&&i||n.includes(d),m=!i||i===2&&u||n.includes(r);return c._open=!!(s===42?h:h&&(i||!m)),c._close=!!(s===42?m:m&&(u||!h)),t(d)}}function Cc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const I5={name:"autolink",tokenize:D5};function D5(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return Et(p)?(e.consume(p),a):p===64?n(p):c(p)}function a(p){return p===43||p===45||p===46||at(p)?(r=1,l(p)):c(p)}function l(p){return p===58?(e.consume(p),r=0,d):(p===43||p===45||p===46||at(p))&&r++<32?(e.consume(p),l):(r=0,c(p))}function d(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Zo(p)?n(p):(e.consume(p),d)}function c(p){return p===64?(e.consume(p),u):v5(p)?(e.consume(p),c):n(p)}function u(p){return at(p)?h(p):n(p)}function h(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):m(p)}function m(p){if((p===45||at(p))&&r++<63){const x=p===45?m:h;return e.consume(p),x}return n(p)}}const gi={partial:!0,tokenize:R5};function R5(e,t,n){return r;function r(s){return me(s)?ve(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||ie(s)?t(s):n(s)}}const Xf={continuation:{tokenize:P5},exit:O5,name:"blockQuote",tokenize:M5};function M5(e,t,n){const r=this;return i;function i(a){if(a===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),s}return n(a)}function s(a){return me(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function P5(e,t,n){const r=this;return i;function i(a){return me(a)?ve(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(Xf,t,n)(a)}}function O5(e){e.exit("blockQuote")}const Zf={name:"characterEscape",tokenize:z5};function z5(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return w5(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const Jf={name:"characterReference",tokenize:_5};function _5(e,t,n){const r=this;let i=0,s,a;return l;function l(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),d}function d(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,a=at,u(h))}function c(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=k5,u):(e.enter("characterReferenceValue"),s=7,a=Jo,u(h))}function u(h){if(h===59&&i){const m=e.exit("characterReferenceValue");return a===at&&!qs(r.sliceSerialize(m))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(h)&&i++<s?(e.consume(h),u):n(h)}}const jc={partial:!0,tokenize:V5},Tc={concrete:!0,name:"codeFenced",tokenize:N5};function N5(e,t,n){const r=this,i={partial:!0,tokenize:B};let s=0,a=0,l;return d;function d(C){return c(C)}function c(C){const O=r.events[r.events.length-1];return s=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,l=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(C)}function u(C){return C===l?(a++,e.consume(C),u):a<3?n(C):(e.exit("codeFencedFenceSequence"),me(C)?ve(e,h,"whitespace")(C):h(C))}function h(C){return C===null||ie(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(jc,g,A)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||ie(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(C)):me(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ve(e,p,"whitespace")(C)):C===96&&C===l?n(C):(e.consume(C),m)}function p(C){return C===null||ie(C)?h(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(C))}function x(C){return C===null||ie(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(C)):C===96&&C===l?n(C):(e.consume(C),x)}function g(C){return e.attempt(i,A,v)(C)}function v(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),y}function y(C){return s>0&&me(C)?ve(e,j,"linePrefix",s+1)(C):j(C)}function j(C){return C===null||ie(C)?e.check(jc,g,A)(C):(e.enter("codeFlowValue"),w(C))}function w(C){return C===null||ie(C)?(e.exit("codeFlowValue"),j(C)):(e.consume(C),w)}function A(C){return e.exit("codeFenced"),t(C)}function B(C,O,E){let F=0;return L;function L(I){return C.enter("lineEnding"),C.consume(I),C.exit("lineEnding"),R}function R(I){return C.enter("codeFencedFence"),me(I)?ve(C,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):D(I)}function D(I){return I===l?(C.enter("codeFencedFenceSequence"),N(I)):E(I)}function N(I){return I===l?(F++,C.consume(I),N):F>=a?(C.exit("codeFencedFenceSequence"),me(I)?ve(C,P,"whitespace")(I):P(I)):E(I)}function P(I){return I===null||ie(I)?(C.exit("codeFencedFence"),O(I)):E(I)}}}function V5(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const eo={name:"codeIndented",tokenize:H5},W5={partial:!0,tokenize:U5};function H5(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ve(e,s,"linePrefix",5)(c)}function s(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?d(c):ie(c)?e.attempt(W5,a,d)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||ie(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),l)}function d(c){return e.exit("codeIndented"),t(c)}}function U5(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):ie(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):ve(e,s,"linePrefix",5)(a)}function s(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):ie(a)?i(a):n(a)}}const $5={name:"codeText",previous:Y5,resolve:G5,tokenize:K5};function G5(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Y5(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function K5(e,t,n){let r=0,i,s;return a;function a(h){return e.enter("codeText"),e.enter("codeTextSequence"),l(h)}function l(h){return h===96?(e.consume(h),r++,l):(e.exit("codeTextSequence"),d(h))}function d(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),d):h===96?(s=e.enter("codeTextSequence"),i=0,u(h)):ie(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),d):(e.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||ie(h)?(e.exit("codeTextData"),d(h)):(e.consume(h),c)}function u(h){return h===96?(e.consume(h),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(s.type="codeTextData",c(h))}}class q5{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&qn(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),qn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),qn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);qn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);qn(this.left,n.reverse())}}}function qn(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Qf(e){const t={};let n=-1,r,i,s,a,l,d,c;const u=new q5(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,s=0,s<d.length&&d[s][1].type==="lineEndingBlank"&&(s+=2),s<d.length&&d[s][1].type==="content"))for(;++s<d.length&&d[s][1].type!=="content";)d[s][1].type==="chunkText"&&(d[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,X5(u,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=u.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},l=u.slice(i,n),l.unshift(r),u.splice(i,n-i+1,l))}}return It(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function X5(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const l=a.events,d=[],c={};let u,h,m=-1,p=n,x=0,g=0;const v=[g];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),h&&a.defineSkip(p.start),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=p,p=p.next}for(p=n;++m<l.length;)l[m][0]==="exit"&&l[m-1][0]==="enter"&&l[m][1].type===l[m-1][1].type&&l[m][1].start.line!==l[m][1].end.line&&(g=m+1,v.push(g),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(a.events=[],p?(p._tokenizer=void 0,p.previous=void 0):v.pop(),m=v.length;m--;){const y=l.slice(v[m],v[m+1]),j=s.pop();d.push([j,j+y.length-1]),e.splice(j,2,y)}for(d.reverse(),m=-1;++m<d.length;)c[x+d[m][0]]=x+d[m][1],x+=d[m][1]-d[m][0]-1;return c}const Z5={resolve:Q5,tokenize:ev},J5={partial:!0,tokenize:tv};function Q5(e){return Qf(e),e}function ev(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?s(l):ie(l)?e.check(J5,a,s)(l):(e.consume(l),i)}function s(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function a(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function tv(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ve(e,s,"linePrefix")}function s(a){if(a===null||ie(a))return n(a);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function eh(e,t,n,r,i,s,a,l,d){const c=d||Number.POSITIVE_INFINITY;let u=0;return h;function h(y){return y===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(y),e.exit(s),m):y===null||y===32||y===41||Zo(y)?n(y):(e.enter(r),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(y))}function m(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(l),m(y)):y===null||y===60||ie(y)?n(y):(e.consume(y),y===92?x:p)}function x(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function g(y){return!u&&(y===null||y===41||tt(y))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(r),t(y)):u<c&&y===40?(e.consume(y),u++,g):y===41?(e.consume(y),u--,g):y===null||y===32||y===40||Zo(y)?n(y):(e.consume(y),y===92?v:g)}function v(y){return y===40||y===41||y===92?(e.consume(y),g):g(y)}}function th(e,t,n,r,i,s){const a=this;let l=0,d;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(s),u}function u(p){return l>999||p===null||p===91||p===93&&!d||p===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(e.exit(s),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):ie(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===null||p===91||p===93||ie(p)||l++>999?(e.exit("chunkString"),u(p)):(e.consume(p),d||(d=!me(p)),p===92?m:h)}function m(p){return p===91||p===92||p===93?(e.consume(p),l++,h):h(p)}}function nh(e,t,n,r,i,s){let a;return l;function l(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),a=m===40?41:m,d):n(m)}function d(m){return m===a?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(s),c(m))}function c(m){return m===a?(e.exit(s),d(a)):m===null?n(m):ie(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),ve(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(m))}function u(m){return m===a||m===null||ie(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?h:u)}function h(m){return m===a||m===92?(e.consume(m),u):u(m)}}function or(e,t){let n;return r;function r(i){return ie(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):me(i)?ve(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const nv={name:"definition",tokenize:iv},rv={partial:!0,tokenize:ov};function iv(e,t,n){const r=this;let i;return s;function s(p){return e.enter("definition"),a(p)}function a(p){return th.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return i=Rn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),d):n(p)}function d(p){return tt(p)?or(e,c)(p):c(p)}function c(p){return eh(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(rv,h,h)(p)}function h(p){return me(p)?ve(e,m,"whitespace")(p):m(p)}function m(p){return p===null||ie(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function ov(e,t,n){return r;function r(l){return tt(l)?or(e,i)(l):n(l)}function i(l){return nh(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return me(l)?ve(e,a,"whitespace")(l):a(l)}function a(l){return l===null||ie(l)?t(l):n(l)}}const sv={name:"hardBreakEscape",tokenize:av};function av(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return ie(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const lv={name:"headingAtx",resolve:cv,tokenize:uv};function cv(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},It(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function uv(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),s(u)}function s(u){return e.enter("atxHeadingSequence"),a(u)}function a(u){return u===35&&r++<6?(e.consume(u),a):u===null||tt(u)?(e.exit("atxHeadingSequence"),l(u)):n(u)}function l(u){return u===35?(e.enter("atxHeadingSequence"),d(u)):u===null||ie(u)?(e.exit("atxHeading"),t(u)):me(u)?ve(e,l,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function d(u){return u===35?(e.consume(u),d):(e.exit("atxHeadingSequence"),l(u))}function c(u){return u===null||u===35||tt(u)?(e.exit("atxHeadingText"),l(u)):(e.consume(u),c)}}const dv=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Bc=["pre","script","style","textarea"],fv={concrete:!0,name:"htmlFlow",resolveTo:mv,tokenize:xv},hv={partial:!0,tokenize:yv},pv={partial:!0,tokenize:gv};function mv(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function xv(e,t,n){const r=this;let i,s,a,l,d;return c;function c(T){return u(T)}function u(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),h}function h(T){return T===33?(e.consume(T),m):T===47?(e.consume(T),s=!0,g):T===63?(e.consume(T),i=3,r.interrupt?t:b):Et(T)?(e.consume(T),a=String.fromCharCode(T),v):n(T)}function m(T){return T===45?(e.consume(T),i=2,p):T===91?(e.consume(T),i=5,l=0,x):Et(T)?(e.consume(T),i=4,r.interrupt?t:b):n(T)}function p(T){return T===45?(e.consume(T),r.interrupt?t:b):n(T)}function x(T){const be="CDATA[";return T===be.charCodeAt(l++)?(e.consume(T),l===be.length?r.interrupt?t:D:x):n(T)}function g(T){return Et(T)?(e.consume(T),a=String.fromCharCode(T),v):n(T)}function v(T){if(T===null||T===47||T===62||tt(T)){const be=T===47,ke=a.toLowerCase();return!be&&!s&&Bc.includes(ke)?(i=1,r.interrupt?t(T):D(T)):dv.includes(a.toLowerCase())?(i=6,be?(e.consume(T),y):r.interrupt?t(T):D(T)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(T):s?j(T):w(T))}return T===45||at(T)?(e.consume(T),a+=String.fromCharCode(T),v):n(T)}function y(T){return T===62?(e.consume(T),r.interrupt?t:D):n(T)}function j(T){return me(T)?(e.consume(T),j):L(T)}function w(T){return T===47?(e.consume(T),L):T===58||T===95||Et(T)?(e.consume(T),A):me(T)?(e.consume(T),w):L(T)}function A(T){return T===45||T===46||T===58||T===95||at(T)?(e.consume(T),A):B(T)}function B(T){return T===61?(e.consume(T),C):me(T)?(e.consume(T),B):w(T)}function C(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),d=T,O):me(T)?(e.consume(T),C):E(T)}function O(T){return T===d?(e.consume(T),d=null,F):T===null||ie(T)?n(T):(e.consume(T),O)}function E(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||tt(T)?B(T):(e.consume(T),E)}function F(T){return T===47||T===62||me(T)?w(T):n(T)}function L(T){return T===62?(e.consume(T),R):n(T)}function R(T){return T===null||ie(T)?D(T):me(T)?(e.consume(T),R):n(T)}function D(T){return T===45&&i===2?(e.consume(T),M):T===60&&i===1?(e.consume(T),U):T===62&&i===4?(e.consume(T),W):T===63&&i===3?(e.consume(T),b):T===93&&i===5?(e.consume(T),H):ie(T)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(hv,ne,N)(T)):T===null||ie(T)?(e.exit("htmlFlowData"),N(T)):(e.consume(T),D)}function N(T){return e.check(pv,P,ne)(T)}function P(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),I}function I(T){return T===null||ie(T)?N(T):(e.enter("htmlFlowData"),D(T))}function M(T){return T===45?(e.consume(T),b):D(T)}function U(T){return T===47?(e.consume(T),a="",G):D(T)}function G(T){if(T===62){const be=a.toLowerCase();return Bc.includes(be)?(e.consume(T),W):D(T)}return Et(T)&&a.length<8?(e.consume(T),a+=String.fromCharCode(T),G):D(T)}function H(T){return T===93?(e.consume(T),b):D(T)}function b(T){return T===62?(e.consume(T),W):T===45&&i===2?(e.consume(T),b):D(T)}function W(T){return T===null||ie(T)?(e.exit("htmlFlowData"),ne(T)):(e.consume(T),W)}function ne(T){return e.exit("htmlFlow"),t(T)}}function gv(e,t,n){const r=this;return i;function i(a){return ie(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function yv(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(gi,t,n)}}const bv={name:"htmlText",tokenize:vv};function vv(e,t,n){const r=this;let i,s,a;return l;function l(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),d}function d(b){return b===33?(e.consume(b),c):b===47?(e.consume(b),B):b===63?(e.consume(b),w):Et(b)?(e.consume(b),E):n(b)}function c(b){return b===45?(e.consume(b),u):b===91?(e.consume(b),s=0,x):Et(b)?(e.consume(b),j):n(b)}function u(b){return b===45?(e.consume(b),p):n(b)}function h(b){return b===null?n(b):b===45?(e.consume(b),m):ie(b)?(a=h,U(b)):(e.consume(b),h)}function m(b){return b===45?(e.consume(b),p):h(b)}function p(b){return b===62?M(b):b===45?m(b):h(b)}function x(b){const W="CDATA[";return b===W.charCodeAt(s++)?(e.consume(b),s===W.length?g:x):n(b)}function g(b){return b===null?n(b):b===93?(e.consume(b),v):ie(b)?(a=g,U(b)):(e.consume(b),g)}function v(b){return b===93?(e.consume(b),y):g(b)}function y(b){return b===62?M(b):b===93?(e.consume(b),y):g(b)}function j(b){return b===null||b===62?M(b):ie(b)?(a=j,U(b)):(e.consume(b),j)}function w(b){return b===null?n(b):b===63?(e.consume(b),A):ie(b)?(a=w,U(b)):(e.consume(b),w)}function A(b){return b===62?M(b):w(b)}function B(b){return Et(b)?(e.consume(b),C):n(b)}function C(b){return b===45||at(b)?(e.consume(b),C):O(b)}function O(b){return ie(b)?(a=O,U(b)):me(b)?(e.consume(b),O):M(b)}function E(b){return b===45||at(b)?(e.consume(b),E):b===47||b===62||tt(b)?F(b):n(b)}function F(b){return b===47?(e.consume(b),M):b===58||b===95||Et(b)?(e.consume(b),L):ie(b)?(a=F,U(b)):me(b)?(e.consume(b),F):M(b)}function L(b){return b===45||b===46||b===58||b===95||at(b)?(e.consume(b),L):R(b)}function R(b){return b===61?(e.consume(b),D):ie(b)?(a=R,U(b)):me(b)?(e.consume(b),R):F(b)}function D(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),i=b,N):ie(b)?(a=D,U(b)):me(b)?(e.consume(b),D):(e.consume(b),P)}function N(b){return b===i?(e.consume(b),i=void 0,I):b===null?n(b):ie(b)?(a=N,U(b)):(e.consume(b),N)}function P(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||tt(b)?F(b):(e.consume(b),P)}function I(b){return b===47||b===62||tt(b)?F(b):n(b)}function M(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function U(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),G}function G(b){return me(b)?ve(e,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):H(b)}function H(b){return e.enter("htmlTextData"),a(b)}}const Zs={name:"labelEnd",resolveAll:Cv,resolveTo:jv,tokenize:Tv},kv={tokenize:Bv},wv={tokenize:Ev},Sv={tokenize:Fv};function Cv(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&It(e,0,e.length,n),e}function jv(e,t){let n=e.length,r=0,i,s,a,l;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const d={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[a][1].end}},u={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[a-2][1].start}};return l=[["enter",d,t],["enter",c,t]],l=ut(l,e.slice(s+1,s+r+3)),l=ut(l,[["enter",u,t]]),l=ut(l,Xs(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),l=ut(l,[["exit",u,t],e[a-2],e[a-1],["exit",c,t]]),l=ut(l,e.slice(a+1)),l=ut(l,[["exit",d,t]]),It(e,s,e.length,l),e}function Tv(e,t,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return l;function l(m){return s?s._inactive?h(m):(a=r.parser.defined.includes(Rn(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),d):n(m)}function d(m){return m===40?e.attempt(kv,u,a?u:h)(m):m===91?e.attempt(wv,u,a?c:h)(m):a?u(m):h(m)}function c(m){return e.attempt(Sv,u,h)(m)}function u(m){return t(m)}function h(m){return s._balanced=!0,n(m)}}function Bv(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return tt(h)?or(e,s)(h):s(h)}function s(h){return h===41?u(h):eh(e,a,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return tt(h)?or(e,d)(h):u(h)}function l(h){return n(h)}function d(h){return h===34||h===39||h===40?nh(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):u(h)}function c(h){return tt(h)?or(e,u)(h):u(h)}function u(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function Ev(e,t,n){const r=this;return i;function i(l){return th.call(r,e,s,a,"reference","referenceMarker","referenceString")(l)}function s(l){return r.parser.defined.includes(Rn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function a(l){return n(l)}}function Fv(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const Av={name:"labelStartImage",resolveAll:Zs.resolveAll,tokenize:Lv};function Lv(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),s}function s(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),a):n(l)}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Iv={name:"labelStartLink",resolveAll:Zs.resolveAll,tokenize:Dv};function Dv(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const to={name:"lineEnding",tokenize:Rv};function Rv(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ve(e,t,"linePrefix")}}const Gr={name:"thematicBreak",tokenize:Mv};function Mv(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,l(c)}function l(c){return c===i?(e.enter("thematicBreakSequence"),d(c)):r>=3&&(c===null||ie(c))?(e.exit("thematicBreak"),t(c)):n(c)}function d(c){return c===i?(e.consume(c),r++,d):(e.exit("thematicBreakSequence"),me(c)?ve(e,l,"whitespace")(c):l(c))}}const Je={continuation:{tokenize:_v},exit:Vv,name:"list",tokenize:zv},Pv={partial:!0,tokenize:Wv},Ov={partial:!0,tokenize:Nv};function zv(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return l;function l(p){const x=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Jo(p)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Gr,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(p)}return n(p)}function d(p){return Jo(p)&&++a<10?(e.consume(p),d):(!r.interrupt||a<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(gi,r.interrupt?n:u,e.attempt(Pv,m,h))}function u(p){return r.containerState.initialBlankLine=!0,s++,m(p)}function h(p){return me(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),m):n(p)}function m(p){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function _v(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(gi,i,s);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ve(e,t,"listItemIndent",r.containerState.size+1)(l)}function s(l){return r.containerState.furtherBlankLines||!me(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Ov,t,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,ve(e,e.attempt(Je,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Nv(e,t,n){const r=this;return ve(e,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(s):n(s)}}function Vv(e){e.exit(this.containerState.type)}function Wv(e,t,n){const r=this;return ve(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!me(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Ec={name:"setextUnderline",resolveTo:Hv,tokenize:Uv};function Hv(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function Uv(e,t,n){const r=this;let i;return s;function s(c){let u=r.events.length,h;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){h=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===i?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),me(c)?ve(e,d,"lineSuffix")(c):d(c))}function d(c){return c===null||ie(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const $v={tokenize:Gv};function Gv(e){const t=this,n=e.attempt(gi,r,e.attempt(this.parser.constructs.flowInitial,i,ve(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Z5,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Yv={resolveAll:ih()},Kv=rh("string"),qv=rh("text");function rh(e){return{resolveAll:ih(e==="text"?Xv:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,l);return a;function a(u){return c(u)?s(u):l(u)}function l(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),d}function d(u){return c(u)?(n.exit("data"),s(u)):(n.consume(u),d)}function c(u){if(u===null)return!0;const h=i[u];let m=-1;if(h)for(;++m<h.length;){const p=h[m];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function ih(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function Xv(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,a=-1,l=0,d;for(;s--;){const c=i[s];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)l++,a--;if(a)break;a=-1}else if(c===-2)d=!0,l++;else if(c!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const c={type:n===e.length||d||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const Zv={42:Je,43:Je,45:Je,48:Je,49:Je,50:Je,51:Je,52:Je,53:Je,54:Je,55:Je,56:Je,57:Je,62:Xf},Jv={91:nv},Qv={[-2]:eo,[-1]:eo,32:eo},e4={35:lv,42:Gr,45:[Ec,Gr],60:fv,61:Ec,95:Gr,96:Tc,126:Tc},t4={38:Jf,92:Zf},n4={[-5]:to,[-4]:to,[-3]:to,33:Av,38:Jf,42:Qo,60:[I5,bv],91:Iv,92:[sv,Zf],93:Zs,95:Qo,96:$5},r4={null:[Qo,Yv]},i4={null:[42,95]},o4={null:[]},s4=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:i4,contentInitial:Jv,disable:o4,document:Zv,flow:e4,flowInitial:Qv,insideSpan:r4,string:t4,text:n4},Symbol.toStringTag,{value:"Module"}));function a4(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],l=[];const d={attempt:O(B),check:O(C),consume:j,enter:w,exit:A,interrupt:O(C,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:x,parser:e,previous:null,sliceSerialize:m,sliceStream:p,write:h};let u=t.tokenize.call(c,d);return t.resolveAll&&s.push(t),c;function h(R){return a=ut(a,R),v(),a[a.length-1]!==null?[]:(E(t,0),c.events=Xs(s,c.events,c),c.events)}function m(R,D){return c4(p(R),D)}function p(R){return l4(a,R)}function x(){const{_bufferIndex:R,_index:D,line:N,column:P,offset:I}=r;return{_bufferIndex:R,_index:D,line:N,column:P,offset:I}}function g(R){i[R.line]=R.column,L()}function v(){let R;for(;r._index<a.length;){const D=a[r._index];if(typeof D=="string")for(R=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===R&&r._bufferIndex<D.length;)y(D.charCodeAt(r._bufferIndex));else y(D)}}function y(R){u=u(R)}function j(R){ie(R)?(r.line++,r.column=1,r.offset+=R===-3?2:1,L()):R!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=R}function w(R,D){const N=D||{};return N.type=R,N.start=x(),c.events.push(["enter",N,c]),l.push(N),N}function A(R){const D=l.pop();return D.end=x(),c.events.push(["exit",D,c]),D}function B(R,D){E(R,D.from)}function C(R,D){D.restore()}function O(R,D){return N;function N(P,I,M){let U,G,H,b;return Array.isArray(P)?ne(P):"tokenize"in P?ne([P]):W(P);function W(J){return X;function X(te){const de=te!==null&&J[te],ee=te!==null&&J.null,Ce=[...Array.isArray(de)?de:de?[de]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return ne(Ce)(te)}}function ne(J){return U=J,G=0,J.length===0?M:T(J[G])}function T(J){return X;function X(te){return b=F(),H=J,J.partial||(c.currentConstruct=J),J.name&&c.parser.constructs.disable.null.includes(J.name)?ke():J.tokenize.call(D?Object.assign(Object.create(c),D):c,d,be,ke)(te)}}function be(J){return R(H,b),I}function ke(J){return b.restore(),++G<U.length?T(U[G]):M}}}function E(R,D){R.resolveAll&&!s.includes(R)&&s.push(R),R.resolve&&It(c.events,D,c.events.length-D,R.resolve(c.events.slice(D),c)),R.resolveTo&&(c.events=R.resolveTo(c.events,c))}function F(){const R=x(),D=c.previous,N=c.currentConstruct,P=c.events.length,I=Array.from(l);return{from:P,restore:M};function M(){r=R,c.previous=D,c.currentConstruct=N,c.events.length=P,l=I,L()}}function L(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function l4(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,s)];else{if(a=e.slice(n,i),r>-1){const l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function c4(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
416
416
  `;break}case-3:{a=`\r
417
- `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function a4(e){const r={constructs:p5([r4,...(e||{}).extensions||[]]),content:i(w5),defined:[],document:i(C5),flow:i(Wv),lazy:{},string:i($v),text:i(Gv)};return r;function i(s){return a;function a(l){return i4(r,s,l)}}}function l4(e){for(;!Xf(e););return e}const Ec=/[\0\t\n\r]/g;function c4(){let e=1,t="",n=!0,r;return i;function i(s,a,l){const d=[];let c,u,h,m,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),h=0,t="",n&&(s.charCodeAt(0)===65279&&h++,n=void 0);h<s.length;){if(Ec.lastIndex=h,c=Ec.exec(s),m=c&&c.index!==void 0?c.index:s.length,p=s.charCodeAt(m),!c){t=s.slice(h);break}if(p===10&&h===m&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),h<m&&(d.push(s.slice(h,m)),e+=m-h),p){case 0:{d.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,d.push(-2);e++<u;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}h=m+1}return l&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const u4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function d4(e){return e.replace(u4,f4)}function f4(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Gf(n.slice(s?2:1),s?16:10)}return Ks(n)||e}const nh={}.hasOwnProperty;function h4(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),p4(n)(l4(a4(n).document().write(c4()(e,t,!0))))}function p4(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Q),autolinkProtocol:F,autolinkEmail:F,atxHeading:s(Ot),blockQuote:s(ee),characterEscape:F,characterReference:F,codeFenced:s(Ce),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(Ce,a),codeText:s(De,a),codeTextData:F,data:F,codeFlowValue:F,definition:s(ue),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(hn),hardBreakEscape:s(qt),hardBreakTrailing:s(qt),htmlFlow:s(zt,a),htmlFlowData:F,htmlText:s(zt,a),htmlTextData:F,image:s(lt),label:a,link:s(Q),listItem:s(he),listItemValue:m,listOrdered:s(se,h),listUnordered:s(se),paragraph:s(Se),reference:T,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(Ot),strong:s(Oe),thematicBreak:s(vt)},exit:{atxHeading:d(),atxHeadingSequence:B,autolink:d(),autolinkEmail:de,autolinkProtocol:te,blockQuote:d(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:ke,characterReferenceMarkerNumeric:ke,characterReferenceValue:J,characterReference:X,codeFenced:d(v),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:x,codeFlowValue:L,codeIndented:d(y),codeText:d(I),codeTextData:L,data:L,definition:d(),definitionDestinationString:A,definitionLabelString:j,definitionTitleString:w,emphasis:d(),hardBreakEscape:d(D),hardBreakTrailing:d(D),htmlFlow:d(N),htmlFlowData:L,htmlText:d(P),htmlTextData:L,image:d(U),label:H,labelText:G,lineEnding:R,link:d(M),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:be,resourceDestinationString:b,resourceTitleString:W,resource:ne,setextHeading:d(E),setextHeadingLineSequence:O,setextHeadingText:C,strong:d(),thematicBreak:d()}};rh(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(z){let Y={type:"root",children:[]};const re={stack:[Y],tokenStack:[],config:t,enter:l,exit:c,buffer:a,resume:u,data:n},le=[];let fe=-1;for(;++fe<z.length;)if(z[fe][1].type==="listOrdered"||z[fe][1].type==="listUnordered")if(z[fe][0]==="enter")le.push(fe);else{const ze=le.pop();fe=i(z,ze,fe)}for(fe=-1;++fe<z.length;){const ze=t[z[fe][0]];nh.call(ze,z[fe][1].type)&&ze[z[fe][1].type].call(Object.assign({sliceSerialize:z[fe][2].sliceSerialize},re),z[fe][1])}if(re.tokenStack.length>0){const ze=re.tokenStack[re.tokenStack.length-1];(ze[1]||Fc).call(re,void 0,ze[0])}for(Y.position={start:Vt(z.length>0?z[0][1].start:{line:1,column:1,offset:0}),end:Vt(z.length>0?z[z.length-2][1].end:{line:1,column:1,offset:0})},fe=-1;++fe<t.transforms.length;)Y=t.transforms[fe](Y)||Y;return Y}function i(z,Y,re){let le=Y-1,fe=-1,ze=!1,_e,it,_t,Nt;for(;++le<=re;){const Ve=z[le];switch(Ve[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ve[0]==="enter"?fe++:fe--,Nt=void 0;break}case"lineEndingBlank":{Ve[0]==="enter"&&(_e&&!Nt&&!fe&&!_t&&(_t=le),Nt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Nt=void 0}if(!fe&&Ve[0]==="enter"&&Ve[1].type==="listItemPrefix"||fe===-1&&Ve[0]==="exit"&&(Ve[1].type==="listUnordered"||Ve[1].type==="listOrdered")){if(_e){let Dt=le;for(it=void 0;Dt--;){const Ze=z[Dt];if(Ze[1].type==="lineEnding"||Ze[1].type==="lineEndingBlank"){if(Ze[0]==="exit")continue;it&&(z[it][1].type="lineEndingBlank",ze=!0),Ze[1].type="lineEnding",it=Dt}else if(!(Ze[1].type==="linePrefix"||Ze[1].type==="blockQuotePrefix"||Ze[1].type==="blockQuotePrefixWhitespace"||Ze[1].type==="blockQuoteMarker"||Ze[1].type==="listItemIndent"))break}_t&&(!it||_t<it)&&(_e._spread=!0),_e.end=Object.assign({},it?z[it][1].start:Ve[1].end),z.splice(it||le,0,["exit",_e,Ve[2]]),le++,re++}if(Ve[1].type==="listItemPrefix"){const Dt={type:"listItem",_spread:!1,start:Object.assign({},Ve[1].start),end:void 0};_e=Dt,z.splice(le,0,["enter",Dt,Ve[2]]),le++,re++,_t=void 0,Nt=!0}}}return z[Y][1]._spread=ze,re}function s(z,Y){return re;function re(le){l.call(this,z(le),le),Y&&Y.call(this,le)}}function a(){this.stack.push({type:"fragment",children:[]})}function l(z,Y,re){this.stack[this.stack.length-1].children.push(z),this.stack.push(z),this.tokenStack.push([Y,re||void 0]),z.position={start:Vt(Y.start),end:void 0}}function d(z){return Y;function Y(re){z&&z.call(this,re),c.call(this,re)}}function c(z,Y){const re=this.stack.pop(),le=this.tokenStack.pop();if(le)le[0].type!==z.type&&(Y?Y.call(this,z,le[0]):(le[1]||Fc).call(this,z,le[0]));else throw new Error("Cannot close `"+z.type+"` ("+ir({start:z.start,end:z.end})+"): it’s not open");re.position.end=Vt(z.end)}function u(){return f5(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function m(z){if(this.data.expectingFirstListItemValue){const Y=this.stack[this.stack.length-2];Y.start=Number.parseInt(this.sliceSerialize(z),10),this.data.expectingFirstListItemValue=void 0}}function p(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.lang=z}function x(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.meta=z}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.value=z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.value=z.replace(/(\r?\n|\r)$/g,"")}function j(z){const Y=this.resume(),re=this.stack[this.stack.length-1];re.label=Y,re.identifier=Rn(this.sliceSerialize(z)).toLowerCase()}function w(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.title=z}function A(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.url=z}function B(z){const Y=this.stack[this.stack.length-1];if(!Y.depth){const re=this.sliceSerialize(z).length;Y.depth=re}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function O(z){const Y=this.stack[this.stack.length-1];Y.depth=this.sliceSerialize(z).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function F(z){const re=this.stack[this.stack.length-1].children;let le=re[re.length-1];(!le||le.type!=="text")&&(le=pt(),le.position={start:Vt(z.start),end:void 0},re.push(le)),this.stack.push(le)}function L(z){const Y=this.stack.pop();Y.value+=this.sliceSerialize(z),Y.position.end=Vt(z.end)}function R(z){const Y=this.stack[this.stack.length-1];if(this.data.atHardBreak){const re=Y.children[Y.children.length-1];re.position.end=Vt(z.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Y.type)&&(F.call(this,z),L.call(this,z))}function D(){this.data.atHardBreak=!0}function N(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.value=z}function P(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.value=z}function I(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.value=z}function M(){const z=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";z.type+="Reference",z.referenceType=Y,delete z.url,delete z.title}else delete z.identifier,delete z.label;this.data.referenceType=void 0}function U(){const z=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";z.type+="Reference",z.referenceType=Y,delete z.url,delete z.title}else delete z.identifier,delete z.label;this.data.referenceType=void 0}function G(z){const Y=this.sliceSerialize(z),re=this.stack[this.stack.length-2];re.label=d4(Y),re.identifier=Rn(Y).toLowerCase()}function H(){const z=this.stack[this.stack.length-1],Y=this.resume(),re=this.stack[this.stack.length-1];if(this.data.inReference=!0,re.type==="link"){const le=z.children;re.children=le}else re.alt=Y}function b(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.url=z}function W(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.title=z}function ne(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function be(z){const Y=this.resume(),re=this.stack[this.stack.length-1];re.label=Y,re.identifier=Rn(this.sliceSerialize(z)).toLowerCase(),this.data.referenceType="full"}function ke(z){this.data.characterReferenceType=z.type}function J(z){const Y=this.sliceSerialize(z),re=this.data.characterReferenceType;let le;re?(le=Gf(Y,re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):le=Ks(Y);const fe=this.stack[this.stack.length-1];fe.value+=le}function X(z){const Y=this.stack.pop();Y.position.end=Vt(z.end)}function te(z){L.call(this,z);const Y=this.stack[this.stack.length-1];Y.url=this.sliceSerialize(z)}function de(z){L.call(this,z);const Y=this.stack[this.stack.length-1];Y.url="mailto:"+this.sliceSerialize(z)}function ee(){return{type:"blockquote",children:[]}}function Ce(){return{type:"code",lang:null,meta:null,value:""}}function De(){return{type:"inlineCode",value:""}}function ue(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function hn(){return{type:"emphasis",children:[]}}function Ot(){return{type:"heading",depth:0,children:[]}}function qt(){return{type:"break"}}function zt(){return{type:"html",value:""}}function lt(){return{type:"image",title:null,url:"",alt:null}}function Q(){return{type:"link",title:null,url:"",children:[]}}function se(z){return{type:"list",ordered:z.type==="listOrdered",start:null,spread:z._spread,children:[]}}function he(z){return{type:"listItem",spread:z._spread,checked:null,children:[]}}function Se(){return{type:"paragraph",children:[]}}function Oe(){return{type:"strong",children:[]}}function pt(){return{type:"text",value:""}}function vt(){return{type:"thematicBreak"}}}function Vt(e){return{line:e.line,column:e.column,offset:e.offset}}function rh(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?rh(e,r):m4(e,r)}}function m4(e,t){let n;for(n in t)if(nh.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Fc(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ir({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ir({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ir({start:t.start,end:t.end})+") is still open")}function x4(e){const t=this;t.parser=n;function n(r){return h4(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function g4(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function y4(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
418
- `}]}function b4(e,t){const n=t.value?t.value+`
419
- `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function v4(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function k4(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function w4(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Wn(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let a,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=s+1,l+=1,e.footnoteCounts.set(r,l);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,d);const c={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,c),e.applyData(t,c)}function S4(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function C4(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ih(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function j4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ih(e,t);const i={src:Wn(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function T4(e,t){const n={src:Wn(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function B4(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function E4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ih(e,t);const i={href:Wn(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function F4(e,t){const n={href:Wn(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function A4(e,t,n){const r=e.all(t),i=n?L4(n):oh(t),s={},a=[];if(typeof t.checked=="boolean"){const u=r[0];let h;u&&u.type==="element"&&u.tagName==="p"?h=u:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const u=r[l];(i||l!==0||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
417
+ `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function u4(e){const r={constructs:g5([s4,...(e||{}).extensions||[]]),content:i(j5),defined:[],document:i(B5),flow:i($v),lazy:{},string:i(Kv),text:i(qv)};return r;function i(s){return a;function a(l){return a4(r,s,l)}}}function d4(e){for(;!Qf(e););return e}const Fc=/[\0\t\n\r]/g;function f4(){let e=1,t="",n=!0,r;return i;function i(s,a,l){const d=[];let c,u,h,m,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),h=0,t="",n&&(s.charCodeAt(0)===65279&&h++,n=void 0);h<s.length;){if(Fc.lastIndex=h,c=Fc.exec(s),m=c&&c.index!==void 0?c.index:s.length,p=s.charCodeAt(m),!c){t=s.slice(h);break}if(p===10&&h===m&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),h<m&&(d.push(s.slice(h,m)),e+=m-h),p){case 0:{d.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,d.push(-2);e++<u;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}h=m+1}return l&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const h4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function p4(e){return e.replace(h4,m4)}function m4(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return qf(n.slice(s?2:1),s?16:10)}return qs(n)||e}const oh={}.hasOwnProperty;function x4(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),g4(n)(d4(u4(n).document().write(f4()(e,t,!0))))}function g4(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Q),autolinkProtocol:F,autolinkEmail:F,atxHeading:s(Ot),blockQuote:s(ee),characterEscape:F,characterReference:F,codeFenced:s(Ce),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(Ce,a),codeText:s(De,a),codeTextData:F,data:F,codeFlowValue:F,definition:s(ue),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(hn),hardBreakEscape:s(qt),hardBreakTrailing:s(qt),htmlFlow:s(zt,a),htmlFlowData:F,htmlText:s(zt,a),htmlTextData:F,image:s(lt),label:a,link:s(Q),listItem:s(he),listItemValue:m,listOrdered:s(se,h),listUnordered:s(se),paragraph:s(Se),reference:T,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(Ot),strong:s(Oe),thematicBreak:s(vt)},exit:{atxHeading:d(),atxHeadingSequence:B,autolink:d(),autolinkEmail:de,autolinkProtocol:te,blockQuote:d(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:ke,characterReferenceMarkerNumeric:ke,characterReferenceValue:J,characterReference:X,codeFenced:d(v),codeFencedFence:g,codeFencedFenceInfo:p,codeFencedFenceMeta:x,codeFlowValue:L,codeIndented:d(y),codeText:d(I),codeTextData:L,data:L,definition:d(),definitionDestinationString:A,definitionLabelString:j,definitionTitleString:w,emphasis:d(),hardBreakEscape:d(D),hardBreakTrailing:d(D),htmlFlow:d(N),htmlFlowData:L,htmlText:d(P),htmlTextData:L,image:d(U),label:H,labelText:G,lineEnding:R,link:d(M),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:be,resourceDestinationString:b,resourceTitleString:W,resource:ne,setextHeading:d(E),setextHeadingLineSequence:O,setextHeadingText:C,strong:d(),thematicBreak:d()}};sh(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(z){let Y={type:"root",children:[]};const re={stack:[Y],tokenStack:[],config:t,enter:l,exit:c,buffer:a,resume:u,data:n},le=[];let fe=-1;for(;++fe<z.length;)if(z[fe][1].type==="listOrdered"||z[fe][1].type==="listUnordered")if(z[fe][0]==="enter")le.push(fe);else{const ze=le.pop();fe=i(z,ze,fe)}for(fe=-1;++fe<z.length;){const ze=t[z[fe][0]];oh.call(ze,z[fe][1].type)&&ze[z[fe][1].type].call(Object.assign({sliceSerialize:z[fe][2].sliceSerialize},re),z[fe][1])}if(re.tokenStack.length>0){const ze=re.tokenStack[re.tokenStack.length-1];(ze[1]||Ac).call(re,void 0,ze[0])}for(Y.position={start:Vt(z.length>0?z[0][1].start:{line:1,column:1,offset:0}),end:Vt(z.length>0?z[z.length-2][1].end:{line:1,column:1,offset:0})},fe=-1;++fe<t.transforms.length;)Y=t.transforms[fe](Y)||Y;return Y}function i(z,Y,re){let le=Y-1,fe=-1,ze=!1,_e,it,_t,Nt;for(;++le<=re;){const Ve=z[le];switch(Ve[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ve[0]==="enter"?fe++:fe--,Nt=void 0;break}case"lineEndingBlank":{Ve[0]==="enter"&&(_e&&!Nt&&!fe&&!_t&&(_t=le),Nt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Nt=void 0}if(!fe&&Ve[0]==="enter"&&Ve[1].type==="listItemPrefix"||fe===-1&&Ve[0]==="exit"&&(Ve[1].type==="listUnordered"||Ve[1].type==="listOrdered")){if(_e){let Dt=le;for(it=void 0;Dt--;){const Ze=z[Dt];if(Ze[1].type==="lineEnding"||Ze[1].type==="lineEndingBlank"){if(Ze[0]==="exit")continue;it&&(z[it][1].type="lineEndingBlank",ze=!0),Ze[1].type="lineEnding",it=Dt}else if(!(Ze[1].type==="linePrefix"||Ze[1].type==="blockQuotePrefix"||Ze[1].type==="blockQuotePrefixWhitespace"||Ze[1].type==="blockQuoteMarker"||Ze[1].type==="listItemIndent"))break}_t&&(!it||_t<it)&&(_e._spread=!0),_e.end=Object.assign({},it?z[it][1].start:Ve[1].end),z.splice(it||le,0,["exit",_e,Ve[2]]),le++,re++}if(Ve[1].type==="listItemPrefix"){const Dt={type:"listItem",_spread:!1,start:Object.assign({},Ve[1].start),end:void 0};_e=Dt,z.splice(le,0,["enter",Dt,Ve[2]]),le++,re++,_t=void 0,Nt=!0}}}return z[Y][1]._spread=ze,re}function s(z,Y){return re;function re(le){l.call(this,z(le),le),Y&&Y.call(this,le)}}function a(){this.stack.push({type:"fragment",children:[]})}function l(z,Y,re){this.stack[this.stack.length-1].children.push(z),this.stack.push(z),this.tokenStack.push([Y,re||void 0]),z.position={start:Vt(Y.start),end:void 0}}function d(z){return Y;function Y(re){z&&z.call(this,re),c.call(this,re)}}function c(z,Y){const re=this.stack.pop(),le=this.tokenStack.pop();if(le)le[0].type!==z.type&&(Y?Y.call(this,z,le[0]):(le[1]||Ac).call(this,z,le[0]));else throw new Error("Cannot close `"+z.type+"` ("+ir({start:z.start,end:z.end})+"): it’s not open");re.position.end=Vt(z.end)}function u(){return m5(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function m(z){if(this.data.expectingFirstListItemValue){const Y=this.stack[this.stack.length-2];Y.start=Number.parseInt(this.sliceSerialize(z),10),this.data.expectingFirstListItemValue=void 0}}function p(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.lang=z}function x(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.meta=z}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.value=z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.value=z.replace(/(\r?\n|\r)$/g,"")}function j(z){const Y=this.resume(),re=this.stack[this.stack.length-1];re.label=Y,re.identifier=Rn(this.sliceSerialize(z)).toLowerCase()}function w(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.title=z}function A(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.url=z}function B(z){const Y=this.stack[this.stack.length-1];if(!Y.depth){const re=this.sliceSerialize(z).length;Y.depth=re}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function O(z){const Y=this.stack[this.stack.length-1];Y.depth=this.sliceSerialize(z).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function F(z){const re=this.stack[this.stack.length-1].children;let le=re[re.length-1];(!le||le.type!=="text")&&(le=pt(),le.position={start:Vt(z.start),end:void 0},re.push(le)),this.stack.push(le)}function L(z){const Y=this.stack.pop();Y.value+=this.sliceSerialize(z),Y.position.end=Vt(z.end)}function R(z){const Y=this.stack[this.stack.length-1];if(this.data.atHardBreak){const re=Y.children[Y.children.length-1];re.position.end=Vt(z.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Y.type)&&(F.call(this,z),L.call(this,z))}function D(){this.data.atHardBreak=!0}function N(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.value=z}function P(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.value=z}function I(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.value=z}function M(){const z=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";z.type+="Reference",z.referenceType=Y,delete z.url,delete z.title}else delete z.identifier,delete z.label;this.data.referenceType=void 0}function U(){const z=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";z.type+="Reference",z.referenceType=Y,delete z.url,delete z.title}else delete z.identifier,delete z.label;this.data.referenceType=void 0}function G(z){const Y=this.sliceSerialize(z),re=this.stack[this.stack.length-2];re.label=p4(Y),re.identifier=Rn(Y).toLowerCase()}function H(){const z=this.stack[this.stack.length-1],Y=this.resume(),re=this.stack[this.stack.length-1];if(this.data.inReference=!0,re.type==="link"){const le=z.children;re.children=le}else re.alt=Y}function b(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.url=z}function W(){const z=this.resume(),Y=this.stack[this.stack.length-1];Y.title=z}function ne(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function be(z){const Y=this.resume(),re=this.stack[this.stack.length-1];re.label=Y,re.identifier=Rn(this.sliceSerialize(z)).toLowerCase(),this.data.referenceType="full"}function ke(z){this.data.characterReferenceType=z.type}function J(z){const Y=this.sliceSerialize(z),re=this.data.characterReferenceType;let le;re?(le=qf(Y,re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):le=qs(Y);const fe=this.stack[this.stack.length-1];fe.value+=le}function X(z){const Y=this.stack.pop();Y.position.end=Vt(z.end)}function te(z){L.call(this,z);const Y=this.stack[this.stack.length-1];Y.url=this.sliceSerialize(z)}function de(z){L.call(this,z);const Y=this.stack[this.stack.length-1];Y.url="mailto:"+this.sliceSerialize(z)}function ee(){return{type:"blockquote",children:[]}}function Ce(){return{type:"code",lang:null,meta:null,value:""}}function De(){return{type:"inlineCode",value:""}}function ue(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function hn(){return{type:"emphasis",children:[]}}function Ot(){return{type:"heading",depth:0,children:[]}}function qt(){return{type:"break"}}function zt(){return{type:"html",value:""}}function lt(){return{type:"image",title:null,url:"",alt:null}}function Q(){return{type:"link",title:null,url:"",children:[]}}function se(z){return{type:"list",ordered:z.type==="listOrdered",start:null,spread:z._spread,children:[]}}function he(z){return{type:"listItem",spread:z._spread,checked:null,children:[]}}function Se(){return{type:"paragraph",children:[]}}function Oe(){return{type:"strong",children:[]}}function pt(){return{type:"text",value:""}}function vt(){return{type:"thematicBreak"}}}function Vt(e){return{line:e.line,column:e.column,offset:e.offset}}function sh(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?sh(e,r):y4(e,r)}}function y4(e,t){let n;for(n in t)if(oh.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Ac(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ir({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ir({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ir({start:t.start,end:t.end})+") is still open")}function b4(e){const t=this;t.parser=n;function n(r){return x4(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function v4(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function k4(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
418
+ `}]}function w4(e,t){const n=t.value?t.value+`
419
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function S4(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function C4(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function j4(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Wn(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let a,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=s+1,l+=1,e.footnoteCounts.set(r,l);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,d);const c={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,c),e.applyData(t,c)}function T4(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function B4(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ah(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function E4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ah(e,t);const i={src:Wn(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function F4(e,t){const n={src:Wn(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function A4(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function L4(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ah(e,t);const i={href:Wn(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function I4(e,t){const n={href:Wn(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function D4(e,t,n){const r=e.all(t),i=n?R4(n):lh(t),s={},a=[];if(typeof t.checked=="boolean"){const u=r[0];let h;u&&u.type==="element"&&u.tagName==="p"?h=u:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const u=r[l];(i||l!==0||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
420
420
  `}),u.type==="element"&&u.tagName==="p"&&!i?a.push(...u.children):a.push(u)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
421
- `});const c={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,c),e.applyData(t,c)}function L4(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=oh(n[r])}return t}function oh(e){const t=e.spread;return t??e.children.length>1}function I4(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function D4(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function R4(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function M4(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function P4(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Us(t.children[1]),d=_f(t.children[t.children.length-1]);l&&d&&(a.position={start:l,end:d}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function O4(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,l=a?a.length:t.children.length;let d=-1;const c=[];for(;++d<l;){const h=t.children[d],m={},p=a?a[d]:void 0;p&&(m.align=p);let x={type:"element",tagName:s,properties:m,children:[]};h&&(x.children=e.all(h),e.patch(h,x),x=e.applyData(h,x)),c.push(x)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function z4(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Ac=9,Lc=32;function _4(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(Ic(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(Ic(t.slice(i),i>0,!1)),s.join("")}function Ic(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===Ac||s===Lc;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===Ac||s===Lc;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function N4(e,t){const n={type:"text",value:_4(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function V4(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const W4={blockquote:g4,break:y4,code:b4,delete:v4,emphasis:k4,footnoteReference:w4,heading:S4,html:C4,imageReference:j4,image:T4,inlineCode:B4,linkReference:E4,link:F4,listItem:A4,list:I4,paragraph:D4,root:R4,strong:M4,table:P4,tableCell:z4,tableRow:O4,text:N4,thematicBreak:V4,toml:Mr,yaml:Mr,definition:Mr,footnoteDefinition:Mr};function Mr(){}const sh=-1,gi=0,sr=1,si=2,Zs=3,Js=4,Qs=5,ea=6,ah=7,lh=8,H4=typeof self=="object"?self:globalThis,Dc=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new H4[e](t)},U4=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case gi:case sh:return n(a,i);case sr:{const l=n([],i);for(const d of a)l.push(r(d));return l}case si:{const l=n({},i);for(const[d,c]of a)l[r(d)]=r(c);return l}case Zs:return n(new Date(a),i);case Js:{const{source:l,flags:d}=a;return n(new RegExp(l,d),i)}case Qs:{const l=n(new Map,i);for(const[d,c]of a)l.set(r(d),r(c));return l}case ea:{const l=n(new Set,i);for(const d of a)l.add(r(d));return l}case ah:{const{name:l,message:d}=a;return n(Dc(l,d),i)}case lh:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(Dc(s,a),i)};return r},Rc=e=>U4(new Map,e)(0),Sn="",{toString:$4}={},{keys:G4}=Object,Xn=e=>{const t=typeof e;if(t!=="object"||!e)return[gi,t];const n=$4.call(e).slice(8,-1);switch(n){case"Array":return[sr,Sn];case"Object":return[si,Sn];case"Date":return[Zs,Sn];case"RegExp":return[Js,Sn];case"Map":return[Qs,Sn];case"Set":return[ea,Sn];case"DataView":return[sr,n]}return n.includes("Array")?[sr,n]:n.includes("Error")?[ah,n]:[si,n]},Pr=([e,t])=>e===gi&&(t==="function"||t==="symbol"),Y4=(e,t,n,r)=>{const i=(a,l)=>{const d=r.push(a)-1;return n.set(l,d),d},s=a=>{if(n.has(a))return n.get(a);let[l,d]=Xn(a);switch(l){case gi:{let u=a;switch(d){case"bigint":l=lh,u=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);u=null;break;case"undefined":return i([sh],a)}return i([l,u],a)}case sr:{if(d){let m=a;return d==="DataView"?m=new Uint8Array(a.buffer):d==="ArrayBuffer"&&(m=new Uint8Array(a)),i([d,[...m]],a)}const u=[],h=i([l,u],a);for(const m of a)u.push(s(m));return h}case si:{if(d)switch(d){case"BigInt":return i([d,a.toString()],a);case"Boolean":case"Number":case"String":return i([d,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const u=[],h=i([l,u],a);for(const m of G4(a))(e||!Pr(Xn(a[m])))&&u.push([s(m),s(a[m])]);return h}case Zs:return i([l,a.toISOString()],a);case Js:{const{source:u,flags:h}=a;return i([l,{source:u,flags:h}],a)}case Qs:{const u=[],h=i([l,u],a);for(const[m,p]of a)(e||!(Pr(Xn(m))||Pr(Xn(p))))&&u.push([s(m),s(p)]);return h}case ea:{const u=[],h=i([l,u],a);for(const m of a)(e||!Pr(Xn(m)))&&u.push(s(m));return h}}const{message:c}=a;return i([l,{name:d,message:c}],a)};return s},Mc=(e,{json:t,lossy:n}={})=>{const r=[];return Y4(!(t||n),!!t,new Map,r)(e),r},ai=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Rc(Mc(e,t)):structuredClone(e):(e,t)=>Rc(Mc(e,t));function K4(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function q4(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function X4(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||K4,r=e.options.footnoteBackLabel||q4,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let d=-1;for(;++d<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[d]);if(!c)continue;const u=e.all(c),h=String(c.identifier).toUpperCase(),m=Wn(h.toLowerCase());let p=0;const x=[],g=e.footnoteCounts.get(h);for(;g!==void 0&&++p<=g;){x.length>0&&x.push({type:"text",value:" "});let j=typeof n=="string"?n:n(d,p);typeof j=="string"&&(j={type:"text",value:j}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,p),className:["data-footnote-backref"]},children:Array.isArray(j)?j:[j]})}const v=u[u.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const j=v.children[v.children.length-1];j&&j.type==="text"?j.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...x)}else u.push(...x);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(u,!0)};e.patch(c,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...ai(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
421
+ `});const c={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,c),e.applyData(t,c)}function R4(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=lh(n[r])}return t}function lh(e){const t=e.spread;return t??e.children.length>1}function M4(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function P4(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function O4(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function z4(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _4(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=$s(t.children[1]),d=Wf(t.children[t.children.length-1]);l&&d&&(a.position={start:l,end:d}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function N4(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,l=a?a.length:t.children.length;let d=-1;const c=[];for(;++d<l;){const h=t.children[d],m={},p=a?a[d]:void 0;p&&(m.align=p);let x={type:"element",tagName:s,properties:m,children:[]};h&&(x.children=e.all(h),e.patch(h,x),x=e.applyData(h,x)),c.push(x)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function V4(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Lc=9,Ic=32;function W4(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(Dc(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(Dc(t.slice(i),i>0,!1)),s.join("")}function Dc(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===Lc||s===Ic;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===Lc||s===Ic;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function H4(e,t){const n={type:"text",value:W4(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function U4(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const $4={blockquote:v4,break:k4,code:w4,delete:S4,emphasis:C4,footnoteReference:j4,heading:T4,html:B4,imageReference:E4,image:F4,inlineCode:A4,linkReference:L4,link:I4,listItem:D4,list:M4,paragraph:P4,root:O4,strong:z4,table:_4,tableCell:V4,tableRow:N4,text:H4,thematicBreak:U4,toml:Mr,yaml:Mr,definition:Mr,footnoteDefinition:Mr};function Mr(){}const ch=-1,yi=0,sr=1,ai=2,Js=3,Qs=4,ea=5,ta=6,uh=7,dh=8,G4=typeof self=="object"?self:globalThis,Rc=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new G4[e](t)},Y4=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case yi:case ch:return n(a,i);case sr:{const l=n([],i);for(const d of a)l.push(r(d));return l}case ai:{const l=n({},i);for(const[d,c]of a)l[r(d)]=r(c);return l}case Js:return n(new Date(a),i);case Qs:{const{source:l,flags:d}=a;return n(new RegExp(l,d),i)}case ea:{const l=n(new Map,i);for(const[d,c]of a)l.set(r(d),r(c));return l}case ta:{const l=n(new Set,i);for(const d of a)l.add(r(d));return l}case uh:{const{name:l,message:d}=a;return n(Rc(l,d),i)}case dh:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(Rc(s,a),i)};return r},Mc=e=>Y4(new Map,e)(0),Sn="",{toString:K4}={},{keys:q4}=Object,Xn=e=>{const t=typeof e;if(t!=="object"||!e)return[yi,t];const n=K4.call(e).slice(8,-1);switch(n){case"Array":return[sr,Sn];case"Object":return[ai,Sn];case"Date":return[Js,Sn];case"RegExp":return[Qs,Sn];case"Map":return[ea,Sn];case"Set":return[ta,Sn];case"DataView":return[sr,n]}return n.includes("Array")?[sr,n]:n.includes("Error")?[uh,n]:[ai,n]},Pr=([e,t])=>e===yi&&(t==="function"||t==="symbol"),X4=(e,t,n,r)=>{const i=(a,l)=>{const d=r.push(a)-1;return n.set(l,d),d},s=a=>{if(n.has(a))return n.get(a);let[l,d]=Xn(a);switch(l){case yi:{let u=a;switch(d){case"bigint":l=dh,u=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);u=null;break;case"undefined":return i([ch],a)}return i([l,u],a)}case sr:{if(d){let m=a;return d==="DataView"?m=new Uint8Array(a.buffer):d==="ArrayBuffer"&&(m=new Uint8Array(a)),i([d,[...m]],a)}const u=[],h=i([l,u],a);for(const m of a)u.push(s(m));return h}case ai:{if(d)switch(d){case"BigInt":return i([d,a.toString()],a);case"Boolean":case"Number":case"String":return i([d,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const u=[],h=i([l,u],a);for(const m of q4(a))(e||!Pr(Xn(a[m])))&&u.push([s(m),s(a[m])]);return h}case Js:return i([l,a.toISOString()],a);case Qs:{const{source:u,flags:h}=a;return i([l,{source:u,flags:h}],a)}case ea:{const u=[],h=i([l,u],a);for(const[m,p]of a)(e||!(Pr(Xn(m))||Pr(Xn(p))))&&u.push([s(m),s(p)]);return h}case ta:{const u=[],h=i([l,u],a);for(const m of a)(e||!Pr(Xn(m)))&&u.push(s(m));return h}}const{message:c}=a;return i([l,{name:d,message:c}],a)};return s},Pc=(e,{json:t,lossy:n}={})=>{const r=[];return X4(!(t||n),!!t,new Map,r)(e),r},li=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Mc(Pc(e,t)):structuredClone(e):(e,t)=>Mc(Pc(e,t));function Z4(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function J4(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Q4(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Z4,r=e.options.footnoteBackLabel||J4,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let d=-1;for(;++d<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[d]);if(!c)continue;const u=e.all(c),h=String(c.identifier).toUpperCase(),m=Wn(h.toLowerCase());let p=0;const x=[],g=e.footnoteCounts.get(h);for(;g!==void 0&&++p<=g;){x.length>0&&x.push({type:"text",value:" "});let j=typeof n=="string"?n:n(d,p);typeof j=="string"&&(j={type:"text",value:j}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,p),className:["data-footnote-backref"]},children:Array.isArray(j)?j:[j]})}const v=u[u.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const j=v.children[v.children.length-1];j&&j.type==="text"?j.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...x)}else u.push(...x);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(u,!0)};e.patch(c,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...li(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
422
422
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
423
- `}]}}const ch=(function(e){if(e==null)return e6;if(typeof e=="function")return yi(e);if(typeof e=="object")return Array.isArray(e)?Z4(e):J4(e);if(typeof e=="string")return Q4(e);throw new Error("Expected function, string, or object as test")});function Z4(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ch(e[n]);return yi(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function J4(e){const t=e;return yi(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function Q4(e){return yi(t);function t(n){return n&&n.type===e}}function yi(e){return t;function t(n,r,i){return!!(t6(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function e6(){return!0}function t6(e){return e!==null&&typeof e=="object"&&"type"in e}const uh=[],n6=!0,Pc=!1,r6="skip";function i6(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=ch(i),a=r?-1:1;l(e,void 0,[])();function l(d,c,u){const h=d&&typeof d=="object"?d:{};if(typeof h.type=="string"){const p=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(d.type+(p?"<"+p+">":""))+")"})}return m;function m(){let p=uh,x,g,v;if((!t||s(d,c,u[u.length-1]||void 0))&&(p=o6(n(d,u)),p[0]===Pc))return p;if("children"in d&&d.children){const y=d;if(y.children&&p[0]!==r6)for(g=(r?y.children.length:-1)+a,v=u.concat(y);g>-1&&g<y.children.length;){const j=y.children[g];if(x=l(j,g,v)(),x[0]===Pc)return x;g=typeof x[1]=="number"?x[1]:g+a}}return p}}}function o6(e){return Array.isArray(e)?e:typeof e=="number"?[n6,e]:e==null?uh:[e]}function dh(e,t,n,r){let i,s,a;typeof t=="function"&&typeof n!="function"?(s=void 0,a=t,i=n):(s=t,a=n,i=r),i6(e,s,l,i);function l(d,c){const u=c[c.length-1],h=u?u.children.indexOf(d):void 0;return a(d,h,u)}}const Qo={}.hasOwnProperty,s6={};function a6(e,t){const n=t||s6,r=new Map,i=new Map,s=new Map,a={...W4,...n.handlers},l={all:c,applyData:c6,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:d,options:n,patch:l6,wrap:d6};return dh(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const h=u.type==="definition"?r:i,m=String(u.identifier).toUpperCase();h.has(m)||h.set(m,u)}}),l;function d(u,h){const m=u.type,p=l.handlers[m];if(Qo.call(l.handlers,m)&&p)return p(l,u,h);if(l.options.passThrough&&l.options.passThrough.includes(m)){if("children"in u){const{children:g,...v}=u,y=ai(v);return y.children=l.all(u),y}return ai(u)}return(l.options.unknownHandler||u6)(l,u,h)}function c(u){const h=[];if("children"in u){const m=u.children;let p=-1;for(;++p<m.length;){const x=l.one(m[p],u);if(x){if(p&&m[p-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=Oc(x.value)),!Array.isArray(x)&&x.type==="element")){const g=x.children[0];g&&g.type==="text"&&(g.value=Oc(g.value))}Array.isArray(x)?h.push(...x):h.push(x)}}}return h}}function l6(e,t){e.position&&(t.position=Ub(e))}function c6(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,ai(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function u6(e,t){const n=t.data||{},r="value"in t&&!(Qo.call(n,"hProperties")||Qo.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function d6(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
423
+ `}]}}const fh=(function(e){if(e==null)return r6;if(typeof e=="function")return bi(e);if(typeof e=="object")return Array.isArray(e)?e6(e):t6(e);if(typeof e=="string")return n6(e);throw new Error("Expected function, string, or object as test")});function e6(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=fh(e[n]);return bi(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function t6(e){const t=e;return bi(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function n6(e){return bi(t);function t(n){return n&&n.type===e}}function bi(e){return t;function t(n,r,i){return!!(i6(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function r6(){return!0}function i6(e){return e!==null&&typeof e=="object"&&"type"in e}const hh=[],o6=!0,Oc=!1,s6="skip";function a6(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=fh(i),a=r?-1:1;l(e,void 0,[])();function l(d,c,u){const h=d&&typeof d=="object"?d:{};if(typeof h.type=="string"){const p=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(d.type+(p?"<"+p+">":""))+")"})}return m;function m(){let p=hh,x,g,v;if((!t||s(d,c,u[u.length-1]||void 0))&&(p=l6(n(d,u)),p[0]===Oc))return p;if("children"in d&&d.children){const y=d;if(y.children&&p[0]!==s6)for(g=(r?y.children.length:-1)+a,v=u.concat(y);g>-1&&g<y.children.length;){const j=y.children[g];if(x=l(j,g,v)(),x[0]===Oc)return x;g=typeof x[1]=="number"?x[1]:g+a}}return p}}}function l6(e){return Array.isArray(e)?e:typeof e=="number"?[o6,e]:e==null?hh:[e]}function ph(e,t,n,r){let i,s,a;typeof t=="function"&&typeof n!="function"?(s=void 0,a=t,i=n):(s=t,a=n,i=r),a6(e,s,l,i);function l(d,c){const u=c[c.length-1],h=u?u.children.indexOf(d):void 0;return a(d,h,u)}}const es={}.hasOwnProperty,c6={};function u6(e,t){const n=t||c6,r=new Map,i=new Map,s=new Map,a={...$4,...n.handlers},l={all:c,applyData:f6,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:d,options:n,patch:d6,wrap:p6};return ph(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const h=u.type==="definition"?r:i,m=String(u.identifier).toUpperCase();h.has(m)||h.set(m,u)}}),l;function d(u,h){const m=u.type,p=l.handlers[m];if(es.call(l.handlers,m)&&p)return p(l,u,h);if(l.options.passThrough&&l.options.passThrough.includes(m)){if("children"in u){const{children:g,...v}=u,y=li(v);return y.children=l.all(u),y}return li(u)}return(l.options.unknownHandler||h6)(l,u,h)}function c(u){const h=[];if("children"in u){const m=u.children;let p=-1;for(;++p<m.length;){const x=l.one(m[p],u);if(x){if(p&&m[p-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=zc(x.value)),!Array.isArray(x)&&x.type==="element")){const g=x.children[0];g&&g.type==="text"&&(g.value=zc(g.value))}Array.isArray(x)?h.push(...x):h.push(x)}}}return h}}function d6(e,t){e.position&&(t.position=Yb(e))}function f6(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,li(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function h6(e,t){const n=t.data||{},r="value"in t&&!(es.call(n,"hProperties")||es.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function p6(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
424
424
  `});++r<e.length;)r&&n.push({type:"text",value:`
425
425
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
426
- `}),n}function Oc(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function zc(e,t){const n=a6(e,t),r=n.one(e,void 0),i=X4(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
427
- `},i),s}function f6(e,t){return e&&"run"in e?async function(n,r){const i=zc(n,{file:r,...t});await e.run(i,r)}:function(n,r){return zc(n,{file:r,...e||t})}}function _c(e){if(e)throw e}var to,Nc;function h6(){if(Nc)return to;Nc=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},s=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var u=e.call(c,"constructor"),h=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!h)return!1;var m;for(m in c);return typeof m>"u"||e.call(c,m)},a=function(c,u){n&&u.name==="__proto__"?n(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},l=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return to=function d(){var c,u,h,m,p,x,g=arguments[0],v=1,y=arguments.length,j=!1;for(typeof g=="boolean"&&(j=g,g=arguments[1]||{},v=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});v<y;++v)if(c=arguments[v],c!=null)for(u in c)h=l(g,u),m=l(c,u),g!==m&&(j&&m&&(s(m)||(p=i(m)))?(p?(p=!1,x=h&&i(h)?h:[]):x=h&&s(h)?h:{},a(g,{name:u,newValue:d(j,x,m)})):typeof m<"u"&&a(g,{name:u,newValue:m}));return g},to}var p6=h6();const no=zf(p6);function es(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function m6(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);l(null,...i);function l(d,...c){const u=e[++s];let h=-1;if(d){a(d);return}for(;++h<i.length;)(c[h]===null||c[h]===void 0)&&(c[h]=i[h]);i=c,u?x6(u,l)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function x6(e,t){let n;return r;function r(...a){const l=e.length>a.length;let d;l&&a.push(i);try{d=e.apply(this,a)}catch(c){const u=c;if(l&&n)throw u;return i(u)}l||(d&&d.then&&typeof d.then=="function"?d.then(s,i):d instanceof Error?i(d):s(d))}function i(a,...l){n||(n=!0,t(a,...l))}function s(a){i(null,a)}}const jt={basename:g6,dirname:y6,extname:b6,join:v6,sep:"/"};function g6(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');br(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function y6(e){if(br(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function b6(e){br(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),l===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function v6(...e){let t=-1,n;for(;++t<e.length;)br(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":k6(n)}function k6(e){br(e);const t=e.codePointAt(0)===47;let n=w6(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function w6(e,t){let n="",r=0,i=-1,s=0,a=-1,l,d;for(;++a<=e.length;){if(a<e.length)l=e.codePointAt(a);else{if(l===47)break;l=47}if(l===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,s=0}else l===46&&s>-1?s++:s=-1}return n}function br(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const S6={cwd:C6};function C6(){return"/"}function ts(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function j6(e){if(typeof e=="string")e=new URL(e);else if(!ts(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return T6(e)}function T6(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const ro=["history","path","basename","stem","extname","dirname"];class fh{constructor(t){let n;t?ts(t)?n={path:t}:typeof t=="string"||B6(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":S6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ro.length;){const s=ro[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)ro.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?jt.basename(this.path):void 0}set basename(t){oo(t,"basename"),io(t,"basename"),this.path=jt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?jt.dirname(this.path):void 0}set dirname(t){Vc(this.basename,"dirname"),this.path=jt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?jt.extname(this.path):void 0}set extname(t){if(io(t,"extname"),Vc(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=jt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ts(t)&&(t=j6(t)),oo(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?jt.basename(this.path,this.extname):void 0}set stem(t){oo(t,"stem"),io(t,"stem"),this.path=jt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Ge(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function io(e,t){if(e&&e.includes(jt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+jt.sep+"`")}function oo(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Vc(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function B6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const E6=(function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),F6={}.hasOwnProperty;class ta extends E6{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=m6()}copy(){const t=new ta;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(no(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(lo("data",this.frozen),this.namespace[t]=n,this):F6.call(this.namespace,t)&&this.namespace[t]||void 0:t?(lo("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Or(t),r=this.parser||this.Parser;return so("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),so("process",this.parser||this.Parser),ao("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const l=Or(t),d=r.parse(l);r.run(d,l,function(u,h,m){if(u||!h||!m)return c(u);const p=h,x=r.stringify(p,m);I6(x)?m.value=x:m.result=x,c(u,m)});function c(u,h){u||!h?a(u):s?s(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),so("processSync",this.parser||this.Parser),ao("processSync",this.compiler||this.Compiler),this.process(t,i),Hc("processSync","process",n),r;function i(s,a){n=!0,_c(s),r=a}}run(t,n,r){Wc(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,l){const d=Or(n);i.run(t,d,c);function c(u,h,m){const p=h||t;u?l(u):a?a(p):r(void 0,p,m)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),Hc("runSync","run",r),i;function s(a,l){_c(a),i=l,r=!0}}stringify(t,n){this.freeze();const r=Or(n),i=this.compiler||this.Compiler;return ao("stringify",i),Wc(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(lo("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")d(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...h]=c;d(u,h)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(c.plugins),c.settings&&(i.settings=no(!0,i.settings,c.settings))}function l(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const h=c[u];s(h)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function d(c,u){let h=-1,m=-1;for(;++h<r.length;)if(r[h][0]===c){m=h;break}if(m===-1)r.push([c,...u]);else if(u.length>0){let[p,...x]=u;const g=r[m][1];es(g)&&es(p)&&(p=no(!0,g,p)),r[m]=[c,p,...x]}}}}const A6=new ta().freeze();function so(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ao(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function lo(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Wc(e){if(!es(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Hc(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Or(e){return L6(e)?e:new fh(e)}function L6(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function I6(e){return typeof e=="string"||D6(e)}function D6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const R6="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Uc=[],$c={allowDangerousHtml:!0},M6=/^(https?|ircs?|mailto|xmpp)$/i,P6=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function O6(e){const t=z6(e),n=_6(e);return N6(t.runSync(t.parse(n),n),e)}function z6(e){const t=e.rehypePlugins||Uc,n=e.remarkPlugins||Uc,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...$c}:$c;return A6().use(x4).use(n).use(f6,r).use(t)}function _6(e){const t=e.children||"",n=new fh;return typeof t=="string"&&(n.value=t),n}function N6(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,d=t.urlTransform||V6;for(const u of P6)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+R6+u.id,void 0);return dh(e,c),qb(e,{Fragment:o.Fragment,components:i,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function c(u,h,m){if(u.type==="raw"&&m&&typeof h=="number")return a?m.children.splice(h,1):m.children[h]={type:"text",value:u.value},h;if(u.type==="element"){let p;for(p in Ji)if(Object.hasOwn(Ji,p)&&Object.hasOwn(u.properties,p)){const x=u.properties[p],g=Ji[p];(g===null||g.includes(u.tagName))&&(u.properties[p]=d(String(x||""),p,u))}}if(u.type==="element"){let p=n?!n.includes(u.tagName):s?s.includes(u.tagName):!1;if(!p&&r&&typeof h=="number"&&(p=!r(u,h,m)),p&&m&&typeof h=="number")return l&&u.children?m.children.splice(h,1,...u.children):m.children.splice(h,1),h}}}function V6(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||M6.test(e.slice(0,t))?e:""}const W6={blue:{solid:"#0685FF",ring:"#0685FF"},purple:{solid:"#7700CC",ring:"#7700CC"}};function H6({items:e,allowMultiple:t=!1,defaultOpenIds:n=[],colorScheme:r="blue",answerType:i="HTML",...s}){const a=W6[r],[l,d]=k.useState(new Set(n)),c=u=>{d(h=>{const m=new Set(h);return m.has(u)?m.delete(u):(t||m.clear(),m.add(u)),m})};return o.jsx(f.Box,{display:"flex",flexDirection:"column",gap:"4",...s,children:e.map(u=>{const h=l.has(u.id);return o.jsxs(f.Box,{bg:"bg.primary",border:"1px solid",borderColor:"border",borderRadius:"card",overflow:"hidden",transition:"border-color 0.2s",_hover:{borderColor:h?a.ring:"border"},children:[o.jsxs(f.Box,{as:"button",w:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4",px:"6",py:"5",bg:"transparent",border:"none",cursor:"pointer",textAlign:"left",onClick:()=>c(u.id),"aria-expanded":h,children:[o.jsx(f.Box,{fontSize:"lg",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",flex:"1",lineHeight:"short",children:u.question}),o.jsx(f.Box,{flexShrink:0,w:"10",h:"10",borderRadius:"full",display:"flex",alignItems:"center",justifyContent:"center",transition:"background 0.2s, border-color 0.2s, color 0.2s","aria-hidden":"true",style:{border:h?"none":"1.5px solid var(--medix-form-text)",background:h?a.solid:"transparent",color:h?"#ffffff":"inherit",flexShrink:0},children:h?o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:o.jsx("rect",{x:"3",y:"8.25",width:"12",height:"1.5",rx:"0.75",fill:" var(--medix-form-text)"})}):o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:[o.jsx("rect",{x:"3",y:"8.25",width:"12",height:"1.5",rx:"0.75",fill:" var(--medix-form-text)"}),o.jsx("rect",{x:"8.25",y:"3",width:"1.5",height:"12",rx:"0.75",fill:" var(--medix-form-text)"})]})})]}),o.jsx(f.Box,{overflow:"hidden",maxH:h?"800px":"0px",opacity:h?1:0,transition:"max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease",children:o.jsx(f.Box,{px:"6",pb:"6",pt:"0",fontSize:"md",color:"text.body",fontFamily:"var(--font-body)",lineHeight:"loose",children:typeof u.answer=="string"?i==="MD"?o.jsx(O6,{children:u.answer}):o.jsx("span",{dangerouslySetInnerHTML:{__html:vb.sanitize(u.answer)}}):u.answer})})]},u.id)})})}function U6({quote:e,authorName:t,authorTitle:n,authorAvatar:r,rating:i,...s}){return o.jsxs(f.Box,{bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",p:"5",display:"flex",flexDirection:"column",gap:"4",boxShadow:"none",_dark:{boxShadow:"none"},...s,children:[i!==void 0&&o.jsx(f.Box,{display:"flex",gap:"0.5",children:Array.from({length:5}).map((a,l)=>o.jsx(f.Box,{as:"span",fontSize:"sm",color:l<i?"#F59E0B":"text.muted",children:"★"},l))}),o.jsxs(f.Box,{as:"blockquote",m:"0",fontSize:"sm",color:"text.body",fontFamily:"var(--font-body)",lineHeight:"loose",fontStyle:"italic",children:['"',e,'"']}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"3",mt:"auto",children:[r?o.jsx("img",{src:r,alt:t,style:{width:36,height:36,borderRadius:"50%",objectFit:"cover"}}):o.jsx(f.Box,{w:"9",h:"9",borderRadius:"full",bg:"blue.500",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"sm",fontWeight:"semibold",color:"white",flexShrink:0,children:t.charAt(0).toUpperCase()}),o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"sm",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-body)",children:t}),n&&o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:n})]})]})]})}const $6={blue:{solid:"#0685FF",token:"blue.500"},purple:{solid:"#7700CC",token:"purple.500"}};function G6(e){if(!e)return null;try{const t=new Date(e);return isNaN(t.getTime())?null:{day:String(t.getUTCDate()),weekday:t.toLocaleDateString("en-US",{weekday:"short",timeZone:"UTC"}).toUpperCase()}}catch{return null}}function Y6({title:e,excerpt:t,category:n,date:r,coverImage:i,href:s,onClick:a,colorScheme:l="blue",...d}){const c=!!(s||a),u=G6(r),h=$6[l],m={display:"block",textDecoration:"none",background:"transparent",border:"none",padding:0,cursor:c?"pointer":"default",textAlign:"left"},p=o.jsxs(f.Box,{bg:"bg.primary",borderRadius:"card",overflow:"hidden",transition:"transform 0.22s ease, box-shadow 0.22s ease",_dark:{bg:"bg.primary"},_hover:c?{transform:"translateY(-4px)"}:void 0,...d,children:[o.jsxs(f.Box,{position:"relative",overflow:"hidden",children:[i?o.jsx("img",{src:i,alt:e,style:{width:"100%",height:300,objectFit:"cover",display:"block",borderRadius:"20px"}}):o.jsx(f.Box,{borderRadius:"card",h:"300px",style:{background:"linear-gradient(135deg, #0685FF 0%, #7700CC 100%)",borderRadius:"20px"}}),u&&o.jsxs(f.Box,{position:"absolute",bottom:"3",right:"3",bg:"white",borderRadius:"10px",px:"3",py:"2",display:"flex",flexDirection:"column",alignItems:"center",minW:"44px",border:"1px solid",borderColor:"border",boxShadow:"none",children:[o.jsx(f.Box,{style:{fontSize:22,fontWeight:700,color:h.solid,lineHeight:1,fontFamily:"var(--font-heading)"},children:u.day}),o.jsx(f.Box,{style:{fontSize:10,fontWeight:600,color:"#6B7280",letterSpacing:"0.08em",marginTop:2,fontFamily:"var(--font-body)"},children:u.weekday})]})]}),o.jsxs(f.Box,{px:"0",pt:"3",pb:"4",children:[n&&o.jsx(f.Box,{display:"inline-flex",alignItems:"center",px:"3",py:"1",mb:"3",borderRadius:"full",bg:h.token,color:"white",fontSize:"xs",fontWeight:"medium",fontFamily:"var(--font-body)",letterSpacing:"wide",children:n}),o.jsx(f.Box,{fontSize:"md",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",lineHeight:"snug",mb:t?"2":"0",children:e}),t&&o.jsx(f.Box,{fontSize:"sm",color:"text.body",fontFamily:"var(--font-body)",lineHeight:"relaxed",style:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:t})]})]});return s?o.jsx("a",{href:s,style:m,onClick:a,children:p}):a?o.jsx("button",{type:"button",style:m,onClick:a,children:p}):p}function K6({columns:e,data:t,rowKey:n="id",isLoading:r=!1,emptyMessage:i="No data available",sortable:s=!1,sortKey:a,sortDirection:l="asc",onSort:d,striped:c=!0,onRowClick:u,caption:h,enablePagination:m=!1,pageSize:p=10,page:x,onPageChange:g,enableSearch:v=!1,searchPlaceholder:y="Search table...",searchQuery:j,onSearchChange:w,style:A,className:B,stickyFirstColumn:C=!1}){const[O,E]=k.useState(""),F=j??O,[L,R]=k.useState(1),D=x??L,[N,P]=k.useState(a),[I,M]=k.useState(l),U=a??N,G=a?l:I,H=X=>{E(X),R(1),w==null||w(X)},b=X=>{const te=U===X&&G==="asc"?"desc":"asc";P(X),M(te),d==null||d(X,te)},W=X=>{R(X),g==null||g(X)},ne=k.useMemo(()=>{if(!F.trim())return t;const X=F.toLowerCase().trim();return t.filter(te=>e.some(de=>{const ee=te[de.key];return ee==null?!1:String(ee).toLowerCase().includes(X)}))},[t,e,F]),T=k.useMemo(()=>!U||d?ne:[...ne].sort((X,te)=>{const de=X[U],ee=te[U],Ce=String(de??""),De=String(ee??""),ue=Ce.localeCompare(De,void 0,{numeric:!0,sensitivity:"base"});return G==="asc"?ue:-ue}),[ne,U,G,d]),be=T.length,ke=k.useMemo(()=>{if(!m)return T;const X=(D-1)*p;return T.slice(X,X+p)},[T,m,D,p]),J=({colKey:X})=>U!==X?o.jsx(f.Text,{as:"span",opacity:.3,ml:"1",fontSize:"xs",children:"↕"}):o.jsx(f.Text,{as:"span",ml:"1",color:"text.heading",fontSize:"xs",children:G==="asc"?"↑":"↓"});return o.jsxs(f.Box,{border:"1px solid",borderColor:"border",borderRadius:"card",overflow:"hidden",bg:"bg.surface",boxShadow:"none",_dark:{boxShadow:"none"},style:A,className:B,children:[v&&o.jsx(f.Box,{p:"4",borderBottom:"1px solid",borderColor:"border",bg:"bg.surface",children:o.jsx(as,{placeholder:y,value:F,onChange:X=>H(X.target.value),maxW:"360px"})}),o.jsx(f.Box,{overflowX:"auto",children:o.jsxs(f.Box,{as:"table",w:"full",style:{borderCollapse:"collapse"},"aria-label":h,children:[h&&o.jsx("caption",{style:{display:"none"},children:h}),o.jsx(f.Box,{as:"thead",children:o.jsx(f.Box,{as:"tr",bg:"bg.subtle",borderBottom:"1px solid",borderColor:"border",children:e.map((X,te)=>{const de=C&&te===0;return o.jsx(f.Box,{as:"th",py:"3",px:"4",textAlign:X.align??"left",minW:X.minWidth,fontSize:"xs",fontWeight:"600",letterSpacing:"0.05em",textTransform:"uppercase",color:"text.muted",fontFamily:"var(--font-body)",whiteSpace:"nowrap",userSelect:"none",cursor:X.sortable||s?"pointer":"default",_hover:X.sortable||s?{color:"text.heading"}:void 0,onClick:()=>X.sortable||s?b(X.key):void 0,"aria-sort":U===X.key?G==="asc"?"ascending":"descending":void 0,position:de?"sticky":void 0,left:de?0:void 0,zIndex:de?3:void 0,bg:de?"bg.subtle":void 0,borderRight:de?"1px solid":void 0,borderColor:de?"border":void 0,boxShadow:de?"2px 0 4px rgba(0, 0, 0, 0.05)":void 0,children:o.jsxs(f.Flex,{as:"span",align:"center",justify:X.align==="right"?"flex-end":X.align==="center"?"center":"flex-start",children:[X.label,(X.sortable||s)&&o.jsx(J,{colKey:X.key})]})},X.key)})})}),o.jsx(f.Box,{as:"tbody",children:r?Array.from({length:5}).map((X,te)=>o.jsx(f.Box,{as:"tr",borderBottom:"1px solid",borderColor:"border",children:e.map(de=>o.jsx(f.Box,{as:"td",py:"3.5",px:"4",children:o.jsx(f.Box,{h:"4",bg:"bg.subtle",borderRadius:"full",w:`${60+Math.random()*30}%`,style:{animation:"medix-shimmer 1.5s infinite"}})},de.key))},te)):ke.length===0?o.jsx(f.Box,{as:"tr",children:o.jsx("td",{colSpan:e.length,style:{textAlign:"center",padding:"48px 16px"},children:o.jsx(f.Text,{color:"text.muted",fontFamily:"var(--font-body)",fontSize:"sm",children:i})})}):ke.map((X,te)=>{const de=String(X[n]??te);return o.jsx(f.Box,{as:"tr",onClick:()=>u==null?void 0:u(X,te),bg:c&&te%2===1?"bg.subtle":"transparent",borderBottom:"1px solid",borderColor:"border",cursor:u?"pointer":"default",transition:"background 0.15s ease",_hover:{bg:"bg.subtle"},children:e.map((ee,Ce)=>{const De=C&&Ce===0;return o.jsx(f.Box,{as:"td",py:"3.5",px:"4",textAlign:ee.align??"left",fontSize:"sm",color:"text.body",fontFamily:"var(--font-body)",verticalAlign:"middle",position:De?"sticky":void 0,left:De?0:void 0,zIndex:De?2:void 0,bg:De?c&&te%2===1?"bg.subtle":"bg.surface":void 0,borderRight:De?"1px solid":void 0,borderColor:De?"border":void 0,boxShadow:De?"2px 0 4px rgba(0, 0, 0, 0.05)":void 0,children:ee.render?ee.render(X[ee.key],X,te):String(X[ee.key]??"—")},ee.key)})},de)})})]})}),m&&o.jsxs(f.Flex,{p:"4",borderTop:"1px solid",borderColor:"border",bg:"bg.surface",align:"center",justify:"space-between",flexWrap:"wrap",gap:"4",children:[o.jsxs(f.Text,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:["Showing ",be===0?0:(D-1)*p+1," to"," ",Math.min(D*p,be)," of ",be," entries"]}),o.jsx(bf,{total:be,pageSize:p,currentPage:D,onChange:W,compact:!0})]})]})}function q6({name:e,specialty:t,location:n,avatar:r,rating:i,reviewCount:s,experience:a,consultationFee:l,isVerified:d=!1,isAvailable:c=!1,availabilityLabel:u="Available",onBookClick:h,onViewClick:m,variant:p="standard",...x}){return p==="featured"?o.jsxs(f.Box,{bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",overflow:"hidden",transition:"all 0.2s ease",_hover:{transform:"translateY(-2px)",borderColor:"blue.200"},display:"flex",flexDirection:"column",...x,children:[r?o.jsx("img",{src:r,alt:e,style:{width:"100%",height:240,objectFit:"cover",display:"block"}}):o.jsx(f.Box,{w:"100%",h:"240px",bg:"blue.100",display:"flex",alignItems:"center",justifyContent:"center",children:o.jsx(f.Box,{fontSize:"4xl",fontWeight:"bold",color:"blue.500",children:e.charAt(0)})}),o.jsxs(f.Box,{p:"5",display:"flex",flexDirection:"column",gap:"4",children:[o.jsxs(f.Box,{children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",flexWrap:"wrap",children:[o.jsx(f.Box,{fontSize:"xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",children:e}),d&&o.jsx(At,{label:"This practitioner's identity has been verified by MedixDeck",placement:"top",children:o.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{cursor:"pointer",flexShrink:0},children:[o.jsx("path",{d:"M10.5213 2.62368C11.3147 1.75255 12.6853 1.75255 13.4787 2.62368L14.4989 3.74391C14.8998 4.18418 15.4761 4.42288 16.071 4.39508L17.5845 4.32435C18.7614 4.26934 19.7307 5.23857 19.6757 6.41554L19.6049 7.92905C19.5771 8.52388 19.8158 9.10016 20.2561 9.50111L21.3763 10.5213C22.2475 11.3147 22.2475 12.6853 21.3763 13.4787L20.2561 14.4989C19.8158 14.8998 19.5771 15.4761 19.6049 16.071L19.6757 17.5845C19.7307 18.7614 18.7614 19.7307 17.5845 19.6757L16.071 19.6049C15.4761 19.5771 14.8998 19.8158 14.4989 20.2561L13.4787 21.3763C12.6853 22.2475 11.3147 22.2475 10.5213 21.3763L9.50111 20.2561C9.10016 19.8158 8.52388 19.5771 7.92905 19.6049L6.41554 19.6757C5.23857 19.7307 4.26934 18.7614 4.32435 17.5845L4.39508 16.071C4.42288 15.4761 4.18418 14.8998 3.74391 14.4989L2.62368 13.4787C1.75255 12.6853 1.75255 11.3147 2.62368 10.5213L3.74391 9.50111C4.18418 9.10016 4.42288 8.52388 4.39508 7.92905L4.32435 6.41554C4.26934 5.23857 5.23857 4.26934 6.41554 4.32435L7.92905 4.39508C8.52388 4.42288 9.10016 4.18418 9.50111 3.74391L10.5213 2.62368Z",fill:"#0685FF"}),o.jsx("path",{d:"M10.5 15.5L6.5 11.5L7.91 10.09L10.5 12.67L16.09 7.09L17.5 8.5L10.5 15.5Z",fill:"white"})]})})]}),o.jsxs(f.Box,{fontSize:"md",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:[t,n?` • ${n}`:""]})]}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"4",mt:"1",children:[c&&o.jsxs(f.Box,{display:"inline-flex",alignItems:"center",gap:"2",px:"3",py:"1.5",bg:"status.success.tint",color:"status.success",borderRadius:"md",fontSize:"sm",fontWeight:"medium",children:[o.jsx(f.Box,{w:"1.5",h:"1.5",borderRadius:"full",bg:"status.success"}),u]}),c&&a&&o.jsx(f.Box,{w:"1px",h:"20px",bg:"border"}),a&&o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",fontSize:"sm",color:"text.heading",children:[o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",color:"var(--chakra-colors-text-muted)",children:[o.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),o.jsx("path",{d:"M9 12l2 2 4-4"})]}),a]})]}),o.jsx(f.Box,{borderTop:"1px solid",borderColor:"border",my:"1"}),o.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[l&&o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:"Consultation fee"}),o.jsx(f.Box,{fontSize:"xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",children:l})]}),o.jsxs(f.Box,{display:"flex",gap:"3",alignItems:"center",children:[m&&o.jsx(f.Box,{as:"button",px:"3",py:"2",fontSize:"md",fontWeight:"medium",fontFamily:"var(--font-body)",bg:"transparent",color:"text.body",border:"none",cursor:"pointer",transition:"all 0.15s",_hover:{color:"blue.500"},onClick:m,children:"view"}),h&&o.jsx(f.Box,{as:"button",px:"5",py:"2.5",fontSize:"sm",fontWeight:"semibold",fontFamily:"var(--font-body)",bg:"blue.500",color:"white",borderRadius:"md",border:"none",cursor:"pointer",transition:"all 0.15s",_hover:{bg:"blue.600"},onClick:h,children:"Consult Now"})]})]})]})]}):p==="compact"?o.jsxs(f.Box,{bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",p:"5",display:"flex",flexDirection:"column",gap:"4",transition:"all 0.2s ease",_hover:{transform:"translateY(-2px)",borderColor:"blue.200"},...x,children:[o.jsxs(f.Box,{display:"flex",gap:"4",alignItems:"flex-start",justifyContent:"space-between",children:[o.jsxs(f.Box,{display:"flex",gap:"4",children:[o.jsx(f.Box,{flexShrink:0,children:r?o.jsx("img",{src:r,alt:e,style:{width:64,height:64,borderRadius:"50%",objectFit:"cover",display:"block"}}):o.jsx(f.Box,{w:"64px",h:"64px",borderRadius:"full",bg:"blue.500",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"2xl",fontWeight:"bold",color:"white",children:e.charAt(0)})}),o.jsxs(f.Box,{pt:"1",children:[o.jsx(f.Box,{fontSize:"xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",children:e}),o.jsxs(f.Box,{fontSize:"md",color:"text.muted",fontFamily:"var(--font-body)",children:[t,n&&p!=="compact"?` • ${n}`:""]})]})]}),m&&o.jsx(f.Box,{as:"button",fontSize:"md",fontWeight:"medium",fontFamily:"var(--font-body)",bg:"transparent",color:"text.heading",border:"none",cursor:"pointer",_hover:{color:"blue.500"},onClick:m,pt:"1",children:"View"})]}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1.5",fontSize:"md",color:"text.muted",fontFamily:"var(--font-body)",children:[o.jsx(f.Box,{as:"span",color:"status.warning",mt:"-2px",children:o.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"})})}),o.jsxs(f.Box,{as:"span",color:"text.heading",mr:"1",children:[(i==null?void 0:i.toFixed(1))||"New"," ",s?`(${s})`:""]}),n&&o.jsxs(f.Box,{as:"span",children:[" • ",n]}),a&&o.jsxs(f.Box,{as:"span",children:[" • ",a]})]}),o.jsx(f.Box,{borderTop:"1px solid",borderColor:"border",mt:"1"}),o.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"1",children:[l&&o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:"Consultation fee"}),o.jsx(f.Box,{fontSize:"xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",children:l})]}),h&&o.jsx(f.Box,{as:"button",px:"5",py:"2.5",fontSize:"sm",fontWeight:"semibold",fontFamily:"var(--font-body)",bg:"blue.500",color:"white",borderRadius:"md",border:"none",cursor:"pointer",transition:"all 0.15s",_hover:{bg:"blue.600"},onClick:h,children:"Consult Now"})]})]}):o.jsxs(f.Box,{bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",p:"5",display:"flex",flexDirection:"column",gap:"4",transition:"all 0.2s ease",_hover:{transform:"translateY(-2px)",borderColor:"blue.200"},...x,children:[o.jsxs(f.Box,{display:"flex",gap:"4",alignItems:"flex-start",justifyContent:"space-between",children:[o.jsxs(f.Box,{display:"flex",gap:"4",minW:"0",flex:"1",children:[o.jsx(f.Box,{flexShrink:0,children:r?o.jsx("img",{src:r,alt:e,style:{width:64,height:64,borderRadius:"50%",objectFit:"cover",display:"block"}}):o.jsx(f.Box,{w:"64px",h:"64px",borderRadius:"full",bg:"blue.500",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"2xl",fontWeight:"bold",color:"white",children:e.charAt(0)})}),o.jsxs(f.Box,{pt:"1",minW:"0",flex:"1",children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",minW:"0",children:[o.jsx(f.Box,{fontSize:"xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minW:"0",flex:"1",children:e}),d&&o.jsx(At,{label:"This practitioner's identity has been verified by MedixDeck",placement:"top",children:o.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{cursor:"pointer",flexShrink:0},children:[o.jsx("path",{d:"M10.5213 2.62368C11.3147 1.75255 12.6853 1.75255 13.4787 2.62368L14.4989 3.74391C14.8998 4.18418 15.4761 4.42288 16.071 4.39508L17.5845 4.32435C18.7614 4.26934 19.7307 5.23857 19.6757 6.41554L19.6049 7.92905C19.5771 8.52388 19.8158 9.10016 20.2561 9.50111L21.3763 10.5213C22.2475 11.3147 22.2475 12.6853 21.3763 13.4787L20.2561 14.4989C19.8158 14.8998 19.5771 15.4761 19.6049 16.071L19.6757 17.5845C19.7307 18.7614 18.7614 19.7307 17.5845 19.6757L16.071 19.6049C15.4761 19.5771 14.8998 19.8158 14.4989 20.2561L13.4787 21.3763C12.6853 22.2475 11.3147 22.2475 10.5213 21.3763L9.50111 20.2561C9.10016 19.8158 8.52388 19.5771 7.92905 19.6049L6.41554 19.6757C5.23857 19.7307 4.26934 18.7614 4.32435 17.5845L4.39508 16.071C4.42288 15.4761 4.18418 14.8998 3.74391 14.4989L2.62368 13.4787C1.75255 12.6853 1.75255 11.3147 2.62368 10.5213L3.74391 9.50111C4.18418 9.10016 4.42288 8.52388 4.39508 7.92905L4.32435 6.41554C4.26934 5.23857 5.23857 4.26934 6.41554 4.32435L7.92905 4.39508C8.52388 4.42288 9.10016 4.18418 9.50111 3.74391L10.5213 2.62368Z",fill:"#0685FF"}),o.jsx("path",{d:"M10.5 15.5L6.5 11.5L7.91 10.09L10.5 12.67L16.09 7.09L17.5 8.5L10.5 15.5Z",fill:"white"})]})})]}),o.jsxs(f.Box,{fontSize:"md",color:"text.muted",fontFamily:"var(--font-body)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:[t,n?` • ${n}`:""]})]})]}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1",fontSize:"md",color:"text.heading",fontFamily:"var(--font-body)",pt:"1",children:[o.jsx(f.Box,{as:"span",color:"status.warning",mt:"-2px",children:o.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"})})}),(i==null?void 0:i.toFixed(1))||"New"," ",s?o.jsxs(f.Box,{as:"span",color:"text.muted",children:["(",s,")"]}):null]})]}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"4",mt:"1",children:[c&&o.jsxs(f.Box,{display:"inline-flex",alignItems:"center",gap:"2",px:"3",py:"1.5",bg:"status.success.tint",color:"status.success",borderRadius:"md",fontSize:"sm",fontWeight:"medium",children:[o.jsx(f.Box,{w:"1.5",h:"1.5",borderRadius:"full",bg:"status.success"}),u]}),c&&a&&o.jsx(f.Box,{w:"1px",h:"20px",bg:"border"}),a&&o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",fontSize:"sm",color:"text.heading",children:[o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",color:"var(--chakra-colors-text-muted)",children:[o.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),o.jsx("path",{d:"M9 12l2 2 4-4"})]}),a]})]}),o.jsx(f.Box,{borderTop:"1px solid",borderColor:"border",my:"1"}),o.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"1",children:[l&&o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:"Consultation fee"}),o.jsx(f.Box,{fontSize:"xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",children:l})]}),o.jsxs(f.Box,{display:"flex",gap:"3",alignItems:"center",children:[m&&o.jsx(f.Box,{as:"button",px:"4",py:"2",fontSize:"md",fontWeight:"medium",fontFamily:"var(--font-body)",bg:"transparent",color:"text.heading",border:"1px solid",borderColor:"border",borderRadius:"md",cursor:"pointer",transition:"all 0.15s",_hover:{borderColor:"blue.400",color:"blue.500"},onClick:m,children:"view"}),h&&o.jsx(f.Box,{as:"button",px:"5",py:"2.5",fontSize:"sm",fontWeight:"semibold",fontFamily:"var(--font-body)",bg:"blue.500",color:"white",borderRadius:"md",border:"none",cursor:"pointer",transition:"all 0.15s",_hover:{bg:"blue.600"},onClick:h,children:"Consult Now"})]})]})]})}const X6={normal:{bg:"color-mix(in srgb, var(--chakra-colors-status-success) 8%, transparent)",indicator:"status.success",border:"color-mix(in srgb, var(--chakra-colors-status-success) 20%, transparent)",text:"status.success",ariaLabel:"Normal",icon:o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:[o.jsx("circle",{cx:"12",cy:"12",r:"11",fill:"var(--chakra-colors-status-success)"}),o.jsx("path",{d:"M7 12.5l3.5 3.5 6.5-7",stroke:"white",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})]})},warning:{bg:"color-mix(in srgb, var(--chakra-colors-status-warning) 8%, transparent)",indicator:"status.warning",border:"color-mix(in srgb, var(--chakra-colors-status-warning) 20%, transparent)",text:"status.warning",ariaLabel:"Warning",icon:o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:[o.jsx("path",{d:"M12 2L2 21h20L12 2z",fill:"var(--chakra-colors-status-warning)"}),o.jsx("path",{d:"M12 9v5",stroke:"white",strokeWidth:"2.2",strokeLinecap:"round"}),o.jsx("circle",{cx:"12",cy:"17",r:"1",fill:"white"})]})},critical:{bg:"color-mix(in srgb, var(--chakra-colors-status-error) 8%, transparent)",indicator:"status.error",border:"color-mix(in srgb, var(--chakra-colors-status-error) 20%, transparent)",text:"status.error",ariaLabel:"Critical",icon:o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:[o.jsx("path",{d:"M8.5 2h7l6.5 6.5v7L15.5 22h-7L2 15.5v-7L8.5 2z",fill:"var(--chakra-colors-status-error)"}),o.jsx("path",{d:"M12 7v6",stroke:"white",strokeWidth:"2.2",strokeLinecap:"round"}),o.jsx("circle",{cx:"12",cy:"16.5",r:"1",fill:"white"})]})}};function Z6({label:e,value:t,unit:n,status:r="normal",...i}){const s=X6[r];return o.jsxs(f.Box,{display:"inline-flex",alignItems:"center",gap:"2",px:"3",py:"2",borderRadius:"md",bg:s.bg,border:"1px solid",borderColor:s.border,...i,children:[o.jsx("span",{"aria-label":s.ariaLabel,style:{display:"inline-flex",alignItems:"center",flexShrink:0},children:s.icon}),o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"2xs",color:"text.muted",fontFamily:"var(--font-body)",textTransform:"uppercase",letterSpacing:"wide",children:e}),o.jsxs(f.Box,{display:"flex",alignItems:"baseline",gap:"1",children:[o.jsx(f.Box,{fontSize:"md",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-mono, monospace)",children:t}),n&&o.jsx(f.Box,{fontSize:"xs",color:s.text,fontFamily:"var(--font-body)",children:n})]})]})]})}const J6={upcoming:{label:"Upcoming",color:"info"},completed:{label:"Completed",color:"success"},cancelled:{label:"Cancelled",color:"error"}};function Q6({doctorName:e,doctorSpecialty:t,doctorAvatar:n,date:r,time:i,type:s="video",status:a="upcoming",onCancel:l,onReschedule:d,onJoin:c,...u}){const h=J6[a];return o.jsxs(f.Box,{bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",p:"5",display:"flex",flexDirection:"column",gap:"4",...u,children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"3",children:[n?o.jsx("img",{src:n,alt:e,style:{width:40,height:40,borderRadius:"50%",objectFit:"cover",display:"block"}}):o.jsx(f.Box,{w:"10",h:"10",borderRadius:"full",bg:"blue.500",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"md",fontWeight:"bold",color:"white",children:e.charAt(0)}),o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"md",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",children:e}),t&&o.jsx(f.Box,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:t})]})]}),o.jsx(os,{status:h.color,size:"sm",children:h.label})]}),o.jsxs(f.Box,{display:"flex",gap:"4",py:"3",borderTop:"1px solid",borderBottom:"1px solid",borderColor:"border",children:[o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:"Date"}),o.jsx(f.Box,{fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:r})]}),o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:"Time"}),o.jsx(f.Box,{fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:i})]}),o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:"Type"}),o.jsx(f.Box,{fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",textTransform:"capitalize",children:s==="video"?"🎥 Video Call":"🏥 In-Person"})]})]}),a==="upcoming"&&o.jsxs(f.Box,{display:"flex",gap:"2",children:[c&&o.jsx(f.Box,{as:"button",flex:"1",py:"2",bg:"blue.500",color:"white",borderRadius:"md",border:"none",fontSize:"sm",fontWeight:"semibold",fontFamily:"var(--font-body)",cursor:"pointer",_hover:{bg:"blue.600"},transition:"all 0.15s",onClick:c,children:"Join Call"}),d&&o.jsx(f.Box,{as:"button",flex:"1",py:"2",bg:"transparent",color:"text.body",border:"1px solid",borderColor:"border",borderRadius:"md",fontSize:"sm",fontWeight:"medium",fontFamily:"var(--font-body)",cursor:"pointer",_hover:{borderColor:"blue.400",color:"blue.500"},transition:"all 0.15s",onClick:d,children:"Reschedule"}),l&&o.jsx(f.Box,{as:"button",py:"2",px:"3",bg:"transparent",color:"red.500",border:"1px solid",borderColor:"red.200",borderRadius:"md",fontSize:"sm",fontFamily:"var(--font-body)",cursor:"pointer",_hover:{bg:"red.50"},transition:"all 0.15s",onClick:l,children:"Cancel"})]})]})}const e3={active:{label:"Active",bg:"color-mix(in srgb, var(--chakra-colors-status-success) 12%, transparent)",color:"var(--chakra-colors-status-success)"},expired:{label:"Expired",bg:"color-mix(in srgb, var(--chakra-colors-status-error) 10%, transparent)",color:"var(--chakra-colors-status-error)"},dispensed:{label:"Dispensed",bg:"color-mix(in srgb, var(--chakra-colors-blue-500) 10%, transparent)",color:"var(--chakra-colors-blue-500)"}},t3=()=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z"}),o.jsx("path",{d:"m8.5 8.5 7 7"})]}),n3=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),o.jsx("polyline",{points:"7 10 12 15 17 10"}),o.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),Gc=()=>o.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),o.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),o.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),o.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]});function r3({rxId:e,doctorName:t,doctorSpecialty:n,issuedDate:r,expiryDate:i,drugs:s,refillsRemaining:a,status:l="active",colorScheme:d="blue",onDownload:c,...u}){const h=e3[l],m=d==="purple"?"#7700CC":"#0685FF",p=d==="purple"?"color-mix(in srgb, #7700CC 8%, transparent)":"color-mix(in srgb, #0685FF 8%, transparent)";return o.jsxs(f.Box,{bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",overflow:"hidden",...u,children:[o.jsxs(f.Box,{px:"5",py:"3.5",display:"flex",alignItems:"center",justifyContent:"space-between",style:{borderBottom:"1px solid var(--chakra-colors-border)",background:p},children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",children:[o.jsx(f.Box,{style:{color:m},children:o.jsx(t3,{})}),o.jsx(f.Box,{fontSize:"sm",fontWeight:"700",fontFamily:"var(--font-heading)",style:{color:m},children:"Prescription"}),e&&o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:e})]}),o.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:4,fontSize:11,fontWeight:600,fontFamily:"var(--font-body)",background:h.bg,color:h.color},children:[o.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:h.color,display:"inline-block"}}),h.label]})]}),o.jsxs(f.Box,{px:"5",py:"3",display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid",borderColor:"border",flexWrap:"wrap",gap:"2",children:[o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"sm",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",children:t}),n&&o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:n})]}),o.jsxs(f.Box,{display:"flex",gap:"4",children:[o.jsxs(f.Box,{children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1",color:"text.muted",children:[o.jsx(Gc,{}),o.jsx(f.Box,{fontSize:"xs",fontFamily:"var(--font-body)",children:"Issued"})]}),o.jsx(f.Box,{fontSize:"xs",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:r})]}),i&&o.jsxs(f.Box,{children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1",color:"text.muted",children:[o.jsx(Gc,{}),o.jsx(f.Box,{fontSize:"xs",fontFamily:"var(--font-body)",children:"Expires"})]}),o.jsx(f.Box,{fontSize:"xs",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:i})]})]})]}),o.jsx(f.Box,{px:"5",py:"4",display:"flex",flexDirection:"column",gap:"3",children:s.map((x,g)=>o.jsxs(f.Box,{display:"flex",alignItems:"flex-start",gap:"3",p:"3",borderRadius:"md",bg:"bg.subtle",border:"1px solid",borderColor:"border",children:[o.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"50%",background:p,color:m,fontSize:11,fontWeight:700,fontFamily:"var(--font-heading)",flexShrink:0,marginTop:1},children:g+1}),o.jsxs(f.Box,{flex:"1",minW:"0",children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",flexWrap:"wrap",children:[o.jsx(f.Box,{fontSize:"sm",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",children:x.name}),o.jsx("span",{style:{padding:"1px 6px",borderRadius:4,fontSize:11,fontWeight:600,background:p,color:m,fontFamily:"var(--font-body)"},children:x.dosage})]}),o.jsxs(f.Box,{display:"flex",gap:"3",mt:"1",flexWrap:"wrap",children:[o.jsxs(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:["🕐 ",x.frequency]}),x.duration&&o.jsxs(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:["📅 ",x.duration]}),x.instructions&&o.jsxs(f.Box,{fontSize:"xs",color:"text.body",fontFamily:"var(--font-body)",fontStyle:"italic",children:["ℹ️ ",x.instructions]})]})]})]},g))}),o.jsxs(f.Box,{px:"5",py:"3",display:"flex",alignItems:"center",justifyContent:"space-between",borderTop:"1px solid",borderColor:"border",children:[a!==void 0?o.jsxs(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:[o.jsx(f.Box,{as:"span",fontWeight:"semibold",color:"text.heading",children:a})," ","refill",a!==1?"s":""," remaining"]}):o.jsx(f.Box,{}),c&&o.jsxs("button",{onClick:c,"aria-label":"Download prescription",style:{display:"inline-flex",alignItems:"center",gap:6,padding:"6px 14px",borderRadius:8,fontSize:12,fontWeight:600,fontFamily:"var(--font-body)",color:m,background:p,border:"none",cursor:"pointer",transition:"opacity 0.15s"},onMouseEnter:x=>{x.currentTarget.style.opacity="0.8"},onMouseLeave:x=>{x.currentTarget.style.opacity="1"},children:[o.jsx(n3,{}),"Download"]})]})]})}const i3={primary:{label:"Primary",bg:"color-mix(in srgb, #0685FF 10%, transparent)",color:"#0685FF",border:"color-mix(in srgb, #0685FF 25%, transparent)"},secondary:{label:"Secondary",bg:"color-mix(in srgb, #64748B 10%, transparent)",color:"#64748B",border:"color-mix(in srgb, #64748B 25%, transparent)"},chronic:{label:"Chronic",bg:"color-mix(in srgb, #F59E0B 10%, transparent)",color:"#B45309",border:"color-mix(in srgb, #F59E0B 25%, transparent)"},acute:{label:"Acute",bg:"color-mix(in srgb, #EF4444 10%, transparent)",color:"#DC2626",border:"color-mix(in srgb, #EF4444 25%, transparent)"}};function hh({code:e,description:t,category:n="primary",...r}){const i=i3[n];return o.jsxs(f.Box,{display:"inline-flex",alignItems:"center",gap:"1.5",...r,children:[o.jsx("span",{title:t,"aria-label":`ICD-10 code ${e}${t?`: ${t}`:""}`,style:{display:"inline-flex",alignItems:"center",gap:4,padding:"3px 8px",borderRadius:4,fontSize:11,fontWeight:700,fontFamily:"var(--font-mono, monospace)",background:i.bg,color:i.color,border:`1px solid ${i.border}`,cursor:t?"help":"default",whiteSpace:"nowrap"},children:e}),t&&o.jsx(f.Box,{as:"span",fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:t})]})}function ph({bloodType:e,...t}){return o.jsx(f.Box,{display:"inline-flex",alignItems:"center",...t,children:o.jsxs("span",{"aria-label":`Blood type ${e}`,style:{display:"inline-flex",alignItems:"center",gap:4,padding:"3px 10px",borderRadius:4,fontSize:12,fontWeight:800,fontFamily:"var(--font-heading)",background:"color-mix(in srgb, #DC2626 12%, transparent)",color:"#DC2626",border:"1px solid color-mix(in srgb, #DC2626 30%, transparent)",letterSpacing:"0.02em"},children:[o.jsx("svg",{width:"10",height:"12",viewBox:"0 0 12 16",fill:"currentColor","aria-hidden":"true",children:o.jsx("path",{d:"M6 0C6 0 0 7.5 0 11a6 6 0 0 0 12 0C12 7.5 6 0 6 0z"})}),e]})})}const o3={mild:{label:"Mild",bg:"color-mix(in srgb, #F59E0B 8%, transparent)",color:"#B45309",border:"color-mix(in srgb, #F59E0B 30%, transparent)",icon:"⚠"},moderate:{label:"Moderate",bg:"color-mix(in srgb, #F97316 10%, transparent)",color:"#C2410C",border:"color-mix(in srgb, #F97316 30%, transparent)",icon:"⚠"},severe:{label:"Severe",bg:"color-mix(in srgb, #EF4444 10%, transparent)",color:"#DC2626",border:"color-mix(in srgb, #EF4444 30%, transparent)",icon:"🚫"},"life-threatening":{label:"Life-threatening",bg:"color-mix(in srgb, #7F1D1D 15%, transparent)",color:"#991B1B",border:"#DC2626",icon:"⛔"}};function mh({allergen:e,severity:t="mild",...n}){const r=o3[t];return o.jsx(f.Box,{display:"inline-flex",alignItems:"center",...n,children:o.jsxs("span",{"aria-label":`Allergy: ${e} — ${r.label} severity`,style:{display:"inline-flex",alignItems:"center",gap:5,padding:"3px 8px",borderRadius:4,fontSize:11,fontWeight:600,fontFamily:"var(--font-body)",background:r.bg,color:r.color,border:`1px solid ${r.border}`,borderLeftWidth:t==="life-threatening"?3:1,whiteSpace:"nowrap"},children:[o.jsx("span",{"aria-hidden":"true",children:r.icon}),e,o.jsxs("span",{style:{opacity:.7,fontSize:10},children:["· ",r.label]})]})})}function s3({diagnoses:e,bloodType:t,allergies:n,direction:r="row",...i}){return o.jsxs(f.Box,{display:"flex",flexDirection:r,flexWrap:"wrap",gap:"2",alignItems:r==="row"?"center":"flex-start",...i,children:[t&&o.jsx(ph,{bloodType:t}),e==null?void 0:e.map((s,a)=>o.jsx(hh,{code:s.code,description:s.description,category:s.category},a)),n==null?void 0:n.map((s,a)=>o.jsx(mh,{allergen:s.allergen,severity:s.severity},a))]})}var xh={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Yc=k.createContext&&k.createContext(xh),a3=["attr","size","title"];function l3(e,t){if(e==null)return{};var n,r,i=c3(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function c3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function li(){return li=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},li.apply(null,arguments)}function Kc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ci(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Kc(Object(n),!0).forEach(function(r){u3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function u3(e,t,n){return(t=d3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d3(e){var t=f3(e,"string");return typeof t=="symbol"?t:t+""}function f3(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gh(e){return e&&e.map((t,n)=>k.createElement(t.tag,ci({key:n},t.attr),gh(t.child)))}function rt(e){return t=>k.createElement(h3,li({attr:ci({},e.attr)},t),gh(e.child))}function h3(e){var t=n=>{var{attr:r,size:i,title:s}=e,a=l3(e,a3),l=i||n.size||"1em",d;return n.className&&(d=n.className),e.className&&(d=(d?d+" ":"")+e.className),k.createElement("svg",li({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,a,{className:d,style:ci(ci({color:e.color||n.color},n.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),s&&k.createElement("title",null,s),e.children)};return Yc!==void 0?k.createElement(Yc.Consumer,null,n=>t(n)):t(xh)}function p3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"},child:[]},{tag:"rect",attr:{x:"2",y:"6",width:"14",height:"12",rx:"2"},child:[]}]})(e)}function m3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196"},child:[]},{tag:"path",attr:{d:"M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2"},child:[]},{tag:"path",attr:{d:"m2 2 20 20"},child:[]}]})(e)}function x3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M13 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-3"},child:[]},{tag:"path",attr:{d:"M8 21h8"},child:[]},{tag:"path",attr:{d:"M12 17v4"},child:[]},{tag:"path",attr:{d:"m17 8 5-5"},child:[]},{tag:"path",attr:{d:"M17 3h5v5"},child:[]}]})(e)}function g3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z"},child:[]},{tag:"path",attr:{d:"m8.5 8.5 7 7"},child:[]}]})(e)}function y3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"},child:[]},{tag:"line",attr:{x1:"22",x2:"2",y1:"2",y2:"22"},child:[]}]})(e)}function b3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"},child:[]},{tag:"path",attr:{d:"M14.05 2a9 9 0 0 1 8 7.94"},child:[]},{tag:"path",attr:{d:"M14.05 6A5 5 0 0 1 18 10"},child:[]}]})(e)}function v3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"},child:[]},{tag:"path",attr:{d:"M19 10v2a7 7 0 0 1-14 0v-2"},child:[]},{tag:"line",attr:{x1:"12",x2:"12",y1:"19",y2:"22"},child:[]}]})(e)}function k3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"2",x2:"22",y1:"2",y2:"22"},child:[]},{tag:"path",attr:{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2"},child:[]},{tag:"path",attr:{d:"M5 10v2a7 7 0 0 0 12 5"},child:[]},{tag:"path",attr:{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33"},child:[]},{tag:"path",attr:{d:"M9 9v3a3 3 0 0 0 5.12 2.12"},child:[]},{tag:"line",attr:{x1:"12",x2:"12",y1:"19",y2:"22"},child:[]}]})(e)}function w3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"},child:[]},{tag:"polyline",attr:{points:"16 17 21 12 16 7"},child:[]},{tag:"line",attr:{x1:"21",x2:"9",y1:"12",y2:"12"},child:[]}]})(e)}function S3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 6v4"},child:[]},{tag:"path",attr:{d:"M14 14h-4"},child:[]},{tag:"path",attr:{d:"M14 18h-4"},child:[]},{tag:"path",attr:{d:"M14 8h-4"},child:[]},{tag:"path",attr:{d:"M18 12h2a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2h2"},child:[]},{tag:"path",attr:{d:"M18 22V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v18"},child:[]}]})(e)}function C3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2"},child:[]},{tag:"path",attr:{d:"M8.5 2h7"},child:[]},{tag:"path",attr:{d:"M7 16h10"},child:[]}]})(e)}function j3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"},child:[]},{tag:"path",attr:{d:"M14 2v4a2 2 0 0 0 2 2h4"},child:[]},{tag:"path",attr:{d:"M10 9H8"},child:[]},{tag:"path",attr:{d:"M16 13H8"},child:[]},{tag:"path",attr:{d:"M16 17H8"},child:[]}]})(e)}function T3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]}]})(e)}function B3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"},child:[]}]})(e)}const E3=({muted:e})=>e?o.jsx(k3,{size:18,"aria-hidden":"true"}):o.jsx(v3,{size:18,"aria-hidden":"true"}),F3=({off:e})=>e?o.jsx(m3,{size:18,"aria-hidden":"true"}):o.jsx(p3,{size:18,"aria-hidden":"true"}),A3=({active:e})=>o.jsx(x3,{size:18,color:e?"var(--chakra-colors-status-success, #16A34A)":"currentColor","aria-hidden":"true"}),L3=()=>o.jsx(y3,{size:18,"aria-hidden":"true"});function I3({participantName:e,participantRole:t,participantAvatar:n,duration:r,isMuted:i=!1,isCameraOff:s=!1,isSharingScreen:a=!1,onToggleMute:l,onToggleCamera:d,onEndCall:c,onShareScreen:u,position:h="bottom",variant:m="adaptive",...p}){const[x,g]=k.useState(i),[v,y]=k.useState(s),j=m==="dark",w=()=>{g(C=>!C),l==null||l()},A=()=>{y(C=>!C),d==null||d()},B=({onClick:C,ariaLabel:O,active:E,isEndCall:F=!1,children:L})=>{let R=j?"rgba(255,255,255,0.1)":"var(--chakra-colors-bg-subtle, #F0F4F8)",D=j?"white":"var(--chakra-colors-text-heading, #111926)",N=j?"rgba(255,255,255,0.2)":"var(--chakra-colors-border, #E2E8F0)";return F?(R="var(--chakra-colors-status-error, #DC2626)",D="white",N="color-mix(in srgb, var(--chakra-colors-status-error, #DC2626) 85%, black)"):E&&(R="var(--chakra-colors-status-error-tint, rgba(220,38,38,0.15))",D="var(--chakra-colors-status-error, #DC2626)",N="var(--chakra-colors-status-error-tint, rgba(220,38,38,0.25))"),o.jsx("button",{onClick:C,"aria-label":O,"aria-pressed":E,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:44,height:44,borderRadius:"50%",border:E?"1px solid var(--chakra-colors-status-error)":"1px solid transparent",cursor:"pointer",transition:"all 0.15s ease",background:R,color:D,WebkitTapHighlightColor:"transparent"},onMouseEnter:P=>{const I=P.currentTarget;I.style.background=N,I.style.transform="scale(1.06)"},onMouseLeave:P=>{const I=P.currentTarget;I.style.background=R,I.style.transform="scale(1)"},children:L})};return o.jsxs(f.Box,{position:"fixed",...h==="bottom"?{bottom:"0"}:{top:"0"},left:"0",right:"0",zIndex:"overlay",display:"flex",alignItems:"center",justifyContent:"space-between",px:{base:"4",md:"8"},flexWrap:"wrap",gap:"4",bg:j?void 0:"bg.surface",borderColor:"border",style:{minHeight:72,paddingTop:12,paddingBottom:h==="bottom"?"calc(12px + env(safe-area-inset-bottom, 0px))":12,background:j?"linear-gradient(135deg, #0A1220 0%, #0F1C2E 100%)":void 0,borderTop:h==="bottom"?"1px solid var(--chakra-colors-border)":"none",borderBottom:h==="top"?"1px solid var(--chakra-colors-border)":"none",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)",transition:"background 0.2s ease, border-color 0.2s ease"},...p,children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"3",children:[o.jsx(ui,{src:n,name:e,size:"md"}),o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"sm",fontWeight:"semibold",fontFamily:"var(--font-heading)",color:j?"white":"text.heading",children:e}),t&&o.jsx(f.Box,{fontSize:"xs",fontFamily:"var(--font-body)",color:j?"rgba(255,255,255,0.6)":"text.muted",children:t})]}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",ml:"2",children:[o.jsxs("span",{"aria-label":"Live call",style:{display:"inline-flex",alignItems:"center",gap:5,padding:"2px 8px",borderRadius:4,fontSize:10,fontWeight:700,background:"var(--chakra-colors-status-error-tint, rgba(220,38,38,0.15))",color:"var(--chakra-colors-status-error, #DC2626)",fontFamily:"var(--font-body)",letterSpacing:"0.05em"},children:[o.jsx("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:"50%",background:"var(--chakra-colors-status-error, #DC2626)",display:"inline-block",animation:"medixPulse 1.5s ease-in-out infinite"}}),"LIVE"]}),r&&o.jsx(f.Box,{fontSize:"sm",fontFamily:"var(--font-mono, monospace)",fontWeight:"600",color:j?"rgba(255,255,255,0.8)":"text.heading",style:{letterSpacing:"0.05em"},children:r})]})]}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",children:[l&&o.jsx(B,{onClick:w,ariaLabel:x?"Unmute microphone":"Mute microphone",active:x,children:o.jsx(E3,{muted:x})}),d&&o.jsx(B,{onClick:A,ariaLabel:v?"Turn camera on":"Turn camera off",active:v,children:o.jsx(F3,{off:v})}),u&&o.jsx(B,{onClick:u,ariaLabel:a?"Stop sharing screen":"Share screen",active:a,children:o.jsx(A3,{active:a})}),c&&o.jsx(B,{onClick:c,ariaLabel:"End call",isEndCall:!0,children:o.jsx(L3,{})})]})]})}const D3={consultation:{bg:"color-mix(in srgb, #0685FF 12%, transparent)",color:"#0685FF",icon:o.jsx(b3,{size:14,"aria-hidden":"true"})},lab:{bg:"color-mix(in srgb, #7700CC 12%, transparent)",color:"#7700CC",icon:o.jsx(C3,{size:14,"aria-hidden":"true"})},prescription:{bg:"color-mix(in srgb, #10B981 12%, transparent)",color:"#10B981",icon:o.jsx(g3,{size:14,"aria-hidden":"true"})},vitals:{bg:"color-mix(in srgb, #F59E0B 12%, transparent)",color:"#D97706",icon:o.jsx(B3,{size:14,"aria-hidden":"true"})},note:{bg:"color-mix(in srgb, #64748B 12%, transparent)",color:"#64748B",icon:o.jsx(j3,{size:14,"aria-hidden":"true"})},admission:{bg:"color-mix(in srgb, #EF4444 12%, transparent)",color:"#EF4444",icon:o.jsx(S3,{size:14,"aria-hidden":"true"})},discharge:{bg:"color-mix(in srgb, #10B981 12%, transparent)",color:"#10B981",icon:o.jsx(w3,{size:14,"aria-hidden":"true"})},custom:{bg:"color-mix(in srgb, #0685FF 10%, transparent)",color:"#0685FF",icon:o.jsx(T3,{size:14,"aria-hidden":"true"})}},qc={success:{bg:"color-mix(in srgb, #10B981 12%, transparent)",color:"#10B981"},warning:{bg:"color-mix(in srgb, #F59E0B 12%, transparent)",color:"#D97706"},error:{bg:"color-mix(in srgb, #EF4444 12%, transparent)",color:"#EF4444"},info:{bg:"color-mix(in srgb, #0685FF 12%, transparent)",color:"#0685FF"},neutral:{bg:"color-mix(in srgb, #64748B 12%, transparent)",color:"#64748B"}};function R3(){return o.jsxs(f.Box,{display:"flex",gap:"4",alignItems:"flex-start",children:[o.jsxs(f.Box,{flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",children:[o.jsx(f.Box,{w:"8",h:"8",borderRadius:"full",bg:"bg.subtle",style:{animation:"medix-shimmer 1.5s infinite"}}),o.jsx(f.Box,{w:"px",flex:"1",minH:"8",bg:"border",mt:"2"})]}),o.jsxs(f.Box,{flex:"1",pb:"6",children:[o.jsx(f.Box,{h:"4",bg:"bg.subtle",borderRadius:"full",w:"40%",mb:"2",style:{animation:"medix-shimmer 1.5s infinite"}}),o.jsx(f.Box,{h:"3",bg:"bg.subtle",borderRadius:"full",w:"65%",style:{animation:"medix-shimmer 1.5s infinite"}})]})]})}function M3({events:e,compact:t=!1,isLoading:n=!1,loadingCount:r=4,colorScheme:i="blue",...s}){const a=i==="purple"?"var(--chakra-colors-purple-200, rgba(119,0,204,0.2))":"var(--chakra-colors-blue-200, rgba(6,133,255,0.2))";return n?o.jsx(f.Box,{...s,children:Array.from({length:r}).map((l,d)=>o.jsx(R3,{},d))}):o.jsx(f.Box,{...s,role:"feed","aria-label":"Patient medical timeline",children:e.map((l,d)=>{const c=D3[l.type],u=d===e.length-1;return o.jsxs(f.Box,{display:"flex",gap:"4",alignItems:"flex-start",role:"article","aria-label":`${l.title} on ${l.date}`,children:[o.jsxs(f.Box,{flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",children:[o.jsx(f.Box,{w:"8",h:"8",borderRadius:"full",display:"flex",alignItems:"center",justifyContent:"center",style:{background:c.bg,color:c.color,border:`1.5px solid ${c.color}40`,cursor:l.onClick?"pointer":"default",transition:"transform 0.15s, box-shadow 0.15s",flexShrink:0},onClick:l.onClick,role:l.onClick?"button":void 0,tabIndex:l.onClick?0:void 0,onKeyDown:l.onClick?h=>{(h.key==="Enter"||h.key===" ")&&l.onClick()}:void 0,_hover:l.onClick?{transform:"scale(1.1)"}:void 0,children:l.icon??c.icon}),!u&&o.jsx(f.Box,{w:"1px",flex:"1",minH:"8",mt:"1",style:{background:a}})]}),o.jsxs(f.Box,{flex:"1",pb:u?"0":"5",cursor:l.onClick?"pointer":"default",onClick:l.onClick,_hover:l.onClick?{opacity:.85}:void 0,transition:"opacity 0.15s",children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",flexWrap:"wrap",children:[o.jsx(f.Box,{fontSize:"sm",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",children:l.title}),l.badgeLabel&&l.badgeStatus&&o.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"1px 7px",borderRadius:4,fontSize:11,fontWeight:600,fontFamily:"var(--font-body)",background:qc[l.badgeStatus].bg,color:qc[l.badgeStatus].color},children:l.badgeLabel})]}),!t&&l.description&&o.jsx(f.Box,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:l.description}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"3",mt:"1",flexWrap:"wrap",children:[o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:l.date}),l.provider&&o.jsxs(o.Fragment,{children:[o.jsx(f.Box,{w:"1px",h:"3",style:{background:"var(--chakra-colors-border)"}}),o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:l.provider})]})]})]})]},l.id)})})}Object.defineProperty(exports,"Box",{enumerable:!0,get:()=>f.Box});Object.defineProperty(exports,"Center",{enumerable:!0,get:()=>f.Center});Object.defineProperty(exports,"Flex",{enumerable:!0,get:()=>f.Flex});Object.defineProperty(exports,"Grid",{enumerable:!0,get:()=>f.Grid});Object.defineProperty(exports,"GridItem",{enumerable:!0,get:()=>f.GridItem});Object.defineProperty(exports,"HStack",{enumerable:!0,get:()=>f.HStack});Object.defineProperty(exports,"Heading",{enumerable:!0,get:()=>f.Heading});Object.defineProperty(exports,"Icon",{enumerable:!0,get:()=>f.Icon});Object.defineProperty(exports,"Image",{enumerable:!0,get:()=>f.Image});Object.defineProperty(exports,"Link",{enumerable:!0,get:()=>f.Link});Object.defineProperty(exports,"SimpleGrid",{enumerable:!0,get:()=>f.SimpleGrid});Object.defineProperty(exports,"Stack",{enumerable:!0,get:()=>f.Stack});Object.defineProperty(exports,"Text",{enumerable:!0,get:()=>f.Text});Object.defineProperty(exports,"VStack",{enumerable:!0,get:()=>f.VStack});Object.defineProperty(exports,"Wrap",{enumerable:!0,get:()=>f.Wrap});Object.defineProperty(exports,"WrapItem",{enumerable:!0,get:()=>f.WrapItem});exports.Accordion=H6;exports.Alert=rs;exports.AllergyBadge=mh;exports.AppointmentCard=Q6;exports.Avatar=ui;exports.AvatarGroup=rp;exports.Badge=os;exports.BlogCard=Y6;exports.BloodTypeBadge=ph;exports.Breadcrumb=h2;exports.Button=Qe;exports.Calendar=ls;exports.Card=wu;exports.CardBody=dm;exports.CardFooter=fm;exports.CardHeader=um;exports.Checkbox=mu;exports.Combobox=Vp;exports.Container=Cu;exports.CookieConsentBanner=jf;exports.DRAFT_STORAGE_PREFIX=dn;exports.DashboardLayout=xf;exports.DataTable=K6;exports.DatePicker=zp;exports.DateRangePicker=_p;exports.Divider=cu;exports.DoctorCard=q6;exports.Drawer=F2;exports.EmptyState=j2;exports.FileUpload=Hp;exports.Footer=yf;exports.FormControl=wp;exports.FullPageSpinner=ip;exports.ICD10Badge=hh;exports.IconButton=ou;exports.Input=ss;exports.Logo=cn;exports.MedicalRecordBadge=s3;exports.MedixProvider=qh;exports.Modal=C2;exports.Navbar=r2;exports.NotFoundPage=T2;exports.OTPInput=gu;exports.PWAInstallPrompt=Bf;exports.Pagination=bf;exports.PatientTimeline=M3;exports.PhoneInput=Ap;exports.PinInput=Sp;exports.PrescriptionCard=r3;exports.Progress=kf;exports.RadioGroup=yp;exports.RichTextEditor=cm;exports.RichTextInput=cs;exports.SearchInput=as;exports.SectionHeader=pm;exports.Select=gp;exports.ServerErrorPage=B2;exports.Skeleton=on;exports.SkeletonCard=b2;exports.SkeletonText=vf;exports.Spinner=au;exports.StatCard=Su;exports.Stepper=g2;exports.Switch=xu;exports.TEXTAREA_DRAFT_PREFIX=un;exports.Tabs=m2;exports.Tag=lu;exports.TagInput=Up;exports.TagsInput=yu;exports.TelehealthCallBar=I3;exports.TestimonialCard=U6;exports.Textarea=hu;exports.ThemeColorPalette=ju;exports.Toaster=iu;exports.Tooltip=At;exports.VitalBadge=Z6;exports.clearRichTextDraft=vu;exports.clearTextareaDraft=du;exports.colorTokens=V;exports.dismissToast=Wh;exports.getEffectiveStorageKey=bu;exports.getEffectiveTextareaStorageKey=uu;exports.getRichTextDraft=ku;exports.getTextareaDraft=fu;exports.htmlToMarkdown=jn;exports.markdownToHtml=Mt;exports.medixConfig=nu;exports.radiiTokens=eu;exports.saveRichTextDraft=fo;exports.saveTextareaDraft=co;exports.shadowTokens=tu;exports.spacingTokens=Qc;exports.system=ru;exports.textStyleTokens=Jc;exports.toast=Zn;exports.typographyTokens=Cn;exports.useColorScheme=Jh;exports.useIsDarkMode=is;exports.useThemeMode=hr;
426
+ `}),n}function zc(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function _c(e,t){const n=u6(e,t),r=n.one(e,void 0),i=Q4(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
427
+ `},i),s}function m6(e,t){return e&&"run"in e?async function(n,r){const i=_c(n,{file:r,...t});await e.run(i,r)}:function(n,r){return _c(n,{file:r,...e||t})}}function Nc(e){if(e)throw e}var no,Vc;function x6(){if(Vc)return no;Vc=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},s=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var u=e.call(c,"constructor"),h=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!h)return!1;var m;for(m in c);return typeof m>"u"||e.call(c,m)},a=function(c,u){n&&u.name==="__proto__"?n(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},l=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return no=function d(){var c,u,h,m,p,x,g=arguments[0],v=1,y=arguments.length,j=!1;for(typeof g=="boolean"&&(j=g,g=arguments[1]||{},v=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});v<y;++v)if(c=arguments[v],c!=null)for(u in c)h=l(g,u),m=l(c,u),g!==m&&(j&&m&&(s(m)||(p=i(m)))?(p?(p=!1,x=h&&i(h)?h:[]):x=h&&s(h)?h:{},a(g,{name:u,newValue:d(j,x,m)})):typeof m<"u"&&a(g,{name:u,newValue:m}));return g},no}var g6=x6();const ro=Vf(g6);function ts(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function y6(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);l(null,...i);function l(d,...c){const u=e[++s];let h=-1;if(d){a(d);return}for(;++h<i.length;)(c[h]===null||c[h]===void 0)&&(c[h]=i[h]);i=c,u?b6(u,l)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function b6(e,t){let n;return r;function r(...a){const l=e.length>a.length;let d;l&&a.push(i);try{d=e.apply(this,a)}catch(c){const u=c;if(l&&n)throw u;return i(u)}l||(d&&d.then&&typeof d.then=="function"?d.then(s,i):d instanceof Error?i(d):s(d))}function i(a,...l){n||(n=!0,t(a,...l))}function s(a){i(null,a)}}const jt={basename:v6,dirname:k6,extname:w6,join:S6,sep:"/"};function v6(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');br(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function k6(e){if(br(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function w6(e){br(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),l===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function S6(...e){let t=-1,n;for(;++t<e.length;)br(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":C6(n)}function C6(e){br(e);const t=e.codePointAt(0)===47;let n=j6(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function j6(e,t){let n="",r=0,i=-1,s=0,a=-1,l,d;for(;++a<=e.length;){if(a<e.length)l=e.codePointAt(a);else{if(l===47)break;l=47}if(l===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,s=0}else l===46&&s>-1?s++:s=-1}return n}function br(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const T6={cwd:B6};function B6(){return"/"}function ns(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function E6(e){if(typeof e=="string")e=new URL(e);else if(!ns(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return F6(e)}function F6(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const io=["history","path","basename","stem","extname","dirname"];class mh{constructor(t){let n;t?ns(t)?n={path:t}:typeof t=="string"||A6(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":T6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<io.length;){const s=io[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)io.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?jt.basename(this.path):void 0}set basename(t){so(t,"basename"),oo(t,"basename"),this.path=jt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?jt.dirname(this.path):void 0}set dirname(t){Wc(this.basename,"dirname"),this.path=jt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?jt.extname(this.path):void 0}set extname(t){if(oo(t,"extname"),Wc(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=jt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ns(t)&&(t=E6(t)),so(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?jt.basename(this.path,this.extname):void 0}set stem(t){so(t,"stem"),oo(t,"stem"),this.path=jt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Ge(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function oo(e,t){if(e&&e.includes(jt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+jt.sep+"`")}function so(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Wc(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function A6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const L6=(function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),I6={}.hasOwnProperty;class na extends L6{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=y6()}copy(){const t=new na;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ro(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(co("data",this.frozen),this.namespace[t]=n,this):I6.call(this.namespace,t)&&this.namespace[t]||void 0:t?(co("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Or(t),r=this.parser||this.Parser;return ao("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ao("process",this.parser||this.Parser),lo("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const l=Or(t),d=r.parse(l);r.run(d,l,function(u,h,m){if(u||!h||!m)return c(u);const p=h,x=r.stringify(p,m);M6(x)?m.value=x:m.result=x,c(u,m)});function c(u,h){u||!h?a(u):s?s(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),ao("processSync",this.parser||this.Parser),lo("processSync",this.compiler||this.Compiler),this.process(t,i),Uc("processSync","process",n),r;function i(s,a){n=!0,Nc(s),r=a}}run(t,n,r){Hc(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,l){const d=Or(n);i.run(t,d,c);function c(u,h,m){const p=h||t;u?l(u):a?a(p):r(void 0,p,m)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),Uc("runSync","run",r),i;function s(a,l){Nc(a),i=l,r=!0}}stringify(t,n){this.freeze();const r=Or(n),i=this.compiler||this.Compiler;return lo("stringify",i),Hc(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(co("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")d(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...h]=c;d(u,h)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(c.plugins),c.settings&&(i.settings=ro(!0,i.settings,c.settings))}function l(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const h=c[u];s(h)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function d(c,u){let h=-1,m=-1;for(;++h<r.length;)if(r[h][0]===c){m=h;break}if(m===-1)r.push([c,...u]);else if(u.length>0){let[p,...x]=u;const g=r[m][1];ts(g)&&ts(p)&&(p=ro(!0,g,p)),r[m]=[c,p,...x]}}}}const D6=new na().freeze();function ao(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function lo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function co(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Hc(e){if(!ts(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Uc(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Or(e){return R6(e)?e:new mh(e)}function R6(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function M6(e){return typeof e=="string"||P6(e)}function P6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const O6="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",$c=[],Gc={allowDangerousHtml:!0},z6=/^(https?|ircs?|mailto|xmpp)$/i,_6=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function N6(e){const t=V6(e),n=W6(e);return H6(t.runSync(t.parse(n),n),e)}function V6(e){const t=e.rehypePlugins||$c,n=e.remarkPlugins||$c,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Gc}:Gc;return D6().use(b4).use(n).use(m6,r).use(t)}function W6(e){const t=e.children||"",n=new mh;return typeof t=="string"&&(n.value=t),n}function H6(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,d=t.urlTransform||U6;for(const u of _6)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+O6+u.id,void 0);return ph(e,c),Jb(e,{Fragment:o.Fragment,components:i,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function c(u,h,m){if(u.type==="raw"&&m&&typeof h=="number")return a?m.children.splice(h,1):m.children[h]={type:"text",value:u.value},h;if(u.type==="element"){let p;for(p in Qi)if(Object.hasOwn(Qi,p)&&Object.hasOwn(u.properties,p)){const x=u.properties[p],g=Qi[p];(g===null||g.includes(u.tagName))&&(u.properties[p]=d(String(x||""),p,u))}}if(u.type==="element"){let p=n?!n.includes(u.tagName):s?s.includes(u.tagName):!1;if(!p&&r&&typeof h=="number"&&(p=!r(u,h,m)),p&&m&&typeof h=="number")return l&&u.children?m.children.splice(h,1,...u.children):m.children.splice(h,1),h}}}function U6(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||z6.test(e.slice(0,t))?e:""}const $6={blue:{solid:"#0685FF",ring:"#0685FF"},purple:{solid:"#7700CC",ring:"#7700CC"}};function G6({items:e,allowMultiple:t=!1,defaultOpenIds:n=[],colorScheme:r="blue",answerType:i="HTML",...s}){const a=$6[r],[l,d]=k.useState(new Set(n)),c=u=>{d(h=>{const m=new Set(h);return m.has(u)?m.delete(u):(t||m.clear(),m.add(u)),m})};return o.jsx(f.Box,{display:"flex",flexDirection:"column",gap:"4",...s,children:e.map(u=>{const h=l.has(u.id);return o.jsxs(f.Box,{bg:"bg.primary",border:"1px solid",borderColor:"border",borderRadius:"card",overflow:"hidden",transition:"border-color 0.2s",_hover:{borderColor:h?a.ring:"border"},children:[o.jsxs(f.Box,{as:"button",w:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"4",px:"6",py:"5",bg:"transparent",border:"none",cursor:"pointer",textAlign:"left",onClick:()=>c(u.id),"aria-expanded":h,children:[o.jsx(f.Box,{fontSize:"lg",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",flex:"1",lineHeight:"short",children:u.question}),o.jsx(f.Box,{flexShrink:0,w:"10",h:"10",borderRadius:"full",display:"flex",alignItems:"center",justifyContent:"center",transition:"background 0.2s, border-color 0.2s, color 0.2s","aria-hidden":"true",style:{border:h?"none":"1.5px solid var(--medix-form-text)",background:h?a.solid:"transparent",color:h?"#ffffff":"inherit",flexShrink:0},children:h?o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:o.jsx("rect",{x:"3",y:"8.25",width:"12",height:"1.5",rx:"0.75",fill:" var(--medix-form-text)"})}):o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:[o.jsx("rect",{x:"3",y:"8.25",width:"12",height:"1.5",rx:"0.75",fill:" var(--medix-form-text)"}),o.jsx("rect",{x:"8.25",y:"3",width:"1.5",height:"12",rx:"0.75",fill:" var(--medix-form-text)"})]})})]}),o.jsx(f.Box,{overflow:"hidden",maxH:h?"800px":"0px",opacity:h?1:0,transition:"max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease",children:o.jsx(f.Box,{px:"6",pb:"6",pt:"0",fontSize:"md",color:"text.body",fontFamily:"var(--font-body)",lineHeight:"loose",children:typeof u.answer=="string"?i==="MD"?o.jsx(N6,{children:u.answer}):o.jsx("span",{dangerouslySetInnerHTML:{__html:Sb.sanitize(u.answer)}}):u.answer})})]},u.id)})})}function Y6({quote:e,authorName:t,authorTitle:n,authorAvatar:r,rating:i,...s}){return o.jsxs(f.Box,{bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",p:"5",display:"flex",flexDirection:"column",gap:"4",boxShadow:"none",_dark:{boxShadow:"none"},...s,children:[i!==void 0&&o.jsx(f.Box,{display:"flex",gap:"0.5",children:Array.from({length:5}).map((a,l)=>o.jsx(f.Box,{as:"span",fontSize:"sm",color:l<i?"#F59E0B":"text.muted",children:"★"},l))}),o.jsxs(f.Box,{as:"blockquote",m:"0",fontSize:"sm",color:"text.body",fontFamily:"var(--font-body)",lineHeight:"loose",fontStyle:"italic",children:['"',e,'"']}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"3",mt:"auto",children:[r?o.jsx("img",{src:r,alt:t,style:{width:36,height:36,borderRadius:"50%",objectFit:"cover"}}):o.jsx(f.Box,{w:"9",h:"9",borderRadius:"full",bg:"blue.500",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"sm",fontWeight:"semibold",color:"white",flexShrink:0,children:t.charAt(0).toUpperCase()}),o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"sm",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-body)",children:t}),n&&o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:n})]})]})]})}const K6={blue:{solid:"#0685FF",token:"blue.500"},purple:{solid:"#7700CC",token:"purple.500"}};function q6(e){if(!e)return null;try{const t=new Date(e);return isNaN(t.getTime())?null:{day:String(t.getUTCDate()),weekday:t.toLocaleDateString("en-US",{weekday:"short",timeZone:"UTC"}).toUpperCase()}}catch{return null}}function X6({title:e,excerpt:t,category:n,date:r,coverImage:i,href:s,onClick:a,colorScheme:l="blue",...d}){const c=!!(s||a),u=q6(r),h=K6[l],m={display:"block",textDecoration:"none",background:"transparent",border:"none",padding:0,cursor:c?"pointer":"default",textAlign:"left"},p=o.jsxs(f.Box,{bg:"bg.primary",borderRadius:"card",overflow:"hidden",transition:"transform 0.22s ease, box-shadow 0.22s ease",_dark:{bg:"bg.primary"},_hover:c?{transform:"translateY(-4px)"}:void 0,...d,children:[o.jsxs(f.Box,{position:"relative",overflow:"hidden",children:[i?o.jsx("img",{src:i,alt:e,style:{width:"100%",height:300,objectFit:"cover",display:"block",borderRadius:"20px"}}):o.jsx(f.Box,{borderRadius:"card",h:"300px",style:{background:"linear-gradient(135deg, #0685FF 0%, #7700CC 100%)",borderRadius:"20px"}}),u&&o.jsxs(f.Box,{position:"absolute",bottom:"3",right:"3",bg:"white",borderRadius:"10px",px:"3",py:"2",display:"flex",flexDirection:"column",alignItems:"center",minW:"44px",border:"1px solid",borderColor:"border",boxShadow:"none",children:[o.jsx(f.Box,{style:{fontSize:22,fontWeight:700,color:h.solid,lineHeight:1,fontFamily:"var(--font-heading)"},children:u.day}),o.jsx(f.Box,{style:{fontSize:10,fontWeight:600,color:"#6B7280",letterSpacing:"0.08em",marginTop:2,fontFamily:"var(--font-body)"},children:u.weekday})]})]}),o.jsxs(f.Box,{px:"0",pt:"3",pb:"4",children:[n&&o.jsx(f.Box,{display:"inline-flex",alignItems:"center",px:"3",py:"1",mb:"3",borderRadius:"full",bg:h.token,color:"white",fontSize:"xs",fontWeight:"medium",fontFamily:"var(--font-body)",letterSpacing:"wide",children:n}),o.jsx(f.Box,{fontSize:"md",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",lineHeight:"snug",mb:t?"2":"0",children:e}),t&&o.jsx(f.Box,{fontSize:"sm",color:"text.body",fontFamily:"var(--font-body)",lineHeight:"relaxed",style:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:t})]})]});return s?o.jsx("a",{href:s,style:m,onClick:a,children:p}):a?o.jsx("button",{type:"button",style:m,onClick:a,children:p}):p}function Z6({columns:e,data:t,rowKey:n="id",isLoading:r=!1,emptyMessage:i="No data available",sortable:s=!1,sortKey:a,sortDirection:l="asc",onSort:d,striped:c=!0,onRowClick:u,caption:h,enablePagination:m=!1,pageSize:p=10,page:x,onPageChange:g,enableSearch:v=!1,searchPlaceholder:y="Search table...",searchQuery:j,onSearchChange:w,style:A,className:B,stickyFirstColumn:C=!1}){const[O,E]=k.useState(""),F=j??O,[L,R]=k.useState(1),D=x??L,[N,P]=k.useState(a),[I,M]=k.useState(l),U=a??N,G=a?l:I,H=X=>{E(X),R(1),w==null||w(X)},b=X=>{const te=U===X&&G==="asc"?"desc":"asc";P(X),M(te),d==null||d(X,te)},W=X=>{R(X),g==null||g(X)},ne=k.useMemo(()=>{if(!F.trim())return t;const X=F.toLowerCase().trim();return t.filter(te=>e.some(de=>{const ee=te[de.key];return ee==null?!1:String(ee).toLowerCase().includes(X)}))},[t,e,F]),T=k.useMemo(()=>!U||d?ne:[...ne].sort((X,te)=>{const de=X[U],ee=te[U],Ce=String(de??""),De=String(ee??""),ue=Ce.localeCompare(De,void 0,{numeric:!0,sensitivity:"base"});return G==="asc"?ue:-ue}),[ne,U,G,d]),be=T.length,ke=k.useMemo(()=>{if(!m)return T;const X=(D-1)*p;return T.slice(X,X+p)},[T,m,D,p]),J=({colKey:X})=>U!==X?o.jsx(f.Text,{as:"span",opacity:.3,ml:"1",fontSize:"xs",children:"↕"}):o.jsx(f.Text,{as:"span",ml:"1",color:"text.heading",fontSize:"xs",children:G==="asc"?"↑":"↓"});return o.jsxs(f.Box,{border:"1px solid",borderColor:"border",borderRadius:"card",overflow:"hidden",bg:"bg.surface",boxShadow:"none",_dark:{boxShadow:"none"},style:A,className:B,children:[v&&o.jsx(f.Box,{p:"4",borderBottom:"1px solid",borderColor:"border",bg:"bg.surface",children:o.jsx(ls,{placeholder:y,value:F,onChange:X=>H(X.target.value),maxW:"360px"})}),o.jsx(f.Box,{overflowX:"auto",children:o.jsxs(f.Box,{as:"table",w:"full",style:{borderCollapse:"collapse"},"aria-label":h,children:[h&&o.jsx("caption",{style:{display:"none"},children:h}),o.jsx(f.Box,{as:"thead",children:o.jsx(f.Box,{as:"tr",bg:"bg.subtle",borderBottom:"1px solid",borderColor:"border",children:e.map((X,te)=>{const de=C&&te===0;return o.jsx(f.Box,{as:"th",py:"3",px:"4",textAlign:X.align??"left",minW:X.minWidth,fontSize:"xs",fontWeight:"600",letterSpacing:"0.05em",textTransform:"uppercase",color:"text.muted",fontFamily:"var(--font-body)",whiteSpace:"nowrap",userSelect:"none",cursor:X.sortable||s?"pointer":"default",_hover:X.sortable||s?{color:"text.heading"}:void 0,onClick:()=>X.sortable||s?b(X.key):void 0,"aria-sort":U===X.key?G==="asc"?"ascending":"descending":void 0,position:de?"sticky":void 0,left:de?0:void 0,zIndex:de?3:void 0,bg:de?"bg.subtle":void 0,borderRight:de?"1px solid":void 0,borderColor:de?"border":void 0,boxShadow:de?"2px 0 4px rgba(0, 0, 0, 0.05)":void 0,children:o.jsxs(f.Flex,{as:"span",align:"center",justify:X.align==="right"?"flex-end":X.align==="center"?"center":"flex-start",children:[X.label,(X.sortable||s)&&o.jsx(J,{colKey:X.key})]})},X.key)})})}),o.jsx(f.Box,{as:"tbody",children:r?Array.from({length:5}).map((X,te)=>o.jsx(f.Box,{as:"tr",borderBottom:"1px solid",borderColor:"border",children:e.map(de=>o.jsx(f.Box,{as:"td",py:"3.5",px:"4",children:o.jsx(f.Box,{h:"4",bg:"bg.subtle",borderRadius:"full",w:`${60+Math.random()*30}%`,style:{animation:"medix-shimmer 1.5s infinite"}})},de.key))},te)):ke.length===0?o.jsx(f.Box,{as:"tr",children:o.jsx("td",{colSpan:e.length,style:{textAlign:"center",padding:"48px 16px"},children:o.jsx(f.Text,{color:"text.muted",fontFamily:"var(--font-body)",fontSize:"sm",children:i})})}):ke.map((X,te)=>{const de=String(X[n]??te);return o.jsx(f.Box,{as:"tr",onClick:()=>u==null?void 0:u(X,te),bg:c&&te%2===1?"bg.subtle":"transparent",borderBottom:"1px solid",borderColor:"border",cursor:u?"pointer":"default",transition:"background 0.15s ease",_hover:{bg:"bg.subtle"},children:e.map((ee,Ce)=>{const De=C&&Ce===0;return o.jsx(f.Box,{as:"td",py:"3.5",px:"4",textAlign:ee.align??"left",fontSize:"sm",color:"text.body",fontFamily:"var(--font-body)",verticalAlign:"middle",position:De?"sticky":void 0,left:De?0:void 0,zIndex:De?2:void 0,bg:De?c&&te%2===1?"bg.subtle":"bg.surface":void 0,borderRight:De?"1px solid":void 0,borderColor:De?"border":void 0,boxShadow:De?"2px 0 4px rgba(0, 0, 0, 0.05)":void 0,children:ee.render?ee.render(X[ee.key],X,te):String(X[ee.key]??"—")},ee.key)})},de)})})]})}),m&&o.jsxs(f.Flex,{p:"4",borderTop:"1px solid",borderColor:"border",bg:"bg.surface",align:"center",justify:"space-between",flexWrap:"wrap",gap:"4",children:[o.jsxs(f.Text,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:["Showing ",be===0?0:(D-1)*p+1," to"," ",Math.min(D*p,be)," of ",be," entries"]}),o.jsx(wf,{total:be,pageSize:p,currentPage:D,onChange:W,compact:!0})]})]})}function J6({name:e,specialty:t,location:n,avatar:r,rating:i,reviewCount:s,experience:a,consultationFee:l,isVerified:d=!1,isAvailable:c=!1,availabilityLabel:u="Available",onBookClick:h,onViewClick:m,variant:p="standard",...x}){return p==="featured"?o.jsxs(f.Box,{bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",overflow:"hidden",transition:"all 0.2s ease",_hover:{transform:"translateY(-2px)",borderColor:"blue.200"},display:"flex",flexDirection:"column",...x,children:[r?o.jsx("img",{src:r,alt:e,style:{width:"100%",height:240,objectFit:"cover",display:"block"}}):o.jsx(f.Box,{w:"100%",h:"240px",bg:"blue.100",display:"flex",alignItems:"center",justifyContent:"center",children:o.jsx(f.Box,{fontSize:"4xl",fontWeight:"bold",color:"blue.500",children:e.charAt(0)})}),o.jsxs(f.Box,{p:"5",display:"flex",flexDirection:"column",gap:"4",children:[o.jsxs(f.Box,{children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",flexWrap:"wrap",children:[o.jsx(f.Box,{fontSize:"xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",children:e}),d&&o.jsx(At,{label:"This practitioner's identity has been verified by MedixDeck",placement:"top",children:o.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{cursor:"pointer",flexShrink:0},children:[o.jsx("path",{d:"M10.5213 2.62368C11.3147 1.75255 12.6853 1.75255 13.4787 2.62368L14.4989 3.74391C14.8998 4.18418 15.4761 4.42288 16.071 4.39508L17.5845 4.32435C18.7614 4.26934 19.7307 5.23857 19.6757 6.41554L19.6049 7.92905C19.5771 8.52388 19.8158 9.10016 20.2561 9.50111L21.3763 10.5213C22.2475 11.3147 22.2475 12.6853 21.3763 13.4787L20.2561 14.4989C19.8158 14.8998 19.5771 15.4761 19.6049 16.071L19.6757 17.5845C19.7307 18.7614 18.7614 19.7307 17.5845 19.6757L16.071 19.6049C15.4761 19.5771 14.8998 19.8158 14.4989 20.2561L13.4787 21.3763C12.6853 22.2475 11.3147 22.2475 10.5213 21.3763L9.50111 20.2561C9.10016 19.8158 8.52388 19.5771 7.92905 19.6049L6.41554 19.6757C5.23857 19.7307 4.26934 18.7614 4.32435 17.5845L4.39508 16.071C4.42288 15.4761 4.18418 14.8998 3.74391 14.4989L2.62368 13.4787C1.75255 12.6853 1.75255 11.3147 2.62368 10.5213L3.74391 9.50111C4.18418 9.10016 4.42288 8.52388 4.39508 7.92905L4.32435 6.41554C4.26934 5.23857 5.23857 4.26934 6.41554 4.32435L7.92905 4.39508C8.52388 4.42288 9.10016 4.18418 9.50111 3.74391L10.5213 2.62368Z",fill:"#0685FF"}),o.jsx("path",{d:"M10.5 15.5L6.5 11.5L7.91 10.09L10.5 12.67L16.09 7.09L17.5 8.5L10.5 15.5Z",fill:"white"})]})})]}),o.jsxs(f.Box,{fontSize:"md",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:[t,n?` • ${n}`:""]})]}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"4",mt:"1",children:[c&&o.jsxs(f.Box,{display:"inline-flex",alignItems:"center",gap:"2",px:"3",py:"1.5",bg:"status.success.tint",color:"status.success",borderRadius:"md",fontSize:"sm",fontWeight:"medium",children:[o.jsx(f.Box,{w:"1.5",h:"1.5",borderRadius:"full",bg:"status.success"}),u]}),c&&a&&o.jsx(f.Box,{w:"1px",h:"20px",bg:"border"}),a&&o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",fontSize:"sm",color:"text.heading",children:[o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",color:"var(--chakra-colors-text-muted)",children:[o.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),o.jsx("path",{d:"M9 12l2 2 4-4"})]}),a]})]}),o.jsx(f.Box,{borderTop:"1px solid",borderColor:"border",my:"1"}),o.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[l&&o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:"Consultation fee"}),o.jsx(f.Box,{fontSize:"xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",children:l})]}),o.jsxs(f.Box,{display:"flex",gap:"3",alignItems:"center",children:[m&&o.jsx(f.Box,{as:"button",px:"3",py:"2",fontSize:"md",fontWeight:"medium",fontFamily:"var(--font-body)",bg:"transparent",color:"text.body",border:"none",cursor:"pointer",transition:"all 0.15s",_hover:{color:"blue.500"},onClick:m,children:"view"}),h&&o.jsx(f.Box,{as:"button",px:"5",py:"2.5",fontSize:"sm",fontWeight:"semibold",fontFamily:"var(--font-body)",bg:"blue.500",color:"white",borderRadius:"md",border:"none",cursor:"pointer",transition:"all 0.15s",_hover:{bg:"blue.600"},onClick:h,children:"Consult Now"})]})]})]})]}):p==="compact"?o.jsxs(f.Box,{bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",p:"5",display:"flex",flexDirection:"column",gap:"4",transition:"all 0.2s ease",_hover:{transform:"translateY(-2px)",borderColor:"blue.200"},...x,children:[o.jsxs(f.Box,{display:"flex",gap:"4",alignItems:"flex-start",justifyContent:"space-between",children:[o.jsxs(f.Box,{display:"flex",gap:"4",children:[o.jsx(f.Box,{flexShrink:0,children:r?o.jsx("img",{src:r,alt:e,style:{width:64,height:64,borderRadius:"50%",objectFit:"cover",display:"block"}}):o.jsx(f.Box,{w:"64px",h:"64px",borderRadius:"full",bg:"blue.500",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"2xl",fontWeight:"bold",color:"white",children:e.charAt(0)})}),o.jsxs(f.Box,{pt:"1",children:[o.jsx(f.Box,{fontSize:"xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",children:e}),o.jsxs(f.Box,{fontSize:"md",color:"text.muted",fontFamily:"var(--font-body)",children:[t,n&&p!=="compact"?` • ${n}`:""]})]})]}),m&&o.jsx(f.Box,{as:"button",fontSize:"md",fontWeight:"medium",fontFamily:"var(--font-body)",bg:"transparent",color:"text.heading",border:"none",cursor:"pointer",_hover:{color:"blue.500"},onClick:m,pt:"1",children:"View"})]}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1.5",fontSize:"md",color:"text.muted",fontFamily:"var(--font-body)",children:[o.jsx(f.Box,{as:"span",color:"status.warning",mt:"-2px",children:o.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"})})}),o.jsxs(f.Box,{as:"span",color:"text.heading",mr:"1",children:[(i==null?void 0:i.toFixed(1))||"New"," ",s?`(${s})`:""]}),n&&o.jsxs(f.Box,{as:"span",children:[" • ",n]}),a&&o.jsxs(f.Box,{as:"span",children:[" • ",a]})]}),o.jsx(f.Box,{borderTop:"1px solid",borderColor:"border",mt:"1"}),o.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"1",children:[l&&o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:"Consultation fee"}),o.jsx(f.Box,{fontSize:"xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",children:l})]}),h&&o.jsx(f.Box,{as:"button",px:"5",py:"2.5",fontSize:"sm",fontWeight:"semibold",fontFamily:"var(--font-body)",bg:"blue.500",color:"white",borderRadius:"md",border:"none",cursor:"pointer",transition:"all 0.15s",_hover:{bg:"blue.600"},onClick:h,children:"Consult Now"})]})]}):o.jsxs(f.Box,{bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",p:"5",display:"flex",flexDirection:"column",gap:"4",transition:"all 0.2s ease",_hover:{transform:"translateY(-2px)",borderColor:"blue.200"},...x,children:[o.jsxs(f.Box,{display:"flex",gap:"4",alignItems:"flex-start",justifyContent:"space-between",children:[o.jsxs(f.Box,{display:"flex",gap:"4",minW:"0",flex:"1",children:[o.jsx(f.Box,{flexShrink:0,children:r?o.jsx("img",{src:r,alt:e,style:{width:64,height:64,borderRadius:"50%",objectFit:"cover",display:"block"}}):o.jsx(f.Box,{w:"64px",h:"64px",borderRadius:"full",bg:"blue.500",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"2xl",fontWeight:"bold",color:"white",children:e.charAt(0)})}),o.jsxs(f.Box,{pt:"1",minW:"0",flex:"1",children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",minW:"0",children:[o.jsx(f.Box,{fontSize:"xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minW:"0",flex:"1",children:e}),d&&o.jsx(At,{label:"This practitioner's identity has been verified by MedixDeck",placement:"top",children:o.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{cursor:"pointer",flexShrink:0},children:[o.jsx("path",{d:"M10.5213 2.62368C11.3147 1.75255 12.6853 1.75255 13.4787 2.62368L14.4989 3.74391C14.8998 4.18418 15.4761 4.42288 16.071 4.39508L17.5845 4.32435C18.7614 4.26934 19.7307 5.23857 19.6757 6.41554L19.6049 7.92905C19.5771 8.52388 19.8158 9.10016 20.2561 9.50111L21.3763 10.5213C22.2475 11.3147 22.2475 12.6853 21.3763 13.4787L20.2561 14.4989C19.8158 14.8998 19.5771 15.4761 19.6049 16.071L19.6757 17.5845C19.7307 18.7614 18.7614 19.7307 17.5845 19.6757L16.071 19.6049C15.4761 19.5771 14.8998 19.8158 14.4989 20.2561L13.4787 21.3763C12.6853 22.2475 11.3147 22.2475 10.5213 21.3763L9.50111 20.2561C9.10016 19.8158 8.52388 19.5771 7.92905 19.6049L6.41554 19.6757C5.23857 19.7307 4.26934 18.7614 4.32435 17.5845L4.39508 16.071C4.42288 15.4761 4.18418 14.8998 3.74391 14.4989L2.62368 13.4787C1.75255 12.6853 1.75255 11.3147 2.62368 10.5213L3.74391 9.50111C4.18418 9.10016 4.42288 8.52388 4.39508 7.92905L4.32435 6.41554C4.26934 5.23857 5.23857 4.26934 6.41554 4.32435L7.92905 4.39508C8.52388 4.42288 9.10016 4.18418 9.50111 3.74391L10.5213 2.62368Z",fill:"#0685FF"}),o.jsx("path",{d:"M10.5 15.5L6.5 11.5L7.91 10.09L10.5 12.67L16.09 7.09L17.5 8.5L10.5 15.5Z",fill:"white"})]})})]}),o.jsxs(f.Box,{fontSize:"md",color:"text.muted",fontFamily:"var(--font-body)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:[t,n?` • ${n}`:""]})]})]}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1",fontSize:"md",color:"text.heading",fontFamily:"var(--font-body)",pt:"1",children:[o.jsx(f.Box,{as:"span",color:"status.warning",mt:"-2px",children:o.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor",children:o.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"})})}),(i==null?void 0:i.toFixed(1))||"New"," ",s?o.jsxs(f.Box,{as:"span",color:"text.muted",children:["(",s,")"]}):null]})]}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"4",mt:"1",children:[c&&o.jsxs(f.Box,{display:"inline-flex",alignItems:"center",gap:"2",px:"3",py:"1.5",bg:"status.success.tint",color:"status.success",borderRadius:"md",fontSize:"sm",fontWeight:"medium",children:[o.jsx(f.Box,{w:"1.5",h:"1.5",borderRadius:"full",bg:"status.success"}),u]}),c&&a&&o.jsx(f.Box,{w:"1px",h:"20px",bg:"border"}),a&&o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",fontSize:"sm",color:"text.heading",children:[o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",color:"var(--chakra-colors-text-muted)",children:[o.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),o.jsx("path",{d:"M9 12l2 2 4-4"})]}),a]})]}),o.jsx(f.Box,{borderTop:"1px solid",borderColor:"border",my:"1"}),o.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"1",children:[l&&o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:"Consultation fee"}),o.jsx(f.Box,{fontSize:"xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",children:l})]}),o.jsxs(f.Box,{display:"flex",gap:"3",alignItems:"center",children:[m&&o.jsx(f.Box,{as:"button",px:"4",py:"2",fontSize:"md",fontWeight:"medium",fontFamily:"var(--font-body)",bg:"transparent",color:"text.heading",border:"1px solid",borderColor:"border",borderRadius:"md",cursor:"pointer",transition:"all 0.15s",_hover:{borderColor:"blue.400",color:"blue.500"},onClick:m,children:"view"}),h&&o.jsx(f.Box,{as:"button",px:"5",py:"2.5",fontSize:"sm",fontWeight:"semibold",fontFamily:"var(--font-body)",bg:"blue.500",color:"white",borderRadius:"md",border:"none",cursor:"pointer",transition:"all 0.15s",_hover:{bg:"blue.600"},onClick:h,children:"Consult Now"})]})]})]})}const Q6={normal:{bg:"color-mix(in srgb, var(--chakra-colors-status-success) 8%, transparent)",indicator:"status.success",border:"color-mix(in srgb, var(--chakra-colors-status-success) 20%, transparent)",text:"status.success",ariaLabel:"Normal",icon:o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:[o.jsx("circle",{cx:"12",cy:"12",r:"11",fill:"var(--chakra-colors-status-success)"}),o.jsx("path",{d:"M7 12.5l3.5 3.5 6.5-7",stroke:"white",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})]})},warning:{bg:"color-mix(in srgb, var(--chakra-colors-status-warning) 8%, transparent)",indicator:"status.warning",border:"color-mix(in srgb, var(--chakra-colors-status-warning) 20%, transparent)",text:"status.warning",ariaLabel:"Warning",icon:o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:[o.jsx("path",{d:"M12 2L2 21h20L12 2z",fill:"var(--chakra-colors-status-warning)"}),o.jsx("path",{d:"M12 9v5",stroke:"white",strokeWidth:"2.2",strokeLinecap:"round"}),o.jsx("circle",{cx:"12",cy:"17",r:"1",fill:"white"})]})},critical:{bg:"color-mix(in srgb, var(--chakra-colors-status-error) 8%, transparent)",indicator:"status.error",border:"color-mix(in srgb, var(--chakra-colors-status-error) 20%, transparent)",text:"status.error",ariaLabel:"Critical",icon:o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:[o.jsx("path",{d:"M8.5 2h7l6.5 6.5v7L15.5 22h-7L2 15.5v-7L8.5 2z",fill:"var(--chakra-colors-status-error)"}),o.jsx("path",{d:"M12 7v6",stroke:"white",strokeWidth:"2.2",strokeLinecap:"round"}),o.jsx("circle",{cx:"12",cy:"16.5",r:"1",fill:"white"})]})}};function e3({label:e,value:t,unit:n,status:r="normal",...i}){const s=Q6[r];return o.jsxs(f.Box,{display:"inline-flex",alignItems:"center",gap:"2",px:"3",py:"2",borderRadius:"md",bg:s.bg,border:"1px solid",borderColor:s.border,...i,children:[o.jsx("span",{"aria-label":s.ariaLabel,style:{display:"inline-flex",alignItems:"center",flexShrink:0},children:s.icon}),o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"2xs",color:"text.muted",fontFamily:"var(--font-body)",textTransform:"uppercase",letterSpacing:"wide",children:e}),o.jsxs(f.Box,{display:"flex",alignItems:"baseline",gap:"1",children:[o.jsx(f.Box,{fontSize:"md",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-mono, monospace)",children:t}),n&&o.jsx(f.Box,{fontSize:"xs",color:s.text,fontFamily:"var(--font-body)",children:n})]})]})]})}const t3={upcoming:{label:"Upcoming",color:"info"},completed:{label:"Completed",color:"success"},cancelled:{label:"Cancelled",color:"error"}};function n3({doctorName:e,doctorSpecialty:t,doctorAvatar:n,date:r,time:i,type:s="video",status:a="upcoming",onCancel:l,onReschedule:d,onJoin:c,...u}){const h=t3[a];return o.jsxs(f.Box,{bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",p:"5",display:"flex",flexDirection:"column",gap:"4",...u,children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"3",children:[n?o.jsx("img",{src:n,alt:e,style:{width:40,height:40,borderRadius:"50%",objectFit:"cover",display:"block"}}):o.jsx(f.Box,{w:"10",h:"10",borderRadius:"full",bg:"blue.500",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"md",fontWeight:"bold",color:"white",children:e.charAt(0)}),o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"md",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",children:e}),t&&o.jsx(f.Box,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:t})]})]}),o.jsx(ss,{status:h.color,size:"sm",children:h.label})]}),o.jsxs(f.Box,{display:"flex",gap:"4",py:"3",borderTop:"1px solid",borderBottom:"1px solid",borderColor:"border",children:[o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:"Date"}),o.jsx(f.Box,{fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:r})]}),o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:"Time"}),o.jsx(f.Box,{fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:i})]}),o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:"Type"}),o.jsx(f.Box,{fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",textTransform:"capitalize",children:s==="video"?"🎥 Video Call":"🏥 In-Person"})]})]}),a==="upcoming"&&o.jsxs(f.Box,{display:"flex",gap:"2",children:[c&&o.jsx(f.Box,{as:"button",flex:"1",py:"2",bg:"blue.500",color:"white",borderRadius:"md",border:"none",fontSize:"sm",fontWeight:"semibold",fontFamily:"var(--font-body)",cursor:"pointer",_hover:{bg:"blue.600"},transition:"all 0.15s",onClick:c,children:"Join Call"}),d&&o.jsx(f.Box,{as:"button",flex:"1",py:"2",bg:"transparent",color:"text.body",border:"1px solid",borderColor:"border",borderRadius:"md",fontSize:"sm",fontWeight:"medium",fontFamily:"var(--font-body)",cursor:"pointer",_hover:{borderColor:"blue.400",color:"blue.500"},transition:"all 0.15s",onClick:d,children:"Reschedule"}),l&&o.jsx(f.Box,{as:"button",py:"2",px:"3",bg:"transparent",color:"red.500",border:"1px solid",borderColor:"red.200",borderRadius:"md",fontSize:"sm",fontFamily:"var(--font-body)",cursor:"pointer",_hover:{bg:"red.50"},transition:"all 0.15s",onClick:l,children:"Cancel"})]})]})}const r3={active:{label:"Active",bg:"color-mix(in srgb, var(--chakra-colors-status-success) 12%, transparent)",color:"var(--chakra-colors-status-success)"},expired:{label:"Expired",bg:"color-mix(in srgb, var(--chakra-colors-status-error) 10%, transparent)",color:"var(--chakra-colors-status-error)"},dispensed:{label:"Dispensed",bg:"color-mix(in srgb, var(--chakra-colors-blue-500) 10%, transparent)",color:"var(--chakra-colors-blue-500)"}},i3=()=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z"}),o.jsx("path",{d:"m8.5 8.5 7 7"})]}),o3=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),o.jsx("polyline",{points:"7 10 12 15 17 10"}),o.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),Yc=()=>o.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),o.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),o.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),o.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]});function s3({rxId:e,doctorName:t,doctorSpecialty:n,issuedDate:r,expiryDate:i,drugs:s,refillsRemaining:a,status:l="active",colorScheme:d="blue",onDownload:c,...u}){const h=r3[l],m=d==="purple"?"#7700CC":"#0685FF",p=d==="purple"?"color-mix(in srgb, #7700CC 8%, transparent)":"color-mix(in srgb, #0685FF 8%, transparent)";return o.jsxs(f.Box,{bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",overflow:"hidden",...u,children:[o.jsxs(f.Box,{px:"5",py:"3.5",display:"flex",alignItems:"center",justifyContent:"space-between",style:{borderBottom:"1px solid var(--chakra-colors-border)",background:p},children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",children:[o.jsx(f.Box,{style:{color:m},children:o.jsx(i3,{})}),o.jsx(f.Box,{fontSize:"sm",fontWeight:"700",fontFamily:"var(--font-heading)",style:{color:m},children:"Prescription"}),e&&o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:e})]}),o.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:4,fontSize:11,fontWeight:600,fontFamily:"var(--font-body)",background:h.bg,color:h.color},children:[o.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:h.color,display:"inline-block"}}),h.label]})]}),o.jsxs(f.Box,{px:"5",py:"3",display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid",borderColor:"border",flexWrap:"wrap",gap:"2",children:[o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"sm",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",children:t}),n&&o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:n})]}),o.jsxs(f.Box,{display:"flex",gap:"4",children:[o.jsxs(f.Box,{children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1",color:"text.muted",children:[o.jsx(Yc,{}),o.jsx(f.Box,{fontSize:"xs",fontFamily:"var(--font-body)",children:"Issued"})]}),o.jsx(f.Box,{fontSize:"xs",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:r})]}),i&&o.jsxs(f.Box,{children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1",color:"text.muted",children:[o.jsx(Yc,{}),o.jsx(f.Box,{fontSize:"xs",fontFamily:"var(--font-body)",children:"Expires"})]}),o.jsx(f.Box,{fontSize:"xs",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:i})]})]})]}),o.jsx(f.Box,{px:"5",py:"4",display:"flex",flexDirection:"column",gap:"3",children:s.map((x,g)=>o.jsxs(f.Box,{display:"flex",alignItems:"flex-start",gap:"3",p:"3",borderRadius:"md",bg:"bg.subtle",border:"1px solid",borderColor:"border",children:[o.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"50%",background:p,color:m,fontSize:11,fontWeight:700,fontFamily:"var(--font-heading)",flexShrink:0,marginTop:1},children:g+1}),o.jsxs(f.Box,{flex:"1",minW:"0",children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",flexWrap:"wrap",children:[o.jsx(f.Box,{fontSize:"sm",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",children:x.name}),o.jsx("span",{style:{padding:"1px 6px",borderRadius:4,fontSize:11,fontWeight:600,background:p,color:m,fontFamily:"var(--font-body)"},children:x.dosage})]}),o.jsxs(f.Box,{display:"flex",gap:"3",mt:"1",flexWrap:"wrap",children:[o.jsxs(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:["🕐 ",x.frequency]}),x.duration&&o.jsxs(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:["📅 ",x.duration]}),x.instructions&&o.jsxs(f.Box,{fontSize:"xs",color:"text.body",fontFamily:"var(--font-body)",fontStyle:"italic",children:["ℹ️ ",x.instructions]})]})]})]},g))}),o.jsxs(f.Box,{px:"5",py:"3",display:"flex",alignItems:"center",justifyContent:"space-between",borderTop:"1px solid",borderColor:"border",children:[a!==void 0?o.jsxs(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:[o.jsx(f.Box,{as:"span",fontWeight:"semibold",color:"text.heading",children:a})," ","refill",a!==1?"s":""," remaining"]}):o.jsx(f.Box,{}),c&&o.jsxs("button",{onClick:c,"aria-label":"Download prescription",style:{display:"inline-flex",alignItems:"center",gap:6,padding:"6px 14px",borderRadius:8,fontSize:12,fontWeight:600,fontFamily:"var(--font-body)",color:m,background:p,border:"none",cursor:"pointer",transition:"opacity 0.15s"},onMouseEnter:x=>{x.currentTarget.style.opacity="0.8"},onMouseLeave:x=>{x.currentTarget.style.opacity="1"},children:[o.jsx(o3,{}),"Download"]})]})]})}const a3={primary:{label:"Primary",bg:"color-mix(in srgb, #0685FF 10%, transparent)",color:"#0685FF",border:"color-mix(in srgb, #0685FF 25%, transparent)"},secondary:{label:"Secondary",bg:"color-mix(in srgb, #64748B 10%, transparent)",color:"#64748B",border:"color-mix(in srgb, #64748B 25%, transparent)"},chronic:{label:"Chronic",bg:"color-mix(in srgb, #F59E0B 10%, transparent)",color:"#B45309",border:"color-mix(in srgb, #F59E0B 25%, transparent)"},acute:{label:"Acute",bg:"color-mix(in srgb, #EF4444 10%, transparent)",color:"#DC2626",border:"color-mix(in srgb, #EF4444 25%, transparent)"}};function xh({code:e,description:t,category:n="primary",...r}){const i=a3[n];return o.jsxs(f.Box,{display:"inline-flex",alignItems:"center",gap:"1.5",...r,children:[o.jsx("span",{title:t,"aria-label":`ICD-10 code ${e}${t?`: ${t}`:""}`,style:{display:"inline-flex",alignItems:"center",gap:4,padding:"3px 8px",borderRadius:4,fontSize:11,fontWeight:700,fontFamily:"var(--font-mono, monospace)",background:i.bg,color:i.color,border:`1px solid ${i.border}`,cursor:t?"help":"default",whiteSpace:"nowrap"},children:e}),t&&o.jsx(f.Box,{as:"span",fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:t})]})}function gh({bloodType:e,...t}){return o.jsx(f.Box,{display:"inline-flex",alignItems:"center",...t,children:o.jsxs("span",{"aria-label":`Blood type ${e}`,style:{display:"inline-flex",alignItems:"center",gap:4,padding:"3px 10px",borderRadius:4,fontSize:12,fontWeight:800,fontFamily:"var(--font-heading)",background:"color-mix(in srgb, #DC2626 12%, transparent)",color:"#DC2626",border:"1px solid color-mix(in srgb, #DC2626 30%, transparent)",letterSpacing:"0.02em"},children:[o.jsx("svg",{width:"10",height:"12",viewBox:"0 0 12 16",fill:"currentColor","aria-hidden":"true",children:o.jsx("path",{d:"M6 0C6 0 0 7.5 0 11a6 6 0 0 0 12 0C12 7.5 6 0 6 0z"})}),e]})})}const l3={mild:{label:"Mild",bg:"color-mix(in srgb, #F59E0B 8%, transparent)",color:"#B45309",border:"color-mix(in srgb, #F59E0B 30%, transparent)",icon:"⚠"},moderate:{label:"Moderate",bg:"color-mix(in srgb, #F97316 10%, transparent)",color:"#C2410C",border:"color-mix(in srgb, #F97316 30%, transparent)",icon:"⚠"},severe:{label:"Severe",bg:"color-mix(in srgb, #EF4444 10%, transparent)",color:"#DC2626",border:"color-mix(in srgb, #EF4444 30%, transparent)",icon:"🚫"},"life-threatening":{label:"Life-threatening",bg:"color-mix(in srgb, #7F1D1D 15%, transparent)",color:"#991B1B",border:"#DC2626",icon:"⛔"}};function yh({allergen:e,severity:t="mild",...n}){const r=l3[t];return o.jsx(f.Box,{display:"inline-flex",alignItems:"center",...n,children:o.jsxs("span",{"aria-label":`Allergy: ${e} — ${r.label} severity`,style:{display:"inline-flex",alignItems:"center",gap:5,padding:"3px 8px",borderRadius:4,fontSize:11,fontWeight:600,fontFamily:"var(--font-body)",background:r.bg,color:r.color,border:`1px solid ${r.border}`,borderLeftWidth:t==="life-threatening"?3:1,whiteSpace:"nowrap"},children:[o.jsx("span",{"aria-hidden":"true",children:r.icon}),e,o.jsxs("span",{style:{opacity:.7,fontSize:10},children:["· ",r.label]})]})})}function c3({diagnoses:e,bloodType:t,allergies:n,direction:r="row",...i}){return o.jsxs(f.Box,{display:"flex",flexDirection:r,flexWrap:"wrap",gap:"2",alignItems:r==="row"?"center":"flex-start",...i,children:[t&&o.jsx(gh,{bloodType:t}),e==null?void 0:e.map((s,a)=>o.jsx(xh,{code:s.code,description:s.description,category:s.category},a)),n==null?void 0:n.map((s,a)=>o.jsx(yh,{allergen:s.allergen,severity:s.severity},a))]})}var bh={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Kc=k.createContext&&k.createContext(bh),u3=["attr","size","title"];function d3(e,t){if(e==null)return{};var n,r,i=f3(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function f3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ci(){return ci=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ci.apply(null,arguments)}function qc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ui(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qc(Object(n),!0).forEach(function(r){h3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function h3(e,t,n){return(t=p3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p3(e){var t=m3(e,"string");return typeof t=="symbol"?t:t+""}function m3(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vh(e){return e&&e.map((t,n)=>k.createElement(t.tag,ui({key:n},t.attr),vh(t.child)))}function rt(e){return t=>k.createElement(x3,ci({attr:ui({},e.attr)},t),vh(e.child))}function x3(e){var t=n=>{var{attr:r,size:i,title:s}=e,a=d3(e,u3),l=i||n.size||"1em",d;return n.className&&(d=n.className),e.className&&(d=(d?d+" ":"")+e.className),k.createElement("svg",ci({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,a,{className:d,style:ui(ui({color:e.color||n.color},n.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),s&&k.createElement("title",null,s),e.children)};return Kc!==void 0?k.createElement(Kc.Consumer,null,n=>t(n)):t(bh)}function g3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"},child:[]},{tag:"rect",attr:{x:"2",y:"6",width:"14",height:"12",rx:"2"},child:[]}]})(e)}function y3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196"},child:[]},{tag:"path",attr:{d:"M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2"},child:[]},{tag:"path",attr:{d:"m2 2 20 20"},child:[]}]})(e)}function b3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M13 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-3"},child:[]},{tag:"path",attr:{d:"M8 21h8"},child:[]},{tag:"path",attr:{d:"M12 17v4"},child:[]},{tag:"path",attr:{d:"m17 8 5-5"},child:[]},{tag:"path",attr:{d:"M17 3h5v5"},child:[]}]})(e)}function v3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z"},child:[]},{tag:"path",attr:{d:"m8.5 8.5 7 7"},child:[]}]})(e)}function k3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"},child:[]},{tag:"line",attr:{x1:"22",x2:"2",y1:"2",y2:"22"},child:[]}]})(e)}function w3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"},child:[]},{tag:"path",attr:{d:"M14.05 2a9 9 0 0 1 8 7.94"},child:[]},{tag:"path",attr:{d:"M14.05 6A5 5 0 0 1 18 10"},child:[]}]})(e)}function S3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"},child:[]},{tag:"path",attr:{d:"M19 10v2a7 7 0 0 1-14 0v-2"},child:[]},{tag:"line",attr:{x1:"12",x2:"12",y1:"19",y2:"22"},child:[]}]})(e)}function C3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"2",x2:"22",y1:"2",y2:"22"},child:[]},{tag:"path",attr:{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2"},child:[]},{tag:"path",attr:{d:"M5 10v2a7 7 0 0 0 12 5"},child:[]},{tag:"path",attr:{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33"},child:[]},{tag:"path",attr:{d:"M9 9v3a3 3 0 0 0 5.12 2.12"},child:[]},{tag:"line",attr:{x1:"12",x2:"12",y1:"19",y2:"22"},child:[]}]})(e)}function j3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"},child:[]},{tag:"polyline",attr:{points:"16 17 21 12 16 7"},child:[]},{tag:"line",attr:{x1:"21",x2:"9",y1:"12",y2:"12"},child:[]}]})(e)}function T3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 6v4"},child:[]},{tag:"path",attr:{d:"M14 14h-4"},child:[]},{tag:"path",attr:{d:"M14 18h-4"},child:[]},{tag:"path",attr:{d:"M14 8h-4"},child:[]},{tag:"path",attr:{d:"M18 12h2a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2h2"},child:[]},{tag:"path",attr:{d:"M18 22V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v18"},child:[]}]})(e)}function B3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2"},child:[]},{tag:"path",attr:{d:"M8.5 2h7"},child:[]},{tag:"path",attr:{d:"M7 16h10"},child:[]}]})(e)}function E3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"},child:[]},{tag:"path",attr:{d:"M14 2v4a2 2 0 0 0 2 2h4"},child:[]},{tag:"path",attr:{d:"M10 9H8"},child:[]},{tag:"path",attr:{d:"M16 13H8"},child:[]},{tag:"path",attr:{d:"M16 17H8"},child:[]}]})(e)}function F3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]}]})(e)}function A3(e){return rt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"},child:[]}]})(e)}const L3=({muted:e})=>e?o.jsx(C3,{size:18,"aria-hidden":"true"}):o.jsx(S3,{size:18,"aria-hidden":"true"}),I3=({off:e})=>e?o.jsx(y3,{size:18,"aria-hidden":"true"}):o.jsx(g3,{size:18,"aria-hidden":"true"}),D3=({active:e})=>o.jsx(b3,{size:18,color:e?"var(--chakra-colors-status-success, #16A34A)":"currentColor","aria-hidden":"true"}),R3=()=>o.jsx(k3,{size:18,"aria-hidden":"true"});function M3({participantName:e,participantRole:t,participantAvatar:n,duration:r,isMuted:i=!1,isCameraOff:s=!1,isSharingScreen:a=!1,onToggleMute:l,onToggleCamera:d,onEndCall:c,onShareScreen:u,position:h="bottom",variant:m="adaptive",...p}){const[x,g]=k.useState(i),[v,y]=k.useState(s),j=m==="dark",w=()=>{g(C=>!C),l==null||l()},A=()=>{y(C=>!C),d==null||d()},B=({onClick:C,ariaLabel:O,active:E,isEndCall:F=!1,children:L})=>{let R=j?"rgba(255,255,255,0.1)":"var(--chakra-colors-bg-subtle, #F0F4F8)",D=j?"white":"var(--chakra-colors-text-heading, #111926)",N=j?"rgba(255,255,255,0.2)":"var(--chakra-colors-border, #E2E8F0)";return F?(R="var(--chakra-colors-status-error, #DC2626)",D="white",N="color-mix(in srgb, var(--chakra-colors-status-error, #DC2626) 85%, black)"):E&&(R="var(--chakra-colors-status-error-tint, rgba(220,38,38,0.15))",D="var(--chakra-colors-status-error, #DC2626)",N="var(--chakra-colors-status-error-tint, rgba(220,38,38,0.25))"),o.jsx("button",{onClick:C,"aria-label":O,"aria-pressed":E,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:44,height:44,borderRadius:"50%",border:E?"1px solid var(--chakra-colors-status-error)":"1px solid transparent",cursor:"pointer",transition:"all 0.15s ease",background:R,color:D,WebkitTapHighlightColor:"transparent"},onMouseEnter:P=>{const I=P.currentTarget;I.style.background=N,I.style.transform="scale(1.06)"},onMouseLeave:P=>{const I=P.currentTarget;I.style.background=R,I.style.transform="scale(1)"},children:L})};return o.jsxs(f.Box,{position:"fixed",...h==="bottom"?{bottom:"0"}:{top:"0"},left:"0",right:"0",zIndex:"overlay",display:"flex",alignItems:"center",justifyContent:"space-between",px:{base:"4",md:"8"},flexWrap:"wrap",gap:"4",bg:j?void 0:"bg.surface",borderColor:"border",style:{minHeight:72,paddingTop:12,paddingBottom:h==="bottom"?"calc(12px + env(safe-area-inset-bottom, 0px))":12,background:j?"linear-gradient(135deg, #0A1220 0%, #0F1C2E 100%)":void 0,borderTop:h==="bottom"?"1px solid var(--chakra-colors-border)":"none",borderBottom:h==="top"?"1px solid var(--chakra-colors-border)":"none",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)",transition:"background 0.2s ease, border-color 0.2s ease"},...p,children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"3",children:[o.jsx(di,{src:n,name:e,size:"md"}),o.jsxs(f.Box,{children:[o.jsx(f.Box,{fontSize:"sm",fontWeight:"semibold",fontFamily:"var(--font-heading)",color:j?"white":"text.heading",children:e}),t&&o.jsx(f.Box,{fontSize:"xs",fontFamily:"var(--font-body)",color:j?"rgba(255,255,255,0.6)":"text.muted",children:t})]}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",ml:"2",children:[o.jsxs("span",{"aria-label":"Live call",style:{display:"inline-flex",alignItems:"center",gap:5,padding:"2px 8px",borderRadius:4,fontSize:10,fontWeight:700,background:"var(--chakra-colors-status-error-tint, rgba(220,38,38,0.15))",color:"var(--chakra-colors-status-error, #DC2626)",fontFamily:"var(--font-body)",letterSpacing:"0.05em"},children:[o.jsx("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:"50%",background:"var(--chakra-colors-status-error, #DC2626)",display:"inline-block",animation:"medixPulse 1.5s ease-in-out infinite"}}),"LIVE"]}),r&&o.jsx(f.Box,{fontSize:"sm",fontFamily:"var(--font-mono, monospace)",fontWeight:"600",color:j?"rgba(255,255,255,0.8)":"text.heading",style:{letterSpacing:"0.05em"},children:r})]})]}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",children:[l&&o.jsx(B,{onClick:w,ariaLabel:x?"Unmute microphone":"Mute microphone",active:x,children:o.jsx(L3,{muted:x})}),d&&o.jsx(B,{onClick:A,ariaLabel:v?"Turn camera on":"Turn camera off",active:v,children:o.jsx(I3,{off:v})}),u&&o.jsx(B,{onClick:u,ariaLabel:a?"Stop sharing screen":"Share screen",active:a,children:o.jsx(D3,{active:a})}),c&&o.jsx(B,{onClick:c,ariaLabel:"End call",isEndCall:!0,children:o.jsx(R3,{})})]})]})}const P3={consultation:{bg:"color-mix(in srgb, #0685FF 12%, transparent)",color:"#0685FF",icon:o.jsx(w3,{size:14,"aria-hidden":"true"})},lab:{bg:"color-mix(in srgb, #7700CC 12%, transparent)",color:"#7700CC",icon:o.jsx(B3,{size:14,"aria-hidden":"true"})},prescription:{bg:"color-mix(in srgb, #10B981 12%, transparent)",color:"#10B981",icon:o.jsx(v3,{size:14,"aria-hidden":"true"})},vitals:{bg:"color-mix(in srgb, #F59E0B 12%, transparent)",color:"#D97706",icon:o.jsx(A3,{size:14,"aria-hidden":"true"})},note:{bg:"color-mix(in srgb, #64748B 12%, transparent)",color:"#64748B",icon:o.jsx(E3,{size:14,"aria-hidden":"true"})},admission:{bg:"color-mix(in srgb, #EF4444 12%, transparent)",color:"#EF4444",icon:o.jsx(T3,{size:14,"aria-hidden":"true"})},discharge:{bg:"color-mix(in srgb, #10B981 12%, transparent)",color:"#10B981",icon:o.jsx(j3,{size:14,"aria-hidden":"true"})},custom:{bg:"color-mix(in srgb, #0685FF 10%, transparent)",color:"#0685FF",icon:o.jsx(F3,{size:14,"aria-hidden":"true"})}},Xc={success:{bg:"color-mix(in srgb, #10B981 12%, transparent)",color:"#10B981"},warning:{bg:"color-mix(in srgb, #F59E0B 12%, transparent)",color:"#D97706"},error:{bg:"color-mix(in srgb, #EF4444 12%, transparent)",color:"#EF4444"},info:{bg:"color-mix(in srgb, #0685FF 12%, transparent)",color:"#0685FF"},neutral:{bg:"color-mix(in srgb, #64748B 12%, transparent)",color:"#64748B"}};function O3(){return o.jsxs(f.Box,{display:"flex",gap:"4",alignItems:"flex-start",children:[o.jsxs(f.Box,{flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",children:[o.jsx(f.Box,{w:"8",h:"8",borderRadius:"full",bg:"bg.subtle",style:{animation:"medix-shimmer 1.5s infinite"}}),o.jsx(f.Box,{w:"px",flex:"1",minH:"8",bg:"border",mt:"2"})]}),o.jsxs(f.Box,{flex:"1",pb:"6",children:[o.jsx(f.Box,{h:"4",bg:"bg.subtle",borderRadius:"full",w:"40%",mb:"2",style:{animation:"medix-shimmer 1.5s infinite"}}),o.jsx(f.Box,{h:"3",bg:"bg.subtle",borderRadius:"full",w:"65%",style:{animation:"medix-shimmer 1.5s infinite"}})]})]})}function z3({events:e,compact:t=!1,isLoading:n=!1,loadingCount:r=4,colorScheme:i="blue",...s}){const a=i==="purple"?"var(--chakra-colors-purple-200, rgba(119,0,204,0.2))":"var(--chakra-colors-blue-200, rgba(6,133,255,0.2))";return n?o.jsx(f.Box,{...s,children:Array.from({length:r}).map((l,d)=>o.jsx(O3,{},d))}):o.jsx(f.Box,{...s,role:"feed","aria-label":"Patient medical timeline",children:e.map((l,d)=>{const c=P3[l.type],u=d===e.length-1;return o.jsxs(f.Box,{display:"flex",gap:"4",alignItems:"flex-start",role:"article","aria-label":`${l.title} on ${l.date}`,children:[o.jsxs(f.Box,{flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",children:[o.jsx(f.Box,{w:"8",h:"8",borderRadius:"full",display:"flex",alignItems:"center",justifyContent:"center",style:{background:c.bg,color:c.color,border:`1.5px solid ${c.color}40`,cursor:l.onClick?"pointer":"default",transition:"transform 0.15s, box-shadow 0.15s",flexShrink:0},onClick:l.onClick,role:l.onClick?"button":void 0,tabIndex:l.onClick?0:void 0,onKeyDown:l.onClick?h=>{(h.key==="Enter"||h.key===" ")&&l.onClick()}:void 0,_hover:l.onClick?{transform:"scale(1.1)"}:void 0,children:l.icon??c.icon}),!u&&o.jsx(f.Box,{w:"1px",flex:"1",minH:"8",mt:"1",style:{background:a}})]}),o.jsxs(f.Box,{flex:"1",pb:u?"0":"5",cursor:l.onClick?"pointer":"default",onClick:l.onClick,_hover:l.onClick?{opacity:.85}:void 0,transition:"opacity 0.15s",children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",flexWrap:"wrap",children:[o.jsx(f.Box,{fontSize:"sm",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",children:l.title}),l.badgeLabel&&l.badgeStatus&&o.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"1px 7px",borderRadius:4,fontSize:11,fontWeight:600,fontFamily:"var(--font-body)",background:Xc[l.badgeStatus].bg,color:Xc[l.badgeStatus].color},children:l.badgeLabel})]}),!t&&l.description&&o.jsx(f.Box,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:l.description}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"3",mt:"1",flexWrap:"wrap",children:[o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:l.date}),l.provider&&o.jsxs(o.Fragment,{children:[o.jsx(f.Box,{w:"1px",h:"3",style:{background:"var(--chakra-colors-border)"}}),o.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:l.provider})]})]})]})]},l.id)})})}Object.defineProperty(exports,"Box",{enumerable:!0,get:()=>f.Box});Object.defineProperty(exports,"Center",{enumerable:!0,get:()=>f.Center});Object.defineProperty(exports,"Flex",{enumerable:!0,get:()=>f.Flex});Object.defineProperty(exports,"Grid",{enumerable:!0,get:()=>f.Grid});Object.defineProperty(exports,"GridItem",{enumerable:!0,get:()=>f.GridItem});Object.defineProperty(exports,"HStack",{enumerable:!0,get:()=>f.HStack});Object.defineProperty(exports,"Heading",{enumerable:!0,get:()=>f.Heading});Object.defineProperty(exports,"Icon",{enumerable:!0,get:()=>f.Icon});Object.defineProperty(exports,"Image",{enumerable:!0,get:()=>f.Image});Object.defineProperty(exports,"Link",{enumerable:!0,get:()=>f.Link});Object.defineProperty(exports,"SimpleGrid",{enumerable:!0,get:()=>f.SimpleGrid});Object.defineProperty(exports,"Stack",{enumerable:!0,get:()=>f.Stack});Object.defineProperty(exports,"Text",{enumerable:!0,get:()=>f.Text});Object.defineProperty(exports,"VStack",{enumerable:!0,get:()=>f.VStack});Object.defineProperty(exports,"Wrap",{enumerable:!0,get:()=>f.Wrap});Object.defineProperty(exports,"WrapItem",{enumerable:!0,get:()=>f.WrapItem});exports.Accordion=G6;exports.Alert=is;exports.AllergyBadge=yh;exports.AppointmentCard=n3;exports.Avatar=di;exports.AvatarGroup=sp;exports.Badge=ss;exports.BlogCard=X6;exports.BloodTypeBadge=gh;exports.Breadcrumb=x2;exports.Button=Qe;exports.Calendar=cs;exports.Card=Su;exports.CardBody=pm;exports.CardFooter=mm;exports.CardHeader=hm;exports.Checkbox=xu;exports.Combobox=Up;exports.Container=ju;exports.CookieConsentBanner=Ef;exports.DASHBOARD_MEDIX_TIER_CONFIG=ri;exports.DASHBOARD_MEDIX_TIER_ORDER=gf;exports.DRAFT_STORAGE_PREFIX=dn;exports.DashboardLayout=bf;exports.DataTable=Z6;exports.DatePicker=Vp;exports.DateRangePicker=Wp;exports.Divider=uu;exports.DoctorCard=J6;exports.Drawer=I2;exports.EmptyState=E2;exports.FileUpload=Gp;exports.Footer=kf;exports.FormControl=jp;exports.FullPageSpinner=ap;exports.ICD10Badge=xh;exports.IconButton=su;exports.Input=as;exports.Logo=cn;exports.MedicalRecordBadge=c3;exports.MedixProvider=Jh;exports.Modal=B2;exports.Navbar=s2;exports.NotFoundPage=F2;exports.OTPInput=yu;exports.PWAInstallPrompt=Af;exports.Pagination=wf;exports.PatientTimeline=z3;exports.PhoneInput=Dp;exports.PinInput=Tp;exports.PrescriptionCard=s3;exports.Progress=Cf;exports.RadioGroup=kp;exports.RichTextEditor=fm;exports.RichTextInput=us;exports.SearchInput=ls;exports.SectionHeader=gm;exports.Select=vp;exports.ServerErrorPage=A2;exports.Skeleton=on;exports.SkeletonCard=w2;exports.SkeletonText=Sf;exports.Spinner=lu;exports.StatCard=Cu;exports.Stepper=v2;exports.Switch=gu;exports.TEXTAREA_DRAFT_PREFIX=un;exports.Tabs=y2;exports.Tag=cu;exports.TagInput=Yp;exports.TagsInput=bu;exports.TelehealthCallBar=M3;exports.TestimonialCard=Y6;exports.Textarea=pu;exports.ThemeColorPalette=Tu;exports.Toaster=ou;exports.Tooltip=At;exports.VitalBadge=e3;exports.clearRichTextDraft=ku;exports.clearTextareaDraft=fu;exports.colorTokens=V;exports.dismissToast=$h;exports.getEffectiveStorageKey=vu;exports.getEffectiveTextareaStorageKey=du;exports.getMedixScoreTierForScore=Wy;exports.getMedixScoreTierMeta=yf;exports.getRichTextDraft=wu;exports.getTextareaDraft=hu;exports.htmlToMarkdown=jn;exports.markdownToHtml=Mt;exports.medixConfig=ru;exports.radiiTokens=tu;exports.saveRichTextDraft=ho;exports.saveTextareaDraft=uo;exports.shadowTokens=nu;exports.spacingTokens=eu;exports.system=iu;exports.textStyleTokens=Qc;exports.toast=Zn;exports.typographyTokens=Cn;exports.useColorScheme=tp;exports.useIsDarkMode=os;exports.useThemeMode=hr;
428
428
  //# sourceMappingURL=index.cjs.map