@medixdeck/ui 0.1.23 → 0.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -15
- package/dist/index.cjs +43 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +139 -2
- package/dist/index.js +6340 -5981
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),S=require("react"),f=require("@chakra-ui/react"),ca=require("@tiptap/react"),mh=require("@tiptap/starter-kit"),gh=require("@tiptap/extension-link"),xh=require("@tiptap/extension-underline"),yh=require("@tiptap/extension-text-align"),bh=require("@tiptap/extension-placeholder");var dn=typeof document<"u"?document.currentScript:null;function vh(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 be=vh(S);var kh=(e,t,n,r,o,s,a,l)=>{let u=document.documentElement,c=["light","dark"];function d(m){(Array.isArray(e)?e:[e]).forEach(g=>{let x=g==="class",y=x&&s?o.map(v=>s[v]||v):o;x?(u.classList.remove(...y),u.classList.add(s&&s[m]?s[m]:m)):u.setAttribute(g,m)}),h(m)}function h(m){l&&c.includes(m)&&(u.style.colorScheme=m)}function p(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)d(r);else try{let m=localStorage.getItem(t)||n,g=a&&m==="system"?p():m;d(g)}catch{}},ua=["light","dark"],Yc="(prefers-color-scheme: dark)",wh=typeof window>"u",Ji=be.createContext(void 0),Sh={setTheme:e=>{},themes:[]},Ch=()=>{var e;return(e=be.useContext(Ji))!=null?e:Sh},jh=e=>be.useContext(Ji)?be.createElement(be.Fragment,null,e.children):be.createElement(Bh,{...e}),Th=["light","dark"],Bh=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:o="theme",themes:s=Th,defaultTheme:a=n?"system":"light",attribute:l="data-theme",value:u,children:c,nonce:d,scriptProps:h})=>{let[p,m]=be.useState(()=>Fh(o,a)),[g,x]=be.useState(()=>p==="system"?jo():p),y=u?Object.values(u):s,v=be.useCallback(B=>{let C=B;if(!C)return;B==="system"&&n&&(C=jo());let P=u?u[C]:C,A=t?Ah(d):null,E=document.documentElement,L=R=>{R==="class"?(E.classList.remove(...y),P&&E.classList.add(P)):R.startsWith("data-")&&(P?E.setAttribute(R,P):E.removeAttribute(R))};if(Array.isArray(l)?l.forEach(L):L(l),r){let R=ua.includes(a)?a:null,D=ua.includes(C)?C:R;E.style.colorScheme=D}A==null||A()},[d]),j=be.useCallback(B=>{let C=typeof B=="function"?B(p):B;m(C);try{localStorage.setItem(o,C)}catch{}},[p]),w=be.useCallback(B=>{let C=jo(B);x(C),p==="system"&&n&&!e&&v("system")},[p,e]);be.useEffect(()=>{let B=window.matchMedia(Yc);return B.addListener(w),w(B),()=>B.removeListener(w)},[w]),be.useEffect(()=>{let B=C=>{C.key===o&&(C.newValue?m(C.newValue):j(a))};return window.addEventListener("storage",B),()=>window.removeEventListener("storage",B)},[j]),be.useEffect(()=>{v(e??p)},[e,p]);let F=be.useMemo(()=>({theme:p,setTheme:j,forcedTheme:e,resolvedTheme:p==="system"?g:p,themes:n?[...s,"system"]:s,systemTheme:n?g:void 0}),[p,j,e,g,n,s]);return be.createElement(Ji.Provider,{value:F},be.createElement(Eh,{forcedTheme:e,storageKey:o,attribute:l,enableSystem:n,enableColorScheme:r,defaultTheme:a,value:u,themes:s,nonce:d,scriptProps:h}),c)},Eh=be.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:s,value:a,themes:l,nonce:u,scriptProps:c})=>{let d=JSON.stringify([n,t,s,e,l,a,r,o]).slice(1,-1);return be.createElement("script",{...c,suppressHydrationWarning:!0,nonce:typeof window>"u"?u:"",dangerouslySetInnerHTML:{__html:`(${kh.toString()})(${d})`}})}),Fh=(e,t)=>{if(wh)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},Ah=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)}},jo=e=>(e||(e=window.matchMedia(Yc)),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"}}},xn={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"}}},Kc={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"}},Xc={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%"}},Zc={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"}},Jc=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:xn.fonts,fontSizes:xn.fontSizes,fontWeights:xn.fontWeights,lineHeights:xn.lineHeights,letterSpacings:xn.letterSpacings,spacing:qc,radii:Xc,shadows:Zc},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:Kc}}),Qc=f.createSystem(f.defaultConfig,Jc),Lh={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:"✕"}},Qi=S.forwardRef(({status:e="info",variant:t="subtle",title:n,description:r,icon:o,onClose:s,closable:a=!1,children:l,...u},c)=>{const d=Lh[e],h=t==="solid"?d.color:d.bg,p=t==="solid"?"white":"inherit",m=t==="left-accent"?`4px solid ${d.color}`:void 0,g=t==="subtle"?`1px solid ${d.border}`:void 0;return i.jsxs(f.Box,{ref:c,role:"alert",display:"flex",alignItems:"flex-start",gap:"3",p:"4",borderRadius:"md",bg:h,border:g,borderLeft:m,color:p,...u,children:[i.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)":d.color,color:"white",mt:"0.5",children:o??d.icon}),i.jsxs(f.Box,{flex:"1",children:[n&&i.jsx(f.Box,{fontWeight:"semibold",fontSize:"sm",fontFamily:"var(--font-body)",color:t==="solid"?"white":d.color,children:n}),r&&i.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&&i.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:"×"})]})});Qi.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"),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=`
|
|
2
2
|
@keyframes medixToastProgress {
|
|
3
3
|
from { transform: scaleX(1); }
|
|
4
4
|
to { transform: scaleX(0); }
|
|
5
5
|
}
|
|
6
|
-
`,document.head.appendChild(t)}}const
|
|
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=`
|
|
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 da=!1,fa=!1;function Oh(){if(typeof document>"u"||da)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)}),Mh.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)}),da=!0}function zh(){if(typeof document>"u"||fa)return;const e=document.createElement("style");e.setAttribute("data-medixdeck","global"),e.textContent=Ph,document.head.insertBefore(e,document.head.firstChild),fa=!0}function _h({children:e,defaultColorMode:t="system",forcedColorMode:n}){return S.useEffect(()=>{Oh(),zh()},[]),i.jsx(jh,{attribute:"class",defaultTheme:t,forcedTheme:n,disableTransitionOnChange:!0,children:i.jsxs(f.ChakraProvider,{value:Qc,children:[e,i.jsx(eu,{})]})})}function Nh(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 Vh(){return typeof document>"u"?!1:document.documentElement.classList.contains("dark")||document.body.classList.contains("dark")}function ur(){const{resolvedTheme:e,setTheme:t,theme:n}=Ch(),[r,o]=S.useState(!1),s=S.useSyncExternalStore(Nh,Vh,()=>!1);S.useEffect(()=>{o(!0)},[]);const l=e==="dark"||s?"dark":"light",u=n==="light"||n==="dark"||n==="system"?n:"system",c=S.useCallback(h=>{t(h)},[t]),d=S.useCallback(()=>{t(l==="dark"?"light":"dark")},[t,l]);return{mounted:r,themeMode:l,themeSetting:u,setThemeMode:c,toggleThemeMode:d}}function es(){const{themeMode:e}=ur();return e==="dark"}function Wh(e="blue"){const[t,n]=S.useState(e),r=S.useCallback(s=>{n(s)},[]),o=S.useCallback(()=>{n(s=>s==="blue"?"purple":"blue")},[]);return{colorScheme:t,setColorScheme:r,toggleColorScheme:o,isBlue:t==="blue",isPurple:t==="purple"}}const ha={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"}},pa={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"}},Ye=S.forwardRef(({variant:e="solid",size:t="md",colorScheme:n="blue",isLoading:r=!1,leftIcon:o,rightIcon:s,disabled:a,children:l,style:u,as:c="button",href:d,target:h,rel:p,...m},g)=>{const x=ha[n]||ha.blue,y=pa[t]||pa.md,v={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"0.4rem",height:y.height,paddingLeft:y.px,paddingRight:y.px,fontSize:y.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:x.solid,color:"#FFFFFF"};break;case"outline":j={background:"transparent",color:x.fg,border:`1.5px solid ${x.solid}`};break;case"ghost":j={background:"transparent",color:x.fg,border:"none"};break;case"secondary":j={background:x.tint,color:x.fg,border:"none"};break;case"link":j={background:"transparent",color:x.fg,border:"none",padding:0,height:"auto",fontSize:y.fontSize,textDecoration:"underline",textUnderlineOffset:"3px"};break}const[w,F]=S.useState(!1),[B,C]=S.useState(!1);let P={};if((w||B)&&!a&&!r)switch(e){case"solid":P={background:B?x.solidActive:x.solidHover,boxShadow:"none"};break;case"outline":P={background:x.tint,color:x.fgHover};break;case"ghost":P={background:x.tint};break;case"secondary":P={background:x.tintHover};break;case"link":P={color:x.fgHover};break}const A={...v,...j,...P,...u};return i.jsx(c,{ref:g,type:c==="button"?m.type??"button":void 0,href:d,target:h,rel:p,disabled:c==="button"?a||r:void 0,style:A,onMouseEnter:()=>F(!0),onMouseLeave:()=>{F(!1),C(!1)},onMouseDown:()=>C(!0),onMouseUp:()=>C(!1),onFocus:E=>{E.currentTarget.style.boxShadow="none"},onBlur:E=>{E.currentTarget.style.boxShadow="none"},...m,"aria-disabled":c!=="button"&&(a||r)?!0:m["aria-disabled"],onClick:E=>{var L;if(c!=="button"&&(a||r)){E.preventDefault();return}(L=m.onClick)==null||L.call(m,E)},children:r?i.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"}}):i.jsxs(i.Fragment,{children:[o&&i.jsx("span",{style:{display:"inline-flex",flexShrink:0},children:o}),l,s&&i.jsx("span",{style:{display:"inline-flex",flexShrink:0},children:s})]})})});Ye.displayName="MedixButton";const Hh={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"}},Uh={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}},tu=S.forwardRef(({variant:e="ghost",size:t="md",colorScheme:n="blue",isRound:r=!1,disabled:o,children:s,style:a,...l},u)=>{const c=Hh[n],d=Uh[t],[h,p]=S.useState(!1),[m,g]=S.useState(!1);let x;switch(e){case"solid":x={background:h?m?c.solidActive:c.solidHover:c.solid,color:"#fff"};break;case"outline":x={background:h?c.tint:"transparent",color:c.fg,border:`1.5px solid ${c.solid}`};break;case"ghost":default:x={background:h?c.tint:"transparent",color:c.fg};break}return i.jsx("button",{ref:u,type:l.type??"button",disabled:o,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",border:"none",cursor:o?"not-allowed":"pointer",opacity:o?.55:1,outline:"none",flexShrink:0,transition:"background 0.15s ease, box-shadow 0.15s ease",...d,...r?{borderRadius:"50%"}:{},...x,...a},onMouseEnter:()=>p(!0),onMouseLeave:()=>{p(!1),g(!1)},onMouseDown:()=>g(!0),onMouseUp:()=>g(!1),onFocus:y=>{y.currentTarget.style.boxShadow="none"},onBlur:y=>{y.currentTarget.style.boxShadow="none"},...l,children:s})});tu.displayName="MedixIconButton";const $h={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"}},Gh={sm:{padding:"1px 6px",fontSize:10,lineHeight:"18px"},md:{padding:"2px 8px",fontSize:11,lineHeight:"20px"},lg:{padding:"3px 10px",fontSize:12,lineHeight:"22px"}},ts=S.forwardRef(({variant:e="subtle",status:t="neutral",size:n="md",rounded:r,children:o,style:s,...a},l)=>{const u=$h[t],c=Gh[n];let d,h,p="1px solid transparent";switch(e){case"solid":d=u.solid,h=u.solidText;break;case"outline":d="transparent",h=u.tintText,p=`1px solid ${u.border}`;break;case"surface":d=u.tint,h=u.tintText,p=`1px solid ${u.border}20`;break;case"subtle":default:d=u.tint,h=u.tintText;break}const m={display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-body)",fontWeight:500,letterSpacing:"0.03em",textTransform:"none",borderRadius:r?"100px":4,border:p,background:d,color:h,whiteSpace:"nowrap",...c,...s};return i.jsx("span",{ref:l,style:m,...a,children:o})});ts.displayName="MedixBadge";const nu={xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"xl","2xl":"2xl"},lo=S.forwardRef(({src:e,name:t,size:n="md",showStatus:r=!1,statusColor:o="green",...s},a)=>i.jsxs(f.Avatar.Root,{ref:a,size:nu[n],position:"relative",...s,children:[i.jsx(f.Avatar.Fallback,{name:t,bg:"blue.500",color:"white",fontFamily:"var(--font-body)"}),e&&i.jsx(f.Avatar.Image,{src:e,alt:t??""}),r&&i.jsx(f.Box,{position:"absolute",bottom:"0",right:"0",w:"3",h:"3",bg:o,borderRadius:"full",border:"2px solid",borderColor:"bg"})]}));lo.displayName="MedixAvatar";function Yh({children:e,max:t,size:n="md"}){const r=S.Children.toArray(e),o=t?r.slice(0,t):r,s=t?Math.max(0,r.length-t):0,a=nu[n];return i.jsxs(f.Box,{display:"flex",alignItems:"center",children:[o.map((l,u)=>i.jsx(f.Box,{ml:u===0?"0":"-2",position:"relative",zIndex:o.length-u,children:S.isValidElement(l)?S.cloneElement(l,{size:n}):l},u)),s>0&&i.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 ru({size:e="md",label:t,color:n="blue.500",...r}){return i.jsxs(f.Box,{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"2",children:[i.jsx(f.Spinner,{size:e,color:n,borderWidth:"2px",...r}),t&&i.jsx(f.Text,{textStyle:"small",color:"text.muted",children:t})]})}function Kh({label:e}){return i.jsx(f.Box,{position:"fixed",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",bg:"bg",zIndex:"overlay",children:i.jsx(ru,{size:"xl",label:e??"Loading…"})})}const ou=S.forwardRef(({variant:e="subtle",colorScheme:t="blue",onClose:n,children:r,...o},s)=>i.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,...o,children:[r,n&&i.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:"×"})]}));ou.displayName="MedixTag";const iu=S.forwardRef(({orientation:e="horizontal",label:t,...n},r)=>t?i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",width:"100%"},children:[i.jsx("div",{style:{flex:1,height:"1px",background:"var(--chakra-colors-border)"}}),i.jsx("span",{style:{fontSize:"var(--chakra-font-sizes-sm)",color:"var(--chakra-colors-text-body)",whiteSpace:"nowrap",fontFamily:"var(--font-body)"},children:t}),i.jsx("div",{style:{flex:1,height:"1px",background:"var(--chakra-colors-border)"}})]}):i.jsx(f.Separator,{ref:r,orientation:e,borderColor:"border",...n}));iu.displayName="MedixDivider";const qh="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",Xh="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 Zh({variant:e,type:t,height:n,markColor:r,textColor:o,downloadFileName:s}){if(typeof window>"u")return;const a=4,l=532,u=44,c=119,d=32,h=n,p=Math.round(n*.3),m=t==="full"?Math.round(c*(n/d)):0,x=(t==="full"?h+p+m:h)*a,y=n*a,v=h*a/l,j=y/d,w=`
|
|
142
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
143
|
-
<g transform="scale(${
|
|
144
|
-
<path d="${
|
|
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=`
|
|
142
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${g}" height="${v}" viewBox="0 0 ${g} ${v}">
|
|
143
|
+
<g transform="scale(${y})">
|
|
144
|
+
<path d="${op}" fill="${r}" fill-rule="evenodd" transform="translate(-178, -1958)"/>
|
|
145
145
|
</g>
|
|
146
|
-
${t==="full"?`<g transform="translate(${(h+
|
|
147
|
-
<svg viewBox="${
|
|
148
|
-
<path d="${
|
|
146
|
+
${t==="full"?`<g transform="translate(${(h+m)*a}, 0) scale(${j})">
|
|
147
|
+
<svg viewBox="${d} 0 ${c} ${u}" width="${c}" height="${u}">
|
|
148
|
+
<path d="${sp}" fill="${i}"/>
|
|
149
149
|
</svg>
|
|
150
150
|
</g>`:""}
|
|
151
151
|
</svg>
|
|
152
|
-
`,
|
|
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:`
|
|
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
|
|
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:`
|
|
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 To={sm:{h:"8",px:"3",fontSize:"sm"},md:{h:"10",px:"4",fontSize:"md"},lg:{h:"12",px:"4",fontSize:"lg"}},ns=S.forwardRef(({size:e="md",colorScheme:t="blue",leftElement:n,rightElement:r,isInvalid:o,errorMessage:s,...a},l)=>{const u=!!n,c=!!r,d=t==="purple"?"purple.500":"blue.500";return i.jsxs(f.Box,{w:"100%",children:[i.jsxs(f.Box,{position:"relative",children:[u&&i.jsx(f.Box,{position:"absolute",left:"3",top:"50%",transform:"translateY(-50%)",zIndex:"1",color:"text.muted",display:"flex",alignItems:"center",children:n}),i.jsx(f.Input,{ref:l,...To[e],pl:u?"10":To[e].px,pr:c?"10":To[e].px,bg:"bg.surface",border:"1px solid",borderColor:o?"red.500":"border",borderRadius:"md",color:"text.heading",fontFamily:"var(--font-body)",_placeholder:{color:"text.muted"},_focus:{borderColor:o?"red.500":d,boxShadow:"none",outline:"none"},_dark:{bg:"bg.surface",borderColor:o?"red.500":"border",color:"text.heading"},...a}),c&&i.jsx(f.Box,{position:"absolute",right:"3",top:"50%",transform:"translateY(-50%)",zIndex:"1",color:"text.muted",display:"flex",alignItems:"center",children:r})]}),o&&s&&i.jsx(f.Text,{mt:"1",fontSize:"xs",color:"red.500",fontFamily:"var(--font-body)",children:s})]})});ns.displayName="MedixInput";const rs=S.forwardRef(({placeholder:e="Search…",...t},n)=>i.jsx(ns,{ref:n,type:"search",placeholder:e,leftElement:i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("circle",{cx:"11",cy:"11",r:"8"}),i.jsx("path",{d:"m21 21-4.35-4.35"})]}),...t}));rs.displayName="MedixSearchInput";const su=S.forwardRef(({colorScheme:e="blue",isInvalid:t,errorMessage:n,maxLength:r,showCount:o=!1,onChange:s,value:a,...l},u)=>{const[c,d]=S.useState(typeof a=="string"?a.length:0),h=e==="purple"?"purple.500":"blue.500",p=m=>{d(m.target.value.length),s==null||s(m)};return i.jsxs(f.Box,{w:"100%",children:[i.jsx(f.Textarea,{ref:u,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:a,onChange:p,_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"}},...l}),i.jsxs(f.Box,{display:"flex",justifyContent:"space-between",mt:"1",children:[t&&n?i.jsx(f.Text,{fontSize:"xs",color:"red.500",fontFamily:"var(--font-body)",children:n}):i.jsx("span",{}),o&&r&&i.jsxs(f.Text,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:[c,"/",r]})]})]})});su.displayName="MedixTextarea";const op={sm:{h:"8",px:"3",fontSize:"sm"},md:{h:"10",px:"4",fontSize:"md"},lg:{h:"12",px:"4",fontSize:"lg"}};function ip({options:e=[],placeholder:t="Select option...",isInvalid:n=!1,errorMessage:r,size:o="md",colorScheme:s="blue",icon:a,value:l,defaultValue:u,onChange:c,disabled:d=!1,name:h,id:p}){const[m,g]=S.useState(!1),[x,y]=S.useState(""),[v,j]=S.useState(()=>typeof u=="string"?u:Array.isArray(u)&&u.length>0?u[0]:""),w=S.useRef(null),F=S.useRef(null),B=l!==void 0,C=B?typeof l=="string"?l:Array.isArray(l)&&l.length>0?l[0]:"":v,P=e.find(N=>N.value===C);S.useEffect(()=>{function N(O){w.current&&!w.current.contains(O.target)&&g(!1)}return m&&document.addEventListener("mousedown",N),()=>{document.removeEventListener("mousedown",N)}},[m]),S.useEffect(()=>{if(m){const N=setTimeout(()=>{var O;return(O=F.current)==null?void 0:O.focus()},50);return()=>clearTimeout(N)}else y("")},[m]);const A=N=>{d||(B||j(N),c==null||c(N),g(!1))},E=S.useMemo(()=>{if(!x.trim())return e;const N=x.toLowerCase().trim();return e.filter(O=>O.label.toLowerCase().includes(N))},[e,x]),L=s==="purple"?"#7700CC":"#0685FF",R=n?"#DC2626":m?L:"var(--medix-form-border)",D=op[o];return i.jsxs(f.Box,{w:"100%",position:"relative",zIndex:m?1e3:void 0,ref:w,children:[h&&i.jsx("input",{type:"hidden",name:h,id:p,value:C}),i.jsxs(f.Box,{onClick:()=>!d&&g(!m),display:"flex",alignItems:"center",justifyContent:"space-between",h:D.h,px:D.px,borderRadius:"md",bg:"bg.surface",cursor:d?"not-allowed":"pointer",opacity:d?.55:1,transition:"border-color 0.15s ease",style:{border:`1.5px solid ${R}`,boxShadow:"none",background:"var(--medix-form-bg)"},children:[i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2.5",flex:"1",minW:"0",children:[a&&i.jsx(f.Box,{color:"text.muted",display:"flex",alignItems:"center",flexShrink:0,children:a}),P?i.jsx(f.Text,{fontSize:D.fontSize,color:"text.heading",fontFamily:"var(--font-body)",truncate:!0,fontWeight:"500",children:P.label}):i.jsx(f.Text,{fontSize:D.fontSize,color:"text.muted",fontFamily:"var(--font-body)",truncate:!0,children:t})]}),i.jsx(f.Box,{display:"flex",alignItems:"center",color:"text.muted",ml:"2",flexShrink:0,style:{transform:m?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s ease"},children:i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:i.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),m&&i.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&&i.jsx(f.Box,{p:"2",borderBottom:"1px solid",borderColor:"border",bg:"bg.surface",children:i.jsxs(f.Box,{position:"relative",display:"flex",alignItems:"center",children:[i.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:[i.jsx("circle",{cx:"11",cy:"11",r:"8"}),i.jsx("path",{d:"m21 21-4.35-4.35"})]}),i.jsx("input",{ref:F,type:"text",placeholder:"Search...",value:x,onChange:N=>y(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"}})]})}),i.jsx(f.Box,{overflowY:"auto",flex:"1",py:"1",children:E.length===0?i.jsx(f.Box,{px:"4",py:"3",fontSize:"xs",color:"text.muted",textAlign:"center",children:"No options found"}):E.map(N=>{const O=N.value===C;return i.jsxs("button",{type:"button",disabled:N.disabled,onClick:()=>A(N.value),style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between",padding:"8px 14px",background:O?"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=O?"var(--medix-form-bg-subtle)":"transparent")},children:[i.jsx("span",{style:{fontWeight:O?600:400},children:N.label}),O&&i.jsx("span",{style:{color:L,fontWeight:700,fontSize:"14px"},children:"✓"})]},N.value)})})]}),n&&r&&i.jsx(f.Text,{mt:"1",fontSize:"xs",color:"red.500",fontFamily:"var(--font-body)",children:r})]})}function sp({options:e=[],placeholder:t="Select options...",isInvalid:n=!1,errorMessage:r,size:o="md",colorScheme:s="blue",icon:a,value:l,defaultValue:u,onChange:c,disabled:d=!1,name:h,id:p}){const[m,g]=S.useState(!1),[x,y]=S.useState(""),[v,j]=S.useState(()=>Array.isArray(u)?u:typeof u=="string"&&u?[u]:[]),w=S.useRef(null),F=S.useRef(null),B=l!==void 0,C=B?Array.isArray(l)?l:typeof l=="string"&&l?[l]:[]:v;S.useEffect(()=>{function I(M){w.current&&!w.current.contains(M.target)&&g(!1)}return m&&document.addEventListener("mousedown",I),()=>{document.removeEventListener("mousedown",I)}},[m]),S.useEffect(()=>{if(m){const I=setTimeout(()=>{var M;return(M=F.current)==null?void 0:M.focus()},50);return()=>clearTimeout(I)}else y("")},[m]);const P=I=>{if(d)return;const H=C.includes(I)?C.filter(W=>W!==I):[...C,I];B||j(H),c==null||c(H)},A=(I,M)=>{if(M.stopPropagation(),d)return;const H=C.filter(W=>W!==I);B||j(H),c==null||c(H)},E=S.useMemo(()=>{if(!x.trim())return e;const I=x.toLowerCase().trim();return e.filter(M=>M.label.toLowerCase().includes(I))},[e,x]),L=s==="purple"?"#7700CC":"#0685FF",R=n?"#DC2626":m?L:"var(--medix-form-border)",D=s==="purple"?"purple.50":"blue.50",N=s==="purple"?"purple.700":"blue.700",O=s==="purple"?"purple.200":"blue.200";return i.jsxs(f.Box,{w:"100%",position:"relative",zIndex:m?1e3:void 0,ref:w,children:[h&&i.jsx("input",{type:"hidden",name:h,id:p,value:C.join(",")}),i.jsxs(f.Box,{onClick:()=>!d&&g(!m),display:"flex",alignItems:"center",justifyContent:"space-between",minH:o==="sm"?"34px":o==="lg"?"48px":"42px",py:"1.5",px:"3",borderRadius:"md",bg:"bg.surface",cursor:d?"not-allowed":"pointer",opacity:d?.55:1,transition:"border-color 0.15s ease",style:{border:`1.5px solid ${R}`,boxShadow:"none",background:"var(--medix-form-bg)"},children:[i.jsxs(f.Box,{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"1.5",flex:"1",minW:"0",children:[a&&i.jsx(f.Box,{color:"text.muted",display:"flex",alignItems:"center",mr:"1",children:a}),C.length===0?i.jsx(f.Text,{fontSize:o==="sm"?"xs":"sm",color:"text.muted",fontFamily:"var(--font-body)",children:t}):C.map(I=>{const M=e.find(W=>W.value===I),H=M?M.label:I;return i.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:O,_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:[i.jsx("span",{children:H}),!d&&i.jsx("button",{type:"button",onClick:W=>A(I,W),"aria-label":`Remove ${H}`,style:{background:"transparent",border:"none",padding:0,marginLeft:"2px",cursor:"pointer",color:"inherit",fontSize:"13px",lineHeight:1,opacity:.75},onMouseEnter:W=>W.currentTarget.style.opacity="1",onMouseLeave:W=>W.currentTarget.style.opacity="0.75",children:"×"})]},I)})]}),i.jsx(f.Box,{display:"flex",alignItems:"center",color:"text.muted",ml:"2",style:{transform:m?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s ease"},children:i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:i.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),m&&i.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&&i.jsx(f.Box,{p:"2",borderBottom:"1px solid",borderColor:"border",bg:"bg.surface",children:i.jsxs(f.Box,{position:"relative",display:"flex",alignItems:"center",children:[i.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:[i.jsx("circle",{cx:"11",cy:"11",r:"8"}),i.jsx("path",{d:"m21 21-4.35-4.35"})]}),i.jsx("input",{ref:F,type:"text",placeholder:"Search options...",value:x,onChange:I=>y(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"}})]})}),i.jsx(f.Box,{overflowY:"auto",flex:"1",py:"1",children:E.length===0?i.jsx(f.Box,{px:"4",py:"3",fontSize:"xs",color:"text.muted",textAlign:"center",children:"No options found"}):E.map(I=>{const M=C.includes(I.value);return i.jsxs("button",{type:"button",disabled:I.disabled,onClick:()=>P(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:H=>{I.disabled||(H.currentTarget.style.background="var(--medix-form-bg-subtle)")},onMouseLeave:H=>{I.disabled||(H.currentTarget.style.background=M?"var(--medix-form-bg-subtle)":"transparent")},children:[i.jsx("span",{style:{fontWeight:M?600:400},children:I.label}),M&&i.jsx("span",{style:{color:L,fontWeight:700,fontSize:"14px"},children:"✓"})]},I.value)})})]}),n&&r&&i.jsx(f.Text,{mt:"1",fontSize:"xs",color:"red.500",fontFamily:"var(--font-body)",children:r})]})}function ap(e){return e.multiple?i.jsx(sp,{...e}):i.jsx(ip,{...e})}const au={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"}},lu=S.forwardRef(({colorScheme:e="blue",checked:t,defaultChecked:n=!1,onChange:r,disabled:o=!1,indeterminate:s=!1,children:a,description:l,name:u,value:c,id:d},h)=>{const p=au[e],m=d??S.useId(),[g,x]=S.useState(n),[y,v]=S.useState(!1),j=t!==void 0?t:g,w=B=>{t===void 0&&x(B.target.checked),r==null||r(B.target.checked)},F={width:18,height:18,borderRadius:4,border:`2px solid ${j||s?p.solid:"var(--medix-form-border, #CBD5E1)"}`,background:j||s?p.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 i.jsxs(f.Box,{opacity:o?.55:1,children:[i.jsxs("label",{htmlFor:m,style:{display:"inline-flex",alignItems:"flex-start",gap:10,cursor:o?"not-allowed":"pointer",userSelect:"none"},children:[i.jsx("input",{ref:h,id:m,type:"checkbox",name:u,value:c,checked:j,disabled:o,onChange:w,onFocus:()=>v(!0),onBlur:()=>v(!1),style:{position:"absolute",width:1,height:1,opacity:0,margin:0,padding:0,pointerEvents:"none"}}),i.jsx("span",{style:F,"aria-hidden":"true",children:s?i.jsx("svg",{width:"10",height:"2",viewBox:"0 0 10 2",fill:"none",children:i.jsx("rect",{width:"10",height:"2",rx:"1",fill:"#fff"})}):j?i.jsx("svg",{width:"11",height:"9",viewBox:"0 0 11 9",fill:"none",children:i.jsx("path",{d:"M1 4.5L4 7.5L10 1",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):null}),a&&i.jsxs(f.Box,{children:[i.jsx(f.Text,{as:"span",fontFamily:"var(--font-body)",fontSize:"md",color:"text.body",lineHeight:"1.5",children:a}),l&&i.jsx(f.Text,{display:"block",fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:l})]})]}),!a&&l&&i.jsx(f.Text,{mt:"1",ml:"7",fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:l})]})});lu.displayName="MedixCheckbox";function lp({name:e,value:t,onChange:n,options:r,colorScheme:o="blue",direction:s="column"}){const a=au[o],[l,u]=S.useState(""),c=t!==void 0?t:l,d=h=>{t===void 0&&u(h),n==null||n(h)};return i.jsx(f.Box,{display:"flex",flexDirection:s,gap:s==="row"?"5":"3",role:"radiogroup",children:r.map(h=>{const p=c===h.value;return i.jsx(cp,{option:h,name:e,isSelected:p,onChange:d,solidColor:a.solid,ring:a.ring},h.value)})})}function cp({option:e,name:t,isSelected:n,onChange:r,solidColor:o,ring:s}){const[a,l]=S.useState(!1);return i.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:[i.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"}}),i.jsx("span",{"aria-hidden":"true",style:{width:18,height:18,borderRadius:"50%",border:`2px solid ${n?o:"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:i.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:o,transform:n?"scale(1)":"scale(0)",transition:"transform 0.15s ease"}})}),i.jsxs(f.Box,{children:[i.jsx(f.Text,{as:"span",fontFamily:"var(--font-body)",fontSize:"md",color:"text.body",lineHeight:"1.5",children:e.label}),e.description&&i.jsx(f.Text,{display:"block",fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:e.description})]})]})}const up={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"}},dp={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}},cu=S.forwardRef(({colorScheme:e="blue",size:t="md",checked:n,defaultChecked:r=!1,onChange:o,disabled:s=!1,label:a,description:l,name:u,id:c},d)=>{const h=up[e],p=dp[t],m=c??S.useId(),[g,x]=S.useState(r),[y,v]=S.useState(!1),j=n!==void 0?n:g,w=C=>{n===void 0&&x(C.target.checked),o==null||o(C.target.checked)},F={position:"relative",display:"inline-flex",alignItems:"center",width:p.width,height:p.height,borderRadius:p.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:p.thumbSize,height:p.thumbSize,borderRadius:"50%",background:"#fff",boxShadow:"none",top:p.thumbOffset,left:j?p.width-p.thumbSize-p.thumbOffset:p.thumbOffset,transition:"left 0.18s ease"};return i.jsxs(f.Box,{display:"flex",alignItems:"flex-start",gap:"3",opacity:s?.55:1,children:[i.jsxs("label",{htmlFor:m,style:{display:"inline-flex",cursor:s?"not-allowed":"pointer"},children:[i.jsx("input",{ref:d,id:m,type:"checkbox",role:"switch",name:u,checked:j,disabled:s,onChange:w,onFocus:()=>v(!0),onBlur:()=>v(!1),style:{position:"absolute",width:1,height:1,opacity:0,margin:0,padding:0,pointerEvents:"none"}}),i.jsx("span",{style:F,"aria-hidden":"true",children:i.jsx("span",{style:B})})]}),(a||l)&&i.jsxs(f.Box,{children:[a&&i.jsx("label",{htmlFor:m,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&&i.jsx(f.Text,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:l})]})]})});cu.displayName="MedixSwitch";function fp({id:e,label:t,helperText:n,errorMessage:r,isRequired:o=!1,isDisabled:s=!1,children:a}){const l=!!r;return i.jsxs(f.Box,{display:"flex",flexDirection:"column",gap:"1.5",opacity:s?.5:1,pointerEvents:s?"none":void 0,w:"100%",children:[t&&i.jsxs(f.Box,{as:"label",htmlFor:e,display:"flex",alignItems:"center",gap:"1",children:[i.jsx(f.Text,{as:"span",fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:t}),o&&i.jsx(f.Text,{as:"span",color:"red.500",fontSize:"sm",lineHeight:"1",children:"*"})]}),S.cloneElement(a,{id:e,isInvalid:l||void 0}),n&&!l&&i.jsx(f.Text,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:n}),l&&r&&i.jsx(f.Text,{fontSize:"xs",color:"red.500",fontFamily:"var(--font-body)",children:r})]})}function uu({length:e=6,value:t,defaultValue:n="",onChange:r,onComplete:o,colorScheme:s="blue",isInvalid:a=!1,isDisabled:l=!1,mask:u=!1,label:c,helperText:d,errorMessage:h}){const[p,m]=S.useState(n),[g,x]=S.useState(null),y=t!==void 0,j=(y?t:p).split("").slice(0,e),w=S.useRef([]),F=a?"#DC2626":"var(--medix-form-border, var(--chakra-colors-border, #E2E8F0))",B=a?"#DC2626":s==="purple"?"#7700CC":"#0685FF",C=(E,L)=>{var R,D,N;if(E.key==="Backspace"){E.preventDefault();const O=[...j];if(O[L]){O[L]="";const I=O.join("");y||m(I),r==null||r(I)}else if(L>0){(R=w.current[L-1])==null||R.focus(),O[L-1]="";const I=O.join("");y||m(I),r==null||r(I)}}else E.key==="ArrowLeft"&&L>0?(D=w.current[L-1])==null||D.focus():E.key==="ArrowRight"&&L<e-1&&((N=w.current[L+1])==null||N.focus())},P=(E,L)=>{var O;const R=E.target.value.replace(/\D/g,""),D=[...j];for(;D.length<e;)D.push("");if(!R){D[L]="";const I=D.join("");y||m(I),r==null||r(I);return}D[L]=R[0];const N=D.join("");y||m(N),r==null||r(N),L<e-1&&((O=w.current[L+1])==null||O.focus()),N.replace(/\s/g,"").length===e&&(o==null||o(N))},A=(E,L)=>{var M;E.preventDefault();const R=E.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((H,W)=>{D[L+W]=H});const O=D.join("");y||m(O),r==null||r(O);const I=O.replace(/\s/g,"").length===e?e-1:Math.min(L+N.length,e-1);(M=w.current[I])==null||M.focus(),O.replace(/\s/g,"").length===e&&(o==null||o(O))};return i.jsxs(f.Box,{w:"fit-content",children:[c&&i.jsx(f.Text,{mb:"2",fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:c}),i.jsx(f.Box,{display:"flex",gap:"2",alignItems:"center",children:Array.from({length:e}).map((E,L)=>i.jsx("input",{ref:R=>{w.current[L]=R},type:u?"password":"text",inputMode:"numeric",pattern:"\\d*",maxLength:1,value:j[L]??"",onChange:R=>P(R,L),onKeyDown:R=>C(R,L),onPaste:R=>A(R,L),onFocus:R=>{R.target.select(),x(L)},onBlur:()=>x(null),disabled:l,"aria-label":`Digit ${L+1} of ${e}`,style:{width:"48px",height:"48px",borderRadius:"10px",border:`1.5px solid ${g===L?B:F}`,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))}),(d||h)&&i.jsx(f.Text,{mt:"2",fontSize:"xs",color:a?"red.500":"text.muted",fontFamily:"var(--font-body)",children:a?h:d})]})}const hp=uu;function $r(){return $r=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},$r.apply(this,arguments)}function pp(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var mp=["cdnSuffix","cdnUrl","countryCode","style","svg"],gp="https://cdn.jsdelivr.net/gh/lipis/flag-icons/flags/4x3/",xp="svg",yp=127397,ma=function(t){var n=t.cdnSuffix,r=n===void 0?xp:n,o=t.cdnUrl,s=o===void 0?gp:o,a=t.countryCode,l=t.style,u=t.svg,c=u===void 0?!1:u,d=pp(t,mp);if(typeof a!="string")return null;if(c){var h=""+s+a.toLowerCase()+"."+r;return S.createElement("img",Object.assign({},d,{src:h,style:$r({display:"inline-block",width:"1em",height:"1em",verticalAlign:"middle"},l)}))}var p=a.toUpperCase().replace(/./g,function(m){return String.fromCodePoint(m.charCodeAt(0)+yp)});return S.createElement("span",Object.assign({role:"img"},d,{style:$r({display:"inline-block",fontSize:"1em",lineHeight:"1em",verticalAlign:"middle"},l)}),p)};const bp={"+1":"US","+7":"RU","+39":"IT","+44":"GB","+47":"NO","+212":"MA","+262":"RE","+290":"SH","+358":"FI","+590":"GP","+599":"CW"},Ht=[{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 vp({value:e="",onChange:t,showCountryCode:n=!0,showCountryFlag:r=!0,defaultCountryCode:o="+234",defaultCountry:s,placeholder:a="80 000 0000",colorScheme:l="blue",isInvalid:u=!1,errorMessage:c,label:d,helperText:h,isDisabled:p=!1,id:m}){const g=S.useId(),x=m??g,y=s??(o?bp[o]:void 0),v=(y?Ht.find(Y=>Y.country===y):void 0)??Ht.find(Y=>Y.code===o)??Ht.find(Y=>Y.country==="NG")??Ht[0],[j,w]=S.useState(v.country),[F,B]=S.useState(e),[C,P]=S.useState(!1),[A,E]=S.useState(!1),[L,R]=S.useState(""),D=S.useRef(null),N=S.useRef(null),O=Ht.find(Y=>Y.country===j)??v;S.useEffect(()=>{function Y(oe){D.current&&!D.current.contains(oe.target)&&E(!1)}return A&&document.addEventListener("mousedown",Y),()=>{document.removeEventListener("mousedown",Y)}},[A]),S.useEffect(()=>{if(A){const Y=setTimeout(()=>{var oe;(oe=N.current)==null||oe.focus()},50);return()=>clearTimeout(Y)}else R("")},[A]);const I=S.useMemo(()=>{if(!L.trim())return Ht;const Y=L.toLowerCase().trim();return Ht.filter(oe=>oe.name.toLowerCase().includes(Y)||oe.code.toLowerCase().includes(Y)||oe.country.toLowerCase().includes(Y))},[L]),M=Y=>{const oe=Y.target.value.replace(/[^\d\s\-]/g,"");B(oe),t==null||t(`${O.code}${oe.replace(/\s/g,"")}`)},H=Y=>{w(Y.country),t==null||t(`${Y.code}${F.replace(/\s/g,"")}`),E(!1)},$=u?"#DC2626":C||A?l==="purple"?"#7700CC":"#0685FF":"var(--medix-form-border)";return i.jsxs(f.Box,{w:"100%",children:[d&&i.jsx("label",{htmlFor:x,style:{display:"block",marginBottom:"6px",fontSize:"14px",fontWeight:500,color:"var(--medix-form-text)",fontFamily:"var(--font-body)"},children:d}),i.jsxs(f.Box,{display:"flex",alignItems:"center",borderRadius:"10px",transition:"border-color 0.15s, box-shadow 0.15s",opacity:p?.5:1,pointerEvents:p?"none":void 0,position:"relative",zIndex:A?1e3:void 0,style:{border:`1.5px solid ${$}`,boxShadow:"none",background:"var(--medix-form-bg)"},children:[n&&i.jsxs(f.Box,{position:"relative",ref:D,h:"full",children:[i.jsxs("button",{id:`${x}-country`,type:"button",onClick:()=>!p&&E(!A),disabled:p,"aria-label":"Select country code","aria-expanded":A,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:p?"not-allowed":"pointer",height:"100%",color:"var(--medix-form-text)",fontFamily:"var(--font-body)",fontSize:"14px",fontWeight:500},children:[r&&i.jsx(f.Box,{display:"flex",alignItems:"center",fontSize:"lg",lineHeight:"1",children:i.jsx(ma,{countryCode:O.country,svg:!0,style:{width:"1.2em",height:"1.2em",borderRadius:"2px"}})}),i.jsx("span",{children:O.code}),i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:A?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s ease",opacity:.7},children:i.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),A&&i.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:[i.jsx(f.Box,{p:"2.5",color:"text.heading",borderBottom:"1px solid",borderColor:"border",bg:"bg.surface",children:i.jsxs(f.Box,{color:"text.heading",position:"relative",display:"flex",alignItems:"center",children:[i.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:[i.jsx("circle",{cx:"11",cy:"11",r:"8"}),i.jsx("path",{d:"m21 21-4.35-4.35"})]}),i.jsx("input",{ref:N,type:"text",placeholder:"Search country or code...",value:L,onChange:Y=>R(Y.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"}})]})}),i.jsx(f.Box,{overflowY:"auto",flex:"1",py:"1",children:I.length===0?i.jsx(f.Box,{px:"4",py:"3",fontSize:"xs",color:"text.muted",textAlign:"center",children:"No country found"}):I.map(Y=>{const oe=Y.country===O.country;return i.jsxs("button",{type:"button",onClick:()=>H(Y),style:{display:"flex",width:"100%",alignItems:"center",gap:"10px",padding:"8px 14px",background:oe?"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=oe?"var(--medix-form-bg-subtle)":"transparent"},children:[i.jsx(f.Box,{display:"flex",alignItems:"center",fontSize:"md",flexShrink:0,children:i.jsx(ma,{countryCode:Y.country,svg:!0,style:{width:"1.2em",height:"1.2em",borderRadius:"2px"}})}),i.jsx(f.Text,{flex:"1",truncate:!0,fontWeight:oe?"600":"400",children:Y.name}),i.jsx(f.Text,{fontSize:"xs",color:"text.muted",flexShrink:0,children:Y.code})]},`${Y.country}-${Y.code}`)})})]})]}),i.jsx("input",{id:x,type:"tel",value:F,onChange:M,onFocus:()=>P(!0),onBlur:()=>P(!1),placeholder:a,disabled:p,"aria-invalid":u,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)&&i.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:u?"red.500":"text.muted",fontFamily:"var(--font-body)",children:u?c:h})]})}const kp=["MON","TUES","WED","THURS","FRI","SAT","SUN"],wp=["January","February","March","April","May","June","July","August","September","October","November","December"],Sp=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Nn=12;function li(e,t){return new Date(e,t+1,0).getDate()}function Cp(e,t){return new Date(e,t,1).getDay()}function jp(e){return e===0?6:e-1}function ga(e,t,n,r,o){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(o){const a=new Date(o.getFullYear(),o.getMonth(),o.getDate());if(s>a)return!0}return!1}function Tp(e,t,n,r){const o=li(t,e),s=new Date(t,e,1),a=new Date(t,e,o);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 Bp(e,t,n){return!!(t&&e<t.getFullYear()||n&&e>n.getFullYear())}function os({value:e,onChange:t,minDate:n,maxDate:r,colorScheme:o="blue",...s}){const a=o==="purple"?"#7700CC":"#0685FF",l=o==="purple"?"rgba(119,0,204,0.14)":"rgba(6,133,255,0.14)",[u,c]=S.useState(()=>e?new Date(e):new Date),[d,h]=S.useState("day"),[p,m]=S.useState(0);S.useEffect(()=>{e&&c($=>{const b=new Date(e);return $.getFullYear()===b.getFullYear()&&$.getMonth()===b.getMonth()?$:b})},[e]);const g=u.getFullYear(),x=u.getMonth(),v=Math.floor(g/Nn)*Nn+p*Nn,j=v+Nn-1,w=!n||g>n.getFullYear()||g===n.getFullYear()&&x>n.getMonth(),F=!r||g<r.getFullYear()||g===r.getFullYear()&&x<r.getMonth(),B=()=>{c(new Date(g,x-1,1))},C=()=>{c(new Date(g,x+1,1))},P=()=>{const $=new Date;c($),h("day"),t&&!ga($.getDate(),$.getMonth(),$.getFullYear(),n,r)&&t($)},A=$=>{c(new Date(g,$,1)),h("day")},E=$=>{c(new Date($,x,1)),m(0),h("month")},L=li(g,x),R=jp(Cp(g,x)),D=li(g,x-1),O=(R+L>35?42:35)-(R+L),I=($,b,Y)=>e?e.getDate()===$&&e.getMonth()===b&&e.getFullYear()===Y:!1,M=()=>{const $=[];for(let b=0;b<R;b++){const Y=D-R+b+1;$.push(i.jsx(Bo,{day:Y,isMuted:!0,accentColor:a},`prev-${b}`))}for(let b=1;b<=L;b++){const Y=ga(b,x,g,n,r);$.push(i.jsx(Bo,{day:b,isActive:I(b,x,g),isDisabled:Y,accentColor:a,accentLight:l,onClick:Y?void 0:()=>t==null?void 0:t(new Date(g,x,b))},`curr-${b}`))}for(let b=1;b<=O;b++)$.push(i.jsx(Bo,{day:b,isMuted:!0,accentColor:a},`next-${b}`));return $},H=()=>i.jsx(f.Box,{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2",p:"1",mt:"2",children:Sp.map(($,b)=>{const Y=b===x,oe=Tp(b,g,n,r);return i.jsx(ya,{label:$,isActive:Y,isDisabled:oe,accentColor:a,accentLight:l,onClick:()=>!oe&&A(b)},$)})}),W=()=>{const $=Array.from({length:Nn},(b,Y)=>v+Y);return i.jsxs(i.Fragment,{children:[i.jsxs(f.Flex,{justify:"space-between",align:"center",mb:"3",children:[i.jsx(wr,{direction:"prev",enabled:!0,accentColor:a,onClick:()=>m(b=>b-1),ariaLabel:"Previous years"}),i.jsxs(f.Text,{fontSize:"sm",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-body)",children:[v," – ",j]}),i.jsx(wr,{direction:"next",enabled:!0,accentColor:a,onClick:()=>m(b=>b+1),ariaLabel:"Next years"})]}),i.jsx(f.Box,{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2",p:"1",children:$.map(b=>{const Y=b===g,oe=Bp(b,n,r);return i.jsx(ya,{label:String(b),isActive:Y,isDisabled:oe,accentColor:a,accentLight:l,onClick:()=>!oe&&E(b)},b)})})]})};return i.jsxs(f.Box,{w:"100%",maxW:"360px",bg:"bg.surface",borderRadius:"card",p:"5",fontFamily:"var(--font-body)",...s,children:[i.jsxs(f.Flex,{justify:"space-between",align:"center",mb:d==="day"?"6":"4",children:[i.jsxs(f.Flex,{align:"center",gap:"1",children:[d==="day"&&i.jsx(wr,{direction:"prev",enabled:w,accentColor:a,onClick:B,ariaLabel:"Go to previous month"}),i.jsx(xa,{label:wp[x],isActive:d==="month",accentColor:a,accentLight:l,onClick:()=>{h($=>$==="month"?"day":"month"),m(0)}}),i.jsx(xa,{label:String(g),isActive:d==="year",accentColor:a,accentLight:l,onClick:()=>{h($=>$==="year"?"day":"year"),m(0)}}),d==="day"&&i.jsx(wr,{direction:"next",enabled:F,accentColor:a,onClick:C,ariaLabel:"Go to next month"})]}),i.jsx(f.Box,{as:"button",type:"button",onClick:P,px:"3",py:"1",fontSize:"sm",fontWeight:"medium",borderRadius:"md",border:"1px solid",borderColor:"border",color:"text.heading",_hover:{bg:"bg.subtle"},children:"Today"})]}),d==="day"&&i.jsxs(i.Fragment,{children:[i.jsx(f.Flex,{mb:"3",children:kp.map($=>i.jsx(f.Box,{flex:"1",textAlign:"center",fontSize:"xs",fontWeight:"medium",color:"text.muted",children:$},$))}),i.jsx(f.Box,{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gapY:"2",children:M()})]}),d==="month"&&H(),d==="year"&&W()]})}function wr({enabled:e,onClick:t,direction:n,accentColor:r,ariaLabel:o}){return i.jsx(f.Box,{as:"button",type:"button","aria-label":o??(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:i.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"?i.jsx("path",{d:"M15 18l-6-6 6-6"}):i.jsx("path",{d:"M9 18l6-6-6-6"})})})}function xa({label:e,isActive:t,accentColor:n,accentLight:r,onClick:o}){return i.jsxs(f.Box,{as:"button",type:"button",onClick:o,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,i.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:i.jsx("path",{d:"M6 9l6 6 6-6"})})]})}function ya({label:e,isActive:t,isDisabled:n,accentColor:r,accentLight:o,onClick:s}){return i.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:o,color:r,borderColor:r}:void 0,transition:"all 0.15s",children:e})}function Bo({day:e,isActive:t,isMuted:n,isDisabled:r,accentColor:o,accentLight:s,onClick:a}){return i.jsx(f.Flex,{justify:"center",align:"center",h:"10",children:i.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?o:"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:o}:void 0,transition:"all 0.2s",children:e})})}function Ep({value:e,onChange:t,min:n,max:r,label:o,helperText:s,errorMessage:a,colorScheme:l="blue",isInvalid:u=!1,isDisabled:c=!1,placeholder:d="Select date",id:h,includeTime:p=!1}){const[m,g]=S.useState(!1),x=S.useRef(null),y=E=>E!=null&&E.includes("T")&&E.split("T")[1].slice(0,5)||"00:00";S.useEffect(()=>{function E(L){x.current&&!x.current.contains(L.target)&&g(!1)}return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[]);const j=u?"#DC2626":m?l==="purple"?"#7700CC":"#0685FF":"var(--medix-form-border)",w="none",F=E=>{const L=E.getFullYear(),R=String(E.getMonth()+1).padStart(2,"0"),D=String(E.getDate()).padStart(2,"0");p?t==null||t(`${L}-${R}-${D}T${y(e)}`):(t==null||t(`${L}-${R}-${D}`),g(!1))},B=E=>{const L=E.target.value,R=(e==null?void 0:e.split("T")[0])??"";R&&(t==null||t(`${R}T${L}`))},C=E=>{if(!E)return;const[L,R,D]=E.split("-"),N=Number(L),O=Number(R),I=Number(D==null?void 0:D.split("T")[0]);if(!Number.isInteger(N)||!Number.isInteger(O)||!Number.isInteger(I))return;const M=new Date(N,O-1,I);if(!(M.getFullYear()!==N||M.getMonth()!==O-1||M.getDate()!==I))return M},P=C(e==null?void 0:e.split("T")[0]),A=P&&!isNaN(P.getTime())?p&&(e!=null&&e.includes("T"))?`${P.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})} ${e.split("T")[1].slice(0,5)}`:P.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"";return i.jsxs(f.Box,{w:"100%",position:"relative",zIndex:m?1e3:void 0,ref:x,children:[o&&i.jsx(f.Text,{mb:"1.5",fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:o}),i.jsxs(f.Box,{position:"relative",children:[i.jsx("input",{id:h,readOnly:!0,type:"text",value:A,placeholder:d,disabled:c,"aria-invalid":u,"aria-haspopup":"dialog","aria-expanded":m,onClick:()=>!c&&g(!m),onKeyDown:E=>{c||(E.key==="Enter"||E.key===" "||E.key==="ArrowDown"?(E.preventDefault(),g(!0)):E.key==="Escape"&&g(!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"}}),i.jsx(f.Box,{position:"absolute",right:"3",top:"50%",transform:"translateY(-50%)",pointerEvents:"none",fontSize:"md",color:"text.muted",children:i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),i.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),i.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),i.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})})]}),m&&i.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:[i.jsx(os,{value:P,onChange:F,minDate:C(n),maxDate:C(r),colorScheme:l}),p&&i.jsxs(f.Box,{px:"5",pb:"4",borderTop:"1px solid",borderColor:"border",children:[i.jsx(f.Text,{fontSize:"xs",fontWeight:"medium",color:"text.muted",mb:"1.5",fontFamily:"var(--font-body)",children:"Time"}),i.jsx("input",{type:"time",value:y(e),onChange:B,disabled:!P,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:P?1:.4,cursor:P?"default":"not-allowed",colorScheme:"auto"}})]})]}),(s||a)&&i.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:u?"red.500":"text.muted",fontFamily:"var(--font-body)",children:u?a:s})]})}function Fp({startValue:e,onStartChange:t,endValue:n,onEndChange:r,min:o,max:s,label:a,helperText:l,errorMessage:u,colorScheme:c="blue",isInvalid:d=!1,isDisabled:h=!1,startPlaceholder:p="Start date",endPlaceholder:m="End date",id:g}){const[x,y]=S.useState(null),v=S.useRef(null);S.useEffect(()=>{function M(H){v.current&&!v.current.contains(H.target)&&y(null)}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[]);const w=d?"#DC2626":x?c==="purple"?"#7700CC":"#0685FF":"var(--medix-form-border)",F="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 H=M.getFullYear(),W=String(M.getMonth()+1).padStart(2,"0"),$=String(M.getDate()).padStart(2,"0");return`${H}-${W}-${$}`},P=M=>o&&M<o?o:s&&M>s?s:M,A=M=>{const H=P(C(M));x==="start"?(t==null||t(H),n&&n<H&&(r==null||r("")),y("end")):x==="end"&&(r==null||r(H),e&&e>H&&(t==null||t("")),y(null))},E=M=>{if(!M)return;const[H,W,$]=M.split("-").map(Number);if(!H||W<1||W>12||$<1||$>31)return;const b=new Date(H,W-1,$);if(!(b.getFullYear()!==H||b.getMonth()!==W-1||b.getDate()!==$))return b},R=E(x==="start"?e:n),D=E(e),N=E(n),O=D?D.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"",I=N?N.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"";return i.jsxs(f.Box,{w:"100%",position:"relative",zIndex:x?1e3:void 0,ref:v,children:[a&&i.jsx(f.Text,{mb:"1.5",fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:a}),i.jsxs(f.Box,{display:"flex",alignItems:"center",position:"relative",style:{width:"100%",height:"40px",borderRadius:"10px",border:`1.5px solid ${w}`,boxShadow:F,background:"var(--medix-form-bg)",transition:"border-color 0.15s, box-shadow 0.15s",opacity:h?.5:1,overflow:"hidden"},children:[i.jsx("input",{id:g,readOnly:!0,type:"text",value:O,placeholder:p,disabled:h,"aria-invalid":d,"aria-haspopup":"dialog","aria-expanded":x==="start",onClick:()=>!h&&y("start"),onKeyDown:M=>{h||(M.key==="Enter"||M.key===" "||M.key==="ArrowDown"?(M.preventDefault(),y("start")):M.key==="Escape"&&y(null))},style:{...B,textAlign:"center"}}),i.jsx(f.Box,{color:"text.muted",px:"1",fontSize:"sm",children:"—"}),i.jsx("input",{readOnly:!0,type:"text",value:I,placeholder:m,disabled:h,"aria-invalid":d,"aria-haspopup":"dialog","aria-expanded":x==="end",onClick:()=>!h&&y("end"),onKeyDown:M=>{h||(M.key==="Enter"||M.key===" "||M.key==="ArrowDown"?(M.preventDefault(),y("end")):M.key==="Escape"&&y(null))},style:{...B,textAlign:"center"}})]}),x&&i.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:i.jsx(os,{value:R,onChange:A,minDate:x==="end"?D??E(o):E(o),maxDate:E(s),colorScheme:c})}),(l||u)&&i.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:d?"red.500":"text.muted",fontFamily:"var(--font-body)",children:d?u:l})]})}const Ap=i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("polyline",{points:"6 9 12 15 18 9"})});function Lp({options:e,value:t,onChange:n,placeholder:r="Search...",label:o,helperText:s,errorMessage:a,colorScheme:l="blue",isInvalid:u=!1,isDisabled:c=!1}){const[d,h]=S.useState(!1),[p,m]=S.useState(""),g=S.useRef(null);S.useEffect(()=>{if(t){const w=e.find(F=>F.value===t);w&&m(w.label)}},[t,e]),S.useEffect(()=>{function w(F){if(g.current&&!g.current.contains(F.target))if(h(!1),t){const B=e.find(C=>C.value===t);B&&m(B.label)}else m("")}return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[t,e]);const x=e.filter(w=>w.label.toLowerCase().includes(p.toLowerCase())),v=u?"#DC2626":d?l==="purple"?"#7700CC":"#0685FF":"var(--medix-form-border)";return i.jsxs(f.Box,{w:"100%",position:"relative",zIndex:d?1e3:void 0,ref:g,children:[o&&i.jsx(f.Text,{mb:"1.5",fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:o}),i.jsxs(f.Box,{position:"relative",children:[i.jsx("input",{type:"text",value:p,placeholder:r,disabled:c,onChange:w=>{m(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 ${v}`,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}}),i.jsx(f.Box,{position:"absolute",right:"3",top:"50%",transform:"translateY(-50%)",pointerEvents:"none",color:"text.muted",children:Ap})]}),d&&!c&&i.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:x.length>0?x.map(w=>i.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),m(w.label),h(!1)},children:w.label},w.value)):i.jsx(f.Box,{px:"3",py:"2",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:"No options found"})}),(s||a)&&i.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:u?"red.500":"text.muted",fontFamily:"var(--font-body)",children:u?a:s})]})}const Ip=i.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),i.jsx("polyline",{points:"17 8 12 3 7 8"}),i.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]});function Dp({accept:e,multiple:t=!1,maxSize:n,label:r,helperText:o,errorMessage:s,colorScheme:a="blue",isInvalid:l=!1,isDisabled:u=!1,onChange:c,dropzoneTitle:d="Click or drag to upload",id:h}){const[p,m]=S.useState(!1),[g,x]=S.useState([]),y=S.useRef(null),v=D=>{D.preventDefault(),u||m(!0)},j=D=>{D.preventDefault(),u||m(!0)},w=D=>{D.preventDefault(),m(!1)},[F,B]=S.useState(null),C=D=>{if(!D||D.length===0)return;const N=Array.from(D);B(null);const O=N.find(M=>n&&M.size>n);if(O&&n){const M=Math.round(n/1048576);B(`File "${O.name}" exceeds the maximum limit of ${M}MB.`)}const I=N.filter(M=>!(n&&M.size>n));I.length>0&&(x(I.map(M=>M.name)),c==null||c(I))},P=D=>{D.preventDefault(),m(!1),!u&&C(D.dataTransfer.files)},A=D=>{C(D.target.files),D.target.value=""},E=a==="purple"?"purple.500":"blue.500",L=l?"red.500":p?E:"border",R=p?"bg.subtle":"transparent";return i.jsxs(f.Box,{w:"100%",children:[r&&i.jsx(f.Text,{mb:"1.5",fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:r}),i.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:u?.5:1,cursor:u?"not-allowed":"pointer",_hover:u?void 0:{borderColor:E,bg:"bg.subtle"},onDragEnter:v,onDragOver:j,onDragLeave:w,onDrop:P,onClick:()=>{var D;return!u&&((D=y.current)==null?void 0:D.click())},children:[i.jsx("input",{ref:y,id:h,type:"file",accept:e,multiple:t,disabled:u,style:{display:"none"},onChange:A}),i.jsx(f.Box,{color:"text.muted",display:"flex",justifyContent:"center",mb:"3",children:Ip}),i.jsx(f.Text,{fontSize:"sm",fontWeight:"medium",color:p?"blue.500":"text.heading",fontFamily:"var(--font-body)",children:d}),i.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`]}),g.length>0&&i.jsxs(f.Box,{mt:"4",pt:"3",borderTop:"1px solid",borderColor:"border",children:[i.jsxs(f.Text,{fontSize:"xs",fontWeight:"semibold",color:"text.heading",mb:"1",fontFamily:"var(--font-body)",children:["Selected file",g.length>1?"s":"",":"]}),g.map((D,N)=>i.jsx(f.Text,{fontSize:"xs",color:"text.muted",truncate:!0,fontFamily:"var(--font-body)",children:D},N))]})]}),(o||s||F)&&i.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:l||F?"red.500":"text.muted",fontFamily:"var(--font-body)",children:F||(l?s:o)})]})}const ba={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"}},va={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 du({value:e=[],onChange:t,placeholder:n="Add tag...",label:r,helperText:o,errorMessage:s,isInvalid:a=!1,colorScheme:l="blue",size:u="md",isDisabled:c=!1,isReadOnly:d=!1,maxTags:h,allowDuplicates:p=!1,addOnBlur:m=!1,delimiter:g=",",id:x,name:y,style:v,className:j}){const w=S.useId(),F=x??w,[B,C]=S.useState(""),[P,A]=S.useState(!1),E=S.useRef(null),L=va[l]??va.blue,R=ba[u]??ba.md,D=H=>{if(c||d)return;const W=H.trim();if(W&&!(h!=null&&e.length>=h)){if(!p&&e.includes(W)){C("");return}t([...e,W]),C("")}},N=H=>{c||d||t(e.filter((W,$)=>$!==H))},O=H=>{H.key==="Enter"||g&&H.key===g?(H.preventDefault(),D(B)):H.key==="Backspace"&&!B&&e.length>0&&N(e.length-1)},I=()=>{A(!1),m&&B.trim()&&D(B)},M=a?"#DC2626":P?L.focusBorder:"var(--medix-form-border)";return i.jsxs(f.Box,{w:"100%",style:v,className:j,children:[r&&i.jsx("label",{htmlFor:F,style:{display:"block",marginBottom:"6px",fontSize:"14px",fontWeight:500,color:"var(--medix-form-text)",fontFamily:"var(--font-body)"},children:r}),i.jsxs(f.Box,{onClick:()=>{var H;return!c&&((H=E.current)==null?void 0:H.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((H,W)=>i.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:[i.jsx("span",{children:H}),!c&&!d&&i.jsx("button",{type:"button",onClick:$=>{$.stopPropagation(),N(W)},"aria-label":`Remove ${H}`,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:$=>{$.currentTarget.style.opacity="1"},onMouseLeave:$=>{$.currentTarget.style.opacity="0.7"},children:"×"})]},`${H}-${W}`)),!c&&!d&&i.jsx("input",{ref:E,id:F,name:y,type:"text",value:B,onChange:H=>C(H.target.value),onKeyDown:O,onFocus:()=>A(!0),onBlur:I,placeholder:e.length===0?n:"",disabled:c,readOnly:d,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}})]}),(o||s)&&i.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:a?"red.500":"text.muted",fontFamily:"var(--font-body)",children:a?s:o})]})}const Rp=du;function Kn(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 o=r,s=o.tagName.toLowerCase(),a=Array.from(o.childNodes).map(n).join("");switch(s){case"h1":return`# ${a.trim()}
|
|
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()}
|
|
271
271
|
|
|
272
272
|
`;case"h2":return`## ${a.trim()}
|
|
273
273
|
|
|
@@ -277,15 +277,15 @@
|
|
|
277
277
|
|
|
278
278
|
`:"";case"strong":case"b":return a.trim()?`**${a}**`:"";case"em":case"i":return a.trim()?`*${a}*`:"";case"u":return a.trim()?`<u>${a}</u>`:"";case"s":case"del":case"strike":return a.trim()?`~~${a}~~`:"";case"blockquote":return`> ${a.trim()}
|
|
279
279
|
|
|
280
|
-
`;case"ul":return`${Array.from(
|
|
280
|
+
`;case"ul":return`${Array.from(i.children).map(l=>`- ${n(l).trim()}`).join(`
|
|
281
281
|
`)}
|
|
282
282
|
|
|
283
|
-
`;case"ol":return`${Array.from(
|
|
283
|
+
`;case"ol":return`${Array.from(i.children).map((l,d)=>`${d+1}. ${n(l).trim()}`).join(`
|
|
284
284
|
`)}
|
|
285
285
|
|
|
286
|
-
`;case"li":return a;case"a":{const l=
|
|
287
|
-
`;default:return a}}return n(t).trim()}function
|
|
288
|
-
`),n=[];let r=!1,
|
|
286
|
+
`;case"li":return a;case"a":{const l=i.getAttribute("href")||"";return`[${a}](${l})`}case"br":return`
|
|
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=`
|
|
289
289
|
.medix-rte-content .tiptap {
|
|
290
290
|
outline: none;
|
|
291
291
|
padding: 12px 16px;
|
|
@@ -332,38 +332,38 @@
|
|
|
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
|
|
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(`
|
|
336
336
|
# Heading 1
|
|
337
|
-
`),disabled:n,title:"Markdown H1",accentColor:t,children:"# H1"}),
|
|
337
|
+
`),disabled:n,title:"Markdown H1",accentColor:t,children:"# H1"}),o.jsx(Me,{onClick:()=>l==null?void 0:l(`
|
|
338
338
|
## Heading 2
|
|
339
|
-
`),disabled:n,title:"Markdown H2",accentColor:t,children:"## H2"}),
|
|
339
|
+
`),disabled:n,title:"Markdown H2",accentColor:t,children:"## H2"}),o.jsx(Me,{onClick:()=>l==null?void 0:l(`
|
|
340
340
|
- List item
|
|
341
|
-
`),disabled:n,title:"Markdown Bullet List",accentColor:t,children:"- List"}),
|
|
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&&i.jsx(Xp,{currentMode:o,onSelectMode:a,accentColor:t,disabled:n})]})}const Jp={bold:!0,italic:!0,underline:!0,strikethrough:!0,headings:!0,bulletList:!0,orderedList:!0,quote:!0,link:!0,textAlign:!0,clearFormat:!0};function is({value:e,defaultValue:t,onChange:n,onMarkdownChange:r,onHtmlChange:o,outputFormat:s="html",defaultMode:a="wysiwyg",mode:l,onModeChange:u,showModeToggle:c=!0,placeholder:d="Start typing...",label:h,helperText:p,errorMessage:m,isInvalid:g=!1,disabled:x=!1,colorScheme:y="blue",minHeight:v="180px",maxHeight:j="400px",maxLength:w,showCharCount:F=!1,toolbarOptions:B,className:C}){const[P,A]=S.useState(!1),[E,L]=S.useState(a),R=l!==void 0?l:E,D=e!==void 0,N=Mp[y],O={...Jp,...B},[I,M]=S.useState(()=>{const ie=D?e:t??"";return s==="markdown"?ie:Kn(ie)}),H=S.useRef(null);S.useEffect(()=>{Pp()},[]);const W=ca.useEditor({extensions:[mh.configure({heading:{levels:[1,2,3]}}),xh,gh.configure({openOnClick:!1,HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}}),yh.configure({types:["heading","paragraph"]}),bh.configure({placeholder:d})],content:D?s==="markdown"?Yt(e??""):e??"":t?s==="markdown"?Yt(t):t:"",editable:!x,editorProps:{attributes:{spellcheck:"true"}},onUpdate({editor:ie}){const se=ie.getHTML(),X=se==="<p></p>"?"":se,Z=Kn(X);o==null||o(X),r==null||r(Z);const Q=s==="markdown"?Z:X;w!==void 0&&ie.getText().length>w||n==null||n(Q)},onFocus(){A(!0)},onBlur(){A(!1)}}),$=ie=>{if(ie!==R){if(ie==="markdown"){const se=W?W.getHTML():"",X=Kn(se==="<p></p>"?"":se);M(X)}else{const se=Yt(I);W&&W.commands.setContent(se,{emitUpdate:!1})}l===void 0&&L(ie),u==null||u(ie)}},b=ie=>{const se=ie.target.value;M(se);const X=Yt(se);r==null||r(se),o==null||o(X);const Z=s==="markdown"?se:X;w!==void 0&&se.length>w||(n==null||n(Z),W&&W.commands.setContent(X,{emitUpdate:!1}))},Y=ie=>{const se=H.current;if(!se){M(Ae=>Ae+ie);return}const X=se.selectionStart,Z=se.selectionEnd,Q=se.value,ue=Q.substring(0,X)+ie+Q.substring(Z);M(ue);const ee=Yt(ue);r==null||r(ue),o==null||o(ee);const ze=s==="markdown"?ue:ee;n==null||n(ze),W&&W.commands.setContent(ee,{emitUpdate:!1}),setTimeout(()=>{se.focus(),se.setSelectionRange(X+ie.length,X+ie.length)},50)};S.useEffect(()=>{if(D)if(s==="markdown"){const ie=e??"";if(M(ie),W){const se=Yt(ie);W.getHTML()!==se&&W.commands.setContent(se,{emitUpdate:!1})}}else{const ie=e===""?"<p></p>":e??"<p></p>";W&&W.getHTML()!==ie&&W.commands.setContent(ie,{emitUpdate:!1}),M(Kn(e??""))}},[W,D,e,s]);const oe=R==="markdown"?I.length:(W==null?void 0:W.getText().length)??0,T=g?"#DC2626":P?N.base:"var(--medix-form-border)";return i.jsxs(f.Box,{w:"100%",className:C,children:[h&&i.jsx(f.Text,{mb:"1.5",fontSize:"sm",fontWeight:"500",fontFamily:"var(--font-body)",color:"text.heading",children:h}),i.jsxs(f.Box,{borderRadius:"md",overflow:"hidden",bg:"bg.surface",opacity:x?.6:1,style:{border:`1.5px solid ${T}`,transition:"border-color 0.15s ease",boxShadow:"none",background:"var(--medix-form-bg)"},children:[i.jsx(Zp,{editor:W,accentColor:N.base,disabled:x,opts:O,mode:R,showModeToggle:c,onModeChange:$,onInsertMarkdown:Y}),R==="wysiwyg"?i.jsx(f.Box,{className:"medix-rte-content",style:{minHeight:v,maxHeight:j,overflowY:"auto"},_dark:{color:"var(--medix-form-text)"},children:i.jsx(ca.EditorContent,{editor:W})}):i.jsx("textarea",{ref:H,value:I,onChange:b,placeholder:d,disabled:x,onFocus:()=>A(!0),onBlur:()=>A(!1),style:{width:"100%",minHeight:v,maxHeight:j,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"}}),(F||w)&&i.jsx(f.Box,{display:"flex",justifyContent:w?"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:i.jsxs(f.Text,{fontSize:"xs",color:w&&oe>w?"red.500":"text.muted",fontFamily:"var(--font-body)",children:[oe,w?` / ${w}`:""," characters"]})})]}),p&&!g&&i.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:p}),g&&m&&i.jsx(f.Text,{mt:"1.5",fontSize:"xs",color:"red.500",fontFamily:"var(--font-body)",children:m})]})}const Qp=is;is.displayName="MedixRichTextInput";const fu=S.forwardRef(({noPadding:e=!1,hoverable:t=!1,children:n,...r},o)=>i.jsx(f.Box,{ref:o,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:S.Children.map(n,s=>s||null)}));fu.displayName="MedixCard";function em({title:e,subtitle:t,action:n,children:r,...o}){return i.jsxs(f.Box,{px:"6",py:"4",borderBottom:"1px solid",borderColor:"border",display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"4",...o,children:[i.jsxs(f.Box,{flex:"1",children:[e&&i.jsx(f.Box,{as:"h3",fontSize:"lg",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",lineHeight:"1.3",children:e}),t&&i.jsx(f.Box,{as:"p",mt:"0.5",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:t}),r]}),n&&i.jsx(f.Box,{flexShrink:0,children:n})]})}function tm({children:e,...t}){return i.jsx(f.Box,{px:"6",py:"5",...t,children:e})}function nm({children:e,...t}){return i.jsx(f.Box,{px:"6",py:"4",borderTop:"1px solid",borderColor:"border",display:"flex",alignItems:"center",gap:"3",...t,children:e})}const hu=S.forwardRef(({value:e,label:t,unit:n,change:r,trend:o,icon:s,accentColor:a="blue.500",...l},u)=>{const c=o??(r!==void 0?r>=0?"up":"down":"neutral"),d=c==="up"?"green.500":c==="down"?"red.500":"text.muted";return i.jsxs(f.Box,{ref:u,bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",p:"6",boxShadow:"none",_dark:{boxShadow:"none"},...l,children:[s&&i.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}),i.jsxs(f.Box,{fontSize:"4xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",lineHeight:"1.1",children:[e,n&&i.jsx(f.Box,{as:"span",fontSize:"xl",fontWeight:"medium",color:"text.muted",ml:"1",children:n})]}),i.jsx(f.Box,{mt:"1",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:t}),r!==void 0&&i.jsxs(f.Box,{mt:"2",display:"inline-flex",alignItems:"center",gap:"1",fontSize:"xs",fontWeight:"medium",color:d,children:[i.jsx(f.Box,{as:"span",children:c==="up"?"↑":c==="down"?"↓":"→"}),i.jsxs(f.Box,{as:"span",children:[Math.abs(r),"%"]})]})]})});hu.displayName="MedixStatCard";const rm={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1440px",full:"100%"},pu=S.forwardRef(({maxWidth:e="xl",children:t,...n},r)=>i.jsx(f.Box,{ref:r,w:"100%",maxW:rm[e],mx:"auto",px:{base:"4",md:"6",lg:"8"},...n,children:t}));pu.displayName="MedixContainer";function om({eyebrow:e,title:t,description:n,align:r="center",action:o,eyebrowColor:s="blue.500",...a}){const l=r,u=r==="center"?"center":r==="right"?"flex-end":"flex-start";return i.jsxs(f.Box,{display:"flex",flexDirection:"column",alignItems:u,textAlign:l,gap:"3",...a,children:[e&&i.jsx(f.Box,{as:"span",fontSize:"md",fontWeight:"bold",color:s,letterSpacing:"wider",textTransform:"uppercase",fontFamily:"var(--font-body)",children:e}),i.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&&i.jsx(f.Box,{as:"p",fontSize:"md",color:"text.body",fontFamily:"var(--font-body)",lineHeight:"loose",maxW:r==="center"?"640px":void 0,children:n}),o&&i.jsx(f.Box,{mt:"2",children:o})]})}const im=["light","dark"],sm={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 Ut(e,t){return Object.entries(t).map(([n,r])=>({token:`${e}.${n}`,value:r.value}))}const am=[{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}]}],lm=[{title:"Brand blue tokens",description:"Raw MedixDeck primary blue scale.",tokens:Ut("brand.blue",V.blue)},{title:"Brand purple tokens",description:"Raw MedixDeck secondary purple scale.",tokens:Ut("brand.purple",V.purple)},{title:"Status green tokens",description:"Raw success scale tokens.",tokens:Ut("brand.green",V.green)},{title:"Status amber tokens",description:"Raw warning scale tokens.",tokens:Ut("brand.amber",V.amber)},{title:"Status red tokens",description:"Raw error scale tokens.",tokens:Ut("brand.red",V.red)},{title:"Neutral light tokens",description:"Raw light-mode neutrals.",tokens:Ut("brand.neutralLight",V.neutralLight)},{title:"Neutral dark tokens",description:"Raw dark-mode neutrals.",tokens:Ut("brand.neutralDark",V.neutralDark)}];function cm({mode:e,token:t}){const n=sm[e],r=e==="light"?t.light:t.dark,o={minH:"88px",borderRadius:"md",border:"1px solid",borderColor:n.border,bg:n.canvas,display:"flex",alignItems:"center",justifyContent:"center",px:"4"};return i.jsxs(f.Box,{border:"1px solid",borderColor:n.border,borderRadius:"lg",bg:n.surface,p:"3",children:[i.jsx(f.Text,{fontSize:"xs",fontWeight:"600",color:n.text,fontFamily:"var(--font-heading)",mb:"2",children:n.label}),t.preview==="text"?i.jsx(f.Box,{...o,children:i.jsx(f.Text,{color:r,fontSize:"sm",fontWeight:"600",fontFamily:"var(--font-heading)",children:"Aa MedixDeck"})}):t.preview==="border"?i.jsx(f.Box,{...o,children:i.jsx(f.Box,{w:"100%",maxW:"140px",h:"48px",borderRadius:"md",border:"2px solid",borderColor:r,bg:n.canvas})}):i.jsx(f.Box,{...o,bg:r,borderColor:r===n.canvas||r==="#FFFFFF"?n.border:"transparent"}),i.jsx(f.Text,{mt:"2",fontSize:"xs",color:n.muted,fontFamily:"var(--font-mono)",children:r})]})}const mu=S.forwardRef(({showSemanticTokens:e=!0,showPrimitiveTokens:t=!0,...n},r)=>i.jsxs(f.Box,{ref:r,display:"flex",flexDirection:"column",gap:"8",...n,children:[i.jsx(f.Box,{children:i.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&&i.jsx(f.Box,{display:"flex",flexDirection:"column",gap:"6",children:am.map(o=>i.jsxs(f.Box,{children:[i.jsx(f.Text,{fontSize:"lg",fontWeight:"600",color:"text.heading",fontFamily:"var(--font-heading)",children:o.title}),i.jsx(f.Text,{mt:"1",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:o.description}),i.jsx(f.SimpleGrid,{columns:{base:1,xl:2},gap:"4",mt:"4",children:o.tokens.map(s=>i.jsxs(f.Box,{border:"1px solid",borderColor:"border",borderRadius:"xl",bg:"bg.surface",p:"4",children:[i.jsx(f.Text,{fontSize:"sm",fontWeight:"700",color:"text.heading",fontFamily:"var(--font-heading)",children:s.token}),i.jsx(f.Text,{mt:"1",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:s.description}),i.jsx(f.SimpleGrid,{columns:{base:1,md:2},gap:"3",mt:"4",children:im.map(a=>i.jsx(cm,{mode:a,token:s},`${s.token}-${a}`))})]},s.token))})]},o.title))}),t&&i.jsx(f.Box,{display:"flex",flexDirection:"column",gap:"6",children:lm.map(o=>i.jsxs(f.Box,{children:[i.jsx(f.Text,{fontSize:"lg",fontWeight:"600",color:"text.heading",fontFamily:"var(--font-heading)",children:o.title}),i.jsx(f.Text,{mt:"1",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:o.description}),i.jsx(f.SimpleGrid,{columns:{base:1,sm:2,lg:3,xl:4},gap:"4",mt:"4",children:o.tokens.map(s=>i.jsxs(f.Box,{border:"1px solid",borderColor:"border",borderRadius:"xl",overflow:"hidden",bg:"bg.surface",children:[i.jsx(f.Box,{h:"72px",bg:s.value,borderBottom:"1px solid",borderColor:s.value==="#FFFFFF"||s.value===V.neutralLight.bg.value?"border":"transparent"}),i.jsxs(f.Box,{p:"4",children:[i.jsx(f.Text,{fontSize:"sm",fontWeight:"600",color:"text.heading",fontFamily:"var(--font-heading)",children:s.token}),i.jsx(f.Text,{mt:"1",fontSize:"xs",color:"text.muted",fontFamily:"var(--font-mono)",children:s.value})]})]},s.token))})]},o.title))})]}));mu.displayName="MedixThemeColorPalette";const ss=S.createContext({});function as(e){const t=S.useRef(null);return t.current===null&&(t.current=e()),t.current}const um=typeof window<"u",gu=um?S.useLayoutEffect:S.useEffect,co=S.createContext(null);function ls(e,t){e.indexOf(t)===-1&&e.push(t)}function Gr(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const jt=(e,t,n)=>n>t?t:n<e?e:n;function ci(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Fn=()=>{},Ft=()=>{};var Gc;typeof process<"u"&&((Gc=process.env)==null?void 0:Gc.NODE_ENV)!=="production"&&(Fn=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(ci(t,n))},Ft=(e,t,n)=>{if(!e)throw new Error(ci(t,n))});const zt={},xu=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function yu(e){return typeof e=="object"&&e!==null}const bu=e=>/^0[^.\s]+$/u.test(e);function vu(e){let t;return()=>(t===void 0&&(t=e()),t)}const st=e=>e,dm=(e,t)=>n=>t(e(n)),dr=(...e)=>e.reduce(dm),or=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class cs{constructor(){this.subscriptions=[]}add(t){return ls(this.subscriptions,t),()=>Gr(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let s=0;s<o;s++){const a=this.subscriptions[s];a&&a(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ke=e=>e*1e3,it=e=>e/1e3;function ku(e,t){return t?e*(1e3/t):0}const wa=new Set;function us(e,t,n){e||wa.has(t)||(console.warn(ci(t,n)),wa.add(t))}const wu=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,fm=1e-7,hm=12;function pm(e,t,n,r,o){let s,a,l=0;do a=t+(n-t)/2,s=wu(a,r,o)-e,s>0?n=a:t=a;while(Math.abs(s)>fm&&++l<hm);return a}function fr(e,t,n,r){if(e===t&&n===r)return st;const o=s=>pm(s,0,1,e,n);return s=>s===0||s===1?s:wu(o(s),t,r)}const Su=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Cu=e=>t=>1-e(1-t),ju=fr(.33,1.53,.69,.99),ds=Cu(ju),Tu=Su(ds),Bu=e=>e>=1?1:(e*=2)<1?.5*ds(e):.5*(2-Math.pow(2,-10*(e-1))),fs=e=>1-Math.sin(Math.acos(e)),Eu=Cu(fs),Fu=Su(fs),mm=fr(.42,0,1,1),gm=fr(0,0,.58,1),Au=fr(.42,0,.58,1),xm=e=>Array.isArray(e)&&typeof e[0]!="number",Lu=e=>Array.isArray(e)&&typeof e[0]=="number",Sa={linear:st,easeIn:mm,easeInOut:Au,easeOut:gm,circIn:fs,circInOut:Fu,circOut:Eu,backIn:ds,backInOut:Tu,backOut:ju,anticipate:Bu},ym=e=>typeof e=="string",Ca=e=>{if(Lu(e)){Ft(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,o]=e;return fr(t,n,r,o)}else if(ym(e))return Ft(Sa[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Sa[e];return e},Cr=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function bm(e,t){let n=new Set,r=new Set,o=!1,s=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function u(d){a.has(d)&&(c.schedule(d),e()),d(l)}const c={schedule:(d,h=!1,p=!1)=>{const g=p&&o?n:r;return h&&a.add(d),g.add(d),d},cancel:d=>{r.delete(d),a.delete(d)},process:d=>{if(l=d,o){s=!0;return}o=!0;const h=n;n=r,r=h,n.forEach(u),n.clear(),o=!1,s&&(s=!1,c.process(d))}};return c}const vm=40;function Iu(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,a=Cr.reduce((w,F)=>(w[F]=bm(s),w),{}),{setup:l,read:u,resolveKeyframes:c,preUpdate:d,update:h,preRender:p,render:m,postRender:g}=a,x=()=>{const w=zt.useManualTiming,F=w?o.timestamp:performance.now();n=!1,w||(o.delta=r?1e3/60:Math.max(Math.min(F-o.timestamp,vm),1)),o.timestamp=F,o.isProcessing=!0,l.process(o),u.process(o),c.process(o),d.process(o),h.process(o),p.process(o),m.process(o),g.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(x))},y=()=>{n=!0,r=!0,o.isProcessing||e(x)};return{schedule:Cr.reduce((w,F)=>{const B=a[F];return w[F]=(C,P=!1,A=!1)=>(n||y(),B.schedule(C,P,A)),w},{}),cancel:w=>{for(let F=0;F<Cr.length;F++)a[Cr[F]].cancel(w)},state:o,steps:a}}const{schedule:ge,cancel:_t,state:Pe,steps:Eo}=Iu(typeof requestAnimationFrame<"u"?requestAnimationFrame:st,!0);let Pr;function km(){Pr=void 0}const We={now:()=>(Pr===void 0&&We.set(Pe.isProcessing||zt.useManualTiming?Pe.timestamp:performance.now()),Pr),set:e=>{Pr=e,queueMicrotask(km)}},Du=e=>t=>typeof t=="string"&&t.startsWith(e),Ru=Du("--"),wm=Du("var(--"),hs=e=>wm(e)?Sm.test(e.split("/*")[0].trim()):!1,Sm=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ja(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const An={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ir={...An,transform:e=>jt(0,1,e)},jr={...An,default:1},Jn=e=>Math.round(e*1e5)/1e5,ps=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Cm(e){return e==null}const jm=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ms=(e,t)=>n=>!!(typeof n=="string"&&jm.test(n)&&n.startsWith(e)||t&&!Cm(n)&&Object.prototype.hasOwnProperty.call(n,t)),Mu=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,s,a,l]=r.match(ps);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},Tm=e=>jt(0,255,e),Fo={...An,transform:e=>Math.round(Tm(e))},qt={test:ms("rgb","red"),parse:Mu("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Fo.transform(e)+", "+Fo.transform(t)+", "+Fo.transform(n)+", "+Jn(ir.transform(r))+")"};function Bm(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const ui={test:ms("#"),parse:Bm,transform:qt.transform},hr=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Mt=hr("deg"),St=hr("%"),q=hr("px"),Em=hr("vh"),Fm=hr("vw"),Ta={...St,parse:e=>St.parse(e)/100,transform:e=>St.transform(e*100)},vn={test:ms("hsl","hue"),parse:Mu("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+St.transform(Jn(t))+", "+St.transform(Jn(n))+", "+Jn(ir.transform(r))+")"},Ce={test:e=>qt.test(e)||ui.test(e)||vn.test(e),parse:e=>qt.test(e)?qt.parse(e):vn.test(e)?vn.parse(e):ui.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?qt.transform(e):vn.transform(e),getAnimatableNone:e=>{const t=Ce.parse(e);return t.alpha=0,Ce.transform(t)}},Am=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Lm(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ps))==null?void 0:t.length)||0)+(((n=e.match(Am))==null?void 0:n.length)||0)>0}const Pu="number",Ou="color",Im="var",Dm="var(",Ba="${}",Rm=/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 Bn(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const l=t.replace(Rm,u=>(Ce.test(u)?(r.color.push(s),o.push(Ou),n.push(Ce.parse(u))):u.startsWith(Dm)?(r.var.push(s),o.push(Im),n.push(u)):(r.number.push(s),o.push(Pu),n.push(parseFloat(u))),++s,Ba)).split(Ba);return{values:n,split:l,indexes:r,types:o}}function Mm(e){return Bn(e).values}function zu({split:e,types:t}){const n=e.length;return r=>{let o="";for(let s=0;s<n;s++)if(o+=e[s],r[s]!==void 0){const a=t[s];a===Pu?o+=Jn(r[s]):a===Ou?o+=Ce.transform(r[s]):o+=r[s]}return o}}function Pm(e){return zu(Bn(e))}const Om=e=>typeof e=="number"?0:Ce.test(e)?Ce.getAnimatableNone(e):e,zm=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:Om(e);function _m(e){const t=Bn(e);return zu(t)(t.values.map((r,o)=>zm(r,t.split[o])))}const ft={test:Lm,parse:Mm,createTransformer:Pm,getAnimatableNone:_m};function Ao(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 Nm({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,s=0,a=0;if(!t)o=s=a=n;else{const l=n<.5?n*(1+t):n+t-n*t,u=2*n-l;o=Ao(u,l,e+1/3),s=Ao(u,l,e),a=Ao(u,l,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:r}}function Yr(e,t){return n=>n>0?t:e}const ye=(e,t,n)=>e+(t-e)*n,Lo=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Vm=[ui,qt,vn],Wm=e=>Vm.find(t=>t.test(e));function Ea(e){const t=Wm(e);if(Fn(!!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===vn&&(n=Nm(n)),n}const Fa=(e,t)=>{const n=Ea(e),r=Ea(t);if(!n||!r)return Yr(e,t);const o={...n};return s=>(o.red=Lo(n.red,r.red,s),o.green=Lo(n.green,r.green,s),o.blue=Lo(n.blue,r.blue,s),o.alpha=ye(n.alpha,r.alpha,s),qt.transform(o))},di=new Set(["none","hidden"]);function Hm(e,t){return di.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Um(e,t){return n=>ye(e,t,n)}function gs(e){return typeof e=="number"?Um:typeof e=="string"?hs(e)?Yr:Ce.test(e)?Fa:Ym:Array.isArray(e)?_u:typeof e=="object"?Ce.test(e)?Fa:$m:Yr}function _u(e,t){const n=[...e],r=n.length,o=e.map((s,a)=>gs(s)(s,t[a]));return s=>{for(let a=0;a<r;a++)n[a]=o[a](s);return n}}function $m(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=gs(e[o])(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function Gm(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],a=e.indexes[s][r[s]],l=e.values[a]??0;n[o]=l,r[s]++}return n}const Ym=(e,t)=>{const n=ft.createTransformer(t),r=Bn(e),o=Bn(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?di.has(e)&&!o.values.length||di.has(t)&&!r.values.length?Hm(e,t):dr(_u(Gm(r,o),o.values),n):(Fn(!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"),Yr(e,t))};function Nu(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ye(e,t,n):gs(e)(e,t)}const Km=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>ge.update(t,n),stop:()=>_t(t),now:()=>Pe.isProcessing?Pe.timestamp:We.now()}},Vu=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)r+=Math.round(e(s/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Kr=2e4;function xs(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Kr;)t+=n,r=e.next(t);return t>=Kr?1/0:t}function qm(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(xs(r),Kr);return{type:"keyframes",ease:s=>r.next(o*s).value/t,duration:it(o)}}const ve={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 fi(e,t){return e*Math.sqrt(1-t*t)}const Xm=12;function Zm(e,t,n){let r=n;for(let o=1;o<Xm;o++)r=r-e(r)/t(r);return r}const Io=.001;function Jm({duration:e=ve.duration,bounce:t=ve.bounce,velocity:n=ve.velocity,mass:r=ve.mass}){let o,s;Fn(e<=Ke(ve.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-t;a=jt(ve.minDamping,ve.maxDamping,a),e=jt(ve.minDuration,ve.maxDuration,it(e)),a<1?(o=c=>{const d=c*a,h=d*e,p=d-n,m=fi(c,a),g=Math.exp(-h);return Io-p/m*g},s=c=>{const h=c*a*e,p=h*n+n,m=Math.pow(a,2)*Math.pow(c,2)*e,g=Math.exp(-h),x=fi(Math.pow(c,2),a);return(-o(c)+Io>0?-1:1)*((p-m)*g)/x}):(o=c=>{const d=Math.exp(-c*e),h=(c-n)*e+1;return-Io+d*h},s=c=>{const d=Math.exp(-c*e),h=(n-c)*(e*e);return d*h});const l=5/e,u=Zm(o,s,l);if(e=Ke(e),isNaN(u))return{stiffness:ve.stiffness,damping:ve.damping,duration:e};{const c=Math.pow(u,2)*r;return{stiffness:c,damping:a*2*Math.sqrt(r*c),duration:e}}}const Qm=["duration","bounce"],e1=["stiffness","damping","mass"];function Aa(e,t){return t.some(n=>e[n]!==void 0)}function t1(e){let t={velocity:ve.velocity,stiffness:ve.stiffness,damping:ve.damping,mass:ve.mass,isResolvedFromDuration:!1,...e};if(!Aa(e,e1)&&Aa(e,Qm))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*jt(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:ve.mass,stiffness:o,damping:s}}else{const n=Jm({...e,velocity:0});t={...t,...n,mass:ve.mass},t.isResolvedFromDuration=!0}return t}function qr(e=ve.visualDuration,t=ve.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const s=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:s},{stiffness:u,damping:c,mass:d,duration:h,velocity:p,isResolvedFromDuration:m}=t1({...n,velocity:-it(n.velocity||0)}),g=p||0,x=c/(2*Math.sqrt(u*d)),y=a-s,v=it(Math.sqrt(u/d)),j=Math.abs(y)<5;r||(r=j?ve.restSpeed.granular:ve.restSpeed.default),o||(o=j?ve.restDelta.granular:ve.restDelta.default);let w,F,B,C,P,A;if(x<1)B=fi(v,x),C=(g+x*v*y)/B,w=L=>{const R=Math.exp(-x*v*L);return a-R*(C*Math.sin(B*L)+y*Math.cos(B*L))},P=x*v*C+y*B,A=x*v*y-C*B,F=L=>Math.exp(-x*v*L)*(P*Math.sin(B*L)+A*Math.cos(B*L));else if(x===1){w=R=>a-Math.exp(-v*R)*(y+(g+v*y)*R);const L=g+v*y;F=R=>Math.exp(-v*R)*(v*L*R-g)}else{const L=v*Math.sqrt(x*x-1);w=O=>{const I=Math.exp(-x*v*O),M=Math.min(L*O,300);return a-I*((g+x*v*y)*Math.sinh(M)+L*y*Math.cosh(M))/L};const R=(g+x*v*y)/L,D=x*v*R-y*L,N=x*v*y-R*L;F=O=>{const I=Math.exp(-x*v*O),M=Math.min(L*O,300);return I*(D*Math.sinh(M)+N*Math.cosh(M))}}const E={calculatedDuration:m&&h||null,velocity:L=>Ke(F(L)),next:L=>{if(!m&&x<1){const D=Math.exp(-x*v*L),N=Math.sin(B*L),O=Math.cos(B*L),I=a-D*(C*N+y*O),M=Ke(D*(P*N+A*O));return l.done=Math.abs(M)<=r&&Math.abs(a-I)<=o,l.value=l.done?a:I,l}const R=w(L);if(m)l.done=L>=h;else{const D=Ke(F(L));l.done=Math.abs(D)<=r&&Math.abs(a-R)<=o}return l.value=l.done?a:R,l},toString:()=>{const L=Math.min(xs(E),Kr),R=Vu(D=>E.next(L*D).value,L,30);return L+"ms "+R},toTransition:()=>{}};return E}qr.applyToOptions=e=>{const t=qm(e,100,qr);return e.ease=t.ease,e.duration=Ke(t.duration),e.type="keyframes",e};const n1=5;function Wu(e,t,n){const r=Math.max(t-n1,0);return ku(n-e(r),t-r)}function hi({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:a,min:l,max:u,restDelta:c=.5,restSpeed:d}){const h=e[0],p={done:!1,value:h},m=A=>l!==void 0&&A<l||u!==void 0&&A>u,g=A=>l===void 0?u:u===void 0||Math.abs(l-A)<Math.abs(u-A)?l:u;let x=n*t;const y=h+x,v=a===void 0?y:a(y);v!==y&&(x=v-h);const j=A=>-x*Math.exp(-A/r),w=A=>v+j(A),F=A=>{const E=j(A),L=w(A);p.done=Math.abs(E)<=c,p.value=p.done?v:L};let B,C;const P=A=>{m(p.value)&&(B=A,C=qr({keyframes:[p.value,g(p.value)],velocity:Wu(w,A,p.value),damping:o,stiffness:s,restDelta:c,restSpeed:d}))};return P(0),{calculatedDuration:null,next:A=>{let E=!1;return!C&&B===void 0&&(E=!0,F(A),P(A)),B!==void 0&&A>=B?C.next(A-B):(!E&&F(A),p)}}}function r1(e,t,n){const r=[],o=n||zt.mix||Nu,s=e.length-1;for(let a=0;a<s;a++){let l=o(e[a],e[a+1]);if(t){const u=Array.isArray(t)?t[a]||st:t;l=dr(u,l)}r.push(l)}return r}function o1(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(Ft(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=r1(t,r,o),u=l.length,c=d=>{if(a&&d<e[0])return t[0];let h=0;if(u>1)for(;h<e.length-2&&!(d<e[h+1]);h++);const p=or(e[h],e[h+1],d);return l[h](p)};return n?d=>c(jt(e[0],e[s-1],d)):c}function i1(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=or(0,t,r);e.push(ye(n,1,o))}}function s1(e){const t=[0];return i1(t,e.length-1),t}function a1(e,t){return e.map(n=>n*t)}function l1(e,t){return e.map(()=>t||Au).splice(0,e.length-1)}function kn({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=xm(r)?r.map(Ca):Ca(r),s={done:!1,value:t[0]},a=a1(n&&n.length===t.length?n:s1(t),e),l=o1(a,t,{ease:Array.isArray(o)?o:l1(t,o)});return{calculatedDuration:e,next:u=>(s.value=l(u),s.done=u>=e,s)}}const c1=e=>e!==null;function uo(e,{repeat:t,repeatType:n="loop"},r,o=1){const s=e.filter(c1),l=o<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!l||r===void 0?s[l]:r}const u1={decay:hi,inertia:hi,tween:kn,keyframes:kn,spring:qr};function Hu(e){typeof e.type=="string"&&(e.type=u1[e.type])}class ys{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 d1=e=>e/100;class Xr extends ys{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,o;const{motionValue:n}=this.options;n&&n.updatedAt!==We.now()&&this.tick(We.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(r=this.options).onStop)==null||o.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Hu(t);const{type:n=kn,repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:a=0}=t;let{keyframes:l}=t;const u=n||kn;process.env.NODE_ENV!=="production"&&u!==kn&&Ft(l.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${l}`,"spring-two-frames"),u!==kn&&typeof l[0]!="number"&&(this.mixKeyframes=dr(d1,Nu(l[0],l[1])),l=[0,100]);const c=u({...t,keyframes:l});s==="mirror"&&(this.mirroredGenerator=u({...t,keyframes:[...l].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=xs(c));const{calculatedDuration:d}=c;this.calculatedDuration=d,this.resolvedDuration=d+o,this.totalDuration=this.resolvedDuration*(r+1)-o,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:o,mixKeyframes:s,mirroredGenerator:a,resolvedDuration:l,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:d,repeat:h,repeatType:p,repeatDelay:m,type:g,onUpdate:x,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const v=this.currentTime-c*(this.playbackSpeed>=0?1:-1),j=this.playbackSpeed>=0?v<0:v>o;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let w=this.currentTime,F=r;if(h){const A=Math.min(this.currentTime,o)/l;let E=Math.floor(A),L=A%1;!L&&A>=1&&(L=1),L===1&&E--,E=Math.min(E,h+1),!!(E%2)&&(p==="reverse"?(L=1-L,m&&(L-=m/l)):p==="mirror"&&(F=a)),w=jt(0,1,L)*l}let B;j?(this.delayState.value=d[0],B=this.delayState):B=F.next(w),s&&!j&&(B.value=s(B.value));let{done:C}=B;!j&&u!==null&&(C=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return P&&g!==hi&&(B.value=uo(d,this.options,y,this.speed)),x&&x(B.value),P&&this.finish(),B}then(t,n){return this.finished.then(t,n)}get duration(){return it(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+it(t)}get time(){return it(this.currentTime)}set time(t){t=Ke(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 Wu(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(We.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=it(this.currentTime))}play(){var o,s;if(this.isStopped)return;const{driver:t=Km,startTime:n}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),(s=(o=this.options).onPlay)==null||s.call(o);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(We.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 f1(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Xt=e=>e*180/Math.PI,pi=e=>{const t=Xt(Math.atan2(e[1],e[0]));return mi(t)},h1={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:pi,rotateZ:pi,skewX:e=>Xt(Math.atan(e[1])),skewY:e=>Xt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},mi=e=>(e=e%360,e<0&&(e+=360),e),La=pi,Ia=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Da=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),p1={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ia,scaleY:Da,scale:e=>(Ia(e)+Da(e))/2,rotateX:e=>mi(Xt(Math.atan2(e[6],e[5]))),rotateY:e=>mi(Xt(Math.atan2(-e[2],e[0]))),rotateZ:La,rotate:La,skewX:e=>Xt(Math.atan(e[4])),skewY:e=>Xt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function gi(e){return e.includes("scale")?1:0}function xi(e,t){if(!e||e==="none")return gi(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=p1,o=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=h1,o=l}if(!o)return gi(t);const s=r[t],a=o[1].split(",").map(g1);return typeof s=="function"?s(a):a[s]}const m1=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return xi(n,t)};function g1(e){return parseFloat(e.trim())}const Ln=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],In=new Set(Ln),Ra=e=>e===An||e===q,x1=new Set(["x","y","z"]),y1=Ln.filter(e=>!x1.has(e));function b1(e){const t=[];return y1.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Ot={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const o=e.max-e.min;return r==="border-box"?o:o-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const o=e.max-e.min;return r==="border-box"?o:o-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})=>xi(t,"x"),y:(e,{transform:t})=>xi(t,"y")};Ot.translateX=Ot.x;Ot.translateY=Ot.y;const Jt=new Set;let yi=!1,bi=!1,vi=!1;function Uu(){if(bi){const e=Array.from(Jt).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=b1(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.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)})}bi=!1,yi=!1,Jt.forEach(e=>e.complete(vi)),Jt.clear()}function $u(){Jt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(bi=!0)})}function v1(){vi=!0,$u(),Uu(),vi=!1}class bs{constructor(t,n,r,o,s,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=s,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Jt.add(this),yi||(yi=!0,ge.read($u),ge.resolveKeyframes(Uu))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const s=o==null?void 0:o.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),o&&s===void 0&&o.set(t[0])}f1(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Jt.delete(this)}cancel(){this.state==="scheduled"&&(Jt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const k1=e=>e.startsWith("--");function Gu(e,t,n){k1(t)?e.style.setProperty(t,n):e.style[t]=n}const w1={};function Yu(e,t){const n=vu(e);return()=>w1[t]??n()}const S1=Yu(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Ku=Yu(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),qn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Ma={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:qn([0,.65,.55,1]),circOut:qn([.55,0,1,.45]),backIn:qn([.31,.01,.66,-.59]),backOut:qn([.33,1.53,.69,.99])};function qu(e,t){if(e)return typeof e=="function"?Ku()?Vu(e,t):"ease-out":Lu(e)?qn(e):Array.isArray(e)?e.map(n=>qu(n,t)||Ma.easeOut):Ma[e]}function C1(e,t,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:a="loop",ease:l="easeOut",times:u}={},c=void 0){const d={[t]:n};u&&(d.offset=u);const h=qu(l,o);Array.isArray(h)&&(d.easing=h);const p={delay:r,duration:o,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"};return c&&(p.pseudoElement=c),e.animate(d,p)}function Xu(e){return typeof e=="function"&&"applyToOptions"in e}function j1({type:e,...t}){return Xu(e)&&Ku()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Zu extends ys{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:s,allowFlatten:a=!1,finalKeyframe:l,onComplete:u}=t;this.isPseudoElement=!!s,this.allowFlatten=a,this.options=t,Ft(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=j1(t);this.animation=C1(n,r,o,c,s),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=uo(o,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(d),Gu(n,r,d),this.animation.cancel()}u==null||u(),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,o;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((o=(r=this.animation).commitStyles)==null||o.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 it(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+it(t)}get time(){return it(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ke(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:o}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&S1()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),st):o(this)}}const Ju={anticipate:Bu,backInOut:Tu,circInOut:Fu};function T1(e){return e in Ju}function B1(e){typeof e.ease=="string"&&T1(e.ease)&&(e.ease=Ju[e.ease])}const Do=10;class E1 extends Zu{constructor(t){B1(t),Hu(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:o,element:s,...a}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new Xr({...a,autoplay:!1}),u=Math.max(Do,We.now()-this.startTime),c=jt(0,Do,u-Do),d=l.sample(u).value,{name:h}=this.options;s&&h&&Gu(s,h,d),n.setWithVelocity(l.sample(Math.max(0,u-c)).value,d,c),l.stop()}}const Pa=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ft.test(e)||e==="0")&&!e.startsWith("url("));function F1(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 A1(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],a=Pa(o,t),l=Pa(s,t);return Fn(a===l,`You are trying to animate ${t} from "${o}" to "${s}". "${a?s:o}" is not an animatable value.`,"value-not-animatable"),!a||!l?!1:F1(e)||(n==="spring"||Xu(n))&&r}function ki(e){e.duration=0,e.type="keyframes"}const Qu=new Set(["opacity","clipPath","filter","transform"]),L1=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function I1(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&L1.test(e[t]))return!0;return!1}const D1=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),R1=vu(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function M1(e){var h;const{motionValue:t,name:n,repeatDelay:r,repeatType:o,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:d}=t.owner.getProps();return R1()&&n&&(Qu.has(n)||D1.has(n)&&I1(l))&&(n!=="transform"||!d)&&!c&&!r&&o!=="mirror"&&s!==0&&a!=="inertia"}const P1=40;class O1 extends ys{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:a="loop",keyframes:l,name:u,motionValue:c,element:d,...h}){var g;super(),this.stop=()=>{var x,y;this._animation&&(this._animation.stop(),(x=this.stopTimeline)==null||x.call(this)),(y=this.keyframeResolver)==null||y.cancel()},this.createdAt=We.now();const p={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:a,name:u,motionValue:c,element:d,...h},m=(d==null?void 0:d.KeyframeResolver)||bs;this.keyframeResolver=new m(l,(x,y,v)=>this.onKeyframesResolved(x,y,p,!v),u,c,d),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(t,n,r,o){var v,j;this.keyframeResolver=void 0;const{name:s,type:a,velocity:l,delay:u,isHandoff:c,onUpdate:d}=r;this.resolvedAt=We.now();let h=!0;A1(t,s,a,l)||(h=!1,(zt.instantAnimations||!u)&&(d==null||d(uo(t,r,n))),t[0]=t[t.length-1],ki(r),r.repeat=0);const m={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>P1?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},g=h&&!c&&M1(m),x=(j=(v=m.motionValue)==null?void 0:v.owner)==null?void 0:j.current;let y;if(g)try{y=new E1({...m,element:x})}catch{y=new Xr(m)}else y=new Xr(m);y.finished.then(()=>{this.notifyFinished()}).catch(st),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}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(),v1()),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 ed(e,t,n,r=0,o=1){const s=Array.from(e).sort((c,d)=>c.sortNodePosition(d)).indexOf(t),a=e.size,l=(a-1)*r;return typeof n=="function"?n(s,a):o===1?s*r:l-s*r}const z1=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _1(e){const t=z1.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const N1=4;function td(e,t,n=1){Ft(n<=N1,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=_1(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const a=s.trim();return xu(a)?parseFloat(a):a}return hs(o)?td(o,t,n+1):o}const V1={type:"spring",stiffness:500,damping:25,restSpeed:10},W1=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),H1={type:"keyframes",duration:.8},U1={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$1=(e,{keyframes:t})=>t.length>2?H1:In.has(e)?e.startsWith("scale")?W1(t[1]):V1:U1;function nd(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function vs(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?nd(n,e):n}const G1=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Y1(e){for(const t in e)if(!G1.has(t))return!0;return!1}const ks=(e,t,n,r={},o,s)=>a=>{const l=vs(r,e)||{},u=l.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Ke(u);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-c,onUpdate:p=>{t.set(p),l.onUpdate&&l.onUpdate(p)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:s?void 0:o};Y1(l)||Object.assign(d,$1(e,d)),d.duration&&(d.duration=Ke(d.duration)),d.repeatDelay&&(d.repeatDelay=Ke(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let h=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(ki(d),d.delay===0&&(h=!0)),(zt.instantAnimations||zt.skipAnimations||o!=null&&o.shouldSkipAnimations)&&(h=!0,ki(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,h&&!s&&t.get()!==void 0){const p=uo(d.keyframes,l);if(p!==void 0){ge.update(()=>{d.onUpdate(p),d.onComplete()});return}}return l.isSync?new Xr(d):new O1(d)};function Oa(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function ws(e,t,n,r){if(typeof t=="function"){const[o,s]=Oa(r);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=Oa(r);t=t(n!==void 0?n:e.custom,o,s)}return t}function Qt(e,t,n){const r=e.getProps();return ws(r,t,n!==void 0?n:r.custom,e)}const rd=new Set(["width","height","top","left","right","bottom",...Ln]),za=30,K1=e=>!isNaN(parseFloat(e));class q1{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const o=We.now();if(this.updatedAt!==o&&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=We.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=K1(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&us(!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 cs);const r=this.events[t].add(n);return t==="change"?()=>{r(),ge.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=We.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>za)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,za);return ku(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 En(e,t){return new q1(e,t)}const wi=e=>Array.isArray(e);function X1(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,En(n))}function Z1(e){return wi(e)?e[e.length-1]||0:e}function J1(e,t){const n=Qt(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const a in s){const l=Z1(s[a]);X1(e,a,l)}}const Oe=e=>!!(e&&e.getVelocity);function Q1(e){return!!(Oe(e)&&e.add)}function Si(e,t){const n=e.getValue("willChange");if(Q1(n))return n.add(t);if(!n&&zt.WillChange){const r=new zt.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Ss(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const eg="framerAppearId",od="data-"+Ss(eg);function id(e){return e.props[od]}function tg({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function sd(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s,transitionEnd:a,...l}=t;const u=e.getDefaultTransition();s=s?nd(s,u):u;const c=s==null?void 0:s.reduceMotion;r&&(s=r);const d=[],h=o&&e.animationState&&e.animationState.getState()[o];for(const p in l){const m=e.getValue(p,e.latestValues[p]??null),g=l[p];if(g===void 0||h&&tg(h,p))continue;const x={delay:n,...vs(s||{},p)},y=m.get();if(y!==void 0&&!m.isAnimating()&&!Array.isArray(g)&&g===y&&!x.velocity){ge.update(()=>m.set(g));continue}let v=!1;if(window.MotionHandoffAnimation){const F=id(e);if(F){const B=window.MotionHandoffAnimation(F,p,ge);B!==null&&(x.startTime=B,v=!0)}}Si(e,p);const j=c??e.shouldReduceMotion;m.start(ks(p,m,g,j&&rd.has(p)?{type:!1}:x,e,v));const w=m.animation;w&&d.push(w)}if(a){const p=()=>ge.update(()=>{a&&J1(e,a)});d.length?Promise.all(d).then(p):p()}return d}function Ci(e,t,n={}){var u;const r=Qt(e,t,n.type==="exit"?(u=e.presenceContext)==null?void 0:u.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(sd(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:p}=o;return ng(e,t,c,d,h,p,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[c,d]=l==="beforeChildren"?[s,a]:[a,s];return c().then(()=>d())}else return Promise.all([s(),a(n.delay)])}function ng(e,t,n=0,r=0,o=0,s=1,a){const l=[];for(const u of e.variantChildren)u.notify("AnimationStart",t),l.push(Ci(u,t,{...a,delay:n+(typeof r=="function"?0:r)+ed(e.variantChildren,u,r,o,s)}).then(()=>u.notify("AnimationComplete",t)));return Promise.all(l)}function rg(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>Ci(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=Ci(e,t,n);else{const o=typeof t=="function"?Qt(e,t,n.custom):t;r=Promise.all(sd(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const og={test:e=>e==="auto",parse:e=>e},ad=e=>t=>t.test(e),ld=[An,q,St,Mt,Fm,Em,og],_a=e=>ld.find(ad(e));function ig(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||bu(e):!0}const sg=new Set(["brightness","contrast","saturate","opacity"]);function ag(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(ps)||[];if(!r)return e;const o=n.replace(r,"");let s=sg.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const lg=/\b([a-z-]*)\(.*?\)/gu,ji={...ft,getAnimatableNone:e=>{const t=e.match(lg);return t?t.map(ag).join(" "):e}},Ti={...ft,getAnimatableNone:e=>{const t=ft.parse(e);return ft.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},Na={...An,transform:Math.round},cg={rotate:Mt,rotateX:Mt,rotateY:Mt,rotateZ:Mt,scale:jr,scaleX:jr,scaleY:jr,scaleZ:jr,skew:Mt,skewX:Mt,skewY:Mt,distance:q,translateX:q,translateY:q,translateZ:q,x:q,y:q,z:q,perspective:q,transformPerspective:q,opacity:ir,originX:Ta,originY:Ta,originZ:q},Cs={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,...cg,zIndex:Na,fillOpacity:ir,strokeOpacity:ir,numOctaves:Na},ug={...Cs,color:Ce,backgroundColor:Ce,outlineColor:Ce,fill:Ce,stroke:Ce,borderColor:Ce,borderTopColor:Ce,borderRightColor:Ce,borderBottomColor:Ce,borderLeftColor:Ce,filter:ji,WebkitFilter:ji,mask:Ti,WebkitMask:Ti},cd=e=>ug[e],dg=new Set([ji,Ti]);function ud(e,t){let n=cd(e);return dg.has(n)||(n=ft),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const fg=new Set(["auto","none","0"]);function hg(e,t,n){let r=0,o;for(;r<e.length&&!o;){const s=e[r];typeof s=="string"&&!fg.has(s)&&Bn(s).values.length&&(o=e[r]),r++}if(o&&n)for(const s of t)e[s]=ud(n,o)}class pg extends bs{constructor(t,n,r,o,s){super(t,n,r,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let h=t[d];if(typeof h=="string"&&(h=h.trim(),hs(h))){const p=td(h,n.current);p!==void 0&&(t[d]=p),d===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!rd.has(r)||t.length!==2)return;const[o,s]=t,a=_a(o),l=_a(s),u=ja(o),c=ja(s);if(u!==c&&Ot[r]){this.needsMeasurement=!0;return}if(a!==l)if(Ra(a)&&Ra(l))for(let d=0;d<t.length;d++){const h=t[d];typeof h=="string"&&(t[d]=parseFloat(h))}else Ot[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||ig(t[o]))&&r.push(o);r.length&&hg(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=Ot[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const s=r.length-1,a=r[s];r[s]=Ot[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(([u,c])=>{t.getValue(u).set(c)}),this.resolveNoneKeyframes()}}function dd(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=(n==null?void 0:n[e])??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(r=>r!=null)}const fd=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Or(e){return yu(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:js}=Iu(queueMicrotask,!1),dt={x:!1,y:!1};function hd(){return dt.x||dt.y}function mg(e){return e==="x"||e==="y"?dt[e]?null:(dt[e]=!0,()=>{dt[e]=!1}):dt.x||dt.y?null:(dt.x=dt.y=!0,()=>{dt.x=dt.y=!1})}function pd(e,t){const n=dd(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function gg(e){return!(e.pointerType==="touch"||hd())}function xg(e,t,n={}){const[r,o,s]=pd(e,n);return r.forEach(a=>{let l=!1,u=!1,c;const d=()=>{a.removeEventListener("pointerleave",g)},h=y=>{c&&(c(y),c=void 0),d()},p=y=>{l=!1,window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",p),u&&(u=!1,h(y))},m=()=>{l=!0,window.addEventListener("pointerup",p,o),window.addEventListener("pointercancel",p,o)},g=y=>{if(y.pointerType!=="touch"){if(l){u=!0;return}h(y)}},x=y=>{if(!gg(y))return;u=!1;const v=t(a,y);typeof v=="function"&&(c=v,a.addEventListener("pointerleave",g,o))};a.addEventListener("pointerenter",x,o),a.addEventListener("pointerdown",m,o)}),s}const md=(e,t)=>t?e===t?!0:md(e,t.parentElement):!1,Ts=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,yg=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function bg(e){return yg.has(e.tagName)||e.isContentEditable===!0}const vg=new Set(["INPUT","SELECT","TEXTAREA"]);function kg(e){return vg.has(e.tagName)||e.isContentEditable===!0}const zr=new WeakSet;function Va(e){return t=>{t.key==="Enter"&&e(t)}}function Ro(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const wg=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Va(()=>{if(zr.has(n))return;Ro(n,"down");const o=Va(()=>{Ro(n,"up")}),s=()=>Ro(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Wa(e){return Ts(e)&&!hd()}const Ha=new WeakSet;function Sg(e,t,n={}){const[r,o,s]=pd(e,n),a=l=>{const u=l.currentTarget;if(!Wa(l)||Ha.has(l))return;zr.add(u),n.stopPropagation&&Ha.add(l);const c=t(u,l),d=(m,g)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",p),zr.has(u)&&zr.delete(u),Wa(m)&&typeof c=="function"&&c(m,{success:g})},h=m=>{d(m,u===window||u===document||n.useGlobalTarget||md(u,m.target))},p=m=>{d(m,!1)};window.addEventListener("pointerup",h,o),window.addEventListener("pointercancel",p,o)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,o),Or(l)&&(l.addEventListener("focus",c=>wg(c,o)),!bg(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),s}function Bs(e){return yu(e)&&"ownerSVGElement"in e}const _r=new WeakMap;let Pt;const gd=(e,t,n)=>(r,o)=>o&&o[0]?o[0][e+"Size"]:Bs(r)&&"getBBox"in r?r.getBBox()[t]:r[n],Cg=gd("inline","width","offsetWidth"),jg=gd("block","height","offsetHeight");function Tg({target:e,borderBoxSize:t}){var n;(n=_r.get(e))==null||n.forEach(r=>{r(e,{get width(){return Cg(e,t)},get height(){return jg(e,t)}})})}function Bg(e){e.forEach(Tg)}function Eg(){typeof ResizeObserver>"u"||(Pt=new ResizeObserver(Bg))}function Fg(e,t){Pt||Eg();const n=dd(e);return n.forEach(r=>{let o=_r.get(r);o||(o=new Set,_r.set(r,o)),o.add(t),Pt==null||Pt.observe(r)}),()=>{n.forEach(r=>{const o=_r.get(r);o==null||o.delete(t),o!=null&&o.size||Pt==null||Pt.unobserve(r)})}}const Nr=new Set;let wn;function Ag(){wn=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Nr.forEach(t=>t(e))},window.addEventListener("resize",wn)}function Lg(e){return Nr.add(e),wn||Ag(),()=>{Nr.delete(e),!Nr.size&&typeof wn=="function"&&(window.removeEventListener("resize",wn),wn=void 0)}}function Ua(e,t){return typeof e=="function"?Lg(e):Fg(e,t)}function Ig(e){return Bs(e)&&e.tagName==="svg"}const Dg=[...ld,Ce,ft],Rg=e=>Dg.find(ad(e)),$a=()=>({translate:0,scale:1,origin:0,originPoint:0}),Sn=()=>({x:$a(),y:$a()}),Ga=()=>({min:0,max:0}),Fe=()=>({x:Ga(),y:Ga()}),Mg=new WeakMap;function fo(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function sr(e){return typeof e=="string"||Array.isArray(e)}const Es=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Fs=["initial",...Es];function ho(e){return fo(e.animate)||Fs.some(t=>sr(e[t]))}function xd(e){return!!(ho(e)||e.variants)}function Pg(e,t,n){for(const r in t){const o=t[r],s=n[r];if(Oe(o))e.addValue(r,o);else if(Oe(s))e.addValue(r,En(o,{owner:e}));else if(s!==o)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(o):a.hasAnimated||a.set(o)}else{const a=e.getStaticValue(r);e.addValue(r,En(a!==void 0?a:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Bi={current:null},yd={current:!1},Og=typeof window<"u";function zg(){if(yd.current=!0,!!Og)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Bi.current=e.matches;e.addEventListener("change",t),t()}else Bi.current=!1}const Ya=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Zr={};function bd(e){Zr=e}function _g(){return Zr}class Ng{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,skipAnimations:s,blockInitialAnimation:a,visualState:l},u={}){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=bs,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 m=We.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,ge.render(this.render,!1,!0))};const{latestValues:c,renderState:d}=l;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=s,this.options=u,this.blockInitialAnimation=!!a,this.isControllingVariants=ho(n),this.isVariantNode=xd(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in p){const g=p[m];c[m]!==void 0&&Oe(g)&&g.set(c[m])}}mount(t){var n,r;if(this.hasBeenMounted)for(const o in this.initialValues)(n=this.values.get(o))==null||n.jump(this.initialValues[o]),this.latestValues[o]=this.initialValues[o];this.current=t,Mg.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((o,s)=>this.bindToMotionValue(s,o)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(yd.current||zg(),this.shouldReduceMotion=Bi.current),process.env.NODE_ENV!=="production"&&us(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(),_t(this.notifyUpdate),_t(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&&Qu.has(t)&&this.current instanceof HTMLElement){const{factory:a,keyframes:l,times:u,ease:c,duration:d}=n.accelerate,h=new Zu({element:this.current,name:t,keyframes:l,times:u,ease:c,duration:Ke(d)}),p=a(h);this.valueSubscriptions.set(t,()=>{p(),h.cancel()});return}const r=In.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&ge.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,()=>{o(),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 Zr){const n=Zr[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(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):Fe()}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<Ya.length;r++){const o=Ya[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,a=t[s];a&&(this.propEventSubscriptions[o]=this.on(o,a))}this.prevMotionValues=Pg(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=En(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"&&(xu(r)||bu(r))?r=parseFloat(r):!Rg(r)&&ft.test(n)&&(r=ud(t,n)),this.setBaseTarget(t,Oe(r)?r.get():r)),Oe(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=ws(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);a&&(r=a[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Oe(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new cs),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){js.render(this.render)}}class vd extends Ng{constructor(){super(...arguments),this.KeyframeResolver=pg}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;Oe(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Nt{constructor(t){this.isMounted=!1,this.node=t}update(){}}function kd({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Vg({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Wg(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 Mo(e){return e===void 0||e===1}function Ei({scale:e,scaleX:t,scaleY:n}){return!Mo(e)||!Mo(t)||!Mo(n)}function Kt(e){return Ei(e)||wd(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function wd(e){return Ka(e.x)||Ka(e.y)}function Ka(e){return e&&e!=="0%"}function Jr(e,t,n){const r=e-n,o=t*r;return n+o}function qa(e,t,n,r,o){return o!==void 0&&(e=Jr(e,o,r)),Jr(e,n,r)+t}function Fi(e,t=0,n=1,r,o){e.min=qa(e.min,t,n,r,o),e.max=qa(e.max,t,n,r,o)}function Sd(e,{x:t,y:n}){Fi(e.x,t.translate,t.scale,t.originPoint),Fi(e.y,n.translate,n.scale,n.originPoint)}const Xa=.999999999999,Za=1.0000000000001;function Hg(e,t,n,r=!1){var l;const o=n.length;if(!o)return;t.x=t.y=1;let s,a;for(let u=0;u<o;u++){s=n[u],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&&(vt(e.x,-s.scroll.offset.x),vt(e.y,-s.scroll.offset.y)),a&&(t.x*=a.x.scale,t.y*=a.y.scale,Sd(e,a)),r&&Kt(s.latestValues)&&Vr(e,s.latestValues,(l=s.layout)==null?void 0:l.layoutBox))}t.x<Za&&t.x>Xa&&(t.x=1),t.y<Za&&t.y>Xa&&(t.y=1)}function vt(e,t){e.min+=t,e.max+=t}function Ja(e,t,n,r,o=.5){const s=ye(e.min,e.max,o);Fi(e,t,n,s,r)}function Qa(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Vr(e,t,n){const r=n??e;Ja(e.x,Qa(t.x,r.x),t.scaleX,t.scale,t.originX),Ja(e.y,Qa(t.y,r.y),t.scaleY,t.scale,t.originY)}function Cd(e,t){return kd(Wg(e.getBoundingClientRect(),t))}function Ug(e,t,n){const r=Cd(e,n),{scroll:o}=t;return o&&(vt(r.x,o.offset.x),vt(r.y,o.offset.y)),r}const $g={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Gg=Ln.length;function Yg(e,t,n){let r="",o=!0;for(let s=0;s<Gg;s++){const a=Ln[s],l=e[a];if(l===void 0)continue;let u=!0;if(typeof l=="number")u=l===(a.startsWith("scale")?1:0);else{const c=parseFloat(l);u=a.startsWith("scale")?c===1:c===0}if(!u||n){const c=fd(l,Cs[a]);if(!u){o=!1;const d=$g[a]||a;r+=`${d}(${c}) `}n&&(t[a]=c)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function As(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let a=!1,l=!1;for(const u in t){const c=t[u];if(In.has(u)){a=!0;continue}else if(Ru(u)){o[u]=c;continue}else{const d=fd(c,Cs[u]);u.startsWith("origin")?(l=!0,s[u]=d):r[u]=d}}if(t.transform||(a||n?r.transform=Yg(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:u="50%",originY:c="50%",originZ:d=0}=s;r.transformOrigin=`${u} ${c} ${d}`}}function jd(e,{style:t,vars:n},r,o){const s=e.style;let a;for(a in t)s[a]=t[a];o==null||o.applyProjectionStyles(s,r);for(a in n)s.setProperty(a,n[a])}function el(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Vn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(q.test(e))e=parseFloat(e);else return e;const n=el(e,t.target.x),r=el(e,t.target.y);return`${n}% ${r}%`}},Kg={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=ft.parse(e);if(o.length>5)return r;const s=ft.createTransformer(e),a=typeof o[0]!="number"?1:0,l=n.x.scale*t.x,u=n.y.scale*t.y;o[0+a]/=l,o[1+a]/=u;const c=ye(l,u,.5);return typeof o[2+a]=="number"&&(o[2+a]/=c),typeof o[3+a]=="number"&&(o[3+a]/=c),s(o)}},Ai={borderRadius:{...Vn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vn,borderTopRightRadius:Vn,borderBottomLeftRadius:Vn,borderBottomRightRadius:Vn,boxShadow:Kg};function Td(e,{layout:t,layoutId:n}){return In.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ai[e]||e==="opacity")}function Ls(e,t,n){var a;const r=e.style,o=t==null?void 0:t.style,s={};if(!r)return s;for(const l in r)(Oe(r[l])||o&&Oe(o[l])||Td(l,e)||((a=n==null?void 0:n.getValue(l))==null?void 0:a.liveStyle)!==void 0)&&(s[l]=r[l]);return s}function qg(e){return window.getComputedStyle(e)}class Xg extends vd{constructor(){super(...arguments),this.type="html",this.renderInstance=jd}readValueFromInstance(t,n){var r;if(In.has(n))return(r=this.projection)!=null&&r.isProjecting?gi(n):m1(t,n);{const o=qg(t),s=(Ru(n)?o.getPropertyValue(n):o[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Cd(t,n)}build(t,n,r){As(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Ls(t,n,r)}}const Zg={offset:"stroke-dashoffset",array:"stroke-dasharray"},Jg={offset:"strokeDashoffset",array:"strokeDasharray"};function Qg(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?Zg:Jg;e[s.offset]=`${-r}`,e[s.array]=`${t} ${n}`}const ex=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Bd(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:a=0,...l},u,c,d){if(As(e,l,c),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p}=e;h.transform&&(p.transform=h.transform,delete h.transform),(p.transform||h.transformOrigin)&&(p.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),p.transform&&(p.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete h.transformBox);for(const m of ex)h[m]!==void 0&&(p[m]=h[m],delete h[m]);t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&Qg(h,o,s,a,!1)}const Ed=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"]),Fd=e=>typeof e=="string"&&e.toLowerCase()==="svg";function tx(e,t,n,r){jd(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(Ed.has(o)?o:Ss(o),t.attrs[o])}function Ad(e,t,n){const r=Ls(e,t,n);for(const o in e)if(Oe(e[o])||Oe(t[o])){const s=Ln.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}class nx extends vd{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Fe}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(In.has(n)){const r=cd(n);return r&&r.default||0}return n=Ed.has(n)?n:Ss(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Ad(t,n,r)}build(t,n,r){Bd(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){tx(t,n,r,o)}mount(t){this.isSVGTag=Fd(t.tagName),super.mount(t)}}const rx=Fs.length;function Ld(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Ld(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<rx;n++){const r=Fs[n],o=e.props[r];(sr(o)||o===!1)&&(t[r]=o)}return t}function Id(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 ox=[...Es].reverse(),ix=Es.length;function sx(e){return t=>Promise.all(t.map(({animation:n,options:r})=>rg(e,n,r)))}function ax(e){let t=sx(e),n=tl(),r=!0,o=!1;const s=c=>(d,h)=>{var m;const p=Qt(e,h,c==="exit"?(m=e.presenceContext)==null?void 0:m.custom:void 0);if(p){const{transition:g,transitionEnd:x,...y}=p;d={...d,...y,...x}}return d};function a(c){t=c(e)}function l(c){const{props:d}=e,h=Ld(e.parent)||{},p=[],m=new Set;let g={},x=1/0;for(let v=0;v<ix;v++){const j=ox[v],w=n[j],F=d[j]!==void 0?d[j]:h[j],B=sr(F),C=j===c?w.isActive:null;C===!1&&(x=v);let P=F===h[j]&&F!==d[j]&&B;if(P&&(r||o)&&e.manuallyAnimateOnMount&&(P=!1),w.protectedKeys={...g},!w.isActive&&C===null||!F&&!w.prevProp||fo(F)||typeof F=="boolean")continue;if(j==="exit"&&w.isActive&&C!==!0){w.prevResolvedValues&&(g={...g,...w.prevResolvedValues});continue}const A=lx(w.prevProp,F);let E=A||j===c&&w.isActive&&!P&&B||v>x&&B,L=!1;const R=Array.isArray(F)?F:[F];let D=R.reduce(s(j),{});C===!1&&(D={});const{prevResolvedValues:N={}}=w,O={...N,...D},I=W=>{E=!0,m.has(W)&&(L=!0,m.delete(W)),w.needsAnimating[W]=!0;const $=e.getValue(W);$&&($.liveStyle=!1)};for(const W in O){const $=D[W],b=N[W];if(g.hasOwnProperty(W))continue;let Y=!1;wi($)&&wi(b)?Y=!Id($,b):Y=$!==b,Y?$!=null?I(W):m.add(W):$!==void 0&&m.has(W)?I(W):w.protectedKeys[W]=!0}w.prevProp=F,w.prevResolvedValues=D,w.isActive&&(g={...g,...D}),(r||o)&&e.blockInitialAnimation&&(E=!1);const M=P&&A;E&&(!M||L)&&p.push(...R.map(W=>{const $={type:j};if(typeof W=="string"&&(r||o)&&!M&&e.manuallyAnimateOnMount&&e.parent){const{parent:b}=e,Y=Qt(b,W);if(b.enteringChildren&&Y){const{delayChildren:oe}=Y.transition||{};$.delay=ed(b.enteringChildren,e,oe)}}return{animation:W,options:$}}))}if(m.size){const v={};if(typeof d.initial!="boolean"){const j=Qt(e,Array.isArray(d.initial)?d.initial[0]:d.initial);j&&j.transition&&(v.transition=j.transition)}m.forEach(j=>{const w=e.getBaseTarget(j),F=e.getValue(j);F&&(F.liveStyle=!0),v[j]=w??null}),p.push({animation:v})}let y=!!p.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,o=!1,y?t(p):Promise.resolve()}function u(c,d){var p;if(n[c].isActive===d)return Promise.resolve();(p=e.variantChildren)==null||p.forEach(m=>{var g;return(g=m.animationState)==null?void 0:g.setActive(c,d)}),n[c].isActive=d;const h=l(c);for(const m in n)n[m].protectedKeys={};return h}return{animateChanges:l,setActive:u,setAnimateFunction:a,getState:()=>n,reset:()=>{n=tl(),o=!0}}}function lx(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Id(t,e):!1}function $t(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function tl(){return{animate:$t(!0),whileInView:$t(),whileHover:$t(),whileTap:$t(),whileDrag:$t(),whileFocus:$t(),exit:$t()}}function Li(e,t){e.min=t.min,e.max=t.max}function ut(e,t){Li(e.x,t.x),Li(e.y,t.y)}function nl(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Dd=1e-4,cx=1-Dd,ux=1+Dd,Rd=.01,dx=0-Rd,fx=0+Rd;function He(e){return e.max-e.min}function hx(e,t,n){return Math.abs(e-t)<=n}function rl(e,t,n,r=.5){e.origin=r,e.originPoint=ye(t.min,t.max,e.origin),e.scale=He(n)/He(t),e.translate=ye(n.min,n.max,e.origin)-e.originPoint,(e.scale>=cx&&e.scale<=ux||isNaN(e.scale))&&(e.scale=1),(e.translate>=dx&&e.translate<=fx||isNaN(e.translate))&&(e.translate=0)}function Qn(e,t,n,r){rl(e.x,t.x,n.x,r?r.originX:void 0),rl(e.y,t.y,n.y,r?r.originY:void 0)}function ol(e,t,n,r=0){const o=r?ye(n.min,n.max,r):n.min;e.min=o+t.min,e.max=e.min+He(t)}function px(e,t,n,r){ol(e.x,t.x,n.x,r==null?void 0:r.x),ol(e.y,t.y,n.y,r==null?void 0:r.y)}function il(e,t,n,r=0){const o=r?ye(n.min,n.max,r):n.min;e.min=t.min-o,e.max=e.min+He(t)}function Qr(e,t,n,r){il(e.x,t.x,n.x,r==null?void 0:r.x),il(e.y,t.y,n.y,r==null?void 0:r.y)}function sl(e,t,n,r,o){return e-=t,e=Jr(e,1/n,r),o!==void 0&&(e=Jr(e,1/o,r)),e}function mx(e,t=0,n=1,r=.5,o,s=e,a=e){if(St.test(t)&&(t=parseFloat(t),t=ye(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=ye(s.min,s.max,r);e===s&&(l-=t),e.min=sl(e.min,t,n,l,o),e.max=sl(e.max,t,n,l,o)}function al(e,t,[n,r,o],s,a){mx(e,t[n],t[r],t[o],t.scale,s,a)}const gx=["x","scaleX","originX"],xx=["y","scaleY","originY"];function ll(e,t,n,r){al(e.x,t,gx,n?n.x:void 0,r?r.x:void 0),al(e.y,t,xx,n?n.y:void 0,r?r.y:void 0)}function cl(e){return e.translate===0&&e.scale===1}function Md(e){return cl(e.x)&&cl(e.y)}function ul(e,t){return e.min===t.min&&e.max===t.max}function yx(e,t){return ul(e.x,t.x)&&ul(e.y,t.y)}function dl(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Pd(e,t){return dl(e.x,t.x)&&dl(e.y,t.y)}function fl(e){return He(e.x)/He(e.y)}function hl(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function yt(e){return[e("x"),e("y")]}function bx(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((o||s||a)&&(r=`translate3d(${o}px, ${s}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:d,rotateX:h,rotateY:p,skewX:m,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),d&&(r+=`rotate(${d}deg) `),h&&(r+=`rotateX(${h}deg) `),p&&(r+=`rotateY(${p}deg) `),m&&(r+=`skewX(${m}deg) `),g&&(r+=`skewY(${g}deg) `)}const l=e.x.scale*t.x,u=e.y.scale*t.y;return(l!==1||u!==1)&&(r+=`scale(${l}, ${u})`),r||"none"}const Od=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],vx=Od.length,pl=e=>typeof e=="string"?parseFloat(e):e,ml=e=>typeof e=="number"||q.test(e);function kx(e,t,n,r,o,s){o?(e.opacity=ye(0,n.opacity??1,wx(r)),e.opacityExit=ye(t.opacity??1,0,Sx(r))):s&&(e.opacity=ye(t.opacity??1,n.opacity??1,r));for(let a=0;a<vx;a++){const l=Od[a];let u=gl(t,l),c=gl(n,l);if(u===void 0&&c===void 0)continue;u||(u=0),c||(c=0),u===0||c===0||ml(u)===ml(c)?(e[l]=Math.max(ye(pl(u),pl(c),r),0),(St.test(c)||St.test(u))&&(e[l]+="%")):e[l]=c}(t.rotate||n.rotate)&&(e.rotate=ye(t.rotate||0,n.rotate||0,r))}function gl(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const wx=zd(0,.5,Eu),Sx=zd(.5,.95,st);function zd(e,t,n){return r=>r<e?0:r>t?1:n(or(e,t,r))}function Cx(e,t,n){const r=Oe(e)?e:En(e);return r.start(ks("",r,t,n)),r.animation}function ar(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const jx=(e,t)=>e.depth-t.depth;class Tx{constructor(){this.children=[],this.isDirty=!1}add(t){ls(this.children,t),this.isDirty=!0}remove(t){Gr(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(jx),this.isDirty=!1,this.children.forEach(t)}}function Bx(e,t){const n=We.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(_t(r),e(s-t))};return ge.setup(r,!0),()=>_t(r)}function Wr(e){return Oe(e)?e.get():e}class Ex{constructor(){this.members=[]}add(t){ls(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 o=r.instance;(!o||o.isConnected===!1)&&!r.snapshot&&(Gr(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Gr(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 o=this.members[r];if(o.isPresent!==!1&&((n=o.instance)==null?void 0:n.isConnected)!==!1)return this.promote(o),!0}return!1}promote(t,n){var o;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),(o=t.root)!=null&&o.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,o,s,a;(r=(n=t.options).onExitComplete)==null||r.call(n),(a=(o=t.resumingFrom)==null?void 0:(s=o.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 Hr={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Po=["","X","Y","Z"],Fx=1e3;let Ax=0;function Oo(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function _d(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=id(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ge,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&_d(r)}function Nd({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(a={},l=t==null?void 0:t()){this.id=Ax++,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(Dx),this.nodes.forEach(_x),this.nodes.forEach(Nx),this.nodes.forEach(Rx)},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 u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new Tx)}addEventListener(a,l){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new cs),this.eventHandlers.get(a).add(l)}notifyListeners(a,...l){const u=this.eventHandlers.get(a);u&&u.notify(...l)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=Bs(a)&&!Ig(a),this.instance=a;const{layoutId:l,layout:u,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&&(u||l)&&(this.isLayoutDirty=!0),e){let d,h=0;const p=()=>this.root.updateBlockedByResize=!1;ge.read(()=>{h=window.innerWidth}),e(a,()=>{const m=window.innerWidth;m!==h&&(h=m,this.root.updateBlockedByResize=!0,d&&d(),d=Bx(p,250),Hr.hasAnimatedSinceResize&&(Hr.hasAnimatedSinceResize=!1,this.nodes.forEach(bl)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeLayoutChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||$x,{onLayoutAnimationStart:x,onLayoutAnimationComplete:y}=c.getProps(),v=!this.targetLayout||!Pd(this.targetLayout,m),j=!h&&p;if(this.options.layoutRoot||this.resumeFrom||j||h&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...vs(g,"layout"),onPlay:x,onComplete:y};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(d,j)}else h||bl(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}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(),_t(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(Vx),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&&_d(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const h=this.path[d];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:u}=this.options;if(l===void 0&&!u)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 u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(Px),this.nodes.forEach(xl);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(yl);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Ox),this.nodes.forEach(zx),this.nodes.forEach(Lx),this.nodes.forEach(Ix)):this.nodes.forEach(yl),this.clearAllSnapshots();const l=We.now();Pe.delta=jt(0,1e3/60,l-Pe.timestamp),Pe.timestamp=l,Pe.isProcessing=!0,Eo.update.process(Pe),Eo.preRender.process(Pe),Eo.render.process(Pe),Pe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,js.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Mx),this.sharedNodes.forEach(Wx)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ge.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ge.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!He(this.snapshot.measuredBox.x)&&!He(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 u=0;u<this.path.length;u++)this.path[u].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Fe()),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 u=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:u,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!o)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!Md(this.projectionDelta),u=this.getTransformTemplate(),c=u?u(this.latestValues,""):void 0,d=c!==this.prevTransformTemplateValue;a&&this.instance&&(l||Kt(this.latestValues)||d)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const l=this.measurePageBox();let u=this.removeElementScroll(l);return a&&(u=this.removeTransform(u)),Gx(u),{animationId:this.root.animationId,measuredBox:l,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:a}=this.options;if(!a)return Fe();const l=a.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(Yx))){const{scroll:d}=this.root;d&&(vt(l.x,d.offset.x),vt(l.y,d.offset.y))}return l}removeElementScroll(a){var u;const l=Fe();if(ut(l,a),(u=this.scroll)!=null&&u.wasRoot)return l;for(let c=0;c<this.path.length;c++){const d=this.path[c],{scroll:h,options:p}=d;d!==this.root&&h&&p.layoutScroll&&(h.wasRoot&&ut(l,a),vt(l.x,h.offset.x),vt(l.y,h.offset.y))}return l}applyTransform(a,l=!1,u){var d,h;const c=u||Fe();ut(c,a);for(let p=0;p<this.path.length;p++){const m=this.path[p];!l&&m.options.layoutScroll&&m.scroll&&m!==m.root&&(vt(c.x,-m.scroll.offset.x),vt(c.y,-m.scroll.offset.y)),Kt(m.latestValues)&&Vr(c,m.latestValues,(d=m.layout)==null?void 0:d.layoutBox)}return Kt(this.latestValues)&&Vr(c,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),c}removeTransform(a){var u;const l=Fe();ut(l,a);for(let c=0;c<this.path.length;c++){const d=this.path[c];if(!Kt(d.latestValues))continue;let h;d.instance&&(Ei(d.latestValues)&&d.updateSnapshot(),h=Fe(),ut(h,d.measurePageBox())),ll(l,d.latestValues,(u=d.snapshot)==null?void 0:u.layoutBox,h)}return Kt(this.latestValues)&&ll(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!==Pe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var m;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(a||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:h}=this.options;if(!this.layout||!(d||h))return;this.resolvedRelativeTargetAt=Pe.timestamp;const p=this.getClosestProjectingParent();p&&this.linkedParentVersion!==p.layoutVersion&&!p.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&p&&p.layout?this.createRelativeTarget(p,this.layout.layoutBox,p.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Fe(),this.targetWithTransforms=Fe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),px(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ut(this.target,this.layout.layoutBox),Sd(this.target,this.targetDelta)):ut(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?this.createRelativeTarget(p,this.target,p.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Ei(this.parent.latestValues)||wd(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,u){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Fe(),this.relativeTargetOrigin=Fe(),Qr(this.relativeTargetOrigin,l,u,this.options.layoutAnchor||void 0),ut(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var g;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||(g=this.parent)!=null&&g.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Pe.timestamp&&(u=!1),u)return;const{layout:c,layoutId:d}=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||d))return;ut(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,p=this.treeScale.y;Hg(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=Fe());const{target:m}=a;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(nl(this.prevProjectionDelta.x,this.projectionDelta.x),nl(this.prevProjectionDelta.y,this.projectionDelta.y)),Qn(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==p||!hl(this.projectionDelta.x,this.prevProjectionDelta.x)||!hl(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),a){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Sn(),this.projectionDelta=Sn(),this.projectionDeltaWithTransform=Sn()}setAnimationOrigin(a,l=!1){const u=this.snapshot,c=u?u.latestValues:{},d={...this.latestValues},h=Sn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const p=Fe(),m=u?u.source:void 0,g=this.layout?this.layout.source:void 0,x=m!==g,y=this.getStack(),v=!y||y.members.length<=1,j=!!(x&&!v&&this.options.crossfade===!0&&!this.path.some(Ux));this.animationProgress=0;let w;this.mixTargetDelta=F=>{const B=F/1e3;vl(h.x,a.x,B),vl(h.y,a.y,B),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Qr(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Hx(this.relativeTarget,this.relativeTargetOrigin,p,B),w&&yx(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Fe()),ut(w,this.relativeTarget)),x&&(this.animationValues=d,kx(d,c,this.latestValues,B,j,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=B},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var l,u,c;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(c=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||c.stop(),this.pendingAnimation&&(_t(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ge.update(()=>{Hr.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=En(0)),this.motionValue.jump(0,!1),this.currentAnimation=Cx(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),a.onUpdate&&a.onUpdate(d)},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(Fx),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:u,layout:c,latestValues:d}=a;if(!(!l||!u||!c)){if(this!==a&&this.layout&&c&&Vd(this.options.animationType,this.layout.layoutBox,c.layoutBox)){u=this.target||Fe();const h=He(this.layout.layoutBox.x);u.x.min=a.target.x.min,u.x.max=u.x.min+h;const p=He(this.layout.layoutBox.y);u.y.min=a.target.y.min,u.y.max=u.y.min+p}ut(l,u),Vr(l,d),Qn(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new Ex),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:u}={}){const c=this.getStack();c&&c.promote(this,u),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:u}=a;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(l=!0),!l)return;const c={};u.z&&Oo("z",a,c,this.animationValues);for(let d=0;d<Po.length;d++)Oo(`rotate${Po[d]}`,a,c,this.animationValues),Oo(`skew${Po[d]}`,a,c,this.animationValues);a.render();for(const d in c)a.setStaticValue(d,c[d]),this.animationValues&&(this.animationValues[d]=c[d]);a.scheduleRender()}applyProjectionStyles(a,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=Wr(l==null?void 0:l.pointerEvents)||"",a.transform=u?u(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=Wr(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!Kt(this.latestValues)&&(a.transform=u?u({},""):"none",this.hasProjected=!1);return}a.visibility="";const d=c.animationValues||c.latestValues;this.applyTransformsToTarget();let h=bx(this.projectionDeltaWithTransform,this.treeScale,d);u&&(h=u(d,h)),a.transform=h;const{x:p,y:m}=this.projectionDelta;a.transformOrigin=`${p.origin*100}% ${m.origin*100}% 0`,c.animationValues?a.opacity=c===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:a.opacity=c===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const g in Ai){if(d[g]===void 0)continue;const{correct:x,applyTo:y,isCSSVariable:v}=Ai[g],j=h==="none"?d[g]:x(d[g],c);if(y){const w=y.length;for(let F=0;F<w;F++)a[y[F]]=j}else v?this.options.visualElement.renderState.vars[g]=j:a[g]=j}this.options.layoutId&&(a.pointerEvents=c===this?Wr(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(xl),this.root.sharedNodes.clear()}}}function Lx(e){e.updateLayout()}function Ix(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:o}=e.layout,{animationType:s}=e.options,a=t.source!==e.layout.source;if(s==="size")yt(h=>{const p=a?t.measuredBox[h]:t.layoutBox[h],m=He(p);p.min=r[h].min,p.max=p.min+m});else if(s==="x"||s==="y"){const h=s==="x"?"y":"x";Li(a?t.measuredBox[h]:t.layoutBox[h],r[h])}else Vd(s,t.layoutBox,r)&&yt(h=>{const p=a?t.measuredBox[h]:t.layoutBox[h],m=He(r[h]);p.max=p.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+m)});const l=Sn();Qn(l,r,t.layoutBox);const u=Sn();a?Qn(u,e.applyTransform(o,!0),t.measuredBox):Qn(u,r,t.layoutBox);const c=!Md(l);let d=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:p,layout:m}=h;if(p&&m){const g=e.options.layoutAnchor||void 0,x=Fe();Qr(x,t.layoutBox,p.layoutBox,g);const y=Fe();Qr(y,r,m.layoutBox,g),Pd(x,y)||(d=!0),h.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=x,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:u,layoutDelta:l,hasLayoutChanged:c,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Dx(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 Rx(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Mx(e){e.clearSnapshot()}function xl(e){e.clearMeasurements()}function Px(e){e.isLayoutDirty=!0,e.updateLayout()}function yl(e){e.isLayoutDirty=!1}function Ox(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function zx(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function bl(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function _x(e){e.resolveTargetDelta()}function Nx(e){e.calcProjection()}function Vx(e){e.resetSkewAndRotation()}function Wx(e){e.removeLeadSnapshot()}function vl(e,t,n){e.translate=ye(t.translate,0,n),e.scale=ye(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function kl(e,t,n,r){e.min=ye(t.min,n.min,r),e.max=ye(t.max,n.max,r)}function Hx(e,t,n,r){kl(e.x,t.x,n.x,r),kl(e.y,t.y,n.y,r)}function Ux(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const $x={duration:.45,ease:[.4,0,.1,1]},wl=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Sl=wl("applewebkit/")&&!wl("chrome/")?Math.round:st;function Cl(e){e.min=Sl(e.min),e.max=Sl(e.max)}function Gx(e){Cl(e.x),Cl(e.y)}function Vd(e,t,n){return e==="position"||e==="preserve-aspect"&&!hx(fl(t),fl(n),.2)}function Yx(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Kx=Nd({attachResizeListener:(e,t)=>ar(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}),zo={current:void 0},Wd=Nd({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!zo.current){const e=new Kx({});e.mount(window),e.setOptions({layoutScroll:!0}),zo.current=e}return zo.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Is=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function jl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function qx(...e){return t=>{let n=!1;const r=e.map(o=>{const s=jl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():jl(e[o],null)}}}}function Xx(...e){return be.useCallback(qx(...e),e)}class Zx extends be.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Or(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,o=Or(r)&&r.offsetWidth||0,s=Or(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=o-l.width-l.left,l.bottom=s-l.height-l.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Jx({children:e,isPresent:t,anchorX:n,anchorY:r,root:o,pop:s}){var p;const a=S.useId(),l=S.useRef(null),u=S.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=S.useContext(Is),d=((p=e.props)==null?void 0:p.ref)??(e==null?void 0:e.ref),h=Xx(l,d);return S.useInsertionEffect(()=>{const{width:m,height:g,top:x,left:y,right:v,bottom:j}=u.current;if(t||s===!1||!l.current||!m||!g)return;const w=n==="left"?`left: ${y}`:`right: ${v}`,F=r==="bottom"?`bottom: ${j}`:`top: ${x}`;l.current.dataset.motionPopId=a;const B=document.createElement("style");c&&(B.nonce=c);const C=o??document.head;return C.appendChild(B),B.sheet&&B.sheet.insertRule(`
|
|
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&>(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(`
|
|
344
344
|
[data-motion-pop-id="${a}"] {
|
|
345
345
|
position: absolute !important;
|
|
346
|
-
width: ${
|
|
347
|
-
height: ${
|
|
346
|
+
width: ${p}px !important;
|
|
347
|
+
height: ${x}px !important;
|
|
348
348
|
${w}px !important;
|
|
349
|
-
${
|
|
349
|
+
${A}px !important;
|
|
350
350
|
}
|
|
351
|
-
`),()=>{var P;(P=l.current)==null||P.removeAttribute("data-motion-pop-id"),C.contains(B)&&C.removeChild(B)}},[t]),i.jsx(Zx,{isPresent:t,childRef:l,sizeRef:u,pop:s,children:s===!1?e:be.cloneElement(e,{ref:h})})}const Qx=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:a,anchorX:l,anchorY:u,root:c})=>{const d=as(e0),h=S.useId();let p=!0,m=S.useMemo(()=>(p=!1,{id:h,initial:t,isPresent:n,custom:o,onExitComplete:g=>{d.set(g,!0);for(const x of d.values())if(!x)return;r&&r()},register:g=>(d.set(g,!1),()=>d.delete(g))}),[n,d,r]);return s&&p&&(m={...m}),S.useMemo(()=>{d.forEach((g,x)=>d.set(x,!1))},[n]),be.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),e=i.jsx(Jx,{pop:a==="popLayout",isPresent:n,anchorX:l,anchorY:u,root:c,children:e}),i.jsx(co.Provider,{value:m,children:e})};function e0(){return new Map}function Hd(e=!0){const t=S.useContext(co);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=S.useId();S.useEffect(()=>{if(e)return o(s)},[e]);const a=S.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,a]:[!0]}const Tr=e=>e.key||"";function Tl(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const lr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s="sync",propagate:a=!1,anchorX:l="left",anchorY:u="top",root:c})=>{const[d,h]=Hd(a),p=S.useMemo(()=>Tl(e),[e]),m=a&&!d?[]:p.map(Tr),g=S.useRef(!0),x=S.useRef(p),y=as(()=>new Map),v=S.useRef(new Set),[j,w]=S.useState(p),[F,B]=S.useState(p);gu(()=>{g.current=!1,x.current=p;for(let A=0;A<F.length;A++){const E=Tr(F[A]);m.includes(E)?(y.delete(E),v.current.delete(E)):y.get(E)!==!0&&y.set(E,!1)}},[F,m.length,m.join("-")]);const C=[];if(p!==j){let A=[...p];for(let E=0;E<F.length;E++){const L=F[E],R=Tr(L);m.includes(R)||(A.splice(E,0,L),C.push(L))}return s==="wait"&&C.length&&(A=C),B(Tl(A)),w(p),null}process.env.NODE_ENV!=="production"&&s==="wait"&&F.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:P}=S.useContext(ss);return i.jsx(i.Fragment,{children:F.map(A=>{const E=Tr(A),L=a&&!d?!1:p===F||m.includes(E),R=()=>{if(v.current.has(E))return;if(y.has(E))v.current.add(E),y.set(E,!0);else return;let D=!0;y.forEach(N=>{N||(D=!1)}),D&&(P==null||P(),B(x.current),a&&(h==null||h()),r&&r())};return i.jsx(Qx,{isPresent:L,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:c,onExitComplete:L?void 0:R,anchorX:l,anchorY:u,children:A},E)})})},Ud=S.createContext({strict:!1}),Bl={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 El=!1;function t0(){if(El)return;const e={};for(const t in Bl)e[t]={isEnabled:n=>Bl[t].some(r=>!!n[r])};bd(e),El=!0}function $d(){return t0(),_g()}function n0(e){const t=$d();for(const n in e)t[n]={...t[n],...e[n]};bd(t)}const r0=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 eo(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||r0.has(e)}let Gd=e=>!eo(e);function o0(e){typeof e=="function"&&(Gd=t=>t.startsWith("on")?!eo(t):e(t))}try{o0(require("@emotion/is-prop-valid").default)}catch{}function i0(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||Oe(e[o])||(Gd(o)||n===!0&&eo(o)||!t&&!eo(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const po=S.createContext({});function s0(e,t){if(ho(e)){const{initial:n,animate:r}=e;return{initial:n===!1||sr(n)?n:void 0,animate:sr(r)?r:void 0}}return e.inherit!==!1?t:{}}function a0(e){const{initial:t,animate:n}=s0(e,S.useContext(po));return S.useMemo(()=>({initial:t,animate:n}),[Fl(t),Fl(n)])}function Fl(e){return Array.isArray(e)?e.join(" "):e}const Ds=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Yd(e,t,n){for(const r in t)!Oe(t[r])&&!Td(r,n)&&(e[r]=t[r])}function l0({transformTemplate:e},t){return S.useMemo(()=>{const n=Ds();return As(n,t,e),Object.assign({},n.vars,n.style)},[t])}function c0(e,t){const n=e.style||{},r={};return Yd(r,n,e),Object.assign(r,l0(e,t)),r}function u0(e,t){const n={},r=c0(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 Kd=()=>({...Ds(),attrs:{}});function d0(e,t,n,r){const o=S.useMemo(()=>{const s=Kd();return Bd(s,t,Fd(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Yd(s,e.style,e),o.style={...s,...o.style}}return o}const f0=["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 Rs(e){return typeof e!="string"||e.includes("-")?!1:!!(f0.indexOf(e)>-1||/[A-Z]/u.test(e))}function h0(e,t,n,{latestValues:r},o,s=!1,a){const u=(a??Rs(e)?d0:u0)(t,r,o,e),c=i0(t,typeof e=="string",s),d=e!==S.Fragment?{...c,...u,ref:n}:{},{children:h}=t,p=S.useMemo(()=>Oe(h)?h.get():h,[h]);return S.createElement(e,{...d,children:p})}function p0({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:m0(n,r,o,e),renderState:t()}}function m0(e,t,n,r){const o={},s=r(e,{});for(const p in s)o[p]=Wr(s[p]);let{initial:a,animate:l}=e;const u=ho(e),c=xd(e);t&&c&&!u&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const h=d?l:a;if(h&&typeof h!="boolean"&&!fo(h)){const p=Array.isArray(h)?h:[h];for(let m=0;m<p.length;m++){const g=ws(e,p[m]);if(g){const{transitionEnd:x,transition:y,...v}=g;for(const j in v){let w=v[j];if(Array.isArray(w)){const F=d?w.length-1:0;w=w[F]}w!==null&&(o[j]=w)}for(const j in x)o[j]=x[j]}}}return o}const qd=e=>(t,n)=>{const r=S.useContext(po),o=S.useContext(co),s=()=>p0(e,t,r,o);return n?s():as(s)},g0=qd({scrapeMotionValuesFromProps:Ls,createRenderState:Ds}),x0=qd({scrapeMotionValuesFromProps:Ad,createRenderState:Kd}),y0=Symbol.for("motionComponentSymbol");function b0(e,t,n){const r=S.useRef(n);S.useInsertionEffect(()=>{r.current=n});const o=S.useRef(null);return S.useCallback(s=>{var l;s&&((l=e.onMount)==null||l.call(e,s));const a=r.current;if(typeof a=="function")if(s){const u=a(s);typeof u=="function"&&(o.current=u)}else o.current?(o.current(),o.current=null):a(s);else a&&(a.current=s);t&&(s?t.mount(s):t.unmount())},[t])}const Xd=S.createContext({});function yn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function v0(e,t,n,r,o,s){var w,F;const{visualElement:a}=S.useContext(po),l=S.useContext(Ud),u=S.useContext(co),c=S.useContext(Is),d=c.reducedMotion,h=c.skipAnimations,p=S.useRef(null),m=S.useRef(!1);r=r||l.renderer,!p.current&&r&&(p.current=r(e,{visualState:t,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d,skipAnimations:h,isSVG:s}),m.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const g=p.current,x=S.useContext(Xd);g&&!g.projection&&o&&(g.type==="html"||g.type==="svg")&&k0(p.current,n,o,x);const y=S.useRef(!1);S.useInsertionEffect(()=>{g&&y.current&&g.update(n,u)});const v=n[od],j=S.useRef(!!v&&typeof window<"u"&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,v))&&((F=window.MotionHasOptimisedAnimation)==null?void 0:F.call(window,v)));return gu(()=>{m.current=!0,g&&(y.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),j.current&&g.animationState&&g.animationState.animateChanges())}),S.useEffect(()=>{g&&(!j.current&&g.animationState&&g.animationState.animateChanges(),j.current&&(queueMicrotask(()=>{var B;(B=window.MotionHandoffMarkAsComplete)==null||B.call(window,v)}),j.current=!1),g.enteringChildren=void 0)}),g}function k0(e,t,n,r){const{layoutId:o,layout:s,drag:a,dragConstraints:l,layoutScroll:u,layoutRoot:c,layoutAnchor:d,layoutCrossfade:h}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Zd(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!a||l&&yn(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:u,layoutRoot:c,layoutAnchor:d})}function Zd(e){if(e)return e.options.allowProjection!==!1?e.projection:Zd(e.parent)}function _o(e,{forwardMotionProps:t=!1,type:n}={},r,o){r&&n0(r);const s=n?n==="svg":Rs(e),a=s?x0:g0;function l(c,d){let h;const p={...S.useContext(Is),...c,layoutId:w0(c)},{isStatic:m}=p,g=a0(c),x=a(c,m);if(!m&&typeof window<"u"){S0(p,r);const y=C0(p);h=y.MeasureLayout,g.visualElement=v0(e,x,p,o,y.ProjectionNode,s)}return i.jsxs(po.Provider,{value:g,children:[h&&g.visualElement?i.jsx(h,{visualElement:g.visualElement,...p}):null,h0(e,c,b0(x,g.visualElement,d),x,m,t,s)]})}l.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const u=S.forwardRef(l);return u[y0]=e,u}function w0({layoutId:e}){const t=S.useContext(ss).id;return t&&e!==void 0?t+"-"+e:e}function S0(e,t){const n=S.useContext(Ud).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?Fn(!1,r,"lazy-strict-mode"):Ft(!1,r,"lazy-strict-mode")}}function C0(e){const t=$d(),{drag:n,layout:r}=t;if(!n&&!r)return{};const o={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function j0(e,t){if(typeof Proxy>"u")return _o;const n=new Map,r=(s,a)=>_o(s,a,e,t),o=(s,a)=>(process.env.NODE_ENV!=="production"&&us(!1,"motion() is deprecated. Use motion.create() instead."),r(s,a));return new Proxy(o,{get:(s,a)=>a==="create"?r:(n.has(a)||n.set(a,_o(a,void 0,e,t)),n.get(a))})}const T0=(e,t)=>t.isSVG??Rs(e)?new nx(t):new Xg(t,{allowProjection:e!==S.Fragment});class B0 extends Nt{constructor(t){super(t),t.animationState||(t.animationState=ax(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();fo(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 E0=0;class F0 extends Nt{constructor(){super(...arguments),this.id=E0++,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 u=Qt(this.node,a,l);if(u){const{transition:c,transitionEnd:d,...h}=u;for(const p in h)(s=this.node.getValue(p))==null||s.jump(h[p])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.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 A0={animation:{Feature:B0},exit:{Feature:F0}};function pr(e){return{point:{x:e.pageX,y:e.pageY}}}const L0=e=>t=>Ts(t)&&e(t,pr(t));function er(e,t,n,r){return ar(e,t,L0(n),r)}const Jd=({current:e})=>e?e.ownerDocument.defaultView:null,Al=(e,t)=>Math.abs(e-t);function I0(e,t){const n=Al(e.x,t.x),r=Al(e.y,t.y);return Math.sqrt(n**2+r**2)}const Ll=new Set(["auto","scroll"]);class Qd{constructor(t,n,{transformPagePoint:r,contextWindow:o=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=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Br(this.lastRawMoveEventInfo,this.transformPagePoint));const m=No(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,x=I0(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!x)return;const{point:y}=m,{timestamp:v}=Pe;this.history.push({...y,timestamp:v});const{onStart:j,onMove:w}=this.handlers;g||(j&&j(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,m)},this.handlePointerMove=(m,g)=>{this.lastMoveEvent=m,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=Br(g,this.transformPagePoint),ge.update(this.updatePoint,!0)},this.handlePointerUp=(m,g)=>{this.end();const{onEnd:x,onSessionEnd:y,resumeAnimation:v}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const j=No(m.type==="pointercancel"?this.lastMoveEventInfo:Br(g,this.transformPagePoint),this.history);this.startEvent&&x&&x(m,j),y&&y(m,j)},!Ts(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=o||window;const u=pr(t),c=Br(u,this.transformPagePoint),{point:d}=c,{timestamp:h}=Pe;this.history=[{...d,timestamp:h}];const{onSessionStart:p}=n;p&&p(t,No(c,this.history)),this.removeListeners=dr(er(this.contextWindow,"pointermove",this.handlePointerMove),er(this.contextWindow,"pointerup",this.handlePointerUp),er(this.contextWindow,"pointercancel",this.handlePointerUp)),l&&this.startScrollTracking(l)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(Ll.has(r.overflowX)||Ll.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,o=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:o.x-n.x,y:o.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,o),ge.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),_t(this.updatePoint)}}function Br(e,t){return t?{point:t(e.point)}:e}function Il(e,t){return{x:e.x-t.x,y:e.y-t.y}}function No({point:e},t){return{point:e,delta:Il(e,ef(t)),offset:Il(e,D0(t)),velocity:R0(t,.1)}}function D0(e){return e[0]}function ef(e){return e[e.length-1]}function R0(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=ef(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Ke(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&o.timestamp-r.timestamp>Ke(t)*2&&(r=e[1]);const s=it(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const a={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function M0(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ye(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ye(n,e,r.max):Math.min(e,n)),e}function Dl(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 P0(e,{top:t,left:n,bottom:r,right:o}){return{x:Dl(e.x,n,o),y:Dl(e.y,t,r)}}function Rl(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 O0(e,t){return{x:Rl(e.x,t.x),y:Rl(e.y,t.y)}}function z0(e,t){let n=.5;const r=He(e),o=He(t);return o>r?n=or(t.min,t.max-r,e.min):r>o&&(n=or(e.min,e.max-o,t.min)),jt(0,1,n)}function _0(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 Ii=.35;function N0(e=Ii){return e===!1?e=0:e===!0&&(e=Ii),{x:Ml(e,"left","right"),y:Ml(e,"top","bottom")}}function Ml(e,t,n){return{min:Pl(e,t),max:Pl(e,n)}}function Pl(e,t){return typeof e=="number"?e:e[t]||0}const V0=new WeakMap;class W0{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=Fe(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=h=>{n&&this.snapToCursor(pr(h).point),this.stopAnimation()},a=(h,p)=>{const{drag:m,dragPropagation:g,onDragStart:x}=this.getProps();if(m&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=mg(m),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=p,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),yt(v=>{let j=this.getAxisMotionValue(v).get()||0;if(St.test(j)){const{projection:w}=this.visualElement;if(w&&w.layout){const F=w.layout.layoutBox[v];F&&(j=He(F)*(parseFloat(j)/100))}}this.originPoint[v]=j}),x&&ge.update(()=>x(h,p),!1,!0),Si(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},l=(h,p)=>{this.latestPointerEvent=h,this.latestPanInfo=p;const{dragPropagation:m,dragDirectionLock:g,onDirectionLock:x,onDrag:y}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:v}=p;if(g&&this.currentDirection===null){this.currentDirection=U0(v),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",p.point,v),this.updateAxis("y",p.point,v),this.visualElement.render(),y&&ge.update(()=>y(h,p),!1,!0)},u=(h,p)=>{this.latestPointerEvent=h,this.latestPanInfo=p,this.stop(h,p),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new Qd(t,{onSessionStart:s,onStart:a,onMove:l,onSessionEnd:u,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:Jd(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!r)return;const{velocity:a}=o;this.startAnimation(a);const{onDragEnd:l}=this.getProps();l&&ge.postRender(()=>l(r,o))}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:o}=this.getProps();if(!r||!Er(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=M0(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,o=this.constraints;t&&yn(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=P0(r.layoutBox,t):this.constraints=!1,this.elastic=N0(n),o!==this.constraints&&!yn(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&yt(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=_0(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!yn(t))return!1;const r=t.current;Ft(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:o}=this.visualElement;if(!o||!o.layout)return!1;const s=Ug(r,o.root,this.visualElement.getTransformPagePoint());let a=O0(o.layout.layoutBox,s);if(n){const l=n(Vg(a));this.hasMutatedConstraints=!!l,l&&(a=kd(l))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),u=this.constraints||{},c=yt(d=>{if(!Er(d,n,this.currentDirection))return;let h=u&&u[d]||{};(a===!0||a===d)&&(h={min:0,max:0});const p=o?200:1e6,m=o?40:1e7,g={type:"inertia",velocity:r?t[d]:0,bounceStiffness:p,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...h};return this.startAxisValueAnimation(d,g)});return Promise.all(c).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Si(this.visualElement,t),r.start(ks(t,r,0,n,this.visualElement,!1))}stopAnimation(){yt(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){yt(n=>{const{drag:r}=this.getProps();if(!Er(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:a,max:l}=o.layout.layoutBox[n],u=s.get()||0;s.set(t[n]-ye(a,l,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!yn(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};yt(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const u=l.get();o[a]=z0({min:u,max:u},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(),yt(a=>{if(!Er(a,t,null))return;const l=this.getAxisMotionValue(a),{min:u,max:c}=this.constraints[a];l.set(ye(u,c,o[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;V0.set(this.visualElement,this);const t=this.visualElement.current,n=er(t,"pointerdown",c=>{const{drag:d,dragListener:h=!0}=this.getProps(),p=c.target,m=p!==t&&kg(p);d&&h&&!m&&this.start(c)});let r;const o=()=>{const{dragConstraints:c}=this.getProps();yn(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=H0(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,a=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ge.read(o);const l=ar(window,"resize",()=>this.scalePositionWithinConstraints()),u=s.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:d})=>{this.isDragging&&d&&(yt(h=>{const p=this.getAxisMotionValue(h);p&&(this.originPoint[h]+=c[h].translate,p.set(p.get()+c[h].translate))}),this.visualElement.render())}));return()=>{l(),n(),a(),u&&u(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:a=Ii,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:a,dragMomentum:l}}}function Ol(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function H0(e,t,n){const r=Ua(e,Ol(n)),o=Ua(t,Ol(n));return()=>{r(),o()}}function Er(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function U0(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class $0 extends Nt{constructor(t){super(t),this.removeGroupControls=st,this.removeListeners=st,this.controls=new W0(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||st}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 Vo=e=>(t,n)=>{e&&ge.update(()=>e(t,n),!1,!0)};class G0 extends Nt{constructor(){super(...arguments),this.removePointerDownListener=st}onPointerDown(t){this.session=new Qd(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Jd(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Vo(t),onStart:Vo(n),onMove:Vo(r),onEnd:(s,a)=>{delete this.session,o&&ge.postRender(()=>o(s,a))}}}mount(){this.removePointerDownListener=er(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 Wo=!1;class Y0 extends S.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),Wo&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Hr.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:a}=r;return a&&(a.isPresent=s,t.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),Wo=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?a.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?a.promote():a.relegate()||ge.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(),js.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;Wo=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function tf(e){const[t,n]=Hd(),r=S.useContext(ss);return i.jsx(Y0,{...e,layoutGroup:r,switchLayoutGroup:S.useContext(Xd),isPresent:t,safeToRemove:n})}const K0={pan:{Feature:G0},drag:{Feature:$0,ProjectionNode:Wd,MeasureLayout:tf}};function zl(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&ge.postRender(()=>s(t,pr(t)))}class q0 extends Nt{mount(){const{current:t}=this.node;t&&(this.unmount=xg(t,(n,r)=>(zl(this.node,r,"Start"),o=>zl(this.node,o,"End"))))}unmount(){}}class X0 extends Nt{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=dr(ar(this.node.current,"focus",()=>this.onFocus()),ar(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function _l(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 o="onTap"+(n==="End"?"":n),s=r[o];s&&ge.postRender(()=>s(t,pr(t)))}class Z0 extends Nt{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=Sg(t,(o,s)=>(_l(this.node,s,"Start"),(a,{success:l})=>_l(this.node,a,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Di=new WeakMap,Ho=new WeakMap,J0=e=>{const t=Di.get(e.target);t&&t(e)},Q0=e=>{e.forEach(J0)};function ey({root:e,...t}){const n=e||document;Ho.has(n)||Ho.set(n,{});const r=Ho.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Q0,{root:e,...t})),r[o]}function ty(e,t,n){const r=ey(t);return Di.set(e,n),r.observe(e),()=>{Di.delete(e),r.unobserve(e)}}const ny={some:0,all:1};class ry extends Nt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var u;(u=this.stopObserver)==null||u.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:ny[o]},l=c=>{const{isIntersecting:d}=c;if(this.isInView===d||(this.isInView=d,s&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:h,onViewportLeave:p}=this.node.getProps(),m=d?h:p;m&&m(c)};this.stopObserver=ty(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(oy(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function oy({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const iy={inView:{Feature:ry},tap:{Feature:Z0},focus:{Feature:X0},hover:{Feature:q0}},sy={layout:{ProjectionNode:Wd,MeasureLayout:tf}},ay={...A0,...iy,...K0,...sy},tt=j0(ay,T0);function Ct({label:e,children:t,placement:n="top",...r}){const[o,s]=S.useState(!1),a=S.useRef(null),l=S.useMemo(()=>typeof window>"u"?!1:window.matchMedia("(pointer: coarse)").matches,[]);S.useEffect(()=>{if(!l||!o)return;const c=d=>{a.current&&!a.current.contains(d.target)&&s(!1)};return document.addEventListener("mousedown",c),document.addEventListener("touchstart",c,{passive:!0}),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("touchstart",c)}},[l,o]);const u=c=>{l&&(c.preventDefault(),c.stopPropagation(),s(d=>!d))};return i.jsxs(f.Tooltip.Root,{positioning:{placement:n},open:l?o:void 0,onOpenChange:l?c=>s(c.open):void 0,...r,children:[i.jsx(f.Tooltip.Trigger,{asChild:!0,children:i.jsx("span",{ref:a,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:u,children:t})}),i.jsx(f.Tooltip.Positioner,{children:i.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 ly={BASE_URL:"/",DEV:!1,MODE:"production",PACKAGE_VERSION:"0.1.23",PROD:!0,SSR:!1,VITE_STORYBOOK_URL:"https://medixdeck-ui.vercel.app",VITE_WHATSAPP_COMMUNITY_LINK:"https://medixdeck.com/whatsapp"},cy={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"}},kt="#EF4444",Ri="rgba(239,68,68,0.08)",nf=()=>i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),i.jsx("path",{d:"M9 3v18"}),i.jsx("path",{d:"m14 9-3 3 3 3"})]}),rf=()=>i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),i.jsx("path",{d:"M9 3v18"}),i.jsx("path",{d:"m12 15 3-3-3-3"})]}),uy=()=>i.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),i.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),i.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]}),dy=()=>i.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),i.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),of=({open:e})=>i.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:i.jsx("polyline",{points:"6 9 12 15 18 9"})}),Mi=()=>i.jsxs("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4"}),i.jsx("polyline",{points:"16 17 21 12 16 7"}),i.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}),fy=()=>i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),i.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),hy=()=>i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("circle",{cx:"12",cy:"12",r:"3"}),i.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"})]}),py=()=>i.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("circle",{cx:"12",cy:"12",r:"4"}),i.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"4"}),i.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"22"}),i.jsx("line",{x1:"4.93",y1:"4.93",x2:"6.34",y2:"6.34"}),i.jsx("line",{x1:"17.66",y1:"17.66",x2:"19.07",y2:"19.07"}),i.jsx("line",{x1:"2",y1:"12",x2:"4",y2:"12"}),i.jsx("line",{x1:"20",y1:"12",x2:"22",y2:"12"}),i.jsx("line",{x1:"4.93",y1:"19.07",x2:"6.34",y2:"17.66"}),i.jsx("line",{x1:"17.66",y1:"6.34",x2:"19.07",y2:"4.93"})]}),my=()=>i.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),gy=()=>i.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("rect",{x:"3",y:"4",width:"18",height:"12",rx:"2"}),i.jsx("line",{x1:"8",y1:"20",x2:"16",y2:"20"}),i.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"20"})]}),xy=()=>i.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.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"}),i.jsx("line",{x1:"8.5",y1:"2",x2:"15.5",y2:"2"}),i.jsx("path",{d:"M8.5 14h7"})]}),yy=()=>i.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),i.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),i.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),by=()=>i.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.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"}),i.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),i.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),vy=()=>i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),i.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),ky=(e,t)=>i.jsx("a",{href:e.href,style:{textDecoration:"none",display:"block"},children:t});function wy(){const e=new Date().getHours();return e<12?"Good morning":e<17?"Good afternoon":"Good evening"}const Nl={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 Sy(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,o=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(o==="deploy-preview"||o==="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:dn&&dn.tagName.toUpperCase()==="SCRIPT"&&dn.src||new URL("index.cjs",document.baseURI).href}<"u"&&{url:typeof document>"u"?require("url").pathToFileURL(__filename).href:dn&&dn.tagName.toUpperCase()==="SCRIPT"&&dn.src||new URL("index.cjs",document.baseURI).href}&&ly){const t="production"}}catch{}if(typeof window<"u"&&window.location&&window.location.hostname){const t=window.location.hostname.toLowerCase();if(t==="localhost"||t==="127.0.0.1"||t==="[::1]"||t==="0.0.0.0"||t.endsWith(".local")||t.endsWith(".test")||t.endsWith(".internal")||t.includes(".ngrok")||t.includes(".loca.lt"))return{isNonProduction:!0,detectedEnv:"development"};if(t.endsWith(".vercel.app")||t.endsWith(".netlify.app")||t.endsWith(".pages.dev")||t.endsWith(".amplifyapp.com")||t.endsWith(".onrender.com")||t.endsWith(".fly.dev")||t.endsWith(".azurestaticapps.net"))return{isNonProduction:!0,detectedEnv:"preview"};if(t.startsWith("sandbox.")||t.includes("-sandbox."))return{isNonProduction:!0,detectedEnv:"sandbox"};if(t.startsWith("staging.")||t.startsWith("stage.")||t.includes("-staging."))return{isNonProduction:!0,detectedEnv:"staging"};if(t.startsWith("test.")||t.startsWith("qa.")||t.includes("-test."))return{isNonProduction:!0,detectedEnv:"test"};if(t.startsWith("dev.")||t.includes("-dev."))return{isNonProduction:!0,detectedEnv:"development"}}return{isNonProduction:!1,detectedEnv:"production"}}function Cy(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 jy({detectedEnv:e,config:t,onDismiss:n}){const r=t.status??(e==="staging"||e==="preview"?"info":e==="test"?"error":"warning"),o=Nl[r]??Nl.warning,s=t.badgeLabel??Cy(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"?i.jsx(yy,{}):r==="error"?i.jsx(by,{}):i.jsx(xy,{});return i.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:o.border,bg:o.bg,color:o.text,_dark:{bg:o.darkBg,borderColor:o.darkBorder,color:o.darkText},transition:"background 0.2s ease, border-color 0.2s ease",children:[i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2.5",minW:"0",flex:"1",children:[i.jsx(f.Box,{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:o.badgeBg,children:l}),i.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:o.badgeBg,color:o.badgeColor},children:s}),i.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})]}),i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2.5",flexShrink:0,children:[t.action,t.dismissible&&i.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:o.badgeBg,outlineOffset:"1px"},transition:"background 0.15s ease, opacity 0.15s ease",children:i.jsx(vy,{})})]})]})}const Fr=[{value:"light",label:"Light mode",shortLabel:"Light",icon:i.jsx(py,{})},{value:"dark",label:"Dark mode",shortLabel:"Dark",icon:i.jsx(my,{})},{value:"system",label:"System theme",shortLabel:"System",icon:i.jsx(gy,{})}];function Ty({scheme:e}){const{mounted:t,themeMode:n,themeSetting:r,setThemeMode:o}=ur(),[s,a]=S.useState(!1),l=S.useRef(null),u=t?r:void 0,c=Fr.find(p=>p.value===u)||Fr[0];S.useEffect(()=>{const p=m=>{l.current&&!l.current.contains(m.target)&&a(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]);const d=i.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:Fr.map(p=>{const m=u===p.value,g=p.value==="dark"?e.activeBgDarkStrong:p.value==="system"?e.hoverBgDark:e.hoverBgLight;return i.jsxs(f.Box,{as:"button",onClick:()=>{t&&o(p.value)},"aria-pressed":m,"aria-label":p.label,title:t&&p.value==="system"?`System theme (currently ${n})`:p.label,display:"inline-flex",alignItems:"center",gap:"2",h:"9",px:"3",borderRadius:"full",border:"none",bg:m?g:"transparent",color:m?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:m?g:"bg",color:"text.heading"}:void 0,_focusVisible:{outline:"2px solid",outlineColor:e.chakraToken,outlineOffset:"2px"},children:[i.jsx(f.Box,{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,children:p.icon}),i.jsx(f.Box,{as:"span",fontSize:"xs",fontWeight:m?"700":"600",fontFamily:"var(--font-body)",whiteSpace:"nowrap",children:p.shortLabel})]},p.value)})}),h=i.jsxs(f.Box,{display:{base:"block",md:"none"},position:"relative",ref:l,children:[i.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(p=>!p)},"aria-label":"Theme mode switcher","aria-expanded":s,"aria-haspopup":"menu",children:c.icon}),s&&t&&i.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:Fr.map(p=>{const m=u===p.value;return i.jsxs(f.Box,{as:"button",role:"menuitem",display:"flex",alignItems:"center",gap:"2.5",w:"full",px:"4",py:"2.5",border:"none",bg:m?e.hoverBgLight:"transparent",color:m?e.chakraToken:"text.body",cursor:"pointer",textAlign:"left",onClick:()=>{o(p.value),a(!1)},_hover:{bg:e.hoverBgLight,color:e.chakraToken},_dark:{bg:m?e.hoverBgDark:"transparent",_hover:{bg:e.hoverBgDark}},children:[i.jsx(f.Box,{flexShrink:0,children:p.icon}),i.jsx(f.Box,{as:"span",fontSize:"sm",fontWeight:m?"600":"500",fontFamily:"var(--font-body)",children:p.label})]},p.value)})})]});return i.jsxs(i.Fragment,{children:[d,h]})}function Pi({item:e,renderLink:t,onClick:n,scheme:r,isCollapsed:o=!1}){var F;const[s,a]=S.useState(!1),[l,u]=S.useState(!1),[c,d]=S.useState(!1),h=S.useRef(null),p=e.isActive??!1,m=((F=e.subItems)==null?void 0:F.some(B=>B.isActive))??!1,[g,x]=S.useState(p||m),y=!!(e.subItems&&e.subItems.length>0),v=S.useId();S.useEffect(()=>{x(p||m)},[p,m]),S.useEffect(()=>{if(!c)return;const B=P=>{h.current&&!h.current.contains(P.target)&&d(!1)},C=P=>{P.key==="Escape"&&d(!1)};return document.addEventListener("mousedown",B),document.addEventListener("keydown",C),()=>{document.removeEventListener("mousedown",B),document.removeEventListener("keydown",C)}},[c]);const j=p;if(o){if(y){const C=i.jsxs(f.Box,{as:"button","aria-label":e.label,"aria-haspopup":"menu","aria-expanded":c,onClick:()=>d(P=>!P),onFocus:P=>u(P.currentTarget.matches(":focus-visible")),onBlur:()=>u(!1),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),display:"flex",alignItems:"center",justifyContent:"center",w:"10",h:"10",mx:"auto",borderRadius:"lg",border:"none",cursor:"pointer",position:"relative",style:{background:p||m?r.activeBgLight:s||c?r.hoverBgLight:"transparent",outline:l?`2px solid ${r.solid}`:void 0,outlineOffset:l?"2px":void 0,transition:"background 0.15s ease"},_dark:{bg:p||m?r.activeBgDark:s||c?r.hoverBgDark:"transparent"},children:[e.icon&&i.jsx(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",style:{color:p||m?r.solid:void 0,opacity:p||m?1:s||c?.85:.6},color:p||m?r.chakraToken:"text.body",children:e.icon}),m&&i.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 i.jsxs(f.Box,{position:"relative",ref:h,my:"0.5",display:"flex",justifyContent:"center",style:{zIndex:c?100:1},children:[c?C:i.jsx(Ct,{label:e.label,placement:"right",children:C}),c&&i.jsx(tt.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:i.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:[i.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&&i.jsx(f.Box,{display:"inline-flex",alignItems:"center",justifyContent:"center",color:r.chakraToken,children:e.icon}),i.jsx(f.Box,{as:"span",children:e.label})]}),i.jsx(f.Box,{display:"flex",flexDirection:"column",gap:"0.5",px:"1",children:e.subItems.map(P=>i.jsx(Pi,{item:P,renderLink:t,onClick:()=>{d(!1),n==null||n()},scheme:r,isCollapsed:!1},P.href))})]})})]})}const B=i.jsx(f.Box,{display:"flex",justifyContent:"center",alignItems:"center",w:"full",children:i.jsx(Ct,{label:e.label,placement:"right",children:i.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:()=>a(!0),onMouseLeave:()=>a(!1),onClick:n,style:{background:p?r.activeBgLight:s?r.hoverBgLight:"transparent",outline:l?`2px solid ${r.solid}`:void 0,outlineOffset:l?"2px":void 0,transition:"background 0.15s ease"},_dark:{bg:p?r.activeBgDark:s?r.hoverBgDark:"transparent"},children:[e.icon&&i.jsx(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",style:{color:j?r.solid:void 0,opacity:j?1:s?.85:.6},color:j?r.chakraToken:"text.body",children:e.icon}),typeof e.badge=="number"&&i.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&&i.jsx(f.Box,{as:"span",position:"absolute",top:"2px",right:"2px",w:"6px",h:"6px",borderRadius:"full",style:{background:kt},"aria-label":"New notification"})]})})});return t(e,B)}const w=i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"3",px:"3",py:"2.5",borderRadius:"lg",borderLeftRadius:y?"lg":"none",borderTopLeftRadius:y?"lg":"none",borderBottomLeftRadius:y?"lg":"none",position:"relative",onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onClick:y?void 0:n,style:{background:p?r.activeBgLight:s?r.hoverBgLight:"transparent",boxShadow:p&&!y?`inset 3px 0 0 ${r.solid}`:void 0,outline:l?`2px solid ${r.solid}`:void 0,outlineOffset:l?"2px":void 0,transition:"background 0.15s ease, box-shadow 0.15s ease"},_dark:{bg:p?r.activeBgDark:s?r.hoverBgDark:"transparent"},children:[e.icon&&i.jsx(f.Box,{flexShrink:0,style:{color:j?r.solid:void 0,opacity:j?1:s?.85:.6,transition:"color 0.15s ease, opacity 0.15s ease"},color:j?r.chakraToken:"text.body",children:e.icon}),i.jsx(f.Box,{as:"span",flex:"1",fontSize:"sm",fontWeight:j?"600":"500",fontFamily:"var(--font-body)",style:{color:j?r.solid:void 0,transition:"color 0.15s ease"},color:j?r.chakraToken:"text.body",children:e.label}),typeof e.badge=="number"&&!y&&i.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&&i.jsx(f.Box,{as:"span",display:"inline-block",w:"7px",h:"7px",borderRadius:"full",flexShrink:0,style:{background:kt},"aria-label":"New notification"}),y&&i.jsx(f.Box,{flexShrink:0,color:"text.muted",children:i.jsx(of,{open:g})})]});return i.jsxs(i.Fragment,{children:[y?i.jsx("button",{type:"button","aria-expanded":g,"aria-controls":v,onClick:()=>x(B=>!B),onFocus:B=>{u(B.currentTarget.matches(":focus-visible"))},onBlur:()=>u(!1),style:{display:"block",width:"100%",background:"none",border:"none",padding:0,cursor:"pointer",textAlign:"left"},children:w}):t(e,w),y&&i.jsx(tt.div,{id:v,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:i.jsx(f.Box,{display:"flex",flexDirection:"column",gap:"0.5",pl:"9",mt:"0.5",mb:"1",children:e.subItems.map(B=>i.jsx(Pi,{item:B,renderLink:t,onClick:n,scheme:r,isCollapsed:!1},B.href))})})]})}let Vl=!1;function By(){if(typeof document>"u"||Vl)return;const e=document.createElement("style");e.setAttribute("data-medixdeck","mobile-nav"),e.textContent=`
|
|
351
|
+
`),()=>{var O;(O=l.current)==null||O.removeAttribute("data-motion-pop-id"),C.contains(B)&&C.removeChild(B)}},[t]),o.jsx(a0,{isPresent:t,childRef:l,sizeRef:d,pop:s,children:s===!1?e:je.cloneElement(e,{ref:h})})}const c0=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a,anchorX:l,anchorY:d,root:c})=>{const u=ds(u0),h=k.useId();let m=!0,p=k.useMemo(()=>(m=!1,{id:h,initial:t,isPresent:n,custom:i,onExitComplete:x=>{u.set(x,!0);for(const g of u.values())if(!g)return;r&&r()},register:x=>(u.set(x,!1),()=>u.delete(x))}),[n,u,r]);return s&&m&&(p={...p}),k.useMemo(()=>{u.forEach((x,g)=>u.set(g,!1))},[n]),je.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=o.jsx(l0,{pop:a==="popLayout",isPresent:n,anchorX:l,anchorY:d,root:c,children:e}),o.jsx(di.Provider,{value:p,children:e})};function u0(){return new Map}function Qd(e=!0){const t=k.useContext(di);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=k.useId();k.useEffect(()=>{if(e)return i(s)},[e]);const a=k.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,a]:[!0]}const Er=e=>e.key||"";function Al(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const dr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:a=!1,anchorX:l="left",anchorY:d="top",root:c})=>{const[u,h]=Qd(a),m=k.useMemo(()=>Al(e),[e]),p=a&&!u?[]:m.map(Er),x=k.useRef(!0),g=k.useRef(m),v=ds(()=>new Map),y=k.useRef(new Set),[j,w]=k.useState(m),[A,B]=k.useState(m);Tu(()=>{x.current=!1,g.current=m;for(let E=0;E<A.length;E++){const F=Er(A[E]);p.includes(F)?(v.delete(F),y.current.delete(F)):v.get(F)!==!0&&v.set(F,!1)}},[A,p.length,p.join("-")]);const C=[];if(m!==j){let E=[...m];for(let F=0;F<A.length;F++){const L=A[F],R=Er(L);p.includes(R)||(E.splice(F,0,L),C.push(L))}return s==="wait"&&C.length&&(E=C),B(Al(E)),w(m),null}process.env.NODE_ENV!=="production"&&s==="wait"&&A.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:O}=k.useContext(us);return o.jsx(o.Fragment,{children:A.map(E=>{const F=Er(E),L=a&&!u?!1:m===A||p.includes(F),R=()=>{if(y.current.has(F))return;if(v.has(F))y.current.add(F),v.set(F,!0);else return;let D=!0;v.forEach(N=>{N||(D=!1)}),D&&(O==null||O(),B(g.current),a&&(h==null||h()),r&&r())};return o.jsx(c0,{isPresent:L,initial:!x.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,root:c,onExitComplete:L?void 0:R,anchorX:l,anchorY:d,children:E},F)})})},ef=k.createContext({strict:!1}),Ll={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Il=!1;function d0(){if(Il)return;const e={};for(const t in Ll)e[t]={isEnabled:n=>Ll[t].some(r=>!!n[r])};Fd(e),Il=!0}function tf(){return d0(),qx()}function f0(e){const t=tf();for(const n in e)t[n]={...t[n],...e[n]};Fd(t)}const h0=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function ni(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||h0.has(e)}let nf=e=>!ni(e);function p0(e){typeof e=="function"&&(nf=t=>t.startsWith("on")?!ni(t):e(t))}try{p0(require("@emotion/is-prop-valid").default)}catch{}function m0(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||Ue(e[i])||(nf(i)||n===!0&&ni(i)||!t&&!ni(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const mi=k.createContext({});function x0(e,t){if(pi(e)){const{initial:n,animate:r}=e;return{initial:n===!1||cr(n)?n:void 0,animate:cr(r)?r:void 0}}return e.inherit!==!1?t:{}}function g0(e){const{initial:t,animate:n}=x0(e,k.useContext(mi));return k.useMemo(()=>({initial:t,animate:n}),[Dl(t),Dl(n)])}function Dl(e){return Array.isArray(e)?e.join(" "):e}const Os=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function rf(e,t,n){for(const r in t)!Ue(t[r])&&!Pd(r,n)&&(e[r]=t[r])}function y0({transformTemplate:e},t){return k.useMemo(()=>{const n=Os();return Rs(n,t,e),Object.assign({},n.vars,n.style)},[t])}function b0(e,t){const n=e.style||{},r={};return rf(r,n,e),Object.assign(r,y0(e,t)),r}function v0(e,t){const n={},r=b0(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const of=()=>({...Os(),attrs:{}});function k0(e,t,n,r){const i=k.useMemo(()=>{const s=of();return Od(s,t,_d(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};rf(s,e.style,e),i.style={...s,...i.style}}return i}const w0=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function zs(e){return typeof e!="string"||e.includes("-")?!1:!!(w0.indexOf(e)>-1||/[A-Z]/u.test(e))}function S0(e,t,n,{latestValues:r},i,s=!1,a){const d=(a??zs(e)?k0:v0)(t,r,i,e),c=m0(t,typeof e=="string",s),u=e!==k.Fragment?{...c,...d,ref:n}:{},{children:h}=t,m=k.useMemo(()=>Ue(h)?h.get():h,[h]);return k.createElement(e,{...u,children:m})}function C0({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:j0(n,r,i,e),renderState:t()}}function j0(e,t,n,r){const i={},s=r(e,{});for(const m in s)i[m]=Ur(s[m]);let{initial:a,animate:l}=e;const d=pi(e),c=Bd(e);t&&c&&!d&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let u=n?n.initial===!1:!1;u=u||a===!1;const h=u?l:a;if(h&&typeof h!="boolean"&&!hi(h)){const m=Array.isArray(h)?h:[h];for(let p=0;p<m.length;p++){const x=Ts(e,m[p]);if(x){const{transitionEnd:g,transition:v,...y}=x;for(const j in y){let w=y[j];if(Array.isArray(w)){const A=u?w.length-1:0;w=w[A]}w!==null&&(i[j]=w)}for(const j in g)i[j]=g[j]}}}return i}const sf=e=>(t,n)=>{const r=k.useContext(mi),i=k.useContext(di),s=()=>C0(e,t,r,i);return n?s():ds(s)},T0=sf({scrapeMotionValuesFromProps:Ms,createRenderState:Os}),B0=sf({scrapeMotionValuesFromProps:Nd,createRenderState:of}),E0=Symbol.for("motionComponentSymbol");function F0(e,t,n){const r=k.useRef(n);k.useInsertionEffect(()=>{r.current=n});const i=k.useRef(null);return k.useCallback(s=>{var l;s&&((l=e.onMount)==null||l.call(e,s));const a=r.current;if(typeof a=="function")if(s){const d=a(s);typeof d=="function"&&(i.current=d)}else i.current?(i.current(),i.current=null):a(s);else a&&(a.current=s);t&&(s?t.mount(s):t.unmount())},[t])}const af=k.createContext({});function Tn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function A0(e,t,n,r,i,s){var w,A;const{visualElement:a}=k.useContext(mi),l=k.useContext(ef),d=k.useContext(di),c=k.useContext(Ps),u=c.reducedMotion,h=c.skipAnimations,m=k.useRef(null),p=k.useRef(!1);r=r||l.renderer,!m.current&&r&&(m.current=r(e,{visualState:t,parent:a,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:u,skipAnimations:h,isSVG:s}),p.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const x=m.current,g=k.useContext(af);x&&!x.projection&&i&&(x.type==="html"||x.type==="svg")&&L0(m.current,n,i,g);const v=k.useRef(!1);k.useInsertionEffect(()=>{x&&v.current&&x.update(n,d)});const y=n[pd],j=k.useRef(!!y&&typeof window<"u"&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,y))&&((A=window.MotionHasOptimisedAnimation)==null?void 0:A.call(window,y)));return Tu(()=>{p.current=!0,x&&(v.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),j.current&&x.animationState&&x.animationState.animateChanges())}),k.useEffect(()=>{x&&(!j.current&&x.animationState&&x.animationState.animateChanges(),j.current&&(queueMicrotask(()=>{var B;(B=window.MotionHandoffMarkAsComplete)==null||B.call(window,y)}),j.current=!1),x.enteringChildren=void 0)}),x}function L0(e,t,n,r){const{layoutId:i,layout:s,drag:a,dragConstraints:l,layoutScroll:d,layoutRoot:c,layoutAnchor:u,layoutCrossfade:h}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:lf(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!a||l&&Tn(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:d,layoutRoot:c,layoutAnchor:u})}function lf(e){if(e)return e.options.allowProjection!==!1?e.projection:lf(e.parent)}function Ni(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&f0(r);const s=n?n==="svg":zs(e),a=s?B0:T0;function l(c,u){let h;const m={...k.useContext(Ps),...c,layoutId:I0(c)},{isStatic:p}=m,x=g0(c),g=a(c,p);if(!p&&typeof window<"u"){D0(m,r);const v=R0(m);h=v.MeasureLayout,x.visualElement=A0(e,g,m,i,v.ProjectionNode,s)}return o.jsxs(mi.Provider,{value:x,children:[h&&x.visualElement?o.jsx(h,{visualElement:x.visualElement,...m}):null,S0(e,c,F0(g,x.visualElement,u),g,p,t,s)]})}l.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const d=k.forwardRef(l);return d[E0]=e,d}function I0({layoutId:e}){const t=k.useContext(us).id;return t&&e!==void 0?t+"-"+e:e}function D0(e,t){const n=k.useContext(ef).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?On(!1,r,"lazy-strict-mode"):Pt(!1,r,"lazy-strict-mode")}}function R0(e){const t=tf(),{drag:n,layout:r}=t;if(!n&&!r)return{};const i={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function M0(e,t){if(typeof Proxy>"u")return Ni;const n=new Map,r=(s,a)=>Ni(s,a,e,t),i=(s,a)=>(process.env.NODE_ENV!=="production"&&ps(!1,"motion() is deprecated. Use motion.create() instead."),r(s,a));return new Proxy(i,{get:(s,a)=>a==="create"?r:(n.has(a)||n.set(a,Ni(a,void 0,e,t)),n.get(a))})}const P0=(e,t)=>t.isSVG??zs(e)?new fg(t):new sg(t,{allowProjection:e!==k.Fragment});class O0 extends Yt{constructor(t){super(t),t.animationState||(t.animationState=gg(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();hi(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let z0=0;class _0 extends Yt{constructor(){super(...arguments),this.id=z0++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:a,custom:l}=this.node.getProps();if(typeof a=="string"){const d=an(this.node,a,l);if(d){const{transition:c,transitionEnd:u,...h}=d;for(const m in h)(s=this.node.getValue(m))==null||s.jump(h[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const N0={animation:{Feature:O0},exit:{Feature:_0}};function gr(e){return{point:{x:e.pageX,y:e.pageY}}}const V0=e=>t=>As(t)&&e(t,gr(t));function rr(e,t,n,r){return ur(e,t,V0(n),r)}const cf=({current:e})=>e?e.ownerDocument.defaultView:null,Rl=(e,t)=>Math.abs(e-t);function W0(e,t){const n=Rl(e.x,t.x),r=Rl(e.y,t.y);return Math.sqrt(n**2+r**2)}const Ml=new Set(["auto","scroll"]);class uf{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:a=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Fr(this.lastRawMoveEventInfo,this.transformPagePoint));const p=Vi(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,g=W0(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!g)return;const{point:v}=p,{timestamp:y}=He;this.history.push({...v,timestamp:y});const{onStart:j,onMove:w}=this.handlers;x||(j&&j(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,p)},this.handlePointerMove=(p,x)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=Fr(x,this.transformPagePoint),ye.update(this.updatePoint,!0)},this.handlePointerUp=(p,x)=>{this.end();const{onEnd:g,onSessionEnd:v,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const j=Vi(p.type==="pointercancel"?this.lastMoveEventInfo:Fr(x,this.transformPagePoint),this.history);this.startEvent&&g&&g(p,j),v&&v(p,j)},!As(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=i||window;const d=gr(t),c=Fr(d,this.transformPagePoint),{point:u}=c,{timestamp:h}=He;this.history=[{...u,timestamp:h}];const{onSessionStart:m}=n;m&&m(t,Vi(c,this.history)),this.removeListeners=pr(rr(this.contextWindow,"pointermove",this.handlePointerMove),rr(this.contextWindow,"pointerup",this.handlePointerUp),rr(this.contextWindow,"pointercancel",this.handlePointerUp)),l&&this.startScrollTracking(l)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(Ml.has(r.overflowX)||Ml.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,i=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:i.x-n.x,y:i.y-n.y};s.x===0&&s.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,i),ye.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Gt(this.updatePoint)}}function Fr(e,t){return t?{point:t(e.point)}:e}function Pl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Vi({point:e},t){return{point:e,delta:Pl(e,df(t)),offset:Pl(e,H0(t)),velocity:U0(t,.1)}}function H0(e){return e[0]}function df(e){return e[e.length-1]}function U0(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=df(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>et(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>et(t)*2&&(r=e[1]);const s=dt(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const a={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function $0(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?we(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?we(n,e,r.max):Math.min(e,n)),e}function Ol(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function G0(e,{top:t,left:n,bottom:r,right:i}){return{x:Ol(e.x,n,i),y:Ol(e.y,t,r)}}function zl(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Y0(e,t){return{x:zl(e.x,t.x),y:zl(e.y,t.y)}}function K0(e,t){let n=.5;const r=qe(e),i=qe(t);return i>r?n=ar(t.min,t.max-r,e.min):r>i&&(n=ar(e.min,e.max-i,t.min)),Lt(0,1,n)}function q0(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Po=.35;function X0(e=Po){return e===!1?e=0:e===!0&&(e=Po),{x:_l(e,"left","right"),y:_l(e,"top","bottom")}}function _l(e,t,n){return{min:Nl(e,t),max:Nl(e,n)}}function Nl(e,t){return typeof e=="number"?e:e[t]||0}const Z0=new WeakMap;class J0{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Pe(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=h=>{n&&this.snapToCursor(gr(h).point),this.stopAnimation()},a=(h,m)=>{const{drag:p,dragPropagation:x,onDragStart:g}=this.getProps();if(p&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=jx(p),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ct(y=>{let j=this.getAxisMotionValue(y).get()||0;if(Ft.test(j)){const{projection:w}=this.visualElement;if(w&&w.layout){const A=w.layout.layoutBox[y];A&&(j=qe(A)*(parseFloat(j)/100))}}this.originPoint[y]=j}),g&&ye.update(()=>g(h,m),!1,!0),Bo(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},l=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m;const{dragPropagation:p,dragDirectionLock:x,onDirectionLock:g,onDrag:v}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:y}=m;if(x&&this.currentDirection===null){this.currentDirection=ey(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",m.point,y),this.updateAxis("y",m.point,y),this.visualElement.render(),v&&ye.update(()=>v(h,m),!1,!0)},d=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m,this.stop(h,m),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new uf(t,{onSessionStart:s,onStart:a,onMove:l,onSessionEnd:d,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:cf(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!r)return;const{velocity:a}=i;this.startAnimation(a);const{onDragEnd:l}=this.getProps();l&&ye.postRender(()=>l(r,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Ar(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=$0(a,this.constraints[t],this.elastic[t])),s.set(a)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&Tn(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=G0(r.layoutBox,t):this.constraints=!1,this.elastic=X0(n),i!==this.constraints&&!Tn(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Ct(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=q0(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Tn(t))return!1;const r=t.current;Pt(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=eg(r,i.root,this.visualElement.getTransformPagePoint());let a=Y0(i.layout.layoutBox,s);if(n){const l=n(Zx(a));this.hasMutatedConstraints=!!l,l&&(a=Ld(l))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),d=this.constraints||{},c=Ct(u=>{if(!Ar(u,n,this.currentDirection))return;let h=d&&d[u]||{};(a===!0||a===u)&&(h={min:0,max:0});const m=i?200:1e6,p=i?40:1e7,x={type:"inertia",velocity:r?t[u]:0,bounceStiffness:m,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...h};return this.startAxisValueAnimation(u,x)});return Promise.all(c).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Bo(this.visualElement,t),r.start(js(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ct(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ct(n=>{const{drag:r}=this.getProps();if(!Ar(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:l}=i.layout.layoutBox[n],d=s.get()||0;s.set(t[n]-we(a,l,.5)+d)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Tn(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ct(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const d=l.get();i[a]=K0({min:d,max:d},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ct(a=>{if(!Ar(a,t,null))return;const l=this.getAxisMotionValue(a),{min:d,max:c}=this.constraints[a];l.set(we(d,c,i[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Z0.set(this.visualElement,this);const t=this.visualElement.current,n=rr(t,"pointerdown",c=>{const{drag:u,dragListener:h=!0}=this.getProps(),m=c.target,p=m!==t&&Lx(m);u&&h&&!p&&this.start(c)});let r;const i=()=>{const{dragConstraints:c}=this.getProps();Tn(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=Q0(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,a=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ye.read(i);const l=ur(window,"resize",()=>this.scalePositionWithinConstraints()),d=s.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ct(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=c[h].translate,m.set(m.get()+c[h].translate))}),this.visualElement.render())}));return()=>{l(),n(),a(),d&&d(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:a=Po,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:a,dragMomentum:l}}}function Vl(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Q0(e,t,n){const r=Ka(e,Vl(n)),i=Ka(t,Vl(n));return()=>{r(),i()}}function Ar(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ey(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class ty extends Yt{constructor(t){super(t),this.removeGroupControls=ft,this.removeListeners=ft,this.controls=new J0(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ft}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Wi=e=>(t,n)=>{e&&ye.update(()=>e(t,n),!1,!0)};class ny extends Yt{constructor(){super(...arguments),this.removePointerDownListener=ft}onPointerDown(t){this.session=new uf(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:cf(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Wi(t),onStart:Wi(n),onMove:Wi(r),onEnd:(s,a)=>{delete this.session,i&&ye.postRender(()=>i(s,a))}}}mount(){this.removePointerDownListener=rr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Hi=!1;class ry extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),Hi&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),$r.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,{projection:a}=r;return a&&(a.isPresent=s,t.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),Hi=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?a.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?a.promote():a.relegate()||ye.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Fs.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;Hi=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function ff(e){const[t,n]=Qd(),r=k.useContext(us);return o.jsx(ry,{...e,layoutGroup:r,switchLayoutGroup:k.useContext(af),isPresent:t,safeToRemove:n})}const iy={pan:{Feature:ny},drag:{Feature:ty,ProjectionNode:Jd,MeasureLayout:ff}};function Wl(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&ye.postRender(()=>s(t,gr(t)))}class oy extends Yt{mount(){const{current:t}=this.node;t&&(this.unmount=Bx(t,(n,r)=>(Wl(this.node,r,"Start"),i=>Wl(this.node,i,"End"))))}unmount(){}}class sy extends Yt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=pr(ur(this.node.current,"focus",()=>this.onFocus()),ur(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Hl(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&ye.postRender(()=>s(t,gr(t)))}class ay extends Yt{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=Dx(t,(i,s)=>(Hl(this.node,s,"Start"),(a,{success:l})=>Hl(this.node,a,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Oo=new WeakMap,Ui=new WeakMap,ly=e=>{const t=Oo.get(e.target);t&&t(e)},cy=e=>{e.forEach(ly)};function uy({root:e,...t}){const n=e||document;Ui.has(n)||Ui.set(n,{});const r=Ui.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(cy,{root:e,...t})),r[i]}function dy(e,t,n){const r=uy(t);return Oo.set(e,n),r.observe(e),()=>{Oo.delete(e),r.unobserve(e)}}const fy={some:0,all:1};class hy extends Yt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var d;(d=this.stopObserver)==null||d.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:fy[i]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:h,onViewportLeave:m}=this.node.getProps(),p=u?h:m;p&&p(c)};this.stopObserver=dy(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(py(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function py({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const my={inView:{Feature:hy},tap:{Feature:ay},focus:{Feature:sy},hover:{Feature:oy}},xy={layout:{ProjectionNode:Jd,MeasureLayout:ff}},gy={...N0,...my,...iy,...xy},st=M0(gy,P0);function At({label:e,children:t,placement:n="top",...r}){const[i,s]=k.useState(!1),a=k.useRef(null),l=k.useMemo(()=>typeof window>"u"?!1:window.matchMedia("(pointer: coarse)").matches,[]);k.useEffect(()=>{if(!l||!i)return;const c=u=>{a.current&&!a.current.contains(u.target)&&s(!1)};return document.addEventListener("mousedown",c),document.addEventListener("touchstart",c,{passive:!0}),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("touchstart",c)}},[l,i]);const d=c=>{l&&(c.preventDefault(),c.stopPropagation(),s(u=>!u))};return o.jsxs(f.Tooltip.Root,{positioning:{placement:n},open:l?i:void 0,onOpenChange:l?c=>s(c.open):void 0,...r,children:[o.jsx(f.Tooltip.Trigger,{asChild:!0,children:o.jsx("span",{ref:a,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:d,children:t})}),o.jsx(f.Tooltip.Positioner,{children:o.jsx(f.Tooltip.Content,{bg:"gray.900",color:"white",borderRadius:"md",px:"3",py:"1.5",fontSize:"xs",fontFamily:"var(--font-body)",border:"1px solid",borderColor:"gray.700",boxShadow:"none",children:e})})]})}const yy={BASE_URL:"/",DEV:!1,MODE:"production",PACKAGE_VERSION:"0.1.24",PROD:!0,SSR:!1,VITE_STORYBOOK_URL:"https://medixdeck-ui.vercel.app",VITE_WHATSAPP_COMMUNITY_LINK:"https://medixdeck.com/whatsapp"},by={blue:{solid:"#0685FF",hoverBgLight:"rgba(6,133,255,0.08)",hoverBgDark:"rgba(6,133,255,0.12)",activeBgLight:"rgba(6,133,255,0.10)",activeBgDark:"rgba(6,133,255,0.15)",activeBgDarkStrong:"rgba(6,133,255,0.18)",chakraToken:"blue.500"},purple:{solid:"#7700CC",hoverBgLight:"rgba(119,0,204,0.08)",hoverBgDark:"rgba(119,0,204,0.12)",activeBgLight:"rgba(119,0,204,0.10)",activeBgDark:"rgba(119,0,204,0.15)",activeBgDarkStrong:"rgba(119,0,204,0.18)",chakraToken:"purple.500"}},Bt="#EF4444",zo="rgba(239,68,68,0.08)",hf=()=>o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),o.jsx("path",{d:"M9 3v18"}),o.jsx("path",{d:"m14 9-3 3 3 3"})]}),pf=()=>o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),o.jsx("path",{d:"M9 3v18"}),o.jsx("path",{d:"m12 15 3-3-3-3"})]}),vy=()=>o.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),o.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),o.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]}),ky=()=>o.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),mf=({open:e})=>o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"transform 0.2s ease",transform:e?"rotate(180deg)":"rotate(0deg)"},children:o.jsx("polyline",{points:"6 9 12 15 18 9"})}),_o=()=>o.jsxs("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4"}),o.jsx("polyline",{points:"16 17 21 12 16 7"}),o.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}),wy=()=>o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),o.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),Sy=()=>o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"3"}),o.jsx("path",{d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"})]}),Cy=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"4"}),o.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"4"}),o.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"22"}),o.jsx("line",{x1:"4.93",y1:"4.93",x2:"6.34",y2:"6.34"}),o.jsx("line",{x1:"17.66",y1:"17.66",x2:"19.07",y2:"19.07"}),o.jsx("line",{x1:"2",y1:"12",x2:"4",y2:"12"}),o.jsx("line",{x1:"20",y1:"12",x2:"22",y2:"12"}),o.jsx("line",{x1:"4.93",y1:"19.07",x2:"6.34",y2:"17.66"}),o.jsx("line",{x1:"17.66",y1:"6.34",x2:"19.07",y2:"4.93"})]}),jy=()=>o.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),Ty=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"12",rx:"2"}),o.jsx("line",{x1:"8",y1:"20",x2:"16",y2:"20"}),o.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"20"})]}),By=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M10 2v7.31a2 2 0 0 1-.37 1.17L4.22 18A3 3 0 0 0 6.78 22h10.44a3 3 0 0 0 2.56-4l-5.41-7.52A2 2 0 0 1 14 9.31V2"}),o.jsx("line",{x1:"8.5",y1:"2",x2:"15.5",y2:"2"}),o.jsx("path",{d:"M8.5 14h7"})]}),Ey=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),o.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),o.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),Fy=()=>o.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),o.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),o.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),Ay=()=>o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),Ly=(e,t)=>o.jsx("a",{href:e.href,style:{textDecoration:"none",display:"block"},children:t});function Iy(){const e=new Date().getHours();return e<12?"Good morning":e<17?"Good afternoon":"Good evening"}const Ul={warning:{bg:"#FFFBEB",border:"#FDE68A",text:"#92400E",darkBg:"rgba(245,158,11,0.12)",darkBorder:"rgba(245,158,11,0.25)",darkText:"#FDE68A",badgeBg:"#F59E0B",badgeColor:"#FFFFFF"},info:{bg:"#EFF6FF",border:"#BFDBFE",text:"#1E40AF",darkBg:"rgba(6,133,255,0.12)",darkBorder:"rgba(6,133,255,0.25)",darkText:"#93C5FD",badgeBg:"#0685FF",badgeColor:"#FFFFFF"},error:{bg:"#FEF2F2",border:"#FECACA",text:"#991B1B",darkBg:"rgba(239,68,68,0.12)",darkBorder:"rgba(239,68,68,0.25)",darkText:"#FCA5A5",badgeBg:"#EF4444",badgeColor:"#FFFFFF"},neutral:{bg:"bg.surface",border:"var(--chakra-colors-border)",text:"text.body",darkBg:"bg.surface",darkBorder:"var(--chakra-colors-border)",darkText:"text.heading",badgeBg:"#6B7280",badgeColor:"#FFFFFF"}};function Dy(e){if(e&&e!=="auto")return{isNonProduction:e!=="production"&&e!=="live",detectedEnv:e};try{if(typeof process<"u"&&process&&process.env){const t=process.env.NODE_ENV,n=process.env.VERCEL_ENV||process.env.NEXT_PUBLIC_VERCEL_ENV,r=process.env.MEDIX_ENV||process.env.NEXT_PUBLIC_MEDIX_ENV||process.env.PUBLIC_MEDIX_ENV,i=process.env.CONTEXT;if(r){const s=String(r).toLowerCase();if(s==="sandbox")return{isNonProduction:!0,detectedEnv:"sandbox"};if(s==="staging")return{isNonProduction:!0,detectedEnv:"staging"};if(s==="test")return{isNonProduction:!0,detectedEnv:"test"};if(s==="dev"||s==="development")return{isNonProduction:!0,detectedEnv:"development"};if(s==="production"||s==="live")return{isNonProduction:!1,detectedEnv:"production"}}if(n==="preview")return{isNonProduction:!0,detectedEnv:"preview"};if(n==="development")return{isNonProduction:!0,detectedEnv:"development"};if(i==="deploy-preview"||i==="branch-deploy")return{isNonProduction:!0,detectedEnv:"preview"};if(t==="development")return{isNonProduction:!0,detectedEnv:"development"};if(t==="test")return{isNonProduction:!0,detectedEnv:"test"}}}catch{}try{if(typeof{url:typeof document>"u"?require("url").pathToFileURL(__filename).href:yn&&yn.tagName.toUpperCase()==="SCRIPT"&&yn.src||new URL("index.cjs",document.baseURI).href}<"u"&&{url:typeof document>"u"?require("url").pathToFileURL(__filename).href:yn&&yn.tagName.toUpperCase()==="SCRIPT"&&yn.src||new URL("index.cjs",document.baseURI).href}&&yy){const t="production"}}catch{}if(typeof window<"u"&&window.location&&window.location.hostname){const t=window.location.hostname.toLowerCase();if(t==="localhost"||t==="127.0.0.1"||t==="[::1]"||t==="0.0.0.0"||t.endsWith(".local")||t.endsWith(".test")||t.endsWith(".internal")||t.includes(".ngrok")||t.includes(".loca.lt"))return{isNonProduction:!0,detectedEnv:"development"};if(t.endsWith(".vercel.app")||t.endsWith(".netlify.app")||t.endsWith(".pages.dev")||t.endsWith(".amplifyapp.com")||t.endsWith(".onrender.com")||t.endsWith(".fly.dev")||t.endsWith(".azurestaticapps.net"))return{isNonProduction:!0,detectedEnv:"preview"};if(t.startsWith("sandbox.")||t.includes("-sandbox."))return{isNonProduction:!0,detectedEnv:"sandbox"};if(t.startsWith("staging.")||t.startsWith("stage.")||t.includes("-staging."))return{isNonProduction:!0,detectedEnv:"staging"};if(t.startsWith("test.")||t.startsWith("qa.")||t.includes("-test."))return{isNonProduction:!0,detectedEnv:"test"};if(t.startsWith("dev.")||t.includes("-dev."))return{isNonProduction:!0,detectedEnv:"development"}}return{isNonProduction:!1,detectedEnv:"production"}}function Ry(e){switch(e){case"sandbox":return"SANDBOX ENVIRONMENT";case"staging":return"STAGING ENVIRONMENT";case"test":return"TEST ENVIRONMENT";case"preview":return"PREVIEW DEPLOYMENT";case"development":return"DEVELOPMENT MODE";default:return"NON-PRODUCTION ENVIRONMENT"}}function My({detectedEnv:e,config:t,onDismiss:n}){const r=t.status??(e==="staging"||e==="preview"?"info":e==="test"?"error":"warning"),i=Ul[r]??Ul.warning,s=t.badgeLabel??Ry(e),a=t.message??"You are in a non-production test/sandbox environment. Simulated patient records, transactions, and actions will not affect live data.",l=r==="info"?o.jsx(Ey,{}):r==="error"?o.jsx(Fy,{}):o.jsx(By,{});return o.jsxs(f.Box,{as:"aside",role:"status","aria-live":"polite","aria-label":`${s}: ${a}`,position:"sticky",top:"0",zIndex:"banner",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"3",px:{base:"3",md:"5"},py:"2",minH:"36px",borderBottom:"1px solid",borderColor:i.border,bg:i.bg,color:i.text,_dark:{bg:i.darkBg,borderColor:i.darkBorder,color:i.darkText},transition:"background 0.2s ease, border-color 0.2s ease",children:[o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2.5",minW:"0",flex:"1",children:[o.jsx(f.Box,{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:i.badgeBg,children:l}),o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",px:"2",py:"0.5",borderRadius:"full",fontSize:"10px",fontWeight:"700",letterSpacing:"0.06em",textTransform:"uppercase",fontFamily:"var(--font-body)",lineHeight:"1",flexShrink:0,style:{background:i.badgeBg,color:i.badgeColor},children:s}),o.jsx(f.Box,{as:"span",fontSize:"xs",fontWeight:"500",fontFamily:"var(--font-body)",lineHeight:"1.4",color:"inherit",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},display:{base:"none",sm:"inline-block"},children:a})]}),o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2.5",flexShrink:0,children:[t.action,t.dismissible&&o.jsx(f.Box,{as:"button",type:"button",onClick:n,"aria-label":"Dismiss environment banner",display:"inline-flex",alignItems:"center",justifyContent:"center",w:"6",h:"6",borderRadius:"md",border:"none",bg:"transparent",color:"inherit",cursor:"pointer",opacity:.8,_hover:{opacity:1,bg:"blackAlpha.100"},_dark:{_hover:{bg:"whiteAlpha.100"}},_focusVisible:{outline:"2px solid",outlineColor:i.badgeBg,outlineOffset:"1px"},transition:"background 0.15s ease, opacity 0.15s ease",children:o.jsx(Ay,{})})]})]})}const Lr=[{value:"light",label:"Light mode",shortLabel:"Light",icon:o.jsx(Cy,{})},{value:"dark",label:"Dark mode",shortLabel:"Dark",icon:o.jsx(jy,{})},{value:"system",label:"System theme",shortLabel:"System",icon:o.jsx(Ty,{})}];function Py({scheme:e}){const{mounted:t,themeMode:n,themeSetting:r,setThemeMode:i}=hr(),[s,a]=k.useState(!1),l=k.useRef(null),d=t?r:void 0,c=Lr.find(m=>m.value===d)||Lr[0];k.useEffect(()=>{const m=p=>{l.current&&!l.current.contains(p.target)&&a(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);const u=o.jsx(f.Box,{display:{base:"none",md:"flex"},alignItems:"center",gap:"1",bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"full",p:"1","aria-label":"Theme mode switcher",children:Lr.map(m=>{const p=d===m.value,x=m.value==="dark"?e.activeBgDarkStrong:m.value==="system"?e.hoverBgDark:e.hoverBgLight;return o.jsxs(f.Box,{as:"button",onClick:()=>{t&&i(m.value)},"aria-pressed":p,"aria-label":m.label,title:t&&m.value==="system"?`System theme (currently ${n})`:m.label,display:"inline-flex",alignItems:"center",gap:"2",h:"9",px:"3",borderRadius:"full",border:"none",bg:p?x:"transparent",color:p?e.chakraToken:"text.muted",opacity:t?1:.6,cursor:t?"pointer":"default",transition:"background 0.18s ease, color 0.18s ease, opacity 0.18s ease",_hover:t?{bg:p?x:"bg",color:"text.heading"}:void 0,_focusVisible:{outline:"2px solid",outlineColor:e.chakraToken,outlineOffset:"2px"},children:[o.jsx(f.Box,{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,children:m.icon}),o.jsx(f.Box,{as:"span",fontSize:"xs",fontWeight:p?"700":"600",fontFamily:"var(--font-body)",whiteSpace:"nowrap",children:m.shortLabel})]},m.value)})}),h=o.jsxs(f.Box,{display:{base:"block",md:"none"},position:"relative",ref:l,children:[o.jsx(f.Box,{as:"button",display:"flex",alignItems:"center",justifyContent:"center",w:"10",h:"10",borderRadius:"full",bg:"bg.surface",border:"1px solid",borderColor:"border",color:e.chakraToken,cursor:t?"pointer":"default",opacity:t?1:.6,_hover:t?{bg:"bg"}:void 0,onClick:()=>{t&&a(m=>!m)},"aria-label":"Theme mode switcher","aria-expanded":s,"aria-haspopup":"menu",children:c.icon}),s&&t&&o.jsx(f.Box,{role:"menu",position:"absolute",top:"calc(100% + 8px)",right:"0",minW:"150px",bg:"bg",border:"1px solid",borderColor:"border",borderRadius:"xl",boxShadow:"none",zIndex:"popover",overflow:"hidden",py:"1",children:Lr.map(m=>{const p=d===m.value;return o.jsxs(f.Box,{as:"button",role:"menuitem",display:"flex",alignItems:"center",gap:"2.5",w:"full",px:"4",py:"2.5",border:"none",bg:p?e.hoverBgLight:"transparent",color:p?e.chakraToken:"text.body",cursor:"pointer",textAlign:"left",onClick:()=>{i(m.value),a(!1)},_hover:{bg:e.hoverBgLight,color:e.chakraToken},_dark:{bg:p?e.hoverBgDark:"transparent",_hover:{bg:e.hoverBgDark}},children:[o.jsx(f.Box,{flexShrink:0,children:m.icon}),o.jsx(f.Box,{as:"span",fontSize:"sm",fontWeight:p?"600":"500",fontFamily:"var(--font-body)",children:m.label})]},m.value)})})]});return o.jsxs(o.Fragment,{children:[u,h]})}function No({item:e,renderLink:t,onClick:n,scheme:r,isCollapsed:i=!1,isSubItem:s=!1}){var B;const[a,l]=k.useState(!1),[d,c]=k.useState(!1),[u,h]=k.useState(!1),m=k.useRef(null),p=e.isActive??!1,x=((B=e.subItems)==null?void 0:B.some(C=>C.isActive))??!1,[g,v]=k.useState(p||x),y=!!(e.subItems&&e.subItems.length>0),j=k.useId();k.useEffect(()=>{v(p||x)},[p,x]),k.useEffect(()=>{if(!u)return;const C=E=>{m.current&&!m.current.contains(E.target)&&h(!1)},O=E=>{E.key==="Escape"&&h(!1)};return document.addEventListener("mousedown",C),document.addEventListener("keydown",O),()=>{document.removeEventListener("mousedown",C),document.removeEventListener("keydown",O)}},[u]);const w=p;if(i){if(y){const O=o.jsxs(f.Box,{as:"button","aria-label":e.label,"aria-haspopup":"menu","aria-expanded":u,onClick:()=>h(E=>!E),onFocus:E=>c(E.currentTarget.matches(":focus-visible")),onBlur:()=>c(!1),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),display:"flex",alignItems:"center",justifyContent:"center",w:"10",h:"10",mx:"auto",borderRadius:"lg",border:"none",cursor:"pointer",position:"relative",style:{background:p||x?r.activeBgLight:a||u?r.hoverBgLight:"transparent",outline:d?`2px solid ${r.solid}`:void 0,outlineOffset:d?"2px":void 0,transition:"background 0.15s ease"},_dark:{bg:p||x?r.activeBgDark:a||u?r.hoverBgDark:"transparent"},children:[e.icon&&o.jsx(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",style:{color:p||x?r.solid:void 0,opacity:p||x?1:a||u?.85:.6},color:p||x?r.chakraToken:"text.body",children:e.icon}),x&&o.jsx(f.Box,{as:"span",position:"absolute",top:"2px",right:"2px",w:"6px",h:"6px",borderRadius:"full",style:{background:r.solid},"aria-hidden":"true"})]});return o.jsxs(f.Box,{position:"relative",ref:m,my:"0.5",display:"flex",justifyContent:"center",style:{zIndex:u?100:1},children:[u?O:o.jsx(At,{label:e.label,placement:"right",children:O}),u&&o.jsx(st.div,{initial:{opacity:0,x:-6,scale:.98},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:-4,scale:.98},transition:{duration:.16,ease:[0,0,.2,1]},style:{position:"absolute",left:"calc(100% + 8px)",top:0,zIndex:1500},children:o.jsxs(f.Box,{role:"menu","aria-label":e.label,bg:"bg",border:"1px solid",borderColor:"border",borderRadius:"card",boxShadow:"none",py:"1.5",minW:"200px",maxW:"260px",children:[o.jsxs(f.Box,{px:"3.5",py:"1.5",fontSize:"xs",fontWeight:"700",color:"text.muted",fontFamily:"var(--font-heading)",borderBottom:"1px solid",borderColor:"border",mb:"1",display:"flex",alignItems:"center",gap:"2",children:[e.icon&&o.jsx(f.Box,{display:"inline-flex",alignItems:"center",justifyContent:"center",color:r.chakraToken,children:e.icon}),o.jsx(f.Box,{as:"span",children:e.label}),e.isNew&&o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",justifyContent:"center",px:"1.5",py:"0.5",borderRadius:"full",fontSize:"10px",fontWeight:"700",letterSpacing:"0.04em",lineHeight:"1",textTransform:"uppercase",fontFamily:"var(--font-heading)",flexShrink:0,style:{background:r.solid,color:"#fff"},children:"NEW"})]}),o.jsx(f.Box,{display:"flex",flexDirection:"column",gap:"0.5",px:"1",children:e.subItems.map(E=>o.jsx(No,{item:E,renderLink:t,onClick:()=>{h(!1),n==null||n()},scheme:r,isCollapsed:!1,isSubItem:!0},E.href))})]})})]})}const C=o.jsx(f.Box,{display:"flex",justifyContent:"center",alignItems:"center",w:"full",children:o.jsx(At,{label:e.isNew?`${e.label} (NEW)`:e.label,placement:"right",children:o.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",w:"10",h:"10",mx:"auto",my:"0.5",borderRadius:"lg",position:"relative","aria-label":e.label,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onClick:n,style:{background:p?r.activeBgLight:a?r.hoverBgLight:"transparent",outline:d?`2px solid ${r.solid}`:void 0,outlineOffset:d?"2px":void 0,transition:"background 0.15s ease"},_dark:{bg:p?r.activeBgDark:a?r.hoverBgDark:"transparent"},children:[e.icon&&o.jsx(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",style:{color:w?r.solid:void 0,opacity:w?1:a?.85:.6},color:w?r.chakraToken:"text.body",children:e.icon}),typeof e.badge=="number"&&o.jsx(f.Box,{as:"span",position:"absolute",top:"-2px",right:"-2px",minW:"16px",h:"16px",px:"1",borderRadius:"full",fontSize:"9px",fontWeight:"700",lineHeight:"1",display:"inline-flex",alignItems:"center",justifyContent:"center",style:{background:r.solid,color:"#fff"},children:e.badge>99?"99+":e.badge}),e.hasDot&&o.jsx(f.Box,{as:"span",position:"absolute",top:"2px",right:"2px",w:"6px",h:"6px",borderRadius:"full",style:{background:Bt},"aria-label":"New notification"}),e.isNew&&typeof e.badge!="number"&&!e.hasDot&&o.jsx(f.Box,{as:"span",position:"absolute",top:"2px",right:"2px",w:"6px",h:"6px",borderRadius:"full",style:{background:r.solid},"aria-label":"New feature"})]})})});return t(e,C)}const A=o.jsxs(f.Box,{display:"flex",alignItems:"center",gap:s?"2.5":"3",px:s?"2":"3",py:s?"2":"2.5",borderRadius:"lg",borderLeftRadius:y?"lg":"none",borderTopLeftRadius:y?"lg":"none",borderBottomLeftRadius:y?"lg":"none",position:"relative",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onClick:y?void 0:n,style:{background:p?r.activeBgLight:a?r.hoverBgLight:"transparent",boxShadow:p&&!y?`inset 3px 0 0 ${r.solid}`:void 0,outline:d?`2px solid ${r.solid}`:void 0,outlineOffset:d?"2px":void 0,transition:"background 0.15s ease, box-shadow 0.15s ease"},_dark:{bg:p?r.activeBgDark:a?r.hoverBgDark:"transparent"},children:[e.icon&&o.jsx(f.Box,{flexShrink:0,style:{color:w?r.solid:void 0,opacity:w?1:a?.85:.6,transition:"color 0.15s ease, opacity 0.15s ease"},color:w?r.chakraToken:"text.body",children:e.icon}),o.jsx(f.Box,{as:"span",flex:"1",minW:"0",fontSize:"sm",fontWeight:w?"600":"500",fontFamily:"var(--font-body)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",style:{color:w?r.solid:void 0,transition:"color 0.15s ease"},color:w?r.chakraToken:"text.body",children:e.label}),typeof e.badge=="number"&&!y&&o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",justifyContent:"center",minW:"20px",h:"20px",px:"1",borderRadius:"full",fontSize:"xs",fontWeight:"700",lineHeight:"1",style:{background:r.solid,color:"#fff"},children:e.badge}),e.hasDot&&!y&&o.jsx(f.Box,{as:"span",display:"inline-block",w:"7px",h:"7px",borderRadius:"full",flexShrink:0,style:{background:Bt},"aria-label":"New notification"}),e.isNew&&o.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",justifyContent:"center",px:"1.5",py:"0.5",borderRadius:"full",fontSize:"10px",fontWeight:"700",letterSpacing:"0.04em",lineHeight:"1",textTransform:"uppercase",fontFamily:"var(--font-heading)",flexShrink:0,style:{background:r.solid,color:"#fff"},children:"NEW"}),y&&o.jsx(f.Box,{flexShrink:0,color:"text.muted",children:o.jsx(mf,{open:g})})]});return o.jsxs(o.Fragment,{children:[y?o.jsx("button",{type:"button","aria-expanded":g,"aria-controls":j,onClick:()=>v(C=>!C),onFocus:C=>{c(C.currentTarget.matches(":focus-visible"))},onBlur:()=>c(!1),style:{display:"block",width:"100%",background:"none",border:"none",padding:0,cursor:"pointer",textAlign:"left"},children:A}):t(e,A),y&&o.jsx(st.div,{id:j,initial:!1,animate:g?{height:"auto",opacity:1}:{height:0,opacity:0},transition:{duration:.2,ease:[0,0,.2,1]},style:{overflow:"hidden"},"aria-hidden":!g,children:o.jsx(f.Box,{display:"flex",flexDirection:"column",gap:"0.5",pl:"3",mt:"0.5",mb:"1",children:e.subItems.map(C=>o.jsx(No,{item:C,renderLink:t,onClick:n,scheme:r,isCollapsed:!1,isSubItem:!0},C.href))})})]})}let $l=!1;function Oy(){if(typeof document>"u"||$l)return;const e=document.createElement("style");e.setAttribute("data-medixdeck","mobile-nav"),e.textContent=`
|
|
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),Vl=!0}function Ey({items:e,renderLink:t,scheme:n}){return S.useEffect(()=>{By()},[]),i.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 o=r.isActive??!1,s=i.jsxs(tt.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:[i.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(${o?1:0})`,opacity:o?1:0,transition:"transform 0.3s cubic-bezier(0.22,1,0.36,1), opacity 0.2s ease",pointerEvents:"none"}}),i.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",position:"relative",zIndex:1,color:o?n.chakraToken:"text.muted",style:{transition:"color 0.18s ease",opacity:o?1:.6},children:[r.icon,typeof r.badge=="number"&&r.badge>0&&i.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})]}),i.jsx(f.Box,{as:"span",fontSize:"2xs",fontWeight:o?"700":"500",fontFamily:"var(--font-body)",textAlign:"center",lineHeight:"1",position:"relative",zIndex:1,color:o?n.chakraToken:"text.muted",style:{transition:"color 0.18s ease",letterSpacing:o?"-0.01em":"0"},children:r.label})]}),a={label:r.label,href:r.href,isActive:r.isActive};return i.jsx(f.Box,{flex:"1",display:"flex",alignItems:"stretch",justifyContent:"center",h:"16",style:{textDecoration:"none"},children:t(a,s)},r.href)})})}const Fy={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)"}},Ay=({color:e})=>i.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("circle",{cx:"12",cy:"8",r:"6"}),i.jsx("path",{d:"M15.477 12.89L17 22l-5-3-5 3 1.523-9.11"})]}),Ly=()=>i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("polyline",{points:"9 18 15 12 9 6"})});function Iy({data:e,renderLink:t,isCollapsed:n=!1}){const r=Fy[e.tier],o=e.name.split(" ").map(a=>a[0]).join("").slice(0,2).toUpperCase();if(n){const a=i.jsx(f.Box,{display:"flex",justifyContent:"center",alignItems:"center",w:"full",my:"2",children:i.jsx(Ct,{label:`${e.role} — ${e.name} (${r.label}, ${e.medixScore} pts)`,placement:"right",children:i.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:i.jsx("div",{style:{flexShrink:0,padding:2,borderRadius:"50%",background:`linear-gradient(135deg, ${r.ring}, ${r.color})`},children:e.avatarSrc?i.jsx("img",{src:e.avatarSrc,alt:e.name,style:{width:36,height:36,borderRadius:"50%",objectFit:"cover",display:"block"}}):i.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:o})})})})});return e.link?i.jsx(i.Fragment,{children:t({label:e.role,href:e.link},a)}):i.jsx(i.Fragment,{children:a})}const s=i.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:[i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"3",px:"3",pt:"3",pb:"2.5",children:[i.jsx("div",{style:{flexShrink:0,padding:2,borderRadius:"50%",background:`linear-gradient(135deg, ${r.ring}, ${r.color})`},children:e.avatarSrc?i.jsx("img",{src:e.avatarSrc,alt:e.name,style:{width:40,height:40,borderRadius:"50%",objectFit:"cover",display:"block"}}):i.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:o})}),i.jsxs(f.Box,{flex:"1",minW:"0",children:[i.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}),i.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&&i.jsx(f.Box,{color:"text.muted",flexShrink:0,children:i.jsx(Ly,{})})]}),i.jsx(f.Box,{borderTop:"1px solid",borderColor:"border"}),i.jsxs(f.Box,{px:"3",pt:"2",pb:"2.5",children:[i.jsx(f.Box,{fontSize:"10px",fontWeight:"600",letterSpacing:"wider",color:"text.muted",fontFamily:"var(--font-body)",mb:"1",children:"MedixScore"}),i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",flexWrap:"nowrap",children:[i.jsx(Ay,{color:r.color}),i.jsx(f.Box,{fontSize:"sm",fontWeight:"500",fontFamily:"var(--font-body)",style:{color:r.color,whiteSpace:"nowrap"},children:r.label}),i.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?i.jsx(i.Fragment,{children:t({label:e.role,href:e.link},s)}):i.jsx(i.Fragment,{children:s})}function Dy({logo:e,collapsedLogo:t,navGroups:n,isOpen:r,onClose:o,onLogout:s,renderLink:a,sidebarWidth:l,collapsedSidebarWidth:u,isCollapsed:c,collapsible:d,onToggleCollapse:h,collapseTogglePlacement:p,scheme:m,scoreCard:g}){const[x,y]=S.useState(!1);return i.jsxs(i.Fragment,{children:[r&&i.jsx(f.Box,{display:{base:"block",md:"none"},position:"fixed",inset:"0",zIndex:"overlay",bg:"blackAlpha.500",onClick:o,"aria-hidden":"true"}),i.jsxs(f.Box,{as:"aside","aria-label":"Main navigation",position:"fixed",top:"0",left:"0",bottom:"0",w:{base:`${l}px`,md:`${c?u: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:[i.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:[i.jsxs(f.Box,{display:{base:"none",md:c?"flex":"none"},flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"2",w:"full",children:[i.jsx(f.Box,{display:"flex",alignItems:"center",justifyContent:"center",children:t??i.jsx(tn,{type:"icon",variant:m.chakraToken==="blue.500"?"blue":"purple",height:26})}),d&&(p==="sidebar-header"||p==="both")&&i.jsx(Ct,{label:"Expand sidebar",placement:"right",children:i.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:i.jsx(rf,{})})})]}),i.jsxs(f.Box,{display:{base:"flex",md:c?"none":"flex"},alignItems:"center",justifyContent:"space-between",w:"full",minW:"0",children:[i.jsx(f.Box,{flex:"1",minW:"0",overflow:"hidden",children:e}),d&&(p==="sidebar-header"||p==="both")&&i.jsx(Ct,{label:"Collapse sidebar",placement:"bottom",children:i.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:i.jsx(nf,{})})})]})]}),g&&i.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:i.jsx(Iy,{data:g,renderLink:a,isCollapsed:c})}),i.jsx(f.Box,{flex:"1",overflowY:c?"visible":"auto",overflowX:c?"visible":"hidden",position:"relative",py:"3",px:c?"2":"3",children:n.map((v,j)=>i.jsxs(f.Box,{mb:c?"2":"4",children:[v.groupLabel&&(c?j>0?i.jsx(f.Box,{h:"1px",bg:"border",mx:"2",my:"2"}):null:i.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:v.groupLabel})),i.jsx(f.Box,{display:"flex",flexDirection:"column",gap:c?"1.5":"0.5",children:v.items.map(w=>i.jsx(Pi,{item:w,renderLink:a,onClick:o,scheme:m,isCollapsed:c},w.href))})]},j))}),i.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?i.jsx(Ct,{label:"Log out",placement:"right",children:i.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:()=>y(!0),onMouseLeave:()=>y(!1),onClick:()=>{o(),s==null||s()},style:{background:x?Ri:"transparent",color:kt,transition:"background 0.15s ease"},children:i.jsx(f.Box,{flexShrink:0,style:{color:kt},children:i.jsx(Mi,{})})})}):i.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:()=>y(!0),onMouseLeave:()=>y(!1),onClick:()=>{o(),s==null||s()},style:{background:x?Ri:"transparent",color:kt,transition:"background 0.15s ease"},children:[i.jsx(f.Box,{flexShrink:0,style:{color:kt},children:i.jsx(Mi,{})}),i.jsx(f.Box,{as:"span",fontSize:"sm",fontWeight:"500",fontFamily:"var(--font-body)",style:{color:kt},children:"Log out"})]})})]})]})}function Ry({user:e,greeting:t,greetingSubtext:n,isSidebarOpen:r,onMenuToggle:o,sidebarWidth:s,topBarSlot:a,dropdownItems:l,onLogout:u,scheme:c,collapsible:d=!0,isCollapsed:h=!1,onToggleCollapse:p,collapseTogglePlacement:m="sidebar-header"}){const[g,x]=S.useState(!1),y=S.useRef(null),v=S.useId(),j=`user-menu-button-${v}`,w=`user-menu-dropdown-${v}`;return S.useEffect(()=>{const F=B=>{y.current&&!y.current.contains(B.target)&&x(!1)};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[]),i.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:[i.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:o,"aria-label":r?"Close navigation menu":"Open navigation menu","aria-expanded":r,children:r?i.jsx(dy,{}):i.jsx(uy,{})}),d&&(m==="topbar"||m==="both")&&i.jsx(Ct,{label:h?"Expand sidebar":"Collapse sidebar",placement:"bottom",children:i.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:p,"aria-label":h?"Expand sidebar":"Collapse sidebar",transition:"background 0.15s ease, color 0.15s ease",children:h?i.jsx(rf,{}):i.jsx(nf,{})})}),i.jsxs(f.Box,{flex:"1",minW:"0",children:[i.jsxs(f.Box,{as:"p",fontSize:{base:"sm",md:"md"},fontWeight:"700",fontFamily:"var(--font-body)",color:"text.heading",lineHeight:"1.3",children:[t,","," ",i.jsx(f.Box,{as:"span",fontWeight:"700",color:"text.heading",children:e.name})]}),n&&i.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,i.jsx(Ty,{scheme:c}),i.jsxs(f.Box,{position:"relative",ref:y,children:[i.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:()=>x(F=>!F),"aria-haspopup":"menu","aria-expanded":g,"aria-controls":g?w:void 0,"aria-label":"User menu",children:[i.jsx(lo,{name:e.name,src:e.avatarSrc,size:"sm"}),i.jsx(f.Box,{color:"text.muted",children:i.jsx(of,{open:g})})]}),g&&i.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:[i.jsxs(f.Box,{px:"4",py:"3",borderBottom:"1px solid",borderColor:"border",children:[i.jsx(f.Box,{fontSize:"sm",fontWeight:"700",color:"text.heading",fontFamily:"var(--font-body)",children:e.name}),e.email&&i.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:e.email})]}),!l&&i.jsxs(i.Fragment,{children:[i.jsx(Ar,{icon:i.jsx(fy,{}),label:"My Profile",onClick:()=>x(!1),scheme:c}),i.jsx(Ar,{icon:i.jsx(hy,{}),label:"Settings",onClick:()=>x(!1),scheme:c})]}),l==null?void 0:l.map((F,B)=>i.jsx(Ar,{icon:F.icon,label:F.label,isDanger:F.isDanger,onClick:()=>{var C;x(!1),(C=F.onClick)==null||C.call(F)},scheme:c},B)),i.jsx(f.Box,{borderTop:"1px solid",borderColor:"border",my:"1"}),i.jsx(Ar,{icon:i.jsx(Mi,{}),label:"Log out",isDanger:!0,onClick:()=>{x(!1),u==null||u()},scheme:c})]})]})]})}function Ar({icon:e,label:t,isDanger:n,onClick:r,scheme:o}){const[s,a]=S.useState(!1);return i.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?Ri:o.hoverBgLight:"transparent",color:n?kt:void 0,transition:"background 0.12s ease"},children:[e&&i.jsx(f.Box,{flexShrink:0,style:{color:n?kt:void 0},color:"text.muted",children:e}),i.jsx(f.Box,{as:"span",fontSize:"sm",fontWeight:"500",fontFamily:"var(--font-body)",style:{color:n?kt:void 0},color:n?void 0:"text.body",children:t})]})}function sf({children:e,logo:t,navGroups:n,user:r,greeting:o,greetingSubtext:s,onLogout:a,renderLink:l=ky,dropdownItems:u,topBarSlot:c,sidebarWidth:d=220,collapsedSidebarWidth:h=68,collapsible:p=!0,defaultCollapsed:m=!1,isCollapsed:g,onCollapseChange:x,collapsedLogo:y,collapseTogglePlacement:v="sidebar-header",colorScheme:j="blue",mobileNavItems:w,scoreCard:F,environment:B="auto",showEnvironmentBanner:C,environmentBanner:P,environmentBannerSlot:A,...E}){const[L,R]=S.useState(!1),[D,N]=S.useState(m),[O,I]=S.useState(!1),[M,H]=S.useState(!1);S.useEffect(()=>{H(!0)},[]);const W=p&&(g!==void 0?g:D),$=()=>{if(!p)return;const ee=!W;g===void 0&&N(ee),x==null||x(ee)},b=cy[j],Y=!!(w&&w.length>0),oe=o??wy(),T=t??i.jsx(tn,{variant:j,height:26}),ie=y??i.jsx(tn,{type:"icon",variant:j,height:26}),se=P||{},X=se.environment||B,{isNonProduction:Z,detectedEnv:Q}=Sy(X),ue=!O&&(C!==void 0?C:M?Z:X!=="production"&&X!=="live");return i.jsxs(f.Box,{display:"flex",minH:"100vh",bg:"bg",...E,children:[i.jsx(Dy,{logo:T,collapsedLogo:ie,navGroups:n,isOpen:L,onClose:()=>R(!1),onLogout:a,renderLink:l,sidebarWidth:d,collapsedSidebarWidth:h,isCollapsed:W,collapsible:p,onToggleCollapse:$,collapseTogglePlacement:v,scheme:b,scoreCard:F}),i.jsxs(f.Box,{flex:"1",display:"flex",flexDirection:"column",minW:"0",ml:{base:"0",md:`${W?h:d}px`},transition:"margin-left 0.22s cubic-bezier(0.2,0,0,1)",children:[ue&&(A??i.jsx(jy,{detectedEnv:Q,config:se,onDismiss:()=>{var ee;I(!0),(ee=se.onDismiss)==null||ee.call(se)}})),i.jsx(Ry,{user:r,greeting:oe,greetingSubtext:s,isSidebarOpen:L,onMenuToggle:()=>R(ee=>!ee),sidebarWidth:d,topBarSlot:c,dropdownItems:u,onLogout:a,scheme:b,collapsible:p,isCollapsed:W,onToggleCollapse:$,collapseTogglePlacement:v}),i.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:Y?{base:"20",md:"6",lg:"8"}:{base:"4",md:"6",lg:"8"},children:e})]}),Y&&i.jsx(Ey,{items:w,renderLink:l,scheme:b})]})}sf.displayName="MedixDashboardLayout";const to=[0,0,.2,1],Ms=[.4,0,1,1],Ps=[.22,1,.36,1],My={hidden:{opacity:0,y:-8,scaleY:.96,transformOrigin:"top"},visible:{opacity:1,y:0,scaleY:1,transformOrigin:"top",transition:{duration:.22,ease:Ps}},exit:{opacity:0,y:-6,scaleY:.97,transformOrigin:"top",transition:{duration:.16,ease:Ms}}},Py={hidden:{},visible:{transition:{staggerChildren:.045,delayChildren:.06}}},Wl={hidden:{opacity:0,x:-10},visible:{opacity:1,x:0,transition:{duration:.2,ease:to}}},Oy={hidden:{opacity:0,y:10},visible:{opacity:1,y:0,transition:{duration:.22,ease:to,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:Ps}},exit:{opacity:0,y:-4,scale:.98,transformOrigin:"top",transition:{duration:.12,ease:Ms}}},_y={hidden:{opacity:0,height:0,overflow:"hidden"},visible:{opacity:1,height:"auto",overflow:"hidden",transition:{duration:.22,ease:Ps}},exit:{opacity:0,height:0,overflow:"hidden",transition:{duration:.16,ease:Ms}}},Ny={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"}},Vy=()=>i.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("line",{x1:"7",y1:"17",x2:"17",y2:"7"}),i.jsx("polyline",{points:"7 7 17 7 17 17"})]});function af({isOpen:e}){return i.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:i.jsx("polyline",{points:"6 9 12 15 18 9"})})}function no(){return i.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:[i.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),i.jsx("polyline",{points:"15 3 21 3 21 9"}),i.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})}function Wy({color:e}){return i.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("rect",{width:"32",height:"32",rx:"8",fill:e}),i.jsx("path",{d:"M9.25 10.75H22.75",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.25 16H22.75",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsx("path",{d:"M9.25 21.25H22.75",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Hy({color:e}){return i.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("rect",{width:"32",height:"32",rx:"8",fill:e}),i.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 Uy=(e,t)=>{const n=e.href??"#",r=e.target??(e.isExternal?"_blank":void 0),o=e.rel??(e.isExternal?"noopener noreferrer":void 0);return n==="#"&&!e.onClick?i.jsx("span",{style:{textDecoration:"none",display:"contents"},children:t}):i.jsx("a",{href:n,target:r,rel:o,onClick:e.onClick,style:{textDecoration:"none",display:"contents"},children:t})};function jn({badge:e,scheme:t}){return e?S.isValidElement(e)?e:i.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 $y({item:e,scheme:t,renderLink:n}){var d;const[r,o]=S.useState(!1),s=S.useRef(null),a=S.useRef(null),l=!!(e.children&&e.children.length>0);S.useEffect(()=>{if(!r)return;function h(m){s.current&&!s.current.contains(m.target)&&o(!1)}function p(m){m.key==="Escape"&&o(!1)}return document.addEventListener("mousedown",h),document.addEventListener("keydown",p),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",p)}},[r]);const u=()=>{a.current&&(clearTimeout(a.current),a.current=null),l&&o(!0)},c=()=>{l&&(a.current=setTimeout(()=>{o(!1)},150))};return l?i.jsxs(f.Box,{as:"li",ref:s,listStyleType:"none",position:"relative",onMouseEnter:u,onMouseLeave:c,children:[i.jsxs(f.Box,{as:"button","aria-haspopup":"menu","aria-expanded":r,onClick:()=>o(!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&&i.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",flexShrink:0,children:e.icon}),i.jsx("span",{children:e.label}),i.jsx(jn,{badge:e.badge,scheme:t}),i.jsx(af,{isOpen:r})]}),i.jsx(lr,{children:r&&i.jsx(tt.div,{variants:zy,initial:"hidden",animate:"visible",exit:"exit",style:{position:"absolute",top:"calc(100% + 6px)",left:0,zIndex:1e3},children:i.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:(d=e.children)==null?void 0:d.map((h,p)=>i.jsx(f.Box,{as:"div",role:"none",children:n(h,i.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:()=>o(!1),children:[h.icon&&i.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}),i.jsxs(f.Box,{flex:"1",minW:"0",children:[i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1.5",justifyContent:"space-between",children:[i.jsxs(f.Box,{as:"span",display:"inline-flex",alignItems:"center",gap:"1.5",fontSize:"sm",fontWeight:"semibold",fontFamily:"var(--font-heading)",children:[i.jsx("span",{children:h.label}),h.isExternal&&i.jsx(no,{})]}),i.jsx(jn,{badge:h.badge,scheme:t})]}),h.description&&i.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}-${p}`))})})})]}):i.jsx(f.Box,{as:"li",listStyleType:"none",children:n(e,i.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&&i.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",flexShrink:0,children:e.icon}),i.jsx("span",{children:e.label}),i.jsx(jn,{badge:e.badge,scheme:t}),e.isExternal&&i.jsx(no,{})]}))})}function Gy({item:e,scheme:t,renderLink:n,onCloseMenu:r}){var l;const[o,s]=S.useState(!1);return!(e.children&&e.children.length>0)?i.jsx(tt.li,{variants:Wl,children:n(e,i.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:[i.jsxs(f.Box,{as:"span",display:"inline-flex",alignItems:"center",gap:"2",children:[e.icon&&i.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",color:t.solid,children:e.icon}),i.jsx("span",{children:e.label})]}),i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1.5",children:[i.jsx(jn,{badge:e.badge,scheme:t}),e.isExternal&&i.jsx(no,{})]})]}))}):i.jsxs(tt.li,{variants:Wl,style:{listStyle:"none"},children:[i.jsxs(f.Box,{as:"button",onClick:()=>s(!o),"aria-expanded":o,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||o?t.hover:"text.body",bg:o?"bg.subtle":"transparent",_dark:{color:e.isActive||o?t.hover:"text.body",bg:o?"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:[i.jsxs(f.Box,{as:"span",display:"inline-flex",alignItems:"center",gap:"2",children:[e.icon&&i.jsx(f.Box,{as:"span",display:"inline-flex",alignItems:"center",color:t.solid,children:e.icon}),i.jsx("span",{children:e.label})]}),i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",children:[i.jsx(jn,{badge:e.badge,scheme:t}),i.jsx(af,{isOpen:o})]})]}),i.jsx(lr,{children:o&&i.jsx(tt.div,{variants:_y,initial:"hidden",animate:"visible",exit:"exit",children:i.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((u,c)=>i.jsx(f.Box,{as:"div",children:n(u,i.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:[u.icon&&i.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:u.icon}),i.jsxs(f.Box,{flex:"1",minW:"0",children:[i.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"1",children:[i.jsxs(f.Box,{as:"span",display:"inline-flex",alignItems:"center",gap:"1",fontSize:"sm",fontWeight:"medium",fontFamily:"var(--font-heading)",children:[i.jsx("span",{children:u.label}),u.isExternal&&i.jsx(no,{})]}),i.jsx(jn,{badge:u.badge,scheme:t})]}),u.description&&i.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:u.description})]})]}))},u.href||`${u.label}-${c}`))})})})]})}function Yy({logo:e,navItems:t=[],navItemsAlign:n="center",ctaLabel:r="Get Started",ctaHref:o,onCtaClick:s,ctaIconHref:a,onCtaIconClick:l,secondaryCtaLabel:u,secondaryCtaHref:c,onSecondaryCtaClick:d,ctaSlot:h,renderLink:p=Uy,isSticky:m=!1,colorScheme:g="blue",variant:x="solid",...y}){const[v,j]=S.useState(!1),w=Ny[g],F=a??o,B=l??s,C=x==="blur"?{background:"rgba(10,18,32,0.85)",backdropFilter:"blur(12px)"}:{},P=({mobile:A=!1})=>i.jsxs(f.Box,{display:"flex",gap:"2",alignItems:"center",flexDirection:A?"column":"row",children:[u&&i.jsx(Ye,{as:c?"a":"button",href:c,variant:A?"outline":"ghost",colorScheme:g,size:A?"md":"sm",onClick:()=>{d==null||d(),A&&j(!1)},style:A?{width:"100%"}:void 0,children:u}),i.jsx(Ye,{as:o?"a":"button",href:o,variant:"solid",colorScheme:g,size:A?"md":"sm",onClick:()=>{s==null||s(),A&&j(!1)},style:A?{width:"100%"}:void 0,children:r}),!A&&i.jsx(Ye,{as:F?"a":"button",href:F,target:F&&F!==o?"_blank":void 0,rel:F&&F!==o?"noopener noreferrer":void 0,variant:"solid",colorScheme:g,size:"sm",onClick:B,"aria-label":"Open",style:{width:34,height:34,padding:0,borderRadius:8,flexShrink:0},children:i.jsx(Vy,{})})]});return i.jsxs(f.Box,{as:"nav",role:"navigation","aria-label":"Main navigation",position:m?"sticky":"relative",top:m?"0":void 0,zIndex:m?"sticky":40,bg:x==="transparent"?"transparent":x==="blur"?void 0:"bg",style:C,borderBottom:"1px solid",borderColor:x==="transparent"?"transparent":"border",transition:"background 0.2s ease, border-color 0.2s ease",...y,children:[i.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:[i.jsx(f.Box,{flexShrink:0,children:e??i.jsx(tn,{variant:g==="blue"?"blue":"purple",height:28})}),i.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((A,E)=>i.jsx($y,{item:A,scheme:w,renderLink:p},A.href||`${A.label}-${E}`))}),i.jsx(f.Box,{display:{base:"none",md:"flex"},alignItems:"center",flexShrink:0,children:h??i.jsx(P,{})}),i.jsx(f.Box,{as:"button",display:{base:"flex",md:"none"},alignItems:"center",justifyContent:"center",border:"none",bg:"transparent",p:"0",cursor:"pointer",onClick:()=>j(!v),"aria-label":v?"Close menu":"Open menu","aria-expanded":v,position:"relative",width:"32px",height:"32px",flexShrink:0,children:i.jsx(lr,{mode:"wait",initial:!1,children:v?i.jsx(tt.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:to},style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx(Hy,{color:w.solid})},"close"):i.jsx(tt.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:to},style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx(Wy,{color:w.solid})},"hamburger")})})]}),i.jsx(lr,{children:v&&i.jsx(tt.div,{variants:My,initial:"hidden",animate:"visible",exit:"exit",style:{overflow:"hidden"},children:i.jsxs(f.Box,{display:{base:"block",md:"none"},bg:"bg",borderTop:"1px solid",borderColor:"border",py:"4",px:"4",children:[i.jsx(tt.ul,{variants:Py,initial:"hidden",animate:"visible",style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:4},children:t.map((A,E)=>i.jsx(Gy,{item:A,scheme:w,renderLink:p,onCloseMenu:()=>j(!1)},A.href||`${A.label}-${E}`))}),i.jsx(tt.div,{variants:Oy,initial:"hidden",animate:"visible",children:i.jsx(f.Box,{mt:"4",children:h??i.jsx(P,{mobile:!0})})})]})},"mobile-menu")})]})}const Ky={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)"}},qy=e=>({facebook:i.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),i.jsx("g",{clipPath:"url(#clip0_1217_192)",children:i.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"})}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_1217_192",children:i.jsx("rect",{width:"8",height:"16",fill:"white",transform:"translate(9 5)"})})})]}),twitter:i.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),i.jsx("g",{clipPath:"url(#clip0_1217_186)",children:i.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"})}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_1217_186",children:i.jsx("rect",{width:"15",height:"15",fill:"white",transform:"translate(6 5)"})})})]}),linkedin:i.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),i.jsx("g",{clipPath:"url(#clip0_1217_198)",children:i.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"})}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_1217_198",children:i.jsx("rect",{width:"16",height:"16",fill:"white",transform:"translate(5 5)"})})})]}),instagram:i.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),i.jsx("g",{clipPath:"url(#clip0_1217_183)",children:i.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"})}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_1217_183",children:i.jsx("rect",{width:"15",height:"15",fill:"white",transform:"translate(6 5)"})})})]}),youtube:i.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),i.jsx("g",{clipPath:"url(#clip0_1217_195)",children:i.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"})}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_1217_195",children:i.jsx("rect",{width:"16",height:"12",fill:"white",transform:"translate(5 7)"})})})]}),threads:i.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),i.jsx("g",{clipPath:"url(#clip0_1217_189)",children:i.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"})}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_1217_189",children:i.jsx("rect",{width:"15",height:"15",fill:"white",transform:"translate(6 5)"})})})]}),whatsapp:i.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),i.jsx("g",{transform:"translate(5.5, 5.5) scale(0.625)",children:i.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:i.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("rect",{width:"26",height:"26",rx:"5",fill:e}),i.jsx("g",{transform:"translate(5.5, 5.5) scale(0.625)",children:i.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"})})]})}),Xy="Nigeria's leading digital platform for specialist healthcare. Bridging the gap between expert care and patient convenience.",Zy=[{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"}]}],Jy=[{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"}],Qy=[{label:"Terms",href:"/terms"},{label:"Privacy",href:"/privacy"},{label:"Cookies",href:"/cookies"}],e2=(e,t)=>i.jsx("a",{href:e.href,target:e.isExternal?"_blank":void 0,rel:e.isExternal?"noopener noreferrer":void 0,style:{textDecoration:"none"},children:t});function lf({description:e=Xy,logo:t,sections:n=Zy,socialLinks:r=Jy,copyright:o,bottomLinks:s=Qy,newsletter:a,renderLink:l=e2,colorScheme:u="blue",certifications:c,...d}){const h=new Date().getFullYear(),p=o??`© ${h} MedixDeck Health Solutions Ltd. All Rights Reserved.`,[m,g]=S.useState(""),[x,y]=S.useState(!1),[v,j]=S.useState(!1),w=Ky[u],{mounted:F,themeMode:B,toggleThemeMode:C}=ur(),P=A=>{A.preventDefault(),a!=null&&a.onSubmit&&m&&(a.onSubmit(m),g(""))};return i.jsx(f.Box,{as:"footer",bg:"bg",py:{base:12,md:16},...d,children:i.jsxs(f.Container,{maxWidth:"7xl",children:[i.jsxs(f.Grid,{templateColumns:{base:"1fr",lg:"1.5fr 1fr 1.5fr"},gap:{base:12,lg:16},mb:16,children:[i.jsxs(f.Box,{children:[i.jsx(f.Box,{mb:4,children:i.jsx(f.Link,{href:"/",children:t??i.jsx(tn,{variant:u==="blue"?"blue":"purple",height:28})})}),i.jsx(f.Text,{fontSize:"sm",color:"text.body",maxW:"320px",lineHeight:"1.6",fontFamily:"var(--font-body)",children:e}),i.jsx(f.HStack,{mt:6,gap:2,flexWrap:"wrap",children:(()=>{const A=qy(w.solid);return r.map(E=>i.jsx(f.Link,{href:E.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:E.platform,"aria-label":E.platform,children:A[E.platform]},E.platform))})()})]}),i.jsx(f.Grid,{templateColumns:"1fr 1fr",gap:8,children:n.map(A=>i.jsxs(f.Box,{children:[i.jsx(f.Text,{fontWeight:"700",color:"text.heading",mb:4,fontSize:"xs",fontFamily:"var(--font-heading)",letterSpacing:"0.05em",textTransform:"uppercase",children:A.title}),i.jsx(f.VStack,{align:"flex-start",gap:3,children:A.links.map(E=>i.jsx(f.Box,{w:"full",children:l(E,i.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:E.label}))},E.label))})]},A.title))}),!(a!=null&&a.hide)&&i.jsx(f.Box,{children:i.jsxs(f.Box,{p:6,borderRadius:"2xl",border:"1px solid",borderColor:"border",bg:"bg",_dark:{bg:"rgba(255,255,255,0.02)"},children:[i.jsx(f.Text,{fontWeight:"700",color:"text.heading",mb:2,fontSize:"md",fontFamily:"var(--font-heading)",children:(a==null?void 0:a.title)??"Newsletter"}),i.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."}),i.jsxs(f.Box,{as:"form",onSubmit:P,position:"relative",display:"flex",children:[i.jsx(f.Box,{as:"input",type:"email",value:m,onChange:A=>g(A.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}),i.jsx("button",{type:"submit",style:{position:"absolute",right:"4px",top:"4px",bottom:"4px",width:"36px",height:"36px",padding:0,background:x?w.solidHover:w.solid,color:"white",borderRadius:"6px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",border:"none",boxShadow:v?`0 0 0 3px ${w.focusRing}`:"none",transition:"background 0.2s ease, box-shadow 0.2s ease"},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),onFocus:()=>j(!0),onBlur:()=>j(!1),"aria-label":"Subscribe",children:(a==null?void 0:a.buttonIcon)??i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),i.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]})]})})]}),i.jsx(f.Box,{borderTop:"1px solid",borderColor:"border",pt:6,children:i.jsxs(f.Flex,{justify:"space-between",align:{base:"center",md:"flex-start"},flexDir:{base:"column-reverse",md:"row"},gap:4,children:[i.jsx(f.Text,{fontSize:"xs",color:"text.body",fontFamily:"var(--font-body)",textAlign:{base:"center",md:"left"},children:p}),i.jsxs(f.HStack,{gap:6,flexWrap:"wrap",justify:"center",alignItems:"center",children:[s.map(A=>i.jsx(f.Box,{children:l(A,i.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:A.label}))},A.label)),F&&i.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"?i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("circle",{cx:"12",cy:"12",r:"5"}),i.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),i.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),i.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),i.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),i.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),i.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),i.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),i.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}):i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:i.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&&i.jsx(f.Box,{borderTop:"1px solid",borderColor:"border",pt:6,mt:6,pb:0,children:i.jsx(f.Flex,{gap:{base:6,md:10},flexWrap:"wrap",justify:{base:"center",md:"center"},align:"center",children:c.map(A=>{const E=i.jsxs(f.Flex,{align:"center",gap:"3",opacity:.75,_hover:{opacity:1},transition:"opacity 0.2s ease",style:{cursor:A.href?"pointer":"default"},children:[A.imageSrc?i.jsx("img",{src:A.imageSrc,alt:A.name,style:{height:28,width:"auto",objectFit:"contain",display:"block"}}):i.jsx(f.Box,{color:"text.muted",flexShrink:0,children:i.jsx("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})})}),i.jsx(f.Text,{fontSize:"xs",fontWeight:"600",fontFamily:"var(--font-body)",color:"text.muted",style:{whiteSpace:"nowrap"},children:A.name})]},A.name);return A.href?i.jsx(f.Box,{children:l({href:A.href,isExternal:A.isExternal??!0},E)},A.name):i.jsx(f.Box,{children:E},A.name)})})})]})})}lf.displayName="MedixFooter";const t2=i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:i.jsx("path",{d:"m9 18 6-6-6-6"})}),n2=(e,t)=>e.href?i.jsx("a",{href:e.href,style:{textDecoration:"none"},children:t}):i.jsx(i.Fragment,{children:t});function r2({items:e,separator:t=t2,renderLink:n=n2,...r}){return i.jsx(f.Box,{as:"nav","aria-label":"Breadcrumb",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"1.5",...r,children:e.map((o,s)=>{const a=s===e.length-1;return i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1.5",children:[n(o,i.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&&o.href?"pointer":"default",transition:"color 0.15s",wordBreak:"break-word",whiteSpace:a?"normal":"nowrap",children:o.label})),!a&&i.jsx(f.Box,{color:"text.muted",display:"flex",alignItems:"center",flexShrink:0,mt:"0.5",children:t})]},s)})})}const o2={sm:{px:"3",py:"1.5",fontSize:"sm"},md:{px:"4",py:"2",fontSize:"md"},lg:{px:"5",py:"2.5",fontSize:"lg"}};function i2({tabs:e,defaultActiveId:t,activeId:n,onChange:r,variant:o="line",size:s="md",renderContent:a=!0,...l}){var g;const[u,c]=S.useState(t??((g=e[0])==null?void 0:g.id)),d=n??u,h=x=>{c(x),r==null||r(x)},p=e.find(x=>x.id===d),m=o2[s];return i.jsxs(f.Box,{...l,children:[i.jsx(f.Box,{role:"tablist",display:"flex",gap:o==="pill"?"1":"0",borderBottom:o==="line"?"1px solid":"none",border:o==="pill"?"1px solid":"none",borderColor:"border",bg:o==="pill"?"bg.subtle":"transparent",p:o==="pill"?"1":"0",borderRadius:o==="pill"?"full":"none",overflowX:"auto",flexWrap:"nowrap",style:{scrollbarWidth:"none"},children:e.map(x=>{const y=x.id===d;return i.jsxs(f.Box,{role:"tab","aria-selected":y,"aria-disabled":x.disabled,tabIndex:x.disabled?-1:0,onClick:()=>!x.disabled&&h(x.id),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&!x.disabled&&h(x.id)},display:"flex",alignItems:"center",gap:"2",justifyContent:"center",px:o==="pill"?"4":m.px,py:o==="pill"?"3":m.py,fontFamily:"var(--font-body)",fontWeight:y?"semibold":"medium",fontSize:o==="pill"?"sm":m.fontSize,color:x.disabled?"text.muted":o==="pill"?y?"text.heading":"text.body":y?"blue.500":"text.body",cursor:x.disabled?"not-allowed":"pointer",opacity:x.disabled?.5:1,transition:"all 0.2s ease",whiteSpace:"nowrap",flex:o==="pill"?"1":void 0,flexShrink:o==="pill"?1:0,bg:o==="pill"?y?"bg":"bg.surface":"transparent",borderRadius:o==="pill"?"full":"none",boxShadow:"none",borderBottom:o==="line"?"2px solid":"none",borderColor:o==="line"?y?"blue.500":"transparent":void 0,mb:o==="line"?"-1px":"0",_hover:x.disabled?void 0:o==="line"?{color:"blue.500"}:{bg:y?"bg":"bg.subtle",color:"text.heading"},_focusVisible:{outline:"2px solid",outlineColor:"blue.500",outlineOffset:"2px",borderRadius:o==="pill"?"full":"sm"},children:[i.jsx(f.Text,{fontSize:"inherit",fontWeight:"inherit",color:"inherit",children:x.label}),x.badge!==void 0&&i.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:o==="pill"?y?"bg.subtle":"bg":y?"blue.100":"bg.subtle",color:o==="pill"?y?"text.heading":"text.muted":y?"blue.700":"text.muted",children:x.badge})]},x.id)})}),a&&(p==null?void 0:p.content)&&i.jsx(f.Box,{role:"tabpanel",mt:"4",children:p.content})]})}function s2(e,t,n){if(n*2+5>=t)return Array.from({length:t},(u,c)=>c+1);const o=Math.max(e-n,1),s=Math.min(e+n,t),a=o>2,l=s<t-2;if(!a&&l){const u=3+2*n;return[...Array.from({length:u},(c,d)=>d+1),"...",t]}if(a&&!l){const u=3+2*n;return[1,"...",...Array.from({length:u},(c,d)=>t-u+1+d)]}return[1,"...",...Array.from({length:s-o+1},(u,c)=>o+c),"...",t]}function cf({total:e,pageSize:t=10,currentPage:n=1,onChange:r,siblingCount:o=1,showEdges:s=!0,compact:a=!1,...l}){const u=Math.ceil(e/t);if(u<=1)return null;const c=s2(n,u,o),d={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:g,disabled:x,onClick:y,label:v,icon:j,isNext:w})=>i.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:x?.4:1,pointerEvents:x?"none":void 0,onClick:y,"aria-label":v,_hover:{color:"blue.500"},children:[!w&&j&&i.jsx(f.Box,{as:"span",display:"flex",alignItems:"center",children:j}),g,w&&j&&i.jsx(f.Box,{as:"span",display:"flex",alignItems:"center",children:j})]}),p=i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M15 18l-6-6 6-6"})}),m=i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M9 18l6-6-6-6"})});return i.jsxs(f.Box,{as:"nav",role:"navigation","aria-label":"Pagination",display:"flex",alignItems:"center",gap:"2",flexWrap:"wrap",...l,children:[s&&i.jsx(h,{disabled:n===1,onClick:()=>r==null?void 0:r(1),label:"First page",icon:p,children:"First"}),i.jsx(h,{disabled:n===1,onClick:()=>r==null?void 0:r(n-1),label:"Previous page",icon:p,children:"Prev"}),!a&&c.map((g,x)=>g==="..."?i.jsx(f.Box,{...d,bg:"transparent",color:"text.muted",cursor:"default",pointerEvents:"none",children:"…"},`dots-${x}`):i.jsx(f.Box,{as:"button",...d,bg:n===g?"blue.500":"blue.100",color:n===g?"white":"blue.500",_dark:{bg:n===g?"blue.500":"rgba(6, 133, 255, 0.12)",color:n===g?"white":"blue.200"},onClick:()=>r==null?void 0:r(g),"aria-label":`Page ${g}`,"aria-current":n===g?"page":void 0,_hover:n!==g?{bg:"blue.200",_dark:{bg:"rgba(6, 133, 255, 0.2)"}}:void 0,children:g},g)),a&&i.jsxs(f.Box,{px:"3",fontSize:"sm",color:"text.body",fontFamily:"var(--font-body)",whiteSpace:"nowrap",children:[n," / ",u]}),i.jsx(h,{disabled:n===u,onClick:()=>r==null?void 0:r(n+1),label:"Next page",icon:m,isNext:!0,children:"Next"}),s&&i.jsx(h,{disabled:n===u,onClick:()=>r==null?void 0:r(u),label:"Last page",icon:m,isNext:!0,children:"Last"})]})}const Hl=i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:i.jsx("path",{d:"M2 7L5.5 10.5L12 4",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});function a2({steps:e,currentStep:t,variant:n="default",orientation:r="horizontal",colorScheme:o="blue",...s}){const a=o==="blue"?"#0685FF":"#7700CC",l=o==="blue"?"rgba(6,133,255,0.10)":"rgba(119,0,204,0.10)";return r==="vertical"?i.jsx(f.Box,{display:"flex",flexDirection:"column",alignItems:"flex-start",...s,children:e.map((c,d)=>{const h=d+1<t,p=d+1===t,m=d===e.length-1,g=h||p?a:"var(--chakra-colors-border, #E2E8F0)";return i.jsxs(f.Box,{display:"flex",flexDirection:"row",alignItems:"flex-start",gap:"3",children:[i.jsxs(f.Box,{display:"flex",flexDirection:"column",alignItems:"center",children:[i.jsx(f.Box,{w:"8",h:"8",borderRadius:"full",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",bg:h||p?a:"bg.subtle",border:"2px solid",borderColor:g,color:"white",fontSize:"sm",fontWeight:"bold",fontFamily:"var(--font-body)",transition:"all 0.25s",children:h?Hl:c.icon??d+1}),!m&&i.jsx(f.Box,{w:"2px",flex:"1",minH:"8",bg:h?a:"border",my:"1",transition:"background 0.25s"})]}),n!=="compact"&&i.jsxs(f.Box,{pt:"1",pb:m?"0":"8",children:[i.jsx(f.Box,{fontSize:"sm",fontWeight:p?"semibold":"medium",color:h||p?a:"text.muted",fontFamily:"var(--font-body)",transition:"color 0.25s",children:c.title}),c.description&&i.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:c.description})]})]},c.id)})}):i.jsx(f.Box,{display:"inline-flex",alignItems:"center",gap:"0",role:"list","aria-label":"Progress steps",...s,children:e.map((c,d)=>{const h=d+1<t,p=d+1===t,m=d+1>t,g=d===e.length-1,x=m?"bg.subtle":a,y=h?Hl:c.icon?c.icon:i.jsx(f.Box,{as:"span",fontSize:"13px",fontWeight:"700",fontFamily:"var(--font-body)",color:m?"text.muted":"white",lineHeight:"1",children:d+1}),v=!m&&n!=="compact",j=m?"text.muted":a;return i.jsxs(S.Fragment,{children:[i.jsx(f.Box,{role:"listitem","aria-current":p?"step":void 0,display:"inline-flex",alignItems:"center",gap:"0",children:i.jsxs(f.Box,{display:"inline-flex",alignItems:"center",gap:"2",px:v?"2":"0",py:v?"1.5":"0",bg:v?l:"transparent",borderRadius:"full",transition:"all 0.25s ease",children:[i.jsx(f.Box,{w:"7",h:"7",borderRadius:"full",flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center",bg:x,border:m?"1.5px solid":"none",borderColor:"var(--chakra-colors-border, #E2E8F0)",transition:"all 0.25s ease",flexDirection:"row",children:y}),n!=="compact"&&i.jsx(f.Box,{as:"span",fontSize:"sm",fontWeight:p||h?"semibold":"medium",fontFamily:"var(--font-body)",color:j,whiteSpace:"nowrap",transition:"color 0.25s",children:c.title})]})}),!g&&i.jsx(f.Box,{display:"inline-flex",alignItems:"center",px:"1",flexShrink:0,children:i.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 l2=`
|
|
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=`
|
|
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=
|
|
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=`
|
|
362
362
|
@keyframes medix-indeterminate {
|
|
363
363
|
0% { left: -40%; }
|
|
364
364
|
100% { left: 100%; }
|
|
365
365
|
}
|
|
366
|
-
`,document.head.appendChild(t)}}const
|
|
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=`
|
|
367
367
|
@keyframes medixBottomSheetIn {
|
|
368
368
|
from { transform: translateY(100%); }
|
|
369
369
|
to { transform: translateY(0); }
|
|
@@ -372,10 +372,10 @@
|
|
|
372
372
|
from { transform: translateY(0); }
|
|
373
373
|
to { transform: translateY(100%); }
|
|
374
374
|
}
|
|
375
|
-
`,document.head.appendChild(e),Ul=!0}function p2({isOpen:e,onClose:t,title:n,description:r,size:o="md",closeOnOverlayClick:s=!0,closeOnEscape:a=!0,footer:l,children:u,mobileVariant:c="bottom-sheet"}){const d=!!(n||r);S.useEffect(()=>{h2()},[]);const h=c==="bottom-sheet";return i.jsxs(f.DialogRoot,{open:e,onOpenChange:p=>{p.open||t()},closeOnInteractOutside:s,closeOnEscape:a,size:f2[o],children:[i.jsx(f.DialogBackdrop,{bg:"rgba(10, 18, 32, 0.7)",backdropFilter:"blur(4px)"}),i.jsx(f.DialogPositioner,{display:"flex",alignItems:h?{base:"flex-end",md:"center"}:"center",justifyContent:"center",children:i.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:[i.jsxs(f.DialogHeader,{borderBottom:d?"1px solid":"none",borderColor:"border",px:"6",py:"4",display:"flex",flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",position:"relative",minH:d?void 0:"12",children:[h&&i.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"}),d&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,paddingRight:"2rem"},children:[n&&i.jsx(f.DialogTitle,{fontFamily:"var(--font-heading)",fontSize:"xl",fontWeight:"semibold",color:"text.heading",children:n}),r&&i.jsx(f.DialogDescription,{mt:"1",fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:r})]}),i.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:i.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:[i.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),i.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),i.jsx(f.DialogBody,{px:"6",py:"5",children:u}),l&&i.jsx(f.DialogFooter,{borderTop:"1px solid",borderColor:"border",px:"6",py:"4",display:"flex",justifyContent:"flex-end",gap:"3",style:h?{paddingBottom:"env(safe-area-inset-bottom, 16px)"}:void 0,children:l})]})})]})}function m2({icon:e,title:t,description:n,actionLabel:r,onAction:o,secondaryLabel:s,onSecondaryAction:a,...l}){return i.jsxs(f.Box,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",py:"16",px:"8",gap:"4",...l,children:[e&&i.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}),i.jsxs(f.Box,{children:[i.jsx(f.Box,{fontSize:"xl",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",mb:"2",children:t}),n&&i.jsx(f.Box,{fontSize:"md",color:"text.muted",fontFamily:"var(--font-body)",maxW:"360px",lineHeight:"loose",children:n})]}),(r||s)&&i.jsxs(f.Box,{display:"flex",gap:"3",mt:"2",children:[r&&i.jsx(Ye,{variant:"solid",colorScheme:"blue",onClick:o,children:r}),s&&i.jsx(Ye,{variant:"ghost",colorScheme:"blue",onClick:a,children:s})]})]})}function g2({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:o,secondaryLabel:s,onSecondaryAction:a,...l}){return i.jsxs(f.Box,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",minH:"100vh",px:"6",bg:"bg",...l,children:[i.jsx(f.Box,{fontSize:"8xl",fontWeight:"bold",color:"blue.500",fontFamily:"var(--font-heading)",lineHeight:"1",mb:"4",opacity:.15,children:"404"}),i.jsx(f.Text,{fontSize:"2xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",mb:"3",children:e}),i.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"&&i.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}),i.jsxs(f.Box,{display:"flex",gap:"4",children:[r&&i.jsx(Ye,{variant:"solid",colorScheme:"blue",onClick:o,children:r}),s&&i.jsx(Ye,{variant:"outline",colorScheme:"blue",onClick:a,children:s})]})]})}function x2({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:o,secondaryLabel:s,onSecondaryAction:a,...l}){return i.jsxs(f.Box,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",minH:"100vh",px:"6",bg:"bg",...l,children:[i.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:i.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("circle",{cx:"12",cy:"12",r:"10"}),i.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),i.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),i.jsx(f.Text,{fontSize:"2xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",mb:"3",children:e}),i.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"&&i.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}),i.jsxs(f.Box,{display:"flex",gap:"4",children:[r&&i.jsx(Ye,{variant:"solid",colorScheme:"blue",onClick:o,children:r}),s&&i.jsx(Ye,{variant:"outline",colorScheme:"blue",onClick:a,children:s})]})]})}const y2={left:"start",right:"end",top:"top",bottom:"bottom"};function b2({isOpen:e,onClose:t,title:n,placement:r="right",size:o="md",closeOnOverlayClick:s=!0,closeOnEscape:a=!0,footer:l,children:u}){const c=y2[r]??"end";return i.jsxs(f.DrawerRoot,{open:e,onOpenChange:d=>{d.open||t()},placement:c,size:o,closeOnInteractOutside:s,closeOnEscape:a,children:[i.jsx(f.DrawerBackdrop,{bg:"rgba(10, 18, 32, 0.7)",backdropFilter:"blur(4px)"}),i.jsx(f.DrawerPositioner,{children:i.jsxs(f.DrawerContent,{bg:"bg.surface",border:"1px solid",borderColor:"border",boxShadow:"none",children:[i.jsxs(f.DrawerHeader,{borderBottom:n?"1px solid":"none",borderColor:"border",px:"6",py:"4",position:"relative",minH:n?void 0:"12",children:[n&&i.jsx(f.DrawerTitle,{fontFamily:"var(--font-heading)",fontSize:"xl",fontWeight:"semibold",color:"text.heading",pr:"8",children:n}),i.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:i.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:[i.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),i.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),i.jsx(f.DrawerBody,{px:"6",py:"5",children:u}),l&&i.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 Lr(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 v2={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 Oi(e,t){function n(o,s,a){if(!(typeof document>"u")){a=Lr({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var u in a)a[u]&&(l+="; "+u,a[u]!==!0&&(l+="="+a[u].split(";")[0]));return document.cookie=o+"="+e.write(s,o)+l}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var s=document.cookie?document.cookie.split("; "):[],a={},l=0;l<s.length;l++){var u=s[l].split("="),c=u.slice(1).join("=");try{var d=decodeURIComponent(u[0]);if(a[d]=e.read(c,d),o===d)break}catch{}}return o?a[o]:a}}return Object.create({set:n,get:r,remove:function(o,s){n(o,"",Lr({},s,{expires:-1}))},withAttributes:function(o){return Oi(this.converter,Lr({},this.attributes,o))},withConverter:function(o){return Oi(Lr({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var ro=Oi(v2,{path:"/"});const k2=({condition:e,wrapper:t,children:n})=>e?t(n):n,zi={TOP:"top",BOTTOM:"bottom"};var Os=(e=>(e.STRICT="strict",e.LAX="lax",e.NONE="none",e))(Os||{});const _i={HIDDEN:"hidden",BY_COOKIE_VALUE:"byCookieValue"},ff="CookieConsent",w2=({children:e,...t})=>S.createElement("button",{...t},e),Xn={disableStyles:!1,hideOnAccept:!0,hideOnDecline:!0,location:zi.BOTTOM,visible:_i.BY_COOKIE_VALUE,onAccept:e=>{},onDecline:()=>{},cookieName:ff,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:Os.LAX,ButtonComponent:w2,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:{}},S2={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)"}},C2=(e=ff)=>{const t=ro.get(e);return t===void 0?ro.get(hf(e)):t},hf=e=>`${e}-legacy`,pf=class extends S.Component{constructor(){super(...arguments),this.state=S2,this.handleScroll=()=>{const{acceptOnScrollPercentage:t}={...Xn,...this.props},n=document.documentElement,r=document.body,o="scrollTop",s="scrollHeight";(n[o]||r[o])/((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:o,onAccept:s}={...Xn,...this.props};this.setCookie(n,r),s(t??!1),o&&(this.setState({visible:!1}),this.removeScrollListener())}overlayClick(){const{acceptOnOverlayClick:t,onOverlayClick:n}={...Xn,...this.props};t&&this.accept(),n()}decline(){const{cookieName:t,declineCookieValue:n,hideOnDecline:r,onDecline:o,setDeclineCookie:s}={...Xn,...this.props};s&&this.setCookie(t,n),o(),r&&this.setState({visible:!1})}setCookie(t,n){const{extraCookieOptions:r,expires:o,sameSite:s}=this.props;let{cookieSecurity:a}=this.props;a===void 0&&(a=globalThis.location?globalThis.location.protocol==="https:":!0);const l={expires:o,...r,sameSite:s,secure:a};s===Os.NONE&&ro.set(hf(t),n,l),ro.set(t,n,l)}getCookieValue(){const{cookieName:t}=this.props;return C2(t)}render(){switch(this.props.visible){case _i.HIDDEN:return null;case _i.BY_COOKIE_VALUE:if(!this.state.visible)return null;break}const{location:t,style:n,buttonStyle:r,declineButtonStyle:o,contentStyle:s,disableStyles:a,buttonText:l,declineButtonText:u,containerClasses:c,contentClasses:d,buttonClasses:h,buttonWrapperClasses:p,declineButtonClasses:m,buttonId:g,declineButtonId:x,disableButtonStyles:y,enableDeclineButton:v,flipButtons:j,ButtonComponent:w,overlay:F,overlayClasses:B,overlayStyle:C,ariaAcceptLabel:P,ariaDeclineLabel:A,customContainerAttributes:E,customContentAttributes:L,customButtonProps:R,customDeclineButtonProps:D,customButtonWrapperAttributes:N}=this.props;let O={},I={},M={},H={},W={};switch(a?(O=Object.assign({},n),I=Object.assign({},r),M=Object.assign({},o),H=Object.assign({},s),W=Object.assign({},C)):(O=Object.assign({},{...this.state.style,...n}),H=Object.assign({},{...this.state.contentStyle,...s}),W=Object.assign({},{...this.state.overlayStyle,...C}),y?(I=Object.assign({},r),M=Object.assign({},o)):(I=Object.assign({},{...this.state.buttonStyle,...r}),M=Object.assign({},{...this.state.declineButtonStyle,...o}))),t){case zi.TOP:O.top="0";break;case zi.BOTTOM:O.bottom="0";break}const $=[];return v&&$.push(S.createElement(w,{key:"declineButton",style:M,className:m,id:x,"aria-label":A,onClick:()=>{this.decline()},...D},u)),$.push(S.createElement(w,{key:"acceptButton",style:I,className:h,id:g,"aria-label":P,onClick:()=>{this.accept()},...R},l)),j&&$.reverse(),S.createElement(k2,{condition:F,wrapper:b=>S.createElement("div",{style:W,className:B,onClick:()=>{this.overlayClick()},onKeyDown:Y=>{(Y.key==="Enter"||Y.key===" ")&&(Y.preventDefault(),this.overlayClick())},role:"button",tabIndex:0,"aria-label":"Close cookie consent banner"},b)},S.createElement("div",{className:`${c}`,style:O,...E},S.createElement("div",{style:H,className:d,...L},this.props.children),S.createElement("div",{className:`${p}`,...N},$.map(b=>b))))}};pf.defaultProps=Xn;let j2=pf;function mf({title:e="We value your privacy",acceptText:t="Accept All",declineText:n="Reject Non-Essential",enableDeclineButton:r=!0,children:o,...s}){const a=es(),l=a?"#152035":"#F6F6F6",u=a?"#ABC0D6":"#3D4F63",c=a?"#1E3050":"#E4E8F0";return i.jsxs(i.Fragment,{children:[i.jsx("style",{children:`
|
|
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:`
|
|
376
376
|
.medixdeck-cookie-banner {
|
|
377
377
|
background-color: ${l} !important;
|
|
378
|
-
color: ${
|
|
378
|
+
color: ${d} !important;
|
|
379
379
|
border-top: 1px solid ${c} !important;
|
|
380
380
|
padding: 1rem 1.5rem !important;
|
|
381
381
|
display: flex !important;
|
|
@@ -409,20 +409,20 @@
|
|
|
409
409
|
align-items: center !important;
|
|
410
410
|
flex-wrap: wrap !important;
|
|
411
411
|
}
|
|
412
|
-
`}),
|
|
413
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function O2(e,t){return R2(e)||M2(e,t)||z2(e,t)||P2()}function z2(e,t){if(e){if(typeof e=="string")return $l(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)?$l(e,t):void 0}}const yf=Object.entries,Gl=Object.setPrototypeOf,_2=Object.isFrozen,N2=Object.getPrototypeOf,V2=Object.getOwnPropertyDescriptor;let Ue=Object.freeze,at=Object.seal,bn=Object.create,bf=typeof Reflect<"u"&&Reflect,Ni=bf.apply,Vi=bf.construct;Ue||(Ue=function(t){return t});at||(at=function(t){return t});Ni||(Ni=function(t,n){for(var r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];return t.apply(n,o)});Vi||(Vi=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return new t(...r)});const Gt=je(Array.prototype.forEach),W2=je(Array.prototype.lastIndexOf),Yl=je(Array.prototype.pop),fn=je(Array.prototype.push),H2=je(Array.prototype.splice),Ve=Array.isArray,Zn=je(String.prototype.toLowerCase),Uo=je(String.prototype.toString),Kl=je(String.prototype.match),hn=je(String.prototype.replace),ql=je(String.prototype.indexOf),U2=je(String.prototype.trim),$2=je(Number.prototype.toString),G2=je(Boolean.prototype.toString),Xl=typeof BigInt>"u"?null:je(BigInt.prototype.toString),Zl=typeof Symbol>"u"?null:je(Symbol.prototype.toString),ke=je(Object.prototype.hasOwnProperty),Wn=je(Object.prototype.toString),Me=je(RegExp.prototype.test),pn=Y2(TypeError);function je(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Ni(e,t,r)}}function Y2(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Vi(e,n)}}function ae(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Zn;if(Gl&&Gl(e,null),!Ve(t))return e;let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const s=n(o);s!==o&&(_2(t)||(t[r]=s),o=s)}e[o]=!0}return e}function K2(e){for(let t=0;t<e.length;t++)ke(e,t)||(e[t]=null);return e}function _e(e){const t=bn(null);for(const r of yf(e)){var n=O2(r,2);const o=n[0],s=n[1];ke(e,o)&&(Ve(s)?t[o]=K2(s):s&&typeof s=="object"&&s.constructor===Object?t[o]=_e(s):t[o]=s)}return t}function q2(e){switch(typeof e){case"string":return e;case"number":return $2(e);case"boolean":return G2(e);case"bigint":return Xl?Xl(e):"0";case"symbol":return Zl?Zl(e):"Symbol()";case"undefined":return Wn(e);case"function":case"object":{if(e===null)return Wn(e);const t=e,n=xt(t,"toString");if(typeof n=="function"){const r=n(t);return typeof r=="string"?r:Wn(r)}return Wn(e)}default:return Wn(e)}}function xt(e,t){for(;e!==null;){const r=V2(e,t);if(r){if(r.get)return je(r.get);if(typeof r.value=="function")return je(r.value)}e=N2(e)}function n(){return null}return n}function X2(e){try{return Me(e,""),!0}catch{return!1}}const Jl=Ue(["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"]),$o=Ue(["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"]),Go=Ue(["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"]),Z2=Ue(["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"]),Yo=Ue(["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"]),J2=Ue(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ql=Ue(["#text"]),ec=Ue(["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"]),Ko=Ue(["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"]),tc=Ue(["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"]),Ir=Ue(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Q2=at(/{{[\w\W]*|^[\w\W]*}}/g),eb=at(/<%[\w\W]*|^[\w\W]*%>/g),tb=at(/\${[\w\W]*/g),nb=at(/^data-[\-\w.\u00B7-\uFFFF]+$/),rb=at(/^aria-[\-\w]+$/),nc=at(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ob=at(/^(?:\w+script|data):/i),ib=at(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),sb=at(/^html$/i),ab=at(/^[a-z][.\w]*(-[.\w]+)+$/i),gt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},lb=function(){return typeof window>"u"?null:window},cb=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));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}},rc=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function vf(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:lb();const t=J=>vf(J);if(t.version="3.4.8",t.removed=[],!e||!e.document||e.document.nodeType!==gt.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const r=n,o=r.currentScript;e.DocumentFragment;const s=e.HTMLTemplateElement,a=e.Node,l=e.Element,u=e.NodeFilter,c=e.NamedNodeMap;c===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const d=e.DOMParser,h=e.trustedTypes,p=l.prototype,m=xt(p,"cloneNode"),g=xt(p,"remove"),x=xt(p,"nextSibling"),y=xt(p,"childNodes"),v=xt(p,"parentNode"),j=xt(p,"shadowRoot"),w=xt(p,"attributes"),F=a&&a.prototype?xt(a.prototype,"nodeType"):null,B=a&&a.prototype?xt(a.prototype,"nodeName"):null;if(typeof s=="function"){const J=n.createElement("template");J.content&&J.content.ownerDocument&&(n=J.content.ownerDocument)}let C,P="",A=0;const E=function(k){if(A>0)throw pn('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.');A++;try{return C.createHTML(k)}finally{A--}},L=n,R=L.implementation,D=L.createNodeIterator,N=L.createDocumentFragment,O=L.getElementsByTagName,I=r.importNode;let M=rc();t.isSupported=typeof yf=="function"&&typeof v=="function"&&R&&R.createHTMLDocument!==void 0;const H=Q2,W=eb,$=tb,b=nb,Y=rb,oe=ob,T=ib,ie=ab;let se=nc,X=null;const Z=ae({},[...Jl,...$o,...Go,...Yo,...Ql]);let Q=null;const ue=ae({},[...ec,...Ko,...tc,...Ir]);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}})),ze=null,Ae=null;const Je=Object.seal(bn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let xr=!0,rn=!0,Mn=!1,Pn=!0,ht=!1,At=!0,pt=!1,On=!1,zn=!1,Lt=!1,on=!1,sn=!1,z=!0,G=!1;const ne="user-content-";let le=!0,de=!1,Le={},Ie=null;const Qe=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 It=null;const Dt=ae({},["audio","video","img","source","image","track"]);let Re=null;const Bt=ae({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),$e="http://www.w3.org/1998/Math/MathML",yr="http://www.w3.org/2000/svg",mt="http://www.w3.org/1999/xhtml";let an=mt,yo=!1,bo=null;const lh=ae({},[$e,yr,mt],Uo);let vo=ae({},["mi","mo","mn","ms","mtext"]),ko=ae({},["annotation-xml"]);const ch=ae({},["title","style","font","a","script"]);let _n=null;const uh=["application/xhtml+xml","text/html"],dh="text/html";let we=null,ln=null;const fh=n.createElement("form"),Js=function(k){return k instanceof RegExp||k instanceof Function},wo=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ln&&ln===k)return;(!k||typeof k!="object")&&(k={}),k=_e(k),_n=uh.indexOf(k.PARSER_MEDIA_TYPE)===-1?dh:k.PARSER_MEDIA_TYPE,we=_n==="application/xhtml+xml"?Uo:Zn,X=ke(k,"ALLOWED_TAGS")&&Ve(k.ALLOWED_TAGS)?ae({},k.ALLOWED_TAGS,we):Z,Q=ke(k,"ALLOWED_ATTR")&&Ve(k.ALLOWED_ATTR)?ae({},k.ALLOWED_ATTR,we):ue,bo=ke(k,"ALLOWED_NAMESPACES")&&Ve(k.ALLOWED_NAMESPACES)?ae({},k.ALLOWED_NAMESPACES,Uo):lh,Re=ke(k,"ADD_URI_SAFE_ATTR")&&Ve(k.ADD_URI_SAFE_ATTR)?ae(_e(Bt),k.ADD_URI_SAFE_ATTR,we):Bt,It=ke(k,"ADD_DATA_URI_TAGS")&&Ve(k.ADD_DATA_URI_TAGS)?ae(_e(Dt),k.ADD_DATA_URI_TAGS,we):Dt,Ie=ke(k,"FORBID_CONTENTS")&&Ve(k.FORBID_CONTENTS)?ae({},k.FORBID_CONTENTS,we):Qe,ze=ke(k,"FORBID_TAGS")&&Ve(k.FORBID_TAGS)?ae({},k.FORBID_TAGS,we):_e({}),Ae=ke(k,"FORBID_ATTR")&&Ve(k.FORBID_ATTR)?ae({},k.FORBID_ATTR,we):_e({}),Le=ke(k,"USE_PROFILES")?k.USE_PROFILES&&typeof k.USE_PROFILES=="object"?_e(k.USE_PROFILES):k.USE_PROFILES:!1,xr=k.ALLOW_ARIA_ATTR!==!1,rn=k.ALLOW_DATA_ATTR!==!1,Mn=k.ALLOW_UNKNOWN_PROTOCOLS||!1,Pn=k.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ht=k.SAFE_FOR_TEMPLATES||!1,At=k.SAFE_FOR_XML!==!1,pt=k.WHOLE_DOCUMENT||!1,Lt=k.RETURN_DOM||!1,on=k.RETURN_DOM_FRAGMENT||!1,sn=k.RETURN_TRUSTED_TYPE||!1,zn=k.FORCE_BODY||!1,z=k.SANITIZE_DOM!==!1,G=k.SANITIZE_NAMED_PROPS||!1,le=k.KEEP_CONTENT!==!1,de=k.IN_PLACE||!1,se=X2(k.ALLOWED_URI_REGEXP)?k.ALLOWED_URI_REGEXP:nc,an=typeof k.NAMESPACE=="string"?k.NAMESPACE:mt,vo=ke(k,"MATHML_TEXT_INTEGRATION_POINTS")&&k.MATHML_TEXT_INTEGRATION_POINTS&&typeof k.MATHML_TEXT_INTEGRATION_POINTS=="object"?_e(k.MATHML_TEXT_INTEGRATION_POINTS):ae({},["mi","mo","mn","ms","mtext"]),ko=ke(k,"HTML_INTEGRATION_POINTS")&&k.HTML_INTEGRATION_POINTS&&typeof k.HTML_INTEGRATION_POINTS=="object"?_e(k.HTML_INTEGRATION_POINTS):ae({},["annotation-xml"]);const _=ke(k,"CUSTOM_ELEMENT_HANDLING")&&k.CUSTOM_ELEMENT_HANDLING&&typeof k.CUSTOM_ELEMENT_HANDLING=="object"?_e(k.CUSTOM_ELEMENT_HANDLING):bn(null);if(ee=bn(null),ke(_,"tagNameCheck")&&Js(_.tagNameCheck)&&(ee.tagNameCheck=_.tagNameCheck),ke(_,"attributeNameCheck")&&Js(_.attributeNameCheck)&&(ee.attributeNameCheck=_.attributeNameCheck),ke(_,"allowCustomizedBuiltInElements")&&typeof _.allowCustomizedBuiltInElements=="boolean"&&(ee.allowCustomizedBuiltInElements=_.allowCustomizedBuiltInElements),ht&&(rn=!1),on&&(Lt=!0),Le&&(X=ae({},Ql),Q=bn(null),Le.html===!0&&(ae(X,Jl),ae(Q,ec)),Le.svg===!0&&(ae(X,$o),ae(Q,Ko),ae(Q,Ir)),Le.svgFilters===!0&&(ae(X,Go),ae(Q,Ko),ae(Q,Ir)),Le.mathMl===!0&&(ae(X,Yo),ae(Q,tc),ae(Q,Ir))),Je.tagCheck=null,Je.attributeCheck=null,ke(k,"ADD_TAGS")&&(typeof k.ADD_TAGS=="function"?Je.tagCheck=k.ADD_TAGS:Ve(k.ADD_TAGS)&&(X===Z&&(X=_e(X)),ae(X,k.ADD_TAGS,we))),ke(k,"ADD_ATTR")&&(typeof k.ADD_ATTR=="function"?Je.attributeCheck=k.ADD_ATTR:Ve(k.ADD_ATTR)&&(Q===ue&&(Q=_e(Q)),ae(Q,k.ADD_ATTR,we))),ke(k,"ADD_URI_SAFE_ATTR")&&Ve(k.ADD_URI_SAFE_ATTR)&&ae(Re,k.ADD_URI_SAFE_ATTR,we),ke(k,"FORBID_CONTENTS")&&Ve(k.FORBID_CONTENTS)&&(Ie===Qe&&(Ie=_e(Ie)),ae(Ie,k.FORBID_CONTENTS,we)),ke(k,"ADD_FORBID_CONTENTS")&&Ve(k.ADD_FORBID_CONTENTS)&&(Ie===Qe&&(Ie=_e(Ie)),ae(Ie,k.ADD_FORBID_CONTENTS,we)),le&&(X["#text"]=!0),pt&&ae(X,["html","head","body"]),X.table&&(ae(X,["tbody"]),delete ze.tbody),k.TRUSTED_TYPES_POLICY){if(typeof k.TRUSTED_TYPES_POLICY.createHTML!="function")throw pn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof k.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw pn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const K=C;C=k.TRUSTED_TYPES_POLICY;try{P=E("")}catch(fe){throw C=K,fe}}else C===void 0&&k.TRUSTED_TYPES_POLICY!==null&&(C=cb(h,o)),C&&typeof P=="string"&&(P=E(""));(M.uponSanitizeElement.length>0||M.uponSanitizeAttribute.length>0)&&X===Z&&(X=_e(X)),M.uponSanitizeAttribute.length>0&&Q===ue&&(Q=_e(Q)),Ue&&Ue(k),ln=k},Qs=ae({},[...$o,...Go,...Z2]),ea=ae({},[...Yo,...J2]),hh=function(k){let _=v(k);(!_||!_.tagName)&&(_={namespaceURI:an,tagName:"template"});const K=Zn(k.tagName),fe=Zn(_.tagName);return bo[k.namespaceURI]?k.namespaceURI===yr?_.namespaceURI===mt?K==="svg":_.namespaceURI===$e?K==="svg"&&(fe==="annotation-xml"||vo[fe]):!!Qs[K]:k.namespaceURI===$e?_.namespaceURI===mt?K==="math":_.namespaceURI===yr?K==="math"&&ko[fe]:!!ea[K]:k.namespaceURI===mt?_.namespaceURI===yr&&!ko[fe]||_.namespaceURI===$e&&!vo[fe]?!1:!ea[K]&&(ch[K]||!Qs[K]):!!(_n==="application/xhtml+xml"&&bo[k.namespaceURI]):!1},lt=function(k){fn(t.removed,{element:k});try{v(k).removeChild(k)}catch{g(k)}},Wt=function(k,_){try{fn(t.removed,{attribute:_.getAttributeNode(k),from:_})}catch{fn(t.removed,{attribute:null,from:_})}if(_.removeAttribute(k),k==="is")if(Lt||on)try{lt(_)}catch{}else try{_.setAttribute(k,"")}catch{}},ta=function(k){let _=null,K=null;if(zn)k="<remove></remove>"+k;else{const pe=Kl(k,/^[\r\n\t ]+/);K=pe&&pe[0]}_n==="application/xhtml+xml"&&an===mt&&(k='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+k+"</body></html>");const fe=C?E(k):k;if(an===mt)try{_=new d().parseFromString(fe,_n)}catch{}if(!_||!_.documentElement){_=R.createDocument(an,"template",null);try{_.documentElement.innerHTML=yo?P:fe}catch{}}const ce=_.body||_.documentElement;return k&&K&&ce.insertBefore(n.createTextNode(K),ce.childNodes[0]||null),an===mt?O.call(_,pt?"html":"body")[0]:pt?_.documentElement:ce},na=function(k){return D.call(k.ownerDocument||k,k,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},So=function(k){var _,K;k.normalize();const fe=D.call(k.ownerDocument||k,k,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null);let ce=fe.nextNode();for(;ce;){let Be=ce.data;Gt([H,W,$],rt=>{Be=hn(Be,rt," ")}),ce.data=Be,ce=fe.nextNode()}const pe=(_=(K=k.querySelectorAll)===null||K===void 0?void 0:K.call(k,"template"))!==null&&_!==void 0?_:[];Gt(Array.from(pe),Be=>{cn(Be.content)&&So(Be.content)})},br=function(k){const _=B?B(k):null;return typeof _!="string"||we(_)!=="form"?!1:typeof k.nodeName!="string"||typeof k.textContent!="string"||typeof k.removeChild!="function"||k.attributes!==w(k)||typeof k.removeAttribute!="function"||typeof k.setAttribute!="function"||typeof k.namespaceURI!="string"||typeof k.insertBefore!="function"||typeof k.hasChildNodes!="function"||k.nodeType!==F(k)||k.childNodes!==y(k)},cn=function(k){if(!F||typeof k!="object"||k===null)return!1;try{return F(k)===gt.documentFragment}catch{return!1}},vr=function(k){if(!F||typeof k!="object"||k===null)return!1;try{return typeof F(k)=="number"}catch{return!1}};function Et(J,k,_){Gt(J,K=>{K.call(t,k,_,ln)})}const ra=function(k){let _=null;if(Et(M.beforeSanitizeElements,k,null),br(k))return lt(k),!0;const K=we(B?B(k):k.nodeName);if(Et(M.uponSanitizeElement,k,{tagName:K,allowedTags:X}),At&&k.hasChildNodes()&&!vr(k.firstElementChild)&&Me(/<[/\w!]/g,k.innerHTML)&&Me(/<[/\w!]/g,k.textContent)||At&&k.namespaceURI===mt&&K==="style"&&vr(k.firstElementChild)||k.nodeType===gt.progressingInstruction||At&&k.nodeType===gt.comment&&Me(/<[/\w]/g,k.data))return lt(k),!0;if(ze[K]||!(Je.tagCheck instanceof Function&&Je.tagCheck(K))&&!X[K]){if(!ze[K]&&ia(K)&&(ee.tagNameCheck instanceof RegExp&&Me(ee.tagNameCheck,K)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(K)))return!1;if(le&&!Ie[K]){const ce=v(k),pe=y(k);if(pe&&ce){const Be=pe.length;for(let rt=Be-1;rt>=0;--rt){const ct=m(pe[rt],!0);ce.insertBefore(ct,x(k))}}}return lt(k),!0}return(F?F(k):k.nodeType)===gt.element&&!hh(k)||(K==="noscript"||K==="noembed"||K==="noframes")&&Me(/<\/no(script|embed|frames)/i,k.innerHTML)?(lt(k),!0):(ht&&k.nodeType===gt.text&&(_=k.textContent,Gt([H,W,$],ce=>{_=hn(_,ce," ")}),k.textContent!==_&&(fn(t.removed,{element:k.cloneNode()}),k.textContent=_)),Et(M.afterSanitizeElements,k,null),!1)},oa=function(k,_,K){if(Ae[_]||z&&(_==="id"||_==="name")&&(K in n||K in fh))return!1;const fe=Q[_]||Je.attributeCheck instanceof Function&&Je.attributeCheck(_,k);if(!(rn&&!Ae[_]&&Me(b,_))){if(!(xr&&Me(Y,_))){if(!fe||Ae[_]){if(!(ia(k)&&(ee.tagNameCheck instanceof RegExp&&Me(ee.tagNameCheck,k)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(k))&&(ee.attributeNameCheck instanceof RegExp&&Me(ee.attributeNameCheck,_)||ee.attributeNameCheck instanceof Function&&ee.attributeNameCheck(_,k))||_==="is"&&ee.allowCustomizedBuiltInElements&&(ee.tagNameCheck instanceof RegExp&&Me(ee.tagNameCheck,K)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(K))))return!1}else if(!Re[_]){if(!Me(se,hn(K,T,""))){if(!((_==="src"||_==="xlink:href"||_==="href")&&k!=="script"&&ql(K,"data:")===0&&It[k])){if(!(Mn&&!Me(oe,hn(K,T,"")))){if(K)return!1}}}}}}return!0},ph=ae({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ia=function(k){return!ph[Zn(k)]&&Me(ie,k)},sa=function(k){Et(M.beforeSanitizeAttributes,k,null);const _=k.attributes;if(!_||br(k))return;const K={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Q,forceKeepAttr:void 0};let fe=_.length;for(;fe--;){const ce=_[fe],pe=ce.name,Be=ce.namespaceURI,rt=ce.value,ct=we(pe),Co=rt;let De=pe==="value"?Co:U2(Co);if(K.attrName=ct,K.attrValue=De,K.keepAttr=!0,K.forceKeepAttr=void 0,Et(M.uponSanitizeAttribute,k,K),De=K.attrValue,G&&(ct==="id"||ct==="name")&&ql(De,ne)!==0&&(Wt(pe,k),De=ne+De),At&&Me(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,De)){Wt(pe,k);continue}if(ct==="attributename"&&Kl(De,"href")){Wt(pe,k);continue}if(K.forceKeepAttr)continue;if(!K.keepAttr){Wt(pe,k);continue}if(!Pn&&Me(/\/>/i,De)){Wt(pe,k);continue}ht&&Gt([H,W,$],la=>{De=hn(De,la," ")});const aa=we(k.nodeName);if(!oa(aa,ct,De)){Wt(pe,k);continue}if(C&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!Be)switch(h.getAttributeType(aa,ct)){case"TrustedHTML":{De=E(De);break}case"TrustedScriptURL":{De=C.createScriptURL(De);break}}if(De!==Co)try{Be?k.setAttributeNS(Be,pe,De):k.setAttribute(pe,De),br(k)?lt(k):Yl(t.removed)}catch{Wt(pe,k)}}Et(M.afterSanitizeAttributes,k,null)},kr=function(k){let _=null;const K=na(k);for(Et(M.beforeSanitizeShadowDOM,k,null);_=K.nextNode();)if(Et(M.uponSanitizeShadowNode,_,null),ra(_),sa(_),cn(_.content)&&kr(_.content),(F?F(_):_.nodeType)===gt.element){const ce=j?j(_):_.shadowRoot;cn(ce)&&(un(ce),kr(ce))}Et(M.afterSanitizeShadowDOM,k,null)},un=function(k){const _=F?F(k):k.nodeType;if(_===gt.element){const ce=j?j(k):k.shadowRoot;cn(ce)&&(un(ce),kr(ce))}const K=y?y(k):k.childNodes;if(!K)return;const fe=[];Gt(K,ce=>{fn(fe,ce)});for(const ce of fe)un(ce);if(_===gt.element){const ce=B?B(k):null;if(typeof ce=="string"&&we(ce)==="template"){const pe=k.content;cn(pe)&&un(pe)}}};return t.sanitize=function(J){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_=null,K=null,fe=null,ce=null;if(yo=!J,yo&&(J="<!-->"),typeof J!="string"&&!vr(J)&&(J=q2(J),typeof J!="string"))throw pn("dirty is not a string, aborting");if(!t.isSupported)return J;if(On||wo(k),t.removed=[],typeof J=="string"&&(de=!1),de){const rt=B?B(J):J.nodeName;if(typeof rt=="string"){const ct=we(rt);if(!X[ct]||ze[ct])throw pn("root node is forbidden and cannot be sanitized in-place")}if(br(J))throw pn("root node is clobbered and cannot be sanitized in-place");un(J)}else if(vr(J))_=ta("<!---->"),K=_.ownerDocument.importNode(J,!0),K.nodeType===gt.element&&K.nodeName==="BODY"||K.nodeName==="HTML"?_=K:_.appendChild(K),un(K);else{if(!Lt&&!ht&&!pt&&J.indexOf("<")===-1)return C&&sn?E(J):J;if(_=ta(J),!_)return Lt?null:sn?P:""}_&&zn&<(_.firstChild);const pe=na(de?J:_);for(;fe=pe.nextNode();)ra(fe),sa(fe),cn(fe.content)&&kr(fe.content);if(de)return ht&&So(J),J;if(Lt){if(ht&&So(_),on)for(ce=N.call(_.ownerDocument);_.firstChild;)ce.appendChild(_.firstChild);else ce=_;return(Q.shadowroot||Q.shadowrootmode)&&(ce=I.call(r,ce,!0)),ce}let Be=pt?_.outerHTML:_.innerHTML;return pt&&X["!doctype"]&&_.ownerDocument&&_.ownerDocument.doctype&&_.ownerDocument.doctype.name&&Me(sb,_.ownerDocument.doctype.name)&&(Be="<!DOCTYPE "+_.ownerDocument.doctype.name+`>
|
|
414
|
-
`+Be),ht&&Gt([H,W,$],rt=>{Be=hn(Be,rt," ")}),C&&sn?E(Be):Be},t.setConfig=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};wo(J),On=!0},t.clearConfig=function(){ln=null,On=!1},t.isValidAttribute=function(J,k,_){ln||wo({});const K=we(J),fe=we(k);return oa(K,fe,_)},t.addHook=function(J,k){typeof k=="function"&&fn(M[J],k)},t.removeHook=function(J,k){if(k!==void 0){const _=W2(M[J],k);return _===-1?void 0:H2(M[J],_,1)[0]}return Yl(M[J])},t.removeHooks=function(J){M[J]=[]},t.removeAllHooks=function(){M=rc()},t}var Te=vf(),ub=Te;Te.sanitize.bind(Te);Te.isSupported;Te.addHook.bind(Te);Te.removeHook.bind(Te);Te.removeHooks.bind(Te);Te.removeAllHooks.bind(Te);Te.setConfig.bind(Te);Te.clearConfig.bind(Te);Te.isValidAttribute.bind(Te);Te.version;Te.removed;function db(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const fb=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hb=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pb={};function oc(e,t){return(pb.jsx?hb:fb).test(e)}const mb=/[ \t\n\f\r]/g;function gb(e){return typeof e=="object"?e.type==="text"?ic(e.value):!1:ic(e)}function ic(e){return e.replace(mb,"")===""}class mr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}mr.prototype.normal={};mr.prototype.property={};mr.prototype.space=void 0;function kf(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new mr(n,r,t)}function Wi(e){return e.toLowerCase()}class Xe{constructor(t,n){this.attribute=n,this.property=t}}Xe.prototype.attribute="";Xe.prototype.booleanish=!1;Xe.prototype.boolean=!1;Xe.prototype.commaOrSpaceSeparated=!1;Xe.prototype.commaSeparated=!1;Xe.prototype.defined=!1;Xe.prototype.mustUseProperty=!1;Xe.prototype.number=!1;Xe.prototype.overloadedBoolean=!1;Xe.prototype.property="";Xe.prototype.spaceSeparated=!1;Xe.prototype.space=void 0;let xb=0;const re=nn(),Se=nn(),Hi=nn(),U=nn(),me=nn(),en=nn(),et=nn();function nn(){return 2**++xb}const Ui=Object.freeze(Object.defineProperty({__proto__:null,boolean:re,booleanish:Se,commaOrSpaceSeparated:et,commaSeparated:en,number:U,overloadedBoolean:Hi,spaceSeparated:me},Symbol.toStringTag,{value:"Module"})),qo=Object.keys(Ui);class zs extends Xe{constructor(t,n,r,o){let s=-1;if(super(t,n),sc(this,"space",o),typeof r=="number")for(;++s<qo.length;){const a=qo[s];sc(this,qo[s],(r&Ui[a])===Ui[a])}}}zs.prototype.defined=!0;function sc(e,t,n){n&&(e[t]=n)}function Dn(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const s=new zs(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Wi(r)]=r,n[Wi(s.attribute)]=r}return new mr(t,n,e.space)}const wf=Dn({properties:{ariaActiveDescendant:null,ariaAtomic:Se,ariaAutoComplete:null,ariaBusy:Se,ariaChecked:Se,ariaColCount:U,ariaColIndex:U,ariaColSpan:U,ariaControls:me,ariaCurrent:null,ariaDescribedBy:me,ariaDetails:null,ariaDisabled:Se,ariaDropEffect:me,ariaErrorMessage:null,ariaExpanded:Se,ariaFlowTo:me,ariaGrabbed:Se,ariaHasPopup:null,ariaHidden:Se,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:me,ariaLevel:U,ariaLive:null,ariaModal:Se,ariaMultiLine:Se,ariaMultiSelectable:Se,ariaOrientation:null,ariaOwns:me,ariaPlaceholder:null,ariaPosInSet:U,ariaPressed:Se,ariaReadOnly:Se,ariaRelevant:null,ariaRequired:Se,ariaRoleDescription:me,ariaRowCount:U,ariaRowIndex:U,ariaRowSpan:U,ariaSelected:Se,ariaSetSize:U,ariaSort:null,ariaValueMax:U,ariaValueMin:U,ariaValueNow:U,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Sf(e,t){return t in e?e[t]:t}function Cf(e,t){return Sf(e,t.toLowerCase())}const yb=Dn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:en,acceptCharset:me,accessKey:me,action:null,allow:null,allowFullScreen:re,allowPaymentRequest:re,allowUserMedia:re,alpha:re,alt:null,as:null,async:re,autoCapitalize:null,autoComplete:me,autoFocus:re,autoPlay:re,blocking:me,capture:null,charSet:null,checked:re,cite:null,className:me,closedBy:null,colorSpace:null,cols:U,colSpan:U,command:null,commandFor:null,content:null,contentEditable:Se,controls:re,controlsList:me,coords:U|en,crossOrigin:null,data:null,dateTime:null,decoding:null,default:re,defer:re,dir:null,dirName:null,disabled:re,download:Hi,draggable:Se,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:re,formTarget:null,headers:me,height:U,hidden:Hi,high:U,href:null,hrefLang:null,htmlFor:me,httpEquiv:me,id:null,imageSizes:null,imageSrcSet:null,inert:re,inputMode:null,integrity:null,is:null,isMap:re,itemId:null,itemProp:me,itemRef:me,itemScope:re,itemType:me,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:re,low:U,manifest:null,max:null,maxLength:U,media:null,method:null,min:null,minLength:U,multiple:re,muted:re,name:null,nonce:null,noModule:re,noValidate:re,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:re,optimum:U,pattern:null,ping:me,placeholder:null,playsInline:re,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:re,referrerPolicy:null,rel:me,required:re,reversed:re,rows:U,rowSpan:U,sandbox:me,scope:null,scoped:re,seamless:re,selected:re,shadowRootClonable:re,shadowRootCustomElementRegistry:re,shadowRootDelegatesFocus:re,shadowRootMode:null,shadowRootSerializable:re,shape:null,size:U,sizes:null,slot:null,span:U,spellCheck:Se,src:null,srcDoc:null,srcLang:null,srcSet:null,start:U,step:null,style:null,tabIndex:U,target:null,title:null,translate:null,type:null,typeMustMatch:re,useMap:null,value:Se,width:U,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:me,axis:null,background:null,bgColor:null,border:U,borderColor:null,bottomMargin:U,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:re,declare:re,event:null,face:null,frame:null,frameBorder:null,hSpace:U,leftMargin:U,link:null,longDesc:null,lowSrc:null,marginHeight:U,marginWidth:U,noResize:re,noHref:re,noShade:re,noWrap:re,object:null,profile:null,prompt:null,rev:null,rightMargin:U,rules:null,scheme:null,scrolling:Se,standby:null,summary:null,text:null,topMargin:U,valueType:null,version:null,vAlign:null,vLink:null,vSpace:U,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:re,disablePictureInPicture:re,disableRemotePlayback:re,exportParts:en,part:me,prefix:null,property:null,results:U,security:null,unselectable:null},space:"html",transform:Cf}),bb=Dn({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:et,accentHeight:U,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:U,amplitude:U,arabicForm:null,ascent:U,attributeName:null,attributeType:null,azimuth:U,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:U,by:null,calcMode:null,capHeight:U,className:me,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:U,diffuseConstant:U,direction:null,display:null,dur:null,divisor:U,dominantBaseline:null,download:re,dx:null,dy:null,edgeMode:null,editable:null,elevation:U,enableBackground:null,end:null,event:null,exponent:U,externalResourcesRequired:null,fill:null,fillOpacity:U,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:en,g2:en,glyphName:en,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:U,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:U,horizOriginX:U,horizOriginY:U,id:null,ideographic:U,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:U,k:U,k1:U,k2:U,k3:U,k4:U,kernelMatrix:et,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:U,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:U,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:U,overlineThickness:U,paintOrder:null,panose1:null,path:null,pathLength:U,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:me,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:U,pointsAtY:U,pointsAtZ:U,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:et,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:et,rev:et,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:et,requiredFeatures:et,requiredFonts:et,requiredFormats:et,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:U,specularExponent:U,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:U,strikethroughThickness:U,string:null,stroke:null,strokeDashArray:et,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:U,strokeOpacity:U,strokeWidth:null,style:null,surfaceScale:U,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:et,tabIndex:U,tableValues:null,target:null,targetX:U,targetY:U,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:et,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:U,underlineThickness:U,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:U,values:null,vAlphabetic:U,vMathematical:U,vectorEffect:null,vHanging:U,vIdeographic:U,version:null,vertAdvY:U,vertOriginX:U,vertOriginY:U,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:U,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Sf}),jf=Dn({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()}}),Tf=Dn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Cf}),Bf=Dn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),vb={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"},kb=/[A-Z]/g,ac=/-[a-z]/g,wb=/^data[-\w.:]+$/i;function Sb(e,t){const n=Wi(t);let r=t,o=Xe;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&wb.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(ac,jb);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!ac.test(s)){let a=s.replace(kb,Cb);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}o=zs}return new o(r,t)}function Cb(e){return"-"+e.toLowerCase()}function jb(e){return e.charAt(1).toUpperCase()}const Tb=kf([wf,yb,jf,Tf,Bf],"html"),_s=kf([wf,bb,jf,Tf,Bf],"svg");function Bb(e){return e.join(" ").trim()}function Ef(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mn={},Xo,lc;function Eb(){if(lc)return Xo;lc=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
415
|
-
`,c="/",d="*",h="",p="comment",m="declaration";function g(y,v){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];v=v||{};var j=1,w=1;function F(O){var I=O.match(t);I&&(j+=I.length);var M=O.lastIndexOf(u);w=~M?O.length-M:w+O.length}function B(){var O={line:j,column:w};return function(I){return I.position=new C(O),E(),I}}function C(O){this.start=O,this.end={line:j,column:w},this.source=v.source}C.prototype.content=y;function P(O){var I=new Error(v.source+":"+j+":"+w+": "+O);if(I.reason=O,I.filename=v.source,I.line=j,I.column=w,I.source=y,!v.silent)throw I}function A(O){var I=O.exec(y);if(I){var M=I[0];return F(M),y=y.slice(M.length),I}}function E(){A(n)}function L(O){var I;for(O=O||[];I=R();)I!==!1&&O.push(I);return O}function R(){var O=B();if(!(c!=y.charAt(0)||d!=y.charAt(1))){for(var I=2;h!=y.charAt(I)&&(d!=y.charAt(I)||c!=y.charAt(I+1));)++I;if(I+=2,h===y.charAt(I-1))return P("End of comment missing");var M=y.slice(2,I-2);return w+=2,F(M),y=y.slice(I),w+=2,O({type:p,comment:M})}}function D(){var O=B(),I=A(r);if(I){if(R(),!A(o))return P("property missing ':'");var M=A(s),H=O({type:m,property:x(I[0].replace(e,h)),value:M?x(M[0].replace(e,h)):h});return A(a),H}}function N(){var O=[];L(O);for(var I;I=D();)I!==!1&&(O.push(I),L(O));return O}return E(),N()}function x(y){return y?y.replace(l,h):h}return Xo=g,Xo}var cc;function Fb(){if(cc)return mn;cc=1;var e=mn&&mn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(mn,"__esModule",{value:!0}),mn.default=n;const t=e(Eb());function n(r,o){let s=null;if(!r||typeof r!="string")return s;const a=(0,t.default)(r),l=typeof o=="function";return a.forEach(u=>{if(u.type!=="declaration")return;const{property:c,value:d}=u;l?o(c,d,u):d&&(s=s||{},s[c]=d)}),s}return mn}var Hn={},uc;function Ab(){if(uc)return Hn;uc=1,Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(c){return!c||n.test(c)||e.test(c)},a=function(c,d){return d.toUpperCase()},l=function(c,d){return"".concat(d,"-")},u=function(c,d){return d===void 0&&(d={}),s(c)?c:(c=c.toLowerCase(),d.reactCompat?c=c.replace(o,l):c=c.replace(r,l),c.replace(t,a))};return Hn.camelCase=u,Hn}var Un,dc;function Lb(){if(dc)return Un;dc=1;var e=Un&&Un.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(Fb()),n=Ab();function r(o,s){var a={};return!o||typeof o!="string"||(0,t.default)(o,function(l,u){l&&u&&(a[(0,n.camelCase)(l,s)]=u)}),a}return r.default=r,Un=r,Un}var Ib=Lb();const Db=Ef(Ib),Ff=Af("end"),Ns=Af("start");function Af(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 Rb(e){const t=Ns(e),n=Ff(e);if(t&&n)return{start:t,end:n}}function tr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?fc(e.position):"start"in e||"end"in e?fc(e):"line"in e||"column"in e?$i(e):""}function $i(e){return hc(e&&e.line)+":"+hc(e&&e.column)}function fc(e){return $i(e&&e.start)+"-"+$i(e&&e.end)}function hc(e){return e&&typeof e=="number"?e:1}class Ne extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",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"?o=t:!s.cause&&t&&(a=!0,o=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.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=o,this.line=l?l.line:void 0,this.name=tr(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}}Ne.prototype.file="";Ne.prototype.name="";Ne.prototype.reason="";Ne.prototype.message="";Ne.prototype.stack="";Ne.prototype.column=void 0;Ne.prototype.line=void 0;Ne.prototype.ancestors=void 0;Ne.prototype.cause=void 0;Ne.prototype.fatal=void 0;Ne.prototype.place=void 0;Ne.prototype.ruleId=void 0;Ne.prototype.source=void 0;const Vs={}.hasOwnProperty,Mb=new Map,Pb=/[A-Z]/g,Ob=new Set(["table","tbody","thead","tfoot","tr"]),zb=new Set(["td","th"]),Lf="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function _b(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=Yb(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=Gb(n,t.jsx,t.jsxs)}const o={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"?_s:Tb,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=If(o,e,void 0);return s&&typeof s!="string"?s:o.create(e,o.Fragment,{children:s||void 0},void 0)}function If(e,t,n){if(t.type==="element")return Nb(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Vb(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Hb(e,t,n);if(t.type==="mdxjsEsm")return Wb(e,t);if(t.type==="root")return Ub(e,t,n);if(t.type==="text")return $b(e,t)}function Nb(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=_s,e.schema=o),e.ancestors.push(t);const s=Rf(e,t.tagName,!1),a=Kb(e,t);let l=Hs(e,t);return Ob.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!gb(u):!0})),Df(e,a,s,t),Ws(a,l),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function Vb(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)}cr(e,t.position)}function Wb(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);cr(e,t.position)}function Hb(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=_s,e.schema=o),e.ancestors.push(t);const s=t.name===null?e.Fragment:Rf(e,t.name,!0),a=qb(e,t),l=Hs(e,t);return Df(e,a,s,t),Ws(a,l),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function Ub(e,t,n){const r={};return Ws(r,Hs(e,t)),e.create(t,e.Fragment,r,n)}function $b(e,t){return t.value}function Df(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ws(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Gb(e,t,n){return r;function r(o,s,a,l){const c=Array.isArray(a.children)?n:t;return l?c(s,a,l):c(s,a)}}function Yb(e,t){return n;function n(r,o,s,a){const l=Array.isArray(s.children),u=Ns(r);return t(o,s,a,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Kb(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&Vs.call(t.properties,o)){const s=Xb(e,o,t.properties[o]);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 qb(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 cr(e,t.position);else{const o=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 cr(e,t.position);else s=r.value===null?!0:r.value;n[o]=s}return n}function Hs(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Mb;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys){const u=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(u){const c=o.get(u)||0;a=u+"-"+c,o.set(u,c+1)}}const l=If(e,s,a);l!==void 0&&n.push(l)}return n}function Xb(e,t,n){const r=Sb(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?db(n):Bb(n)),r.property==="style"){let o=typeof n=="object"?n:Zb(e,String(n));return e.stylePropertyNameCase==="css"&&(o=Jb(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?vb[r.property]||r.property:r.attribute,n]}}function Zb(e,t){try{return Db(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new Ne("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=Lf+"#cannot-parse-style-attribute",o}}function Rf(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let s=-1,a;for(;++s<o.length;){const l=oc(o[s])?{type:"Identifier",name:o[s]}:{type:"Literal",value:o[s]};a=a?{type:"MemberExpression",object:a,property:l,computed:!!(s&&l.type==="Literal"),optional:!1}:l}r=a}else r=oc(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return Vs.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);cr(e)}function cr(e,t){const n=new Ne("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=Lf+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Jb(e){const t={};let n;for(n in e)Vs.call(e,n)&&(t[Qb(n)]=e[n]);return t}function Qb(e){let t=e.replace(Pb,e5);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function e5(e){return"-"+e.toLowerCase()}const Zo={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"]},t5={};function n5(e,t){const n=t5,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Mf(e,r,o)}function Mf(e,t,n){if(r5(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 pc(e.children,t,n)}return Array.isArray(e)?pc(e,t,n):""}function pc(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=Mf(e[o],t,n);return r.join("")}function r5(e){return!!(e&&typeof e=="object")}const mc=document.createElement("i");function Us(e){const t="&"+e+";";mc.innerHTML=t;const n=mc.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Tt(e,t,n,r){const o=e.length;let s=0,a;if(t<0?t=-t>o?0:o+t:t=t>o?o: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 ot(e,t){return e.length>0?(Tt(e,e.length,0,t),e):t}const gc={}.hasOwnProperty;function o5(e){const t={};let n=-1;for(;++n<e.length;)i5(t,e[n]);return t}function i5(e,t){let n;for(n in t){const o=(gc.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){gc.call(o,a)||(o[a]=[]);const l=s[a];s5(o[a],Array.isArray(l)?l:l?[l]:[])}}}function s5(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Tt(e,0,0,r)}function Pf(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 Tn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const wt=Vt(/[A-Za-z]/),nt=Vt(/[\dA-Za-z]/),a5=Vt(/[#-'*+\--9=?A-Z^-~]/);function Gi(e){return e!==null&&(e<32||e===127)}const Yi=Vt(/\d/),l5=Vt(/[\dA-Fa-f]/),c5=Vt(/[!-/:-@[-`{-~]/);function te(e){return e!==null&&e<-2}function qe(e){return e!==null&&(e<0||e===32)}function he(e){return e===-2||e===-1||e===32}const u5=Vt(new RegExp("\\p{P}|\\p{S}","u")),d5=Vt(/\s/);function Vt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Rn(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&nt(e.charCodeAt(n+1))&&nt(e.charCodeAt(n+2)))o=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),o=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+o+1,a=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function xe(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(u){return he(u)?(e.enter(n),l(u)):t(u)}function l(u){return he(u)&&s++<o?(e.consume(u),l):(e.exit(n),t(u))}}const f5={tokenize:h5};function h5(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),xe(e,t,"linePrefix")}function o(l){return e.enter("paragraph"),s(l)}function s(l){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,a(l)}function a(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return te(l)?(e.consume(l),e.exit("chunkText"),s):(e.consume(l),a)}}const p5={tokenize:m5},xc={tokenize:g5};function m5(e){const t=this,n=[];let r=0,o,s,a;return l;function l(w){if(r<n.length){const F=n[r];return t.containerState=F[1],e.attempt(F[0].continuation,u,c)(w)}return c(w)}function u(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&j();const F=t.events.length;let B=F,C;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){C=t.events[B][1].end;break}v(r);let P=F;for(;P<t.events.length;)t.events[P][1].end={...C},P++;return Tt(t.events,B+1,0,t.events.slice(F)),t.events.length=P,c(w)}return l(w)}function c(w){if(r===n.length){if(!o)return p(w);if(o.currentConstruct&&o.currentConstruct.concrete)return g(w);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(xc,d,h)(w)}function d(w){return o&&j(),v(r),p(w)}function h(w){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,g(w)}function p(w){return t.containerState={},e.attempt(xc,m,g)(w)}function m(w){return r++,n.push([t.currentConstruct,t.containerState]),p(w)}function g(w){if(w===null){o&&j(),v(0),e.consume(w);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:s}),x(w)}function x(w){if(w===null){y(e.exit("chunkFlow"),!0),v(0),e.consume(w);return}return te(w)?(e.consume(w),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(w),x)}function y(w,F){const B=t.sliceStream(w);if(F&&B.push(null),w.previous=s,s&&(s.next=w),s=w,o.defineSkip(w.start),o.write(B),t.parser.lazy[w.start.line]){let C=o.events.length;for(;C--;)if(o.events[C][1].start.offset<a&&(!o.events[C][1].end||o.events[C][1].end.offset>a))return;const P=t.events.length;let A=P,E,L;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(E){L=t.events[A][1].end;break}E=!0}for(v(r),C=P;C<t.events.length;)t.events[C][1].end={...L},C++;Tt(t.events,A+1,0,t.events.slice(P)),t.events.length=C}}function v(w){let F=n.length;for(;F-- >w;){const B=n[F];t.containerState=B[1],B[0].exit.call(t,e)}n.length=w}function j(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function g5(e,t,n){return xe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function yc(e){if(e===null||qe(e)||d5(e))return 1;if(u5(e))return 2}function $s(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const s=e[o].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Ki={name:"attention",resolveAll:x5,tokenize:y5};function x5(e,t){let n=-1,r,o,s,a,l,u,c,d;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;u=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},p={...e[n][1].start};bc(h,-u),bc(p,u),a={type:u>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},s={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:u>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=ot(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ot(c,[["enter",o,t],["enter",a,t],["exit",a,t],["enter",s,t]]),c=ot(c,$s(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ot(c,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=ot(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Tt(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function y5(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=yc(r);let s;return a;function a(u){return s=u,e.enter("attentionSequence"),l(u)}function l(u){if(u===s)return e.consume(u),l;const c=e.exit("attentionSequence"),d=yc(u),h=!d||d===2&&o||n.includes(u),p=!o||o===2&&d||n.includes(r);return c._open=!!(s===42?h:h&&(o||!p)),c._close=!!(s===42?p:p&&(d||!h)),t(u)}}function bc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const b5={name:"autolink",tokenize:v5};function v5(e,t,n){let r=0;return o;function o(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(m){return wt(m)?(e.consume(m),a):m===64?n(m):c(m)}function a(m){return m===43||m===45||m===46||nt(m)?(r=1,l(m)):c(m)}function l(m){return m===58?(e.consume(m),r=0,u):(m===43||m===45||m===46||nt(m))&&r++<32?(e.consume(m),l):(r=0,c(m))}function u(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||Gi(m)?n(m):(e.consume(m),u)}function c(m){return m===64?(e.consume(m),d):a5(m)?(e.consume(m),c):n(m)}function d(m){return nt(m)?h(m):n(m)}function h(m){return m===46?(e.consume(m),r=0,d):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):p(m)}function p(m){if((m===45||nt(m))&&r++<63){const g=m===45?p:h;return e.consume(m),g}return n(m)}}const mo={partial:!0,tokenize:k5};function k5(e,t,n){return r;function r(s){return he(s)?xe(e,o,"linePrefix")(s):o(s)}function o(s){return s===null||te(s)?t(s):n(s)}}const Of={continuation:{tokenize:S5},exit:C5,name:"blockQuote",tokenize:w5};function w5(e,t,n){const r=this;return o;function o(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 he(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function S5(e,t,n){const r=this;return o;function o(a){return he(a)?xe(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(Of,t,n)(a)}}function C5(e){e.exit("blockQuote")}const zf={name:"characterEscape",tokenize:j5};function j5(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),o}function o(s){return c5(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const _f={name:"characterReference",tokenize:T5};function T5(e,t,n){const r=this;let o=0,s,a;return l;function l(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),u}function u(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,a=nt,d(h))}function c(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=l5,d):(e.enter("characterReferenceValue"),s=7,a=Yi,d(h))}function d(h){if(h===59&&o){const p=e.exit("characterReferenceValue");return a===nt&&!Us(r.sliceSerialize(p))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(h)&&o++<s?(e.consume(h),d):n(h)}}const vc={partial:!0,tokenize:E5},kc={concrete:!0,name:"codeFenced",tokenize:B5};function B5(e,t,n){const r=this,o={partial:!0,tokenize:B};let s=0,a=0,l;return u;function u(C){return c(C)}function c(C){const P=r.events[r.events.length-1];return s=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,l=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(C)}function d(C){return C===l?(a++,e.consume(C),d):a<3?n(C):(e.exit("codeFencedFenceSequence"),he(C)?xe(e,h,"whitespace")(C):h(C))}function h(C){return C===null||te(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(vc,x,F)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(C))}function p(C){return C===null||te(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(C)):he(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),xe(e,m,"whitespace")(C)):C===96&&C===l?n(C):(e.consume(C),p)}function m(C){return C===null||te(C)?h(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(C))}function g(C){return C===null||te(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(C)):C===96&&C===l?n(C):(e.consume(C),g)}function x(C){return e.attempt(o,F,y)(C)}function y(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),v}function v(C){return s>0&&he(C)?xe(e,j,"linePrefix",s+1)(C):j(C)}function j(C){return C===null||te(C)?e.check(vc,x,F)(C):(e.enter("codeFlowValue"),w(C))}function w(C){return C===null||te(C)?(e.exit("codeFlowValue"),j(C)):(e.consume(C),w)}function F(C){return e.exit("codeFenced"),t(C)}function B(C,P,A){let E=0;return L;function L(I){return C.enter("lineEnding"),C.consume(I),C.exit("lineEnding"),R}function R(I){return C.enter("codeFencedFence"),he(I)?xe(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)):A(I)}function N(I){return I===l?(E++,C.consume(I),N):E>=a?(C.exit("codeFencedFenceSequence"),he(I)?xe(C,O,"whitespace")(I):O(I)):A(I)}function O(I){return I===null||te(I)?(C.exit("codeFencedFence"),P(I)):A(I)}}}function E5(e,t,n){const r=this;return o;function o(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 Jo={name:"codeIndented",tokenize:A5},F5={partial:!0,tokenize:L5};function A5(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),xe(e,s,"linePrefix",5)(c)}function s(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?u(c):te(c)?e.attempt(F5,a,u)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||te(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),l)}function u(c){return e.exit("codeIndented"),t(c)}}function L5(e,t,n){const r=this;return o;function o(a){return r.parser.lazy[r.now().line]?n(a):te(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):xe(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):te(a)?o(a):n(a)}}const I5={name:"codeText",previous:R5,resolve:D5,tokenize:M5};function D5(e){let t=e.length-4,n=3,r,o;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;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function R5(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function M5(e,t,n){let r=0,o,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"),u(h))}function u(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),u):h===96?(s=e.enter("codeTextSequence"),o=0,d(h)):te(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||te(h)?(e.exit("codeTextData"),u(h)):(e.consume(h),c)}function d(h){return h===96?(e.consume(h),o++,d):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(s.type="codeTextData",c(h))}}class P5{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 o=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&$n(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),$n(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),$n(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);$n(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);$n(this.left,n.reverse())}}}function $n(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 Nf(e){const t={};let n=-1,r,o,s,a,l,u,c;const d=new P5(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,s=0,s<u.length&&u[s][1].type==="lineEndingBlank"&&(s+=2),s<u.length&&u[s][1].type==="content"))for(;++s<u.length&&u[s][1].type!=="content";)u[s][1].type==="chunkText"&&(u[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,O5(d,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,o=void 0;s--;)if(a=d.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(o&&(d.get(o)[1].type="lineEndingBlank"),a[1].type="lineEnding",o=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;o&&(r[1].end={...d.get(o)[1].start},l=d.slice(o,n),l.unshift(r),d.splice(o,n-o+1,l))}}return Tt(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function O5(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=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,u=[],c={};let d,h,p=-1,m=n,g=0,x=0;const y=[x];for(;m;){for(;e.get(++o)[1]!==m;);s.push(o),m._tokenizer||(d=r.sliceStream(m),m.next||d.push(null),h&&a.defineSkip(m.start),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=m,m=m.next}for(m=n;++p<l.length;)l[p][0]==="exit"&&l[p-1][0]==="enter"&&l[p][1].type===l[p-1][1].type&&l[p][1].start.line!==l[p][1].end.line&&(x=p+1,y.push(x),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(a.events=[],m?(m._tokenizer=void 0,m.previous=void 0):y.pop(),p=y.length;p--;){const v=l.slice(y[p],y[p+1]),j=s.pop();u.push([j,j+v.length-1]),e.splice(j,2,v)}for(u.reverse(),p=-1;++p<u.length;)c[g+u[p][0]]=g+u[p][1],g+=u[p][1]-u[p][0]-1;return c}const z5={resolve:N5,tokenize:V5},_5={partial:!0,tokenize:W5};function N5(e){return Nf(e),e}function V5(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(l)}function o(l){return l===null?s(l):te(l)?e.check(_5,a,s)(l):(e.consume(l),o)}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,o}}function W5(e,t,n){const r=this;return o;function o(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),xe(e,s,"linePrefix")}function s(a){if(a===null||te(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 Vf(e,t,n,r,o,s,a,l,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return h;function h(v){return v===60?(e.enter(r),e.enter(o),e.enter(s),e.consume(v),e.exit(s),p):v===null||v===32||v===41||Gi(v)?n(v):(e.enter(r),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),x(v))}function p(v){return v===62?(e.enter(s),e.consume(v),e.exit(s),e.exit(o),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===62?(e.exit("chunkString"),e.exit(l),p(v)):v===null||v===60||te(v)?n(v):(e.consume(v),v===92?g:m)}function g(v){return v===60||v===62||v===92?(e.consume(v),m):m(v)}function x(v){return!d&&(v===null||v===41||qe(v))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(r),t(v)):d<c&&v===40?(e.consume(v),d++,x):v===41?(e.consume(v),d--,x):v===null||v===32||v===40||Gi(v)?n(v):(e.consume(v),v===92?y:x)}function y(v){return v===40||v===41||v===92?(e.consume(v),x):x(v)}}function Wf(e,t,n,r,o,s){const a=this;let l=0,u;return c;function c(m){return e.enter(r),e.enter(o),e.consume(m),e.exit(o),e.enter(s),d}function d(m){return l>999||m===null||m===91||m===93&&!u||m===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(m):m===93?(e.exit(s),e.enter(o),e.consume(m),e.exit(o),e.exit(r),t):te(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===null||m===91||m===93||te(m)||l++>999?(e.exit("chunkString"),d(m)):(e.consume(m),u||(u=!he(m)),m===92?p:h)}function p(m){return m===91||m===92||m===93?(e.consume(m),l++,h):h(m)}}function Hf(e,t,n,r,o,s){let a;return l;function l(p){return p===34||p===39||p===40?(e.enter(r),e.enter(o),e.consume(p),e.exit(o),a=p===40?41:p,u):n(p)}function u(p){return p===a?(e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):(e.enter(s),c(p))}function c(p){return p===a?(e.exit(s),u(a)):p===null?n(p):te(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),xe(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===a||p===null||te(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?h:d)}function h(p){return p===a||p===92?(e.consume(p),d):d(p)}}function nr(e,t){let n;return r;function r(o){return te(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):he(o)?xe(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const H5={name:"definition",tokenize:$5},U5={partial:!0,tokenize:G5};function $5(e,t,n){const r=this;let o;return s;function s(m){return e.enter("definition"),a(m)}function a(m){return Wf.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return o=Tn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),u):n(m)}function u(m){return qe(m)?nr(e,c)(m):c(m)}function c(m){return Vf(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(U5,h,h)(m)}function h(m){return he(m)?xe(e,p,"whitespace")(m):p(m)}function p(m){return m===null||te(m)?(e.exit("definition"),r.parser.defined.push(o),t(m)):n(m)}}function G5(e,t,n){return r;function r(l){return qe(l)?nr(e,o)(l):n(l)}function o(l){return Hf(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return he(l)?xe(e,a,"whitespace")(l):a(l)}function a(l){return l===null||te(l)?t(l):n(l)}}const Y5={name:"hardBreakEscape",tokenize:K5};function K5(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return te(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const q5={name:"headingAtx",resolve:X5,tokenize:Z5};function X5(e,t){let n=e.length-2,r=3,o,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&&(o={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"},Tt(e,r,n-r+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function Z5(e,t,n){let r=0;return o;function o(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||qe(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||te(d)?(e.exit("atxHeading"),t(d)):he(d)?xe(e,l,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),l(d))}function c(d){return d===null||d===35||qe(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),c)}}const J5=["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"],wc=["pre","script","style","textarea"],Q5={concrete:!0,name:"htmlFlow",resolveTo:nv,tokenize:rv},ev={partial:!0,tokenize:iv},tv={partial:!0,tokenize:ov};function nv(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 rv(e,t,n){const r=this;let o,s,a,l,u;return c;function c(T){return d(T)}function d(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),h}function h(T){return T===33?(e.consume(T),p):T===47?(e.consume(T),s=!0,x):T===63?(e.consume(T),o=3,r.interrupt?t:b):wt(T)?(e.consume(T),a=String.fromCharCode(T),y):n(T)}function p(T){return T===45?(e.consume(T),o=2,m):T===91?(e.consume(T),o=5,l=0,g):wt(T)?(e.consume(T),o=4,r.interrupt?t:b):n(T)}function m(T){return T===45?(e.consume(T),r.interrupt?t:b):n(T)}function g(T){const ie="CDATA[";return T===ie.charCodeAt(l++)?(e.consume(T),l===ie.length?r.interrupt?t:D:g):n(T)}function x(T){return wt(T)?(e.consume(T),a=String.fromCharCode(T),y):n(T)}function y(T){if(T===null||T===47||T===62||qe(T)){const ie=T===47,se=a.toLowerCase();return!ie&&!s&&wc.includes(se)?(o=1,r.interrupt?t(T):D(T)):J5.includes(a.toLowerCase())?(o=6,ie?(e.consume(T),v):r.interrupt?t(T):D(T)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(T):s?j(T):w(T))}return T===45||nt(T)?(e.consume(T),a+=String.fromCharCode(T),y):n(T)}function v(T){return T===62?(e.consume(T),r.interrupt?t:D):n(T)}function j(T){return he(T)?(e.consume(T),j):L(T)}function w(T){return T===47?(e.consume(T),L):T===58||T===95||wt(T)?(e.consume(T),F):he(T)?(e.consume(T),w):L(T)}function F(T){return T===45||T===46||T===58||T===95||nt(T)?(e.consume(T),F):B(T)}function B(T){return T===61?(e.consume(T),C):he(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),u=T,P):he(T)?(e.consume(T),C):A(T)}function P(T){return T===u?(e.consume(T),u=null,E):T===null||te(T)?n(T):(e.consume(T),P)}function A(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||qe(T)?B(T):(e.consume(T),A)}function E(T){return T===47||T===62||he(T)?w(T):n(T)}function L(T){return T===62?(e.consume(T),R):n(T)}function R(T){return T===null||te(T)?D(T):he(T)?(e.consume(T),R):n(T)}function D(T){return T===45&&o===2?(e.consume(T),M):T===60&&o===1?(e.consume(T),H):T===62&&o===4?(e.consume(T),Y):T===63&&o===3?(e.consume(T),b):T===93&&o===5?(e.consume(T),$):te(T)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(ev,oe,N)(T)):T===null||te(T)?(e.exit("htmlFlowData"),N(T)):(e.consume(T),D)}function N(T){return e.check(tv,O,oe)(T)}function O(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),I}function I(T){return T===null||te(T)?N(T):(e.enter("htmlFlowData"),D(T))}function M(T){return T===45?(e.consume(T),b):D(T)}function H(T){return T===47?(e.consume(T),a="",W):D(T)}function W(T){if(T===62){const ie=a.toLowerCase();return wc.includes(ie)?(e.consume(T),Y):D(T)}return wt(T)&&a.length<8?(e.consume(T),a+=String.fromCharCode(T),W):D(T)}function $(T){return T===93?(e.consume(T),b):D(T)}function b(T){return T===62?(e.consume(T),Y):T===45&&o===2?(e.consume(T),b):D(T)}function Y(T){return T===null||te(T)?(e.exit("htmlFlowData"),oe(T)):(e.consume(T),Y)}function oe(T){return e.exit("htmlFlow"),t(T)}}function ov(e,t,n){const r=this;return o;function o(a){return te(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 iv(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(mo,t,n)}}const sv={name:"htmlText",tokenize:av};function av(e,t,n){const r=this;let o,s,a;return l;function l(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),u}function u(b){return b===33?(e.consume(b),c):b===47?(e.consume(b),B):b===63?(e.consume(b),w):wt(b)?(e.consume(b),A):n(b)}function c(b){return b===45?(e.consume(b),d):b===91?(e.consume(b),s=0,g):wt(b)?(e.consume(b),j):n(b)}function d(b){return b===45?(e.consume(b),m):n(b)}function h(b){return b===null?n(b):b===45?(e.consume(b),p):te(b)?(a=h,H(b)):(e.consume(b),h)}function p(b){return b===45?(e.consume(b),m):h(b)}function m(b){return b===62?M(b):b===45?p(b):h(b)}function g(b){const Y="CDATA[";return b===Y.charCodeAt(s++)?(e.consume(b),s===Y.length?x:g):n(b)}function x(b){return b===null?n(b):b===93?(e.consume(b),y):te(b)?(a=x,H(b)):(e.consume(b),x)}function y(b){return b===93?(e.consume(b),v):x(b)}function v(b){return b===62?M(b):b===93?(e.consume(b),v):x(b)}function j(b){return b===null||b===62?M(b):te(b)?(a=j,H(b)):(e.consume(b),j)}function w(b){return b===null?n(b):b===63?(e.consume(b),F):te(b)?(a=w,H(b)):(e.consume(b),w)}function F(b){return b===62?M(b):w(b)}function B(b){return wt(b)?(e.consume(b),C):n(b)}function C(b){return b===45||nt(b)?(e.consume(b),C):P(b)}function P(b){return te(b)?(a=P,H(b)):he(b)?(e.consume(b),P):M(b)}function A(b){return b===45||nt(b)?(e.consume(b),A):b===47||b===62||qe(b)?E(b):n(b)}function E(b){return b===47?(e.consume(b),M):b===58||b===95||wt(b)?(e.consume(b),L):te(b)?(a=E,H(b)):he(b)?(e.consume(b),E):M(b)}function L(b){return b===45||b===46||b===58||b===95||nt(b)?(e.consume(b),L):R(b)}function R(b){return b===61?(e.consume(b),D):te(b)?(a=R,H(b)):he(b)?(e.consume(b),R):E(b)}function D(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),o=b,N):te(b)?(a=D,H(b)):he(b)?(e.consume(b),D):(e.consume(b),O)}function N(b){return b===o?(e.consume(b),o=void 0,I):b===null?n(b):te(b)?(a=N,H(b)):(e.consume(b),N)}function O(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||qe(b)?E(b):(e.consume(b),O)}function I(b){return b===47||b===62||qe(b)?E(b):n(b)}function M(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function H(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),W}function W(b){return he(b)?xe(e,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):$(b)}function $(b){return e.enter("htmlTextData"),a(b)}}const Gs={name:"labelEnd",resolveAll:dv,resolveTo:fv,tokenize:hv},lv={tokenize:pv},cv={tokenize:mv},uv={tokenize:gv};function dv(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 o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&Tt(e,0,e.length,n),e}function fv(e,t){let n=e.length,r=0,o,s,a,l;for(;n--;)if(o=e[n][1],s){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(s=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(a=n);const u={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}},d={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[a-2][1].start}};return l=[["enter",u,t],["enter",c,t]],l=ot(l,e.slice(s+1,s+r+3)),l=ot(l,[["enter",d,t]]),l=ot(l,$s(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),l=ot(l,[["exit",d,t],e[a-2],e[a-1],["exit",c,t]]),l=ot(l,e.slice(a+1)),l=ot(l,[["exit",u,t]]),Tt(e,s,e.length,l),e}function hv(e,t,n){const r=this;let o=r.events.length,s,a;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){s=r.events[o][1];break}return l;function l(p){return s?s._inactive?h(p):(a=r.parser.defined.includes(Tn(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),u):n(p)}function u(p){return p===40?e.attempt(lv,d,a?d:h)(p):p===91?e.attempt(cv,d,a?c:h)(p):a?d(p):h(p)}function c(p){return e.attempt(uv,d,h)(p)}function d(p){return t(p)}function h(p){return s._balanced=!0,n(p)}}function pv(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),o}function o(h){return qe(h)?nr(e,s)(h):s(h)}function s(h){return h===41?d(h):Vf(e,a,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return qe(h)?nr(e,u)(h):d(h)}function l(h){return n(h)}function u(h){return h===34||h===39||h===40?Hf(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function c(h){return qe(h)?nr(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function mv(e,t,n){const r=this;return o;function o(l){return Wf.call(r,e,s,a,"reference","referenceMarker","referenceString")(l)}function s(l){return r.parser.defined.includes(Tn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function a(l){return n(l)}}function gv(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),o}function o(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const xv={name:"labelStartImage",resolveAll:Gs.resolveAll,tokenize:yv};function yv(e,t,n){const r=this;return o;function o(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 bv={name:"labelStartLink",resolveAll:Gs.resolveAll,tokenize:vv};function vv(e,t,n){const r=this;return o;function o(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 Qo={name:"lineEnding",tokenize:kv};function kv(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),xe(e,t,"linePrefix")}}const Ur={name:"thematicBreak",tokenize:wv};function wv(e,t,n){let r=0,o;return s;function s(c){return e.enter("thematicBreak"),a(c)}function a(c){return o=c,l(c)}function l(c){return c===o?(e.enter("thematicBreakSequence"),u(c)):r>=3&&(c===null||te(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===o?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),he(c)?xe(e,l,"whitespace")(c):l(c))}}const Ge={continuation:{tokenize:Tv},exit:Ev,name:"list",tokenize:jv},Sv={partial:!0,tokenize:Fv},Cv={partial:!0,tokenize:Bv};function jv(e,t,n){const r=this,o=r.events[r.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,a=0;return l;function l(m){const g=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Yi(m)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Ur,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(m)}return n(m)}function u(m){return Yi(m)&&++a<10?(e.consume(m),u):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(mo,r.interrupt?n:d,e.attempt(Sv,p,h))}function d(m){return r.containerState.initialBlankLine=!0,s++,p(m)}function h(m){return he(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function Tv(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(mo,o,s);function o(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,xe(e,t,"listItemIndent",r.containerState.size+1)(l)}function s(l){return r.containerState.furtherBlankLines||!he(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(Cv,t,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,xe(e,e.attempt(Ge,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Bv(e,t,n){const r=this;return xe(e,o,"listItemIndent",r.containerState.size+1);function o(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 Ev(e){e.exit(this.containerState.type)}function Fv(e,t,n){const r=this;return xe(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const a=r.events[r.events.length-1];return!he(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Sc={name:"setextUnderline",resolveTo:Av,tokenize:Lv};function Av(e,t){let n=e.length,r,o,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=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[o][1].type="setextHeadingText",s?(e.splice(o,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 Lv(e,t,n){const r=this;let o;return s;function s(c){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),o=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===o?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),he(c)?xe(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||te(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Iv={tokenize:Dv};function Dv(e){const t=this,n=e.attempt(mo,r,e.attempt(this.parser.constructs.flowInitial,o,xe(e,e.attempt(this.parser.constructs.flow,o,e.attempt(z5,o)),"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 o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Rv={resolveAll:$f()},Mv=Uf("string"),Pv=Uf("text");function Uf(e){return{resolveAll:$f(e==="text"?Ov:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],s=n.attempt(o,a,l);return a;function a(d){return c(d)?s(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return c(d)?(n.exit("data"),s(d)):(n.consume(d),u)}function c(d){if(d===null)return!0;const h=o[d];let p=-1;if(h)for(;++p<h.length;){const m=h[p];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function $f(e){return t;function t(n,r){let o=-1,s;for(;++o<=n.length;)s===void 0?n[o]&&n[o][1].type==="data"&&(s=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==s+2&&(n[s][1].end=n[o-1][1].end,n.splice(s+2,o-s-2),o=s+2),s=void 0);return e?e(n,r):n}}function Ov(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],o=t.sliceStream(r);let s=o.length,a=-1,l=0,u;for(;s--;){const c=o[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)u=!0,l++;else if(c!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const c={type:n===e.length||u||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:Ge,43:Ge,45:Ge,48:Ge,49:Ge,50:Ge,51:Ge,52:Ge,53:Ge,54:Ge,55:Ge,56:Ge,57:Ge,62:Of},_v={91:H5},Nv={[-2]:Jo,[-1]:Jo,32:Jo},Vv={35:q5,42:Ur,45:[Sc,Ur],60:Q5,61:Sc,95:Ur,96:kc,126:kc},Wv={38:_f,92:zf},Hv={[-5]:Qo,[-4]:Qo,[-3]:Qo,33:xv,38:_f,42:Ki,60:[b5,sv],91:bv,92:[Y5,zf],93:Gs,95:Ki,96:I5},Uv={null:[Ki,Rv]},$v={null:[42,95]},Gv={null:[]},Yv=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:$v,contentInitial:_v,disable:Gv,document:zv,flow:Vv,flowInitial:Nv,insideSpan:Uv,string:Wv,text:Hv},Symbol.toStringTag,{value:"Module"}));function Kv(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 o={},s=[];let a=[],l=[];const u={attempt:P(B),check:P(C),consume:j,enter:w,exit:F,interrupt:P(C,{interrupt:!0})},c={code:null,containerState:{},defineSkip:x,events:[],now:g,parser:e,previous:null,sliceSerialize:p,sliceStream:m,write:h};let d=t.tokenize.call(c,u);return t.resolveAll&&s.push(t),c;function h(R){return a=ot(a,R),y(),a[a.length-1]!==null?[]:(A(t,0),c.events=$s(s,c.events,c),c.events)}function p(R,D){return Xv(m(R),D)}function m(R){return qv(a,R)}function g(){const{_bufferIndex:R,_index:D,line:N,column:O,offset:I}=r;return{_bufferIndex:R,_index:D,line:N,column:O,offset:I}}function x(R){o[R.line]=R.column,L()}function y(){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;)v(D.charCodeAt(r._bufferIndex));else v(D)}}function v(R){d=d(R)}function j(R){te(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=g(),c.events.push(["enter",N,c]),l.push(N),N}function F(R){const D=l.pop();return D.end=g(),c.events.push(["exit",D,c]),D}function B(R,D){A(R,D.from)}function C(R,D){D.restore()}function P(R,D){return N;function N(O,I,M){let H,W,$,b;return Array.isArray(O)?oe(O):"tokenize"in O?oe([O]):Y(O);function Y(X){return Z;function Z(Q){const ue=Q!==null&&X[Q],ee=Q!==null&&X.null,ze=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return oe(ze)(Q)}}function oe(X){return H=X,W=0,X.length===0?M:T(X[W])}function T(X){return Z;function Z(Q){return b=E(),$=X,X.partial||(c.currentConstruct=X),X.name&&c.parser.constructs.disable.null.includes(X.name)?se():X.tokenize.call(D?Object.assign(Object.create(c),D):c,u,ie,se)(Q)}}function ie(X){return R($,b),I}function se(X){return b.restore(),++W<H.length?T(H[W]):M}}}function A(R,D){R.resolveAll&&!s.includes(R)&&s.push(R),R.resolve&&Tt(c.events,D,c.events.length-D,R.resolve(c.events.slice(D),c)),R.resolveTo&&(c.events=R.resolveTo(c.events,c))}function E(){const R=g(),D=c.previous,N=c.currentConstruct,O=c.events.length,I=Array.from(l);return{from:O,restore:M};function M(){r=R,c.previous=D,c.currentConstruct=N,c.events.length=O,l=I,L()}}function L(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function qv(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,s=t.end._bufferIndex;let a;if(n===o)a=[e[n].slice(r,s)];else{if(a=e.slice(n,o),r>-1){const l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}s>0&&a.push(e[o].slice(0,s))}return a}function Xv(e,t){let n=-1;const r=[];let o;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(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=`
|
|
416
416
|
`;break}case-3:{a=`\r
|
|
417
|
-
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&o)continue;a=" ";break}default:a=String.fromCharCode(s)}o=s===-2,r.push(a)}return r.join("")}function Zv(e){const r={constructs:o5([Yv,...(e||{}).extensions||[]]),content:o(f5),defined:[],document:o(p5),flow:o(Iv),lazy:{},string:o(Mv),text:o(Pv)};return r;function o(s){return a;function a(l){return Kv(r,s,l)}}}function Jv(e){for(;!Nf(e););return e}const Cc=/[\0\t\n\r]/g;function Qv(){let e=1,t="",n=!0,r;return o;function o(s,a,l){const u=[];let c,d,h,p,m;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(Cc.lastIndex=h,c=Cc.exec(s),p=c&&c.index!==void 0?c.index:s.length,m=s.charCodeAt(p),!c){t=s.slice(h);break}if(m===10&&h===p&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),h<p&&(u.push(s.slice(h,p)),e+=p-h),m){case 0:{u.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,u.push(-2);e++<d;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}h=p+1}return l&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const e4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function t4(e){return e.replace(e4,n4)}function n4(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),s=o===120||o===88;return Pf(n.slice(s?2:1),s?16:10)}return Us(n)||e}const Gf={}.hasOwnProperty;function r4(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),o4(n)(Jv(Zv(n).document().write(Qv()(e,t,!0))))}function o4(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(At),autolinkProtocol:E,autolinkEmail:E,atxHeading:s(rn),blockQuote:s(ee),characterEscape:E,characterReference:E,codeFenced:s(ze),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(ze,a),codeText:s(Ae,a),codeTextData:E,data:E,codeFlowValue:E,definition:s(Je),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(xr),hardBreakEscape:s(Mn),hardBreakTrailing:s(Mn),htmlFlow:s(Pn,a),htmlFlowData:E,htmlText:s(Pn,a),htmlTextData:E,image:s(ht),label:a,link:s(At),listItem:s(On),listItemValue:p,listOrdered:s(pt,h),listUnordered:s(pt),paragraph:s(zn),reference:T,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(rn),strong:s(Lt),thematicBreak:s(sn)},exit:{atxHeading:u(),atxHeadingSequence:B,autolink:u(),autolinkEmail:ue,autolinkProtocol:Q,blockQuote:u(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:X,characterReference:Z,codeFenced:u(y),codeFencedFence:x,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:L,codeIndented:u(v),codeText:u(I),codeTextData:L,data:L,definition:u(),definitionDestinationString:F,definitionLabelString:j,definitionTitleString:w,emphasis:u(),hardBreakEscape:u(D),hardBreakTrailing:u(D),htmlFlow:u(N),htmlFlowData:L,htmlText:u(O),htmlTextData:L,image:u(H),label:$,labelText:W,lineEnding:R,link:u(M),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ie,resourceDestinationString:b,resourceTitleString:Y,resource:oe,setextHeading:u(A),setextHeadingLineSequence:P,setextHeadingText:C,strong:u(),thematicBreak:u()}};Yf(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(z){let G={type:"root",children:[]};const ne={stack:[G],tokenStack:[],config:t,enter:l,exit:c,buffer:a,resume:d,data:n},le=[];let de=-1;for(;++de<z.length;)if(z[de][1].type==="listOrdered"||z[de][1].type==="listUnordered")if(z[de][0]==="enter")le.push(de);else{const Le=le.pop();de=o(z,Le,de)}for(de=-1;++de<z.length;){const Le=t[z[de][0]];Gf.call(Le,z[de][1].type)&&Le[z[de][1].type].call(Object.assign({sliceSerialize:z[de][2].sliceSerialize},ne),z[de][1])}if(ne.tokenStack.length>0){const Le=ne.tokenStack[ne.tokenStack.length-1];(Le[1]||jc).call(ne,void 0,Le[0])}for(G.position={start:Rt(z.length>0?z[0][1].start:{line:1,column:1,offset:0}),end:Rt(z.length>0?z[z.length-2][1].end:{line:1,column:1,offset:0})},de=-1;++de<t.transforms.length;)G=t.transforms[de](G)||G;return G}function o(z,G,ne){let le=G-1,de=-1,Le=!1,Ie,Qe,It,Dt;for(;++le<=ne;){const Re=z[le];switch(Re[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Re[0]==="enter"?de++:de--,Dt=void 0;break}case"lineEndingBlank":{Re[0]==="enter"&&(Ie&&!Dt&&!de&&!It&&(It=le),Dt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Dt=void 0}if(!de&&Re[0]==="enter"&&Re[1].type==="listItemPrefix"||de===-1&&Re[0]==="exit"&&(Re[1].type==="listUnordered"||Re[1].type==="listOrdered")){if(Ie){let Bt=le;for(Qe=void 0;Bt--;){const $e=z[Bt];if($e[1].type==="lineEnding"||$e[1].type==="lineEndingBlank"){if($e[0]==="exit")continue;Qe&&(z[Qe][1].type="lineEndingBlank",Le=!0),$e[1].type="lineEnding",Qe=Bt}else if(!($e[1].type==="linePrefix"||$e[1].type==="blockQuotePrefix"||$e[1].type==="blockQuotePrefixWhitespace"||$e[1].type==="blockQuoteMarker"||$e[1].type==="listItemIndent"))break}It&&(!Qe||It<Qe)&&(Ie._spread=!0),Ie.end=Object.assign({},Qe?z[Qe][1].start:Re[1].end),z.splice(Qe||le,0,["exit",Ie,Re[2]]),le++,ne++}if(Re[1].type==="listItemPrefix"){const Bt={type:"listItem",_spread:!1,start:Object.assign({},Re[1].start),end:void 0};Ie=Bt,z.splice(le,0,["enter",Bt,Re[2]]),le++,ne++,It=void 0,Dt=!0}}}return z[G][1]._spread=Le,ne}function s(z,G){return ne;function ne(le){l.call(this,z(le),le),G&&G.call(this,le)}}function a(){this.stack.push({type:"fragment",children:[]})}function l(z,G,ne){this.stack[this.stack.length-1].children.push(z),this.stack.push(z),this.tokenStack.push([G,ne||void 0]),z.position={start:Rt(G.start),end:void 0}}function u(z){return G;function G(ne){z&&z.call(this,ne),c.call(this,ne)}}function c(z,G){const ne=this.stack.pop(),le=this.tokenStack.pop();if(le)le[0].type!==z.type&&(G?G.call(this,z,le[0]):(le[1]||jc).call(this,z,le[0]));else throw new Error("Cannot close `"+z.type+"` ("+tr({start:z.start,end:z.end})+"): it’s not open");ne.position.end=Rt(z.end)}function d(){return n5(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function p(z){if(this.data.expectingFirstListItemValue){const G=this.stack[this.stack.length-2];G.start=Number.parseInt(this.sliceSerialize(z),10),this.data.expectingFirstListItemValue=void 0}}function m(){const z=this.resume(),G=this.stack[this.stack.length-1];G.lang=z}function g(){const z=this.resume(),G=this.stack[this.stack.length-1];G.meta=z}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const z=this.resume(),G=this.stack[this.stack.length-1];G.value=z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const z=this.resume(),G=this.stack[this.stack.length-1];G.value=z.replace(/(\r?\n|\r)$/g,"")}function j(z){const G=this.resume(),ne=this.stack[this.stack.length-1];ne.label=G,ne.identifier=Tn(this.sliceSerialize(z)).toLowerCase()}function w(){const z=this.resume(),G=this.stack[this.stack.length-1];G.title=z}function F(){const z=this.resume(),G=this.stack[this.stack.length-1];G.url=z}function B(z){const G=this.stack[this.stack.length-1];if(!G.depth){const ne=this.sliceSerialize(z).length;G.depth=ne}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function P(z){const G=this.stack[this.stack.length-1];G.depth=this.sliceSerialize(z).codePointAt(0)===61?1:2}function A(){this.data.setextHeadingSlurpLineEnding=void 0}function E(z){const ne=this.stack[this.stack.length-1].children;let le=ne[ne.length-1];(!le||le.type!=="text")&&(le=on(),le.position={start:Rt(z.start),end:void 0},ne.push(le)),this.stack.push(le)}function L(z){const G=this.stack.pop();G.value+=this.sliceSerialize(z),G.position.end=Rt(z.end)}function R(z){const G=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ne=G.children[G.children.length-1];ne.position.end=Rt(z.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(G.type)&&(E.call(this,z),L.call(this,z))}function D(){this.data.atHardBreak=!0}function N(){const z=this.resume(),G=this.stack[this.stack.length-1];G.value=z}function O(){const z=this.resume(),G=this.stack[this.stack.length-1];G.value=z}function I(){const z=this.resume(),G=this.stack[this.stack.length-1];G.value=z}function M(){const z=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";z.type+="Reference",z.referenceType=G,delete z.url,delete z.title}else delete z.identifier,delete z.label;this.data.referenceType=void 0}function H(){const z=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";z.type+="Reference",z.referenceType=G,delete z.url,delete z.title}else delete z.identifier,delete z.label;this.data.referenceType=void 0}function W(z){const G=this.sliceSerialize(z),ne=this.stack[this.stack.length-2];ne.label=t4(G),ne.identifier=Tn(G).toLowerCase()}function $(){const z=this.stack[this.stack.length-1],G=this.resume(),ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,ne.type==="link"){const le=z.children;ne.children=le}else ne.alt=G}function b(){const z=this.resume(),G=this.stack[this.stack.length-1];G.url=z}function Y(){const z=this.resume(),G=this.stack[this.stack.length-1];G.title=z}function oe(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function ie(z){const G=this.resume(),ne=this.stack[this.stack.length-1];ne.label=G,ne.identifier=Tn(this.sliceSerialize(z)).toLowerCase(),this.data.referenceType="full"}function se(z){this.data.characterReferenceType=z.type}function X(z){const G=this.sliceSerialize(z),ne=this.data.characterReferenceType;let le;ne?(le=Pf(G,ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):le=Us(G);const de=this.stack[this.stack.length-1];de.value+=le}function Z(z){const G=this.stack.pop();G.position.end=Rt(z.end)}function Q(z){L.call(this,z);const G=this.stack[this.stack.length-1];G.url=this.sliceSerialize(z)}function ue(z){L.call(this,z);const G=this.stack[this.stack.length-1];G.url="mailto:"+this.sliceSerialize(z)}function ee(){return{type:"blockquote",children:[]}}function ze(){return{type:"code",lang:null,meta:null,value:""}}function Ae(){return{type:"inlineCode",value:""}}function Je(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function xr(){return{type:"emphasis",children:[]}}function rn(){return{type:"heading",depth:0,children:[]}}function Mn(){return{type:"break"}}function Pn(){return{type:"html",value:""}}function ht(){return{type:"image",title:null,url:"",alt:null}}function At(){return{type:"link",title:null,url:"",children:[]}}function pt(z){return{type:"list",ordered:z.type==="listOrdered",start:null,spread:z._spread,children:[]}}function On(z){return{type:"listItem",spread:z._spread,checked:null,children:[]}}function zn(){return{type:"paragraph",children:[]}}function Lt(){return{type:"strong",children:[]}}function on(){return{type:"text",value:""}}function sn(){return{type:"thematicBreak"}}}function Rt(e){return{line:e.line,column:e.column,offset:e.offset}}function Yf(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Yf(e,r):i4(e,r)}}function i4(e,t){let n;for(n in t)if(Gf.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 jc(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+tr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+tr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+tr({start:t.start,end:t.end})+") is still open")}function s4(e){const t=this;t.parser=n;function n(r){return r4(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function a4(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 l4(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
418
|
-
`}]}function
|
|
419
|
-
`:"",r={},
|
|
420
|
-
`}),
|
|
421
|
-
`});const c={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,c),e.applyData(t,c)}function
|
|
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:`
|
|
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:`
|
|
422
422
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
|
|
423
|
-
`}]}}const
|
|
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:`
|
|
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
|
|
427
|
-
`},o),s}function n6(e,t){return e&&"run"in e?async function(n,r){const o=Rc(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Rc(n,{file:r,...e||t})}}function Mc(e){if(e)throw e}var ei,Pc;function r6(){if(Pc)return ei;Pc=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=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 d=e.call(c,"constructor"),h=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!d&&!h)return!1;var p;for(p in c);return typeof p>"u"||e.call(c,p)},a=function(c,d){n&&d.name==="__proto__"?n(c,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):c[d.name]=d.newValue},l=function(c,d){if(d==="__proto__")if(e.call(c,d)){if(r)return r(c,d).value}else return;return c[d]};return ei=function u(){var c,d,h,p,m,g,x=arguments[0],y=1,v=arguments.length,j=!1;for(typeof x=="boolean"&&(j=x,x=arguments[1]||{},y=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});y<v;++y)if(c=arguments[y],c!=null)for(d in c)h=l(x,d),p=l(c,d),x!==p&&(j&&p&&(s(p)||(m=o(p)))?(m?(m=!1,g=h&&o(h)?h:[]):g=h&&s(h)?h:{},a(x,{name:d,newValue:u(j,g,p)})):typeof p<"u"&&a(x,{name:d,newValue:p}));return x},ei}var o6=r6();const ti=Ef(o6);function Xi(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 i6(){const e=[],t={run:n,use:r};return t;function n(...o){let s=-1;const a=o.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);l(null,...o);function l(u,...c){const d=e[++s];let h=-1;if(u){a(u);return}for(;++h<o.length;)(c[h]===null||c[h]===void 0)&&(c[h]=o[h]);o=c,d?s6(d,l)(...c):a(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function s6(e,t){let n;return r;function r(...a){const l=e.length>a.length;let u;l&&a.push(o);try{u=e.apply(this,a)}catch(c){const d=c;if(l&&n)throw d;return o(d)}l||(u&&u.then&&typeof u.then=="function"?u.then(s,o):u instanceof Error?o(u):s(u))}function o(a,...l){n||(n=!0,t(a,...l))}function s(a){o(null,a)}}const bt={basename:a6,dirname:l6,extname:c6,join:u6,sep:"/"};function a6(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');gr(e);let n=0,r=-1,o=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else r<0&&(s=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,l=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else a<0&&(s=!0,a=o+1),l>-1&&(e.codePointAt(o)===t.codePointAt(l--)?l<0&&(r=o):(l=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function l6(e){if(gr(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 c6(e){gr(e);let t=e.length,n=-1,r=0,o=-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?o<0?o=t:s!==1&&(s=1):o>-1&&(s=-1)}return o<0||n<0||s===0||s===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function u6(...e){let t=-1,n;for(;++t<e.length;)gr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":d6(n)}function d6(e){gr(e);const t=e.codePointAt(0)===47;let n=f6(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function f6(e,t){let n="",r=0,o=-1,s=0,a=-1,l,u;for(;++a<=e.length;){if(a<e.length)l=e.codePointAt(a);else{if(l===47)break;l=47}if(l===47){if(!(o===a-1||s===1))if(o!==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(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),o=a,s=0;continue}}else if(n.length>0){n="",r=0,o=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,a):n=e.slice(o+1,a),r=a-o-1;o=a,s=0}else l===46&&s>-1?s++:s=-1}return n}function gr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const h6={cwd:p6};function p6(){return"/"}function Zi(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function m6(e){if(typeof e=="string")e=new URL(e);else if(!Zi(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 g6(e)}function g6(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 o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const ni=["history","path","basename","stem","extname","dirname"];class nh{constructor(t){let n;t?Zi(t)?n={path:t}:typeof t=="string"||x6(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":h6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ni.length;){const s=ni[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let o;for(o in n)ni.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?bt.basename(this.path):void 0}set basename(t){oi(t,"basename"),ri(t,"basename"),this.path=bt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?bt.dirname(this.path):void 0}set dirname(t){Oc(this.basename,"dirname"),this.path=bt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?bt.extname(this.path):void 0}set extname(t){if(ri(t,"extname"),Oc(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=bt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Zi(t)&&(t=m6(t)),oi(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?bt.basename(this.path,this.extname):void 0}set stem(t){oi(t,"stem"),ri(t,"stem"),this.path=bt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new Ne(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ri(e,t){if(e&&e.includes(bt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+bt.sep+"`")}function oi(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Oc(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function x6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const y6=(function(e){const r=this.constructor.prototype,o=r[e],s=function(){return o.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),b6={}.hasOwnProperty;class Zs extends y6{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=i6()}copy(){const t=new Zs;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ti(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ai("data",this.frozen),this.namespace[t]=n,this):b6.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ai("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 o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Mr(t),r=this.parser||this.Parser;return ii("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ii("process",this.parser||this.Parser),si("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(s,a){const l=Mr(t),u=r.parse(l);r.run(u,l,function(d,h,p){if(d||!h||!p)return c(d);const m=h,g=r.stringify(m,p);w6(g)?p.value=g:p.result=g,c(d,p)});function c(d,h){d||!h?a(d):s?s(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),ii("processSync",this.parser||this.Parser),si("processSync",this.compiler||this.Compiler),this.process(t,o),_c("processSync","process",n),r;function o(s,a){n=!0,Mc(s),r=a}}run(t,n,r){zc(t),this.freeze();const o=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 u=Mr(n);o.run(t,u,c);function c(d,h,p){const m=h||t;d?l(d):a?a(m):r(void 0,m,p)}}}runSync(t,n){let r=!1,o;return this.run(t,n,s),_c("runSync","run",r),o;function s(a,l){Mc(a),o=l,r=!0}}stringify(t,n){this.freeze();const r=Mr(n),o=this.compiler||this.Compiler;return si("stringify",o),zc(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(ai("use",this.frozen),t!=null)if(typeof t=="function")u(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")u(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...h]=c;u(d,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&&(o.settings=ti(!0,o.settings,c.settings))}function l(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const h=c[d];s(h)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function u(c,d){let h=-1,p=-1;for(;++h<r.length;)if(r[h][0]===c){p=h;break}if(p===-1)r.push([c,...d]);else if(d.length>0){let[m,...g]=d;const x=r[p][1];Xi(x)&&Xi(m)&&(m=ti(!0,x,m)),r[p]=[c,m,...g]}}}}const v6=new Zs().freeze();function ii(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function si(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ai(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 zc(e){if(!Xi(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function _c(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Mr(e){return k6(e)?e:new nh(e)}function k6(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function w6(e){return typeof e=="string"||S6(e)}function S6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const C6="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Nc=[],Vc={allowDangerousHtml:!0},j6=/^(https?|ircs?|mailto|xmpp)$/i,T6=[{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 B6(e){const t=E6(e),n=F6(e);return A6(t.runSync(t.parse(n),n),e)}function E6(e){const t=e.rehypePlugins||Nc,n=e.remarkPlugins||Nc,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Vc}:Vc;return v6().use(s4).use(n).use(n6,r).use(t)}function F6(e){const t=e.children||"",n=new nh;return typeof t=="string"&&(n.value=t),n}function A6(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,s=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||L6;for(const d of T6)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+C6+d.id,void 0);return th(e,c),_b(e,{Fragment:i.Fragment,components:o,ignoreInvalidStyle:!0,jsx:i.jsx,jsxs:i.jsxs,passKeys:!0,passNode:!0});function c(d,h,p){if(d.type==="raw"&&p&&typeof h=="number")return a?p.children.splice(h,1):p.children[h]={type:"text",value:d.value},h;if(d.type==="element"){let m;for(m in Zo)if(Object.hasOwn(Zo,m)&&Object.hasOwn(d.properties,m)){const g=d.properties[m],x=Zo[m];(x===null||x.includes(d.tagName))&&(d.properties[m]=u(String(g||""),m,d))}}if(d.type==="element"){let m=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!m&&r&&typeof h=="number"&&(m=!r(d,h,p)),m&&p&&typeof h=="number")return l&&d.children?p.children.splice(h,1,...d.children):p.children.splice(h,1),h}}}function L6(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||j6.test(e.slice(0,t))?e:""}const I6={blue:{solid:"#0685FF",ring:"#0685FF"},purple:{solid:"#7700CC",ring:"#7700CC"}};function D6({items:e,allowMultiple:t=!1,defaultOpenIds:n=[],colorScheme:r="blue",answerType:o="HTML",...s}){const a=I6[r],[l,u]=S.useState(new Set(n)),c=d=>{u(h=>{const p=new Set(h);return p.has(d)?p.delete(d):(t||p.clear(),p.add(d)),p})};return i.jsx(f.Box,{display:"flex",flexDirection:"column",gap:"4",...s,children:e.map(d=>{const h=l.has(d.id);return i.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:[i.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(d.id),"aria-expanded":h,children:[i.jsx(f.Box,{fontSize:"lg",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",flex:"1",lineHeight:"short",children:d.question}),i.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?i.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:i.jsx("rect",{x:"3",y:"8.25",width:"12",height:"1.5",rx:"0.75",fill:" var(--medix-form-text)"})}):i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:[i.jsx("rect",{x:"3",y:"8.25",width:"12",height:"1.5",rx:"0.75",fill:" var(--medix-form-text)"}),i.jsx("rect",{x:"8.25",y:"3",width:"1.5",height:"12",rx:"0.75",fill:" var(--medix-form-text)"})]})})]}),i.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:i.jsx(f.Box,{px:"6",pb:"6",pt:"0",fontSize:"md",color:"text.body",fontFamily:"var(--font-body)",lineHeight:"loose",children:typeof d.answer=="string"?o==="MD"?i.jsx(B6,{children:d.answer}):i.jsx("span",{dangerouslySetInnerHTML:{__html:ub.sanitize(d.answer)}}):d.answer})})]},d.id)})})}function R6({quote:e,authorName:t,authorTitle:n,authorAvatar:r,rating:o,...s}){return i.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:[o!==void 0&&i.jsx(f.Box,{display:"flex",gap:"0.5",children:Array.from({length:5}).map((a,l)=>i.jsx(f.Box,{as:"span",fontSize:"sm",color:l<o?"#F59E0B":"text.muted",children:"★"},l))}),i.jsxs(f.Box,{as:"blockquote",m:"0",fontSize:"sm",color:"text.body",fontFamily:"var(--font-body)",lineHeight:"loose",fontStyle:"italic",children:['"',e,'"']}),i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"3",mt:"auto",children:[r?i.jsx("img",{src:r,alt:t,style:{width:36,height:36,borderRadius:"50%",objectFit:"cover"}}):i.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()}),i.jsxs(f.Box,{children:[i.jsx(f.Box,{fontSize:"sm",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-body)",children:t}),n&&i.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:n})]})]})]})}const M6={blue:{solid:"#0685FF",token:"blue.500"},purple:{solid:"#7700CC",token:"purple.500"}};function P6(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 O6({title:e,excerpt:t,category:n,date:r,coverImage:o,href:s,onClick:a,colorScheme:l="blue",...u}){const c=!!(s||a),d=P6(r),h=M6[l],p={display:"block",textDecoration:"none",background:"transparent",border:"none",padding:0,cursor:c?"pointer":"default",textAlign:"left"},m=i.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,...u,children:[i.jsxs(f.Box,{position:"relative",overflow:"hidden",children:[o?i.jsx("img",{src:o,alt:e,style:{width:"100%",height:300,objectFit:"cover",display:"block",borderRadius:"20px"}}):i.jsx(f.Box,{borderRadius:"card",h:"300px",style:{background:"linear-gradient(135deg, #0685FF 0%, #7700CC 100%)",borderRadius:"20px"}}),d&&i.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:[i.jsx(f.Box,{style:{fontSize:22,fontWeight:700,color:h.solid,lineHeight:1,fontFamily:"var(--font-heading)"},children:d.day}),i.jsx(f.Box,{style:{fontSize:10,fontWeight:600,color:"#6B7280",letterSpacing:"0.08em",marginTop:2,fontFamily:"var(--font-body)"},children:d.weekday})]})]}),i.jsxs(f.Box,{px:"0",pt:"3",pb:"4",children:[n&&i.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}),i.jsx(f.Box,{fontSize:"md",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",lineHeight:"snug",mb:t?"2":"0",children:e}),t&&i.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?i.jsx("a",{href:s,style:p,onClick:a,children:m}):a?i.jsx("button",{type:"button",style:p,onClick:a,children:m}):m}function z6({columns:e,data:t,rowKey:n="id",isLoading:r=!1,emptyMessage:o="No data available",sortable:s=!1,sortKey:a,sortDirection:l="asc",onSort:u,striped:c=!0,onRowClick:d,caption:h,enablePagination:p=!1,pageSize:m=10,page:g,onPageChange:x,enableSearch:y=!1,searchPlaceholder:v="Search table...",searchQuery:j,onSearchChange:w,style:F,className:B,stickyFirstColumn:C=!1}){const[P,A]=S.useState(""),E=j??P,[L,R]=S.useState(1),D=g??L,[N,O]=S.useState(a),[I,M]=S.useState(l),H=a??N,W=a?l:I,$=Z=>{A(Z),R(1),w==null||w(Z)},b=Z=>{const Q=H===Z&&W==="asc"?"desc":"asc";O(Z),M(Q),u==null||u(Z,Q)},Y=Z=>{R(Z),x==null||x(Z)},oe=S.useMemo(()=>{if(!E.trim())return t;const Z=E.toLowerCase().trim();return t.filter(Q=>e.some(ue=>{const ee=Q[ue.key];return ee==null?!1:String(ee).toLowerCase().includes(Z)}))},[t,e,E]),T=S.useMemo(()=>!H||u?oe:[...oe].sort((Z,Q)=>{const ue=Z[H],ee=Q[H],ze=String(ue??""),Ae=String(ee??""),Je=ze.localeCompare(Ae,void 0,{numeric:!0,sensitivity:"base"});return W==="asc"?Je:-Je}),[oe,H,W,u]),ie=T.length,se=S.useMemo(()=>{if(!p)return T;const Z=(D-1)*m;return T.slice(Z,Z+m)},[T,p,D,m]),X=({colKey:Z})=>H!==Z?i.jsx(f.Text,{as:"span",opacity:.3,ml:"1",fontSize:"xs",children:"↕"}):i.jsx(f.Text,{as:"span",ml:"1",color:"text.heading",fontSize:"xs",children:W==="asc"?"↑":"↓"});return i.jsxs(f.Box,{border:"1px solid",borderColor:"border",borderRadius:"card",overflow:"hidden",bg:"bg.surface",boxShadow:"none",_dark:{boxShadow:"none"},style:F,className:B,children:[y&&i.jsx(f.Box,{p:"4",borderBottom:"1px solid",borderColor:"border",bg:"bg.surface",children:i.jsx(rs,{placeholder:v,value:E,onChange:Z=>$(Z.target.value),maxW:"360px"})}),i.jsx(f.Box,{overflowX:"auto",children:i.jsxs(f.Box,{as:"table",w:"full",style:{borderCollapse:"collapse"},"aria-label":h,children:[h&&i.jsx("caption",{style:{display:"none"},children:h}),i.jsx(f.Box,{as:"thead",children:i.jsx(f.Box,{as:"tr",bg:"bg.subtle",borderBottom:"1px solid",borderColor:"border",children:e.map((Z,Q)=>{const ue=C&&Q===0;return i.jsx(f.Box,{as:"th",py:"3",px:"4",textAlign:Z.align??"left",minW:Z.minWidth,fontSize:"xs",fontWeight:"600",letterSpacing:"0.05em",textTransform:"uppercase",color:"text.muted",fontFamily:"var(--font-body)",whiteSpace:"nowrap",userSelect:"none",cursor:Z.sortable||s?"pointer":"default",_hover:Z.sortable||s?{color:"text.heading"}:void 0,onClick:()=>Z.sortable||s?b(Z.key):void 0,"aria-sort":H===Z.key?W==="asc"?"ascending":"descending":void 0,position:ue?"sticky":void 0,left:ue?0:void 0,zIndex:ue?3:void 0,bg:ue?"bg.subtle":void 0,borderRight:ue?"1px solid":void 0,borderColor:ue?"border":void 0,boxShadow:ue?"2px 0 4px rgba(0, 0, 0, 0.05)":void 0,children:i.jsxs(f.Flex,{as:"span",align:"center",justify:Z.align==="right"?"flex-end":Z.align==="center"?"center":"flex-start",children:[Z.label,(Z.sortable||s)&&i.jsx(X,{colKey:Z.key})]})},Z.key)})})}),i.jsx(f.Box,{as:"tbody",children:r?Array.from({length:5}).map((Z,Q)=>i.jsx(f.Box,{as:"tr",borderBottom:"1px solid",borderColor:"border",children:e.map(ue=>i.jsx(f.Box,{as:"td",py:"3.5",px:"4",children:i.jsx(f.Box,{h:"4",bg:"bg.subtle",borderRadius:"full",w:`${60+Math.random()*30}%`,style:{animation:"medix-shimmer 1.5s infinite"}})},ue.key))},Q)):se.length===0?i.jsx(f.Box,{as:"tr",children:i.jsx("td",{colSpan:e.length,style:{textAlign:"center",padding:"48px 16px"},children:i.jsx(f.Text,{color:"text.muted",fontFamily:"var(--font-body)",fontSize:"sm",children:o})})}):se.map((Z,Q)=>{const ue=String(Z[n]??Q);return i.jsx(f.Box,{as:"tr",onClick:()=>d==null?void 0:d(Z,Q),bg:c&&Q%2===1?"bg.subtle":"transparent",borderBottom:"1px solid",borderColor:"border",cursor:d?"pointer":"default",transition:"background 0.15s ease",_hover:{bg:"bg.subtle"},children:e.map((ee,ze)=>{const Ae=C&&ze===0;return i.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:Ae?"sticky":void 0,left:Ae?0:void 0,zIndex:Ae?2:void 0,bg:Ae?c&&Q%2===1?"bg.subtle":"bg.surface":void 0,borderRight:Ae?"1px solid":void 0,borderColor:Ae?"border":void 0,boxShadow:Ae?"2px 0 4px rgba(0, 0, 0, 0.05)":void 0,children:ee.render?ee.render(Z[ee.key],Z,Q):String(Z[ee.key]??"—")},ee.key)})},ue)})})]})}),p&&i.jsxs(f.Flex,{p:"4",borderTop:"1px solid",borderColor:"border",bg:"bg.surface",align:"center",justify:"space-between",flexWrap:"wrap",gap:"4",children:[i.jsxs(f.Text,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:["Showing ",ie===0?0:(D-1)*m+1," to"," ",Math.min(D*m,ie)," of ",ie," entries"]}),i.jsx(cf,{total:ie,pageSize:m,currentPage:D,onChange:Y,compact:!0})]})]})}function _6({name:e,specialty:t,location:n,avatar:r,rating:o,reviewCount:s,experience:a,consultationFee:l,isVerified:u=!1,isAvailable:c=!1,availabilityLabel:d="Available",onBookClick:h,onViewClick:p,variant:m="standard",...g}){return m==="featured"?i.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",...g,children:[r?i.jsx("img",{src:r,alt:e,style:{width:"100%",height:240,objectFit:"cover",display:"block"}}):i.jsx(f.Box,{w:"100%",h:"240px",bg:"blue.100",display:"flex",alignItems:"center",justifyContent:"center",children:i.jsx(f.Box,{fontSize:"4xl",fontWeight:"bold",color:"blue.500",children:e.charAt(0)})}),i.jsxs(f.Box,{p:"5",display:"flex",flexDirection:"column",gap:"4",children:[i.jsxs(f.Box,{children:[i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",flexWrap:"wrap",children:[i.jsx(f.Box,{fontSize:"xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",children:e}),u&&i.jsx(Ct,{label:"This practitioner's identity has been verified by MedixDeck",placement:"top",children:i.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:[i.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"}),i.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"})]})})]}),i.jsxs(f.Box,{fontSize:"md",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:[t,n?` • ${n}`:""]})]}),i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"4",mt:"1",children:[c&&i.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:[i.jsx(f.Box,{w:"1.5",h:"1.5",borderRadius:"full",bg:"status.success"}),d]}),c&&a&&i.jsx(f.Box,{w:"1px",h:"20px",bg:"border"}),a&&i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",fontSize:"sm",color:"text.heading",children:[i.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:[i.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),i.jsx("path",{d:"M9 12l2 2 4-4"})]}),a]})]}),i.jsx(f.Box,{borderTop:"1px solid",borderColor:"border",my:"1"}),i.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[l&&i.jsxs(f.Box,{children:[i.jsx(f.Box,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:"Consultation fee"}),i.jsx(f.Box,{fontSize:"xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",children:l})]}),i.jsxs(f.Box,{display:"flex",gap:"3",alignItems:"center",children:[p&&i.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:p,children:"view"}),h&&i.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"})]})]})]})]}):m==="compact"?i.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"},...g,children:[i.jsxs(f.Box,{display:"flex",gap:"4",alignItems:"flex-start",justifyContent:"space-between",children:[i.jsxs(f.Box,{display:"flex",gap:"4",children:[i.jsx(f.Box,{flexShrink:0,children:r?i.jsx("img",{src:r,alt:e,style:{width:64,height:64,borderRadius:"50%",objectFit:"cover",display:"block"}}):i.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)})}),i.jsxs(f.Box,{pt:"1",children:[i.jsx(f.Box,{fontSize:"xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",children:e}),i.jsxs(f.Box,{fontSize:"md",color:"text.muted",fontFamily:"var(--font-body)",children:[t,n&&m!=="compact"?` • ${n}`:""]})]})]}),p&&i.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:p,pt:"1",children:"View"})]}),i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1.5",fontSize:"md",color:"text.muted",fontFamily:"var(--font-body)",children:[i.jsx(f.Box,{as:"span",color:"status.warning",mt:"-2px",children:i.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor",children:i.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.jsxs(f.Box,{as:"span",color:"text.heading",mr:"1",children:[(o==null?void 0:o.toFixed(1))||"New"," ",s?`(${s})`:""]}),n&&i.jsxs(f.Box,{as:"span",children:[" • ",n]}),a&&i.jsxs(f.Box,{as:"span",children:[" • ",a]})]}),i.jsx(f.Box,{borderTop:"1px solid",borderColor:"border",mt:"1"}),i.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"1",children:[l&&i.jsxs(f.Box,{children:[i.jsx(f.Box,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:"Consultation fee"}),i.jsx(f.Box,{fontSize:"xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",children:l})]}),h&&i.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"})]})]}):i.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"},...g,children:[i.jsxs(f.Box,{display:"flex",gap:"4",alignItems:"flex-start",justifyContent:"space-between",children:[i.jsxs(f.Box,{display:"flex",gap:"4",minW:"0",flex:"1",children:[i.jsx(f.Box,{flexShrink:0,children:r?i.jsx("img",{src:r,alt:e,style:{width:64,height:64,borderRadius:"50%",objectFit:"cover",display:"block"}}):i.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)})}),i.jsxs(f.Box,{pt:"1",minW:"0",flex:"1",children:[i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",minW:"0",children:[i.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}),u&&i.jsx(Ct,{label:"This practitioner's identity has been verified by MedixDeck",placement:"top",children:i.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:[i.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"}),i.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"})]})})]}),i.jsxs(f.Box,{fontSize:"md",color:"text.muted",fontFamily:"var(--font-body)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:[t,n?` • ${n}`:""]})]})]}),i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1",fontSize:"md",color:"text.heading",fontFamily:"var(--font-body)",pt:"1",children:[i.jsx(f.Box,{as:"span",color:"status.warning",mt:"-2px",children:i.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor",children:i.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==null?void 0:o.toFixed(1))||"New"," ",s?i.jsxs(f.Box,{as:"span",color:"text.muted",children:["(",s,")"]}):null]})]}),i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"4",mt:"1",children:[c&&i.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:[i.jsx(f.Box,{w:"1.5",h:"1.5",borderRadius:"full",bg:"status.success"}),d]}),c&&a&&i.jsx(f.Box,{w:"1px",h:"20px",bg:"border"}),a&&i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",fontSize:"sm",color:"text.heading",children:[i.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:[i.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),i.jsx("path",{d:"M9 12l2 2 4-4"})]}),a]})]}),i.jsx(f.Box,{borderTop:"1px solid",borderColor:"border",my:"1"}),i.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"1",children:[l&&i.jsxs(f.Box,{children:[i.jsx(f.Box,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:"Consultation fee"}),i.jsx(f.Box,{fontSize:"xl",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-heading)",children:l})]}),i.jsxs(f.Box,{display:"flex",gap:"3",alignItems:"center",children:[p&&i.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:p,children:"view"}),h&&i.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 N6={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:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:[i.jsx("circle",{cx:"12",cy:"12",r:"11",fill:"var(--chakra-colors-status-success)"}),i.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:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:[i.jsx("path",{d:"M12 2L2 21h20L12 2z",fill:"var(--chakra-colors-status-warning)"}),i.jsx("path",{d:"M12 9v5",stroke:"white",strokeWidth:"2.2",strokeLinecap:"round"}),i.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:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:[i.jsx("path",{d:"M8.5 2h7l6.5 6.5v7L15.5 22h-7L2 15.5v-7L8.5 2z",fill:"var(--chakra-colors-status-error)"}),i.jsx("path",{d:"M12 7v6",stroke:"white",strokeWidth:"2.2",strokeLinecap:"round"}),i.jsx("circle",{cx:"12",cy:"16.5",r:"1",fill:"white"})]})}};function V6({label:e,value:t,unit:n,status:r="normal",...o}){const s=N6[r];return i.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,...o,children:[i.jsx("span",{"aria-label":s.ariaLabel,style:{display:"inline-flex",alignItems:"center",flexShrink:0},children:s.icon}),i.jsxs(f.Box,{children:[i.jsx(f.Box,{fontSize:"2xs",color:"text.muted",fontFamily:"var(--font-body)",textTransform:"uppercase",letterSpacing:"wide",children:e}),i.jsxs(f.Box,{display:"flex",alignItems:"baseline",gap:"1",children:[i.jsx(f.Box,{fontSize:"md",fontWeight:"bold",color:"text.heading",fontFamily:"var(--font-mono, monospace)",children:t}),n&&i.jsx(f.Box,{fontSize:"xs",color:s.text,fontFamily:"var(--font-body)",children:n})]})]})]})}const W6={upcoming:{label:"Upcoming",color:"info"},completed:{label:"Completed",color:"success"},cancelled:{label:"Cancelled",color:"error"}};function H6({doctorName:e,doctorSpecialty:t,doctorAvatar:n,date:r,time:o,type:s="video",status:a="upcoming",onCancel:l,onReschedule:u,onJoin:c,...d}){const h=W6[a];return i.jsxs(f.Box,{bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",p:"5",display:"flex",flexDirection:"column",gap:"4",...d,children:[i.jsxs(f.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"3",children:[n?i.jsx("img",{src:n,alt:e,style:{width:40,height:40,borderRadius:"50%",objectFit:"cover",display:"block"}}):i.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)}),i.jsxs(f.Box,{children:[i.jsx(f.Box,{fontSize:"md",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",children:e}),t&&i.jsx(f.Box,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",children:t})]})]}),i.jsx(ts,{status:h.color,size:"sm",children:h.label})]}),i.jsxs(f.Box,{display:"flex",gap:"4",py:"3",borderTop:"1px solid",borderBottom:"1px solid",borderColor:"border",children:[i.jsxs(f.Box,{children:[i.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:"Date"}),i.jsx(f.Box,{fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:r})]}),i.jsxs(f.Box,{children:[i.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:"Time"}),i.jsx(f.Box,{fontSize:"sm",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:o})]}),i.jsxs(f.Box,{children:[i.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:"Type"}),i.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"&&i.jsxs(f.Box,{display:"flex",gap:"2",children:[c&&i.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"}),u&&i.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:u,children:"Reschedule"}),l&&i.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 U6={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)"}},$6=()=>i.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:[i.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"}),i.jsx("path",{d:"m8.5 8.5 7 7"})]}),G6=()=>i.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:[i.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),i.jsx("polyline",{points:"7 10 12 15 17 10"}),i.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),Wc=()=>i.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:[i.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),i.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),i.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),i.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]});function Y6({rxId:e,doctorName:t,doctorSpecialty:n,issuedDate:r,expiryDate:o,drugs:s,refillsRemaining:a,status:l="active",colorScheme:u="blue",onDownload:c,...d}){const h=U6[l],p=u==="purple"?"#7700CC":"#0685FF",m=u==="purple"?"color-mix(in srgb, #7700CC 8%, transparent)":"color-mix(in srgb, #0685FF 8%, transparent)";return i.jsxs(f.Box,{bg:"bg.surface",border:"1px solid",borderColor:"border",borderRadius:"card",overflow:"hidden",...d,children:[i.jsxs(f.Box,{px:"5",py:"3.5",display:"flex",alignItems:"center",justifyContent:"space-between",style:{borderBottom:"1px solid var(--chakra-colors-border)",background:m},children:[i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",children:[i.jsx(f.Box,{style:{color:p},children:i.jsx($6,{})}),i.jsx(f.Box,{fontSize:"sm",fontWeight:"700",fontFamily:"var(--font-heading)",style:{color:p},children:"Prescription"}),e&&i.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:e})]}),i.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:[i.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:h.color,display:"inline-block"}}),h.label]})]}),i.jsxs(f.Box,{px:"5",py:"3",display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid",borderColor:"border",flexWrap:"wrap",gap:"2",children:[i.jsxs(f.Box,{children:[i.jsx(f.Box,{fontSize:"sm",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",children:t}),n&&i.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:n})]}),i.jsxs(f.Box,{display:"flex",gap:"4",children:[i.jsxs(f.Box,{children:[i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1",color:"text.muted",children:[i.jsx(Wc,{}),i.jsx(f.Box,{fontSize:"xs",fontFamily:"var(--font-body)",children:"Issued"})]}),i.jsx(f.Box,{fontSize:"xs",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:r})]}),o&&i.jsxs(f.Box,{children:[i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"1",color:"text.muted",children:[i.jsx(Wc,{}),i.jsx(f.Box,{fontSize:"xs",fontFamily:"var(--font-body)",children:"Expires"})]}),i.jsx(f.Box,{fontSize:"xs",fontWeight:"medium",color:"text.heading",fontFamily:"var(--font-body)",children:o})]})]})]}),i.jsx(f.Box,{px:"5",py:"4",display:"flex",flexDirection:"column",gap:"3",children:s.map((g,x)=>i.jsxs(f.Box,{display:"flex",alignItems:"flex-start",gap:"3",p:"3",borderRadius:"md",bg:"bg.subtle",border:"1px solid",borderColor:"border",children:[i.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"50%",background:m,color:p,fontSize:11,fontWeight:700,fontFamily:"var(--font-heading)",flexShrink:0,marginTop:1},children:x+1}),i.jsxs(f.Box,{flex:"1",minW:"0",children:[i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",flexWrap:"wrap",children:[i.jsx(f.Box,{fontSize:"sm",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",children:g.name}),i.jsx("span",{style:{padding:"1px 6px",borderRadius:4,fontSize:11,fontWeight:600,background:m,color:p,fontFamily:"var(--font-body)"},children:g.dosage})]}),i.jsxs(f.Box,{display:"flex",gap:"3",mt:"1",flexWrap:"wrap",children:[i.jsxs(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:["🕐 ",g.frequency]}),g.duration&&i.jsxs(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:["📅 ",g.duration]}),g.instructions&&i.jsxs(f.Box,{fontSize:"xs",color:"text.body",fontFamily:"var(--font-body)",fontStyle:"italic",children:["ℹ️ ",g.instructions]})]})]})]},x))}),i.jsxs(f.Box,{px:"5",py:"3",display:"flex",alignItems:"center",justifyContent:"space-between",borderTop:"1px solid",borderColor:"border",children:[a!==void 0?i.jsxs(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:[i.jsx(f.Box,{as:"span",fontWeight:"semibold",color:"text.heading",children:a})," ","refill",a!==1?"s":""," remaining"]}):i.jsx(f.Box,{}),c&&i.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:p,background:m,border:"none",cursor:"pointer",transition:"opacity 0.15s"},onMouseEnter:g=>{g.currentTarget.style.opacity="0.8"},onMouseLeave:g=>{g.currentTarget.style.opacity="1"},children:[i.jsx(G6,{}),"Download"]})]})]})}const K6={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 rh({code:e,description:t,category:n="primary",...r}){const o=K6[n];return i.jsxs(f.Box,{display:"inline-flex",alignItems:"center",gap:"1.5",...r,children:[i.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:o.bg,color:o.color,border:`1px solid ${o.border}`,cursor:t?"help":"default",whiteSpace:"nowrap"},children:e}),t&&i.jsx(f.Box,{as:"span",fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:t})]})}function oh({bloodType:e,...t}){return i.jsx(f.Box,{display:"inline-flex",alignItems:"center",...t,children:i.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:[i.jsx("svg",{width:"10",height:"12",viewBox:"0 0 12 16",fill:"currentColor","aria-hidden":"true",children:i.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 q6={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 ih({allergen:e,severity:t="mild",...n}){const r=q6[t];return i.jsx(f.Box,{display:"inline-flex",alignItems:"center",...n,children:i.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:[i.jsx("span",{"aria-hidden":"true",children:r.icon}),e,i.jsxs("span",{style:{opacity:.7,fontSize:10},children:["· ",r.label]})]})})}function X6({diagnoses:e,bloodType:t,allergies:n,direction:r="row",...o}){return i.jsxs(f.Box,{display:"flex",flexDirection:r,flexWrap:"wrap",gap:"2",alignItems:r==="row"?"center":"flex-start",...o,children:[t&&i.jsx(oh,{bloodType:t}),e==null?void 0:e.map((s,a)=>i.jsx(rh,{code:s.code,description:s.description,category:s.category},a)),n==null?void 0:n.map((s,a)=>i.jsx(ih,{allergen:s.allergen,severity:s.severity},a))]})}var sh={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Hc=S.createContext&&S.createContext(sh),Z6=["attr","size","title"];function J6(e,t){if(e==null)return{};var n,r,o=Q6(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)&&(o[n]=e[n])}return o}function Q6(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 so(){return so=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},so.apply(null,arguments)}function Uc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ao(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Uc(Object(n),!0).forEach(function(r){e3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function e3(e,t,n){return(t=t3(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t3(e){var t=n3(e,"string");return typeof t=="symbol"?t:t+""}function n3(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 ah(e){return e&&e.map((t,n)=>S.createElement(t.tag,ao({key:n},t.attr),ah(t.child)))}function Ze(e){return t=>S.createElement(r3,so({attr:ao({},e.attr)},t),ah(e.child))}function r3(e){var t=n=>{var{attr:r,size:o,title:s}=e,a=J6(e,Z6),l=o||n.size||"1em",u;return n.className&&(u=n.className),e.className&&(u=(u?u+" ":"")+e.className),S.createElement("svg",so({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,a,{className:u,style:ao(ao({color:e.color||n.color},n.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),s&&S.createElement("title",null,s),e.children)};return Hc!==void 0?S.createElement(Hc.Consumer,null,n=>t(n)):t(sh)}function o3(e){return Ze({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 i3(e){return Ze({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 s3(e){return Ze({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 a3(e){return Ze({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 l3(e){return Ze({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 c3(e){return Ze({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 u3(e){return Ze({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 d3(e){return Ze({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 f3(e){return Ze({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 h3(e){return Ze({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 p3(e){return Ze({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 m3(e){return Ze({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 g3(e){return Ze({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 x3(e){return Ze({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 y3=({muted:e})=>e?i.jsx(d3,{size:18,"aria-hidden":"true"}):i.jsx(u3,{size:18,"aria-hidden":"true"}),b3=({off:e})=>e?i.jsx(i3,{size:18,"aria-hidden":"true"}):i.jsx(o3,{size:18,"aria-hidden":"true"}),v3=({active:e})=>i.jsx(s3,{size:18,color:e?"var(--chakra-colors-status-success, #16A34A)":"currentColor","aria-hidden":"true"}),k3=()=>i.jsx(l3,{size:18,"aria-hidden":"true"});function w3({participantName:e,participantRole:t,participantAvatar:n,duration:r,isMuted:o=!1,isCameraOff:s=!1,isSharingScreen:a=!1,onToggleMute:l,onToggleCamera:u,onEndCall:c,onShareScreen:d,position:h="bottom",variant:p="adaptive",...m}){const[g,x]=S.useState(o),[y,v]=S.useState(s),j=p==="dark",w=()=>{x(C=>!C),l==null||l()},F=()=>{v(C=>!C),u==null||u()},B=({onClick:C,ariaLabel:P,active:A,isEndCall:E=!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 E?(R="var(--chakra-colors-status-error, #DC2626)",D="white",N="color-mix(in srgb, var(--chakra-colors-status-error, #DC2626) 85%, black)"):A&&(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))"),i.jsx("button",{onClick:C,"aria-label":P,"aria-pressed":A,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:44,height:44,borderRadius:"50%",border:A?"1px solid var(--chakra-colors-status-error)":"1px solid transparent",cursor:"pointer",transition:"all 0.15s ease",background:R,color:D,WebkitTapHighlightColor:"transparent"},onMouseEnter:O=>{const I=O.currentTarget;I.style.background=N,I.style.transform="scale(1.06)"},onMouseLeave:O=>{const I=O.currentTarget;I.style.background=R,I.style.transform="scale(1)"},children:L})};return i.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"},...m,children:[i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"3",children:[i.jsx(lo,{src:n,name:e,size:"md"}),i.jsxs(f.Box,{children:[i.jsx(f.Box,{fontSize:"sm",fontWeight:"semibold",fontFamily:"var(--font-heading)",color:j?"white":"text.heading",children:e}),t&&i.jsx(f.Box,{fontSize:"xs",fontFamily:"var(--font-body)",color:j?"rgba(255,255,255,0.6)":"text.muted",children:t})]}),i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",ml:"2",children:[i.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:[i.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&&i.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})]})]}),i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",children:[l&&i.jsx(B,{onClick:w,ariaLabel:g?"Unmute microphone":"Mute microphone",active:g,children:i.jsx(y3,{muted:g})}),u&&i.jsx(B,{onClick:F,ariaLabel:y?"Turn camera on":"Turn camera off",active:y,children:i.jsx(b3,{off:y})}),d&&i.jsx(B,{onClick:d,ariaLabel:a?"Stop sharing screen":"Share screen",active:a,children:i.jsx(v3,{active:a})}),c&&i.jsx(B,{onClick:c,ariaLabel:"End call",isEndCall:!0,children:i.jsx(k3,{})})]})]})}const S3={consultation:{bg:"color-mix(in srgb, #0685FF 12%, transparent)",color:"#0685FF",icon:i.jsx(c3,{size:14,"aria-hidden":"true"})},lab:{bg:"color-mix(in srgb, #7700CC 12%, transparent)",color:"#7700CC",icon:i.jsx(p3,{size:14,"aria-hidden":"true"})},prescription:{bg:"color-mix(in srgb, #10B981 12%, transparent)",color:"#10B981",icon:i.jsx(a3,{size:14,"aria-hidden":"true"})},vitals:{bg:"color-mix(in srgb, #F59E0B 12%, transparent)",color:"#D97706",icon:i.jsx(x3,{size:14,"aria-hidden":"true"})},note:{bg:"color-mix(in srgb, #64748B 12%, transparent)",color:"#64748B",icon:i.jsx(m3,{size:14,"aria-hidden":"true"})},admission:{bg:"color-mix(in srgb, #EF4444 12%, transparent)",color:"#EF4444",icon:i.jsx(h3,{size:14,"aria-hidden":"true"})},discharge:{bg:"color-mix(in srgb, #10B981 12%, transparent)",color:"#10B981",icon:i.jsx(f3,{size:14,"aria-hidden":"true"})},custom:{bg:"color-mix(in srgb, #0685FF 10%, transparent)",color:"#0685FF",icon:i.jsx(g3,{size:14,"aria-hidden":"true"})}},$c={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 C3(){return i.jsxs(f.Box,{display:"flex",gap:"4",alignItems:"flex-start",children:[i.jsxs(f.Box,{flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",children:[i.jsx(f.Box,{w:"8",h:"8",borderRadius:"full",bg:"bg.subtle",style:{animation:"medix-shimmer 1.5s infinite"}}),i.jsx(f.Box,{w:"px",flex:"1",minH:"8",bg:"border",mt:"2"})]}),i.jsxs(f.Box,{flex:"1",pb:"6",children:[i.jsx(f.Box,{h:"4",bg:"bg.subtle",borderRadius:"full",w:"40%",mb:"2",style:{animation:"medix-shimmer 1.5s infinite"}}),i.jsx(f.Box,{h:"3",bg:"bg.subtle",borderRadius:"full",w:"65%",style:{animation:"medix-shimmer 1.5s infinite"}})]})]})}function j3({events:e,compact:t=!1,isLoading:n=!1,loadingCount:r=4,colorScheme:o="blue",...s}){const a=o==="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?i.jsx(f.Box,{...s,children:Array.from({length:r}).map((l,u)=>i.jsx(C3,{},u))}):i.jsx(f.Box,{...s,role:"feed","aria-label":"Patient medical timeline",children:e.map((l,u)=>{const c=S3[l.type],d=u===e.length-1;return i.jsxs(f.Box,{display:"flex",gap:"4",alignItems:"flex-start",role:"article","aria-label":`${l.title} on ${l.date}`,children:[i.jsxs(f.Box,{flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",children:[i.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}),!d&&i.jsx(f.Box,{w:"1px",flex:"1",minH:"8",mt:"1",style:{background:a}})]}),i.jsxs(f.Box,{flex:"1",pb:d?"0":"5",cursor:l.onClick?"pointer":"default",onClick:l.onClick,_hover:l.onClick?{opacity:.85}:void 0,transition:"opacity 0.15s",children:[i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"2",flexWrap:"wrap",children:[i.jsx(f.Box,{fontSize:"sm",fontWeight:"semibold",color:"text.heading",fontFamily:"var(--font-heading)",children:l.title}),l.badgeLabel&&l.badgeStatus&&i.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"1px 7px",borderRadius:4,fontSize:11,fontWeight:600,fontFamily:"var(--font-body)",background:$c[l.badgeStatus].bg,color:$c[l.badgeStatus].color},children:l.badgeLabel})]}),!t&&l.description&&i.jsx(f.Box,{fontSize:"sm",color:"text.muted",fontFamily:"var(--font-body)",mt:"0.5",children:l.description}),i.jsxs(f.Box,{display:"flex",alignItems:"center",gap:"3",mt:"1",flexWrap:"wrap",children:[i.jsx(f.Box,{fontSize:"xs",color:"text.muted",fontFamily:"var(--font-body)",children:l.date}),l.provider&&i.jsxs(i.Fragment,{children:[i.jsx(f.Box,{w:"1px",h:"3",style:{background:"var(--chakra-colors-border)"}}),i.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=D6;exports.Alert=Qi;exports.AllergyBadge=ih;exports.AppointmentCard=H6;exports.Avatar=lo;exports.AvatarGroup=Yh;exports.Badge=ts;exports.BlogCard=O6;exports.BloodTypeBadge=oh;exports.Breadcrumb=r2;exports.Button=Ye;exports.Calendar=os;exports.Card=fu;exports.CardBody=tm;exports.CardFooter=nm;exports.CardHeader=em;exports.Checkbox=lu;exports.Combobox=Lp;exports.Container=pu;exports.CookieConsentBanner=mf;exports.DashboardLayout=sf;exports.DataTable=z6;exports.DatePicker=Ep;exports.DateRangePicker=Fp;exports.Divider=iu;exports.DoctorCard=_6;exports.Drawer=b2;exports.EmptyState=m2;exports.FileUpload=Dp;exports.Footer=lf;exports.FormControl=fp;exports.FullPageSpinner=Kh;exports.ICD10Badge=rh;exports.IconButton=tu;exports.Input=ns;exports.Logo=tn;exports.MedicalRecordBadge=X6;exports.MedixProvider=_h;exports.Modal=p2;exports.Navbar=Yy;exports.NotFoundPage=g2;exports.OTPInput=uu;exports.PWAInstallPrompt=xf;exports.Pagination=cf;exports.PatientTimeline=j3;exports.PhoneInput=vp;exports.PinInput=hp;exports.PrescriptionCard=Y6;exports.Progress=df;exports.RadioGroup=lp;exports.RichTextEditor=Qp;exports.RichTextInput=is;exports.SearchInput=rs;exports.SectionHeader=om;exports.Select=ap;exports.ServerErrorPage=x2;exports.Skeleton=Zt;exports.SkeletonCard=c2;exports.SkeletonText=uf;exports.Spinner=ru;exports.StatCard=hu;exports.Stepper=a2;exports.Switch=cu;exports.Tabs=i2;exports.Tag=ou;exports.TagInput=Rp;exports.TagsInput=du;exports.TelehealthCallBar=w3;exports.TestimonialCard=R6;exports.Textarea=su;exports.ThemeColorPalette=mu;exports.Toaster=eu;exports.Tooltip=Ct;exports.VitalBadge=V6;exports.colorTokens=V;exports.dismissToast=Ih;exports.htmlToMarkdown=Kn;exports.markdownToHtml=Yt;exports.medixConfig=Jc;exports.radiiTokens=Xc;exports.shadowTokens=Zc;exports.spacingTokens=qc;exports.system=Qc;exports.textStyleTokens=Kc;exports.toast=Yn;exports.typographyTokens=xn;exports.useColorScheme=Wh;exports.useIsDarkMode=es;exports.useThemeMode=ur;
|
|
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;
|
|
428
428
|
//# sourceMappingURL=index.cjs.map
|