@udixio/ui-react 2.9.13 → 2.9.14
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/CHANGELOG.md +26 -0
- package/dist/index.cjs +3 -3
- package/dist/index.js +2259 -1814
- package/dist/lib/components/Button.d.ts.map +1 -1
- package/dist/lib/components/Card.d.ts +2 -2
- package/dist/lib/components/Card.d.ts.map +1 -1
- package/dist/lib/components/Checkbox.d.ts +15 -0
- package/dist/lib/components/Checkbox.d.ts.map +1 -0
- package/dist/lib/components/DatePicker.d.ts +9 -0
- package/dist/lib/components/DatePicker.d.ts.map +1 -0
- package/dist/lib/components/FabMenu.d.ts.map +1 -1
- package/dist/lib/components/IconButton.d.ts.map +1 -1
- package/dist/lib/components/TabGroup.d.ts +1 -0
- package/dist/lib/components/TabGroup.d.ts.map +1 -1
- package/dist/lib/components/TabGroupContext.d.ts +1 -0
- package/dist/lib/components/TabGroupContext.d.ts.map +1 -1
- package/dist/lib/components/TabPanel.d.ts +1 -0
- package/dist/lib/components/TabPanel.d.ts.map +1 -1
- package/dist/lib/components/TabPanels.d.ts +1 -0
- package/dist/lib/components/TabPanels.d.ts.map +1 -1
- package/dist/lib/components/TextField.d.ts +4 -4
- package/dist/lib/components/TextField.d.ts.map +1 -1
- package/dist/lib/components/index.d.ts +2 -0
- package/dist/lib/components/index.d.ts.map +1 -1
- package/dist/lib/effects/State.d.ts +3 -1
- package/dist/lib/effects/State.d.ts.map +1 -1
- package/dist/lib/interfaces/card.interface.d.ts +1 -1
- package/dist/lib/interfaces/card.interface.d.ts.map +1 -1
- package/dist/lib/interfaces/checkbox.interface.d.ts +38 -0
- package/dist/lib/interfaces/checkbox.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/date-picker.interface.d.ts +67 -0
- package/dist/lib/interfaces/date-picker.interface.d.ts.map +1 -0
- package/dist/lib/interfaces/icon-button.interface.d.ts +2 -1
- package/dist/lib/interfaces/icon-button.interface.d.ts.map +1 -1
- package/dist/lib/interfaces/index.d.ts +1 -0
- package/dist/lib/interfaces/index.d.ts.map +1 -1
- package/dist/lib/interfaces/text-field.interface.d.ts +7 -4
- package/dist/lib/interfaces/text-field.interface.d.ts.map +1 -1
- package/dist/lib/styles/card.style.d.ts +3 -3
- package/dist/lib/styles/checkbox.style.d.ts +45 -0
- package/dist/lib/styles/checkbox.style.d.ts.map +1 -0
- package/dist/lib/styles/date-picker.style.d.ts +45 -0
- package/dist/lib/styles/date-picker.style.d.ts.map +1 -0
- package/dist/lib/styles/icon-button.style.d.ts +10 -4
- package/dist/lib/styles/icon-button.style.d.ts.map +1 -1
- package/dist/lib/styles/index.d.ts +1 -0
- package/dist/lib/styles/index.d.ts.map +1 -1
- package/dist/lib/styles/text-field.style.d.ts +18 -9
- package/dist/lib/styles/text-field.style.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/lib/components/Button.tsx +1 -0
- package/src/lib/components/Card.tsx +9 -4
- package/src/lib/components/Checkbox.tsx +120 -0
- package/src/lib/components/DatePicker.tsx +432 -0
- package/src/lib/components/FabMenu.tsx +4 -5
- package/src/lib/components/IconButton.tsx +9 -7
- package/src/lib/components/TabGroup.tsx +8 -6
- package/src/lib/components/TabGroupContext.tsx +1 -1
- package/src/lib/components/TabPanel.tsx +1 -0
- package/src/lib/components/TabPanels.tsx +1 -0
- package/src/lib/components/TextField.tsx +95 -108
- package/src/lib/components/index.ts +2 -0
- package/src/lib/effects/State.tsx +4 -1
- package/src/lib/interfaces/card.interface.ts +1 -1
- package/src/lib/interfaces/checkbox.interface.ts +39 -0
- package/src/lib/interfaces/date-picker.interface.ts +79 -0
- package/src/lib/interfaces/icon-button.interface.ts +2 -1
- package/src/lib/interfaces/index.ts +1 -0
- package/src/lib/interfaces/text-field.interface.ts +7 -4
- package/src/lib/styles/checkbox.style.ts +64 -0
- package/src/lib/styles/date-picker.style.ts +43 -0
- package/src/lib/styles/index.ts +1 -0
- package/src/lib/styles/text-field.style.ts +2 -2
- package/src/stories/containment/card.stories.tsx +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";var zt=Object.defineProperty;var Kt=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var A=(e,t,n)=>Kt(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),_e=require("clsx"),Gt=require("tailwind-merge"),i=require("react"),O=require("motion/react"),qe=require("react-dom"),xe=require("@udixio/theme"),Xe=require("@udixio/tailwind"),Jt=require("react-textarea-autosize"),Ue=Gt.extendTailwindMerge({override:{classGroups:{"text-color":[{text:[e=>!e.startsWith("display-")&&!e.startsWith("headline-")&&!e.startsWith("title-")&&!e.startsWith("body-")&&!e.startsWith("label-")]}]}},extend:{classGroups:{font:[{text:[e=>e.startsWith("display-")||e.startsWith("headline-")||e.startsWith("title-")||e.startsWith("body-")||e.startsWith("label-")]}]},conflictingClassGroups:{font:["font"]}}}),w=(...e)=>Ue(_e.clsx(e)),Ye=(...e)=>Ue(_e.clsx(e));function Zt(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}const we=e=>{const t={};e.classNameList.forEach(r=>{var s;if(r)if(typeof r=="string")(t[s=e.default]??(t[s]=[])).push(r);else{const a=r(e.states);Object.entries(a).map(c=>{const[l,u]=c;(t[l]??(t[l]=[])).push(u)})}});const n=t;return Object.entries(t).map(r=>{let[s,a]=r;a=a.reverse(),s==e.default&&a.unshift("relative"),a.unshift(Zt(s)),n[s]=Ye(...a)}),n},Z=(e,t)=>n=>we({classNameList:[n.className,t],default:e,states:n}),J=(e,t)=>n=>i.useMemo(()=>we({classNameList:[n.className,t],default:e,states:n}),[n]);function Qt(e,t,n){return i.useMemo(()=>we({classNameList:[n==null?void 0:n.className,t],default:e,states:n}),[e,t,n])}const ze=({variant:e,disableTextMargins:t,disabled:n,iconPosition:r,icon:s,isActive:a,loading:c,shape:l,onToggle:u,size:o,allowShapeTransformation:f})=>({button:w(" relative cursor-pointer group/button outline-none inline-block flex justify-center items-center ",o==="xSmall"&&"text-label-large px-3 py-1.5 gap-1",o==="small"&&"text-label-large px-4 py-2.5 gap-2",o==="medium"&&"text-title-medium px-6 py-4 gap-2",o==="large"&&"text-headline-small px-12 py-8 gap-3",o==="xLarge"&&"text-headline-large px-16 py-12 gap-4",l==="rounded"&&{"rounded-[30px]":o==="xSmall"||o=="small","rounded-[40px]":o==="medium","rounded-[70px]":o==="large"||o=="xLarge"},(l==="squared"||f&&a)&&{"rounded-[12px]":o==="xSmall"||o=="small","rounded-[16px]":o==="medium","rounded-[28px]":o==="large"||o=="xLarge"},f&&!n&&{"active:rounded-[12px]":o==="xSmall"||o=="small","active:rounded-[16px]":o==="medium","active:rounded-[28px]":o==="large"||o=="xLarge"},e==="elevated"&&{"shadow-1 hover:shadow-2":!n,"bg-surface-container-low text-primary":!n&&!a,"bg-primary text-on-primary":!n&&a,"text-on-surface/[38%]":n},e==="filled"&&{"hover:shadow-1":!n,"bg-surface-container text-on-surface-variant":!n&&!a&&u,"bg-primary text-on-primary":!n&&(a&&u||!u),"text-on-surface/[38%]":n},e==="tonal"&&{"hover:shadow-1":!n,"bg-secondary-container text-on-secondary-container":!n&&!a,"bg-secondary text-on-secondary":!n&&a,"text-on-surface/[0.38]":n},e==="outlined"&&[" border",{"border-on-surface/[0.12] text-on-surface/[0.38]":n,"text-primary border-outline focus:border-primary":!n&&!a,"text-inverse-on-surface bg-inverse-surface border-inverse-surface":!n&&a}],e==="text"&&["w-fit",{"text-primary":!n,"text-on-surface/[0.38]":n},t&&[o==="xSmall"&&"-mx-3 ",o==="small"&&"-mx-4 ",o==="medium"&&"-mx-6 ",o==="large"&&"-mx-12",o==="xLarge"&&"-mx-16 "]],n&&"cursor-default"),touchTarget:w("absolute -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/2 h-12 w-full"),stateLayer:w("overflow-hidden",l==="rounded"&&{"rounded-[30px]":o==="xSmall"||o=="small","rounded-[40px]":o==="medium","rounded-[70px]":o==="large"||o=="xLarge"},(l==="squared"||f&&a)&&{"rounded-[12px]":o==="xSmall"||o=="small","rounded-[16px]":o==="medium","rounded-[28px]":o==="large"||o=="xLarge"},f&&!n&&{"group-active/button:rounded-[12px]":o==="xSmall"||o=="small","group-active/button:rounded-[16px]":o==="medium","group-active/button:rounded-[28px]":o==="large"||o=="xLarge"}),label:w({invisible:c}),icon:w({invisible:c},o==="xSmall"&&"size-5",o==="small"&&"size-5",o==="medium"&&"size-6",o==="large"&&"size-8",o==="xLarge"&&"size-10")}),en=Z("button",ze),Ke=J("button",ze),Ge=({variant:e,isInteractive:t})=>({card:w(" rounded-xl overflow-hidden ",e==="outlined"&&"bg-surface border border-outline-variant",e==="elevated"&&"bg-surface-container-low shadow-1",e==="filled"&&"bg-surface-container-highest",{"group/card":t})}),tn=Z("card",Ge),Je=J("card",Ge),ke=({width:e})=>({carouselItem:w("rounded-[28px] overflow-hidden flex-none",{hidden:e===void 0,"flex-1":e==null})}),nn=Z("carouselItem",ke),Ze=J("carouselItem",ke),Qe=()=>({carousel:w(["w-full h-[400px]"]),track:w("flex h-full w-full")}),sn=Z("carousel",Qe),et=J("carousel",Qe),tt=({variant:e,disabled:t,trailingIcon:n,icon:r,isActive:s,isInteractive:a,activated:c,isFocused:l,isDragging:u,isEditing:o})=>({chip:w(" group/chip px-3 py-1.5 rounded-lg flex items-center gap-2 outline-none",{"pl-2":r,"pr-2":n,"cursor-pointer":!t&&a},{" text-on-surface-variant":!c&&!l||o,"bg-secondary-container text-on-secondary-container":(c||l)&&!o},u&&["opacity-100 cursor-grabbing shadow-3"],e==="outlined"&&["border border-outline-variant",{"border-transparent":o}],e==="elevated"&&!o&&["shadow-1 bg-surface-container-low","border border-outline-variant"]),stateLayer:w("rounded-lg overflow-hidden",{}),label:w("outline-none text-nowrap",{"opacity-[0.38]":t}),leadingIcon:w("text-primary size-[18px]",{"opacity-[0.38]":t}),trailingIcon:w("cursor-pointer size-[18px]",{"opacity-[0.38]":t})}),rn=Z("chip",tt),nt=J("chip",tt),st=({scrollable:e})=>({chips:w(" flex gap-3 outline-none",{"flex-wrap":!e,"overflow-x-auto":e})}),on=Z("chips",st),rt=J("chips",st),ot=({orientation:e})=>({divider:w("border-outline-variant ",{"h-fit w-full border-t":e==="horizontal"},{"h-auto self-stretch w-fit border-l":e==="vertical"})}),ln=Z("divider",ot),it=J("divider",ot),lt=({size:e,variant:t,extended:n})=>({fab:w("flex shadow-3 hover:shadow-4 group/fab overflow-hidden outline-none items-center cursor-pointer",{"rounded-[12px]":e=="small","rounded-[16px]":e=="medium","rounded-[28px]":e=="large"},{"p-2":e=="small","p-4":e=="medium","p-[30px]":e=="large"},t==="primary"&&"bg-primary text-on-primary",t==="secondary"&&"bg-secondary text-on-secondary",t==="tertiary"&&"bg-tertiary text-on-tertiary",t==="primaryContainer"&&"bg-primary-container text-on-primary-container",t==="secondaryContainer"&&"bg-secondary-container text-on-secondary-container",t==="tertiaryContainer"&&"bg-tertiary-container text-on-tertiary-container"),icon:w({"size-6":e=="small"||e=="medium","size-9":e=="large"}),label:w("text-nowrap",{"text-title-medium":e=="small","text-title-large":e=="medium","text-headline-small":e=="large"})}),an=Z("fab",lt),at=J("fab",lt),ct=({size:e,variant:t,open:n})=>({fabMenu:w("relative inline-flex flex-col items-end"),actions:w("flex flex-col gap-1 items-end absolute bottom-[calc(100%_+_8px)] right-0"),label:w("text-nowrap")}),cn=Z("fabMenu",ct),ut=J("fabMenu",ct),dt=({variant:e,disabled:t,onToggle:n,isActive:r,size:s,width:a,shape:c,allowShapeTransformation:l})=>({iconButton:w("rounded-full relative flex transition-all duration-300","group/icon-button cursor-pointer",{"cursor-default":t},c==="rounded"&&{"rounded-[30px]":s==="xSmall"||s=="small","rounded-[40px]":s==="medium","rounded-[70px]":s==="large"||s=="xLarge"},(c==="squared"||l&&r)&&{"rounded-[12px]":s==="xSmall"||s=="small","rounded-[16px]":s==="medium","rounded-[28px]":s==="large"||s=="xLarge"},l&&!t&&{"active:rounded-[12px]":s==="xSmall"||s=="small","active:rounded-[16px]":s==="medium","active:rounded-[28px]":s==="large"||s=="xLarge"},e==="filled"&&[!t&&{"bg-surface-container":!r&&!!n,"bg-primary":r||!n},!!t&&"bg-on-surface/[0.12]"],e==="tonal"&&[!t&&{"bg-secondary-container text-on-secondary-container":!r&&!!n,"bg-secondary text-on-secondary":r||!n},!!t&&"bg-on-surface/[0.12]"],e==="outlined"&&[!t&&{"border border-outline":!r,"border border-transparent bg-inverse-surface":r},!!t&&{"border border-on-surface/[0.12]":!r,"border border-transparent bg-on-surface/[0.12]":r}]),touchTarget:w("absolute -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/2 h-12 w-full"),stateLayer:w("absolute top-0 left-0 h-full w-full overflow-hidden",(c==="rounded"||c==="squared"&&n&&!t&&r&&l)&&{"rounded-[30px]":s==="xSmall"||s=="small","rounded-[40px]":s==="medium","rounded-[70px]":s==="large"||s=="xLarge"},(c==="squared"||c==="rounded"&&n&&!t&&r&&l)&&{"rounded-[12px]":s==="xSmall"||s=="small","rounded-[16px]":s==="medium","rounded-[28px]":s==="large"||s=="xLarge"},l&&!t&&{"group-active/icon-button:rounded-[12px]":s==="xSmall"||s=="small","group-active/icon-button:rounded-[16px]":s==="medium","group-active/icon-button:rounded-[28px]":s==="large"||s=="xLarge"},!t&&[e==="standard"&&{"state-on-surface-variant":!r,"state-primary":r},e==="filled"&&{"state-primary":!r&&!!n,"state-inverse-on-surface":r||!n},e==="tonal"&&{"state-on-surface-variant":!r&&!!n,"state-on-secondary-container":r||!n},e==="outlined"&&{"state-on-surface-variant":!r,"state-on-primary":r}]),icon:w(" transition-all duration-300",{"size-5 p-1.5":s==="xSmall"},{"size-6 p-2":s==="small"},{"size-6 p-4":s==="medium"},{"size-8 p-8":s==="large"},{"size-10 p-12":s==="xLarge"},a=="narrow"&&[{"px-1":s==="xSmall"},{"px-1":s==="small"},{"px-3":s==="medium"},{"px-4":s==="large"},{"px-8":s==="xLarge"}],a=="wide"&&[{"px-2.5":s==="xSmall"},{"px-3.5":s==="small"},{"px-6":s==="medium"},{"px-12":s==="large"},{"px-[72px]":s==="xLarge"}],!t&&[e==="standard"&&{"text-on-surface-variant":!r,"text-primary":r},e==="filled"&&{"text-primary":!r&&!!n,"text-on-primary":r||!n},e==="outlined"&&{"text-on-surface-variant":!r,"text-inverse-on-surface":r}],!!t&&"text-on-surface/[0.38]")}),un=Z("iconButton",dt),ft=J("iconButton",dt),ht=({variant:e,isVisible:t})=>({progressIndicator:w((e==="linear-determinate"||e=="linear-indeterminate")&&"flex w-full h-1"),track:w("h-full rounded-full bg-primary rounded-l-full",{"max-h-0":!t,"max-h-full":t}),activeIndicator:w({"max-h-0":!t,"max-h-full":t},(e==="linear-determinate"||e=="linear-indeterminate")&&"h-full flex-1 rounded-full bg-primary-container",(e==="circular-determinate"||e=="circular-indeterminate")&&["stroke-primary fill-transparent ",{"stroke-[4px]":t,"stroke-[0px]":!t}]),stop:w("absolute top-1/2 -translate-y-1/2 right-0 bg-primary rounded-full size-1",{"max-h-0":!t,"max-h-full":t})}),dn=Z("progressIndicator",ht),mt=J("progressIndicator",ht),je=({variant:e,position:t})=>({sideSheet:w("bg-surface flex justify-between max-w-xs z-10",{"flex-row-reverse":t=="right","h-full":e=="standard"},e=="modal"&&["rounded-2xl fixed top-0 m-[1rem] h-[calc(100dvh-2rem)]",{"right-0":t=="right","left-0":t=="left"}]),container:w("w-full overflow-hidden",{}),content:w("w-fit "),header:w("p-4 flex items-center gap-2"),title:w("text-on-surface-variant text-title-large"),closeButton:w("ml-auto"),divider:w({hidden:e=="modal"}),overlay:w("bg-[black]/[0.32] fixed top-0 left-0 w-screen h-screen")}),pt=Z("sideSheet",je),fn=J("sideSheet",je),Ie=({isChanging:e})=>({slider:w(["relative w-full h-11 flex items-center rounded gap-x-1.5 cursor-pointer min-w-32"]),activeTrack:w(["h-4 relative transition-all duration-100 bg-primary overflow-hidden rounded-l-full "]),inactiveTrack:w(["h-4 relative transition-all duration-100 bg-primary-container rounded-r-full overflow-hidden"]),handle:w(["transform relative transition-all duration-100 bg-primary h-full rounded-full ",{"w-0.5":e,"w-1":!e}]),valueIndicator:w(["absolute select-none bg-inverse-surface text-inverse-on-surface py-3 px-4 text-label-large rounded-full bottom-[calc(100%+4px)] transform left-1/2 -translate-x-1/2"]),dot:w(["h-1 w-1 absolute transform -translate-y-1/2 -translate-x-1/2 top-1/2 rounded-full"])}),hn=Z("slider",Ie),yt=J("slider",Ie),xt=()=>({snackbar:w(" rounded bg-inverse-surface "),container:w("pl-4 pr-2 max-w-full py-1 flex items-center flex-wrap"),supportingText:w("text-body-medium text-inverse-on-surface "),icon:w(" ml-auto mr-0 text-inverse-on-surface block dark")}),mn=Z("snackbar",xt),vt=J("snackbar",xt),wt=({isSelected:e,disabled:t,inactiveIcon:n})=>({switch:w("group/switch w-[52px] h-[32px] outline-none rounded-full border-2 flex items-center",{"bg-on-surface/[0.12] border-transparent":t},!t&&["cursor-pointer ",{"bg-primary border-primary":e},{"bg-surface-container border-outline":!e}]),handleContainer:w("flex items-center justify-center absolute",{"left-[14px]":!e},{"right-[14px]":e}),handle:w("transition-all duration-100 z-10 rounded-full flex items-center justify-center",{"w-[16px] h-[16px]":!e&&!n},{"w-[24px] h-[24px]":!(!e&&!n)},!t&&["cursor-pointer group-active/switch:h-[28px] group-active/switch:w-[28px]",{"bg-on-primary group-hover/switch:bg-primary-container":e},{"bg-outline group-hover/switch:bg-on-surface-variant":!e}],{"bg-surface":t}),handleStateLayer:w("w-[40px] h-[40px] -z-10 rounded-full absolute",{"group-state-primary":!t}),icon:w("w-[16px] h-[16px]",!t&&[{"text-on-primary-container":e},{"text-on-primary":!e}],{"text-on-surface/[0.38]":t})}),pn=Z("switch",wt),gt=J("switch",wt),bt=({isSelected:e,icon:t,label:n,variant:r})=>({tab:w("flex-1 group/tab outline-none flex px-4 justify-center items-center cursor-pointer",{"z-10":e},!!(t&&n)&&r==="primary"&&"h-16",!(t&&n&&r==="primary")&&"h-12"),stateLayer:w("absolute w-full h-full overflow-hidden left-1/2 top-1/2 transform -translate-y-1/2 -translate-x-1/2",r==="primary"&&{"group-hover/tab:hover-state-on-surface group-focus-visible/tab:focus-state-on-surface":!e,"group-hover/tab:hover-state-primary group-focus-visible/tab:focus-state-primary":e},r==="secondary"&&"group-hover/tab:hover-state-on-surface group-focus-visible/tab:focus-state-on-surface"),content:w("flex gap-0.5 h-full justify-center",{relative:r=="primary"},{"":!!(n&&!t)},r==="primary"&&"flex-col items-center",r==="secondary"&&{"flex-col items-center":!(n&&t),"flex-row items-center gap-2":!!(n&&t)}),icon:w("h-6 w-6 p-0.5 !box-border",r==="primary"&&{"text-on-surface-variant":!e,"text-primary":e},r==="secondary"&&{"text-on-surface-variant":!e,"text-on-surface":e}),label:w("text-title-small text-nowrap",r==="primary"&&{"text-on-surface-variant":!e,"text-primary":e},r==="secondary"&&{"text-on-surface-variant":!e,"text-on-surface":e}),underline:w("bg-primary absolute w-full left-0 bottom-0",r==="primary"&&"h-[3px] rounded-t",r==="secondary"&&"h-0.5")}),yn=Z("tab",bt),St=J("tab",bt),Et=({scrollable:e})=>({tabs:w("border-b border-surface-container-highest bg-surface","flex relative ",{"overflow-x-auto":e})}),xn=Z("tabs",Et),Nt=J("tabs",Et),Lt=()=>({tabPanels:w("overflow-hidden")}),vn=Z("tabPanels",Lt),kt=J("tabPanels",Lt),jt=()=>({tabPanel:w("")}),wn=Z("tabPanel",jt),It=J("tabPanel",jt),Mt=({disabled:e,leadingIcon:t,trailingIcon:n,variant:r,errorText:s,isFocused:a,value:c,suffix:l,textLine:u})=>({textField:w({"opacity-[.38]":e}),content:w("group/text-field transition-border duration-200 relative flex items-center ",{"h-14":u=="singleLine"},{"border-on-surface-variant":!(s!=null&&s.length)&&!a&&r=="filled","border-outline":!(s!=null&&s.length)&&!a&&r=="outlined","border-primary":!(s!=null&&s.length)&&a,"border-error":!!(s!=null&&s.length)},{"bg-on-surface/[0.04]":e},r=="filled"&&["rounded-t overflow-hidden border-b",{"bg-surface-container-highest":!e}],r=="outlined"&&["border rounded box-border",{"border-[3px]":a}]),stateLayer:w("absolute -z-10 w-full h-full top-0 left-0",{hidden:r=="outlined"},{"group-state-on-surface":!e,"focus-state-on-surface":a}),label:w("inline-flex outline-none whitespace-nowrap",{"text-on-surface-variant":!e&&!(s!=null&&s.length)},{"text-on-surface":e},{"text-error":!!(s!=null&&s.length)},{"text-primary":!(s!=null&&s.length)&&a}),input:w("w-full resize-none px-4 text-body-large bg-[inherit] outline-none autofill:transition-colors autofill:duration-[5000000ms]",{" text-on-surface placeholder:text-on-surface-variant":!e,"placeholder:text-on-surface text-on-surface":e},{"pr-0":!!l},r=="filled"&&" pb-2 pt-6",r=="outlined"&&"py-4 relative z-10"),activeIndicator:w("absolute w-0 inset-x-0 border-rounded mx-auto bottom-0",r=="filled"&&["h-[2px] transition-all duration-300",{"bg-primary":!(s!=null&&s.length)},{"bg-error":!!(s!=null&&s.length)},{"!w-full":a}]),supportingText:w(" text-body-small px-4 pt-1",{"text-on-surface-variant":!e&&!(s!=null&&s.length)},{"text-on-surface":e},{"!w-full":a},{"text-error":!!(s!=null&&s.length)}),leadingIcon:w(["h-12 ml-3 flex items-center justify-center",{"cursor-text":!i.isValidElement(t)}]),trailingIcon:w("h-12 w-12 flex items-center justify-center",{"cursor-text":!i.isValidElement(n)}),suffix:w("text-on-surface-variant pl-0 pr-4",r=="filled"&&" pb-2 pt-6",r=="outlined"&&"py-4 relative z-10")}),gn=Z("textField",Mt),Rt=J("textField",Mt),Ct=({position:e,variant:t})=>({toolTip:w(" pointer-events-auto w-max z-10 absolute m-1 w-max-content max-w-[312px]",t=="rich"&&"bg-surface-container rounded-2xl text-on-surface-container shadow-2",t=="plain"&&"bg-inverse-surface rounded text-inverse-on-surface ",{"bottom-full left-1/2 -translate-x-1/2":e=="top","top-full left-1/2 -translate-x-1/2":e=="bottom","right-full top-1/2 -translate-y-1/2":e=="left","left-full top-1/2 -translate-y-1/2":e=="right","bottom-full right-full":e=="top-left","bottom-full left-full":e=="top-right","top-full right-full":e=="bottom-left","top-full left-full":e=="bottom-right"}),container:w("pb-2",t=="rich"&&"px-4 pt-3 ",t=="plain"&&"px-2 py-1"),actions:w("flex gap-10 px-1 mt-2",t=="plain"&&"hidden"),subHead:w("text-title-small mb-1",t=="plain"&&"hidden"),supportingText:w(""),content:w("w-full")}),bn=Z("toolTip",Ct),Dt=J("toolTip",Ct),le=({icon:e,colors:t=[],className:n,...r})=>{if(typeof e=="string"){let f=e;return t[0]&&(f=f.replace(/<svg([^>]*)>/,`<svg$1 fill="${t[0]}" color="${t[0]}">`),f=f.replace(/<path([^>]*?)>/g,'<path$1 fill="currentColor">')),d.jsx("div",{className:w("size-5 box-content inline-flex fill-current",n),style:{color:t[0]||"inherit"},dangerouslySetInnerHTML:{__html:f}})}if(e&&typeof e=="object"&&"src"in e){const f=e;return d.jsx("img",{src:f.src,width:f.width,height:f.height,className:w("size-5 box-content",n),style:{filter:t[0]?"brightness(0) saturate(100%) invert(1)":void 0},alt:"","aria-hidden":"true"})}const s=e;if(!(s!=null&&s.prefix))throw new Error(`Invalid icon type: ${typeof e}`);const{icon:a}=s,[c,l,,,u]=a||[],o=f=>{switch(f.length){case 2:return{"--fa-primary-color":f[0]||"inherit","--fa-secondary-color":f[1]||"inherit"};case 1:return{color:f[0]};default:return{}}};return d.jsx("svg",{className:w("size-5 box-content",n),style:{...o(t)},xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${c} ${l}`,role:"img","aria-hidden":"true",...r,children:typeof u=="string"?d.jsx("path",{className:"fill-current",d:u}):u.map((f,y)=>d.jsx("path",{d:f},y))})},$t=({variant:e="linear-determinate",value:t=0,transitionDuration:n=1e3,className:r,...s})=>{const[a,c]=i.useState(t),[l]=i.useState(1.5);i.useEffect(()=>{t>100&&(t=100),t<0&&(t=0),c(t)},[t]);const[u,o]=i.useState(!0),f=()=>u?l:l*.5;i.useEffect(()=>{if((e==="circular-indeterminate"||e==="linear-indeterminate")&&a!==100){const p=setInterval(()=>{c(u?10:90),o(!u)},f()*1e3);return()=>clearInterval(p)}},[e,u,a]);const[y,h]=i.useState(!1);i.useEffect(()=>{if(a>=100){const p=setTimeout(()=>{h(!1)},n);return()=>{clearTimeout(p)}}else h(!0)},[a,n]);const m=mt({className:r,variant:e,value:t,transitionDuration:n,isVisible:y});return d.jsxs(d.Fragment,{children:[(e==="linear-determinate"||e=="linear-indeterminate")&&d.jsxs("div",{className:m.progressIndicator,...s,children:[d.jsx("div",{style:{width:`${a}%`,transition:`width ${n}ms ease-in-out ${a==100?", max-height 200ms 0.5s ease-in-out":""}`},className:m.track}),d.jsx("div",{style:{marginLeft:a!=100?"6px":"0px",transition:`width ${n}ms ease-in-out ${a==100?`, max-height 200ms 0.5s ease-in-out, margin-left ${n}ms ${n/1.5}ms`:""}`},className:m.activeIndicator}),d.jsx("div",{style:{width:"4 px",transition:`width ${n}ms ease-in-out, max-height 200ms 0.5s ease-in-out`},className:m.stop})]}),(e==="circular-determinate"||e=="circular-indeterminate")&&d.jsx(O.motion.svg,{width:"48",height:"48",viewBox:"0 0 48 48",initial:{rotate:-90},animate:{rotate:270},transition:{repeat:1/0,duration:f(),ease:"linear"},className:m.progressIndicator,...s,children:d.jsx(O.motion.circle,{cx:"50%",cy:"50%",r:y?"calc(50% - 2px)":"50%",style:{strokeLinecap:"round"},initial:"hidden",animate:"visible",className:m.activeIndicator,variants:{hidden:{pathLength:u?10/100:90/100},visible:{pathLength:u?90/100:10/100}},transition:{pathLength:{type:"tween",ease:"linear",duration:f(),bounce:0}}})},u+"")]})},Wt=({colorName:e="on-surface",triggerRef:t})=>{const n={initial:{opacity:1,"--r":"25%"},animate:{opacity:1,"--r":"100%",transition:{duration:.5}},exit:{opacity:0,"--r":"100%",transition:{duration:.3}}},[r,s]=i.useState(!0),[a,c]=i.useState(!1),[l,u]=i.useState({x:50,y:50});i.useEffect(()=>{a&&(s(!0),s(!1))},[a]),i.useEffect(()=>{const p=t==null?void 0:t.current;if(p)return p.addEventListener("mousedown",o),p.addEventListener("mouseup",y),p.addEventListener("mouseleave",f),()=>{p.removeEventListener("mousedown",o),p.removeEventListener("mouseup",y),p.removeEventListener("mouseleave",f)}},[t]);const o=p=>{const S=t==null?void 0:t.current,b=S.getBoundingClientRect();c(!0),u({x:(p.clientX-b.left)/S.clientWidth*100,y:(p.clientY-b.top)/S.clientHeight*100})},f=p=>{c(!1)},y=p=>{c(!1)},h=`color-mix(in srgb, var(--state-color,_var(--color-${e})) 10%, transparent)`,m={position:"absolute",inset:0,width:"100%",height:"100%","--x":l.x+"%","--y":l.y+"%","--r":"0%",background:`radial-gradient(ellipse at var(--x) var(--y), ${h} var(--r), transparent calc(var(--r) * 2))`,pointerEvents:"none"};return d.jsx(O.AnimatePresence,{mode:"wait",children:(a||!a&&!r)&&d.jsx(O.motion.div,{style:m,variants:n,initial:"initial",animate:"animate",exit:"exit",onAnimationComplete:()=>s(!0)})})},At=Z("customScroll",({orientation:e,draggable:t,isDragging:n})=>({customScroll:w("flex h-full w-full",t&&["[&::-webkit-scrollbar-track]:rounded-full","[&::-webkit-scrollbar-track]:bg-transparent","[&::-webkit-scrollbar-thumb]:rounded-full",{"[&::-webkit-scrollbar-thumb]:bg-outline":n,"[&::-webkit-scrollbar-thumb]:bg-transparent":!n},{"[&::-webkit-scrollbar]:h-2":e==="horizontal"},{"[&::-webkit-scrollbar]:w-2":e==="vertical"}],{"overflow-y-scroll flex-col":e==="vertical","overflow-x-scroll flex-row":e==="horizontal","cursor-grab":t&&!n,"cursor-grabbing":t&&n}),track:w("overflow-hidden flex-none sticky",{"left-0 h-full":e==="horizontal","top-0 w-full":e==="vertical"})}));function Sn(e,t){let n=0,r=null,s=null;const a=(c,l)=>{n=Date.now(),t(c,l)};return(c,l)=>{const u=Date.now(),o=e-(u-n);o<=0?(r&&(clearTimeout(r),r=null),a(c,l)):(s={v:c,o:l},r||(r=setTimeout(()=>{r=null;const f=s;s=null,f&&a(f.v,f.o)},o)))}}const Pt=({children:e,orientation:t="vertical",scrollSize:n,onScroll:r,className:s,draggable:a=!1,throttleDuration:c=75,scroll:l,setScroll:u})=>{var re,ie;const o=i.useRef(null),f=i.useRef(null),[y,h]=i.useState({width:null,height:null});i.useEffect(()=>{if(!o.current)return;const B=new ResizeObserver(R=>{for(const T of R)T.target===o.current&&h({width:T.contentRect.width,height:T.contentRect.height})});return B.observe(o.current),()=>{B.disconnect()}},[o]);const m=i.useRef(null),p=i.useRef(null),S=()=>{const B=f.current;return B?{width:n??B.scrollWidth,height:n??B.scrollHeight}:null},b=()=>{const B=o.current;return B?{width:B.clientWidth,height:B.clientHeight}:null},{scrollYProgress:k,scrollXProgress:g}=O.useScroll({container:o}),v=i.useRef(null);v.current||(v.current=Sn(c,(B,R)=>{!p.current||!m.current||!o.current||(R===(t==="horizontal"?"x":"y")&&(u==null||u(B)),r&&(t==="horizontal"&&R==="x"&&r({scrollProgress:B,scroll:B*(m.current.width-o.current.clientWidth),scrollTotal:m.current.width-o.current.clientWidth,scrollVisible:p.current.width}),t==="vertical"&&R==="y"&&r({scrollProgress:B,scroll:B*(m.current.height-o.current.clientHeight),scrollTotal:m.current.height-o.current.clientHeight,scrollVisible:p.current.height})))}));const W=(B,R)=>{v.current&&v.current(B,R)};i.useEffect(()=>{y.width&&W(g.get(),"x"),y.height&&W(k.get(),"y")},[y]),i.useEffect(()=>{const B=o.current,R=f.current;if(!B||!R||typeof l!="number")return;const T=(q,Y,z)=>Math.min(z,Math.max(Y,q));if(t==="horizontal"){const q=Math.max(0,(n??R.scrollWidth)-B.clientWidth);B.scrollLeft=T(l*q,0,q)}else{const q=Math.max(0,(n??R.scrollHeight)-B.clientHeight);B.scrollTop=T(l*q,0,q)}},[l,t,n]),O.useMotionValueEvent(g,"change",B=>{W(B,"x")}),O.useMotionValueEvent(k,"change",B=>{W(B,"y")});const[C,x]=i.useState(!1);i.useLayoutEffect(()=>{C||!p.current||!m.current||!r||(r({scrollProgress:0,scroll:0,scrollTotal:t=="vertical"?m.current.height:m.current.width,scrollVisible:t=="vertical"?p.current.height:p.current.width}),x(!0))},[p,m,r]),m.current=S(),p.current=b();const[E,I]=i.useState(!1),M=At({isDragging:E,children:e,className:s,onScroll:r,orientation:t,scrollSize:n,draggable:a,throttleDuration:c}),[D,L]=i.useState(0),[j,N]=i.useState(0),H=B=>{if(!a)return;const R=o.current;if(!R||D==null)return;const q=(B.pageX-R.offsetLeft-D)*1.5;R.scrollLeft=j-q},X=B=>{const R=o.current;R&&(I(!0),L(B.pageX-R.offsetLeft),N(R.scrollLeft))},_=B=>{E&&(B.preventDefault(),H(B))},P=()=>{I(!1)},F=()=>{I(!1)},U=B=>{B.preventDefault()},G=i.useRef(null);return i.useEffect(()=>()=>{G.current&&clearTimeout(G.current)},[]),i.useEffect(()=>{const B=o.current;if(!B)return;const R=T=>{var ee,$,K,Q;const q=T.detail,Y=o.current;if(!Y||!q)return;const z=q.orientation??t;if(typeof q.progress=="number")if(z==="horizontal"){const oe=Math.max(0,(((ee=m.current)==null?void 0:ee.width)??0)-Y.clientWidth);Y.scrollLeft=Math.min(oe,Math.max(0,q.progress*oe))}else{const oe=Math.max(0,((($=m.current)==null?void 0:$.height)??0)-Y.clientHeight);Y.scrollTop=Math.min(oe,Math.max(0,q.progress*oe))}else if(typeof q.scroll=="number")if(z==="horizontal"){const oe=Math.max(0,(((K=m.current)==null?void 0:K.width)??0)-Y.clientWidth);Y.scrollLeft=Math.min(oe,Math.max(0,q.scroll))}else{const oe=Math.max(0,(((Q=m.current)==null?void 0:Q.height)??0)-Y.clientHeight);Y.scrollTop=Math.min(oe,Math.max(0,q.scroll))}};return B.addEventListener("udx:customScroll:set",R),()=>{B.removeEventListener("udx:customScroll:set",R)}},[t]),d.jsxs("div",{className:M.customScroll,ref:o,onMouseDown:X,onMouseMove:_,onMouseUp:P,onMouseLeave:F,onDragStart:U,onScroll:B=>{E||(L(null),I(!0),G.current&&clearTimeout(G.current),G.current=setTimeout(()=>{I(!1)},1e3))},children:[d.jsx("div",{ref:f,style:t==="vertical"?{height:((re=p==null?void 0:p.current)==null?void 0:re.height)??"100%"}:{width:((ie=p==null?void 0:p.current)==null?void 0:ie.width)??"100%"},className:M.track,children:e}),p.current&&m.current&&d.jsxs(d.Fragment,{children:[t==="vertical"&&m.current.height>p.current.height&&d.jsx(O.motion.div,{className:"flex-none",style:{height:m.current.height-p.current.height}}),t==="horizontal"&&m.current.width>p.current.width&&d.jsx(O.motion.div,{className:"flex-none",style:{width:m.current.width-p.current.width}})]})]})};var En="1.3.17";function Ft(e,t,n){return Math.max(e,Math.min(t,n))}function Nn(e,t,n){return(1-n)*e+n*t}function Ln(e,t,n,r){return Nn(e,t,1-Math.exp(-n*r))}function kn(e,t){return(e%t+t)%t}var jn=class{constructor(){A(this,"isRunning",!1);A(this,"value",0);A(this,"from",0);A(this,"to",0);A(this,"currentTime",0);A(this,"lerp");A(this,"duration");A(this,"easing");A(this,"onUpdate")}advance(e){var n;if(!this.isRunning)return;let t=!1;if(this.duration&&this.easing){this.currentTime+=e;const r=Ft(0,this.currentTime/this.duration,1);t=r>=1;const s=t?1:this.easing(r);this.value=this.from+(this.to-this.from)*s}else this.lerp?(this.value=Ln(this.value,this.to,this.lerp*60,e),Math.round(this.value)===this.to&&(this.value=this.to,t=!0)):(this.value=this.to,t=!0);t&&this.stop(),(n=this.onUpdate)==null||n.call(this,this.value,t)}stop(){this.isRunning=!1}fromTo(e,t,{lerp:n,duration:r,easing:s,onStart:a,onUpdate:c}){this.from=this.value=e,this.to=t,this.lerp=n,this.duration=r,this.easing=s,this.currentTime=0,this.isRunning=!0,a==null||a(),this.onUpdate=c}};function In(e,t){let n;return function(...r){let s=this;clearTimeout(n),n=setTimeout(()=>{n=void 0,e.apply(s,r)},t)}}var Mn=class{constructor(e,t,{autoResize:n=!0,debounce:r=250}={}){A(this,"width",0);A(this,"height",0);A(this,"scrollHeight",0);A(this,"scrollWidth",0);A(this,"debouncedResize");A(this,"wrapperResizeObserver");A(this,"contentResizeObserver");A(this,"resize",()=>{this.onWrapperResize(),this.onContentResize()});A(this,"onWrapperResize",()=>{this.wrapper instanceof Window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)});A(this,"onContentResize",()=>{this.wrapper instanceof Window?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)});this.wrapper=e,this.content=t,n&&(this.debouncedResize=In(this.resize,r),this.wrapper instanceof Window?window.addEventListener("resize",this.debouncedResize,!1):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){var e,t;(e=this.wrapperResizeObserver)==null||e.disconnect(),(t=this.contentResizeObserver)==null||t.disconnect(),this.wrapper===window&&this.debouncedResize&&window.removeEventListener("resize",this.debouncedResize,!1)}get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}},Bt=class{constructor(){A(this,"events",{})}emit(e,...t){var r;let n=this.events[e]||[];for(let s=0,a=n.length;s<a;s++)(r=n[s])==null||r.call(n,...t)}on(e,t){var n;return(n=this.events[e])!=null&&n.push(t)||(this.events[e]=[t]),()=>{var r;this.events[e]=(r=this.events[e])==null?void 0:r.filter(s=>t!==s)}}off(e,t){var n;this.events[e]=(n=this.events[e])==null?void 0:n.filter(r=>t!==r)}destroy(){this.events={}}},Ae=100/6,ae={passive:!1},Rn=class{constructor(e,t={wheelMultiplier:1,touchMultiplier:1}){A(this,"touchStart",{x:0,y:0});A(this,"lastDelta",{x:0,y:0});A(this,"window",{width:0,height:0});A(this,"emitter",new Bt);A(this,"onTouchStart",e=>{const{clientX:t,clientY:n}=e.targetTouches?e.targetTouches[0]:e;this.touchStart.x=t,this.touchStart.y=n,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:e})});A(this,"onTouchMove",e=>{const{clientX:t,clientY:n}=e.targetTouches?e.targetTouches[0]:e,r=-(t-this.touchStart.x)*this.options.touchMultiplier,s=-(n-this.touchStart.y)*this.options.touchMultiplier;this.touchStart.x=t,this.touchStart.y=n,this.lastDelta={x:r,y:s},this.emitter.emit("scroll",{deltaX:r,deltaY:s,event:e})});A(this,"onTouchEnd",e=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:e})});A(this,"onWheel",e=>{let{deltaX:t,deltaY:n,deltaMode:r}=e;const s=r===1?Ae:r===2?this.window.width:1,a=r===1?Ae:r===2?this.window.height:1;t*=s,n*=a,t*=this.options.wheelMultiplier,n*=this.options.wheelMultiplier,this.emitter.emit("scroll",{deltaX:t,deltaY:n,event:e})});A(this,"onWindowResize",()=>{this.window={width:window.innerWidth,height:window.innerHeight}});this.element=e,this.options=t,window.addEventListener("resize",this.onWindowResize,!1),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,ae),this.element.addEventListener("touchstart",this.onTouchStart,ae),this.element.addEventListener("touchmove",this.onTouchMove,ae),this.element.addEventListener("touchend",this.onTouchEnd,ae)}on(e,t){return this.emitter.on(e,t)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize,!1),this.element.removeEventListener("wheel",this.onWheel,ae),this.element.removeEventListener("touchstart",this.onTouchStart,ae),this.element.removeEventListener("touchmove",this.onTouchMove,ae),this.element.removeEventListener("touchend",this.onTouchEnd,ae)}},Pe=e=>Math.min(1,1.001-Math.pow(2,-10*e)),Cn=class{constructor({wrapper:e=window,content:t=document.documentElement,eventsTarget:n=e,smoothWheel:r=!0,syncTouch:s=!1,syncTouchLerp:a=.075,touchInertiaExponent:c=1.7,duration:l,easing:u,lerp:o=.1,infinite:f=!1,orientation:y="vertical",gestureOrientation:h=y==="horizontal"?"both":"vertical",touchMultiplier:m=1,wheelMultiplier:p=1,autoResize:S=!0,prevent:b,virtualScroll:k,overscroll:g=!0,autoRaf:v=!1,anchors:W=!1,autoToggle:C=!1,allowNestedScroll:x=!1,__experimental__naiveDimensions:E=!1,naiveDimensions:I=E,stopInertiaOnNavigate:M=!1}={}){A(this,"_isScrolling",!1);A(this,"_isStopped",!1);A(this,"_isLocked",!1);A(this,"_preventNextNativeScrollEvent",!1);A(this,"_resetVelocityTimeout",null);A(this,"_rafId",null);A(this,"isTouching");A(this,"time",0);A(this,"userData",{});A(this,"lastVelocity",0);A(this,"velocity",0);A(this,"direction",0);A(this,"options");A(this,"targetScroll");A(this,"animatedScroll");A(this,"animate",new jn);A(this,"emitter",new Bt);A(this,"dimensions");A(this,"virtualScroll");A(this,"onScrollEnd",e=>{e instanceof CustomEvent||(this.isScrolling==="smooth"||this.isScrolling===!1)&&e.stopPropagation()});A(this,"dispatchScrollendEvent",()=>{this.options.wrapper.dispatchEvent(new CustomEvent("scrollend",{bubbles:this.options.wrapper===window,detail:{lenisScrollEnd:!0}}))});A(this,"onTransitionEnd",e=>{e.propertyName.includes("overflow")&&this.checkOverflow()});A(this,"onClick",e=>{const n=e.composedPath().filter(r=>r instanceof HTMLAnchorElement&&r.getAttribute("href"));if(this.options.anchors){const r=n.find(s=>{var a;return(a=s.getAttribute("href"))==null?void 0:a.includes("#")});if(r){const s=r.getAttribute("href");if(s){const a=typeof this.options.anchors=="object"&&this.options.anchors?this.options.anchors:void 0,c=`#${s.split("#")[1]}`;this.scrollTo(c,a)}}}this.options.stopInertiaOnNavigate&&n.find(s=>s.host===window.location.host)&&this.reset()});A(this,"onPointerDown",e=>{e.button===1&&this.reset()});A(this,"onVirtualScroll",e=>{if(typeof this.options.virtualScroll=="function"&&this.options.virtualScroll(e)===!1)return;const{deltaX:t,deltaY:n,event:r}=e;if(this.emitter.emit("virtual-scroll",{deltaX:t,deltaY:n,event:r}),r.ctrlKey||r.lenisStopPropagation)return;const s=r.type.includes("touch"),a=r.type.includes("wheel");this.isTouching=r.type==="touchstart"||r.type==="touchmove";const c=t===0&&n===0;if(this.options.syncTouch&&s&&r.type==="touchstart"&&c&&!this.isStopped&&!this.isLocked){this.reset();return}const u=this.options.gestureOrientation==="vertical"&&n===0||this.options.gestureOrientation==="horizontal"&&t===0;if(c||u)return;let o=r.composedPath();o=o.slice(0,o.indexOf(this.rootElement));const f=this.options.prevent;if(o.find(b=>{var k,g,v;return b instanceof HTMLElement&&(typeof f=="function"&&(f==null?void 0:f(b))||((k=b.hasAttribute)==null?void 0:k.call(b,"data-lenis-prevent"))||s&&((g=b.hasAttribute)==null?void 0:g.call(b,"data-lenis-prevent-touch"))||a&&((v=b.hasAttribute)==null?void 0:v.call(b,"data-lenis-prevent-wheel"))||this.options.allowNestedScroll&&this.checkNestedScroll(b,{deltaX:t,deltaY:n}))}))return;if(this.isStopped||this.isLocked){r.cancelable&&r.preventDefault();return}if(!(this.options.syncTouch&&s||this.options.smoothWheel&&a)){this.isScrolling="native",this.animate.stop(),r.lenisStopPropagation=!0;return}let h=n;this.options.gestureOrientation==="both"?h=Math.abs(n)>Math.abs(t)?n:t:this.options.gestureOrientation==="horizontal"&&(h=t),(!this.options.overscroll||this.options.infinite||this.options.wrapper!==window&&this.limit>0&&(this.animatedScroll>0&&this.animatedScroll<this.limit||this.animatedScroll===0&&n>0||this.animatedScroll===this.limit&&n<0))&&(r.lenisStopPropagation=!0),r.cancelable&&r.preventDefault();const m=s&&this.options.syncTouch,S=s&&r.type==="touchend";S&&(h=Math.sign(this.velocity)*Math.pow(Math.abs(this.velocity),this.options.touchInertiaExponent)),this.scrollTo(this.targetScroll+h,{programmatic:!1,...m?{lerp:S?this.options.syncTouchLerp:1}:{lerp:this.options.lerp,duration:this.options.duration,easing:this.options.easing}})});A(this,"onNativeScroll",()=>{if(this._resetVelocityTimeout!==null&&(clearTimeout(this._resetVelocityTimeout),this._resetVelocityTimeout=null),this._preventNextNativeScrollEvent){this._preventNextNativeScrollEvent=!1;return}if(this.isScrolling===!1||this.isScrolling==="native"){const e=this.animatedScroll;this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity,this.velocity=this.animatedScroll-e,this.direction=Math.sign(this.animatedScroll-e),this.isStopped||(this.isScrolling="native"),this.emit(),this.velocity!==0&&(this._resetVelocityTimeout=setTimeout(()=>{this.lastVelocity=this.velocity,this.velocity=0,this.isScrolling=!1,this.emit()},400))}});A(this,"raf",e=>{const t=e-(this.time||e);this.time=e,this.animate.advance(t*.001),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))});window.lenisVersion=En,(!e||e===document.documentElement)&&(e=window),typeof l=="number"&&typeof u!="function"?u=Pe:typeof u=="function"&&typeof l!="number"&&(l=1),this.options={wrapper:e,content:t,eventsTarget:n,smoothWheel:r,syncTouch:s,syncTouchLerp:a,touchInertiaExponent:c,duration:l,easing:u,lerp:o,infinite:f,gestureOrientation:h,orientation:y,touchMultiplier:m,wheelMultiplier:p,autoResize:S,prevent:b,virtualScroll:k,overscroll:g,autoRaf:v,anchors:W,autoToggle:C,allowNestedScroll:x,naiveDimensions:I,stopInertiaOnNavigate:M},this.dimensions=new Mn(e,t,{autoResize:S}),this.updateClassName(),this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll,!1),this.options.wrapper.addEventListener("scrollend",this.onScrollEnd,{capture:!0}),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.addEventListener("click",this.onClick,!1),this.options.wrapper.addEventListener("pointerdown",this.onPointerDown,!1),this.virtualScroll=new Rn(n,{touchMultiplier:m,wheelMultiplier:p}),this.virtualScroll.on("scroll",this.onVirtualScroll),this.options.autoToggle&&(this.checkOverflow(),this.rootElement.addEventListener("transitionend",this.onTransitionEnd,{passive:!0})),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))}destroy(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll,!1),this.options.wrapper.removeEventListener("scrollend",this.onScrollEnd,{capture:!0}),this.options.wrapper.removeEventListener("pointerdown",this.onPointerDown,!1),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.removeEventListener("click",this.onClick,!1),this.virtualScroll.destroy(),this.dimensions.destroy(),this.cleanUpClassName(),this._rafId&&cancelAnimationFrame(this._rafId)}on(e,t){return this.emitter.on(e,t)}off(e,t){return this.emitter.off(e,t)}get overflow(){const e=this.isHorizontal?"overflow-x":"overflow-y";return getComputedStyle(this.rootElement)[e]}checkOverflow(){["hidden","clip"].includes(this.overflow)?this.internalStop():this.internalStart()}setScroll(e){this.isHorizontal?this.options.wrapper.scrollTo({left:e,behavior:"instant"}):this.options.wrapper.scrollTo({top:e,behavior:"instant"})}resize(){this.dimensions.resize(),this.animatedScroll=this.targetScroll=this.actualScroll,this.emit()}emit(){this.emitter.emit("scroll",this)}reset(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity=0,this.animate.stop()}start(){if(this.isStopped){if(this.options.autoToggle){this.rootElement.style.removeProperty("overflow");return}this.internalStart()}}internalStart(){this.isStopped&&(this.reset(),this.isStopped=!1,this.emit())}stop(){if(!this.isStopped){if(this.options.autoToggle){this.rootElement.style.setProperty("overflow","clip");return}this.internalStop()}}internalStop(){this.isStopped||(this.reset(),this.isStopped=!0,this.emit())}scrollTo(e,{offset:t=0,immediate:n=!1,lock:r=!1,programmatic:s=!0,lerp:a=s?this.options.lerp:void 0,duration:c=s?this.options.duration:void 0,easing:l=s?this.options.easing:void 0,onStart:u,onComplete:o,force:f=!1,userData:y}={}){if(!((this.isStopped||this.isLocked)&&!f)){if(typeof e=="string"&&["top","left","start","#"].includes(e))e=0;else if(typeof e=="string"&&["bottom","right","end"].includes(e))e=this.limit;else{let h;if(typeof e=="string"?(h=document.querySelector(e),h||(e==="#top"?e=0:console.warn("Lenis: Target not found",e))):e instanceof HTMLElement&&(e!=null&&e.nodeType)&&(h=e),h){if(this.options.wrapper!==window){const p=this.rootElement.getBoundingClientRect();t-=this.isHorizontal?p.left:p.top}const m=h.getBoundingClientRect();e=(this.isHorizontal?m.left:m.top)+this.animatedScroll}}if(typeof e=="number"){if(e+=t,e=Math.round(e),this.options.infinite){if(s){this.targetScroll=this.animatedScroll=this.scroll;const h=e-this.animatedScroll;h>this.limit/2?e=e-this.limit:h<-this.limit/2&&(e=e+this.limit)}}else e=Ft(0,e,this.limit);if(e===this.targetScroll){u==null||u(this),o==null||o(this);return}if(this.userData=y??{},n){this.animatedScroll=this.targetScroll=e,this.setScroll(this.scroll),this.reset(),this.preventNextNativeScrollEvent(),this.emit(),o==null||o(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()});return}s||(this.targetScroll=e),typeof c=="number"&&typeof l!="function"?l=Pe:typeof l=="function"&&typeof c!="number"&&(c=1),this.animate.fromTo(this.animatedScroll,e,{duration:c,easing:l,lerp:a,onStart:()=>{r&&(this.isLocked=!0),this.isScrolling="smooth",u==null||u(this)},onUpdate:(h,m)=>{this.isScrolling="smooth",this.lastVelocity=this.velocity,this.velocity=h-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=h,this.setScroll(this.scroll),s&&(this.targetScroll=h),m||this.emit(),m&&(this.reset(),this.emit(),o==null||o(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()}),this.preventNextNativeScrollEvent())}})}}}preventNextNativeScrollEvent(){this._preventNextNativeScrollEvent=!0,requestAnimationFrame(()=>{this._preventNextNativeScrollEvent=!1})}checkNestedScroll(e,{deltaX:t,deltaY:n}){const r=Date.now(),s=e._lenis??(e._lenis={});let a,c,l,u,o,f,y,h;const m=this.options.gestureOrientation;if(r-(s.time??0)>2e3){s.time=Date.now();const C=window.getComputedStyle(e);s.computedStyle=C;const x=C.overflowX,E=C.overflowY;if(a=["auto","overlay","scroll"].includes(x),c=["auto","overlay","scroll"].includes(E),s.hasOverflowX=a,s.hasOverflowY=c,!a&&!c||m==="vertical"&&!c||m==="horizontal"&&!a)return!1;o=e.scrollWidth,f=e.scrollHeight,y=e.clientWidth,h=e.clientHeight,l=o>y,u=f>h,s.isScrollableX=l,s.isScrollableY=u,s.scrollWidth=o,s.scrollHeight=f,s.clientWidth=y,s.clientHeight=h}else l=s.isScrollableX,u=s.isScrollableY,a=s.hasOverflowX,c=s.hasOverflowY,o=s.scrollWidth,f=s.scrollHeight,y=s.clientWidth,h=s.clientHeight;if(!a&&!c||!l&&!u||m==="vertical"&&(!c||!u)||m==="horizontal"&&(!a||!l))return!1;let p;if(m==="horizontal")p="x";else if(m==="vertical")p="y";else{const C=t!==0,x=n!==0;C&&a&&l&&(p="x"),x&&c&&u&&(p="y")}if(!p)return!1;let S,b,k,g,v;if(p==="x")S=e.scrollLeft,b=o-y,k=t,g=a,v=l;else if(p==="y")S=e.scrollTop,b=f-h,k=n,g=c,v=u;else return!1;return(k>0?S<b:S>0)&&g&&v}get rootElement(){return this.options.wrapper===window?document.documentElement:this.options.wrapper}get limit(){return this.options.naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?"x":"y"]}get isHorizontal(){return this.options.orientation==="horizontal"}get actualScroll(){const e=this.options.wrapper;return this.isHorizontal?e.scrollX??e.scrollLeft:e.scrollY??e.scrollTop}get scroll(){return this.options.infinite?kn(this.animatedScroll,this.limit):this.animatedScroll}get progress(){return this.limit===0?1:this.scroll/this.limit}get isScrolling(){return this._isScrolling}set isScrolling(e){this._isScrolling!==e&&(this._isScrolling=e,this.updateClassName())}get isStopped(){return this._isStopped}set isStopped(e){this._isStopped!==e&&(this._isStopped=e,this.updateClassName())}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this.updateClassName())}get isSmooth(){return this.isScrolling==="smooth"}get className(){let e="lenis";return this.options.autoToggle&&(e+=" lenis-autoToggle"),this.isStopped&&(e+=" lenis-stopped"),this.isLocked&&(e+=" lenis-locked"),this.isScrolling&&(e+=" lenis-scrolling"),this.isScrolling==="smooth"&&(e+=" lenis-smooth"),e}updateClassName(){this.cleanUpClassName(),this.rootElement.className=`${this.rootElement.className} ${this.className}`.trim()}cleanUpClassName(){this.rootElement.className=this.rootElement.className.replace(/lenis(-\w+)?/g,"").trim()}};const Dn=({transition:e=1.2,easing:t,orientation:n="vertical",smoothTouch:r=!1,touchMultiplier:s=2,children:a})=>{const c=i.useRef(null),l=i.useRef(null);return i.useEffect(()=>{let u;typeof e=="string"?e.endsWith("ms")?u=parseFloat(e)/1e3:e.endsWith("s")?u=parseFloat(e):u=parseFloat(e)||1.2:u=e;const o=y=>1-Math.pow(1-y,5);c.current=new Cn({duration:u,easing:t??o,orientation:n,smoothWheel:!0,touchMultiplier:s,syncTouch:r});const f=y=>{var h;(h=c.current)==null||h.raf(y),l.current=requestAnimationFrame(f)};return l.current=requestAnimationFrame(f),()=>{var y;l.current!==null&&cancelAnimationFrame(l.current),(y=c.current)==null||y.destroy(),c.current=null}},[e,t,n,r,s]),a?d.jsx(d.Fragment,{children:a}):null},ce=({style:e,colorName:t,stateClassName:n="state-ripple-group",className:r})=>{const s=i.useRef(null),a=i.useRef(null),[c,l]=i.useState(!1),u=Tt({isClient:c,stateClassName:n,className:r,colorName:t});return i.useEffect(()=>{if(s.current&&n!=="state-layer"){const f=(n.includes("[")?"group/"+n.split("[")[1].split("]")[0]:"group").replace(/\//g,"\\/"),y=s.current.closest(`.${f}:not(.${f} .${f})`);a.current=y}l(!0)},[]),d.jsx("div",{ref:s,className:u.stateLayer,style:{"--state-color":`var(--default-color, var(--color-${t}))`,...e},children:c&&d.jsx(Wt,{triggerRef:a})})},$n=({isClient:e,stateClassName:t})=>({stateLayer:w([t,"w-full top-0 left-0 h-full absolute pointer-events-none overflow-hidden"])}),Tt=J("stateLayer",$n),Ht=({targetRef:e,children:t})=>{const[n,r]=i.useState(null),s=i.useRef(null),a=()=>{const c=e.current;if(!c)return;const l=c.getBoundingClientRect();r({position:"fixed",top:l.top,left:l.left,width:l.width,height:l.height,pointerEvents:"none",zIndex:999})};return i.useEffect(()=>{const c=e.current;if(c)return a(),window.addEventListener("scroll",a,!0),window.addEventListener("resize",a),s.current=new ResizeObserver(a),s.current.observe(c),()=>{var l;window.removeEventListener("scroll",a,!0),window.removeEventListener("resize",a),(l=s.current)==null||l.disconnect()}},[e]),n?qe.createPortal(d.jsx("div",{style:n,children:t}),document.body):null};function Wn(e){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e)}const An=({config:e,throttleDelay:t=100,onLoad:n,loadTheme:r=!1})=>{const[s,a]=i.useState(null);i.useEffect(()=>{(async()=>{const h=await xe.loader(e,r);a(h)})()},[]);const[c,l]=i.useState(null),u=i.useRef(null),o=i.useRef(0),f=i.useRef(null);i.useEffect(()=>{if(!s)return;const h={...e,sourceColor:e.sourceColor},m=Date.now(),p=m-o.current,S=async b=>{await y(b)};if(o.current===0||p>=t)u.current&&(clearTimeout(u.current),u.current=null),f.current=null,o.current=m,S(h);else if(f.current=h,!u.current){const b=Math.max(0,t-p);u.current=setTimeout(async()=>{u.current=null;const k=f.current;f.current=null,k&&(o.current=Date.now(),await S(k))},b)}return()=>{}},[e,t,s]);const y=async h=>{if(typeof h.sourceColor=="string"&&!Wn(h.sourceColor))throw new Error("Invalid hex color");if(!s)return;s.context.update(h),await s.load();const m=s==null?void 0:s.plugins.getPlugin(Xe.TailwindPlugin).getInstance().outputCss;l(m),n==null||n(s)};return i.useEffect(()=>()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]),c?d.jsx("style",{dangerouslySetInnerHTML:{__html:c}}):null};function Pn(){if(typeof window>"u")return!1;try{if(window.CSS&&typeof window.CSS.supports=="function")return CSS.supports("animation-timeline: view()")||CSS.supports("animation-timeline: scroll()")||CSS.supports("view-timeline-name: --a")}catch{}return!1}function Fn(){return typeof window>"u"||!("matchMedia"in window)?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function Me(e){if(!(e instanceof HTMLElement))return!1;const t=e.classList;return Array.from(t).some(n=>n.startsWith("anim-")&&n.includes("scroll"))}function Fe(e){if(!(e instanceof HTMLElement))return!1;const t=e.classList;return Array.from(t).some(n=>n.startsWith("anim-"))}function Se(e,t){if(!Me(e))return;if(e.hasAttribute(`data-${t}-scroll`)){const c=(e.getAttribute(`data-${t}-scroll`)||"").trim().toLowerCase(),l=c==="x"||c==="inline"?"inline":c==="y"||c==="block"?"block":"auto";e.classList.contains(`${t}-timeline`)||e.classList.contains(`${t}-timeline-inline`)||e.classList.contains(`${t}-timeline-block`)||e.classList.contains(`${t}-timeline-x`)||e.classList.contains(`${t}-timeline-y`)||(l==="inline"?e.classList.add(`${t}-timeline-inline`):l==="block"?e.classList.add(`${t}-timeline-block`):e.classList.add(`${t}-scroll`))}const n=e.getAttribute(`data-${t}-start`);n&&e.style.setProperty(`--${t}-range-start`,n);const r=e.getAttribute(`data-${t}-end`);r&&e.style.setProperty(`--${t}-range-end`,r);const s=e.hasAttribute(`data-${t}-paused`)||e.classList.contains(`${t}-paused`),a=e.hasAttribute(`data-${t}-run`)||e.classList.contains(`${t}-run`);!s&&!a&&e.setAttribute(`data-${t}-run`,"")}function Ee(e=document,t){return Array.from(e.querySelectorAll(`[class*="${t}-"][class*="-scroll"]`)).filter(r=>Me(r))}function Bn(e=document,t){const n=Array.from(e.querySelectorAll(`[class*="${t}-"]`)),r=new Set([`${t}-run`,`${t}-in`,`${t}-out`,`${t}-in-run`,`${t}-out-run`,`${t}-paused`,`${t}-timeline`,`${t}-timeline-inline`,`${t}-timeline-block`,`${t}-timeline-x`,`${t}-timeline-y`,`${t}-scroll`]);return n.filter(s=>{if(!(s instanceof HTMLElement))return!1;const a=s.classList;return a.contains(`${t}-in`)||a.contains(`${t}-out`)||Array.from(a).some(u=>u.startsWith(`${t}-`)&&!u.includes("scroll")&&!r.has(u))?!0:!Me(s)})}function Tn(e,t){return Array.from(e).some(n=>n.startsWith(t)&&n.includes("-out"))}function Be(e,t,n){e.setAttribute(`data-${t}-run`,""),e.setAttribute(`data-${t}-${n}-run`,"")}function Te(e,t,n){const r=e.style.animationName;e.style.animationName="none",e.removeAttribute(`data-${t}-run`),n?e.removeAttribute(`data-${t}-${n}-run`):(e.removeAttribute(`data-${t}-in-run`),e.removeAttribute(`data-${t}-out-run`)),e.offsetWidth,e.style.animationName=r}const Hn=[0,.2],He=new WeakSet;function Oe(e,t){if(He.has(e))return;He.add(e);const n=s=>{s.target===e&&(e.hasAttribute(`data-${t}-in-run`)||e.hasAttribute(`data-${t}-out-run`))&&e.setAttribute(`data-${t}-animating`,"")},r=s=>{s.target===e&&e.removeAttribute(`data-${t}-animating`)};e.addEventListener("animationstart",n),e.addEventListener("animationend",r),e.addEventListener("animationcancel",r)}function Re(e={}){const{prefix:t="anim",once:n=!0}=e;if(Fn())return()=>{};const r=Pn(),s=new WeakSet;let a=typeof window<"u"&&(window.pageYOffset||window.scrollY)||0,c=!0;const l=()=>{const m=window.pageYOffset||window.scrollY||0;c=m>=a,a=m};typeof window<"u"&&window.addEventListener("scroll",l,{passive:!0});const u=new IntersectionObserver(m=>{for(const p of m){const S=p.target;if(!Fe(S)||S.hasAttribute(`data-${t}-animating`))continue;const b=Tn(S.classList,t);p.isIntersecting?(b&&Te(S,t,"out"),Be(S,t,"in"),n&&u.unobserve(S)):n||(c||Te(S,t,"in"),b&&Be(S,t,"out"))}},{threshold:Hn}),o=m=>{const p=Bn(m||document,t);for(const S of p)s.has(S)||(s.add(S),u.observe(S),Oe(S,t))};o();let f,y=null,h=null;if(r)(()=>{h==null&&(h=requestAnimationFrame(()=>{h=null;const p=Ee(void 0,t);for(const S of p)Se(S,t)}))})(),y=new MutationObserver(p=>{for(const S of p)if(S.type==="attributes"){const b=S.target;b instanceof HTMLElement&&(Se(b,t),Fe(b)&&(s.has(b)||(s.add(b),u.observe(b),Oe(b,t))))}else if(S.type==="childList"&&S.addedNodes&&S.addedNodes.length){for(const b of Array.from(S.addedNodes))if(b instanceof HTMLElement){const k=Ee(b,t);for(const g of k)Se(g,t);o(b)}}}),y.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["class",`data-${t}-scroll`,`data-${t}-start`,`data-${t}-end`,`data-${t}-paused`,`data-${t}-run`]}),f=()=>{h!=null&&cancelAnimationFrame(h),y&&y.disconnect()};else{let m;Ee(void 0,t).length>0&&Promise.resolve().then(()=>require("./scrollDriven-DWAu7CR0.cjs")).then(S=>{m=S.initScrollViewFallback({once:n})}),f=()=>{typeof m=="function"&&m()}}return()=>{f&&f(),typeof window<"u"&&window.removeEventListener("scroll",l),u.disconnect()}}const On=Re,Vn=Re;function _n(e){const t={primary:"filled",secondary:"tonal"};return e&&e in t?t[e]:e||"filled"}const Ce=({variant:e="filled",disabled:t=!1,icon:n,href:r,label:s,disableTextMargins:a,className:c,iconPosition:l="left",loading:u=!1,shape:o="rounded",onClick:f,onToggle:y,activated:h,ref:m,size:p="medium",allowShapeTransformation:S=!0,transition:b,children:k,...g})=>{if(k&&(s=k),!s)throw new Error("Button component requires either a label prop or children content");e=_n(e);const v=r?"a":"button",W=i.useRef(null),C=m||W,[x,E]=i.useState(h);i.useEffect(()=>{E(h)},[h]),b={duration:.3,...b};const I=L=>{t&&L.preventDefault(),y?(E(!x),y(!x)):f&&f(L)},M=Ke({allowShapeTransformation:S,size:p,disableTextMargins:a,shape:o,href:r,disabled:t,icon:n,iconPosition:l,loading:u,variant:e,transition:b,className:c,isActive:x??!1,onToggle:y,activated:x,label:s,children:s}),D=n?d.jsx(le,{icon:n,className:M.icon}):d.jsx(d.Fragment,{});return d.jsxs(v,{ref:C,href:r,className:M.button,...g,onClick:I,disabled:t,"aria-pressed":y?x:void 0,style:{transition:b.duration+"s"},children:[d.jsx("div",{className:M.touchTarget}),d.jsx(ce,{style:{transition:b.duration+"s"},className:M.stateLayer,colorName:w(e==="filled"&&{"on-surface-variant":!x&&!!y,"on-primary":x||!y},e==="elevated"&&{"on-primary":x&&!!y,primary:!x||!y},e==="tonal"&&{"on-secondary":x&&!!y,"on-secondary-container":!x||!y},e==="outlined"&&{"inverse-on-surface":x&&!!y,"on-surface-variant":!x||!y},e==="text"&&"primary"),stateClassName:"state-ripple-group-[button]"}),l==="left"&&D,u&&d.jsx("div",{className:"!absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2",children:d.jsx($t,{className:()=>({progressIndicator:"h-6 w-6",activeIndicator:w({"!stroke-primary":e==="elevated"&&!t,"!stroke-on-surface/[38%]":e==="elevated"&&t},{"!stroke-on-primary":e==="filled"&&!t,"!stroke-on-surface/[38%]":e==="filled"&&t},{"!stroke-on-secondary-container":e==="tonal"&&!t,"!stroke-on-surface/[38%]":e==="tonal"&&t},{"!stroke-primary":e==="outlined"&&!t,"!stroke-on-surface/[38%]":e==="outlined"&&t},{"!stroke-primary":e==="text"&&!t,"!stroke-on-surface/[38%]":e==="text"&&t})}),variant:"circular-indeterminate"})}),d.jsx("span",{className:M.label,children:s}),l==="right"&&D]})},qn=({variant:e="outlined",className:t,children:n,isInteractive:r=!1,ref:s,...a})=>{const c=Je({className:t,isInteractive:r,variant:e,children:n}),l=i.useRef(null),u=s||l;return d.jsxs("div",{...a,ref:u,className:c.card,children:[r&&d.jsx(ce,{className:c.stateLayer,colorName:"on-surface",stateClassName:"state-ripple-group-[card]"}),n]})},de=(e,t,n=[0,1])=>{const[r,s]=t,[a,c]=n,u=(Math.max(r,Math.min(e,s))-r)/(s-r);return a+u*(c-a)},Ot=({className:e,children:t,width:n,index:r=0,outputRange:s,ref:a,...c})=>{const l=i.useRef(null),u=a||l,o=Ze({className:e,index:r,width:n,children:t,outputRange:s});return d.jsx("div",{ref:u,style:{width:n+"px",maxWidth:s[1]+"px",minWidth:s[0]+"px",willChange:"width"},transition:{duration:.5,ease:"linear"},className:o.carouselItem,...c,children:t})},Xn=({variant:e="hero",className:t,children:n,ref:r,marginPourcent:s=0,inputRange:a=[.21,.65],outputRange:c=[42,300],gap:l=8,onChange:u,onMetricsChange:o,index:f,scrollSensitivity:y=1.25,...h})=>{const m=i.useRef(null),p=r||m,[S,b]=i.useState(0),k=et({index:f,className:t,children:n,variant:e,inputRange:a,outputRange:c,marginPourcent:s,onChange:u,gap:l,scrollSensitivity:y,onMetricsChange:o}),g=i.Children.toArray(n).filter(R=>i.isValidElement(R)&&R.type===Ot),v=i.useRef(null),[W,C]=i.useState({}),[x,E]=i.useState(null),I=i.useRef(0),M=i.useRef(null),D=()=>{var ue,fe;if(!v.current||!p.current||(x==null?void 0:x.scrollProgress)===void 0)return[];const R=(x==null?void 0:x.scrollVisible)??((ue=p.current)==null?void 0:ue.clientWidth)??0;function T(V,te){return V.map((se,he)=>{const be=(se-te)/Math.abs(V[1]-V[0]);return{itemScrollXCenter:se,relativeIndex:be,index:he,width:0}})}const q=g.map((V,te)=>{if(!L[te].current||!v.current)return 0;const he=te/(g.length-1);return de(he,[0,1],[0,1])}),Y=T(q,(x==null?void 0:x.scrollProgress)??0).sort((V,te)=>V.index-te.index);let z=(((fe=p.current)==null?void 0:fe.clientWidth)??R)+l+c[0]+l;const ee=Y.sort((V,te)=>Math.abs(V.relativeIndex)-Math.abs(te.relativeIndex)).map((V,te)=>{if(!(z<=0)){if(te==0&&N(V.index),V.width=de(z-l,[c[0],c[1]],[c[0],c[1]]),z-=V.width+l,z!=0&&z<(c[0]+l)*2){const se=V.width-((c[0]+l)*2-z);z+=V.width,V.width=se,z-=V.width}else if(z==0&&V.width>=c[0]*2+l){const se=V.width-(c[0]+l-z);z+=V.width,V.width=se,z-=V.width}return V}}).filter(Boolean),$=ee.reverse(),K=[...ee].sort((V,te)=>Math.abs(V.index)-Math.abs(te.index));$.forEach((V,te)=>{const se=$[te+1];if(!se)return;const he=1-(Math.abs(V.relativeIndex)-Math.abs(se==null?void 0:se.relativeIndex)),be=de(he,[0,2],[V.width+z,se.width]);z+=V.width,V.width=be,z-=V.width});const Q=ee.length/2,oe=de(Math.abs(K[0].relativeIndex),[K[0].index==0?0:Q-1,Q],[0,1]),ge=de(oe,[0,1],[0,1])*-(c[0]+l);return b(ge),Object.fromEntries(ee.map(V=>[V.index,V.width]))},L=i.useRef([]).current,[j,N]=i.useState(0);i.useEffect(()=>{u&&u(j)},[j]),i.useEffect(()=>{typeof f=="number"&&g.length>0&&f!==j&&_(f)},[f,g.length]),i.useEffect(()=>{X(j)},[j]),L.length!==g.length&&g.forEach((R,T)=>{L[T]||(L[T]=i.createRef())});const[H,X]=i.useState(0),_=(R,T={})=>{if(!g.length)return 0;const q=L[R];if(!q||!q.current||!v.current)return 0;const Y=de(R/Math.max(1,g.length-1),[0,1],[0,1]);return X(R),v.current.dispatchEvent(new CustomEvent("udx:customScroll:set",{bubbles:!0,detail:{progress:Y,orientation:"horizontal",animate:T.animate!==!1}})),Y},P=g.map((R,T)=>{var ee;const q=(ee=R.props)==null?void 0:ee.onClick,Y=$=>{q==null||q($)},z=()=>X(T);return i.cloneElement(R,{width:W[T],outputRange:c,ref:L[T],key:T,index:T,role:"option","aria-selected":j===T,tabIndex:j===T?0:-1,onClick:Y,onFocus:z})}),F=R=>{var T;if(R.scrollTotal>0){(T=M.current)==null||T.stop();const q=I.current??0,Y=R.scrollProgress??0;M.current=O.animate(q,Y,{type:"spring",stiffness:260,damping:32,mass:.6,restDelta:5e-4,onUpdate:z=>{I.current=z,E({...R,scrollProgress:z})}})}};i.useEffect(()=>{const R=D();C(R)},[x]);const U=i.useRef(o);i.useEffect(()=>{U.current=o},[o]);const G=i.useRef(null);i.useEffect(()=>{var te;const R=U.current;if(!R||!(p!=null&&p.current))return;const T=g.length;if(T<=0)return;const q=((te=p.current)==null?void 0:te.clientWidth)??0,Y=c[1],z=I.current??(x==null?void 0:x.scrollProgress)??0,ee=(q+l)/(Y+l),$=Math.max(1,Math.floor(ee)),K=Math.max(1,Math.round($*(2/3))),Q=Math.min(Math.max(0,j),Math.max(0,T-1)),oe=Q>0,ge=Q<T-1,ue={total:T,selectedIndex:Q,visibleApprox:ee,visibleFull:$,stepHalf:K,canPrev:oe,canNext:ge,scrollProgress:z,viewportWidth:q,itemMaxWidth:Y,gap:l},fe=G.current;let V=!fe;if(!V){for(const se in ue)if(ue[se]!==fe[se]){V=!0;break}}V&&(G.current=ue,R(ue))},[p,g.length,j,x,l,c]),i.useEffect(()=>()=>{var R;(R=M.current)==null||R.stop()},[]);const[re,ie]=i.useState(0);i.useLayoutEffect(()=>{let R=c[1];x&&R>x.scrollVisible&&(R=x.scrollVisible);const T=(R+l)*P.length/y;ie(T)},[p,L,x]);const B=R=>{if(!g.length)return;const T=H??j;switch(R.key){case"ArrowLeft":R.preventDefault(),_(Math.max(0,T-1));break;case"ArrowRight":R.preventDefault(),_(Math.min(g.length-1,T+1));break;case"Home":R.preventDefault(),_(0);break;case"End":R.preventDefault(),_(g.length-1);break;case"Enter":case" ":R.preventDefault(),_(T);break}};return i.useEffect(()=>{const R=p.current;if(!R)return;const T=q=>{const Y=q.detail;Y&&typeof Y.index=="number"&&_(Y.index)};return R.addEventListener("udx:carousel:centerIndex",T),()=>{R.removeEventListener("udx:carousel:centerIndex",T)}},[p,g.length]),d.jsx("div",{className:k.carousel,ref:p,role:"listbox","aria-orientation":"horizontal",onKeyDown:B,...h,children:d.jsx(Pt,{draggable:!0,orientation:"horizontal",onScroll:F,scrollSize:re,children:d.jsx("div",{className:k.track,ref:v,style:{gap:`${l}px`,translate:S,willChange:"translate"},children:P})})})};/*!
|
|
1
|
+
"use strict";var Jt=Object.defineProperty;var Zt=(e,t,n)=>t in e?Jt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var B=(e,t,n)=>Zt(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),Ve=require("clsx"),Qt=require("tailwind-merge"),o=require("react"),q=require("motion/react"),_e=require("react-dom"),xe=require("@udixio/theme"),ze=require("@udixio/tailwind"),en=require("react-textarea-autosize"),Ye=Qt.extendTailwindMerge({override:{classGroups:{"text-color":[{text:[e=>!e.startsWith("display-")&&!e.startsWith("headline-")&&!e.startsWith("title-")&&!e.startsWith("body-")&&!e.startsWith("label-")]}]}},extend:{classGroups:{font:[{text:[e=>e.startsWith("display-")||e.startsWith("headline-")||e.startsWith("title-")||e.startsWith("body-")||e.startsWith("label-")]}]},conflictingClassGroups:{font:["font"]}}}),v=(...e)=>Ye(Ve.clsx(e)),qe=(...e)=>Ye(Ve.clsx(e));function tn(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}const ge=e=>{const t={};e.classNameList.forEach(r=>{var s;if(r)if(typeof r=="string")(t[s=e.default]??(t[s]=[])).push(r);else{const a=r(e.states);Object.entries(a).map(c=>{const[l,d]=c;(t[l]??(t[l]=[])).push(d)})}});const n=t;return Object.entries(t).map(r=>{let[s,a]=r;a=a.reverse(),s==e.default&&a.unshift("relative"),a.unshift(tn(s)),n[s]=qe(...a)}),n},ee=(e,t)=>n=>ge({classNameList:[n.className,t],default:e,states:n}),Z=(e,t)=>n=>o.useMemo(()=>ge({classNameList:[n.className,t],default:e,states:n}),[n]);function nn(e,t,n){return o.useMemo(()=>ge({classNameList:[n==null?void 0:n.className,t],default:e,states:n}),[e,t,n])}const Xe=({variant:e,disableTextMargins:t,disabled:n,iconPosition:r,icon:s,isActive:a,loading:c,shape:l,onToggle:d,size:i,allowShapeTransformation:f})=>({button:v(" relative cursor-pointer group/button outline-none inline-block flex justify-center items-center ",i==="xSmall"&&"text-label-large px-3 py-1.5 gap-1",i==="small"&&"text-label-large px-4 py-2.5 gap-2",i==="medium"&&"text-title-medium px-6 py-4 gap-2",i==="large"&&"text-headline-small px-12 py-8 gap-3",i==="xLarge"&&"text-headline-large px-16 py-12 gap-4",l==="rounded"&&{"rounded-[30px]":i==="xSmall"||i=="small","rounded-[40px]":i==="medium","rounded-[70px]":i==="large"||i=="xLarge"},(l==="squared"||f&&a)&&{"rounded-[12px]":i==="xSmall"||i=="small","rounded-[16px]":i==="medium","rounded-[28px]":i==="large"||i=="xLarge"},f&&!n&&{"active:rounded-[12px]":i==="xSmall"||i=="small","active:rounded-[16px]":i==="medium","active:rounded-[28px]":i==="large"||i=="xLarge"},e==="elevated"&&{"shadow-1 hover:shadow-2":!n,"bg-surface-container-low text-primary":!n&&!a,"bg-primary text-on-primary":!n&&a,"text-on-surface/[38%]":n},e==="filled"&&{"hover:shadow-1":!n,"bg-surface-container text-on-surface-variant":!n&&!a&&d,"bg-primary text-on-primary":!n&&(a&&d||!d),"text-on-surface/[38%]":n},e==="tonal"&&{"hover:shadow-1":!n,"bg-secondary-container text-on-secondary-container":!n&&!a,"bg-secondary text-on-secondary":!n&&a,"text-on-surface/[0.38]":n},e==="outlined"&&[" border",{"border-on-surface/[0.12] text-on-surface/[0.38]":n,"text-primary border-outline focus:border-primary":!n&&!a,"text-inverse-on-surface bg-inverse-surface border-inverse-surface":!n&&a}],e==="text"&&["w-fit",{"text-primary":!n,"text-on-surface/[0.38]":n},t&&[i==="xSmall"&&"-mx-3 ",i==="small"&&"-mx-4 ",i==="medium"&&"-mx-6 ",i==="large"&&"-mx-12",i==="xLarge"&&"-mx-16 "]],n&&"cursor-default"),touchTarget:v("absolute -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/2 h-12 w-full"),stateLayer:v("overflow-hidden",l==="rounded"&&{"rounded-[30px]":i==="xSmall"||i=="small","rounded-[40px]":i==="medium","rounded-[70px]":i==="large"||i=="xLarge"},(l==="squared"||f&&a)&&{"rounded-[12px]":i==="xSmall"||i=="small","rounded-[16px]":i==="medium","rounded-[28px]":i==="large"||i=="xLarge"},f&&!n&&{"group-active/button:rounded-[12px]":i==="xSmall"||i=="small","group-active/button:rounded-[16px]":i==="medium","group-active/button:rounded-[28px]":i==="large"||i=="xLarge"}),label:v({invisible:c}),icon:v({invisible:c},i==="xSmall"&&"size-5",i==="small"&&"size-5",i==="medium"&&"size-6",i==="large"&&"size-8",i==="xLarge"&&"size-10")}),sn=ee("button",Xe),Ue=Z("button",Xe),Ke=({variant:e,isInteractive:t})=>({card:v(" rounded-xl overflow-hidden ",e==="outlined"&&"bg-surface border border-outline-variant",e==="elevated"&&"bg-surface-container-low shadow-1",e==="filled"&&"bg-surface-container-highest",{"group/card":t})}),rn=ee("card",Ke),Ge=Z("card",Ke),ke=({width:e})=>({carouselItem:v("rounded-[28px] overflow-hidden flex-none",{hidden:e===void 0,"flex-1":e==null})}),on=ee("carouselItem",ke),Je=Z("carouselItem",ke),Ze=()=>({carousel:v(["w-full h-[400px]"]),track:v("flex h-full w-full")}),ln=ee("carousel",Ze),Qe=Z("carousel",Ze),et=({isChecked:e,isIndeterminate:t,isDisabled:n,isError:r,isFocused:s,isHovered:a})=>({checkbox:v("inline-flex items-center justify-center relative size-4.5 ",{"pointer-events-none opacity-[0.38]":n}),input:v("absolute inset-0 w-full h-full opacity-0 z-10 cursor-pointer"),container:v("relative flex items-center justify-center w-[18px] h-[18px] "),box:v("absolute left-1/2 top-1/2 -translate-1/2 to rounded-[2px] size-4 border-2 transition-colors duration-200",!e&&!t&&{"border-on-surface-variant":!r&&!n,"border-error":r&&!n,"border-on-surface":n},(e||t)&&{"bg-primary border-primary":!r&&!n,"bg-error border-error":r&&!n,"bg-on-surface border-on-surface":n}),icon:v("z-10 relative text-on-primary w-full h-full flex items-center justify-center pointer-events-none",{"text-on-error":r&&!n,"text-surface":n}),stateLayer:"size-10 state-ripple-group-[checkbox] rounded-full cursor-pointer pointer-events-auto absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2"}),an=ee("checkbox",et),tt=Z("checkbox",et),nt=({variant:e,disabled:t,trailingIcon:n,icon:r,isActive:s,isInteractive:a,activated:c,isFocused:l,isDragging:d,isEditing:i})=>({chip:v(" group/chip px-3 py-1.5 rounded-lg flex items-center gap-2 outline-none",{"pl-2":r,"pr-2":n,"cursor-pointer":!t&&a},{" text-on-surface-variant":!c&&!l||i,"bg-secondary-container text-on-secondary-container":(c||l)&&!i},d&&["opacity-100 cursor-grabbing shadow-3"],e==="outlined"&&["border border-outline-variant",{"border-transparent":i}],e==="elevated"&&!i&&["shadow-1 bg-surface-container-low","border border-outline-variant"]),stateLayer:v("rounded-lg overflow-hidden",{}),label:v("outline-none text-nowrap",{"opacity-[0.38]":t}),leadingIcon:v("text-primary size-[18px]",{"opacity-[0.38]":t}),trailingIcon:v("cursor-pointer size-[18px]",{"opacity-[0.38]":t})}),cn=ee("chip",nt),st=Z("chip",nt),rt=({scrollable:e})=>({chips:v(" flex gap-3 outline-none",{"flex-wrap":!e,"overflow-x-auto":e})}),un=ee("chips",rt),ot=Z("chips",rt),it=({orientation:e})=>({divider:v("border-outline-variant ",{"h-fit w-full border-t":e==="horizontal"},{"h-auto self-stretch w-fit border-l":e==="vertical"})}),dn=ee("divider",it),lt=Z("divider",it),at=({size:e,variant:t,extended:n})=>({fab:v("flex shadow-3 hover:shadow-4 group/fab overflow-hidden outline-none items-center cursor-pointer",{"rounded-[12px]":e=="small","rounded-[16px]":e=="medium","rounded-[28px]":e=="large"},{"p-2":e=="small","p-4":e=="medium","p-[30px]":e=="large"},t==="primary"&&"bg-primary text-on-primary",t==="secondary"&&"bg-secondary text-on-secondary",t==="tertiary"&&"bg-tertiary text-on-tertiary",t==="primaryContainer"&&"bg-primary-container text-on-primary-container",t==="secondaryContainer"&&"bg-secondary-container text-on-secondary-container",t==="tertiaryContainer"&&"bg-tertiary-container text-on-tertiary-container"),icon:v({"size-6":e=="small"||e=="medium","size-9":e=="large"}),label:v("text-nowrap",{"text-title-medium":e=="small","text-title-large":e=="medium","text-headline-small":e=="large"})}),fn=ee("fab",at),ct=Z("fab",at),ut=({size:e,variant:t,open:n})=>({fabMenu:v("relative inline-flex flex-col items-end"),actions:v("flex flex-col gap-1 items-end absolute bottom-[calc(100%_+_8px)] right-0"),label:v("text-nowrap")}),hn=ee("fabMenu",ut),dt=Z("fabMenu",ut),ft=({variant:e,disabled:t,onToggle:n,isActive:r,size:s,width:a,shape:c,allowShapeTransformation:l})=>({iconButton:v("rounded-full relative flex transition-all duration-300","group/icon-button cursor-pointer",{"cursor-default":t},c==="rounded"&&{"rounded-[30px]":s==="xSmall"||s=="small","rounded-[40px]":s==="medium","rounded-[70px]":s==="large"||s=="xLarge"},(c==="squared"||l&&r)&&{"rounded-[12px]":s==="xSmall"||s=="small","rounded-[16px]":s==="medium","rounded-[28px]":s==="large"||s=="xLarge"},l&&!t&&{"active:rounded-[12px]":s==="xSmall"||s=="small","active:rounded-[16px]":s==="medium","active:rounded-[28px]":s==="large"||s=="xLarge"},e==="filled"&&[!t&&{"bg-surface-container":!r&&!!n,"bg-primary":r||!n},!!t&&"bg-on-surface/[0.12]"],e==="tonal"&&[!t&&{"bg-secondary-container text-on-secondary-container":!r&&!!n,"bg-secondary text-on-secondary":r||!n},!!t&&"bg-on-surface/[0.12]"],e==="outlined"&&[!t&&{"border border-outline":!r,"border border-transparent bg-inverse-surface":r},!!t&&{"border border-on-surface/[0.12]":!r,"border border-transparent bg-on-surface/[0.12]":r}]),touchTarget:v("absolute -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/2 h-12 w-full"),stateLayer:v("absolute top-0 left-0 h-full w-full overflow-hidden",(c==="rounded"||c==="squared"&&n&&!t&&r&&l)&&{"rounded-[30px]":s==="xSmall"||s=="small","rounded-[40px]":s==="medium","rounded-[70px]":s==="large"||s=="xLarge"},(c==="squared"||c==="rounded"&&n&&!t&&r&&l)&&{"rounded-[12px]":s==="xSmall"||s=="small","rounded-[16px]":s==="medium","rounded-[28px]":s==="large"||s=="xLarge"},l&&!t&&{"group-active/icon-button:rounded-[12px]":s==="xSmall"||s=="small","group-active/icon-button:rounded-[16px]":s==="medium","group-active/icon-button:rounded-[28px]":s==="large"||s=="xLarge"},!t&&[e==="standard"&&{"state-on-surface-variant":!r,"state-primary":r},e==="filled"&&{"state-primary":!r&&!!n,"state-inverse-on-surface":r||!n},e==="tonal"&&{"state-on-surface-variant":!r&&!!n,"state-on-secondary-container":r||!n},e==="outlined"&&{"state-on-surface-variant":!r,"state-on-primary":r}]),icon:v(" transition-all duration-300",{"size-5 p-1.5":s==="xSmall"},{"size-6 p-2":s==="small"},{"size-6 p-4":s==="medium"},{"size-8 p-8":s==="large"},{"size-10 p-12":s==="xLarge"},a=="narrow"&&[{"px-1":s==="xSmall"},{"px-1":s==="small"},{"px-3":s==="medium"},{"px-4":s==="large"},{"px-8":s==="xLarge"}],a=="wide"&&[{"px-2.5":s==="xSmall"},{"px-3.5":s==="small"},{"px-6":s==="medium"},{"px-12":s==="large"},{"px-[72px]":s==="xLarge"}],!t&&[e==="standard"&&{"text-on-surface-variant":!r,"text-primary":r},e==="filled"&&{"text-primary":!r&&!!n,"text-on-primary":r||!n},e==="outlined"&&{"text-on-surface-variant":!r,"text-inverse-on-surface":r}],!!t&&"text-on-surface/[0.38]")}),mn=ee("iconButton",ft),ht=Z("iconButton",ft),mt=({variant:e,isVisible:t})=>({progressIndicator:v((e==="linear-determinate"||e=="linear-indeterminate")&&"flex w-full h-1"),track:v("h-full rounded-full bg-primary rounded-l-full",{"max-h-0":!t,"max-h-full":t}),activeIndicator:v({"max-h-0":!t,"max-h-full":t},(e==="linear-determinate"||e=="linear-indeterminate")&&"h-full flex-1 rounded-full bg-primary-container",(e==="circular-determinate"||e=="circular-indeterminate")&&["stroke-primary fill-transparent ",{"stroke-[4px]":t,"stroke-[0px]":!t}]),stop:v("absolute top-1/2 -translate-y-1/2 right-0 bg-primary rounded-full size-1",{"max-h-0":!t,"max-h-full":t})}),pn=ee("progressIndicator",mt),pt=Z("progressIndicator",mt),je=({variant:e,position:t})=>({sideSheet:v("bg-surface flex justify-between max-w-xs z-10",{"flex-row-reverse":t=="right","h-full":e=="standard"},e=="modal"&&["rounded-2xl fixed top-0 m-[1rem] h-[calc(100dvh-2rem)]",{"right-0":t=="right","left-0":t=="left"}]),container:v("w-full overflow-hidden",{}),content:v("w-fit "),header:v("p-4 flex items-center gap-2"),title:v("text-on-surface-variant text-title-large"),closeButton:v("ml-auto"),divider:v({hidden:e=="modal"}),overlay:v("bg-[black]/[0.32] fixed top-0 left-0 w-screen h-screen")}),yt=ee("sideSheet",je),yn=Z("sideSheet",je),Me=({isChanging:e})=>({slider:v(["relative w-full h-11 flex items-center rounded gap-x-1.5 cursor-pointer min-w-32"]),activeTrack:v(["h-4 relative transition-all duration-100 bg-primary overflow-hidden rounded-l-full "]),inactiveTrack:v(["h-4 relative transition-all duration-100 bg-primary-container rounded-r-full overflow-hidden"]),handle:v(["transform relative transition-all duration-100 bg-primary h-full rounded-full ",{"w-0.5":e,"w-1":!e}]),valueIndicator:v(["absolute select-none bg-inverse-surface text-inverse-on-surface py-3 px-4 text-label-large rounded-full bottom-[calc(100%+4px)] transform left-1/2 -translate-x-1/2"]),dot:v(["h-1 w-1 absolute transform -translate-y-1/2 -translate-x-1/2 top-1/2 rounded-full"])}),xn=ee("slider",Me),xt=Z("slider",Me),vt=()=>({snackbar:v(" rounded bg-inverse-surface "),container:v("pl-4 pr-2 max-w-full py-1 flex items-center flex-wrap"),supportingText:v("text-body-medium text-inverse-on-surface "),icon:v(" ml-auto mr-0 text-inverse-on-surface block dark")}),vn=ee("snackbar",vt),gt=Z("snackbar",vt),wt=({isSelected:e,disabled:t,inactiveIcon:n})=>({switch:v("group/switch w-[52px] h-[32px] outline-none rounded-full border-2 flex items-center",{"bg-on-surface/[0.12] border-transparent":t},!t&&["cursor-pointer ",{"bg-primary border-primary":e},{"bg-surface-container border-outline":!e}]),handleContainer:v("flex items-center justify-center absolute",{"left-[14px]":!e},{"right-[14px]":e}),handle:v("transition-all duration-100 z-10 rounded-full flex items-center justify-center",{"w-[16px] h-[16px]":!e&&!n},{"w-[24px] h-[24px]":!(!e&&!n)},!t&&["cursor-pointer group-active/switch:h-[28px] group-active/switch:w-[28px]",{"bg-on-primary group-hover/switch:bg-primary-container":e},{"bg-outline group-hover/switch:bg-on-surface-variant":!e}],{"bg-surface":t}),handleStateLayer:v("w-[40px] h-[40px] -z-10 rounded-full absolute",{"group-state-primary":!t}),icon:v("w-[16px] h-[16px]",!t&&[{"text-on-primary-container":e},{"text-on-primary":!e}],{"text-on-surface/[0.38]":t})}),gn=ee("switch",wt),bt=Z("switch",wt),St=({isSelected:e,icon:t,label:n,variant:r})=>({tab:v("flex-1 group/tab outline-none flex px-4 justify-center items-center cursor-pointer",{"z-10":e},!!(t&&n)&&r==="primary"&&"h-16",!(t&&n&&r==="primary")&&"h-12"),stateLayer:v("absolute w-full h-full overflow-hidden left-1/2 top-1/2 transform -translate-y-1/2 -translate-x-1/2",r==="primary"&&{"group-hover/tab:hover-state-on-surface group-focus-visible/tab:focus-state-on-surface":!e,"group-hover/tab:hover-state-primary group-focus-visible/tab:focus-state-primary":e},r==="secondary"&&"group-hover/tab:hover-state-on-surface group-focus-visible/tab:focus-state-on-surface"),content:v("flex gap-0.5 h-full justify-center",{relative:r=="primary"},{"":!!(n&&!t)},r==="primary"&&"flex-col items-center",r==="secondary"&&{"flex-col items-center":!(n&&t),"flex-row items-center gap-2":!!(n&&t)}),icon:v("h-6 w-6 p-0.5 !box-border",r==="primary"&&{"text-on-surface-variant":!e,"text-primary":e},r==="secondary"&&{"text-on-surface-variant":!e,"text-on-surface":e}),label:v("text-title-small text-nowrap",r==="primary"&&{"text-on-surface-variant":!e,"text-primary":e},r==="secondary"&&{"text-on-surface-variant":!e,"text-on-surface":e}),underline:v("bg-primary absolute w-full left-0 bottom-0",r==="primary"&&"h-[3px] rounded-t",r==="secondary"&&"h-0.5")}),wn=ee("tab",St),Nt=Z("tab",St),Et=({scrollable:e})=>({tabs:v("border-b border-surface-container-highest bg-surface","flex relative ",{"overflow-x-auto":e})}),bn=ee("tabs",Et),Lt=Z("tabs",Et),kt=()=>({tabPanels:v("overflow-hidden")}),Sn=ee("tabPanels",kt),jt=Z("tabPanels",kt),Mt=()=>({tabPanel:v("")}),Nn=ee("tabPanel",Mt),It=Z("tabPanel",Mt),Ct=({disabled:e,leadingIcon:t,trailingIcon:n,variant:r,errorText:s,isFocused:a,value:c,suffix:l,multiline:d})=>({textField:v({"opacity-[.38]":e}),content:v("group/text-field transition-border duration-200 relative flex items-center ",{"h-14":!d},{"border-on-surface-variant":!(s!=null&&s.length)&&!a&&r=="filled","border-outline":!(s!=null&&s.length)&&!a&&r=="outlined","border-primary":!(s!=null&&s.length)&&a,"border-error":!!(s!=null&&s.length)},{"bg-on-surface/[0.04]":e},r=="filled"&&["rounded-t overflow-hidden border-b",{"bg-surface-container-highest":!e}],r=="outlined"&&["border rounded box-border",{"border-[3px]":a}]),stateLayer:v("absolute -z-10 w-full h-full top-0 left-0",{hidden:r=="outlined"},{"group-state-on-surface":!e,"focus-state-on-surface":a}),label:v("inline-flex outline-none whitespace-nowrap",{"text-on-surface-variant":!e&&!(s!=null&&s.length)},{"text-on-surface":e},{"text-error":!!(s!=null&&s.length)},{"text-primary":!(s!=null&&s.length)&&a}),input:v("w-full resize-none px-4 text-body-large bg-[inherit] outline-none autofill:transition-colors autofill:duration-[5000000ms]",{" text-on-surface placeholder:text-on-surface-variant":!e,"placeholder:text-on-surface text-on-surface":e},{"pr-0":!!l},r=="filled"&&" pb-2 pt-6",r=="outlined"&&"py-4 relative z-10"),activeIndicator:v("absolute w-0 inset-x-0 border-rounded mx-auto bottom-0",r=="filled"&&["h-[2px] transition-all duration-300",{"bg-primary":!(s!=null&&s.length)},{"bg-error":!!(s!=null&&s.length)},{"!w-full":a}]),supportingText:v(" text-body-small px-4 pt-1",{"text-on-surface-variant":!e&&!(s!=null&&s.length)},{"text-on-surface":e},{"!w-full":a},{"text-error":!!(s!=null&&s.length)}),leadingIcon:v(["h-12 ml-3 flex items-center justify-center",{"cursor-text":!o.isValidElement(t)}]),trailingIcon:v("h-12 w-12 flex items-center justify-center",{"cursor-text":!o.isValidElement(n)}),suffix:v("text-on-surface-variant pl-0 pr-4",r=="filled"&&" pb-2 pt-6",r=="outlined"&&"py-4 relative z-10")}),En=ee("textField",Ct),Rt=Z("textField",Ct),Dt=({position:e,variant:t})=>({toolTip:v(" pointer-events-auto w-max z-10 absolute m-1 w-max-content max-w-[312px]",t=="rich"&&"bg-surface-container rounded-2xl text-on-surface-container shadow-2",t=="plain"&&"bg-inverse-surface rounded text-inverse-on-surface ",{"bottom-full left-1/2 -translate-x-1/2":e=="top","top-full left-1/2 -translate-x-1/2":e=="bottom","right-full top-1/2 -translate-y-1/2":e=="left","left-full top-1/2 -translate-y-1/2":e=="right","bottom-full right-full":e=="top-left","bottom-full left-full":e=="top-right","top-full right-full":e=="bottom-left","top-full left-full":e=="bottom-right"}),container:v("pb-2",t=="rich"&&"px-4 pt-3 ",t=="plain"&&"px-2 py-1"),actions:v("flex gap-10 px-1 mt-2",t=="plain"&&"hidden"),subHead:v("text-title-small mb-1",t=="plain"&&"hidden"),supportingText:v(""),content:v("w-full")}),Ln=ee("toolTip",Dt),Ft=Z("toolTip",Dt),ie=({icon:e,colors:t=[],className:n,...r})=>{if(typeof e=="string"){let f=e;return t[0]&&(f=f.replace(/<svg([^>]*)>/,`<svg$1 fill="${t[0]}" color="${t[0]}">`),f=f.replace(/<path([^>]*?)>/g,'<path$1 fill="currentColor">')),u.jsx("div",{className:v("size-5 box-content inline-flex fill-current",n),style:{color:t[0]||"inherit"},dangerouslySetInnerHTML:{__html:f}})}if(e&&typeof e=="object"&&"src"in e){const f=e;return u.jsx("img",{src:f.src,width:f.width,height:f.height,className:v("size-5 box-content",n),style:{filter:t[0]?"brightness(0) saturate(100%) invert(1)":void 0},alt:"","aria-hidden":"true"})}const s=e;if(!(s!=null&&s.prefix))throw new Error(`Invalid icon type: ${typeof e}`);const{icon:a}=s,[c,l,,,d]=a||[],i=f=>{switch(f.length){case 2:return{"--fa-primary-color":f[0]||"inherit","--fa-secondary-color":f[1]||"inherit"};case 1:return{color:f[0]};default:return{}}};return u.jsx("svg",{className:v("size-5 box-content",n),style:{...i(t)},xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${c} ${l}`,role:"img","aria-hidden":"true",...r,children:typeof d=="string"?u.jsx("path",{className:"fill-current",d}):d.map((f,y)=>u.jsx("path",{d:f},y))})},$t=({variant:e="linear-determinate",value:t=0,transitionDuration:n=1e3,className:r,...s})=>{const[a,c]=o.useState(t),[l]=o.useState(1.5);o.useEffect(()=>{t>100&&(t=100),t<0&&(t=0),c(t)},[t]);const[d,i]=o.useState(!0),f=()=>d?l:l*.5;o.useEffect(()=>{if((e==="circular-indeterminate"||e==="linear-indeterminate")&&a!==100){const p=setInterval(()=>{c(d?10:90),i(!d)},f()*1e3);return()=>clearInterval(p)}},[e,d,a]);const[y,h]=o.useState(!1);o.useEffect(()=>{if(a>=100){const p=setTimeout(()=>{h(!1)},n);return()=>{clearTimeout(p)}}else h(!0)},[a,n]);const m=pt({className:r,variant:e,value:t,transitionDuration:n,isVisible:y});return u.jsxs(u.Fragment,{children:[(e==="linear-determinate"||e=="linear-indeterminate")&&u.jsxs("div",{className:m.progressIndicator,...s,children:[u.jsx("div",{style:{width:`${a}%`,transition:`width ${n}ms ease-in-out ${a==100?", max-height 200ms 0.5s ease-in-out":""}`},className:m.track}),u.jsx("div",{style:{marginLeft:a!=100?"6px":"0px",transition:`width ${n}ms ease-in-out ${a==100?`, max-height 200ms 0.5s ease-in-out, margin-left ${n}ms ${n/1.5}ms`:""}`},className:m.activeIndicator}),u.jsx("div",{style:{width:"4 px",transition:`width ${n}ms ease-in-out, max-height 200ms 0.5s ease-in-out`},className:m.stop})]}),(e==="circular-determinate"||e=="circular-indeterminate")&&u.jsx(q.motion.svg,{width:"48",height:"48",viewBox:"0 0 48 48",initial:{rotate:-90},animate:{rotate:270},transition:{repeat:1/0,duration:f(),ease:"linear"},className:m.progressIndicator,...s,children:u.jsx(q.motion.circle,{cx:"50%",cy:"50%",r:y?"calc(50% - 2px)":"50%",style:{strokeLinecap:"round"},initial:"hidden",animate:"visible",className:m.activeIndicator,variants:{hidden:{pathLength:d?10/100:90/100},visible:{pathLength:d?90/100:10/100}},transition:{pathLength:{type:"tween",ease:"linear",duration:f(),bounce:0}}})},d+"")]})},At=({colorName:e="on-surface",triggerRef:t})=>{const n={initial:{opacity:1,"--r":"25%"},animate:{opacity:1,"--r":"100%",transition:{duration:.5}},exit:{opacity:0,"--r":"100%",transition:{duration:.3}}},[r,s]=o.useState(!0),[a,c]=o.useState(!1),[l,d]=o.useState({x:50,y:50});o.useEffect(()=>{a&&(s(!0),s(!1))},[a]),o.useEffect(()=>{const p=t==null?void 0:t.current;if(p)return p.addEventListener("mousedown",i),p.addEventListener("mouseup",y),p.addEventListener("mouseleave",f),()=>{p.removeEventListener("mousedown",i),p.removeEventListener("mouseup",y),p.removeEventListener("mouseleave",f)}},[t]);const i=p=>{const N=t==null?void 0:t.current,w=N.getBoundingClientRect();c(!0),d({x:(p.clientX-w.left)/N.clientWidth*100,y:(p.clientY-w.top)/N.clientHeight*100})},f=p=>{c(!1)},y=p=>{c(!1)},h=`color-mix(in srgb, var(--state-color,_var(--color-${e})) 10%, transparent)`,m={position:"absolute",inset:0,width:"100%",height:"100%","--x":l.x+"%","--y":l.y+"%","--r":"0%",background:`radial-gradient(ellipse at var(--x) var(--y), ${h} var(--r), transparent calc(var(--r) * 2))`,pointerEvents:"none"};return u.jsx(q.AnimatePresence,{mode:"wait",children:(a||!a&&!r)&&u.jsx(q.motion.div,{style:m,variants:n,initial:"initial",animate:"animate",exit:"exit",onAnimationComplete:()=>s(!0)})})},Wt=ee("customScroll",({orientation:e,draggable:t,isDragging:n})=>({customScroll:v("flex h-full w-full",t&&["[&::-webkit-scrollbar-track]:rounded-full","[&::-webkit-scrollbar-track]:bg-transparent","[&::-webkit-scrollbar-thumb]:rounded-full",{"[&::-webkit-scrollbar-thumb]:bg-outline":n,"[&::-webkit-scrollbar-thumb]:bg-transparent":!n},{"[&::-webkit-scrollbar]:h-2":e==="horizontal"},{"[&::-webkit-scrollbar]:w-2":e==="vertical"}],{"overflow-y-scroll flex-col":e==="vertical","overflow-x-scroll flex-row":e==="horizontal","cursor-grab":t&&!n,"cursor-grabbing":t&&n}),track:v("overflow-hidden flex-none sticky",{"left-0 h-full":e==="horizontal","top-0 w-full":e==="vertical"})}));function kn(e,t){let n=0,r=null,s=null;const a=(c,l)=>{n=Date.now(),t(c,l)};return(c,l)=>{const d=Date.now(),i=e-(d-n);i<=0?(r&&(clearTimeout(r),r=null),a(c,l)):(s={v:c,o:l},r||(r=setTimeout(()=>{r=null;const f=s;s=null,f&&a(f.v,f.o)},i)))}}const Pt=({children:e,orientation:t="vertical",scrollSize:n,onScroll:r,className:s,draggable:a=!1,throttleDuration:c=75,scroll:l,setScroll:d})=>{var te,b;const i=o.useRef(null),f=o.useRef(null),[y,h]=o.useState({width:null,height:null});o.useEffect(()=>{if(!i.current)return;const k=new ResizeObserver(E=>{for(const F of E)F.target===i.current&&h({width:F.contentRect.width,height:F.contentRect.height})});return k.observe(i.current),()=>{k.disconnect()}},[i]);const m=o.useRef(null),p=o.useRef(null),N=()=>{const k=f.current;return k?{width:n??k.scrollWidth,height:n??k.scrollHeight}:null},w=()=>{const k=i.current;return k?{width:k.clientWidth,height:k.clientHeight}:null},{scrollYProgress:j,scrollXProgress:S}=q.useScroll({container:i}),g=o.useRef(null);g.current||(g.current=kn(c,(k,E)=>{!p.current||!m.current||!i.current||(E===(t==="horizontal"?"x":"y")&&(d==null||d(k)),r&&(t==="horizontal"&&E==="x"&&r({scrollProgress:k,scroll:k*(m.current.width-i.current.clientWidth),scrollTotal:m.current.width-i.current.clientWidth,scrollVisible:p.current.width}),t==="vertical"&&E==="y"&&r({scrollProgress:k,scroll:k*(m.current.height-i.current.clientHeight),scrollTotal:m.current.height-i.current.clientHeight,scrollVisible:p.current.height})))}));const P=(k,E)=>{g.current&&g.current(k,E)};o.useEffect(()=>{y.width&&P(S.get(),"x"),y.height&&P(j.get(),"y")},[y]),o.useEffect(()=>{const k=i.current,E=f.current;if(!k||!E||typeof l!="number")return;const F=(H,_,z)=>Math.min(z,Math.max(_,H));if(t==="horizontal"){const H=Math.max(0,(n??E.scrollWidth)-k.clientWidth);k.scrollLeft=F(l*H,0,H)}else{const H=Math.max(0,(n??E.scrollHeight)-k.clientHeight);k.scrollTop=F(l*H,0,H)}},[l,t,n]),q.useMotionValueEvent(S,"change",k=>{P(k,"x")}),q.useMotionValueEvent(j,"change",k=>{P(k,"y")});const[C,x]=o.useState(!1);o.useLayoutEffect(()=>{C||!p.current||!m.current||!r||(r({scrollProgress:0,scroll:0,scrollTotal:t=="vertical"?m.current.height:m.current.width,scrollVisible:t=="vertical"?p.current.height:p.current.width}),x(!0))},[p,m,r]),m.current=N(),p.current=w();const[L,D]=o.useState(!1),$=Wt({isDragging:L,children:e,className:s,onScroll:r,orientation:t,scrollSize:n,draggable:a,throttleDuration:c}),[W,I]=o.useState(0),[R,M]=o.useState(0),V=k=>{if(!a)return;const E=i.current;if(!E||W==null)return;const H=(k.pageX-E.offsetLeft-W)*1.5;E.scrollLeft=R-H},J=k=>{const E=i.current;E&&(D(!0),I(k.pageX-E.offsetLeft),M(E.scrollLeft))},X=k=>{L&&(k.preventDefault(),V(k))},T=()=>{D(!1)},O=()=>{D(!1)},K=k=>{k.preventDefault()},G=o.useRef(null);return o.useEffect(()=>()=>{G.current&&clearTimeout(G.current)},[]),o.useEffect(()=>{const k=i.current;if(!k)return;const E=F=>{var Q,A,Y,ne;const H=F.detail,_=i.current;if(!_||!H)return;const z=H.orientation??t;if(typeof H.progress=="number")if(z==="horizontal"){const le=Math.max(0,(((Q=m.current)==null?void 0:Q.width)??0)-_.clientWidth);_.scrollLeft=Math.min(le,Math.max(0,H.progress*le))}else{const le=Math.max(0,(((A=m.current)==null?void 0:A.height)??0)-_.clientHeight);_.scrollTop=Math.min(le,Math.max(0,H.progress*le))}else if(typeof H.scroll=="number")if(z==="horizontal"){const le=Math.max(0,(((Y=m.current)==null?void 0:Y.width)??0)-_.clientWidth);_.scrollLeft=Math.min(le,Math.max(0,H.scroll))}else{const le=Math.max(0,(((ne=m.current)==null?void 0:ne.height)??0)-_.clientHeight);_.scrollTop=Math.min(le,Math.max(0,H.scroll))}};return k.addEventListener("udx:customScroll:set",E),()=>{k.removeEventListener("udx:customScroll:set",E)}},[t]),u.jsxs("div",{className:$.customScroll,ref:i,onMouseDown:J,onMouseMove:X,onMouseUp:T,onMouseLeave:O,onDragStart:K,onScroll:k=>{L||(I(null),D(!0),G.current&&clearTimeout(G.current),G.current=setTimeout(()=>{D(!1)},1e3))},children:[u.jsx("div",{ref:f,style:t==="vertical"?{height:((te=p==null?void 0:p.current)==null?void 0:te.height)??"100%"}:{width:((b=p==null?void 0:p.current)==null?void 0:b.width)??"100%"},className:$.track,children:e}),p.current&&m.current&&u.jsxs(u.Fragment,{children:[t==="vertical"&&m.current.height>p.current.height&&u.jsx(q.motion.div,{className:"flex-none",style:{height:m.current.height-p.current.height}}),t==="horizontal"&&m.current.width>p.current.width&&u.jsx(q.motion.div,{className:"flex-none",style:{width:m.current.width-p.current.width}})]})]})};var jn="1.3.17";function Bt(e,t,n){return Math.max(e,Math.min(t,n))}function Mn(e,t,n){return(1-n)*e+n*t}function In(e,t,n,r){return Mn(e,t,1-Math.exp(-n*r))}function Cn(e,t){return(e%t+t)%t}var Rn=class{constructor(){B(this,"isRunning",!1);B(this,"value",0);B(this,"from",0);B(this,"to",0);B(this,"currentTime",0);B(this,"lerp");B(this,"duration");B(this,"easing");B(this,"onUpdate")}advance(e){var n;if(!this.isRunning)return;let t=!1;if(this.duration&&this.easing){this.currentTime+=e;const r=Bt(0,this.currentTime/this.duration,1);t=r>=1;const s=t?1:this.easing(r);this.value=this.from+(this.to-this.from)*s}else this.lerp?(this.value=In(this.value,this.to,this.lerp*60,e),Math.round(this.value)===this.to&&(this.value=this.to,t=!0)):(this.value=this.to,t=!0);t&&this.stop(),(n=this.onUpdate)==null||n.call(this,this.value,t)}stop(){this.isRunning=!1}fromTo(e,t,{lerp:n,duration:r,easing:s,onStart:a,onUpdate:c}){this.from=this.value=e,this.to=t,this.lerp=n,this.duration=r,this.easing=s,this.currentTime=0,this.isRunning=!0,a==null||a(),this.onUpdate=c}};function Dn(e,t){let n;return function(...r){let s=this;clearTimeout(n),n=setTimeout(()=>{n=void 0,e.apply(s,r)},t)}}var Fn=class{constructor(e,t,{autoResize:n=!0,debounce:r=250}={}){B(this,"width",0);B(this,"height",0);B(this,"scrollHeight",0);B(this,"scrollWidth",0);B(this,"debouncedResize");B(this,"wrapperResizeObserver");B(this,"contentResizeObserver");B(this,"resize",()=>{this.onWrapperResize(),this.onContentResize()});B(this,"onWrapperResize",()=>{this.wrapper instanceof Window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)});B(this,"onContentResize",()=>{this.wrapper instanceof Window?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)});this.wrapper=e,this.content=t,n&&(this.debouncedResize=Dn(this.resize,r),this.wrapper instanceof Window?window.addEventListener("resize",this.debouncedResize,!1):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){var e,t;(e=this.wrapperResizeObserver)==null||e.disconnect(),(t=this.contentResizeObserver)==null||t.disconnect(),this.wrapper===window&&this.debouncedResize&&window.removeEventListener("resize",this.debouncedResize,!1)}get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}},Tt=class{constructor(){B(this,"events",{})}emit(e,...t){var r;let n=this.events[e]||[];for(let s=0,a=n.length;s<a;s++)(r=n[s])==null||r.call(n,...t)}on(e,t){var n;return(n=this.events[e])!=null&&n.push(t)||(this.events[e]=[t]),()=>{var r;this.events[e]=(r=this.events[e])==null?void 0:r.filter(s=>t!==s)}}off(e,t){var n;this.events[e]=(n=this.events[e])==null?void 0:n.filter(r=>t!==r)}destroy(){this.events={}}},$e=100/6,ce={passive:!1},$n=class{constructor(e,t={wheelMultiplier:1,touchMultiplier:1}){B(this,"touchStart",{x:0,y:0});B(this,"lastDelta",{x:0,y:0});B(this,"window",{width:0,height:0});B(this,"emitter",new Tt);B(this,"onTouchStart",e=>{const{clientX:t,clientY:n}=e.targetTouches?e.targetTouches[0]:e;this.touchStart.x=t,this.touchStart.y=n,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:e})});B(this,"onTouchMove",e=>{const{clientX:t,clientY:n}=e.targetTouches?e.targetTouches[0]:e,r=-(t-this.touchStart.x)*this.options.touchMultiplier,s=-(n-this.touchStart.y)*this.options.touchMultiplier;this.touchStart.x=t,this.touchStart.y=n,this.lastDelta={x:r,y:s},this.emitter.emit("scroll",{deltaX:r,deltaY:s,event:e})});B(this,"onTouchEnd",e=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:e})});B(this,"onWheel",e=>{let{deltaX:t,deltaY:n,deltaMode:r}=e;const s=r===1?$e:r===2?this.window.width:1,a=r===1?$e:r===2?this.window.height:1;t*=s,n*=a,t*=this.options.wheelMultiplier,n*=this.options.wheelMultiplier,this.emitter.emit("scroll",{deltaX:t,deltaY:n,event:e})});B(this,"onWindowResize",()=>{this.window={width:window.innerWidth,height:window.innerHeight}});this.element=e,this.options=t,window.addEventListener("resize",this.onWindowResize,!1),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,ce),this.element.addEventListener("touchstart",this.onTouchStart,ce),this.element.addEventListener("touchmove",this.onTouchMove,ce),this.element.addEventListener("touchend",this.onTouchEnd,ce)}on(e,t){return this.emitter.on(e,t)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize,!1),this.element.removeEventListener("wheel",this.onWheel,ce),this.element.removeEventListener("touchstart",this.onTouchStart,ce),this.element.removeEventListener("touchmove",this.onTouchMove,ce),this.element.removeEventListener("touchend",this.onTouchEnd,ce)}},Ae=e=>Math.min(1,1.001-Math.pow(2,-10*e)),An=class{constructor({wrapper:e=window,content:t=document.documentElement,eventsTarget:n=e,smoothWheel:r=!0,syncTouch:s=!1,syncTouchLerp:a=.075,touchInertiaExponent:c=1.7,duration:l,easing:d,lerp:i=.1,infinite:f=!1,orientation:y="vertical",gestureOrientation:h=y==="horizontal"?"both":"vertical",touchMultiplier:m=1,wheelMultiplier:p=1,autoResize:N=!0,prevent:w,virtualScroll:j,overscroll:S=!0,autoRaf:g=!1,anchors:P=!1,autoToggle:C=!1,allowNestedScroll:x=!1,__experimental__naiveDimensions:L=!1,naiveDimensions:D=L,stopInertiaOnNavigate:$=!1}={}){B(this,"_isScrolling",!1);B(this,"_isStopped",!1);B(this,"_isLocked",!1);B(this,"_preventNextNativeScrollEvent",!1);B(this,"_resetVelocityTimeout",null);B(this,"_rafId",null);B(this,"isTouching");B(this,"time",0);B(this,"userData",{});B(this,"lastVelocity",0);B(this,"velocity",0);B(this,"direction",0);B(this,"options");B(this,"targetScroll");B(this,"animatedScroll");B(this,"animate",new Rn);B(this,"emitter",new Tt);B(this,"dimensions");B(this,"virtualScroll");B(this,"onScrollEnd",e=>{e instanceof CustomEvent||(this.isScrolling==="smooth"||this.isScrolling===!1)&&e.stopPropagation()});B(this,"dispatchScrollendEvent",()=>{this.options.wrapper.dispatchEvent(new CustomEvent("scrollend",{bubbles:this.options.wrapper===window,detail:{lenisScrollEnd:!0}}))});B(this,"onTransitionEnd",e=>{e.propertyName.includes("overflow")&&this.checkOverflow()});B(this,"onClick",e=>{const n=e.composedPath().filter(r=>r instanceof HTMLAnchorElement&&r.getAttribute("href"));if(this.options.anchors){const r=n.find(s=>{var a;return(a=s.getAttribute("href"))==null?void 0:a.includes("#")});if(r){const s=r.getAttribute("href");if(s){const a=typeof this.options.anchors=="object"&&this.options.anchors?this.options.anchors:void 0,c=`#${s.split("#")[1]}`;this.scrollTo(c,a)}}}this.options.stopInertiaOnNavigate&&n.find(s=>s.host===window.location.host)&&this.reset()});B(this,"onPointerDown",e=>{e.button===1&&this.reset()});B(this,"onVirtualScroll",e=>{if(typeof this.options.virtualScroll=="function"&&this.options.virtualScroll(e)===!1)return;const{deltaX:t,deltaY:n,event:r}=e;if(this.emitter.emit("virtual-scroll",{deltaX:t,deltaY:n,event:r}),r.ctrlKey||r.lenisStopPropagation)return;const s=r.type.includes("touch"),a=r.type.includes("wheel");this.isTouching=r.type==="touchstart"||r.type==="touchmove";const c=t===0&&n===0;if(this.options.syncTouch&&s&&r.type==="touchstart"&&c&&!this.isStopped&&!this.isLocked){this.reset();return}const d=this.options.gestureOrientation==="vertical"&&n===0||this.options.gestureOrientation==="horizontal"&&t===0;if(c||d)return;let i=r.composedPath();i=i.slice(0,i.indexOf(this.rootElement));const f=this.options.prevent;if(i.find(w=>{var j,S,g;return w instanceof HTMLElement&&(typeof f=="function"&&(f==null?void 0:f(w))||((j=w.hasAttribute)==null?void 0:j.call(w,"data-lenis-prevent"))||s&&((S=w.hasAttribute)==null?void 0:S.call(w,"data-lenis-prevent-touch"))||a&&((g=w.hasAttribute)==null?void 0:g.call(w,"data-lenis-prevent-wheel"))||this.options.allowNestedScroll&&this.checkNestedScroll(w,{deltaX:t,deltaY:n}))}))return;if(this.isStopped||this.isLocked){r.cancelable&&r.preventDefault();return}if(!(this.options.syncTouch&&s||this.options.smoothWheel&&a)){this.isScrolling="native",this.animate.stop(),r.lenisStopPropagation=!0;return}let h=n;this.options.gestureOrientation==="both"?h=Math.abs(n)>Math.abs(t)?n:t:this.options.gestureOrientation==="horizontal"&&(h=t),(!this.options.overscroll||this.options.infinite||this.options.wrapper!==window&&this.limit>0&&(this.animatedScroll>0&&this.animatedScroll<this.limit||this.animatedScroll===0&&n>0||this.animatedScroll===this.limit&&n<0))&&(r.lenisStopPropagation=!0),r.cancelable&&r.preventDefault();const m=s&&this.options.syncTouch,N=s&&r.type==="touchend";N&&(h=Math.sign(this.velocity)*Math.pow(Math.abs(this.velocity),this.options.touchInertiaExponent)),this.scrollTo(this.targetScroll+h,{programmatic:!1,...m?{lerp:N?this.options.syncTouchLerp:1}:{lerp:this.options.lerp,duration:this.options.duration,easing:this.options.easing}})});B(this,"onNativeScroll",()=>{if(this._resetVelocityTimeout!==null&&(clearTimeout(this._resetVelocityTimeout),this._resetVelocityTimeout=null),this._preventNextNativeScrollEvent){this._preventNextNativeScrollEvent=!1;return}if(this.isScrolling===!1||this.isScrolling==="native"){const e=this.animatedScroll;this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity,this.velocity=this.animatedScroll-e,this.direction=Math.sign(this.animatedScroll-e),this.isStopped||(this.isScrolling="native"),this.emit(),this.velocity!==0&&(this._resetVelocityTimeout=setTimeout(()=>{this.lastVelocity=this.velocity,this.velocity=0,this.isScrolling=!1,this.emit()},400))}});B(this,"raf",e=>{const t=e-(this.time||e);this.time=e,this.animate.advance(t*.001),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))});window.lenisVersion=jn,(!e||e===document.documentElement)&&(e=window),typeof l=="number"&&typeof d!="function"?d=Ae:typeof d=="function"&&typeof l!="number"&&(l=1),this.options={wrapper:e,content:t,eventsTarget:n,smoothWheel:r,syncTouch:s,syncTouchLerp:a,touchInertiaExponent:c,duration:l,easing:d,lerp:i,infinite:f,gestureOrientation:h,orientation:y,touchMultiplier:m,wheelMultiplier:p,autoResize:N,prevent:w,virtualScroll:j,overscroll:S,autoRaf:g,anchors:P,autoToggle:C,allowNestedScroll:x,naiveDimensions:D,stopInertiaOnNavigate:$},this.dimensions=new Fn(e,t,{autoResize:N}),this.updateClassName(),this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll,!1),this.options.wrapper.addEventListener("scrollend",this.onScrollEnd,{capture:!0}),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.addEventListener("click",this.onClick,!1),this.options.wrapper.addEventListener("pointerdown",this.onPointerDown,!1),this.virtualScroll=new $n(n,{touchMultiplier:m,wheelMultiplier:p}),this.virtualScroll.on("scroll",this.onVirtualScroll),this.options.autoToggle&&(this.checkOverflow(),this.rootElement.addEventListener("transitionend",this.onTransitionEnd,{passive:!0})),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))}destroy(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll,!1),this.options.wrapper.removeEventListener("scrollend",this.onScrollEnd,{capture:!0}),this.options.wrapper.removeEventListener("pointerdown",this.onPointerDown,!1),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.removeEventListener("click",this.onClick,!1),this.virtualScroll.destroy(),this.dimensions.destroy(),this.cleanUpClassName(),this._rafId&&cancelAnimationFrame(this._rafId)}on(e,t){return this.emitter.on(e,t)}off(e,t){return this.emitter.off(e,t)}get overflow(){const e=this.isHorizontal?"overflow-x":"overflow-y";return getComputedStyle(this.rootElement)[e]}checkOverflow(){["hidden","clip"].includes(this.overflow)?this.internalStop():this.internalStart()}setScroll(e){this.isHorizontal?this.options.wrapper.scrollTo({left:e,behavior:"instant"}):this.options.wrapper.scrollTo({top:e,behavior:"instant"})}resize(){this.dimensions.resize(),this.animatedScroll=this.targetScroll=this.actualScroll,this.emit()}emit(){this.emitter.emit("scroll",this)}reset(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity=0,this.animate.stop()}start(){if(this.isStopped){if(this.options.autoToggle){this.rootElement.style.removeProperty("overflow");return}this.internalStart()}}internalStart(){this.isStopped&&(this.reset(),this.isStopped=!1,this.emit())}stop(){if(!this.isStopped){if(this.options.autoToggle){this.rootElement.style.setProperty("overflow","clip");return}this.internalStop()}}internalStop(){this.isStopped||(this.reset(),this.isStopped=!0,this.emit())}scrollTo(e,{offset:t=0,immediate:n=!1,lock:r=!1,programmatic:s=!0,lerp:a=s?this.options.lerp:void 0,duration:c=s?this.options.duration:void 0,easing:l=s?this.options.easing:void 0,onStart:d,onComplete:i,force:f=!1,userData:y}={}){if(!((this.isStopped||this.isLocked)&&!f)){if(typeof e=="string"&&["top","left","start","#"].includes(e))e=0;else if(typeof e=="string"&&["bottom","right","end"].includes(e))e=this.limit;else{let h;if(typeof e=="string"?(h=document.querySelector(e),h||(e==="#top"?e=0:console.warn("Lenis: Target not found",e))):e instanceof HTMLElement&&(e!=null&&e.nodeType)&&(h=e),h){if(this.options.wrapper!==window){const p=this.rootElement.getBoundingClientRect();t-=this.isHorizontal?p.left:p.top}const m=h.getBoundingClientRect();e=(this.isHorizontal?m.left:m.top)+this.animatedScroll}}if(typeof e=="number"){if(e+=t,e=Math.round(e),this.options.infinite){if(s){this.targetScroll=this.animatedScroll=this.scroll;const h=e-this.animatedScroll;h>this.limit/2?e=e-this.limit:h<-this.limit/2&&(e=e+this.limit)}}else e=Bt(0,e,this.limit);if(e===this.targetScroll){d==null||d(this),i==null||i(this);return}if(this.userData=y??{},n){this.animatedScroll=this.targetScroll=e,this.setScroll(this.scroll),this.reset(),this.preventNextNativeScrollEvent(),this.emit(),i==null||i(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()});return}s||(this.targetScroll=e),typeof c=="number"&&typeof l!="function"?l=Ae:typeof l=="function"&&typeof c!="number"&&(c=1),this.animate.fromTo(this.animatedScroll,e,{duration:c,easing:l,lerp:a,onStart:()=>{r&&(this.isLocked=!0),this.isScrolling="smooth",d==null||d(this)},onUpdate:(h,m)=>{this.isScrolling="smooth",this.lastVelocity=this.velocity,this.velocity=h-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=h,this.setScroll(this.scroll),s&&(this.targetScroll=h),m||this.emit(),m&&(this.reset(),this.emit(),i==null||i(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()}),this.preventNextNativeScrollEvent())}})}}}preventNextNativeScrollEvent(){this._preventNextNativeScrollEvent=!0,requestAnimationFrame(()=>{this._preventNextNativeScrollEvent=!1})}checkNestedScroll(e,{deltaX:t,deltaY:n}){const r=Date.now(),s=e._lenis??(e._lenis={});let a,c,l,d,i,f,y,h;const m=this.options.gestureOrientation;if(r-(s.time??0)>2e3){s.time=Date.now();const C=window.getComputedStyle(e);s.computedStyle=C;const x=C.overflowX,L=C.overflowY;if(a=["auto","overlay","scroll"].includes(x),c=["auto","overlay","scroll"].includes(L),s.hasOverflowX=a,s.hasOverflowY=c,!a&&!c||m==="vertical"&&!c||m==="horizontal"&&!a)return!1;i=e.scrollWidth,f=e.scrollHeight,y=e.clientWidth,h=e.clientHeight,l=i>y,d=f>h,s.isScrollableX=l,s.isScrollableY=d,s.scrollWidth=i,s.scrollHeight=f,s.clientWidth=y,s.clientHeight=h}else l=s.isScrollableX,d=s.isScrollableY,a=s.hasOverflowX,c=s.hasOverflowY,i=s.scrollWidth,f=s.scrollHeight,y=s.clientWidth,h=s.clientHeight;if(!a&&!c||!l&&!d||m==="vertical"&&(!c||!d)||m==="horizontal"&&(!a||!l))return!1;let p;if(m==="horizontal")p="x";else if(m==="vertical")p="y";else{const C=t!==0,x=n!==0;C&&a&&l&&(p="x"),x&&c&&d&&(p="y")}if(!p)return!1;let N,w,j,S,g;if(p==="x")N=e.scrollLeft,w=i-y,j=t,S=a,g=l;else if(p==="y")N=e.scrollTop,w=f-h,j=n,S=c,g=d;else return!1;return(j>0?N<w:N>0)&&S&&g}get rootElement(){return this.options.wrapper===window?document.documentElement:this.options.wrapper}get limit(){return this.options.naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?"x":"y"]}get isHorizontal(){return this.options.orientation==="horizontal"}get actualScroll(){const e=this.options.wrapper;return this.isHorizontal?e.scrollX??e.scrollLeft:e.scrollY??e.scrollTop}get scroll(){return this.options.infinite?Cn(this.animatedScroll,this.limit):this.animatedScroll}get progress(){return this.limit===0?1:this.scroll/this.limit}get isScrolling(){return this._isScrolling}set isScrolling(e){this._isScrolling!==e&&(this._isScrolling=e,this.updateClassName())}get isStopped(){return this._isStopped}set isStopped(e){this._isStopped!==e&&(this._isStopped=e,this.updateClassName())}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this.updateClassName())}get isSmooth(){return this.isScrolling==="smooth"}get className(){let e="lenis";return this.options.autoToggle&&(e+=" lenis-autoToggle"),this.isStopped&&(e+=" lenis-stopped"),this.isLocked&&(e+=" lenis-locked"),this.isScrolling&&(e+=" lenis-scrolling"),this.isScrolling==="smooth"&&(e+=" lenis-smooth"),e}updateClassName(){this.cleanUpClassName(),this.rootElement.className=`${this.rootElement.className} ${this.className}`.trim()}cleanUpClassName(){this.rootElement.className=this.rootElement.className.replace(/lenis(-\w+)?/g,"").trim()}};const Wn=({transition:e=1.2,easing:t,orientation:n="vertical",smoothTouch:r=!1,touchMultiplier:s=2,children:a})=>{const c=o.useRef(null),l=o.useRef(null);return o.useEffect(()=>{let d;typeof e=="string"?e.endsWith("ms")?d=parseFloat(e)/1e3:e.endsWith("s")?d=parseFloat(e):d=parseFloat(e)||1.2:d=e;const i=y=>1-Math.pow(1-y,5);c.current=new An({duration:d,easing:t??i,orientation:n,smoothWheel:!0,touchMultiplier:s,syncTouch:r});const f=y=>{var h;(h=c.current)==null||h.raf(y),l.current=requestAnimationFrame(f)};return l.current=requestAnimationFrame(f),()=>{var y;l.current!==null&&cancelAnimationFrame(l.current),(y=c.current)==null||y.destroy(),c.current=null}},[e,t,n,r,s]),a?u.jsx(u.Fragment,{children:a}):null},ae=({style:e,colorName:t,stateClassName:n="state-ripple-group",children:r,className:s})=>{const a=o.useRef(null),c=o.useRef(null),[l,d]=o.useState(!1),i=Ht({isClient:l,stateClassName:n,className:s,colorName:t});return o.useEffect(()=>{if(a.current&&n!=="state-layer"){const y=(n.includes("[")?"group/"+n.split("[")[1].split("]")[0]:"group").replace(/\//g,"\\/"),h=a.current.closest(`.${y}:not(.${y} .${y})`);c.current=h}d(!0)},[]),u.jsxs("div",{ref:a,className:i.stateLayer,style:{"--state-color":`var(--default-color, var(--color-${t}))`,...e},children:[l&&u.jsx(At,{triggerRef:c}),r]})},Pn=({isClient:e,stateClassName:t})=>({stateLayer:v(["w-full top-0 left-0 h-full absolute pointer-events-none overflow-hidden",t])}),Ht=Z("stateLayer",Pn),Ot=({targetRef:e,children:t})=>{const[n,r]=o.useState(null),s=o.useRef(null),a=()=>{const c=e.current;if(!c)return;const l=c.getBoundingClientRect();r({position:"fixed",top:l.top,left:l.left,width:l.width,height:l.height,pointerEvents:"none",zIndex:999})};return o.useEffect(()=>{const c=e.current;if(c)return a(),window.addEventListener("scroll",a,!0),window.addEventListener("resize",a),s.current=new ResizeObserver(a),s.current.observe(c),()=>{var l;window.removeEventListener("scroll",a,!0),window.removeEventListener("resize",a),(l=s.current)==null||l.disconnect()}},[e]),n?_e.createPortal(u.jsx("div",{style:n,children:t}),document.body):null};function Bn(e){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e)}const Tn=({config:e,throttleDelay:t=100,onLoad:n,loadTheme:r=!1})=>{const[s,a]=o.useState(null);o.useEffect(()=>{(async()=>{const h=await xe.loader(e,r);a(h)})()},[]);const[c,l]=o.useState(null),d=o.useRef(null),i=o.useRef(0),f=o.useRef(null);o.useEffect(()=>{if(!s)return;const h={...e,sourceColor:e.sourceColor},m=Date.now(),p=m-i.current,N=async w=>{await y(w)};if(i.current===0||p>=t)d.current&&(clearTimeout(d.current),d.current=null),f.current=null,i.current=m,N(h);else if(f.current=h,!d.current){const w=Math.max(0,t-p);d.current=setTimeout(async()=>{d.current=null;const j=f.current;f.current=null,j&&(i.current=Date.now(),await N(j))},w)}return()=>{}},[e,t,s]);const y=async h=>{if(typeof h.sourceColor=="string"&&!Bn(h.sourceColor))throw new Error("Invalid hex color");if(!s)return;s.context.update(h),await s.load();const m=s==null?void 0:s.plugins.getPlugin(ze.TailwindPlugin).getInstance().outputCss;l(m),n==null||n(s)};return o.useEffect(()=>()=>{d.current&&(clearTimeout(d.current),d.current=null)},[]),c?u.jsx("style",{dangerouslySetInnerHTML:{__html:c}}):null};function Hn(){if(typeof window>"u")return!1;try{if(window.CSS&&typeof window.CSS.supports=="function")return CSS.supports("animation-timeline: view()")||CSS.supports("animation-timeline: scroll()")||CSS.supports("view-timeline-name: --a")}catch{}return!1}function On(){return typeof window>"u"||!("matchMedia"in window)?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function Ie(e){if(!(e instanceof HTMLElement))return!1;const t=e.classList;return Array.from(t).some(n=>n.startsWith("anim-")&&n.includes("scroll"))}function We(e){if(!(e instanceof HTMLElement))return!1;const t=e.classList;return Array.from(t).some(n=>n.startsWith("anim-"))}function Se(e,t){if(!Ie(e))return;if(e.hasAttribute(`data-${t}-scroll`)){const c=(e.getAttribute(`data-${t}-scroll`)||"").trim().toLowerCase(),l=c==="x"||c==="inline"?"inline":c==="y"||c==="block"?"block":"auto";e.classList.contains(`${t}-timeline`)||e.classList.contains(`${t}-timeline-inline`)||e.classList.contains(`${t}-timeline-block`)||e.classList.contains(`${t}-timeline-x`)||e.classList.contains(`${t}-timeline-y`)||(l==="inline"?e.classList.add(`${t}-timeline-inline`):l==="block"?e.classList.add(`${t}-timeline-block`):e.classList.add(`${t}-scroll`))}const n=e.getAttribute(`data-${t}-start`);n&&e.style.setProperty(`--${t}-range-start`,n);const r=e.getAttribute(`data-${t}-end`);r&&e.style.setProperty(`--${t}-range-end`,r);const s=e.hasAttribute(`data-${t}-paused`)||e.classList.contains(`${t}-paused`),a=e.hasAttribute(`data-${t}-run`)||e.classList.contains(`${t}-run`);!s&&!a&&e.setAttribute(`data-${t}-run`,"")}function Ne(e=document,t){return Array.from(e.querySelectorAll(`[class*="${t}-"][class*="-scroll"]`)).filter(r=>Ie(r))}function Vn(e=document,t){const n=Array.from(e.querySelectorAll(`[class*="${t}-"]`)),r=new Set([`${t}-run`,`${t}-in`,`${t}-out`,`${t}-in-run`,`${t}-out-run`,`${t}-paused`,`${t}-timeline`,`${t}-timeline-inline`,`${t}-timeline-block`,`${t}-timeline-x`,`${t}-timeline-y`,`${t}-scroll`]);return n.filter(s=>{if(!(s instanceof HTMLElement))return!1;const a=s.classList;return a.contains(`${t}-in`)||a.contains(`${t}-out`)||Array.from(a).some(d=>d.startsWith(`${t}-`)&&!d.includes("scroll")&&!r.has(d))?!0:!Ie(s)})}function _n(e,t){return Array.from(e).some(n=>n.startsWith(t)&&n.includes("-out"))}function Pe(e,t,n){e.setAttribute(`data-${t}-run`,""),e.setAttribute(`data-${t}-${n}-run`,"")}function Be(e,t,n){const r=e.style.animationName;e.style.animationName="none",e.removeAttribute(`data-${t}-run`),n?e.removeAttribute(`data-${t}-${n}-run`):(e.removeAttribute(`data-${t}-in-run`),e.removeAttribute(`data-${t}-out-run`)),e.offsetWidth,e.style.animationName=r}const zn=[0,.2],Te=new WeakSet;function He(e,t){if(Te.has(e))return;Te.add(e);const n=s=>{s.target===e&&(e.hasAttribute(`data-${t}-in-run`)||e.hasAttribute(`data-${t}-out-run`))&&e.setAttribute(`data-${t}-animating`,"")},r=s=>{s.target===e&&e.removeAttribute(`data-${t}-animating`)};e.addEventListener("animationstart",n),e.addEventListener("animationend",r),e.addEventListener("animationcancel",r)}function Ce(e={}){const{prefix:t="anim",once:n=!0}=e;if(On())return()=>{};const r=Hn(),s=new WeakSet;let a=typeof window<"u"&&(window.pageYOffset||window.scrollY)||0,c=!0;const l=()=>{const m=window.pageYOffset||window.scrollY||0;c=m>=a,a=m};typeof window<"u"&&window.addEventListener("scroll",l,{passive:!0});const d=new IntersectionObserver(m=>{for(const p of m){const N=p.target;if(!We(N)||N.hasAttribute(`data-${t}-animating`))continue;const w=_n(N.classList,t);p.isIntersecting?(w&&Be(N,t,"out"),Pe(N,t,"in"),n&&d.unobserve(N)):n||(c||Be(N,t,"in"),w&&Pe(N,t,"out"))}},{threshold:zn}),i=m=>{const p=Vn(m||document,t);for(const N of p)s.has(N)||(s.add(N),d.observe(N),He(N,t))};i();let f,y=null,h=null;if(r)(()=>{h==null&&(h=requestAnimationFrame(()=>{h=null;const p=Ne(void 0,t);for(const N of p)Se(N,t)}))})(),y=new MutationObserver(p=>{for(const N of p)if(N.type==="attributes"){const w=N.target;w instanceof HTMLElement&&(Se(w,t),We(w)&&(s.has(w)||(s.add(w),d.observe(w),He(w,t))))}else if(N.type==="childList"&&N.addedNodes&&N.addedNodes.length){for(const w of Array.from(N.addedNodes))if(w instanceof HTMLElement){const j=Ne(w,t);for(const S of j)Se(S,t);i(w)}}}),y.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["class",`data-${t}-scroll`,`data-${t}-start`,`data-${t}-end`,`data-${t}-paused`,`data-${t}-run`]}),f=()=>{h!=null&&cancelAnimationFrame(h),y&&y.disconnect()};else{let m;Ne(void 0,t).length>0&&Promise.resolve().then(()=>require("./scrollDriven-DWAu7CR0.cjs")).then(N=>{m=N.initScrollViewFallback({once:n})}),f=()=>{typeof m=="function"&&m()}}return()=>{f&&f(),typeof window<"u"&&window.removeEventListener("scroll",l),d.disconnect()}}const Yn=Ce,qn=Ce;function Xn(e){const t={primary:"filled",secondary:"tonal"};return e&&e in t?t[e]:e||"filled"}const he=({variant:e="filled",disabled:t=!1,icon:n,href:r,label:s,disableTextMargins:a,className:c,iconPosition:l="left",loading:d=!1,shape:i="rounded",onClick:f,onToggle:y,activated:h,ref:m,size:p="medium",allowShapeTransformation:N=!0,transition:w,children:j,...S})=>{if(j&&(s=j),!s)throw new Error("Button component requires either a label prop or children content");e=Xn(e);const g=r?"a":"button",P=o.useRef(null),C=m||P,[x,L]=o.useState(h);o.useEffect(()=>{L(h)},[h]),w={duration:.3,...w};const D=I=>{t&&I.preventDefault(),y?(L(!x),y(!x)):f&&f(I)},$=Ue({allowShapeTransformation:N,size:p,disableTextMargins:a,shape:i,href:r,disabled:t,icon:n,iconPosition:l,loading:d,variant:e,transition:w,className:c,isActive:x??!1,onToggle:y,activated:x,label:s,children:s}),W=n?u.jsx(ie,{icon:n,className:$.icon}):u.jsx(u.Fragment,{});return u.jsxs(g,{ref:C,href:r,className:$.button,...S,onClick:D,disabled:t,"aria-pressed":y?x:void 0,style:{transition:w.duration+"s"},children:[u.jsx("div",{className:$.touchTarget}),u.jsx(ae,{style:{transition:w.duration+"s"},className:$.stateLayer,colorName:v(e==="filled"&&{"on-surface-variant":!x&&!!y,"on-primary":x||!y},e==="elevated"&&{"on-primary":x&&!!y,primary:!x||!y},e==="tonal"&&{"on-secondary":x&&!!y,"on-secondary-container":!x||!y},e==="outlined"&&{"inverse-on-surface":x&&!!y,"on-surface-variant":!x||!y},e==="text"&&"primary"),stateClassName:"state-ripple-group-[button]"}),l==="left"&&W,d&&u.jsx("div",{className:"!absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2",children:u.jsx($t,{className:()=>({progressIndicator:"h-6 w-6",activeIndicator:v({"!stroke-primary":e==="elevated"&&!t,"!stroke-on-surface/[38%]":e==="elevated"&&t},{"!stroke-on-primary":e==="filled"&&!t,"!stroke-on-surface/[38%]":e==="filled"&&t},{"!stroke-on-secondary-container":e==="tonal"&&!t,"!stroke-on-surface/[38%]":e==="tonal"&&t},{"!stroke-primary":e==="outlined"&&!t,"!stroke-on-surface/[38%]":e==="outlined"&&t},{"!stroke-primary":e==="text"&&!t,"!stroke-on-surface/[38%]":e==="text"&&t})}),variant:"circular-indeterminate"})}),u.jsx("span",{className:$.label,children:s}),l==="right"&&W]})},Un=({variant:e="outlined",className:t,children:n,interactive:r=!1,ref:s,...a})=>{const c=Ge({className:t,isInteractive:r,variant:e,children:n}),l=o.useRef(null),d=s||l;return u.jsxs("div",{...a,ref:d,className:c.card,children:[r&&u.jsx(ae,{className:c.stateLayer,colorName:"on-surface",stateClassName:"state-ripple-group-[card]"}),n]})},de=(e,t,n=[0,1])=>{const[r,s]=t,[a,c]=n,d=(Math.max(r,Math.min(e,s))-r)/(s-r);return a+d*(c-a)},Vt=({className:e,children:t,width:n,index:r=0,outputRange:s,ref:a,...c})=>{const l=o.useRef(null),d=a||l,i=Je({className:e,index:r,width:n,children:t,outputRange:s});return u.jsx("div",{ref:d,style:{width:n+"px",maxWidth:s[1]+"px",minWidth:s[0]+"px",willChange:"width"},transition:{duration:.5,ease:"linear"},className:i.carouselItem,...c,children:t})},Kn=({variant:e="hero",className:t,children:n,ref:r,marginPourcent:s=0,inputRange:a=[.21,.65],outputRange:c=[42,300],gap:l=8,onChange:d,onMetricsChange:i,index:f,scrollSensitivity:y=1.25,...h})=>{const m=o.useRef(null),p=r||m,[N,w]=o.useState(0),j=Qe({index:f,className:t,children:n,variant:e,inputRange:a,outputRange:c,marginPourcent:s,onChange:d,gap:l,scrollSensitivity:y,onMetricsChange:i}),S=o.Children.toArray(n).filter(E=>o.isValidElement(E)&&E.type===Vt),g=o.useRef(null),[P,C]=o.useState({}),[x,L]=o.useState(null),D=o.useRef(0),$=o.useRef(null),W=()=>{var ue,me;if(!g.current||!p.current||(x==null?void 0:x.scrollProgress)===void 0)return[];const E=(x==null?void 0:x.scrollVisible)??((ue=p.current)==null?void 0:ue.clientWidth)??0;function F(U,se){return U.map((oe,pe)=>{const be=(oe-se)/Math.abs(U[1]-U[0]);return{itemScrollXCenter:oe,relativeIndex:be,index:pe,width:0}})}const H=S.map((U,se)=>{if(!I[se].current||!g.current)return 0;const pe=se/(S.length-1);return de(pe,[0,1],[0,1])}),_=F(H,(x==null?void 0:x.scrollProgress)??0).sort((U,se)=>U.index-se.index);let z=(((me=p.current)==null?void 0:me.clientWidth)??E)+l+c[0]+l;const Q=_.sort((U,se)=>Math.abs(U.relativeIndex)-Math.abs(se.relativeIndex)).map((U,se)=>{if(!(z<=0)){if(se==0&&M(U.index),U.width=de(z-l,[c[0],c[1]],[c[0],c[1]]),z-=U.width+l,z!=0&&z<(c[0]+l)*2){const oe=U.width-((c[0]+l)*2-z);z+=U.width,U.width=oe,z-=U.width}else if(z==0&&U.width>=c[0]*2+l){const oe=U.width-(c[0]+l-z);z+=U.width,U.width=oe,z-=U.width}return U}}).filter(Boolean),A=Q.reverse(),Y=[...Q].sort((U,se)=>Math.abs(U.index)-Math.abs(se.index));A.forEach((U,se)=>{const oe=A[se+1];if(!oe)return;const pe=1-(Math.abs(U.relativeIndex)-Math.abs(oe==null?void 0:oe.relativeIndex)),be=de(pe,[0,2],[U.width+z,oe.width]);z+=U.width,U.width=be,z-=U.width});const ne=Q.length/2,le=de(Math.abs(Y[0].relativeIndex),[Y[0].index==0?0:ne-1,ne],[0,1]),we=de(le,[0,1],[0,1])*-(c[0]+l);return w(we),Object.fromEntries(Q.map(U=>[U.index,U.width]))},I=o.useRef([]).current,[R,M]=o.useState(0);o.useEffect(()=>{d&&d(R)},[R]),o.useEffect(()=>{typeof f=="number"&&S.length>0&&f!==R&&X(f)},[f,S.length]),o.useEffect(()=>{J(R)},[R]),I.length!==S.length&&S.forEach((E,F)=>{I[F]||(I[F]=o.createRef())});const[V,J]=o.useState(0),X=(E,F={})=>{if(!S.length)return 0;const H=I[E];if(!H||!H.current||!g.current)return 0;const _=de(E/Math.max(1,S.length-1),[0,1],[0,1]);return J(E),g.current.dispatchEvent(new CustomEvent("udx:customScroll:set",{bubbles:!0,detail:{progress:_,orientation:"horizontal",animate:F.animate!==!1}})),_},T=S.map((E,F)=>{var Q;const H=(Q=E.props)==null?void 0:Q.onClick,_=A=>{H==null||H(A)},z=()=>J(F);return o.cloneElement(E,{width:P[F],outputRange:c,ref:I[F],key:F,index:F,role:"option","aria-selected":R===F,tabIndex:R===F?0:-1,onClick:_,onFocus:z})}),O=E=>{var F;if(E.scrollTotal>0){(F=$.current)==null||F.stop();const H=D.current??0,_=E.scrollProgress??0;$.current=q.animate(H,_,{type:"spring",stiffness:260,damping:32,mass:.6,restDelta:5e-4,onUpdate:z=>{D.current=z,L({...E,scrollProgress:z})}})}};o.useEffect(()=>{const E=W();C(E)},[x]);const K=o.useRef(i);o.useEffect(()=>{K.current=i},[i]);const G=o.useRef(null);o.useEffect(()=>{var se;const E=K.current;if(!E||!(p!=null&&p.current))return;const F=S.length;if(F<=0)return;const H=((se=p.current)==null?void 0:se.clientWidth)??0,_=c[1],z=D.current??(x==null?void 0:x.scrollProgress)??0,Q=(H+l)/(_+l),A=Math.max(1,Math.floor(Q)),Y=Math.max(1,Math.round(A*(2/3))),ne=Math.min(Math.max(0,R),Math.max(0,F-1)),le=ne>0,we=ne<F-1,ue={total:F,selectedIndex:ne,visibleApprox:Q,visibleFull:A,stepHalf:Y,canPrev:le,canNext:we,scrollProgress:z,viewportWidth:H,itemMaxWidth:_,gap:l},me=G.current;let U=!me;if(!U){for(const oe in ue)if(ue[oe]!==me[oe]){U=!0;break}}U&&(G.current=ue,E(ue))},[p,S.length,R,x,l,c]),o.useEffect(()=>()=>{var E;(E=$.current)==null||E.stop()},[]);const[te,b]=o.useState(0);o.useLayoutEffect(()=>{let E=c[1];x&&E>x.scrollVisible&&(E=x.scrollVisible);const F=(E+l)*T.length/y;b(F)},[p,I,x]);const k=E=>{if(!S.length)return;const F=V??R;switch(E.key){case"ArrowLeft":E.preventDefault(),X(Math.max(0,F-1));break;case"ArrowRight":E.preventDefault(),X(Math.min(S.length-1,F+1));break;case"Home":E.preventDefault(),X(0);break;case"End":E.preventDefault(),X(S.length-1);break;case"Enter":case" ":E.preventDefault(),X(F);break}};return o.useEffect(()=>{const E=p.current;if(!E)return;const F=H=>{const _=H.detail;_&&typeof _.index=="number"&&X(_.index)};return E.addEventListener("udx:carousel:centerIndex",F),()=>{E.removeEventListener("udx:carousel:centerIndex",F)}},[p,S.length]),u.jsx("div",{className:j.carousel,ref:p,role:"listbox","aria-orientation":"horizontal",onKeyDown:k,...h,children:u.jsx(Pt,{draggable:!0,orientation:"horizontal",onScroll:O,scrollSize:te,children:u.jsx("div",{className:j.track,ref:g,style:{gap:`${l}px`,translate:N,willChange:"translate"},children:T})})})};/*!
|
|
2
2
|
* Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com
|
|
3
3
|
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
4
4
|
* Copyright 2025 Fonticons, Inc.
|
|
5
|
-
*/var Un={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-192a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.6 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"]},Yn={prefix:"fas",iconName:"check",icon:[448,512,[10003,10004],"f00c","M434.8 70.1c14.3 10.4 17.5 30.4 7.1 44.7l-256 352c-5.5 7.6-14 12.3-23.4 13.1s-18.5-2.7-25.1-9.3l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l101.5 101.5 234-321.7c10.4-14.3 30.4-17.5 44.7-7.1z"]},me={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]},zn=me,Kn={prefix:"fas",iconName:"bars",icon:[448,512,["navicon"],"f0c9","M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]};const Le=({variant:e="outlined",disabled:t=!1,icon:n,href:r,label:s,className:a,onClick:c,onToggle:l,activated:u,ref:o,onRemove:f,editable:y,onEditStart:h,onEditCommit:m,onEditCancel:p,onChange:S,transition:b,children:k,editing:g,...v})=>{if(k&&(s=k),s===void 0&&!y)throw new Error("Chip component requires either a label prop or children content");const W=r?"a":"button",C=i.useRef(null),x=o||C,[E,I]=i.useState(u),[M,D]=i.useState(!1),[L,j]=i.useState(g&&y),[N,H]=i.useState(!1),[X,_]=i.useState(typeof s=="string"?s:""),P=i.useRef(null);i.useEffect(()=>{I(u)},[u]),i.useEffect(()=>{if(g&&j(g),y&&M){const $=setTimeout(()=>{v!=null&&v.draggable&&N||j(!0)},1e3);return()=>clearTimeout($)}else M||j(!1)},[M,y,N,v,X]),i.useEffect(()=>{if(L){_(typeof s=="string"?s:"");const $=z.current||P.current;if($){$.focus();const K=document.createRange();K.selectNodeContents($),K.collapse(!1);const Q=window.getSelection();Q==null||Q.removeAllRanges(),Q==null||Q.addRange(K)}}},[L]),b={duration:.3,...b};const F=$=>{t&&$.preventDefault(),l?(I(!E),l(!E)):c&&c($)},U=!!l||!!f||!!c||!!r||!!y;u&&(n=Yn);const{onFocus:G,onBlur:re,onKeyDown:ie,onDragStart:B,onDragEnd:R,onDoubleClick:T,...q}=v??{},Y=nt({href:r,disabled:t,icon:n,variant:e,transition:b,className:a,isActive:E??!1,onToggle:l,activated:E,label:s,isInteractive:U,children:s,isFocused:M,isDragging:N,onEditCommit:m,isEditing:L}),z=i.useRef(null),ee=()=>{const $=(X??"").trim();if(!$){f&&f();return}m==null||m($)};return d.jsxs(W,{contentEditable:!1,ref:x,href:r,className:Y.chip,...q,onClick:$=>{L||F($)},draggable:!t&&!!(v!=null&&v.draggable),onDragStart:$=>{!t&&(v!=null&&v.draggable)&&H(!0),B==null||B($)},onDragEnd:$=>{v!=null&&v.draggable&&H(!1),R==null||R($)},onDoubleClick:$=>{!t&&y&&!L&&(h==null||h(),$.preventDefault(),$.stopPropagation()),T==null||T($)},onFocus:$=>{U&&D(!0),G==null||G($)},onBlur:$=>{D(!1),re==null||re($)},onKeyDown:$=>{const K=$.key;if(!t&&L){K==="Enter"?($.preventDefault(),ee()):K==="Escape"?($.preventDefault(),p==null||p()):f&&(X==null?void 0:X.trim())===""&&(K==="Backspace"||K==="Delete"||K==="Del")&&($.preventDefault(),$.stopPropagation(),f());return}if(!t&&M){if(y&&!l&&(K==="F2"||K==="Enter")){$.preventDefault(),h==null||h();return}if(l&&(K==="Enter"||K===" "||K==="Spacebar")){$.preventDefault();const Q=!E;I(Q),l(Q)}f&&(K==="Backspace"||K==="Delete"||K==="Del")&&($.preventDefault(),$.stopPropagation(),f())}ie==null||ie($)},disabled:t,"aria-pressed":l?E:void 0,style:{transition:b.duration+"s"},children:[U&&!t&&!L&&d.jsx(ce,{style:{transition:b.duration+"s"},className:Y.stateLayer,colorName:w({"on-surface-variant":!E,"on-secondary-container":E}),stateClassName:"state-ripple-group-[chip]"}),n&&d.jsx(le,{icon:n,className:Y.leadingIcon}),d.jsx("span",{ref:z,contentEditable:!!y&&!!L,suppressContentEditableWarning:!0,className:Y.label,role:y?"textbox":void 0,spellCheck:!1,onInput:$=>{const K=$.currentTarget.innerText;_(K),S==null||S(K)},onBlur:$=>{y&&L&&ee()},onKeyDown:$=>{if(y&&L&&$.key==="Enter"){$.preventDefault(),$.stopPropagation(),ee();return}y&&L&&$.key==="Escape"&&($.preventDefault(),$.stopPropagation(),p==null||p())},children:s}),f&&!L&&d.jsx(le,{icon:me,className:Y.trailingIcon,onMouseDown:$=>{$.preventDefault(),$.stopPropagation()},onClick:$=>{$.stopPropagation(),t||f()}})]})},De=({orientation:e="horizontal",className:t,...n})=>{const r=it({orientation:e,className:t});return d.jsx("hr",{className:r.divider,...n})},ne=[];for(let e=0;e<256;++e)ne.push((e+256).toString(16).slice(1));function Gn(e,t=0){return(ne[e[t+0]]+ne[e[t+1]]+ne[e[t+2]]+ne[e[t+3]]+"-"+ne[e[t+4]]+ne[e[t+5]]+"-"+ne[e[t+6]]+ne[e[t+7]]+"-"+ne[e[t+8]]+ne[e[t+9]]+"-"+ne[e[t+10]]+ne[e[t+11]]+ne[e[t+12]]+ne[e[t+13]]+ne[e[t+14]]+ne[e[t+15]]).toLowerCase()}let Ne;const Jn=new Uint8Array(16);function Zn(){if(!Ne){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ne=crypto.getRandomValues.bind(crypto)}return Ne(Jn)}const Qn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ve={randomUUID:Qn};function pe(e,t,n){var s;if(Ve.randomUUID&&!e)return Ve.randomUUID();e=e||{};const r=e.random??((s=e.rng)==null?void 0:s.call(e))??Zn();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Gn(r)}const es=({variant:e="input",className:t,scrollable:n=!0,draggable:r=!1,items:s,onItemsChange:a})=>{const c=s??[],l=i.useRef(null),[u,o]=i.useState(!1),f=i.useRef(new WeakMap),y=i.useCallback(x=>{const E=f.current;let I=E.get(x);return I||(I=pe(),E.set(x,I)),I},[]);i.useEffect(()=>{var x,E;u&&(e=="input"?(x=W.current)==null||x.focus():(E=l.current)==null||E.focus())},[u]);const h=i.useRef([]),m=i.useRef(!1),p=i.useCallback(x=>{a==null||a(x(c))},[a,c]),S=i.useCallback(x=>{p(E=>E.filter((I,M)=>M!==x))},[p]),b=rt({scrollable:n,className:t,variant:e}),k=i.useCallback((x="")=>{if(e!=="input"||m.current)return;m.current=!0;const E={label:x},I=y(E),M=[...c,E];a==null||a(M),requestAnimationFrame(()=>{v(I),m.current=!1})},[e,a,c,y]),[g,v]=i.useState(null);i.useEffect(()=>{var x;if(g){const E=c.findIndex(I=>y(I)===g);if(E!==-1){const I=h.current[E];(x=I==null?void 0:I.focus)==null||x.call(I);const M=l.current,D=I.offsetLeft+I.offsetWidth/2-M.offsetWidth/2;M.scrollTo({left:D,behavior:"smooth"})}}},[g,c,y]);const W=i.useRef(null),C=(u||c.length===0)&&e==="input";return d.jsxs("div",{ref:l,role:"list","aria-label":"Chips",className:b.chips,tabIndex:e==="input"?0:void 0,onFocus:x=>{x.target===x.currentTarget&&o(!0)},onBlur:()=>{o(!1)},onKeyDown:x=>{var j;if(e!=="input")return;const E=x.key,M=x.target===x.currentTarget;if(!u)return;const D=document.activeElement,L=h.current.findIndex(N=>N===D);if(E==="ArrowLeft"){x.preventDefault();const N=L>0?L-1:c.length-1,H=y(c[N]);v(H);return}if(E==="ArrowRight"){x.preventDefault();const N=L>=0?(L+1)%Math.max(1,c.length):0,H=y(c[N]);v(H);return}if(E==="Home"){x.preventDefault();const N=y(c[0]);v(N);return}if(E==="End"){x.preventDefault();const N=y(c[c.length-1]);v(N);return}if(M&&E==="Backspace"){if(x.preventDefault(),c.length>0){const N=h.current[c.length-1];(j=N==null?void 0:N.focus)==null||j.call(N)}return}},children:[c.map((x,E)=>{const I=y(x),M=e==="input",D=M?{editable:!0,editing:g===I,onEditCommit:L=>{o(!0),p(j=>j.map((N,H)=>H===E?{...N,label:L}:N))},onEditCancel:()=>{o(!0)},onChange:()=>{if(h.current.length==E+1){const L=l.current;requestAnimationFrame(()=>{L.scrollTo({left:L.scrollWidth,behavior:"smooth"})})}}}:{};return d.jsx(Le,{ref:L=>h.current[E]=L,label:x.label??"",icon:x.icon,activated:x.activated,disabled:x.disabled,variant:x.variant,href:x.href,draggable:r,...D,onToggle:x.activated===void 0?void 0:L=>p(j=>j.map((N,H)=>H===E?{...N,activated:L}:N)),onBlur:()=>{g===I&&v(null)},onRemove:M?()=>{o(!0),S(E)}:void 0},I)}),u&&d.jsxs(d.Fragment,{children:[d.jsx(De,{orientation:"vertical",className:"animate-[var(--animate-blink)] border-outline",style:{"--animate-blink":"blink 1s cubic-bezier(0.4, 0, 0.6, 1) infinite"}}),d.jsx("style",{children:`
|
|
5
|
+
*/var Gn={prefix:"fas",iconName:"minus",icon:[448,512,[8211,8722,10134,"subtract"],"f068","M0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32z"]},Jn={prefix:"fas",iconName:"chevron-right",icon:[320,512,[9002],"f054","M311.1 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L243.2 256 73.9 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"]},Zn={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-192a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.6 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"]},_t={prefix:"fas",iconName:"check",icon:[448,512,[10003,10004],"f00c","M434.8 70.1c14.3 10.4 17.5 30.4 7.1 44.7l-256 352c-5.5 7.6-14 12.3-23.4 13.1s-18.5-2.7-25.1-9.3l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l101.5 101.5 234-321.7c10.4-14.3 30.4-17.5 44.7-7.1z"]},ye={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]},Qn=ye,es={prefix:"fas",iconName:"chevron-down",icon:[448,512,[],"f078","M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"]},ts={prefix:"fas",iconName:"chevron-left",icon:[320,512,[9001],"f053","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"]},ns={prefix:"fas",iconName:"bars",icon:[448,512,["navicon"],"f0c9","M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]};const ss=({checked:e,defaultChecked:t,indeterminate:n=!1,disabled:r=!1,error:s=!1,onChange:a,id:c,name:l,value:d,style:i,className:f,...y})=>{const h=o.useId(),m=c||h,p=e!==void 0,[N,w]=o.useState(t??!1),j=p?e:N,[S,g]=o.useState(!1),P=o.useRef(null);o.useEffect(()=>{P.current&&(P.current.indeterminate=n)},[n]);const C=L=>{r||(p||w(L.target.checked),a&&a(L))},x=tt({isChecked:!!j,isIndeterminate:n,isDisabled:r,isError:s,isFocused:S,isHovered:!1});return u.jsx("div",{className:v(x.checkbox,f,"group/checkbox"),style:i,children:u.jsxs(ae,{stateClassName:x.stateLayer,colorName:j||n?"primary":"on-surface",children:[u.jsx("input",{ref:P,type:"checkbox",id:m,name:l,value:d,checked:j,disabled:r,onChange:C,onFocus:()=>g(!0),onBlur:()=>g(!1),className:x.input,...y}),u.jsx("div",{className:x.box}),u.jsx(q.AnimatePresence,{children:(j||n)&&u.jsx(q.motion.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},transition:{duration:.15},className:x.icon,children:u.jsx(ie,{icon:n?Gn:_t,className:"size-3.5"})})})]})})},Le=({variant:e="outlined",disabled:t=!1,icon:n,href:r,label:s,className:a,onClick:c,onToggle:l,activated:d,ref:i,onRemove:f,editable:y,onEditStart:h,onEditCommit:m,onEditCancel:p,onChange:N,transition:w,children:j,editing:S,...g})=>{if(j&&(s=j),s===void 0&&!y)throw new Error("Chip component requires either a label prop or children content");const P=r?"a":"button",C=o.useRef(null),x=i||C,[L,D]=o.useState(d),[$,W]=o.useState(!1),[I,R]=o.useState(S&&y),[M,V]=o.useState(!1),[J,X]=o.useState(typeof s=="string"?s:""),T=o.useRef(null);o.useEffect(()=>{D(d)},[d]),o.useEffect(()=>{if(S&&R(S),y&&$){const A=setTimeout(()=>{g!=null&&g.draggable&&M||R(!0)},1e3);return()=>clearTimeout(A)}else $||R(!1)},[$,y,M,g,J]),o.useEffect(()=>{if(I){X(typeof s=="string"?s:"");const A=z.current||T.current;if(A){A.focus();const Y=document.createRange();Y.selectNodeContents(A),Y.collapse(!1);const ne=window.getSelection();ne==null||ne.removeAllRanges(),ne==null||ne.addRange(Y)}}},[I]),w={duration:.3,...w};const O=A=>{t&&A.preventDefault(),l?(D(!L),l(!L)):c&&c(A)},K=!!l||!!f||!!c||!!r||!!y;d&&(n=_t);const{onFocus:G,onBlur:te,onKeyDown:b,onDragStart:k,onDragEnd:E,onDoubleClick:F,...H}=g??{},_=st({href:r,disabled:t,icon:n,variant:e,transition:w,className:a,isActive:L??!1,onToggle:l,activated:L,label:s,isInteractive:K,children:s,isFocused:$,isDragging:M,onEditCommit:m,isEditing:I}),z=o.useRef(null),Q=()=>{const A=(J??"").trim();if(!A){f&&f();return}m==null||m(A)};return u.jsxs(P,{contentEditable:!1,ref:x,href:r,className:_.chip,...H,onClick:A=>{I||O(A)},draggable:!t&&!!(g!=null&&g.draggable),onDragStart:A=>{!t&&(g!=null&&g.draggable)&&V(!0),k==null||k(A)},onDragEnd:A=>{g!=null&&g.draggable&&V(!1),E==null||E(A)},onDoubleClick:A=>{!t&&y&&!I&&(h==null||h(),A.preventDefault(),A.stopPropagation()),F==null||F(A)},onFocus:A=>{K&&W(!0),G==null||G(A)},onBlur:A=>{W(!1),te==null||te(A)},onKeyDown:A=>{const Y=A.key;if(!t&&I){Y==="Enter"?(A.preventDefault(),Q()):Y==="Escape"?(A.preventDefault(),p==null||p()):f&&(J==null?void 0:J.trim())===""&&(Y==="Backspace"||Y==="Delete"||Y==="Del")&&(A.preventDefault(),A.stopPropagation(),f());return}if(!t&&$){if(y&&!l&&(Y==="F2"||Y==="Enter")){A.preventDefault(),h==null||h();return}if(l&&(Y==="Enter"||Y===" "||Y==="Spacebar")){A.preventDefault();const ne=!L;D(ne),l(ne)}f&&(Y==="Backspace"||Y==="Delete"||Y==="Del")&&(A.preventDefault(),A.stopPropagation(),f())}b==null||b(A)},disabled:t,"aria-pressed":l?L:void 0,style:{transition:w.duration+"s"},children:[K&&!t&&!I&&u.jsx(ae,{style:{transition:w.duration+"s"},className:_.stateLayer,colorName:v({"on-surface-variant":!L,"on-secondary-container":L}),stateClassName:"state-ripple-group-[chip]"}),n&&u.jsx(ie,{icon:n,className:_.leadingIcon}),u.jsx("span",{ref:z,contentEditable:!!y&&!!I,suppressContentEditableWarning:!0,className:_.label,role:y?"textbox":void 0,spellCheck:!1,onInput:A=>{const Y=A.currentTarget.innerText;X(Y),N==null||N(Y)},onBlur:A=>{y&&I&&Q()},onKeyDown:A=>{if(y&&I&&A.key==="Enter"){A.preventDefault(),A.stopPropagation(),Q();return}y&&I&&A.key==="Escape"&&(A.preventDefault(),A.stopPropagation(),p==null||p())},children:s}),f&&!I&&u.jsx(ie,{icon:ye,className:_.trailingIcon,onMouseDown:A=>{A.preventDefault(),A.stopPropagation()},onClick:A=>{A.stopPropagation(),t||f()}})]})},Re=({orientation:e="horizontal",className:t,...n})=>{const r=lt({orientation:e,className:t});return u.jsx("hr",{className:r.divider,...n})},re=[];for(let e=0;e<256;++e)re.push((e+256).toString(16).slice(1));function rs(e,t=0){return(re[e[t+0]]+re[e[t+1]]+re[e[t+2]]+re[e[t+3]]+"-"+re[e[t+4]]+re[e[t+5]]+"-"+re[e[t+6]]+re[e[t+7]]+"-"+re[e[t+8]]+re[e[t+9]]+"-"+re[e[t+10]]+re[e[t+11]]+re[e[t+12]]+re[e[t+13]]+re[e[t+14]]+re[e[t+15]]).toLowerCase()}let Ee;const os=new Uint8Array(16);function is(){if(!Ee){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ee=crypto.getRandomValues.bind(crypto)}return Ee(os)}const ls=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Oe={randomUUID:ls};function zt(e,t,n){var s;if(Oe.randomUUID&&!e)return Oe.randomUUID();e=e||{};const r=e.random??((s=e.rng)==null?void 0:s.call(e))??is();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,rs(r)}const as=({variant:e="input",className:t,scrollable:n=!0,draggable:r=!1,items:s,onItemsChange:a})=>{const c=s??[],l=o.useRef(null),[d,i]=o.useState(!1),f=o.useRef(new WeakMap),y=o.useCallback(x=>{const L=f.current;let D=L.get(x);return D||(D=zt(),L.set(x,D)),D},[]);o.useEffect(()=>{var x,L;d&&(e=="input"?(x=P.current)==null||x.focus():(L=l.current)==null||L.focus())},[d]);const h=o.useRef([]),m=o.useRef(!1),p=o.useCallback(x=>{a==null||a(x(c))},[a,c]),N=o.useCallback(x=>{p(L=>L.filter((D,$)=>$!==x))},[p]),w=ot({scrollable:n,className:t,variant:e}),j=o.useCallback((x="")=>{if(e!=="input"||m.current)return;m.current=!0;const L={label:x},D=y(L),$=[...c,L];a==null||a($),requestAnimationFrame(()=>{g(D),m.current=!1})},[e,a,c,y]),[S,g]=o.useState(null);o.useEffect(()=>{var x;if(S){const L=c.findIndex(D=>y(D)===S);if(L!==-1){const D=h.current[L];(x=D==null?void 0:D.focus)==null||x.call(D);const $=l.current,W=D.offsetLeft+D.offsetWidth/2-$.offsetWidth/2;$.scrollTo({left:W,behavior:"smooth"})}}},[S,c,y]);const P=o.useRef(null),C=(d||c.length===0)&&e==="input";return u.jsxs("div",{ref:l,role:"list","aria-label":"Chips",className:w.chips,tabIndex:e==="input"?0:void 0,onFocus:x=>{x.target===x.currentTarget&&i(!0)},onBlur:()=>{i(!1)},onKeyDown:x=>{var R;if(e!=="input")return;const L=x.key,$=x.target===x.currentTarget;if(!d)return;const W=document.activeElement,I=h.current.findIndex(M=>M===W);if(L==="ArrowLeft"){x.preventDefault();const M=I>0?I-1:c.length-1,V=y(c[M]);g(V);return}if(L==="ArrowRight"){x.preventDefault();const M=I>=0?(I+1)%Math.max(1,c.length):0,V=y(c[M]);g(V);return}if(L==="Home"){x.preventDefault();const M=y(c[0]);g(M);return}if(L==="End"){x.preventDefault();const M=y(c[c.length-1]);g(M);return}if($&&L==="Backspace"){if(x.preventDefault(),c.length>0){const M=h.current[c.length-1];(R=M==null?void 0:M.focus)==null||R.call(M)}return}},children:[c.map((x,L)=>{const D=y(x),$=e==="input",W=$?{editable:!0,editing:S===D,onEditCommit:I=>{i(!0),p(R=>R.map((M,V)=>V===L?{...M,label:I}:M))},onEditCancel:()=>{i(!0)},onChange:()=>{if(h.current.length==L+1){const I=l.current;requestAnimationFrame(()=>{I.scrollTo({left:I.scrollWidth,behavior:"smooth"})})}}}:{};return u.jsx(Le,{ref:I=>h.current[L]=I,label:x.label??"",icon:x.icon,activated:x.activated,disabled:x.disabled,variant:x.variant,href:x.href,draggable:r,...W,onToggle:x.activated===void 0?void 0:I=>p(R=>R.map((M,V)=>V===L?{...M,activated:I}:M)),onBlur:()=>{S===D&&g(null)},onRemove:$?()=>{i(!0),N(L)}:void 0},D)}),d&&u.jsxs(u.Fragment,{children:[u.jsx(Re,{orientation:"vertical",className:"animate-[var(--animate-blink)] border-outline",style:{"--animate-blink":"blink 1s cubic-bezier(0.4, 0, 0.6, 1) infinite"}}),u.jsx("style",{children:`
|
|
6
6
|
@keyframes blink {
|
|
7
7
|
0%, 50% { opacity: 1; }
|
|
8
8
|
50.01%, 100% { opacity: 0; }
|
|
9
9
|
}
|
|
10
|
-
`})]}),C&&d.jsx(Le,{ref:W,className:"opacity-0",draggable:r,editable:!0,editing:!0,onChange:x=>{var E;if(x=x.replace(/( )+/g," ").trim(),console.log("Ghost chip onChange",x,!!x),x)k(x);else if(c.length>0){const I=h.current[c.length-1];(E=I==null?void 0:I.focus)==null||E.call(I)}},onEditCommit:()=>{},onBlur:()=>{o(!1)},onFocus:x=>{o(!0),x.stopPropagation()},children:" "})]})};function Vt({trigger:e=["hover","focus"],isOpen:t,defaultOpen:n=!1,onOpenChange:r,openDelay:s=400,closeDelay:a=150,id:c}={}){const l=i.useId(),u=c??`tooltip-${l}`,o=Array.isArray(e)?e:[e],f=typeof t=="boolean",[y,h]=i.useState(n?"hovered":"hidden"),[m,p]=i.useState(!1),S=i.useRef(null),b=i.useRef(null),k=i.useCallback(()=>{S.current&&(clearTimeout(S.current),S.current=null),b.current&&(clearTimeout(b.current),b.current=null)},[]);i.useEffect(()=>()=>k(),[k]);const g=i.useCallback(_=>{if(f){const P=_!=="hidden";r==null||r(P)}else{h(_);const P=_!=="hidden";r==null||r(P)}},[f,r]),v=f?t?"hovered":"hidden":y,W=v!=="hidden",C=_=>{switch(_){case"hidden":return 0;case"hovered":return 1;case"focused":return 2;case"clicked":return 3;default:return 0}},x=i.useCallback(_=>{k(),!(C(_)<=C(v))&&(S.current=setTimeout(()=>{g(_)},s))},[k,s,v,g]),E=i.useCallback(_=>{k(),b.current=setTimeout(()=>{(!f&&C(y)<=C(_)||f)&&g("hidden")},a)},[k,a,y,f,g]),I=i.useCallback(()=>{o.includes("hover")&&x("hovered")},[o,x]),M=i.useCallback(()=>{o.includes("hover")&&(v==="focused"||v==="clicked"||m||E("hovered"))},[o,v,m,E]),D=i.useCallback(()=>{o.includes("focus")&&(k(),g("focused"))},[o,k,g]),L=i.useCallback(()=>{if(o.includes("focus")&&v!=="clicked"){if(o.includes("hover")&&m){g("hovered");return}E("focused")}},[o,v,m,E,g]),j=i.useCallback(()=>{o.includes("click")&&(k(),g(v==="clicked"?"hidden":"clicked"))},[o,v,k,g]),N=i.useCallback(_=>{_.key==="Escape"&&W&&(k(),g("hidden"),_.preventDefault())},[W,k,g]),H=i.useCallback(()=>{p(!0),k()},[k]),X=i.useCallback(()=>{p(!1),o.includes("hover")&&v==="hovered"&&E("hovered")},[o,v,E]);return{triggerProps:{"aria-describedby":W?u:void 0,onMouseEnter:I,onMouseLeave:M,onFocus:D,onBlur:L,onClick:j,onKeyDown:N},tooltipProps:{id:u,role:"tooltip","aria-hidden":!W,onMouseEnter:H,onMouseLeave:X},isOpen:W,state:v}}function _t({targetRef:e,position:t,variant:n="plain",isOpen:r}){const[s,a]=i.useState(t??"bottom");return i.useLayoutEffect(()=>{if(t){a(t);return}if(!r||!e.current||typeof window>"u")return;const l=e.current.getBoundingClientRect(),u=window.innerWidth,o=window.innerHeight,f=l.left/u,y=l.top/o;let h;n==="plain"?f<1/3?h="right":f>2/3?h="left":h=y>.5?"top":"bottom":f<.5&&y<.5?h="bottom-right":f>=.5&&y<.5?h="bottom-left":f>=.5&&y>=.5?h="top-left":h="top-right",a(h)},[r,e,t,n]),{resolvedPosition:s}}const $e=({variant:e="plain",buttons:t,className:n,children:r,title:s,text:a,content:c,position:l,targetRef:u,ref:o,trigger:f=["hover","focus"],transition:y,openDelay:h=400,closeDelay:m=150,isOpen:p,defaultOpen:S=!1,onOpenChange:b,id:k,...g})=>{if(y={duration:.3,...y},!r&&!u)throw new Error("Tooltip must have a child or a targetRef");t&&!Array.isArray(t)&&(t=[t]);const v=i.useRef(null),W=u||v,{triggerProps:C,tooltipProps:x,isOpen:E}=Vt({trigger:f,isOpen:p,defaultOpen:S,onOpenChange:b,openDelay:h,closeDelay:m,id:k}),{resolvedPosition:I}=_t({targetRef:W,position:l,variant:e,isOpen:E}),M=!u&&i.isValidElement(r)?i.cloneElement(r,{ref:v,...C,onMouseEnter:j=>{var N,H;C.onMouseEnter(),(H=(N=r.props)==null?void 0:N.onMouseEnter)==null||H.call(N,j)},onMouseLeave:j=>{var N,H;C.onMouseLeave(),(H=(N=r.props)==null?void 0:N.onMouseLeave)==null||H.call(N,j)},onFocus:j=>{var N,H;C.onFocus(),(H=(N=r.props)==null?void 0:N.onFocus)==null||H.call(N,j)},onBlur:j=>{var N,H;C.onBlur(),(H=(N=r.props)==null?void 0:N.onBlur)==null||H.call(N,j)},onClick:j=>{var N,H;C.onClick(),(H=(N=r.props)==null?void 0:N.onClick)==null||H.call(N,j)},onKeyDown:j=>{var N,H;C.onKeyDown(j),(H=(N=r.props)==null?void 0:N.onKeyDown)==null||H.call(N,j)}}):r;i.useEffect(()=>{if(!u)return;const j=u.current;if(!j)return;const N=()=>C.onMouseEnter(),H=()=>C.onMouseLeave(),X=()=>C.onFocus(),_=()=>C.onBlur(),P=()=>C.onClick(),F=U=>C.onKeyDown(U);return j.addEventListener("mouseenter",N),j.addEventListener("mouseleave",H),j.addEventListener("focus",X,!0),j.addEventListener("blur",_,!0),j.addEventListener("click",P),j.addEventListener("keydown",F),C["aria-describedby"]?j.setAttribute("aria-describedby",C["aria-describedby"]):j.removeAttribute("aria-describedby"),()=>{j.removeEventListener("mouseenter",N),j.removeEventListener("mouseleave",H),j.removeEventListener("focus",X,!0),j.removeEventListener("blur",_,!0),j.removeEventListener("click",P),j.removeEventListener("keydown",F)}},[u,C]);const D=Dt({variant:e,buttons:t,className:n,title:s,text:a,position:I,trigger:f,targetRef:u,children:r}),L={open:{opacity:1,height:"auto"},close:{opacity:0,height:16}};return d.jsxs(d.Fragment,{children:[M,d.jsx(O.AnimatePresence,{children:E&&d.jsx(Ht,{targetRef:W,children:d.jsx(O.motion.div,{initial:"close",variants:L,animate:"open",transition:{duration:y.duration},exit:"close",className:D.toolTip,...g,...x,children:d.jsx("div",{className:D.container,children:c?d.jsx("div",{className:D.content,children:c}):d.jsxs(d.Fragment,{children:[s&&d.jsx("div",{className:D.subHead,children:s}),a&&d.jsx("div",{className:D.supportingText,children:a}),t&&d.jsx("div",{className:D.actions,children:Array.isArray(t)&&t.map((j,N)=>d.jsx(Ce,{size:"small",variant:"text",...j},N))})]})})})})})]})},ve=({className:e,label:t,variant:n="primary",size:r="medium",href:s,type:a,icon:c,extended:l=!1,ref:u,transition:o,children:f,...y})=>{if(f&&(t=f),!t)throw new Error("FAB component requires either a label prop or children content");const h=s?"a":"button",m=at({href:s,icon:c,extended:l,label:t,size:r,variant:n,className:e,transition:o,children:t});o={duration:.3,...o};const p=i.useRef(null),S=u||p,b={visible:{width:"auto",marginLeft:12,opacity:1,transition:{...o,opacity:{duration:o.duration/2,delay:o.duration-o.duration/2}}},hidden:{width:0,marginLeft:0,opacity:0,transition:{...o,marginLeft:{duration:o.duration/2,delay:o.duration-o.duration/2}}}};return d.jsxs(h,{...y,ref:S,href:s,"aria-label":l?void 0:t,className:m.fab,children:[d.jsx($e,{trigger:l?null:void 0,text:t,targetRef:S}),d.jsx(ce,{style:{transition:o.duration+"s"},className:m.stateLayer,colorName:w({"on-primary":n=="primary","on-secondary":n=="secondary","on-tertiary":n=="tertiary","on-primary-container":n=="primaryContainer","on-secondary-container":n=="secondaryContainer","on-tertiary-container":n=="tertiaryContainer"}),stateClassName:"state-ripple-group-[fab]"}),d.jsx(le,{icon:c,className:m.icon}),d.jsx(O.AnimatePresence,{children:l&&d.jsx(O.motion.span,{variants:b,initial:"hidden",animate:"visible",exit:"hidden",className:m.label,children:t})})]})},ye=({variant:e="standard",href:t,disabled:n=!1,title:r,label:s,onToggle:a,activated:c=!1,onClick:l,icon:u,size:o="medium",iconSelected:f,className:y,ref:h,width:m="default",shape:p="rounded",allowShapeTransformation:S=!0,transition:b,children:k,...g})=>{if(k&&(s=k),!s)throw new Error("IconButton component requires either a label prop or children content to provide an accessible aria-label");r||(r=s);const[v,W]=i.useState(c),C=D=>{n&&D.preventDefault(),a?(W(!v),a(!v)):l&&l(D)};i.useEffect(()=>{W(c)},[c]);const x=t?"a":"button",E=ft({transition:b,shape:p,allowShapeTransformation:S,width:m,href:t,activated:v,label:s,iconSelected:f,isActive:v,onToggle:a,disabled:n,icon:u,variant:e,className:y,size:o,children:s,...g}),I=i.useRef(null),M=h||I;return b={duration:.3,...b},d.jsxs(x,{disabled:n,href:t,style:{transition:b.duration+"s"},className:E.iconButton,"aria-label":s,...g,title:void 0,onClick:C,ref:M,children:[d.jsx($e,{targetRef:M,trigger:n?null:void 0,text:r}),d.jsx("div",{className:E.touchTarget}),d.jsx(ce,{style:{transition:b.duration+"s"},className:E.stateLayer,colorName:w(e==="standard"&&{"on-surface-variant":!v,"on-primary":v},e==="filled"&&{"on-surface-variant":!v&&!!a,"on-primary":v||!a},e==="tonal"&&{"on-secondary":v&&!!a,"on-secondary-container":!v||!a},e==="outlined"&&{"inverse-on-surface":v&&!!a,"on-surface-variant":!v||!a}),stateClassName:"state-ripple-group-[icon-button]"}),u&&d.jsx(le,{icon:u,className:E.icon})]})},ts=({className:e,label:t,variant:n="primary",size:r="medium",href:s,icon:a,extended:c=!1,ref:l,transition:u,children:o,open:f,defaultOpen:y=!1,onOpenChange:h,...m})=>{u={duration:.3,ease:"easeInOut",...u};const p=i.useRef(null),S=l||p,b=typeof f=="boolean",[k,g]=i.useState(y),v=b?f:k,W=L=>{b||g(L),h==null||h(L)},C=i.Children.toArray(o).filter(L=>i.isValidElement(L)&&L.type===Ce),x=ut({href:s,icon:a,extended:c,label:t,size:r,variant:n,className:e,transition:u,children:t,open:v}),E=O.motion.create(ve),I=O.motion.create(ye),M=L=>d.jsx(E,{icon:a,extended:c,label:t,variant:n+"Container",size:r,className:x.fab+" "+(e??""),"aria-expanded":v,onClick:()=>W(!0),style:{transition:"border-radius 0.3s ease-in-out"},transition:{duration:u.duration,ease:"easeInOut",borderRadius:{duration:u.duration,ease:"easeInOut"},background:{duration:u.duration,ease:"easeInOut"},...u},...L}),[D]=i.useState(pe());return d.jsxs("div",{className:x.fabMenu,ref:S,...m,children:[d.jsx(O.AnimatePresence,{children:v&&d.jsx("div",{className:x.actions,role:"menu","aria-hidden":!v,children:(()=>{const L=C.length;return C.map((j,N)=>{j.props;const H=L-1-N,X=((u==null?void 0:u.delay)??0)+H*.06,_={open:{overflow:"visible",opacity:1,width:"auto",transition:{...u,delay:X,opacity:{delay:(u==null?void 0:u.duration)/2+X}}},close:{overflow:"hidden",opacity:0,width:0,transition:{...u,delay:X,opacity:{duration:(u==null?void 0:u.duration)/1.5}}}};return d.jsx(O.motion.div,{initial:"close",animate:"open",variants:_,transition:u,exit:"close",children:i.cloneElement(j,{key:N,shape:"rounded",variant:"filled",className:()=>({button:w("max-w-full overflow-hidden",{"px-0":!v,"bg-primary-container text-on-primary-container ":n==="primary","bg-secondary-container text-on-secondary-container":n==="secondary","bg-tertiary-container text-on-tertiary-container":n==="tertiary"}),stateLayer:w({"state-on-primary-container":n==="primary","state-on-secondary-container":n==="secondary","state-on-tertiary-container":n==="tertiary"})})})})})})()})}),M({className:"invisible pointer-events-none"}),d.jsxs("div",{className:"absolute right-0 top-0",children:[!v&&M({className:"",layout:!0,layoutId:"fab-menu"+D}),v&&d.jsx(d.Fragment,{children:d.jsx(I,{layout:!0,layoutId:"fab-menu"+D,variant:"filled",className:()=>({iconButton:w("",{"bg-primary text-on-primary":n==="primary","bg-secondary text-on-secondary":n==="secondary","bg-tertiary text-on-tertiary":n==="tertiary"}),stateLayer:w({"[--default-color:var(--color-on-primary)]":n==="primary","[--default-color:var(--color-on-secondary)]":n==="secondary","[--default-color:var(--color-on-tertiary)]":n==="tertiary"})}),style:{transition:"border-radius 0.3s ease-in-out"},transition:{duration:u.duration,ease:"easeInOut",borderRadius:{duration:u.duration,ease:"easeInOut"},background:{duration:u.duration,ease:"easeInOut"},...u},icon:zn,onClick:()=>W(!1),children:"Close"})})]})]})},ns=({className:e,valueFormatter:t,step:n=10,name:r,value:s=0,min:a=0,max:c=100,marks:l=[{value:0,label:"0"},{value:100,label:"100"}],ref:u,onChange:o,...f})=>{const y=P=>{const F=m(),U=h();return P===1/0?100:P===-1/0?0:(P-F)/(U-F)*100},h=(P=!1)=>P?c:c==1/0?l[(l==null?void 0:l.length)-1].value:c,m=(P=!1)=>P?a:a==-1/0?l[0].value:a,p=P=>{const F=m(!1);return(h(!1)-F)*P/100+F},[S,b]=i.useState(!1),k=i.useRef(null),g=u||k,[v,W]=i.useState(s),[C,x]=i.useState(y(s)),[E,I]=i.useState(!1);i.useEffect(()=>{W(s),x(y(s))},[s]);const M=P=>{I(!0),b(!0),j(P)},D=()=>{I(!1),b(!1)};i.useEffect(()=>(E?(window.addEventListener("mouseup",D),window.addEventListener("mousemove",j),window.addEventListener("touchend",D),window.addEventListener("touchmove",j)):(window.removeEventListener("mouseup",D),window.removeEventListener("mousemove",j),window.removeEventListener("touchend",D),window.removeEventListener("touchmove",j)),()=>{window.removeEventListener("mouseup",D),window.removeEventListener("mousemove",j),window.removeEventListener("touchend",D),window.removeEventListener("touchmove",j)}),[E]);const L=yt({className:e,isChanging:S,marks:l,max:c,min:a,name:r,step:n,value:v,valueFormatter:t,onChange:o}),j=P=>{const F=g==null?void 0:g.current;if(F){const U=F.getBoundingClientRect().left,re=((P.type==="touchmove"||P.type==="touchstart"?P.touches[0].clientX:P.clientX)-U)/F.offsetWidth*100;N({percent:re})}},N=({percent:P,value:F})=>{if(P){if(P>=100){W(h(!0)),x(100);return}if(P<=0){W(m(!0)),x(0);return}F=p(P),F==m()&&(F=m(!0)),F==h()&&(F=h(!0))}else if(F!=null){if(F>=h()){W(h(!0)),x(100);return}if(F<=m()){W(m(!0)),x(0);return}P=y(F)}else return;n!=null?F=Math.round((F-m())/n)*n+m():l&&(F=l.reduce((U,G,re)=>{let ie=G.value===1/0?h():G.value===-1/0?m():G.value,B=U.value===1/0?h():U.value===-1/0?m():U.value;return ie=Math.abs(ie-F),B=Math.abs(B-F),ie<B?G:U}).value),F>=h()&&(F=h(!0)),F<=m()&&(F=m(!0)),P=y(F),W(F),x(P),o&&o(F)},[H,X]=i.useState(0);i.useEffect(()=>{const P=()=>{g.current&&X(g.current.offsetWidth)};return P(),window.addEventListener("resize",P),()=>{window.removeEventListener("resize",P)}},[]);const _=P=>{switch(P.key){case"ArrowRight":if(n)N({value:v+n});else if(l){const F=l.find(U=>U.value>v);F&&N({value:F.value})}break;case"ArrowLeft":if(n)N({value:v-n});else if(l){const F=l.slice(0).reverse().find((U,G,re)=>v===1/0?G===1:U.value<v);F&&N({value:F.value})}break;default:return}};return d.jsxs("div",{tabIndex:0,onKeyDown:_,role:"slider","aria-valuemin":m(!0),"aria-valuemax":h(!0),"aria-valuenow":v,"aria-valuetext":v.toString(),className:L.slider,onMouseDown:M,onClick:j,ref:g,onTouchStart:M,onDragStart:P=>P.preventDefault(),...f,children:[d.jsx("input",{type:"hidden",name:r,value:v}),d.jsx("div",{className:L.activeTrack,style:{flex:C/100}}),d.jsx("div",{className:L.handle,children:d.jsx(O.AnimatePresence,{children:S&&d.jsx(O.motion.div,{className:L.valueIndicator,initial:"hidden",animate:"visible",exit:"hidden",style:{translate:"-50%",transformOrigin:"center bottom",textWrap:"nowrap"},variants:{visible:{opacity:1,scale:1},hidden:{opacity:1,scale:0}},transition:{duration:.1},children:t?t(v):v})})}),d.jsx("div",{className:L.inactiveTrack,style:{flex:1-C/100}}),d.jsx("div",{className:"w-[calc(100%-12px)] h-full absolute -translate-x-1/2 transform left-1/2",children:l&&l.map((P,F)=>{let U=null;const G=(S?9:10)/H*100,re=y(P.value);return re<=C-G?U=!0:re>=C+G&&(U=!1),d.jsx("div",{className:w(L.dot,{"bg-primary-container":U!=null&&U,"bg-primary":U!=null&&!U}),style:{left:`${y(P.value)}%`}},F)})})]})},ss=({variant:e="standard",className:t,children:n,title:r,position:s="right",extended:a,divider:c,onExtendedChange:l,closeIcon:u=me,transition:o,...f})=>{o={duration:.3,...o};const[y,h]=i.useState(a??!0),m=pt({transition:o,title:r,position:s,closeIcon:u,className:t,children:n,onExtendedChange:l,divider:c,isExtended:y,extended:y,variant:e});i.useEffect(()=>{l==null||l(y??!1)},[y]),i.useEffect(()=>{a!=null&&h(a)},[a]);const p={close:{width:0},open:{width:"auto"}},S=()=>d.jsxs(d.Fragment,{children:[d.jsx(O.AnimatePresence,{children:e=="modal"&&y&&d.jsx(O.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:o,onClick:()=>h(!1),className:m.overlay})}),d.jsx(O.AnimatePresence,{children:y&&d.jsxs("div",{...f,className:m.sideSheet,style:{transition:o.duration+"s"},children:[d.jsxs(O.motion.div,{variants:p,initial:a===!1?"open":"close",animate:"open",exit:"close",className:m.container,children:[d.jsxs("div",{className:m.header,children:[r&&d.jsx("p",{className:m.title,children:r}),d.jsx(ye,{size:"small",label:"close",icon:u,onClick:()=>h(!1),className:m.closeButton})]}),d.jsx("div",{className:m.content,style:{transition:o.duration+"s"},children:n})]}),(c==null&&e=="standard"?!0:c)&&d.jsx(De,{className:m.divider,orientation:"vertical"})]})})]});return e=="modal"?qe.createPortal(S(),document.body):S()},rs=({message:e,className:t,duration:n,closeIcon:r=me,onClose:s,...a})=>{const[c,l]=i.useState(!0),u=vt({className:t,closeIcon:r,duration:n,isVisible:c,onClose:s,message:e});i.useEffect(()=>{n&&setTimeout(()=>{o()},n)},[n]);const o=()=>{l(!1),s==null||s()};return d.jsx(O.AnimatePresence,{children:c&&d.jsx(O.motion.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.1},className:u.snackbar,...a,children:d.jsxs("div",{className:u.container,children:[d.jsx("p",{className:u.supportingText,children:e}),d.jsx(ye,{onClick:()=>o(),className:u.icon,icon:r,label:"close the snackbar"})]})})})},os=({selected:e=!1,className:t,activeIcon:n,disabled:r=!1,inactiveIcon:s,onChange:a,onClick:c,onKeyDown:l,ref:u,...o})=>{const[f,y]=i.useState(e);i.useEffect(()=>{y(e)},[e]);const h=g=>{r||(p(),c&&c(g))},m=g=>{r||((g.key===" "||g.key==="Enter")&&(g.preventDefault(),p()),l&&l(g))},p=()=>{y(!f),a==null||a(!f)},S=gt({className:t,isSelected:f,activeIcon:n,inactiveIcon:s,disabled:r,selected:f,onChange:a}),b=i.useRef(null),k=u||b;return d.jsxs(O.motion.div,{role:"switch","aria-checked":f,tabIndex:r?-1:0,onKeyDown:m,onClick:h,ref:k,className:S.switch,...o,children:[d.jsx("input",{type:"hidden",value:f?"1":"0"}),d.jsxs(O.motion.div,{layout:!0,style:{translate:f?"50%":"-50%"},transition:{type:"spring",stiffness:700,damping:30},className:S.handleContainer,children:[d.jsx("div",{className:S.handle,children:(f?n:s)&&d.jsx(le,{className:S.icon,icon:f?n:s})}),d.jsx("div",{className:S.handleStateLayer})]})]})},qt=({className:e,onClick:t,label:n,variant:r="primary",href:s,icon:a,selectedTab:c,setSelectedTab:l,tabsId:u,index:o,onTabSelected:f,scrollable:y=!1,selected:h=!1,children:m,ref:p,...S})=>{const b=i.useRef(null),k=p||b,g=n??(typeof m=="string"?m:void 0),[v,W]=i.useState(h);i.useEffect(()=>{h&&c==null?W(!0):W(c==o&&o!=null)},[c]),i.useEffect(()=>{c==o&&f&&f({ref:k,index:o||0,label:g,icon:a})},[c]);const C=s?"a":"button",x=I=>{l&&l(o??null),t&&t(I)},E=St({className:e,onTabSelected:f,scrollable:y,selectedTab:c,index:o,tabsId:u,selected:v,variant:r,icon:a,label:g,isSelected:v,setSelectedTab:l,href:s});return d.jsxs(C,{...S,role:"tab","aria-selected":v,ref:k,href:s,className:E.tab,onClick:x,...S,children:[d.jsx(ce,{style:{transition:.3+"s"},className:E.stateLayer,colorName:r==="primary"&&v?"primary":"on-surface",stateClassName:"state-ripple-group-[tab]"}),d.jsxs("span",{className:E.content,children:[a&&d.jsx(le,{icon:a,className:E.icon}),d.jsx("span",{className:E.label,children:g}),v&&d.jsx(O.motion.span,{layoutId:`underline-${u}`,className:E.underline,transition:{duration:.3}})]})]})},We=i.createContext(null),is=({variant:e="primary",onTabSelected:t,children:n,className:r,selectedTab:s,setSelectedTab:a,scrollable:c=!1})=>{const l=i.useContext(We),[u,o]=i.useState(null);let f;s===0||s!=null?f=s:l?f=l.selectedTab:f=u;const y=a??(l==null?void 0:l.setSelectedTab)??o,h=i.Children.toArray(n).filter(k=>i.isValidElement(k)&&k.type===qt),m=i.useRef(null),p=k=>{if(t==null||t(k),c){const g=m.current,v=k.ref.current;if(g&&v){const W=v.offsetLeft+v.offsetWidth/2-g.offsetWidth/2;g.scrollTo({left:W,behavior:"smooth"})}}},S=i.useMemo(()=>(l==null?void 0:l.tabsId)??pe(),[l==null?void 0:l.tabsId]),b=Nt({children:n,onTabSelected:t,scrollable:c,selectedTab:f,setSelectedTab:y,className:r,variant:e});return d.jsx("div",{ref:m,role:"tablist",className:b.tabs,children:h.map((k,g)=>i.cloneElement(k,{key:g,index:g,variant:e,selectedTab:f,setSelectedTab:y,tabsId:S,onTabSelected:p,scrollable:c}))})},ls=({children:e,selectedTab:t,setSelectedTab:n,defaultTab:r=0})=>{const[s,a]=i.useState(r),c=i.useRef(null),l=t!==void 0?t:s,u=n??a,o=c.current!==null&&l!==null?l>c.current?1:-1:0;l!==c.current&&(c.current=l);const f=i.useMemo(()=>pe(),[]),y=i.useMemo(()=>({selectedTab:l,setSelectedTab:u,previousTab:c.current,direction:o,tabsId:f}),[l,u,o,f]);return d.jsx(We.Provider,{value:y,children:e})},Xt=({children:e,className:t,isSelected:n=!1})=>{const r=It({children:e,className:t,isSelected:n});return d.jsx("div",{className:r.tabPanel,children:e})},as=({children:e,className:t})=>{const n=i.useContext(We);if(!n)return console.warn("TabPanels must be used within a TabGroup"),null;const{selectedTab:r,direction:s,tabsId:a}=n,c=i.Children.toArray(e).filter(u=>i.isValidElement(u)&&u.type===Xt),l=kt({children:e,className:t});return d.jsx("div",{className:l.tabPanels,children:d.jsx(O.AnimatePresence,{initial:!1,custom:s,mode:"popLayout",children:c.map((u,o)=>r===o&&d.jsx(O.motion.div,{custom:s,variants:{enter:f=>({x:f*100+"%",opacity:1}),center:{x:0,opacity:1},exit:f=>({x:f*-100+"%",opacity:1})},initial:"enter",animate:"center",exit:"exit",transition:{type:"spring",stiffness:400,damping:40},role:"tabpanel","aria-labelledby":`tab-${a}-${o}`,children:i.cloneElement(u,{isSelected:!0})},o))})})},cs=({variant:e="filled",disabled:t=!1,errorText:n,placeholder:r,suffix:s,name:a,label:c,className:l,supportingText:u,trailingIcon:o,leadingIcon:f,type:y="text",textLine:h="singleLine",autoComplete:m="on",onChange:p,value:S,showSupportingText:b=!1,...k})=>{const[g,v]=i.useState(S??""),[W,C]=i.useState(!1),[x,E]=i.useState(!1),[I,M]=i.useState(b);i.useEffect(()=>{v(S??"")},[S]),i.useEffect(()=>{n!=null&&n.length?E(!0):E(!1)},[n]),i.useEffect(()=>{b?M(b):u!=null&&u.length?M(!0):M(!1)},[I,u]),i.useEffect(()=>{W&&E(!1)},[W]);const D=i.useRef(null),L=()=>{D.current&&!W&&D.current.focus()},j=()=>{C(!0)},N=U=>{const G=U.target.value;v(G),E(!1),typeof p=="function"&&p(G)},H=()=>{C(!1)},X=Rt({showSupportingText:I,isFocused:W,showErrorIcon:x,disabled:t,name:a,label:c,autoComplete:m,className:l,onChange:p,placeholder:r,supportingText:u,type:y,leadingIcon:f,trailingIcon:o,variant:e,errorText:n,value:g,suffix:s,textLine:h}),[_]=i.useState(pe());let P,F;switch(h){case"multiLine":F=Jt,P={};break;case"textAreas":F="textarea",P={};break;case"singleLine":default:F="input",P={type:y};break}return d.jsxs("div",{className:X.textField,...k,children:[d.jsxs("fieldset",{onClick:L,className:X.content,children:[d.jsx("div",{className:X.stateLayer}),f&&d.jsx("div",{className:X.leadingIcon,children:i.isValidElement(f)?f:d.jsx(le,{className:"w-5 h-5",icon:f})}),!(!W&&!g.length||e=="filled")&&d.jsx(O.motion.legend,{variants:{hidden:{width:0,padding:0},visible:{width:"auto",padding:"0 8px"}},initial:"hidden",animate:!W&&!g.length?"hidden":"visible",className:"max-w-full ml-2 px-2 text-body-small h-0",transition:{duration:.2},children:d.jsx("span",{className:"transform inline-flex -translate-y-1/2",children:d.jsx(O.motion.span,{className:X.label,transition:{duration:.3},layoutId:_,children:c})})}),d.jsxs("div",{className:"flex-1 relative",children:[(!W&&!g.length||e=="filled")&&d.jsx(O.motion.label,{htmlFor:a,className:w("absolute left-4 transition-all duration-300",{"text-body-small top-2":e=="filled"&&!(!W&&!g.length),"text-body-large top-1/2 transform -translate-y-1/2":!(e=="filled"&&!(!W&&!g.length))}),transition:{duration:.3},children:d.jsx(O.motion.span,{className:X.label,transition:{duration:.3},layoutId:e=="outlined"?_:void 0,children:c})}),d.jsx(F,{ref:D,value:g,onChange:N,className:X.input,id:a,name:a,placeholder:W?r??void 0:"",onFocus:j,onBlur:H,disabled:t,autoComplete:m,"aria-invalid":!!(n!=null&&n.length),"aria-label":c,...P})]}),d.jsx("div",{className:X.activeIndicator}),!x&&d.jsxs(d.Fragment,{children:[o&&d.jsx("div",{onClick:U=>{U.stopPropagation()},className:X.trailingIcon,children:i.isValidElement(o)?o:d.jsx(le,{className:"h-5",icon:o})}),!o&&s&&d.jsx("span",{className:X.suffix,children:s})]}),x&&d.jsx("div",{className:w(X.trailingIcon,{" absolute right-0":!o}),children:d.jsx(le,{className:"h-5 text-error",icon:Un})})]}),I&&d.jsx("p",{className:X.supportingText,children:n!=null&&n.length?n:u!=null&&u.length?u:" "})]})},us=({isSelected:e,icon:t,label:n,variant:r})=>({navigationRailItem:w(" group/navigation-rail-item flex flex-col pt-1 pb-1.5 cursor-pointer",{"text-on-surface-variant":!e,"text-on-secondary-container":e,"gap-2 h-[68px]":r=="vertical","gap-0 h-[66px]":r=="horizontal"}),container:w(" w-fit flex justify-center relative rounded-full items-center mx-5",{"bg-secondary-container overflow-hidden":e,"gap-2 ":r=="horizontal","gap-0 ":r=="vertical","p-4":!n},n&&["px-4",{"py-1 ":r=="vertical","py-4 ":r=="horizontal"}]),stateLayer:w("rounded-full"),icon:w("size-6 flex"),label:w("w-fit mx-auto text-nowrap",{"text-label-large ":r=="horizontal","text-label-medium":r=="vertical"})}),ds=J("navigationRailItem",us),Ut=({label:e})=>d.jsx("div",{className:" h-9 flex items-center mx-9 mt-3",children:d.jsx("p",{className:"text-label-large text-on-surface-variant",children:e})}),Yt=({className:e,onClick:t,label:n,variant:r="vertical",href:s,icon:a,selectedItem:c,setSelectedItem:l,index:u,onItemSelected:o,selected:f=!1,ref:y,transition:h,isExtended:m,iconSelected:p,style:S,extendedOnly:b,children:k,...g})=>{k&&(n=k);const v=i.useRef(null),W=y||v,[C,x]=i.useState(f);i.useEffect(()=>{f&&c==null?x(!0):x(c==u&&u!=null)},[c]),i.useEffect(()=>{c==u&&o&&o({ref:W,index:u||0,label:n,icon:a})},[c]);const E=s?"a":"button",I=D=>{l&&l(u??null),t&&t(D)},M=ds({isExtended:m,extendedOnly:b,className:e,onItemSelected:o,selectedItem:c,index:u,transition:h,selected:C,variant:r,icon:a,label:n,isSelected:C,setSelectedItem:l,href:s,children:n,iconSelected:p});return h={duration:.3,...h},b&&!m?null:d.jsxs(E,{...g,role:"tab","aria-selected":C,ref:W,href:s,className:M.navigationRailItem,onClick:I,style:{transition:h.duration+"s",...S},children:[d.jsxs(O.motion.div,{style:{transition:r=="horizontal"?h.duration+`s, gap ${h.duration/2}s ${h.duration-h.duration/2}s`:h.duration+`s, gap ${h.duration/3}s ${h.duration-h.duration/3}s`},transition:h,className:M.container,children:[d.jsx(ce,{style:{transition:h.duration+"s"},className:M.stateLayer,colorName:w({"on-surface":!C,"on-secondary-container":C}),stateClassName:"state-ripple-group-[navigation-rail-item]"}),a&&d.jsx(le,{icon:C?p:a,className:M.icon}),d.jsx(O.AnimatePresence,{children:r=="horizontal"&&(()=>{const D={width:0,opacity:0,transition:{...h}},L={width:"auto",opacity:1,transition:{...h,opacity:{duration:h.duration/2,delay:h.duration-h.duration/2}}};return d.jsx(O.motion.span,{initial:D,animate:L,exit:D,className:M.label,children:n})})()})]}),d.jsx(O.AnimatePresence,{children:r=="vertical"&&(()=>{const D={height:0,opacity:0,transition:{...h,opacity:{duration:0}}},L={height:"auto",opacity:1,transition:{...h,opacity:{duration:h.duration/3,delay:h.duration-h.duration/3}}};return d.jsx(O.motion.span,{initial:L,animate:L,exit:D,className:M.label,transition:h,children:n})})()})]})},fs=({isExtended:e,alignment:t})=>({navigationRail:w("flex flex-col left-0 h-full top-0 pt-11",{"w-fit max-w-24":!e,"w-fit min-w-[220px] max-w-[360px]":e,"justify-between":t=="middle","justify-start":t=="top"}),header:w("flex flex-col gap-1 items-start"),menuIcon:"mx-5",segments:w(" flex flex-col overflow-auto min-w-full mt-10",{"w-full":!e,"w-fit items-start":e})}),hs=J("navigationRail",fs),ms=({variant:e="standard",onItemSelected:t,children:n,className:r,selectedItem:s,extended:a,alignment:c="top",menu:l={closed:{icon:Kn,label:"Open menu"},opened:{icon:me,label:"Close menu"}},style:u,onExtendedChange:o,transition:f,setSelectedItem:y})=>{const[h,m]=i.useState(null),[p,S]=i.useState(a);let b;s==0||s!=null?b=s:b=h;const k=y||m,g=i.useRef(null),v=M=>{t==null||t(M)};function W(M){const D=[];return i.Children.forEach(M,L=>{i.isValidElement(L)&&L.type===i.Fragment?D.push(...W(L.props.children)):D.push(L)}),D}const C=W(n),x=C.filter(M=>i.isValidElement(M)&&M.type===ve),E=hs({children:n,onItemSelected:t,selectedItem:b,setSelectedItem:k,className:r,variant:e,extended:p,isExtended:p,alignment:c,menu:l,transition:f,onExtendedChange:o});f={duration:.3,...f};const I=i.useRef(!1);return I.current=!1,i.useEffect(()=>{o==null||o(p??!1)},[p]),d.jsxs("div",{style:{transition:f.duration+"s",...u},ref:g,className:E.navigationRail,children:[d.jsxs("div",{className:E.header,children:[d.jsx(ye,{onClick:()=>S(!p),label:p?l==null?void 0:l.opened.label:l==null?void 0:l.closed.label,className:E.menuIcon,icon:p?l.opened.icon:l==null?void 0:l.closed.icon}),x.length>0&&i.cloneElement(x[0],{transition:f,isExtended:p,className:"!shadow-none mx-5 "+x[0].props.className})]}),d.jsx("div",{className:E.segments,children:(()=>{let M=0;return C.map(D=>i.isValidElement(D)&&D.type===Yt?i.cloneElement(D,{key:M,index:M++,variant:p?"horizontal":"vertical",selectedItem:b,setSelectedItem:k,onItemSelected:v,transition:f,extendedOnly:I.current,isExtended:p}):i.isValidElement(D)&&D.type===ve?null:i.isValidElement(D)&&D.type===Ut?(I.current=!0,p?i.cloneElement(D,{}):null):D)})()}),d.jsx("div",{className:"flex-1 max-h-[160px]"})]})};function ps(e){return xe.defineConfig({variant:xe.Variants.Udixio,...e,plugins:[new xe.FontPlugin(e),new Xe.TailwindPlugin(e)]})}exports.AnimateOnScrollInit=On;exports.Button=Ce;exports.Card=qn;exports.Carousel=Xn;exports.CarouselItem=Ot;exports.Chip=Le;exports.Chips=es;exports.CustomScroll=Pt;exports.Divider=De;exports.Fab=ve;exports.FabMenu=ts;exports.Icon=le;exports.IconButton=ye;exports.NavigationRail=ms;exports.NavigationRailItem=Yt;exports.NavigationRailSection=Ut;exports.ProgressIndicator=$t;exports.RippleEffect=Wt;exports.SideSheet=ss;exports.Slider=ns;exports.SmoothScroll=Dn;exports.Snackbar=rs;exports.State=ce;exports.Switch=os;exports.SyncedFixedWrapper=Ht;exports.Tab=qt;exports.TabGroup=ls;exports.TabPanel=Xt;exports.TabPanels=as;exports.Tabs=is;exports.TextField=cs;exports.ThemeProvider=An;exports.Tooltip=$e;exports.animateOnScroll=Vn;exports.buttonStyle=en;exports.cardStyle=tn;exports.carouselItemConfig=ke;exports.carouselItemStyle=nn;exports.carouselStyle=sn;exports.chipStyle=rn;exports.chipsStyle=on;exports.classNames=w;exports.classnames=Ye;exports.createUseClassNames=J;exports.customScrollStyle=At;exports.defaultClassNames=Z;exports.defineConfig=ps;exports.dividerStyle=ln;exports.fabMenuStyle=cn;exports.fabStyle=an;exports.getClassNames=we;exports.iconButtonStyle=un;exports.initAnimateOnScroll=Re;exports.normalize=de;exports.progressIndicatorStyle=dn;exports.sideSheetConfig=je;exports.sideSheetStyle=pt;exports.sliderConfig=Ie;exports.sliderStyle=hn;exports.snackbarStyle=mn;exports.switchStyle=pn;exports.tabPanelStyle=wn;exports.tabPanelsStyle=vn;exports.tabStyle=yn;exports.tabsStyle=xn;exports.textFieldStyle=gn;exports.toolStyle=bn;exports.useButtonStyle=Ke;exports.useCardStyle=Je;exports.useCarouselItemStyle=Ze;exports.useCarouselStyle=et;exports.useChipStyle=nt;exports.useChipsStyle=rt;exports.useClassNames=Qt;exports.useDividerStyle=it;exports.useFabMenuStyle=ut;exports.useFabStyle=at;exports.useIconButtonStyle=ft;exports.useProgressIndicatorStyle=mt;exports.useSideSheetStyle=fn;exports.useSliderStyle=yt;exports.useSnackbarStyle=vt;exports.useStateStyle=Tt;exports.useSwitchStyle=gt;exports.useTabPanelStyle=It;exports.useTabPanelsStyle=kt;exports.useTabStyle=St;exports.useTabsStyle=Nt;exports.useTextFieldStyle=Rt;exports.useToolTipStyle=Dt;exports.useTooltipPosition=_t;exports.useTooltipTrigger=Vt;
|
|
10
|
+
`})]}),C&&u.jsx(Le,{ref:P,className:"opacity-0",draggable:r,editable:!0,editing:!0,onChange:x=>{var L;if(x=x.replace(/( )+/g," ").trim(),console.log("Ghost chip onChange",x,!!x),x)j(x);else if(c.length>0){const D=h.current[c.length-1];(L=D==null?void 0:D.focus)==null||L.call(D)}},onEditCommit:()=>{},onBlur:()=>{i(!1)},onFocus:x=>{i(!0),x.stopPropagation()},children:" "})]})};function Yt({trigger:e=["hover","focus"],isOpen:t,defaultOpen:n=!1,onOpenChange:r,openDelay:s=400,closeDelay:a=150,id:c}={}){const l=o.useId(),d=c??`tooltip-${l}`,i=Array.isArray(e)?e:[e],f=typeof t=="boolean",[y,h]=o.useState(n?"hovered":"hidden"),[m,p]=o.useState(!1),N=o.useRef(null),w=o.useRef(null),j=o.useCallback(()=>{N.current&&(clearTimeout(N.current),N.current=null),w.current&&(clearTimeout(w.current),w.current=null)},[]);o.useEffect(()=>()=>j(),[j]);const S=o.useCallback(X=>{if(f){const T=X!=="hidden";r==null||r(T)}else{h(X);const T=X!=="hidden";r==null||r(T)}},[f,r]),g=f?t?"hovered":"hidden":y,P=g!=="hidden",C=X=>{switch(X){case"hidden":return 0;case"hovered":return 1;case"focused":return 2;case"clicked":return 3;default:return 0}},x=o.useCallback(X=>{j(),!(C(X)<=C(g))&&(N.current=setTimeout(()=>{S(X)},s))},[j,s,g,S]),L=o.useCallback(X=>{j(),w.current=setTimeout(()=>{(!f&&C(y)<=C(X)||f)&&S("hidden")},a)},[j,a,y,f,S]),D=o.useCallback(()=>{i.includes("hover")&&x("hovered")},[i,x]),$=o.useCallback(()=>{i.includes("hover")&&(g==="focused"||g==="clicked"||m||L("hovered"))},[i,g,m,L]),W=o.useCallback(()=>{i.includes("focus")&&(j(),S("focused"))},[i,j,S]),I=o.useCallback(()=>{if(i.includes("focus")&&g!=="clicked"){if(i.includes("hover")&&m){S("hovered");return}L("focused")}},[i,g,m,L,S]),R=o.useCallback(()=>{i.includes("click")&&(j(),S(g==="clicked"?"hidden":"clicked"))},[i,g,j,S]),M=o.useCallback(X=>{X.key==="Escape"&&P&&(j(),S("hidden"),X.preventDefault())},[P,j,S]),V=o.useCallback(()=>{p(!0),j()},[j]),J=o.useCallback(()=>{p(!1),i.includes("hover")&&g==="hovered"&&L("hovered")},[i,g,L]);return{triggerProps:{"aria-describedby":P?d:void 0,onMouseEnter:D,onMouseLeave:$,onFocus:W,onBlur:I,onClick:R,onKeyDown:M},tooltipProps:{id:d,role:"tooltip","aria-hidden":!P,onMouseEnter:V,onMouseLeave:J},isOpen:P,state:g}}function qt({targetRef:e,position:t,variant:n="plain",isOpen:r}){const[s,a]=o.useState(t??"bottom");return o.useLayoutEffect(()=>{if(t){a(t);return}if(!r||!e.current||typeof window>"u")return;const l=e.current.getBoundingClientRect(),d=window.innerWidth,i=window.innerHeight,f=l.left/d,y=l.top/i;let h;n==="plain"?f<1/3?h="right":f>2/3?h="left":h=y>.5?"top":"bottom":f<.5&&y<.5?h="bottom-right":f>=.5&&y<.5?h="bottom-left":f>=.5&&y>=.5?h="top-left":h="top-right",a(h)},[r,e,t,n]),{resolvedPosition:s}}const De=({variant:e="plain",buttons:t,className:n,children:r,title:s,text:a,content:c,position:l,targetRef:d,ref:i,trigger:f=["hover","focus"],transition:y,openDelay:h=400,closeDelay:m=150,isOpen:p,defaultOpen:N=!1,onOpenChange:w,id:j,...S})=>{if(y={duration:.3,...y},!r&&!d)throw new Error("Tooltip must have a child or a targetRef");t&&!Array.isArray(t)&&(t=[t]);const g=o.useRef(null),P=d||g,{triggerProps:C,tooltipProps:x,isOpen:L}=Yt({trigger:f,isOpen:p,defaultOpen:N,onOpenChange:w,openDelay:h,closeDelay:m,id:j}),{resolvedPosition:D}=qt({targetRef:P,position:l,variant:e,isOpen:L}),$=!d&&o.isValidElement(r)?o.cloneElement(r,{ref:g,...C,onMouseEnter:R=>{var M,V;C.onMouseEnter(),(V=(M=r.props)==null?void 0:M.onMouseEnter)==null||V.call(M,R)},onMouseLeave:R=>{var M,V;C.onMouseLeave(),(V=(M=r.props)==null?void 0:M.onMouseLeave)==null||V.call(M,R)},onFocus:R=>{var M,V;C.onFocus(),(V=(M=r.props)==null?void 0:M.onFocus)==null||V.call(M,R)},onBlur:R=>{var M,V;C.onBlur(),(V=(M=r.props)==null?void 0:M.onBlur)==null||V.call(M,R)},onClick:R=>{var M,V;C.onClick(),(V=(M=r.props)==null?void 0:M.onClick)==null||V.call(M,R)},onKeyDown:R=>{var M,V;C.onKeyDown(R),(V=(M=r.props)==null?void 0:M.onKeyDown)==null||V.call(M,R)}}):r;o.useEffect(()=>{if(!d)return;const R=d.current;if(!R)return;const M=()=>C.onMouseEnter(),V=()=>C.onMouseLeave(),J=()=>C.onFocus(),X=()=>C.onBlur(),T=()=>C.onClick(),O=K=>C.onKeyDown(K);return R.addEventListener("mouseenter",M),R.addEventListener("mouseleave",V),R.addEventListener("focus",J,!0),R.addEventListener("blur",X,!0),R.addEventListener("click",T),R.addEventListener("keydown",O),C["aria-describedby"]?R.setAttribute("aria-describedby",C["aria-describedby"]):R.removeAttribute("aria-describedby"),()=>{R.removeEventListener("mouseenter",M),R.removeEventListener("mouseleave",V),R.removeEventListener("focus",J,!0),R.removeEventListener("blur",X,!0),R.removeEventListener("click",T),R.removeEventListener("keydown",O)}},[d,C]);const W=Ft({variant:e,buttons:t,className:n,title:s,text:a,position:D,trigger:f,targetRef:d,children:r}),I={open:{opacity:1,height:"auto"},close:{opacity:0,height:16}};return u.jsxs(u.Fragment,{children:[$,u.jsx(q.AnimatePresence,{children:L&&u.jsx(Ot,{targetRef:P,children:u.jsx(q.motion.div,{initial:"close",variants:I,animate:"open",transition:{duration:y.duration},exit:"close",className:W.toolTip,...S,...x,children:u.jsx("div",{className:W.container,children:c?u.jsx("div",{className:W.content,children:c}):u.jsxs(u.Fragment,{children:[s&&u.jsx("div",{className:W.subHead,children:s}),a&&u.jsx("div",{className:W.supportingText,children:a}),t&&u.jsx("div",{className:W.actions,children:Array.isArray(t)&&t.map((R,M)=>u.jsx(he,{size:"small",variant:"text",...R},M))})]})})})})})]})},ve=({className:e,label:t,variant:n="primary",size:r="medium",href:s,type:a,icon:c,extended:l=!1,ref:d,transition:i,children:f,...y})=>{if(f&&(t=f),!t)throw new Error("FAB component requires either a label prop or children content");const h=s?"a":"button",m=ct({href:s,icon:c,extended:l,label:t,size:r,variant:n,className:e,transition:i,children:t});i={duration:.3,...i};const p=o.useRef(null),N=d||p,w={visible:{width:"auto",marginLeft:12,opacity:1,transition:{...i,opacity:{duration:i.duration/2,delay:i.duration-i.duration/2}}},hidden:{width:0,marginLeft:0,opacity:0,transition:{...i,marginLeft:{duration:i.duration/2,delay:i.duration-i.duration/2}}}};return u.jsxs(h,{...y,ref:N,href:s,"aria-label":l?void 0:t,className:m.fab,children:[u.jsx(De,{trigger:l?null:void 0,text:t,targetRef:N}),u.jsx(ae,{style:{transition:i.duration+"s"},className:m.stateLayer,colorName:v({"on-primary":n=="primary","on-secondary":n=="secondary","on-tertiary":n=="tertiary","on-primary-container":n=="primaryContainer","on-secondary-container":n=="secondaryContainer","on-tertiary-container":n=="tertiaryContainer"}),stateClassName:"state-ripple-group-[fab]"}),u.jsx(ie,{icon:c,className:m.icon}),u.jsx(q.AnimatePresence,{children:l&&u.jsx(q.motion.span,{variants:w,initial:"hidden",animate:"visible",exit:"hidden",className:m.label,children:t})})]})},fe=({variant:e="standard",href:t,disabled:n=!1,title:r,label:s,onToggle:a,activated:c=!1,onClick:l,icon:d,size:i="medium",iconSelected:f,className:y,ref:h,width:m="default",shape:p="rounded",allowShapeTransformation:N=!0,transition:w,children:j,...S})=>{if(j&&(s=j),!s)throw new Error("IconButton component requires either a label prop or children content to provide an accessible aria-label");!r&&r!==null&&(r=s);const[g,P]=o.useState(c),C=W=>{n&&W.preventDefault(),a?(P(!g),a(!g)):l&&l(W)};o.useEffect(()=>{P(c)},[c]);const x=t?"a":"button",L=ht({transition:w,shape:p,allowShapeTransformation:N,width:m,href:t,activated:g,label:s,iconSelected:f,isActive:g,onToggle:a,disabled:n,icon:d,variant:e,className:y,size:i,children:s,...S}),D=o.useRef(null),$=h||D;return w={duration:.3,...w},u.jsxs(x,{disabled:n,href:t,style:{transition:w.duration+"s"},className:L.iconButton,"aria-label":s,...S,title:void 0,onClick:C,ref:$,children:[r!==null&&u.jsx(De,{targetRef:$,trigger:n?null:void 0,text:r}),u.jsx("div",{className:L.touchTarget}),u.jsx(ae,{style:{transition:w.duration+"s"},className:L.stateLayer,colorName:v(e==="standard"&&{"on-surface-variant":!g,"on-primary":g},e==="filled"&&{"on-surface-variant":!g&&!!a,"on-primary":g||!a},e==="tonal"&&{"on-secondary":g&&!!a,"on-secondary-container":!g||!a},e==="outlined"&&{"inverse-on-surface":g&&!!a,"on-surface-variant":!g||!a}),stateClassName:"state-ripple-group-[icon-button]"}),d?u.jsx(ie,{icon:d,className:L.icon}):j]})},cs=({className:e,label:t,variant:n="primary",size:r="medium",href:s,icon:a,extended:c=!1,ref:l,transition:d,children:i,open:f,defaultOpen:y=!1,onOpenChange:h,...m})=>{d={duration:.3,ease:"easeInOut",...d};const p=o.useRef(null),N=l||p,w=typeof f=="boolean",[j,S]=o.useState(y),g=w?f:j,P=I=>{w||S(I),h==null||h(I)},C=o.Children.toArray(i).filter(I=>o.isValidElement(I)&&I.type===he),x=dt({href:s,icon:a,extended:c,label:t,size:r,variant:n,className:e,transition:d,children:t,open:g}),L=q.motion.create(ve),D=q.motion.create(fe),$=I=>u.jsx(L,{icon:a,extended:c,label:t,variant:n+"Container",size:r,className:x.fab+" "+(e??""),"aria-expanded":g,onClick:()=>P(!0),style:{transition:"border-radius 0.3s ease-in-out"},transition:{duration:d.duration,ease:"easeInOut",borderRadius:{duration:d.duration,ease:"easeInOut"},background:{duration:d.duration,ease:"easeInOut"},...d},...I}),W=o.useId();return u.jsxs("div",{className:x.fabMenu,ref:N,...m,children:[u.jsx(q.AnimatePresence,{children:g&&u.jsx("div",{className:x.actions,role:"menu","aria-hidden":!g,children:(()=>{const I=C.length;return C.map((R,M)=>{R.props;const V=I-1-M,J=((d==null?void 0:d.delay)??0)+V*.06,X={open:{overflow:"visible",opacity:1,width:"auto",transition:{...d,delay:J,opacity:{delay:(d==null?void 0:d.duration)/2+J}}},close:{overflow:"hidden",opacity:0,width:0,transition:{...d,delay:J,opacity:{duration:(d==null?void 0:d.duration)/1.5}}}};return u.jsx(q.motion.div,{initial:"close",animate:"open",variants:X,transition:d,exit:"close",children:o.cloneElement(R,{key:M,shape:"rounded",variant:"filled",className:()=>({button:v("max-w-full overflow-hidden",{"px-0":!g,"bg-primary-container text-on-primary-container ":n==="primary","bg-secondary-container text-on-secondary-container":n==="secondary","bg-tertiary-container text-on-tertiary-container":n==="tertiary"}),stateLayer:v({"state-on-primary-container":n==="primary","state-on-secondary-container":n==="secondary","state-on-tertiary-container":n==="tertiary"})})})})})})()})}),$({className:"invisible pointer-events-none"}),u.jsxs("div",{className:"absolute right-0 top-0",children:[!g&&$({className:"",layout:!0,layoutId:"fab-menu"+W}),g&&u.jsx(u.Fragment,{children:u.jsx(D,{layout:!0,layoutId:"fab-menu"+W,variant:"filled",className:()=>({iconButton:v("",{"bg-primary text-on-primary":n==="primary","bg-secondary text-on-secondary":n==="secondary","bg-tertiary text-on-tertiary":n==="tertiary"}),stateLayer:v({"[--default-color:var(--color-on-primary)]":n==="primary","[--default-color:var(--color-on-secondary)]":n==="secondary","[--default-color:var(--color-on-tertiary)]":n==="tertiary"})}),style:{transition:"border-radius 0.3s ease-in-out"},transition:{duration:d.duration,ease:"easeInOut",borderRadius:{duration:d.duration,ease:"easeInOut"},background:{duration:d.duration,ease:"easeInOut"},...d},icon:Qn,onClick:()=>P(!1),children:"Close"})})]})]})},us=({className:e,valueFormatter:t,step:n=10,name:r,value:s=0,min:a=0,max:c=100,marks:l=[{value:0,label:"0"},{value:100,label:"100"}],ref:d,onChange:i,...f})=>{const y=T=>{const O=m(),K=h();return T===1/0?100:T===-1/0?0:(T-O)/(K-O)*100},h=(T=!1)=>T?c:c==1/0?l[(l==null?void 0:l.length)-1].value:c,m=(T=!1)=>T?a:a==-1/0?l[0].value:a,p=T=>{const O=m(!1);return(h(!1)-O)*T/100+O},[N,w]=o.useState(!1),j=o.useRef(null),S=d||j,[g,P]=o.useState(s),[C,x]=o.useState(y(s)),[L,D]=o.useState(!1);o.useEffect(()=>{P(s),x(y(s))},[s]);const $=T=>{D(!0),w(!0),R(T)},W=()=>{D(!1),w(!1)};o.useEffect(()=>(L?(window.addEventListener("mouseup",W),window.addEventListener("mousemove",R),window.addEventListener("touchend",W),window.addEventListener("touchmove",R)):(window.removeEventListener("mouseup",W),window.removeEventListener("mousemove",R),window.removeEventListener("touchend",W),window.removeEventListener("touchmove",R)),()=>{window.removeEventListener("mouseup",W),window.removeEventListener("mousemove",R),window.removeEventListener("touchend",W),window.removeEventListener("touchmove",R)}),[L]);const I=xt({className:e,isChanging:N,marks:l,max:c,min:a,name:r,step:n,value:g,valueFormatter:t,onChange:i}),R=T=>{const O=S==null?void 0:S.current;if(O){const K=O.getBoundingClientRect().left,te=((T.type==="touchmove"||T.type==="touchstart"?T.touches[0].clientX:T.clientX)-K)/O.offsetWidth*100;M({percent:te})}},M=({percent:T,value:O})=>{if(T){if(T>=100){P(h(!0)),x(100);return}if(T<=0){P(m(!0)),x(0);return}O=p(T),O==m()&&(O=m(!0)),O==h()&&(O=h(!0))}else if(O!=null){if(O>=h()){P(h(!0)),x(100);return}if(O<=m()){P(m(!0)),x(0);return}T=y(O)}else return;n!=null?O=Math.round((O-m())/n)*n+m():l&&(O=l.reduce((K,G,te)=>{let b=G.value===1/0?h():G.value===-1/0?m():G.value,k=K.value===1/0?h():K.value===-1/0?m():K.value;return b=Math.abs(b-O),k=Math.abs(k-O),b<k?G:K}).value),O>=h()&&(O=h(!0)),O<=m()&&(O=m(!0)),T=y(O),P(O),x(T),i&&i(O)},[V,J]=o.useState(0);o.useEffect(()=>{const T=()=>{S.current&&J(S.current.offsetWidth)};return T(),window.addEventListener("resize",T),()=>{window.removeEventListener("resize",T)}},[]);const X=T=>{switch(T.key){case"ArrowRight":if(n)M({value:g+n});else if(l){const O=l.find(K=>K.value>g);O&&M({value:O.value})}break;case"ArrowLeft":if(n)M({value:g-n});else if(l){const O=l.slice(0).reverse().find((K,G,te)=>g===1/0?G===1:K.value<g);O&&M({value:O.value})}break;default:return}};return u.jsxs("div",{tabIndex:0,onKeyDown:X,role:"slider","aria-valuemin":m(!0),"aria-valuemax":h(!0),"aria-valuenow":g,"aria-valuetext":g.toString(),className:I.slider,onMouseDown:$,onClick:R,ref:S,onTouchStart:$,onDragStart:T=>T.preventDefault(),...f,children:[u.jsx("input",{type:"hidden",name:r,value:g}),u.jsx("div",{className:I.activeTrack,style:{flex:C/100}}),u.jsx("div",{className:I.handle,children:u.jsx(q.AnimatePresence,{children:N&&u.jsx(q.motion.div,{className:I.valueIndicator,initial:"hidden",animate:"visible",exit:"hidden",style:{translate:"-50%",transformOrigin:"center bottom",textWrap:"nowrap"},variants:{visible:{opacity:1,scale:1},hidden:{opacity:1,scale:0}},transition:{duration:.1},children:t?t(g):g})})}),u.jsx("div",{className:I.inactiveTrack,style:{flex:1-C/100}}),u.jsx("div",{className:"w-[calc(100%-12px)] h-full absolute -translate-x-1/2 transform left-1/2",children:l&&l.map((T,O)=>{let K=null;const G=(N?9:10)/V*100,te=y(T.value);return te<=C-G?K=!0:te>=C+G&&(K=!1),u.jsx("div",{className:v(I.dot,{"bg-primary-container":K!=null&&K,"bg-primary":K!=null&&!K}),style:{left:`${y(T.value)}%`}},O)})})]})},ds=({variant:e="standard",className:t,children:n,title:r,position:s="right",extended:a,divider:c,onExtendedChange:l,closeIcon:d=ye,transition:i,...f})=>{i={duration:.3,...i};const[y,h]=o.useState(a??!0),m=yt({transition:i,title:r,position:s,closeIcon:d,className:t,children:n,onExtendedChange:l,divider:c,isExtended:y,extended:y,variant:e});o.useEffect(()=>{l==null||l(y??!1)},[y]),o.useEffect(()=>{a!=null&&h(a)},[a]);const p={close:{width:0},open:{width:"auto"}},N=()=>u.jsxs(u.Fragment,{children:[u.jsx(q.AnimatePresence,{children:e=="modal"&&y&&u.jsx(q.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:i,onClick:()=>h(!1),className:m.overlay})}),u.jsx(q.AnimatePresence,{children:y&&u.jsxs("div",{...f,className:m.sideSheet,style:{transition:i.duration+"s"},children:[u.jsxs(q.motion.div,{variants:p,initial:a===!1?"open":"close",animate:"open",exit:"close",className:m.container,children:[u.jsxs("div",{className:m.header,children:[r&&u.jsx("p",{className:m.title,children:r}),u.jsx(fe,{size:"small",label:"close",icon:d,onClick:()=>h(!1),className:m.closeButton})]}),u.jsx("div",{className:m.content,style:{transition:i.duration+"s"},children:n})]}),(c==null&&e=="standard"?!0:c)&&u.jsx(Re,{className:m.divider,orientation:"vertical"})]})})]});return e=="modal"?_e.createPortal(N(),document.body):N()},fs=({message:e,className:t,duration:n,closeIcon:r=ye,onClose:s,...a})=>{const[c,l]=o.useState(!0),d=gt({className:t,closeIcon:r,duration:n,isVisible:c,onClose:s,message:e});o.useEffect(()=>{n&&setTimeout(()=>{i()},n)},[n]);const i=()=>{l(!1),s==null||s()};return u.jsx(q.AnimatePresence,{children:c&&u.jsx(q.motion.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.1},className:d.snackbar,...a,children:u.jsxs("div",{className:d.container,children:[u.jsx("p",{className:d.supportingText,children:e}),u.jsx(fe,{onClick:()=>i(),className:d.icon,icon:r,label:"close the snackbar"})]})})})},hs=({selected:e=!1,className:t,activeIcon:n,disabled:r=!1,inactiveIcon:s,onChange:a,onClick:c,onKeyDown:l,ref:d,...i})=>{const[f,y]=o.useState(e);o.useEffect(()=>{y(e)},[e]);const h=S=>{r||(p(),c&&c(S))},m=S=>{r||((S.key===" "||S.key==="Enter")&&(S.preventDefault(),p()),l&&l(S))},p=()=>{y(!f),a==null||a(!f)},N=bt({className:t,isSelected:f,activeIcon:n,inactiveIcon:s,disabled:r,selected:f,onChange:a}),w=o.useRef(null),j=d||w;return u.jsxs(q.motion.div,{role:"switch","aria-checked":f,tabIndex:r?-1:0,onKeyDown:m,onClick:h,ref:j,className:N.switch,...i,children:[u.jsx("input",{type:"hidden",value:f?"1":"0"}),u.jsxs(q.motion.div,{layout:!0,style:{translate:f?"50%":"-50%"},transition:{type:"spring",stiffness:700,damping:30},className:N.handleContainer,children:[u.jsx("div",{className:N.handle,children:(f?n:s)&&u.jsx(ie,{className:N.icon,icon:f?n:s})}),u.jsx("div",{className:N.handleStateLayer})]})]})},Xt=({className:e,onClick:t,label:n,variant:r="primary",href:s,icon:a,selectedTab:c,setSelectedTab:l,tabsId:d,index:i,onTabSelected:f,scrollable:y=!1,selected:h=!1,children:m,ref:p,...N})=>{const w=o.useRef(null),j=p||w,S=n??(typeof m=="string"?m:void 0),[g,P]=o.useState(h);o.useEffect(()=>{h&&c==null?P(!0):P(c==i&&i!=null)},[c]),o.useEffect(()=>{c==i&&f&&f({ref:j,index:i||0,label:S,icon:a})},[c]);const C=s?"a":"button",x=D=>{l&&l(i??null),t&&t(D)},L=Nt({className:e,onTabSelected:f,scrollable:y,selectedTab:c,index:i,tabsId:d,selected:g,variant:r,icon:a,label:S,isSelected:g,setSelectedTab:l,href:s});return u.jsxs(C,{...N,role:"tab","aria-selected":g,ref:j,href:s,className:L.tab,onClick:x,...N,children:[u.jsx(ae,{style:{transition:.3+"s"},className:L.stateLayer,colorName:r==="primary"&&g?"primary":"on-surface",stateClassName:"state-ripple-group-[tab]"}),u.jsxs("span",{className:L.content,children:[a&&u.jsx(ie,{icon:a,className:L.icon}),u.jsx("span",{className:L.label,children:S}),g&&u.jsx(q.motion.span,{layoutId:`underline-${d}`,className:L.underline,transition:{duration:.3}})]})]})},Fe=o.createContext(null),ms=({variant:e="primary",onTabSelected:t,children:n,className:r,selectedTab:s,setSelectedTab:a,scrollable:c=!1})=>{const l=o.useContext(Fe),[d,i]=o.useState(null);let f;s===0||s!=null?f=s:l?f=l.selectedTab:f=d;const y=a??(l==null?void 0:l.setSelectedTab)??i,h=o.Children.toArray(n).filter(j=>o.isValidElement(j)&&j.type===Xt),m=o.useRef(null),p=j=>{if(t==null||t(j),c){const S=m.current,g=j.ref.current;if(S&&g){const P=g.offsetLeft+g.offsetWidth/2-S.offsetWidth/2;S.scrollTo({left:P,behavior:"smooth"})}}},N=o.useMemo(()=>(l==null?void 0:l.tabsId)??zt(),[l==null?void 0:l.tabsId]),w=Lt({children:n,onTabSelected:t,scrollable:c,selectedTab:f,setSelectedTab:y,className:r,variant:e});return u.jsx("div",{ref:m,role:"tablist",className:w.tabs,children:h.map((j,S)=>o.cloneElement(j,{key:S,index:S,variant:e,selectedTab:f,setSelectedTab:y,tabsId:N,onTabSelected:p,scrollable:c}))})},ps=({children:e,selectedTab:t,setSelectedTab:n,defaultTab:r=0})=>{const[s,a]=o.useState(r),c=o.useRef(null),l=t!==void 0?t:s,d=n??a,i=c.current!==null&&l!==null?l>c.current?1:-1:0;l!==c.current&&(c.current=l);const f=o.useId(),y=o.useMemo(()=>({selectedTab:l,setSelectedTab:d,previousTab:c.current,direction:i,tabsId:f}),[l,d,i,f]);return u.jsx(Fe.Provider,{value:y,children:e})},Ut=({children:e,className:t,isSelected:n=!1})=>{const r=It({children:e,className:t,isSelected:n});return u.jsx("div",{className:r.tabPanel,children:e})},ys=({children:e,className:t})=>{const n=o.useContext(Fe);if(!n)return console.warn("TabPanels must be used within a TabGroup"),null;const{selectedTab:r,direction:s,tabsId:a}=n,c=o.Children.toArray(e).filter(d=>o.isValidElement(d)&&d.type===Ut),l=jt({children:e,className:t});return u.jsx("div",{className:l.tabPanels,children:u.jsx(q.AnimatePresence,{initial:!1,custom:s,mode:"popLayout",children:c.map((d,i)=>r===i&&u.jsx(q.motion.div,{custom:s,variants:{enter:f=>({x:f*100+"%",opacity:1}),center:{x:0,opacity:1},exit:f=>({x:f*-100+"%",opacity:1})},initial:"enter",animate:"center",exit:"exit",transition:{type:"spring",stiffness:400,damping:40},role:"tabpanel","aria-labelledby":`tab-${a}-${i}`,children:o.cloneElement(d,{isSelected:!0})},i))})})},xs=({variant:e="filled",disabled:t=!1,errorText:n,placeholder:r,suffix:s,name:a,label:c,className:l,supportingText:d,trailingIcon:i,leadingIcon:f,type:y="text",multiline:h=!1,autoComplete:m="on",onChange:p,value:N,defaultValue:w,showSupportingText:j,id:S,style:g,...P})=>{const C=o.useId(),x=S||C,L=`${x}-helper`,D=N!==void 0,[$,W]=o.useState(w??""),I=D?N:$,[R,M]=o.useState(!1),[V,J]=o.useState(!!(n!=null&&n.length)),X=j??(!!(n!=null&&n.length)||!!(d!=null&&d.length));o.useEffect(()=>{J(!!(n!=null&&n.length))},[n]);const T=o.useRef(null),O=()=>{T.current&&!R&&T.current.focus()},K=()=>{M(!0),J(!1)},G=z=>{const Q=z.target.value;D||W(Q),J(!1),p&&p(z)},te=()=>{M(!1),n!=null&&n.length&&J(!0)},b=Rt({showSupportingText:X,isFocused:R,showErrorIcon:V,disabled:t,name:a,label:c,autoComplete:m,className:l,onChange:p,placeholder:r,supportingText:d,type:y,leadingIcon:f,trailingIcon:i,variant:e,errorText:n,value:String(I),suffix:s,multiline:h}),k=h?en:"input",E=h?{}:{type:y},F=R||typeof I=="string"&&I.length>0,H=F&&e==="outlined",_=!H;return u.jsxs("div",{className:b.textField,style:g,children:[u.jsxs("fieldset",{onClick:O,className:b.content,role:"presentation",children:[u.jsx("div",{className:b.stateLayer}),f&&u.jsx("div",{className:b.leadingIcon,children:o.isValidElement(f)?f:u.jsx(ie,{className:"w-5 h-5",icon:f})}),u.jsx(q.motion.legend,{"aria-hidden":"true",variants:{hidden:{width:0,padding:0},visible:{width:"auto",padding:"0 8px"}},initial:H?"visible":"hidden",animate:H?"visible":"hidden",className:"max-w-full ml-2 px-2 text-body-small h-0 overflow-hidden whitespace-nowrap",transition:{duration:.2},children:u.jsx("span",{className:"transform inline-flex -translate-y-1/2 opacity-0",children:c})}),u.jsxs("div",{className:"flex-1 relative",children:[_&&u.jsx(q.motion.label,{htmlFor:x,className:v("absolute left-4 transition-all duration-300 pointer-events-none",{"text-body-small top-2":e=="filled"&&F,"text-body-large top-1/2 transform -translate-y-1/2":!(e=="filled"&&F)}),transition:{duration:.3},layoutId:e==="outlined"?`${x}-label`:void 0,children:u.jsx("span",{className:b.label,children:c})}),H&&u.jsx(q.motion.label,{htmlFor:x,className:v("absolute left-2 -top-3 px-1 text-body-small z-10",b.label),layoutId:`${x}-label`,transition:{duration:.3},children:c}),u.jsx(k,{ref:T,value:I,onChange:G,className:b.input,id:x,name:a,placeholder:R?r??void 0:"",onFocus:K,onBlur:te,disabled:t,autoComplete:m,"aria-invalid":!!(n!=null&&n.length),"aria-describedby":X?L:void 0,...E,...P})]}),u.jsx("div",{className:b.activeIndicator}),!V&&u.jsxs(u.Fragment,{children:[i&&u.jsx("div",{onClick:z=>{z.stopPropagation()},className:b.trailingIcon,children:o.isValidElement(i)?i:u.jsx(ie,{className:"h-5",icon:i})}),!i&&s&&u.jsx("span",{className:b.suffix,children:s})]}),V&&u.jsx("div",{className:v(b.trailingIcon,{" absolute right-0":!i}),children:u.jsx(ie,{className:"h-5 text-error",icon:Zn})})]}),X&&u.jsx("p",{className:b.supportingText,id:L,children:n!=null&&n.length?n:d!=null&&d.length?d:" "})]})},vs=({isSelected:e,icon:t,label:n,variant:r})=>({navigationRailItem:v(" group/navigation-rail-item flex flex-col pt-1 pb-1.5 cursor-pointer",{"text-on-surface-variant":!e,"text-on-secondary-container":e,"gap-2 h-[68px]":r=="vertical","gap-0 h-[66px]":r=="horizontal"}),container:v(" w-fit flex justify-center relative rounded-full items-center mx-5",{"bg-secondary-container overflow-hidden":e,"gap-2 ":r=="horizontal","gap-0 ":r=="vertical","p-4":!n},n&&["px-4",{"py-1 ":r=="vertical","py-4 ":r=="horizontal"}]),stateLayer:v("rounded-full"),icon:v("size-6 flex"),label:v("w-fit mx-auto text-nowrap",{"text-label-large ":r=="horizontal","text-label-medium":r=="vertical"})}),gs=Z("navigationRailItem",vs),Kt=({label:e})=>u.jsx("div",{className:" h-9 flex items-center mx-9 mt-3",children:u.jsx("p",{className:"text-label-large text-on-surface-variant",children:e})}),Gt=({className:e,onClick:t,label:n,variant:r="vertical",href:s,icon:a,selectedItem:c,setSelectedItem:l,index:d,onItemSelected:i,selected:f=!1,ref:y,transition:h,isExtended:m,iconSelected:p,style:N,extendedOnly:w,children:j,...S})=>{j&&(n=j);const g=o.useRef(null),P=y||g,[C,x]=o.useState(f);o.useEffect(()=>{f&&c==null?x(!0):x(c==d&&d!=null)},[c]),o.useEffect(()=>{c==d&&i&&i({ref:P,index:d||0,label:n,icon:a})},[c]);const L=s?"a":"button",D=W=>{l&&l(d??null),t&&t(W)},$=gs({isExtended:m,extendedOnly:w,className:e,onItemSelected:i,selectedItem:c,index:d,transition:h,selected:C,variant:r,icon:a,label:n,isSelected:C,setSelectedItem:l,href:s,children:n,iconSelected:p});return h={duration:.3,...h},w&&!m?null:u.jsxs(L,{...S,role:"tab","aria-selected":C,ref:P,href:s,className:$.navigationRailItem,onClick:D,style:{transition:h.duration+"s",...N},children:[u.jsxs(q.motion.div,{style:{transition:r=="horizontal"?h.duration+`s, gap ${h.duration/2}s ${h.duration-h.duration/2}s`:h.duration+`s, gap ${h.duration/3}s ${h.duration-h.duration/3}s`},transition:h,className:$.container,children:[u.jsx(ae,{style:{transition:h.duration+"s"},className:$.stateLayer,colorName:v({"on-surface":!C,"on-secondary-container":C}),stateClassName:"state-ripple-group-[navigation-rail-item]"}),a&&u.jsx(ie,{icon:C?p:a,className:$.icon}),u.jsx(q.AnimatePresence,{children:r=="horizontal"&&(()=>{const W={width:0,opacity:0,transition:{...h}},I={width:"auto",opacity:1,transition:{...h,opacity:{duration:h.duration/2,delay:h.duration-h.duration/2}}};return u.jsx(q.motion.span,{initial:W,animate:I,exit:W,className:$.label,children:n})})()})]}),u.jsx(q.AnimatePresence,{children:r=="vertical"&&(()=>{const W={height:0,opacity:0,transition:{...h,opacity:{duration:0}}},I={height:"auto",opacity:1,transition:{...h,opacity:{duration:h.duration/3,delay:h.duration-h.duration/3}}};return u.jsx(q.motion.span,{initial:I,animate:I,exit:W,className:$.label,transition:h,children:n})})()})]})},ws=({isExtended:e,alignment:t})=>({navigationRail:v("flex flex-col left-0 h-full top-0 pt-11",{"w-fit max-w-24":!e,"w-fit min-w-[220px] max-w-[360px]":e,"justify-between":t=="middle","justify-start":t=="top"}),header:v("flex flex-col gap-1 items-start"),menuIcon:"mx-5",segments:v(" flex flex-col overflow-auto min-w-full mt-10",{"w-full":!e,"w-fit items-start":e})}),bs=Z("navigationRail",ws),Ss=({variant:e="standard",onItemSelected:t,children:n,className:r,selectedItem:s,extended:a,alignment:c="top",menu:l={closed:{icon:ns,label:"Open menu"},opened:{icon:ye,label:"Close menu"}},style:d,onExtendedChange:i,transition:f,setSelectedItem:y})=>{const[h,m]=o.useState(null),[p,N]=o.useState(a);let w;s==0||s!=null?w=s:w=h;const j=y||m,S=o.useRef(null),g=$=>{t==null||t($)};function P($){const W=[];return o.Children.forEach($,I=>{o.isValidElement(I)&&I.type===o.Fragment?W.push(...P(I.props.children)):W.push(I)}),W}const C=P(n),x=C.filter($=>o.isValidElement($)&&$.type===ve),L=bs({children:n,onItemSelected:t,selectedItem:w,setSelectedItem:j,className:r,variant:e,extended:p,isExtended:p,alignment:c,menu:l,transition:f,onExtendedChange:i});f={duration:.3,...f};const D=o.useRef(!1);return D.current=!1,o.useEffect(()=>{i==null||i(p??!1)},[p]),u.jsxs("div",{style:{transition:f.duration+"s",...d},ref:S,className:L.navigationRail,children:[u.jsxs("div",{className:L.header,children:[u.jsx(fe,{onClick:()=>N(!p),label:p?l==null?void 0:l.opened.label:l==null?void 0:l.closed.label,className:L.menuIcon,icon:p?l.opened.icon:l==null?void 0:l.closed.icon}),x.length>0&&o.cloneElement(x[0],{transition:f,isExtended:p,className:"!shadow-none mx-5 "+x[0].props.className})]}),u.jsx("div",{className:L.segments,children:(()=>{let $=0;return C.map(W=>o.isValidElement(W)&&W.type===Gt?o.cloneElement(W,{key:$,index:$++,variant:p?"horizontal":"vertical",selectedItem:w,setSelectedItem:j,onItemSelected:g,transition:f,extendedOnly:D.current,isExtended:p}):o.isValidElement(W)&&W.type===ve?null:o.isValidElement(W)&&W.type===Kt?(D.current=!0,p?o.cloneElement(W,{}):null):W)})()}),u.jsx("div",{className:"flex-1 max-h-[160px]"})]})},Ns=({hasSelected:e})=>({datePicker:v("inline-flex flex-col bg-surface-container-high rounded-[28px] p-3 shadow-sm select-none","min-w-[320px]"),header:v("flex items-center justify-between h-12 mb-2 px-2"),monthNav:v("flex items-center justify-center w-10 h-10 rounded-full text-on-surface-variant hover:bg-on-surface-variant/8 transition-colors cursor-pointer"),monthLabel:v("text-label-large text-on-surface font-bold capitalize"),weekDays:v("grid grid-cols-7 mb-2"),weekDay:v("h-10 flex items-center justify-center text-body-small text-on-surface-variant"),daysGrid:v("grid grid-cols-7 row-auto gap-y-2"),dayCell:v("flex items-center justify-center h-10 p-0 relative"),dayButton:v("w-10 h-10 rounded-full flex items-center justify-center text-body-large transition-all duration-200 relative overflow-hidden z-10 outline-none")}),Es=Z("datePicker",Ns),Ls=({value:e,defaultValue:t,onChange:n,minDate:r,maxDate:s,shouldDisableDate:a,locale:c="default",weekStartDay:l=0,className:d,style:i,mode:f="single",...y})=>{const[h,m]=o.useState(()=>{const b=E=>E instanceof Date?E:Array.isArray(E)&&E[0]?E[0]:null,k=b(e)||b(t)||new Date;return new Date(k.getFullYear(),k.getMonth(),1)}),[p,N]=o.useState(0),[w,j]=o.useState("day"),S=e!==void 0,[g,P]=o.useState(t||null),C=S?e||null:g,x=(b,k)=>new Date(b,k+1,0).getDate(),L=o.useMemo(()=>{const b=h.getFullYear(),k=h.getMonth(),E=x(b,k),H=(new Date(b,k,1).getDay()-l+7)%7,_=[],z=x(b,k-1);for(let Y=H-1;Y>=0;Y--)_.push({date:new Date(b,k-1,z-Y),isCurrentMonth:!1});for(let Y=1;Y<=E;Y++)_.push({date:new Date(b,k,Y),isCurrentMonth:!0});const A=42-_.length;for(let Y=1;Y<=A;Y++)_.push({date:new Date(b,k+1,Y),isCurrentMonth:!1});return _},[h,l]),D=o.useMemo(()=>{const b=new Date().getFullYear(),k=b-100,E=b+100,F=[];for(let H=k;H<=E;H++)F.push(H);return F},[]),$=o.useRef(null);o.useEffect(()=>{if(w==="year"&&$.current){const b=$.current.querySelector('[data-selected="true"]');b&&b.scrollIntoView({block:"center"})}},[w]);const W=o.useMemo(()=>new Intl.DateTimeFormat(c,{month:"long",year:"numeric"}),[c]),I=o.useMemo(()=>new Intl.DateTimeFormat(c,{weekday:"narrow"}),[c]),R=o.useMemo(()=>{const b=new Date(2023,0,1+l);return Array.from({length:7}).map((k,E)=>{const F=new Date(b);return F.setDate(b.getDate()+E),I.format(F).charAt(0).toUpperCase()})},[I,l]),M=()=>{N(-1),m(b=>new Date(b.getFullYear(),b.getMonth()-1,1))},V=()=>{N(1),m(b=>new Date(b.getFullYear(),b.getMonth()+1,1))},J=b=>{m(k=>new Date(b,k.getMonth(),1)),j("day")},X=(b,k)=>b?b.getDate()===k.getDate()&&b.getMonth()===k.getMonth()&&b.getFullYear()===k.getFullYear():!1,T=b=>X(new Date,b),O=b=>{let k=b;if(f==="single")k=b;else{const E=C,[F,H]=Array.isArray(E)?E:[null,null];!F||F&&H?k=[b,null]:b<F?k=[b,F]:k=[F,b]}S||P(k),n&&n(k)},K=b=>{if(f==="single")return{isSelected:X(C,b),isStart:!1,isEnd:!1,isInRange:!1};const k=Array.isArray(C)?C:[C,null],[E,F]=k,H=X(E,b),_=X(F,b);let z=!1;if(E&&F){const Q=new Date(E.getFullYear(),E.getMonth(),E.getDate()).getTime(),A=new Date(F.getFullYear(),F.getMonth(),F.getDate()).getTime(),Y=new Date(b.getFullYear(),b.getMonth(),b.getDate()).getTime();z=Y>Q&&Y<A}return{isSelected:H||_,isStart:H,isEnd:_,isInRange:z}},G=Es({hasSelected:!!C}),te={enter:b=>({x:b>0?"100%":"-100%",opacity:0}),center:{x:0,opacity:1},exit:b=>({x:b<0?"100%":"-100%",opacity:0})};return u.jsxs("div",{className:v(G.datePicker,d),style:i,...y,children:[u.jsxs("div",{className:G.header,children:[u.jsxs(he,{variant:"text",disableTextMargins:!0,size:"small",onClick:()=>j(b=>b==="day"?"year":"day"),className:"text-label-large font-bold capitalize text-on-surface hover:bg-surface-container-highest",children:[u.jsx("span",{className:"mr-2",children:w==="day"?W.format(h):h.getFullYear()}),u.jsx(ie,{icon:es,className:v("w-3 h-3 transition-transform duration-200 inline",w==="year"&&"rotate-180")})]}),w==="day"&&u.jsxs("div",{className:"flex items-center",children:[u.jsx(fe,{size:"xSmall",allowShapeTransformation:!1,onClick:M,icon:ts,label:"Previous month",title:null}),u.jsx(fe,{size:"xSmall",allowShapeTransformation:!1,onClick:V,icon:Jn,label:"Next month",title:null})]})]}),w==="year"?u.jsx("div",{className:"h-[280px] overflow-y-auto grid grid-cols-3 gap-2 p-2 scrollbar-hide",ref:$,children:D.map(b=>u.jsx(he,{size:"small",variant:b===h.getFullYear()?"filled":"text",onClick:()=>J(b),"data-selected":b===h.getFullYear(),className:v("w-full",{"text-on-surface":b!==h.getFullYear()}),label:b.toString(),children:b},b))}):u.jsxs(u.Fragment,{children:[u.jsx("div",{className:G.weekDays,children:R.map((b,k)=>u.jsx("div",{className:G.weekDay,children:b},k))}),u.jsx("div",{className:"overflow-hidden relative min-h-[240px]",children:u.jsx(q.AnimatePresence,{mode:"popLayout",initial:!1,custom:p,children:u.jsx(q.motion.div,{custom:p,variants:te,initial:"enter",animate:"center",exit:"exit",transition:{type:"spring",bounce:0,duration:.3},className:G.daysGrid,children:L.map((b,k)=>{if(!b.isCurrentMonth)return u.jsx("div",{className:G.dayCell},k);const{isSelected:E,isStart:F,isEnd:H,isInRange:_}=K(b.date),z=T(b.date),Q=r&&b.date<r||s&&b.date>s||(a==null?void 0:a(b.date));return u.jsx("div",{className:v(G.dayCell,_&&"bg-primary/20",F&&(C==null?void 0:C[1])&&"bg-gradient-to-r from-transparent to-primary/20",H&&(C==null?void 0:C[0])&&"bg-gradient-to-l from-transparent to-primary/20"),children:u.jsx(he,{className:()=>({button:v("aspect-square h-[40px] p-0",{"text-on-surface":!E&&!z,"opacity-50":Q}),stateLayer:v({"!bg-transparent":Q})}),size:"small",allowShapeTransformation:!1,variant:v({filled:E,outlined:z,text:!E&&!z}),label:b.date.getDate().toString(),onClick:()=>O(b.date),disabled:Q,children:b.date.getDate().toString()})},k)})},h.toISOString())})})]})]})};function ks(e){return xe.defineConfig({variant:xe.Variants.Udixio,...e,plugins:[new xe.FontPlugin(e),new ze.TailwindPlugin(e)]})}exports.AnimateOnScrollInit=Yn;exports.Button=he;exports.Card=Un;exports.Carousel=Kn;exports.CarouselItem=Vt;exports.Checkbox=ss;exports.Chip=Le;exports.Chips=as;exports.CustomScroll=Pt;exports.DatePicker=Ls;exports.Divider=Re;exports.Fab=ve;exports.FabMenu=cs;exports.Icon=ie;exports.IconButton=fe;exports.NavigationRail=Ss;exports.NavigationRailItem=Gt;exports.NavigationRailSection=Kt;exports.ProgressIndicator=$t;exports.RippleEffect=At;exports.SideSheet=ds;exports.Slider=us;exports.SmoothScroll=Wn;exports.Snackbar=fs;exports.State=ae;exports.Switch=hs;exports.SyncedFixedWrapper=Ot;exports.Tab=Xt;exports.TabGroup=ps;exports.TabPanel=Ut;exports.TabPanels=ys;exports.Tabs=ms;exports.TextField=xs;exports.ThemeProvider=Tn;exports.Tooltip=De;exports.animateOnScroll=qn;exports.buttonStyle=sn;exports.cardStyle=rn;exports.carouselItemConfig=ke;exports.carouselItemStyle=on;exports.carouselStyle=ln;exports.checkboxStyle=an;exports.chipStyle=cn;exports.chipsStyle=un;exports.classNames=v;exports.classnames=qe;exports.createUseClassNames=Z;exports.customScrollStyle=Wt;exports.defaultClassNames=ee;exports.defineConfig=ks;exports.dividerStyle=dn;exports.fabMenuStyle=hn;exports.fabStyle=fn;exports.getClassNames=ge;exports.iconButtonStyle=mn;exports.initAnimateOnScroll=Ce;exports.normalize=de;exports.progressIndicatorStyle=pn;exports.sideSheetConfig=je;exports.sideSheetStyle=yt;exports.sliderConfig=Me;exports.sliderStyle=xn;exports.snackbarStyle=vn;exports.switchStyle=gn;exports.tabPanelStyle=Nn;exports.tabPanelsStyle=Sn;exports.tabStyle=wn;exports.tabsStyle=bn;exports.textFieldStyle=En;exports.toolStyle=Ln;exports.useButtonStyle=Ue;exports.useCardStyle=Ge;exports.useCarouselItemStyle=Je;exports.useCarouselStyle=Qe;exports.useCheckboxStyle=tt;exports.useChipStyle=st;exports.useChipsStyle=ot;exports.useClassNames=nn;exports.useDividerStyle=lt;exports.useFabMenuStyle=dt;exports.useFabStyle=ct;exports.useIconButtonStyle=ht;exports.useProgressIndicatorStyle=pt;exports.useSideSheetStyle=yn;exports.useSliderStyle=xt;exports.useSnackbarStyle=gt;exports.useStateStyle=Ht;exports.useSwitchStyle=bt;exports.useTabPanelStyle=It;exports.useTabPanelsStyle=jt;exports.useTabStyle=Nt;exports.useTabsStyle=Lt;exports.useTextFieldStyle=Rt;exports.useToolTipStyle=Ft;exports.useTooltipPosition=qt;exports.useTooltipTrigger=Yt;
|