@udixio/ui-react 0.1.0 → 0.1.2
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 +21 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +713 -750
- package/package.json +14 -2
- package/vite.config.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## 0.1.2 (2025-08-05)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- dependencies package ([a04c368](https://github.com/Udixio/UI/commit/a04c368))
|
|
6
|
+
|
|
7
|
+
### ❤️ Thank You
|
|
8
|
+
|
|
9
|
+
- Joël VIGREUX
|
|
10
|
+
|
|
11
|
+
## 0.1.1 (2025-08-04)
|
|
12
|
+
|
|
13
|
+
### 🩹 Fixes
|
|
14
|
+
|
|
15
|
+
- dependencies pakcage ([9feff43](https://github.com/Udixio/UI/commit/9feff43))
|
|
16
|
+
- dependencies pakcage ([afa3009](https://github.com/Udixio/UI/commit/afa3009))
|
|
17
|
+
|
|
18
|
+
### ❤️ Thank You
|
|
19
|
+
|
|
20
|
+
- Joël VIGREUX
|
|
21
|
+
|
|
1
22
|
## 0.4.3 (2025-07-25)
|
|
2
23
|
|
|
3
24
|
### 🩹 Fixes
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),Pe=require("tailwind-merge"),c=require("react"),k=require("motion/react"),De=require("react-dom"),$e=require("react-textarea-autosize");function se(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=se(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function oe(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=se(e))&&(n&&(n+=" "),n+=t);return n}const le=Pe.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"]}}}),d=(...e)=>le(oe(e)),ae=(...e)=>le(oe(e));function We(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 ce=e=>{const t={};e.classNameList.forEach(n=>{var s;if(n)if(typeof n=="string")(t[s=e.default]??(t[s]=[])).push(n);else{const u=n(e.states);Object.entries(u).map(o=>{const[i,m]=o;(t[i]??(t[i]=[])).push(m)})}});const r=t;return Object.entries(t).map(n=>{let[s,u]=n;u=u.reverse(),s==e.default&&u.unshift("relative"),u.unshift(We(s)),r[s]=ae(...u)}),r},O=(e,t)=>r=>ce({classNameList:[r.className,t],default:e,states:r}),ie=O("button",({variant:e,disabled:t,iconPosition:r,icon:n,loading:s,shape:u,size:o,allowShapeTransformation:i})=>({button:d("group flex items-center cursor-pointer",o==="xSmall"&&"py-2",o==="small"&&"py-1",e==="text"&&[o==="xSmall"&&"-my-2",o==="small"&&"-my-1"]),container:d(" relative outline-none overflow-hidden 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",u==="rounded"&&{"rounded-[30px]":o==="xSmall"||o=="small","rounded-[40px]":o==="medium","rounded-[70px]":o==="large"||o=="xLarge"},u==="squared"&&{"rounded-[12px]":o==="xSmall"||o=="small","rounded-[16px]":o==="medium","rounded-[28px]":o==="large"||o=="xLarge"},i&&!t&&{"group-active:rounded-[12px]":o==="xSmall"||o=="small","group-active:rounded-[16px]":o==="medium","group-active:rounded-[28px]":o==="large"||o=="xLarge"},e==="elevated"&&{"bg-surface-container-low shadow-1 hover:shadow-2":!t},e==="filled"&&{"bg-primary hover:shadow-1":!t},e==="filledTonal"&&{"bg-secondary-container hover:shadow-1":!t},e==="outlined"&&[" border",{"border-on-surface/[0.12]":t," border-outline focus:border-primary":!t}],e==="text"&&["w-fit",{"text-primary":!t,"text-on-surface/[0.38]":t},o==="xSmall"&&"-mx-3 ",o==="small"&&"-mx-4 ",o==="medium"&&"-mx-6 ",o==="large"&&"-mx-12",o==="xLarge"&&"-mx-16 "],t&&"cursor-default"),stateLayer:d("state-layer min-h-full min-w-full absolute top-0 left-0 ",e==="elevated"&&{"bg-on-surface/[0.12]":t,"group-state-primary":!t},e==="filled"&&{"bg-on-surface/[0.12]":t,"group-state-on-primary":!t},e==="filledTonal"&&{"bg-on-surface/[0.12]":t,"group-state-on-secondary-container ":!t},e==="outlined"&&{"group-state-primary group-state-primary":!t},e==="text"&&{"group-state-primary":!t}),label:d({invisible:s},e==="elevated"&&{"text-primary":!t,"text-on-surface/[38%]":t},e==="filled"&&{"text-on-primary":!t,"text-on-surface/[38%]":t},e==="filledTonal"&&{"text-on-secondary-container":!t,"text-on-surface/[0.38]":t},e==="outlined"&&{"text-primary":!t,"text-on-surface/[0.38]":t},e==="text"&&{"text-primary":!t,"text-on-surface/[0.38]":t}),icon:d({invisible:s},o==="xSmall"&&"size-5",o==="small"&&"size-5",o==="medium"&&"size-6",o==="large"&&"size-8",o==="xLarge"&&"size-10",e==="elevated"&&{"text-primary":!t,"text-on-surface/[38%]":t},e==="filled"&&{"text-on-primary":!t,"text-on-surface/[38%]":t},e==="filledTonal"&&{"text-on-secondary-container":!t,"text-on-surface/[0.38]":t},e==="outlined"&&{"text-primary":!t,"text-on-surface/[0.38]":t},e==="text"&&{"text-primary":!t,"text-on-surface/[0.38]":t})})),ue=O("card",({variant:e,isInteractive:t})=>({card:d("card group/card rounded-xl overflow-hidden z-10",e==="outlined"&&"bg-surface",e==="elevated"&&"bg-surface-container-low shadow-1",e==="filled"&&"bg-surface-container-highest",e!=="filled"&&"border border-outline-variant"),stateLayer:d(["w-full top-0 left-0 h-full absolute -z-10",{" group-hover/card:hover-state-on-surface group-focus-visible/card:focus-state-on-surface":t}])})),fe=O("carouselItem",()=>({carouselItem:d("rounded-[28px] overflow-hidden flex-none")})),de=O("carousel",()=>({carousel:d(["w-full h-[400px]"]),track:d("grid grid-flow-col h-full transition-transform ease-out w-fit")})),me=O("divider",({orientation:e})=>({divider:d("border-outline-variant ",{"h-fit w-full border-t":e==="horizontal"},{"h-auto self-stretch w-fit border-l":e==="vertical"})})),pe=O("fab",({size:e,variant:t,isExtended:r})=>({fab:d("flex shadow-3 hover:shadow-4 group overflow-hidden outline-none items-center cursor-pointer",{"rounded-[12px]":e=="small"&&!r,"rounded-[16px]":e=="medium"||r,"rounded-[28px]":e=="large"&&!r},{"p-2":e=="small"&&!r,"p-4":e=="medium"||r,"p-[30px]":e=="large"&&!r},t==="surface"&&"bg-surface-container",t==="primary"&&"bg-primary-container",t==="secondary"&&"bg-secondary-container",t==="tertiary"&&"bg-tertiary-container"),stateLayer:d("absolute w-full h-full overflow-hidden left-1/2 top-1/2 transform -translate-y-1/2 -translate-x-1/2",t==="surface"&&"group-hover:hover-state-primary group-focus:focus-state-primary",t==="primary"&&"group-hover:hover-state-on-primary-container group-focus-visible:focus-state-on-primary-container",t==="secondary"&&"group-hover:hover-state-on-secondary-container group-focus-visible:focus-state-on-secondary-container",t==="tertiary"&&"group-hover:hover-state-on-tertiary-container group-focus-visible:focus-state-on-tertiary-container"),icon:d({"size-6":e=="small"||e=="medium"||r,"size-9":e=="large"&&!r},t==="surface"&&"text-primary",t==="primary"&&"text-on-primary-container",t==="secondary"&&"text-on-secondary-container",t==="tertiary"&&"text-on-tertiary-container"),label:d("text-title-medium text-nowrap",t==="surface"&&"text-primary",t==="primary"&&"text-on-primary-container",t==="secondary"&&"text-on-secondary-container",t==="tertiary"&&"text-on-tertiary-container")})),he=O("iconButton",({variant:e,disabled:t,onToggle:r,isActive:n,size:s,width:u,shape:o,allowShapeTransformation:i})=>({iconButton:d("group min-h-12 flex items-center cursor-pointer",{"cursor-default":t}),container:d("rounded-full relative flex overflow-hidden transition-all duration-300",(o==="rounded"||o==="squared"&&r&&!t&&n&&i)&&{"rounded-[30px]":s==="xSmall"||s=="small","rounded-[40px]":s==="medium","rounded-[70px]":s==="large"||s=="xLarge"},(o==="squared"||o==="rounded"&&r&&!t&&n&&i)&&{"rounded-[12px]":s==="xSmall"||s=="small","rounded-[16px]":s==="medium","rounded-[28px]":s==="large"||s=="xLarge"},i&&!t&&{"group-active:rounded-[12px]":s==="xSmall"||s=="small","group-active:rounded-[16px]":s==="medium","group-active:rounded-[28px]":s==="large"||s=="xLarge"},e==="filled"&&[!t&&{"bg-surface-container":!n&&!!r,"bg-primary":n||!r},!!t&&"bg-on-surface/[0.12]"],e==="tonal"&&[!t&&{"bg-surface-container":!n&&!!r,"bg-secondary-container":n||!r},!!t&&"bg-on-surface/[0.12]"],e==="outlined"&&[!t&&{"border border-outline":!n,"border border-transparent bg-inverse-surface":n},!!t&&{"border border-on-surface/[0.12]":!n,"border border-transparent bg-on-surface/[0.12]":n}]),stateLayer:d("absolute top-0 left-0 h-full w-full ",!t&&[e==="standard"&&{"state-on-surface-variant":!n,"state-primary":n},e==="filled"&&{"state-primary":!n&&!!r,"state-inverse-on-surface":n||!r},e==="tonal"&&{"state-on-surface-variant":!n&&!!r,"state-on-secondary-container":n||!r},e==="outlined"&&{"state-on-surface-variant":!n,"state-on-primary":n}]),icon:d(" 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"},u=="narrow"&&[{"px-1":s==="xSmall"},{"px-1":s==="small"},{"px-3":s==="medium"},{"px-4":s==="large"},{"px-8":s==="xLarge"}],u=="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":!n,"text-primary":n},e==="filled"&&{"text-primary":!n&&!!r,"text-on-primary":n||!r},e==="tonal"&&{"text-on-surface-variant":!n&&!!r,"text-on-secondary-container":n||!r},e==="outlined"&&{"text-on-surface-variant":!n,"text-inverse-on-surface":n}],!!t&&"text-on-surface/[0.38]")})),xe=O("progressIndicator",({variant:e,isVisible:t})=>({progressIndicator:d((e==="linear-determinate"||e=="linear-indeterminate")&&"flex w-full"),track:"h-full rounded-full bg-primary rounded-l-full",activeIndicator:d((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:"absolute right-0 bg-primary rounded-full"})),ye=O("slider",({isChanging:e})=>({slider:d(["relative w-full h-11 flex items-center rounded gap-x-1.5 cursor-pointer"]),activeTrack:d(["h-4 relative transition-all duration-100 bg-primary overflow-hidden rounded-l-full "]),inactiveTrack:d(["h-4 relative transition-all duration-100 bg-primary-container rounded-r-full overflow-hidden"]),handle:d(["transform transition-all duration-100 bg-primary h-full rounded-full ",{"w-0.5":e,"w-1":!e}]),valueIndicator:d(["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:d(["h-1 w-1 absolute transform -translate-y-1/2 -translate-x-1/2 top-1/2 rounded-full"])})),ge=O("snackbar",()=>({snackbar:d(" rounded bg-inverse-surface "),container:d("pl-4 pr-2 max-w-full py-1 flex items-center flex-wrap"),supportingText:d("text-body-medium text-inverse-on-surface "),icon:d(" ml-auto mr-0 text-inverse-on-surface block dark")})),we=O("switch",({isSelected:e,disabled:t,inactiveIcon:r})=>({switch:d("group 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:d("flex items-center justify-center absolute",{"left-[14px]":!e},{"right-[14px]":e}),handle:d("transition-all duration-100 z-10 rounded-full flex items-center justify-center",{"w-[16px] h-[16px]":!e&&!r},{"w-[24px] h-[24px]":!(!e&&!r)},!t&&["cursor-pointer group-active:h-[28px] group-active:w-[28px]",{"bg-on-primary group-hover:bg-primary-container":e},{"bg-outline group-hover:bg-on-surface-variant":!e}],{"bg-surface":t}),handleStateLayer:d("w-[40px] h-[40px] -z-10 rounded-full absolute",{"group-state-primary":!t}),icon:d("w-[16px] h-[16px]",!t&&[{"text-on-primary-container":e},{"text-on-primary":!e}],{"text-on-surface/[0.38]":t})})),ve=O("tab",({isSelected:e,icon:t,label:r,variant:n})=>({tab:d("bg-surface flex-1 group outline-none flex px-4 justify-center items-center cursor-pointer",{"z-10":e},!!(t&&r)&&n==="primary"&&"h-16",!(t&&r&&n==="primary")&&"h-12"),stateLayer:d("absolute w-full h-full overflow-hidden left-1/2 top-1/2 transform -translate-y-1/2 -translate-x-1/2",n==="primary"&&{"group-hover:hover-state-on-surface group-focus-visible:focus-state-on-surface":!e,"group-hover:hover-state-primary group-focus-visible:focus-state-primary":e},n==="secondary"&&"group-hover:hover-state-on-surface group-focus-visible:focus-state-on-surface"),content:d("flex gap-0.5 h-full justify-center",{relative:n=="primary"},{"":!!(r&&!t)},n==="primary"&&"flex-col items-center",n==="secondary"&&{"flex-col items-center":!(r&&t),"flex-row items-center gap-2":!!(r&&t)}),icon:d("h-6 w-6 p-0.5 !box-border",n==="primary"&&{"text-on-surface-variant":!e,"text-primary":e},n==="secondary"&&{"text-on-surface-variant":!e,"text-on-surface":e}),label:d("text-title-small text-nowrap",n==="primary"&&{"text-on-surface-variant":!e,"text-primary":e},n==="secondary"&&{"text-on-surface-variant":!e,"text-on-surface":e}),underline:d("bg-primary absolute w-full left-0 bottom-0",n==="primary"&&"h-[3px] rounded-t",n==="secondary"&&"h-0.5")})),be=O("tabs",({scrollable:e})=>({tabs:d("border-b border-surface-container-highest","flex relative ",{"overflow-x-auto":e})})),je=O("textField",({disabled:e,leadingIcon:t,trailingIcon:r,variant:n,errorText:s,isFocused:u,value:o,suffix:i,textLine:m})=>({textField:d({"opacity-[.38]":e}),content:d("group transition-border duration-200 relative flex items-center ",{"h-14":m=="singleLine"},{"border-on-surface-variant":!(s!=null&&s.length)&&!u&&n=="filled","border-outline":!(s!=null&&s.length)&&!u&&n=="outlined","border-primary":!(s!=null&&s.length)&&u,"border-error":!!(s!=null&&s.length)},{"bg-on-surface/[0.04]":e},n=="filled"&&["rounded-t overflow-hidden border-b",{"bg-surface-container-highest":!e}],n=="outlined"&&["border rounded box-border",{"border-[3px]":u}]),stateLayer:d("absolute -z-10 w-full h-full top-0 left-0",{hidden:n=="outlined"},{"group-state-on-surface":!e,"focus-state-on-surface":u}),label:d("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)&&u}),input:d("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":!!i},n=="filled"&&" pb-2 pt-6",n=="outlined"&&"py-4 relative z-10"),activeIndicator:d("absolute w-0 inset-x-0 border-rounded mx-auto bottom-0",n=="filled"&&["h-[2px] transition-all duration-300",{"bg-primary":!(s!=null&&s.length)},{"bg-error":!!(s!=null&&s.length)},{"!w-full":u}]),supportingText:d(" text-body-small px-4 pt-1",{"text-on-surface-variant":!e&&!(s!=null&&s.length)},{"text-on-surface":e},{"!w-full":u},{"text-error":!!(s!=null&&s.length)}),leadingIcon:d(["h-12 ml-3 flex items-center justify-center",{"cursor-text":!c.isValidElement(t)}]),trailingIcon:d("h-12 w-12 flex items-center justify-center",{"cursor-text":!c.isValidElement(r)}),suffix:d("text-on-surface-variant pl-0 pr-4",n=="filled"&&" pb-2 pt-6",n=="outlined"&&"py-4 relative z-10")})),Ne=O("toolTip",({position:e,variant:t})=>({toolTip:d(" pointer-events-auto w-max z-10 absolute m-1 w-max-content max-w-[312px]",{"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:d("pb-2",t=="rich"&&"bg-surface-container rounded-2xl text-on-surface-container px-4 pt-3 shadow-2",t=="plain"&&"bg-inverse-surface rounded text-inverse-on-surface px-2 py-1"),actions:d("flex gap-10 px-1 mt-2",t=="plain"&&"hidden"),subHead:d("text-title-small mb-1",t=="plain"&&"hidden"),supportingText:d("")})),H=({icon:e,colors:t=[],className:r})=>{const{icon:n}=e,[s,u,,,o]=n||[],i=m=>{switch(m.length){case 2:return{"--fa-primary-color":m[0]||"inherit","--fa-secondary-color":m[1]||"inherit"};case 1:return{color:m[0]};default:return{}}};return l.jsx("svg",{className:d("size-5 box-content",r),style:{...i(t)},xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${s} ${u}`,role:"img","aria-hidden":"true",children:typeof o=="string"?l.jsx("path",{className:"fill-current",d:o}):o.map((m,f)=>l.jsx("path",{d:m},f))})},Se=({variant:e="linear-determinate",minHeight:t=4,value:r=0,transitionDuration:n=1e3,className:s,...u})=>{const[o,i]=c.useState(r),[m,f]=c.useState(1.5);c.useEffect(()=>{r>100&&(r=100),r<0&&(r=0),i(r)},[r]);const[h,v]=c.useState(!0),a=()=>h?m:m*.5;c.useEffect(()=>{if((e==="circular-indeterminate"||e==="linear-indeterminate")&&o!==100){const S=setInterval(()=>{i(h?10:90),v(!h)},a()*1e3);return()=>clearInterval(S)}},[e,h,o]);const[y,b]=c.useState(!1);c.useEffect(()=>{if(o>=100){const S=setTimeout(()=>{b(!1)},n);return()=>{clearTimeout(S)}}else b(!0)},[o,n]);const j=xe({className:s,variant:e,value:r,transitionDuration:n,isVisible:y,minHeight:t});return l.jsxs(l.Fragment,{children:[(e==="linear-determinate"||e=="linear-indeterminate")&&l.jsxs("div",{style:{height:`${t}px`},className:j.progressIndicator,...u,children:[l.jsx("div",{style:{height:y?`${t}px`:"0px",width:`${o}%`,transition:`width 1ms ease-in-out ${o==100?", height 200ms 0.5s ease-in-out":""}`},className:j.track}),l.jsx("div",{style:{height:y?`${t}px`:"0px",marginLeft:o!=100?"6px":"0px",transition:`width ${n}ms ease-in-out ${o==100?`, height 200ms 0.5s ease-in-out, margin-left ${n}ms ${n/1.5}ms`:""}`},className:j.activeIndicator}),l.jsx("div",{style:{height:y?`${t}px`:"0px",width:`${t}px`,transition:`width ${n}ms ease-in-out, height 200ms 0.5s ease-in-out`},className:j.stop})]}),(e==="circular-determinate"||e=="circular-indeterminate")&&l.jsx(k.motion.svg,{width:"48",height:"48",viewBox:"0 0 48 48",initial:{rotate:-90},animate:{rotate:270},transition:{repeat:1/0,duration:a(),ease:"linear"},className:j.progressIndicator,...u,children:l.jsx(k.motion.circle,{cx:"50%",cy:"50%",r:y?"calc(50% - 2px)":"50%",style:{strokeLinecap:"round"},initial:"hidden",animate:"visible",className:j.activeIndicator,variants:{hidden:{pathLength:h?10/100:90/100},visible:{pathLength:h?90/100:10/100}},transition:{pathLength:{type:"tween",ease:"linear",duration:a(),bounce:0}}})},h+"")]})},Z=({colorName:e="on-surface",triggerRef:t})=>{const r={initial:{opacity:0,borderRadius:"50%",width:"25%",height:"25%"},animate:{opacity:1,borderRadius:0,width:"200%",height:"200%",transition:{duration:.3,borderRadius:{duration:.3,delay:.3}}}},[n,s]=c.useState(!0),[u,o]=c.useState(!1),[i,m]=c.useState({x:0,y:0});c.useEffect(()=>{u&&(s(!0),s(!1))},[u]),c.useEffect(()=>{const a=t==null?void 0:t.current;if(a)return a.addEventListener("mousedown",f),a.addEventListener("mouseup",v),a.addEventListener("mouseleave",h),()=>{a.removeEventListener("mousedown",f),a.removeEventListener("mouseup",v),a.removeEventListener("mouseleave",h)}},[t]);const f=a=>{const y=t==null?void 0:t.current,b=y.getBoundingClientRect();o(!0),m({x:(a.clientX-b.left)/y.clientWidth*100,y:(a.clientY-b.top)/y.clientHeight*100})},h=a=>{o(!1)},v=a=>{o(!1)};return l.jsx(k.AnimatePresence,{mode:"wait",children:(u||!u&&!n)&&l.jsx(k.motion.div,{style:{position:"absolute",width:"100%",height:"100%",top:i.y+"%",left:i.x+"%",background:`color-mix(in srgb, var(--color-${e}) 12%, transparent)`,pointerEvents:"none"},variants:r,initial:"initial",animate:"animate",exit:{opacity:0,transition:{duration:0}},onAnimationComplete:()=>s(!0),className:"transform -translate-x-1/2 -translate-y-1/2"})})};function Fe(e,t,r){var n={},s=n.noTrailing,u=s===void 0?!1:s,o=n.noLeading,i=o===void 0?!1:o,m=n.debounceMode,f=m===void 0?void 0:m,h,v=!1,a=0;function y(){h&&clearTimeout(h)}function b(S){var E=S||{},p=E.upcomingOnly,N=p===void 0?!1:p;y(),v=!N}function j(){for(var S=arguments.length,E=new Array(S),p=0;p<S;p++)E[p]=arguments[p];var N=this,L=Date.now()-a;if(v)return;function R(){a=Date.now(),t.apply(N,E)}function C(){h=void 0}!i&&f&&!h&&R(),y(),f===void 0&&L>e?i?(a=Date.now(),u||(h=setTimeout(f?C:R,e))):R():u!==!0&&(h=setTimeout(f?C:R,f===void 0?e-L:e))}return j.cancel=b,j}const Ee=O("customScroll",({orientation:e,draggable:t,isDragging:r})=>({customScroll:d("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":r,"[&::-webkit-scrollbar-thumb]:bg-transparent":!r},{"[&::-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&&!r,"cursor-grabbing":t&&r}),track:d("overflow-hidden flex-none sticky",{"left-0 h-full":e==="horizontal","top-0 w-full":e==="vertical"})})),T=({children:e,orientation:t="vertical",scrollSize:r,onScroll:n,className:s,draggable:u=!1,throttleDuration:o=75})=>{var V,$;const i=c.useRef(null),m=c.useRef(null),[f,h]=c.useState({width:null,height:null});c.useEffect(()=>{if(!i.current)return;const I=new ResizeObserver(W=>{for(const F of W)F.target===i.current&&h({width:F.contentRect.width,height:F.contentRect.height})});return I.observe(i.current),()=>{I.disconnect()}},[i]);const v=c.useRef(null),a=c.useRef(null),y=()=>{const I=m.current;return I?{width:r??I.scrollWidth,height:r??I.scrollHeight}:null},b=()=>{const I=i.current;return I?{width:I.clientWidth,height:I.clientHeight}:null},{scrollYProgress:j,scrollXProgress:S}=k.useScroll({container:i}),E=c.useRef(null);E.current||(E.current=Fe(o,(I,W)=>{!a.current||!v.current||n&&(t==="horizontal"&&W==="x"&&n({scrollProgress:I,scroll:I*v.current.width,scrollTotal:v.current.width,scrollVisible:a.current.width}),t==="vertical"&&W==="y"&&n({scrollProgress:I,scroll:I*v.current.height,scrollTotal:v.current.height,scrollVisible:a.current.height}))}));const p=(I,W)=>{E.current&&E.current(I,W)};c.useEffect(()=>{f.width&&p(S.get(),"x"),f.height&&p(j.get(),"y")},[f]),k.useMotionValueEvent(S,"change",I=>{p(I,"x")}),k.useMotionValueEvent(j,"change",I=>{p(I,"y")});const[N,L]=c.useState(!1);c.useLayoutEffect(()=>{N||!a.current||!v.current||!n||(n({scrollProgress:0,scroll:0,scrollTotal:t=="vertical"?v.current.height:v.current.width,scrollVisible:t=="vertical"?a.current.height:a.current.width}),L(!0))},[a,v,n]),v.current=y(),a.current=b();const[R,C]=c.useState(!1),B=Ee({isDragging:R,children:e,className:s,onScroll:n,orientation:t,scrollSize:r,draggable:u,throttleDuration:o}),[P,M]=c.useState(0),[x,D]=c.useState(0),A=I=>{if(!u)return;const W=i.current;if(!W||P==null)return;const K=(I.pageX-W.offsetLeft-P)*1.5;W.scrollLeft=x-K},X=I=>{const W=i.current;W&&(C(!0),M(I.pageX-W.offsetLeft),D(W.scrollLeft))},G=I=>{R&&(I.preventDefault(),A(I))},U=()=>{C(!1)},_=()=>{C(!1)},w=I=>{I.preventDefault()},g=c.useRef(null);return c.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]),l.jsxs("div",{className:B.customScroll,ref:i,onMouseDown:X,onMouseMove:G,onMouseUp:U,onMouseLeave:_,onDragStart:w,onScroll:I=>{R||(M(null),C(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{C(!1)},1e3))},children:[l.jsx("div",{ref:m,style:t==="vertical"?{height:((V=a==null?void 0:a.current)==null?void 0:V.height)??"100%"}:{width:(($=a==null?void 0:a.current)==null?void 0:$.width)??"100%"},className:B.track,children:e}),a.current&&v.current&&l.jsxs(l.Fragment,{children:[t==="vertical"&&v.current.height>a.current.height&&l.jsx(k.motion.div,{className:"flex-none",style:{height:v.current.height-a.current.height}}),t==="horizontal"&&v.current.width>a.current.width&&l.jsx(k.motion.div,{className:"flex-none",style:{width:v.current.width-a.current.width}})]})]})},Ue=({children:e,transition:t=".5s",orientation:r="vertical",throttleDuration:n=25,...s})=>{const[u,o]=c.useState(null),i=k.motionValue((u==null?void 0:u.scrollProgress)??0),m=k.useTransform(i,[0,1],[0,1-((u==null?void 0:u.scrollVisible)??0)/((u==null?void 0:u.scrollTotal)??0)]),f=k.useTransform(m,a=>`${-a*100}%`),h=a=>{i.set(a.scrollProgress),a.scrollTotal>0&&o(a)},v=c.useRef(null);return k.useMotionValueEvent(f,"change",a=>{const y=performance.now();if(v.current!==null){const b=y-v.current;console.log(`Delta temps : ${b} ms`)}v.current=y,console.log(a)}),l.jsx(T,{onScroll:h,throttleDuration:n,...s,children:l.jsx(k.motion.div,{className:d("transition-transform ease-out",{"w-fit h-full":r==="horizontal","h-fit w-full":r==="vertical"}),style:{transitionDuration:t,...r=="vertical"?{y:f}:{x:f}},children:e})})},Le=({targetRef:e,children:t})=>{const[r,n]=c.useState(null),s=c.useRef(null),u=()=>{const o=e.current;if(!o)return;const i=o.getBoundingClientRect();console.log(o),n({position:"fixed",top:i.top,left:i.left,width:i.width,height:i.height,pointerEvents:"none",zIndex:999})};return c.useEffect(()=>{const o=e.current;if(o)return u(),window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),s.current=new ResizeObserver(u),s.current.observe(o),()=>{var i;window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u),(i=s.current)==null||i.disconnect()}},[e]),r?De.createPortal(l.jsx("div",{style:r,children:t}),document.body):null},Re=({variant:e="filled",disabled:t=!1,icon:r,href:n,label:s,className:u,iconPosition:o="left",loading:i=!1,shape:m="rounded",onClick:f,ref:h,size:v="medium",allowShapeTransformation:a=!0,transition:y,...b})=>{const j=n?"a":"button",S=c.useRef(null),E=h||S,p=ie({allowShapeTransformation:a,size:v,shape:m,href:n,disabled:t,icon:r,iconPosition:o,label:s,loading:i,variant:e,transition:y,className:u}),N=r?l.jsx(H,{icon:r,className:p.icon}):l.jsx(l.Fragment,{});return y={duration:.3,...y},l.jsx(j,{ref:E,href:n,className:p.button,...b,onClick:L=>{t?L.preventDefault():f&&f(L)},disabled:t,children:l.jsxs("div",{className:p.container,style:{transition:y.duration+"s"},children:[l.jsx("div",{className:p.stateLayer,children:!t&&l.jsx(Z,{colorName:e==="elevated"&&"primary"||e==="filled"&&"on-primary"||e==="filledTonal"&&"on-secondary-container"||e==="outlined"&&"primary"||e==="text"&&"primary"||"",triggerRef:E})}),o==="left"&&N,i&&l.jsx("div",{className:"!absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2",children:l.jsx(Se,{className:()=>({progressIndicator:"h-6 w-6",activeIndicator:d({"!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==="filledTonal"&&!t,"!stroke-on-surface/[38%]":e==="filledTonal"&&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"})}),l.jsx("span",{className:p.label,children:s}),o==="right"&&N]})})},Oe=({variant:e="outlined",className:t,children:r,isInteractive:n=!1,ref:s,...u})=>{const o=ue({className:t,isInteractive:n,variant:e}),i=c.useRef(null),m=s||i;return l.jsxs("div",{...u,ref:m,className:o.card,children:[l.jsx("div",{className:o.stateLayer,children:n&&l.jsx(Z,{colorName:"on-surface",triggerRef:m})}),r]})},Ie=(e,t,r=[0,1])=>{const[n,s]=t,[u,o]=r,m=(Math.max(n,Math.min(e,s))-n)/(s-n);return u+m*(o-u)},ke=({className:e,children:t,width:r=1,index:n=0,ref:s,...u})=>{const o=c.useRef(null),i=s||o,m=fe({className:e,index:n,width:r,children:t});return l.jsx(k.motion.div,{ref:i,animate:{width:r+"px"},transition:{duration:.5,ease:"linear"},className:m.carouselItem,...u,children:t})},Xe=({variant:e="hero",className:t,children:r,ref:n,marginPourcent:s=0,inputRange:u=[.21,.65],outputRange:o=[42,300],gap:i=8,onChange:m,scrollSensitivity:f=1.25,...h})=>{var U,_;const v=c.useRef(null),a=n||v,y=de({className:t,children:r,variant:e,inputRange:u,outputRange:o,marginPourcent:s,onChange:m,gap:i,scrollSensitivity:f}),b=c.Children.toArray(r).filter(w=>c.isValidElement(w)&&w.type===ke),j=c.useRef(null),[S,E]=c.useState([]),[p,N]=c.useState(null),L=()=>{var W;if(!j.current||!a.current||!p)return[];const{scrollVisible:w,scrollProgress:g}=p;function V(F,K){return F.map(Y=>(Y-K)/Math.abs(F[1]-F[0]))}let $=b.map((F,K)=>{if(!R[K].current||!j.current)return 0;let J=K/(b.length-1);return J>1&&(J=1),J<0&&(J=0),J});$=V($,g);let I=((((W=a.current)==null?void 0:W.clientWidth)??w)-(o[0]+i))/(o[1]+i);return $.map((F,K)=>({value:Math.abs(F),originalIndex:K})).sort((F,K)=>F.value-K.value).forEach((F,K)=>{K===0&&B(F.originalIndex);let Y=Ie(I,[0,1],[0,o[1]]);Y<o[0]&&(Y=o[0]),I--,$[F.originalIndex]=Y}),$},R=c.useRef([]).current,[C,B]=c.useState(0);c.useEffect(()=>{m&&m(C)},[C]),R.length!==b.length&&b.forEach((w,g)=>{R[g]||(R[g]=c.createRef())});const P=b.map((w,g)=>c.cloneElement(w,{width:S[g],ref:R[g],key:g,index:g})),M=k.motionValue((p==null?void 0:p.scrollProgress)??0),x=k.useTransform(M,[0,1],[0,1-(((U=a.current)==null?void 0:U.clientWidth)??0)/(((_=j==null?void 0:j.current)==null?void 0:_.clientWidth)??0)]),D=k.useTransform(x,w=>`${-w*100}%`),A=w=>{w.scrollTotal>0&&N(w)};c.useEffect(()=>{const w=L();E(w)},[p]);const[X,G]=c.useState(0);return c.useLayoutEffect(()=>{let w=o[1];p&&w>p.scrollVisible&&(w=p.scrollVisible);const g=(w+i)*P.length/f;G(g)},[a,R,p]),l.jsx("div",{className:y.carousel,ref:a,...h,children:l.jsx(T,{draggable:!0,orientation:"horizontal",onScroll:A,scrollSize:X,children:l.jsx(k.motion.div,{className:y.track,ref:j,style:{transitionDuration:"0.5s",transitionTimingFunction:"ease-out",gap:`${i}px`,x:D},children:P})})})},qe=({orientation:e="horizontal",className:t,...r})=>{const n=me({orientation:e,className:t});return l.jsx("hr",{className:n.divider,...r})},q=[];for(let e=0;e<256;++e)q.push((e+256).toString(16).slice(1));function Ae(e,t=0){return(q[e[t+0]]+q[e[t+1]]+q[e[t+2]]+q[e[t+3]]+"-"+q[e[t+4]]+q[e[t+5]]+"-"+q[e[t+6]]+q[e[t+7]]+"-"+q[e[t+8]]+q[e[t+9]]+"-"+q[e[t+10]]+q[e[t+11]]+q[e[t+12]]+q[e[t+13]]+q[e[t+14]]+q[e[t+15]]).toLowerCase()}let Q;const Ge=new Uint8Array(16);function Ke(){if(!Q){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Q=crypto.getRandomValues.bind(crypto)}return Q(Ge)}const He=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),re={randomUUID:He};function ee(e,t,r){var s;if(re.randomUUID&&!e)return re.randomUUID();e=e||{};const n=e.random??((s=e.rng)==null?void 0:s.call(e))??Ke();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Ae(n)}const te=({variant:e="plain",buttons:t,className:r,children:n,title:s,text:u,position:o,targetRef:i,ref:m,trigger:f=["hover","focus"],...h})=>{if(!n&&!i)throw new Error("ToolTip must have a child or a targetRef");Array.isArray(f)||(f=[f]),t&&!Array.isArray(t)&&(t=[t]);const v=c.useRef(null),a=i||v,[y,b]=c.useState(null),[j]=c.useState(ee()),[S,E]=c.useState(!1),p=c.useRef(null);c.useEffect(()=>{const x=D=>{b(D.detail)};return document.addEventListener("tooltip-update",x),()=>{document.removeEventListener("tooltip-update",x)}},[]),c.useEffect(()=>{p.current&&clearTimeout(p.current),y?E(y===j):p.current=setTimeout(()=>{E(!1)},1200)},[y,j]);const N=()=>{if(f.includes("hover")){const x=new CustomEvent("tooltip-update",{detail:j});document.dispatchEvent(x)}},L=()=>{if(f.includes("hover")){const x=new CustomEvent("tooltip-update",{detail:null});document.dispatchEvent(x)}},R=()=>{if(f.includes("click")){const x=new CustomEvent("tooltip-update",{detail:S?null:j});document.dispatchEvent(x)}},C=()=>{if(f.includes("focus")){const x=new CustomEvent("tooltip-update",{detail:j});document.dispatchEvent(x)}},B=()=>{if(f.includes("focus")){const x=new CustomEvent("tooltip-update",{detail:null});document.dispatchEvent(x)}};c.useEffect(()=>{if(a!=null&&a.current){const x=a.current;return x.addEventListener("mouseenter",N),x.addEventListener("mouseleave",L),x.addEventListener("click",R),x.addEventListener("focus",C),x.addEventListener("blur",B),()=>{x.removeEventListener("mouseenter",N),x.removeEventListener("mouseleave",L),x.removeEventListener("click",R),x.removeEventListener("focus",C),x.removeEventListener("blur",B)}}},[a,f,j,S]);const P=!i&&c.isValidElement(n)?c.cloneElement(n,{ref:v}):n;if(!o&&typeof window<"u"&&a!=null&&a.current&&!o){const x=a.current.getBoundingClientRect(),D=window.innerWidth,A=window.innerHeight,X=x.left/D,G=x.top/A;e==="plain"?X<1/3?o="right":X>2/3?o="left":o=G>.5?"top":"bottom":X<1/2&&G<1/2?o="bottom-right":X>1/2&&G<1/2?o="bottom-left":X>1/2&&G>1/2?o="top-left":X<1/2&&G>1/2&&(o="top-right")}const M=Ne({variant:e,buttons:t,className:r,title:s,text:u,position:o,trigger:f,targetRef:i,children:n});return l.jsxs(l.Fragment,{children:[P,l.jsx(k.AnimatePresence,{children:S&&l.jsx(Le,{targetRef:a,children:l.jsx(k.motion.div,{initial:{opacity:y?1:0},animate:{opacity:1},transition:{duration:y?0:.3},exit:{opacity:y?1:0},className:M.toolTip,...h,onMouseEnter:N,onMouseLeave:L,children:l.jsxs(k.motion.div,{className:M.container,layoutId:"tool-tip",transition:{type:"spring",stiffness:200,damping:20},children:[s&&l.jsx("div",{className:M.subHead,children:s}),l.jsx("div",{className:M.supportingText,children:u}),t&&l.jsx("div",{className:M.actions,children:Array.isArray(t)&&t.map((x,D)=>l.jsx(Re,{size:"small",variant:"text",...x},D))})]})})})})]})},z=({className:e,label:t,variant:r="primary",size:n="medium",href:s,type:u,icon:o,isExtended:i=!1,ref:m,transition:f,...h})=>{const v=s?"a":"button",a=pe({href:s,icon:o,isExtended:i,label:t,size:n,variant:r,className:e,transition:f});f={duration:.3,...f};const y=c.useRef(null),b=m||y,j={visible:{width:"auto",marginLeft:12,opacity:1,transition:{...f,opacity:{duration:f.duration/2,delay:f.duration-f.duration/2}}},hidden:{width:0,marginLeft:0,opacity:0,transition:{...f,marginLeft:{duration:f.duration/2,delay:f.duration-f.duration/2}}}};return l.jsxs(v,{...h,ref:b,href:s,"aria-label":i?void 0:t,className:a.fab,children:[l.jsx(te,{trigger:i?null:void 0,text:t,targetRef:b}),l.jsx("span",{className:a.stateLayer,children:l.jsx(Z,{colorName:d({primary:r=="surface","on-primary-container":r=="primary","on-secondary-container":r=="secondary","on-tertiary-container":r=="tertiary"}),triggerRef:b})}),l.jsx(H,{icon:o,className:a.icon}),l.jsx(k.AnimatePresence,{children:i&&l.jsx(k.motion.span,{variants:j,initial:"hidden",animate:"visible",exit:"hidden",className:a.label,children:t})})]})},ne=({variant:e="standard",href:t,disabled:r=!1,type:n="button",title:s,arialLabel:u,onToggle:o,activated:i=!1,onClick:m,icon:f,size:h="medium",iconSelected:v,className:a,ref:y,width:b="default",shape:j="rounded",allowShapeTransformation:S=!0,transition:E,...p})=>{s||(s=u);const[N,L]=c.useState(i);let R;o?o&&(R=x=>{r&&x.preventDefault(),L(!N),o(!!N)},f=N&&v||f):R=x=>{r&&x.preventDefault(),m&&m(x)},c.useEffect(()=>{L(i)},[i]);const C=t?"a":"button",B=he({transition:E,shape:j,allowShapeTransformation:S,width:b,href:t,activated:i,arialLabel:u,iconSelected:v,isActive:N,onToggle:o,disabled:r,icon:f,variant:e,className:a,size:h,...p}),P=c.useRef(null),M=y||P;return E={duration:.3,...E},l.jsxs(C,{disabled:r,href:t,className:B.iconButton,"aria-label":u,...p,title:void 0,onClick:R,ref:M,children:[l.jsx(te,{targetRef:M,trigger:r?null:void 0,text:s}),l.jsxs("div",{style:{transition:E.duration+"s"},className:B.container,children:[l.jsx("div",{className:B.stateLayer,children:!r&&l.jsx(Z,{colorName:d(e==="standard"&&{"on-surface-variant":!N,primary:N},e==="filled"&&{primary:!N&&!!o,"inverse-on-surface":N||!o},e==="tonal"&&{"on-surface-variant":!N&&!!o,"on-secondary-container":N||!o},e==="outlined"&&{"on-surface-variant":!N,"on-primary":N}),triggerRef:M})}),f&&l.jsx(H,{icon:f,className:B.icon})]})]})},_e=({className:e,valueFormatter:t,step:r=10,name:n,value:s=0,min:u=0,max:o=100,marks:i=[{value:0,label:"0"},{value:100,label:"100"}],ref:m,onChange:f,...h})=>{const v=w=>{const g=y(),V=a();return w===1/0?100:w===-1/0?0:(w-g)/(V-g)*100},a=(w=!1)=>w?o:o==1/0?i[(i==null?void 0:i.length)-1].value:o,y=(w=!1)=>w?u:u==-1/0?i[0].value:u,b=w=>{const g=y(!1);return(a(!1)-g)*w/100+g},[j,S]=c.useState(!1),E=c.useRef(null),p=m||E,[N,L]=c.useState(s),[R,C]=c.useState(v(s)),[B,P]=c.useState(!1),M=w=>{P(!0),S(!0),A(w)},x=()=>{P(!1),S(!1)};c.useEffect(()=>(B?(window.addEventListener("mouseup",x),window.addEventListener("mousemove",A),window.addEventListener("touchend",x),window.addEventListener("touchmove",A)):(window.removeEventListener("mouseup",x),window.removeEventListener("mousemove",A),window.removeEventListener("touchend",x),window.removeEventListener("touchmove",A)),()=>{window.removeEventListener("mouseup",x),window.removeEventListener("mousemove",A),window.removeEventListener("touchend",x),window.removeEventListener("touchmove",A)}),[B]);const D=ye({className:e,isChanging:j,marks:i,max:o,min:u,name:n,step:r,value:N,valueFormatter:t,onChange:f}),A=w=>{const g=p==null?void 0:p.current;if(g){const V=g.getBoundingClientRect().left,I=((w.type==="touchmove"||w.type==="touchstart"?w.touches[0].clientX:w.clientX)-V)/g.offsetWidth*100;X({pourcent:I})}},X=({pourcent:w,value:g})=>{if(w){if(w>=100){L(a(!0)),C(100);return}if(w<=0){L(y(!0)),C(0);return}g=b(w),g==y()&&(g=y(!0)),g==a()&&(g=a(!0))}else if(g!=null){if(g>=a()){L(a(!0)),C(100);return}if(g<=y()){L(y(!0)),C(0);return}w=v(g)}else return;r!=null?g=Math.round((g-y())/r)*r+y():i&&(g=i.reduce((V,$,I)=>{let W=$.value===1/0?a():$.value===-1/0?y():$.value,F=V.value===1/0?a():V.value===-1/0?y():V.value;return W=Math.abs(W-g),F=Math.abs(F-g),W<F?$:V}).value),g>=a()&&(g=a(!0)),g<=y()&&(g=y(!0)),w=v(g),L(g),C(w),f&&f(g)},[G,U]=c.useState(0);c.useEffect(()=>{const w=()=>{p.current&&U(p.current.offsetWidth)};return w(),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)}},[]);const _=w=>{switch(w.key){case"ArrowRight":if(r)X({value:N+r});else if(i){const g=i.find(V=>V.value>N);g&&X({value:g.value})}break;case"ArrowLeft":if(r)X({value:N-r});else if(i){const g=i.slice(0).reverse().find((V,$,I)=>N===1/0?$===1:V.value<N);g&&X({value:g.value})}break;default:return}};return l.jsxs("div",{tabIndex:0,onKeyDown:_,role:"slider","aria-valuemin":y(!0),"aria-valuemax":a(!0),"aria-valuenow":N,"aria-valuetext":N.toString(),className:D.slider,onMouseDown:M,onClick:A,ref:p,onTouchStart:M,onDragStart:w=>w.preventDefault(),...h,children:[l.jsx("input",{type:"hidden",name:n,value:N}),l.jsx("div",{className:D.activeTrack,style:{flex:R/100}}),l.jsx("div",{className:D.handle,children:l.jsx(k.AnimatePresence,{children:j&&l.jsx(k.motion.div,{className:D.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(N):N})})}),l.jsx("div",{className:D.inactiveTrack,style:{flex:1-R/100}}),l.jsx("div",{className:"w-[calc(100%-12px)] h-full absolute -translate-x-1/2 transform left-1/2",children:i&&i.map((w,g)=>{let V=null;const $=(j?9:10)/G*100,I=v(w.value);return I<=R-$?V=!0:I>=R+$&&(V=!1),l.jsx("div",{className:d(D.dot,{"bg-primary-container":V!=null&&V,"bg-primary":V!=null&&!V}),style:{left:`${v(w.value)}%`}},g)})})]})};/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),se=require("clsx"),Be=require("tailwind-merge"),c=require("react"),R=require("motion/react"),Pe=require("throttle-debounce"),De=require("react-dom"),We=require("react-textarea-autosize"),le=Be.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"]}}}),d=(...e)=>le(se.clsx(e)),oe=(...e)=>le(se.clsx(e));function $e(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 ae=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 u=r(e.states);Object.entries(u).map(l=>{const[i,m]=l;(t[i]??(t[i]=[])).push(m)})}});const n=t;return Object.entries(t).map(r=>{let[s,u]=r;u=u.reverse(),s==e.default&&u.unshift("relative"),u.unshift($e(s)),n[s]=oe(...u)}),n},X=(e,t)=>n=>ae({classNameList:[n.className,t],default:e,states:n}),ce=X("button",({variant:e,disabled:t,iconPosition:n,icon:r,loading:s,shape:u,size:l,allowShapeTransformation:i})=>({button:d("group flex items-center cursor-pointer",l==="xSmall"&&"py-2",l==="small"&&"py-1",e==="text"&&[l==="xSmall"&&"-my-2",l==="small"&&"-my-1"]),container:d(" relative outline-none overflow-hidden inline-block flex justify-center items-center ",l==="xSmall"&&"text-label-large px-3 py-1.5 gap-1",l==="small"&&"text-label-large px-4 py-2.5 gap-2",l==="medium"&&"text-title-medium px-6 py-4 gap-2",l==="large"&&"text-headline-small px-12 py-8 gap-3",l==="xLarge"&&"text-headline-large px-16 py-12 gap-4",u==="rounded"&&{"rounded-[30px]":l==="xSmall"||l=="small","rounded-[40px]":l==="medium","rounded-[70px]":l==="large"||l=="xLarge"},u==="squared"&&{"rounded-[12px]":l==="xSmall"||l=="small","rounded-[16px]":l==="medium","rounded-[28px]":l==="large"||l=="xLarge"},i&&!t&&{"group-active:rounded-[12px]":l==="xSmall"||l=="small","group-active:rounded-[16px]":l==="medium","group-active:rounded-[28px]":l==="large"||l=="xLarge"},e==="elevated"&&{"bg-surface-container-low shadow-1 hover:shadow-2":!t},e==="filled"&&{"bg-primary hover:shadow-1":!t},e==="filledTonal"&&{"bg-secondary-container hover:shadow-1":!t},e==="outlined"&&[" border",{"border-on-surface/[0.12]":t," border-outline focus:border-primary":!t}],e==="text"&&["w-fit",{"text-primary":!t,"text-on-surface/[0.38]":t},l==="xSmall"&&"-mx-3 ",l==="small"&&"-mx-4 ",l==="medium"&&"-mx-6 ",l==="large"&&"-mx-12",l==="xLarge"&&"-mx-16 "],t&&"cursor-default"),stateLayer:d("state-layer min-h-full min-w-full absolute top-0 left-0 ",e==="elevated"&&{"bg-on-surface/[0.12]":t,"group-state-primary":!t},e==="filled"&&{"bg-on-surface/[0.12]":t,"group-state-on-primary":!t},e==="filledTonal"&&{"bg-on-surface/[0.12]":t,"group-state-on-secondary-container ":!t},e==="outlined"&&{"group-state-primary group-state-primary":!t},e==="text"&&{"group-state-primary":!t}),label:d({invisible:s},e==="elevated"&&{"text-primary":!t,"text-on-surface/[38%]":t},e==="filled"&&{"text-on-primary":!t,"text-on-surface/[38%]":t},e==="filledTonal"&&{"text-on-secondary-container":!t,"text-on-surface/[0.38]":t},e==="outlined"&&{"text-primary":!t,"text-on-surface/[0.38]":t},e==="text"&&{"text-primary":!t,"text-on-surface/[0.38]":t}),icon:d({invisible:s},l==="xSmall"&&"size-5",l==="small"&&"size-5",l==="medium"&&"size-6",l==="large"&&"size-8",l==="xLarge"&&"size-10",e==="elevated"&&{"text-primary":!t,"text-on-surface/[38%]":t},e==="filled"&&{"text-on-primary":!t,"text-on-surface/[38%]":t},e==="filledTonal"&&{"text-on-secondary-container":!t,"text-on-surface/[0.38]":t},e==="outlined"&&{"text-primary":!t,"text-on-surface/[0.38]":t},e==="text"&&{"text-primary":!t,"text-on-surface/[0.38]":t})})),ie=X("card",({variant:e,isInteractive:t})=>({card:d("card group/card rounded-xl overflow-hidden z-10",e==="outlined"&&"bg-surface",e==="elevated"&&"bg-surface-container-low shadow-1",e==="filled"&&"bg-surface-container-highest",e!=="filled"&&"border border-outline-variant"),stateLayer:d(["w-full top-0 left-0 h-full absolute -z-10",{" group-hover/card:hover-state-on-surface group-focus-visible/card:focus-state-on-surface":t}])})),ue=X("carouselItem",()=>({carouselItem:d("rounded-[28px] overflow-hidden flex-none")})),fe=X("carousel",()=>({carousel:d(["w-full h-[400px]"]),track:d("grid grid-flow-col h-full transition-transform ease-out w-fit")})),de=X("divider",({orientation:e})=>({divider:d("border-outline-variant ",{"h-fit w-full border-t":e==="horizontal"},{"h-auto self-stretch w-fit border-l":e==="vertical"})})),me=X("fab",({size:e,variant:t,isExtended:n})=>({fab:d("flex shadow-3 hover:shadow-4 group overflow-hidden outline-none items-center cursor-pointer",{"rounded-[12px]":e=="small"&&!n,"rounded-[16px]":e=="medium"||n,"rounded-[28px]":e=="large"&&!n},{"p-2":e=="small"&&!n,"p-4":e=="medium"||n,"p-[30px]":e=="large"&&!n},t==="surface"&&"bg-surface-container",t==="primary"&&"bg-primary-container",t==="secondary"&&"bg-secondary-container",t==="tertiary"&&"bg-tertiary-container"),stateLayer:d("absolute w-full h-full overflow-hidden left-1/2 top-1/2 transform -translate-y-1/2 -translate-x-1/2",t==="surface"&&"group-hover:hover-state-primary group-focus:focus-state-primary",t==="primary"&&"group-hover:hover-state-on-primary-container group-focus-visible:focus-state-on-primary-container",t==="secondary"&&"group-hover:hover-state-on-secondary-container group-focus-visible:focus-state-on-secondary-container",t==="tertiary"&&"group-hover:hover-state-on-tertiary-container group-focus-visible:focus-state-on-tertiary-container"),icon:d({"size-6":e=="small"||e=="medium"||n,"size-9":e=="large"&&!n},t==="surface"&&"text-primary",t==="primary"&&"text-on-primary-container",t==="secondary"&&"text-on-secondary-container",t==="tertiary"&&"text-on-tertiary-container"),label:d("text-title-medium text-nowrap",t==="surface"&&"text-primary",t==="primary"&&"text-on-primary-container",t==="secondary"&&"text-on-secondary-container",t==="tertiary"&&"text-on-tertiary-container")})),pe=X("iconButton",({variant:e,disabled:t,onToggle:n,isActive:r,size:s,width:u,shape:l,allowShapeTransformation:i})=>({iconButton:d("group min-h-12 flex items-center cursor-pointer",{"cursor-default":t}),container:d("rounded-full relative flex overflow-hidden transition-all duration-300",(l==="rounded"||l==="squared"&&n&&!t&&r&&i)&&{"rounded-[30px]":s==="xSmall"||s=="small","rounded-[40px]":s==="medium","rounded-[70px]":s==="large"||s=="xLarge"},(l==="squared"||l==="rounded"&&n&&!t&&r&&i)&&{"rounded-[12px]":s==="xSmall"||s=="small","rounded-[16px]":s==="medium","rounded-[28px]":s==="large"||s=="xLarge"},i&&!t&&{"group-active:rounded-[12px]":s==="xSmall"||s=="small","group-active:rounded-[16px]":s==="medium","group-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-surface-container":!r&&!!n,"bg-secondary-container":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}]),stateLayer:d("absolute top-0 left-0 h-full w-full ",!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:d(" 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"},u=="narrow"&&[{"px-1":s==="xSmall"},{"px-1":s==="small"},{"px-3":s==="medium"},{"px-4":s==="large"},{"px-8":s==="xLarge"}],u=="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==="tonal"&&{"text-on-surface-variant":!r&&!!n,"text-on-secondary-container":r||!n},e==="outlined"&&{"text-on-surface-variant":!r,"text-inverse-on-surface":r}],!!t&&"text-on-surface/[0.38]")})),he=X("progressIndicator",({variant:e,isVisible:t})=>({progressIndicator:d((e==="linear-determinate"||e=="linear-indeterminate")&&"flex w-full"),track:"h-full rounded-full bg-primary rounded-l-full",activeIndicator:d((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:"absolute right-0 bg-primary rounded-full"})),xe=X("slider",({isChanging:e})=>({slider:d(["relative w-full h-11 flex items-center rounded gap-x-1.5 cursor-pointer"]),activeTrack:d(["h-4 relative transition-all duration-100 bg-primary overflow-hidden rounded-l-full "]),inactiveTrack:d(["h-4 relative transition-all duration-100 bg-primary-container rounded-r-full overflow-hidden"]),handle:d(["transform transition-all duration-100 bg-primary h-full rounded-full ",{"w-0.5":e,"w-1":!e}]),valueIndicator:d(["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:d(["h-1 w-1 absolute transform -translate-y-1/2 -translate-x-1/2 top-1/2 rounded-full"])})),ye=X("snackbar",()=>({snackbar:d(" rounded bg-inverse-surface "),container:d("pl-4 pr-2 max-w-full py-1 flex items-center flex-wrap"),supportingText:d("text-body-medium text-inverse-on-surface "),icon:d(" ml-auto mr-0 text-inverse-on-surface block dark")})),ge=X("switch",({isSelected:e,disabled:t,inactiveIcon:n})=>({switch:d("group 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:d("flex items-center justify-center absolute",{"left-[14px]":!e},{"right-[14px]":e}),handle:d("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:h-[28px] group-active:w-[28px]",{"bg-on-primary group-hover:bg-primary-container":e},{"bg-outline group-hover:bg-on-surface-variant":!e}],{"bg-surface":t}),handleStateLayer:d("w-[40px] h-[40px] -z-10 rounded-full absolute",{"group-state-primary":!t}),icon:d("w-[16px] h-[16px]",!t&&[{"text-on-primary-container":e},{"text-on-primary":!e}],{"text-on-surface/[0.38]":t})})),we=X("tab",({isSelected:e,icon:t,label:n,variant:r})=>({tab:d("bg-surface flex-1 group 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:d("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:hover-state-on-surface group-focus-visible:focus-state-on-surface":!e,"group-hover:hover-state-primary group-focus-visible:focus-state-primary":e},r==="secondary"&&"group-hover:hover-state-on-surface group-focus-visible:focus-state-on-surface"),content:d("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:d("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:d("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:d("bg-primary absolute w-full left-0 bottom-0",r==="primary"&&"h-[3px] rounded-t",r==="secondary"&&"h-0.5")})),ve=X("tabs",({scrollable:e})=>({tabs:d("border-b border-surface-container-highest","flex relative ",{"overflow-x-auto":e})})),be=X("textField",({disabled:e,leadingIcon:t,trailingIcon:n,variant:r,errorText:s,isFocused:u,value:l,suffix:i,textLine:m})=>({textField:d({"opacity-[.38]":e}),content:d("group transition-border duration-200 relative flex items-center ",{"h-14":m=="singleLine"},{"border-on-surface-variant":!(s!=null&&s.length)&&!u&&r=="filled","border-outline":!(s!=null&&s.length)&&!u&&r=="outlined","border-primary":!(s!=null&&s.length)&&u,"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]":u}]),stateLayer:d("absolute -z-10 w-full h-full top-0 left-0",{hidden:r=="outlined"},{"group-state-on-surface":!e,"focus-state-on-surface":u}),label:d("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)&&u}),input:d("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":!!i},r=="filled"&&" pb-2 pt-6",r=="outlined"&&"py-4 relative z-10"),activeIndicator:d("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":u}]),supportingText:d(" text-body-small px-4 pt-1",{"text-on-surface-variant":!e&&!(s!=null&&s.length)},{"text-on-surface":e},{"!w-full":u},{"text-error":!!(s!=null&&s.length)}),leadingIcon:d(["h-12 ml-3 flex items-center justify-center",{"cursor-text":!c.isValidElement(t)}]),trailingIcon:d("h-12 w-12 flex items-center justify-center",{"cursor-text":!c.isValidElement(n)}),suffix:d("text-on-surface-variant pl-0 pr-4",r=="filled"&&" pb-2 pt-6",r=="outlined"&&"py-4 relative z-10")})),je=X("toolTip",({position:e,variant:t})=>({toolTip:d(" pointer-events-auto w-max z-10 absolute m-1 w-max-content max-w-[312px]",{"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:d("pb-2",t=="rich"&&"bg-surface-container rounded-2xl text-on-surface-container px-4 pt-3 shadow-2",t=="plain"&&"bg-inverse-surface rounded text-inverse-on-surface px-2 py-1"),actions:d("flex gap-10 px-1 mt-2",t=="plain"&&"hidden"),subHead:d("text-title-small mb-1",t=="plain"&&"hidden"),supportingText:d("")})),H=({icon:e,colors:t=[],className:n})=>{const{icon:r}=e,[s,u,,,l]=r||[],i=m=>{switch(m.length){case 2:return{"--fa-primary-color":m[0]||"inherit","--fa-secondary-color":m[1]||"inherit"};case 1:return{color:m[0]};default:return{}}};return o.jsx("svg",{className:d("size-5 box-content",n),style:{...i(t)},xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${s} ${u}`,role:"img","aria-hidden":"true",children:typeof l=="string"?o.jsx("path",{className:"fill-current",d:l}):l.map((m,f)=>o.jsx("path",{d:m},f))})},Ne=({variant:e="linear-determinate",minHeight:t=4,value:n=0,transitionDuration:r=1e3,className:s,...u})=>{const[l,i]=c.useState(n),[m,f]=c.useState(1.5);c.useEffect(()=>{n>100&&(n=100),n<0&&(n=0),i(n)},[n]);const[w,v]=c.useState(!0),a=()=>w?m:m*.5;c.useEffect(()=>{if((e==="circular-indeterminate"||e==="linear-indeterminate")&&l!==100){const S=setInterval(()=>{i(w?10:90),v(!w)},a()*1e3);return()=>clearInterval(S)}},[e,w,l]);const[h,b]=c.useState(!1);c.useEffect(()=>{if(l>=100){const S=setTimeout(()=>{b(!1)},r);return()=>{clearTimeout(S)}}else b(!0)},[l,r]);const j=he({className:s,variant:e,value:n,transitionDuration:r,isVisible:h,minHeight:t});return o.jsxs(o.Fragment,{children:[(e==="linear-determinate"||e=="linear-indeterminate")&&o.jsxs("div",{style:{height:`${t}px`},className:j.progressIndicator,...u,children:[o.jsx("div",{style:{height:h?`${t}px`:"0px",width:`${l}%`,transition:`width 1ms ease-in-out ${l==100?", height 200ms 0.5s ease-in-out":""}`},className:j.track}),o.jsx("div",{style:{height:h?`${t}px`:"0px",marginLeft:l!=100?"6px":"0px",transition:`width ${r}ms ease-in-out ${l==100?`, height 200ms 0.5s ease-in-out, margin-left ${r}ms ${r/1.5}ms`:""}`},className:j.activeIndicator}),o.jsx("div",{style:{height:h?`${t}px`:"0px",width:`${t}px`,transition:`width ${r}ms ease-in-out, height 200ms 0.5s ease-in-out`},className:j.stop})]}),(e==="circular-determinate"||e=="circular-indeterminate")&&o.jsx(R.motion.svg,{width:"48",height:"48",viewBox:"0 0 48 48",initial:{rotate:-90},animate:{rotate:270},transition:{repeat:1/0,duration:a(),ease:"linear"},className:j.progressIndicator,...u,children:o.jsx(R.motion.circle,{cx:"50%",cy:"50%",r:h?"calc(50% - 2px)":"50%",style:{strokeLinecap:"round"},initial:"hidden",animate:"visible",className:j.activeIndicator,variants:{hidden:{pathLength:w?10/100:90/100},visible:{pathLength:w?90/100:10/100}},transition:{pathLength:{type:"tween",ease:"linear",duration:a(),bounce:0}}})},w+"")]})},Z=({colorName:e="on-surface",triggerRef:t})=>{const n={initial:{opacity:0,borderRadius:"50%",width:"25%",height:"25%"},animate:{opacity:1,borderRadius:0,width:"200%",height:"200%",transition:{duration:.3,borderRadius:{duration:.3,delay:.3}}}},[r,s]=c.useState(!0),[u,l]=c.useState(!1),[i,m]=c.useState({x:0,y:0});c.useEffect(()=>{u&&(s(!0),s(!1))},[u]),c.useEffect(()=>{const a=t==null?void 0:t.current;if(a)return a.addEventListener("mousedown",f),a.addEventListener("mouseup",v),a.addEventListener("mouseleave",w),()=>{a.removeEventListener("mousedown",f),a.removeEventListener("mouseup",v),a.removeEventListener("mouseleave",w)}},[t]);const f=a=>{const h=t==null?void 0:t.current,b=h.getBoundingClientRect();l(!0),m({x:(a.clientX-b.left)/h.clientWidth*100,y:(a.clientY-b.top)/h.clientHeight*100})},w=a=>{l(!1)},v=a=>{l(!1)};return o.jsx(R.AnimatePresence,{mode:"wait",children:(u||!u&&!r)&&o.jsx(R.motion.div,{style:{position:"absolute",width:"100%",height:"100%",top:i.y+"%",left:i.x+"%",background:`color-mix(in srgb, var(--color-${e}) 12%, transparent)`,pointerEvents:"none"},variants:n,initial:"initial",animate:"animate",exit:{opacity:0,transition:{duration:0}},onAnimationComplete:()=>s(!0),className:"transform -translate-x-1/2 -translate-y-1/2"})})},Se=X("customScroll",({orientation:e,draggable:t,isDragging:n})=>({customScroll:d("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:d("overflow-hidden flex-none sticky",{"left-0 h-full":e==="horizontal","top-0 w-full":e==="vertical"})})),T=({children:e,orientation:t="vertical",scrollSize:n,onScroll:r,className:s,draggable:u=!1,throttleDuration:l=75})=>{var V,W;const i=c.useRef(null),m=c.useRef(null),[f,w]=c.useState({width:null,height:null});c.useEffect(()=>{if(!i.current)return;const L=new ResizeObserver($=>{for(const F of $)F.target===i.current&&w({width:F.contentRect.width,height:F.contentRect.height})});return L.observe(i.current),()=>{L.disconnect()}},[i]);const v=c.useRef(null),a=c.useRef(null),h=()=>{const L=m.current;return L?{width:n??L.scrollWidth,height:n??L.scrollHeight}:null},b=()=>{const L=i.current;return L?{width:L.clientWidth,height:L.clientHeight}:null},{scrollYProgress:j,scrollXProgress:S}=R.useScroll({container:i}),E=c.useRef(null);E.current||(E.current=Pe.throttle(l,(L,$)=>{!a.current||!v.current||r&&(t==="horizontal"&&$==="x"&&r({scrollProgress:L,scroll:L*v.current.width,scrollTotal:v.current.width,scrollVisible:a.current.width}),t==="vertical"&&$==="y"&&r({scrollProgress:L,scroll:L*v.current.height,scrollTotal:v.current.height,scrollVisible:a.current.height}))}));const y=(L,$)=>{E.current&&E.current(L,$)};c.useEffect(()=>{f.width&&y(S.get(),"x"),f.height&&y(j.get(),"y")},[f]),R.useMotionValueEvent(S,"change",L=>{y(L,"x")}),R.useMotionValueEvent(j,"change",L=>{y(L,"y")});const[N,I]=c.useState(!1);c.useLayoutEffect(()=>{N||!a.current||!v.current||!r||(r({scrollProgress:0,scroll:0,scrollTotal:t=="vertical"?v.current.height:v.current.width,scrollVisible:t=="vertical"?a.current.height:a.current.width}),I(!0))},[a,v,r]),v.current=h(),a.current=b();const[M,C]=c.useState(!1),B=Se({isDragging:M,children:e,className:s,onScroll:r,orientation:t,scrollSize:n,draggable:u,throttleDuration:l}),[P,k]=c.useState(0),[p,D]=c.useState(0),A=L=>{if(!u)return;const $=i.current;if(!$||P==null)return;const K=(L.pageX-$.offsetLeft-P)*1.5;$.scrollLeft=p-K},q=L=>{const $=i.current;$&&(C(!0),k(L.pageX-$.offsetLeft),D($.scrollLeft))},G=L=>{M&&(L.preventDefault(),A(L))},U=()=>{C(!1)},Y=()=>{C(!1)},g=L=>{L.preventDefault()},x=c.useRef(null);return c.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]),o.jsxs("div",{className:B.customScroll,ref:i,onMouseDown:q,onMouseMove:G,onMouseUp:U,onMouseLeave:Y,onDragStart:g,onScroll:L=>{M||(k(null),C(!0),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{C(!1)},1e3))},children:[o.jsx("div",{ref:m,style:t==="vertical"?{height:((V=a==null?void 0:a.current)==null?void 0:V.height)??"100%"}:{width:((W=a==null?void 0:a.current)==null?void 0:W.width)??"100%"},className:B.track,children:e}),a.current&&v.current&&o.jsxs(o.Fragment,{children:[t==="vertical"&&v.current.height>a.current.height&&o.jsx(R.motion.div,{className:"flex-none",style:{height:v.current.height-a.current.height}}),t==="horizontal"&&v.current.width>a.current.width&&o.jsx(R.motion.div,{className:"flex-none",style:{width:v.current.width-a.current.width}})]})]})},Fe=({children:e,transition:t=".5s",orientation:n="vertical",throttleDuration:r=25,...s})=>{const[u,l]=c.useState(null),i=R.motionValue((u==null?void 0:u.scrollProgress)??0),m=R.useTransform(i,[0,1],[0,1-((u==null?void 0:u.scrollVisible)??0)/((u==null?void 0:u.scrollTotal)??0)]),f=R.useTransform(m,a=>`${-a*100}%`),w=a=>{i.set(a.scrollProgress),a.scrollTotal>0&&l(a)},v=c.useRef(null);return R.useMotionValueEvent(f,"change",a=>{const h=performance.now();if(v.current!==null){const b=h-v.current;console.log(`Delta temps : ${b} ms`)}v.current=h,console.log(a)}),o.jsx(T,{onScroll:w,throttleDuration:r,...s,children:o.jsx(R.motion.div,{className:d("transition-transform ease-out",{"w-fit h-full":n==="horizontal","h-fit w-full":n==="vertical"}),style:{transitionDuration:t,...n=="vertical"?{y:f}:{x:f}},children:e})})},Ee=({targetRef:e,children:t})=>{const[n,r]=c.useState(null),s=c.useRef(null),u=()=>{const l=e.current;if(!l)return;const i=l.getBoundingClientRect();console.log(l),r({position:"fixed",top:i.top,left:i.left,width:i.width,height:i.height,pointerEvents:"none",zIndex:999})};return c.useEffect(()=>{const l=e.current;if(l)return u(),window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),s.current=new ResizeObserver(u),s.current.observe(l),()=>{var i;window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u),(i=s.current)==null||i.disconnect()}},[e]),n?De.createPortal(o.jsx("div",{style:n,children:t}),document.body):null},Le=({variant:e="filled",disabled:t=!1,icon:n,href:r,label:s,className:u,iconPosition:l="left",loading:i=!1,shape:m="rounded",onClick:f,ref:w,size:v="medium",allowShapeTransformation:a=!0,transition:h,...b})=>{const j=r?"a":"button",S=c.useRef(null),E=w||S,y=ce({allowShapeTransformation:a,size:v,shape:m,href:r,disabled:t,icon:n,iconPosition:l,label:s,loading:i,variant:e,transition:h,className:u}),N=n?o.jsx(H,{icon:n,className:y.icon}):o.jsx(o.Fragment,{});return h={duration:.3,...h},o.jsx(j,{ref:E,href:r,className:y.button,...b,onClick:I=>{t?I.preventDefault():f&&f(I)},disabled:t,children:o.jsxs("div",{className:y.container,style:{transition:h.duration+"s"},children:[o.jsx("div",{className:y.stateLayer,children:!t&&o.jsx(Z,{colorName:e==="elevated"&&"primary"||e==="filled"&&"on-primary"||e==="filledTonal"&&"on-secondary-container"||e==="outlined"&&"primary"||e==="text"&&"primary"||"",triggerRef:E})}),l==="left"&&N,i&&o.jsx("div",{className:"!absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2",children:o.jsx(Ne,{className:()=>({progressIndicator:"h-6 w-6",activeIndicator:d({"!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==="filledTonal"&&!t,"!stroke-on-surface/[38%]":e==="filledTonal"&&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"})}),o.jsx("span",{className:y.label,children:s}),l==="right"&&N]})})},Ue=({variant:e="outlined",className:t,children:n,isInteractive:r=!1,ref:s,...u})=>{const l=ie({className:t,isInteractive:r,variant:e}),i=c.useRef(null),m=s||i;return o.jsxs("div",{...u,ref:m,className:l.card,children:[o.jsx("div",{className:l.stateLayer,children:r&&o.jsx(Z,{colorName:"on-surface",triggerRef:m})}),n]})},Re=(e,t,n=[0,1])=>{const[r,s]=t,[u,l]=n,m=(Math.max(r,Math.min(e,s))-r)/(s-r);return u+m*(l-u)},Ie=({className:e,children:t,width:n=1,index:r=0,ref:s,...u})=>{const l=c.useRef(null),i=s||l,m=ue({className:e,index:r,width:n,children:t});return o.jsx(R.motion.div,{ref:i,animate:{width:n+"px"},transition:{duration:.5,ease:"linear"},className:m.carouselItem,...u,children:t})},Xe=({variant:e="hero",className:t,children:n,ref:r,marginPourcent:s=0,inputRange:u=[.21,.65],outputRange:l=[42,300],gap:i=8,onChange:m,scrollSensitivity:f=1.25,...w})=>{var U,Y;const v=c.useRef(null),a=r||v,h=fe({className:t,children:n,variant:e,inputRange:u,outputRange:l,marginPourcent:s,onChange:m,gap:i,scrollSensitivity:f}),b=c.Children.toArray(n).filter(g=>c.isValidElement(g)&&g.type===Ie),j=c.useRef(null),[S,E]=c.useState([]),[y,N]=c.useState(null),I=()=>{var $;if(!j.current||!a.current||!y)return[];const{scrollVisible:g,scrollProgress:x}=y;function V(F,K){return F.map(_=>(_-K)/Math.abs(F[1]-F[0]))}let W=b.map((F,K)=>{if(!M[K].current||!j.current)return 0;let J=K/(b.length-1);return J>1&&(J=1),J<0&&(J=0),J});W=V(W,x);let L=(((($=a.current)==null?void 0:$.clientWidth)??g)-(l[0]+i))/(l[1]+i);return W.map((F,K)=>({value:Math.abs(F),originalIndex:K})).sort((F,K)=>F.value-K.value).forEach((F,K)=>{K===0&&B(F.originalIndex);let _=Re(L,[0,1],[0,l[1]]);_<l[0]&&(_=l[0]),L--,W[F.originalIndex]=_}),W},M=c.useRef([]).current,[C,B]=c.useState(0);c.useEffect(()=>{m&&m(C)},[C]),M.length!==b.length&&b.forEach((g,x)=>{M[x]||(M[x]=c.createRef())});const P=b.map((g,x)=>c.cloneElement(g,{width:S[x],ref:M[x],key:x,index:x})),k=R.motionValue((y==null?void 0:y.scrollProgress)??0),p=R.useTransform(k,[0,1],[0,1-(((U=a.current)==null?void 0:U.clientWidth)??0)/(((Y=j==null?void 0:j.current)==null?void 0:Y.clientWidth)??0)]),D=R.useTransform(p,g=>`${-g*100}%`),A=g=>{g.scrollTotal>0&&N(g)};c.useEffect(()=>{const g=I();E(g)},[y]);const[q,G]=c.useState(0);return c.useLayoutEffect(()=>{let g=l[1];y&&g>y.scrollVisible&&(g=y.scrollVisible);const x=(g+i)*P.length/f;G(x)},[a,M,y]),o.jsx("div",{className:h.carousel,ref:a,...w,children:o.jsx(T,{draggable:!0,orientation:"horizontal",onScroll:A,scrollSize:q,children:o.jsx(R.motion.div,{className:h.track,ref:j,style:{transitionDuration:"0.5s",transitionTimingFunction:"ease-out",gap:`${i}px`,x:D},children:P})})})},qe=({orientation:e="horizontal",className:t,...n})=>{const r=de({orientation:e,className:t});return o.jsx("hr",{className:r.divider,...n})},O=[];for(let e=0;e<256;++e)O.push((e+256).toString(16).slice(1));function Oe(e,t=0){return(O[e[t+0]]+O[e[t+1]]+O[e[t+2]]+O[e[t+3]]+"-"+O[e[t+4]]+O[e[t+5]]+"-"+O[e[t+6]]+O[e[t+7]]+"-"+O[e[t+8]]+O[e[t+9]]+"-"+O[e[t+10]]+O[e[t+11]]+O[e[t+12]]+O[e[t+13]]+O[e[t+14]]+O[e[t+15]]).toLowerCase()}let Q;const Ae=new Uint8Array(16);function Ge(){if(!Q){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Q=crypto.getRandomValues.bind(crypto)}return Q(Ae)}const Ke=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),re={randomUUID:Ke};function ee(e,t,n){var s;if(re.randomUUID&&!e)return re.randomUUID();e=e||{};const r=e.random??((s=e.rng)==null?void 0:s.call(e))??Ge();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,Oe(r)}const te=({variant:e="plain",buttons:t,className:n,children:r,title:s,text:u,position:l,targetRef:i,ref:m,trigger:f=["hover","focus"],...w})=>{if(!r&&!i)throw new Error("ToolTip must have a child or a targetRef");Array.isArray(f)||(f=[f]),t&&!Array.isArray(t)&&(t=[t]);const v=c.useRef(null),a=i||v,[h,b]=c.useState(null),[j]=c.useState(ee()),[S,E]=c.useState(!1),y=c.useRef(null);c.useEffect(()=>{const p=D=>{b(D.detail)};return document.addEventListener("tooltip-update",p),()=>{document.removeEventListener("tooltip-update",p)}},[]),c.useEffect(()=>{y.current&&clearTimeout(y.current),h?E(h===j):y.current=setTimeout(()=>{E(!1)},1200)},[h,j]);const N=()=>{if(f.includes("hover")){const p=new CustomEvent("tooltip-update",{detail:j});document.dispatchEvent(p)}},I=()=>{if(f.includes("hover")){const p=new CustomEvent("tooltip-update",{detail:null});document.dispatchEvent(p)}},M=()=>{if(f.includes("click")){const p=new CustomEvent("tooltip-update",{detail:S?null:j});document.dispatchEvent(p)}},C=()=>{if(f.includes("focus")){const p=new CustomEvent("tooltip-update",{detail:j});document.dispatchEvent(p)}},B=()=>{if(f.includes("focus")){const p=new CustomEvent("tooltip-update",{detail:null});document.dispatchEvent(p)}};c.useEffect(()=>{if(a!=null&&a.current){const p=a.current;return p.addEventListener("mouseenter",N),p.addEventListener("mouseleave",I),p.addEventListener("click",M),p.addEventListener("focus",C),p.addEventListener("blur",B),()=>{p.removeEventListener("mouseenter",N),p.removeEventListener("mouseleave",I),p.removeEventListener("click",M),p.removeEventListener("focus",C),p.removeEventListener("blur",B)}}},[a,f,j,S]);const P=!i&&c.isValidElement(r)?c.cloneElement(r,{ref:v}):r;if(!l&&typeof window<"u"&&a!=null&&a.current&&!l){const p=a.current.getBoundingClientRect(),D=window.innerWidth,A=window.innerHeight,q=p.left/D,G=p.top/A;e==="plain"?q<1/3?l="right":q>2/3?l="left":l=G>.5?"top":"bottom":q<1/2&&G<1/2?l="bottom-right":q>1/2&&G<1/2?l="bottom-left":q>1/2&&G>1/2?l="top-left":q<1/2&&G>1/2&&(l="top-right")}const k=je({variant:e,buttons:t,className:n,title:s,text:u,position:l,trigger:f,targetRef:i,children:r});return o.jsxs(o.Fragment,{children:[P,o.jsx(R.AnimatePresence,{children:S&&o.jsx(Ee,{targetRef:a,children:o.jsx(R.motion.div,{initial:{opacity:h?1:0},animate:{opacity:1},transition:{duration:h?0:.3},exit:{opacity:h?1:0},className:k.toolTip,...w,onMouseEnter:N,onMouseLeave:I,children:o.jsxs(R.motion.div,{className:k.container,layoutId:"tool-tip",transition:{type:"spring",stiffness:200,damping:20},children:[s&&o.jsx("div",{className:k.subHead,children:s}),o.jsx("div",{className:k.supportingText,children:u}),t&&o.jsx("div",{className:k.actions,children:Array.isArray(t)&&t.map((p,D)=>o.jsx(Le,{size:"small",variant:"text",...p},D))})]})})})})]})},z=({className:e,label:t,variant:n="primary",size:r="medium",href:s,type:u,icon:l,isExtended:i=!1,ref:m,transition:f,...w})=>{const v=s?"a":"button",a=me({href:s,icon:l,isExtended:i,label:t,size:r,variant:n,className:e,transition:f});f={duration:.3,...f};const h=c.useRef(null),b=m||h,j={visible:{width:"auto",marginLeft:12,opacity:1,transition:{...f,opacity:{duration:f.duration/2,delay:f.duration-f.duration/2}}},hidden:{width:0,marginLeft:0,opacity:0,transition:{...f,marginLeft:{duration:f.duration/2,delay:f.duration-f.duration/2}}}};return o.jsxs(v,{...w,ref:b,href:s,"aria-label":i?void 0:t,className:a.fab,children:[o.jsx(te,{trigger:i?null:void 0,text:t,targetRef:b}),o.jsx("span",{className:a.stateLayer,children:o.jsx(Z,{colorName:d({primary:n=="surface","on-primary-container":n=="primary","on-secondary-container":n=="secondary","on-tertiary-container":n=="tertiary"}),triggerRef:b})}),o.jsx(H,{icon:l,className:a.icon}),o.jsx(R.AnimatePresence,{children:i&&o.jsx(R.motion.span,{variants:j,initial:"hidden",animate:"visible",exit:"hidden",className:a.label,children:t})})]})},ne=({variant:e="standard",href:t,disabled:n=!1,type:r="button",title:s,arialLabel:u,onToggle:l,activated:i=!1,onClick:m,icon:f,size:w="medium",iconSelected:v,className:a,ref:h,width:b="default",shape:j="rounded",allowShapeTransformation:S=!0,transition:E,...y})=>{s||(s=u);const[N,I]=c.useState(i);let M;l?l&&(M=p=>{n&&p.preventDefault(),I(!N),l(!!N)},f=N&&v||f):M=p=>{n&&p.preventDefault(),m&&m(p)},c.useEffect(()=>{I(i)},[i]);const C=t?"a":"button",B=pe({transition:E,shape:j,allowShapeTransformation:S,width:b,href:t,activated:i,arialLabel:u,iconSelected:v,isActive:N,onToggle:l,disabled:n,icon:f,variant:e,className:a,size:w,...y}),P=c.useRef(null),k=h||P;return E={duration:.3,...E},o.jsxs(C,{disabled:n,href:t,className:B.iconButton,"aria-label":u,...y,title:void 0,onClick:M,ref:k,children:[o.jsx(te,{targetRef:k,trigger:n?null:void 0,text:s}),o.jsxs("div",{style:{transition:E.duration+"s"},className:B.container,children:[o.jsx("div",{className:B.stateLayer,children:!n&&o.jsx(Z,{colorName:d(e==="standard"&&{"on-surface-variant":!N,primary:N},e==="filled"&&{primary:!N&&!!l,"inverse-on-surface":N||!l},e==="tonal"&&{"on-surface-variant":!N&&!!l,"on-secondary-container":N||!l},e==="outlined"&&{"on-surface-variant":!N,"on-primary":N}),triggerRef:k})}),f&&o.jsx(H,{icon:f,className:B.icon})]})]})},He=({className:e,valueFormatter:t,step:n=10,name:r,value:s=0,min:u=0,max:l=100,marks:i=[{value:0,label:"0"},{value:100,label:"100"}],ref:m,onChange:f,...w})=>{const v=g=>{const x=h(),V=a();return g===1/0?100:g===-1/0?0:(g-x)/(V-x)*100},a=(g=!1)=>g?l:l==1/0?i[(i==null?void 0:i.length)-1].value:l,h=(g=!1)=>g?u:u==-1/0?i[0].value:u,b=g=>{const x=h(!1);return(a(!1)-x)*g/100+x},[j,S]=c.useState(!1),E=c.useRef(null),y=m||E,[N,I]=c.useState(s),[M,C]=c.useState(v(s)),[B,P]=c.useState(!1),k=g=>{P(!0),S(!0),A(g)},p=()=>{P(!1),S(!1)};c.useEffect(()=>(B?(window.addEventListener("mouseup",p),window.addEventListener("mousemove",A),window.addEventListener("touchend",p),window.addEventListener("touchmove",A)):(window.removeEventListener("mouseup",p),window.removeEventListener("mousemove",A),window.removeEventListener("touchend",p),window.removeEventListener("touchmove",A)),()=>{window.removeEventListener("mouseup",p),window.removeEventListener("mousemove",A),window.removeEventListener("touchend",p),window.removeEventListener("touchmove",A)}),[B]);const D=xe({className:e,isChanging:j,marks:i,max:l,min:u,name:r,step:n,value:N,valueFormatter:t,onChange:f}),A=g=>{const x=y==null?void 0:y.current;if(x){const V=x.getBoundingClientRect().left,L=((g.type==="touchmove"||g.type==="touchstart"?g.touches[0].clientX:g.clientX)-V)/x.offsetWidth*100;q({pourcent:L})}},q=({pourcent:g,value:x})=>{if(g){if(g>=100){I(a(!0)),C(100);return}if(g<=0){I(h(!0)),C(0);return}x=b(g),x==h()&&(x=h(!0)),x==a()&&(x=a(!0))}else if(x!=null){if(x>=a()){I(a(!0)),C(100);return}if(x<=h()){I(h(!0)),C(0);return}g=v(x)}else return;n!=null?x=Math.round((x-h())/n)*n+h():i&&(x=i.reduce((V,W,L)=>{let $=W.value===1/0?a():W.value===-1/0?h():W.value,F=V.value===1/0?a():V.value===-1/0?h():V.value;return $=Math.abs($-x),F=Math.abs(F-x),$<F?W:V}).value),x>=a()&&(x=a(!0)),x<=h()&&(x=h(!0)),g=v(x),I(x),C(g),f&&f(x)},[G,U]=c.useState(0);c.useEffect(()=>{const g=()=>{y.current&&U(y.current.offsetWidth)};return g(),window.addEventListener("resize",g),()=>{window.removeEventListener("resize",g)}},[]);const Y=g=>{switch(g.key){case"ArrowRight":if(n)q({value:N+n});else if(i){const x=i.find(V=>V.value>N);x&&q({value:x.value})}break;case"ArrowLeft":if(n)q({value:N-n});else if(i){const x=i.slice(0).reverse().find((V,W,L)=>N===1/0?W===1:V.value<N);x&&q({value:x.value})}break;default:return}};return o.jsxs("div",{tabIndex:0,onKeyDown:Y,role:"slider","aria-valuemin":h(!0),"aria-valuemax":a(!0),"aria-valuenow":N,"aria-valuetext":N.toString(),className:D.slider,onMouseDown:k,onClick:A,ref:y,onTouchStart:k,onDragStart:g=>g.preventDefault(),...w,children:[o.jsx("input",{type:"hidden",name:r,value:N}),o.jsx("div",{className:D.activeTrack,style:{flex:M/100}}),o.jsx("div",{className:D.handle,children:o.jsx(R.AnimatePresence,{children:j&&o.jsx(R.motion.div,{className:D.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(N):N})})}),o.jsx("div",{className:D.inactiveTrack,style:{flex:1-M/100}}),o.jsx("div",{className:"w-[calc(100%-12px)] h-full absolute -translate-x-1/2 transform left-1/2",children:i&&i.map((g,x)=>{let V=null;const W=(j?9:10)/G*100,L=v(g.value);return L<=M-W?V=!0:L>=M+W&&(V=!1),o.jsx("div",{className:d(D.dot,{"bg-primary-container":V!=null&&V,"bg-primary":V!=null&&!V}),style:{left:`${v(g.value)}%`}},x)})})]})};/*!
|
|
2
2
|
* Font Awesome Free 6.7.2 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 2024 Fonticons, Inc.
|
|
5
|
-
*/const Ye={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"]},Ze={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},Me={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]},Je=({supportingText:e,className:t,duration:r,closeIcon:n=Me,onClose:s,...u})=>{const[o,i]=c.useState(!0),m=ge({className:t,closeIcon:n,duration:r,isVisible:o,onClose:s,supportingText:e});c.useEffect(()=>{r&&setTimeout(()=>{f()},r)},[r]);const f=()=>{i(!1),s==null||s()};return l.jsx(k.AnimatePresence,{children:o&&l.jsx(k.motion.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.1},className:m.snackbar,...u,children:l.jsxs("div",{className:m.container,children:[l.jsx("p",{className:m.supportingText,children:e}),l.jsx(ne,{onClick:()=>f(),className:m.icon,icon:n,arialLabel:"close the snackbar"})]})})})},Qe=({selected:e=!1,className:t,activeIcon:r,disabled:n=!1,inactiveIcon:s,onChange:u,onClick:o,onKeyDown:i,ref:m,...f})=>{const[h,v]=c.useState(e),a=p=>{n||(b(),o&&o(p))},y=p=>{n||((p.key===" "||p.key==="Enter")&&(p.preventDefault(),b()),i&&i(p))},b=()=>{v(!h),u==null||u(!h)},j=we({className:t,isSelected:h,activeIcon:r,inactiveIcon:s,disabled:n,selected:h,onChange:u}),S=c.useRef(null),E=m||S;return l.jsxs(k.motion.div,{role:"switch","aria-checked":h,tabIndex:n?-1:0,onKeyDown:y,onClick:a,ref:E,className:j.switch,...f,children:[l.jsx("input",{type:"hidden",value:h?"1":"0"}),l.jsxs(k.motion.div,{layout:!0,style:{translate:h?"50%":"-50%"},transition:{type:"spring",stiffness:700,damping:30},className:j.handleContainer,children:[l.jsx("div",{className:j.handle,children:(h?r:s)&&l.jsx(H,{className:j.icon,icon:h?r:s})}),l.jsx("div",{className:j.handleStateLayer})]})]})},Ce=({className:e,onClick:t,label:r,variant:n="primary",href:s,icon:u,selectedTab:o,setSelectedTab:i,tabsId:m,index:f,onTabSelected:h,scrollable:v=!1,selected:a=!1,ref:y,...b})=>{const j=c.useRef(null),S=y||j,[E,p]=c.useState(a);c.useEffect(()=>{a&&o==null?p(!0):p(o==f&&f!=null)},[o]),c.useEffect(()=>{o==f&&h&&h({ref:S,index:f||0,label:r,icon:u})},[o]);const N=s?"a":"button",L=C=>{i&&i(f??null),t&&t(C)},R=ve({className:e,onTabSelected:h,scrollable:v,selectedTab:o,index:f,tabsId:m,selected:E,variant:n,icon:u,label:r,isSelected:E,setSelectedTab:i,href:s});return l.jsxs(N,{...b,role:"tab","aria-selected":E,ref:S,href:s,className:R.tab,onClick:L,...b,children:[l.jsx("span",{className:R.stateLayer,children:l.jsx(Z,{colorName:n==="primary"&&E?"primary":"on-surface",triggerRef:S})}),l.jsxs("span",{className:R.content,children:[u&&l.jsx(H,{icon:u,className:R.icon}),l.jsx("span",{className:R.label,children:r}),E&&l.jsx(k.motion.span,{layoutId:`underline-${m}`,className:R.underline,transition:{duration:.3}})]})]})},ze=({variant:e="primary",onTabSelected:t,children:r,className:n,selectedTab:s,setSelectedTab:u,scrollable:o=!1})=>{const[i,m]=c.useState(null);let f;s==0||s!=null?f=s:f=i;const h=u||m,v=c.Children.toArray(r).filter(S=>c.isValidElement(S)&&S.type===Ce),a=c.useRef(null),y=S=>{if(t==null||t(S),o){const E=a.current,p=S.ref.current;if(E&&p){const N=p.offsetLeft+p.offsetWidth/2-E.offsetWidth/2;E.scrollTo({left:N,behavior:"smooth"})}}},b=c.useMemo(()=>ee(),[]),j=be({children:r,onTabSelected:t,scrollable:o,selectedTab:f,setSelectedTab:h,className:n,variant:e});return l.jsx("div",{ref:a,role:"tablist",className:j.tabs,children:v.map((S,E)=>c.cloneElement(S,{key:E,index:E,variant:e,selectedTab:f,setSelectedTab:h,tabsId:b,onTabSelected:y,scrollable:o}))})},Te=({variant:e="filled",disabled:t=!1,errorText:r,placeholder:n,suffix:s,name:u,label:o,className:i,supportingText:m,trailingIcon:f,leadingIcon:h,type:v="text",textLine:a="singleLine",autoComplete:y="on",onChange:b,value:j,showSupportingText:S=!1,...E})=>{const[p,N]=c.useState(j??""),[L,R]=c.useState(!1),[C,B]=c.useState(!1),[P,M]=c.useState(S);c.useEffect(()=>{N(j??"")},[j]),c.useEffect(()=>{r!=null&&r.length?B(!0):B(!1)},[r]),c.useEffect(()=>{S?M(S):m!=null&&m.length?M(!0):M(!1)},[P,m]),c.useEffect(()=>{L&&B(!1)},[L]);const x=c.useRef(null),D=()=>{x.current&&!L&&x.current.focus()},A=()=>{R(!0)},X=V=>{const $=V.target.value;N($),B(!1),typeof b=="function"&&b($)},G=()=>{R(!1)},U=je({showSupportingText:P,isFocused:L,showErrorIcon:C,disabled:t,name:u,label:o,autoComplete:y,className:i,onChange:b,placeholder:n,supportingText:m,type:v,leadingIcon:h,trailingIcon:f,variant:e,errorText:r,value:p,suffix:s,textLine:a}),[_]=c.useState(ee());let w,g;switch(a){case"multiLine":g=$e,w={};break;case"textAreas":g="textarea",w={};break;case"singleLine":default:g="input",w={type:v};break}return l.jsxs("div",{className:U.textField,...E,children:[l.jsxs("fieldset",{onClick:D,className:U.content,children:[l.jsx("div",{className:U.stateLayer}),h&&l.jsx("div",{className:U.leadingIcon,children:c.isValidElement(h)?h:l.jsx(H,{className:"w-5 h-5",icon:h})}),!(!L&&!p.length||e=="filled")&&l.jsx(k.motion.legend,{variants:{hidden:{width:0,padding:0},visible:{width:"auto",padding:"0 8px"}},initial:"hidden",animate:!L&&!p.length?"hidden":"visible",className:"max-w-full ml-2 px-2 text-body-small h-0",transition:{duration:.2},children:l.jsx("span",{className:"transform inline-flex -translate-y-1/2",children:l.jsx(k.motion.span,{className:U.label,transition:{duration:.3},layoutId:_,children:o})})}),l.jsxs("div",{className:"flex-1 relative",children:[(!L&&!p.length||e=="filled")&&l.jsx(k.motion.label,{htmlFor:u,className:d("absolute left-4 transition-all duration-300",{"text-body-small top-2":e=="filled"&&!(!L&&!p.length),"text-body-large top-1/2 transform -translate-y-1/2":!(e=="filled"&&!(!L&&!p.length))}),transition:{duration:.3},children:l.jsx(k.motion.span,{className:U.label,transition:{duration:.3},layoutId:e=="outlined"?_:void 0,children:o})}),l.jsx(g,{ref:x,value:p,onChange:X,className:U.input,id:u,name:u,placeholder:L?n??void 0:"",onFocus:A,onBlur:G,disabled:t,autoComplete:y,"aria-invalid":!!(r!=null&&r.length),"aria-label":o,...w})]}),l.jsx("div",{className:U.activeIndicator}),!C&&l.jsxs(l.Fragment,{children:[f&&l.jsx("div",{onClick:V=>{V.stopPropagation()},className:U.trailingIcon,children:c.isValidElement(f)?f:l.jsx(H,{className:"h-5",icon:f})}),!f&&s&&l.jsx("span",{className:U.suffix,children:s})]}),C&&l.jsx("div",{className:d(U.trailingIcon,{" absolute right-0":!f}),children:l.jsx(H,{className:"h-5 text-error",icon:Ze})})]}),P&&l.jsx("p",{className:U.supportingText,children:r!=null&&r.length?r:m!=null&&m.length?m:" "})]})},et=O("navigationRailItem",({isSelected:e,icon:t,label:r,variant:n})=>({navigationRailItem:d(" group flex flex-col pt-1 pb-1.5 cursor-pointer",{"text-on-surface-variant":!e,"text-on-secondary-container":e,"gap-2 h-[68px]":n=="vertical","gap-0 h-[66px]":n=="horizontal"}),container:d(" w-fit flex justify-center relative rounded-full items-center mx-5",{"bg-secondary-container overflow-hidden":e,"gap-2 ":n=="horizontal","gap-0 ":n=="vertical","p-4":!r},r&&["px-4",{"py-1 ":n=="vertical","py-4 ":n=="horizontal"}]),stateLayer:d(" absolute w-full rounded-full h-full left-0 top-0 ",{"group-state-on-surface":!e,"group-state-on-secondary-container":e}),icon:d("size-6 flex"),label:d("w-fit mx-auto",{"text-label-large ":n=="horizontal","text-label-medium":n=="vertical"})})),Ve=({label:e})=>l.jsx("div",{className:" h-9 flex items-center mx-9 mt-3",children:l.jsx("p",{className:"text-label-large text-on-surface-variant",children:e})}),Be=({className:e,onClick:t,label:r,variant:n="vertical",href:s,icon:u,selectedItem:o,setSelectedItem:i,index:m,onItemSelected:f,selected:h=!1,ref:v,transition:a,isExtended:y,iconSelected:b,style:j,extendedOnly:S,...E})=>{const p=c.useRef(null),N=v||p,[L,R]=c.useState(h);c.useEffect(()=>{h&&o==null?R(!0):R(o==m&&m!=null)},[o]),c.useEffect(()=>{o==m&&f&&f({ref:N,index:m||0,label:r,icon:u})},[o]);const C=s?"a":"button",B=M=>{i&&i(m??null),t&&t(M)},P=et({isExtended:y,extendedOnly:S,className:e,onItemSelected:f,selectedItem:o,index:m,transition:a,selected:L,variant:n,icon:u,label:r,isSelected:L,setSelectedItem:i,href:s,iconSelected:b});return a={duration:.3,...a},S&&!y?null:l.jsxs(C,{...E,role:"tab","aria-selected":L,ref:N,href:s,className:P.navigationRailItem,onClick:B,style:{transition:a.duration+"s",...j},children:[l.jsxs(k.motion.div,{style:{transition:n=="horizontal"?a.duration+`s, gap ${a.duration/2}s ${a.duration-a.duration/2}s`:a.duration+`s, gap ${a.duration/3}s ${a.duration-a.duration/3}s`},transition:a,className:P.container,children:[l.jsx(k.motion.div,{layout:!0,className:P.stateLayer}),u&&l.jsx(H,{icon:L?b:u,className:P.icon}),l.jsx(k.AnimatePresence,{children:n=="horizontal"&&(()=>{const M={width:0,opacity:0,transition:{...a}},x={width:"auto",opacity:1,transition:{...a,opacity:{duration:a.duration/2,delay:a.duration-a.duration/2}}};return l.jsx(k.motion.span,{initial:M,animate:x,exit:M,className:P.label,children:r})})()})]}),l.jsx(k.AnimatePresence,{children:n=="vertical"&&(()=>{const M={height:0,opacity:0,transition:{...a,opacity:{duration:0}}},x={height:"auto",opacity:1,transition:{...a,opacity:{duration:a.duration/3,delay:a.duration-a.duration/3}}};return l.jsx(k.motion.span,{initial:M,animate:x,exit:M,className:P.label,transition:a,children:r})})()})]})},tt=O("navigationRail",({isExtended:e,alignment:t})=>({navigationRail:d("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:d("flex flex-col gap-1 items-start"),menuIcon:"mx-5",segments:d(" flex flex-col overflow-auto min-w-full mt-10",{"w-full":!e,"w-fit items-start":e})})),nt=({variant:e="standard",onItemSelected:t,children:r,className:n,selectedItem:s,extended:u,alignment:o="top",menu:i={closed:{icon:Ye,label:"Open menu"},opened:{icon:Me,label:"Close menu"}},style:m,onExtendedChange:f,transition:h,setSelectedItem:v})=>{const[a,y]=c.useState(null),[b,j]=c.useState(u);let S;s==0||s!=null?S=s:S=a;const E=v||y,p=c.useRef(null),N=M=>{t==null||t(M)};function L(M){const x=[];return c.Children.forEach(M,D=>{c.isValidElement(D)&&D.type===c.Fragment?x.push(...L(D.props.children)):x.push(D)}),x}const R=L(r),C=R.filter(M=>c.isValidElement(M)&&M.type===z),B=tt({children:r,onItemSelected:t,selectedItem:S,setSelectedItem:E,className:n,variant:e,extended:b,isExtended:b,alignment:o,menu:i,transition:h,onExtendedChange:f});h={duration:.3,...h};const P=c.useRef(!1);return P.current=!1,c.useEffect(()=>{f==null||f(b??!1)},[b]),l.jsxs("div",{style:{transition:h.duration+"s",...m},ref:p,className:B.navigationRail,children:[l.jsxs("div",{className:B.header,children:[l.jsx(ne,{onClick:()=>j(!b),arialLabel:b?i==null?void 0:i.opened.label:i==null?void 0:i.closed.label,className:B.menuIcon,icon:b?i.opened.icon:i==null?void 0:i.closed.icon}),C.length>0&&c.cloneElement(C[0],{transition:h,isExtended:b,className:"!shadow-none mx-5 "+C[0].props.className})]}),l.jsx("div",{className:B.segments,children:(()=>{let M=0;return R.map(x=>c.isValidElement(x)&&x.type===Be?c.cloneElement(x,{key:M,index:M++,variant:b?"horizontal":"vertical",selectedItem:S,setSelectedItem:E,onItemSelected:N,transition:h,extendedOnly:P.current,isExtended:b}):c.isValidElement(x)&&x.type===z?null:c.isValidElement(x)&&x.type===Ve?(P.current=!0,b?c.cloneElement(x,{}):null):x)})()}),l.jsx("div",{className:"flex-1 max-h-[160px]"})]})};exports.Button=Re;exports.Card=Oe;exports.Carousel=Xe;exports.CarouselItem=ke;exports.CustomScroll=T;exports.Divider=qe;exports.Fab=z;exports.Icon=H;exports.IconButton=ne;exports.NavigationRail=nt;exports.NavigationRailItem=Be;exports.NavigationRailSection=Ve;exports.ProgressIndicator=Se;exports.RippleEffect=Z;exports.Slider=_e;exports.SmoothScroll=Ue;exports.Snackbar=Je;exports.Switch=Qe;exports.SyncedFixedWrapper=Le;exports.Tab=Ce;exports.Tabs=ze;exports.TextField=Te;exports.ToolTip=te;exports.buttonStyle=ie;exports.cardStyle=ue;exports.carouselItemStyle=fe;exports.carouselStyle=de;exports.classNames=d;exports.classnames=ae;exports.customScrollStyle=Ee;exports.defaultClassNames=O;exports.dividerStyle=me;exports.fabStyle=pe;exports.getClassNames=ce;exports.iconButtonStyle=he;exports.normalize=Ie;exports.progressIndicatorStyle=xe;exports.sliderStyle=ye;exports.snackbarStyle=ge;exports.switchStyle=we;exports.tabStyle=ve;exports.tabsStyle=be;exports.textFieldStyle=je;exports.toolStyle=Ne;
|
|
5
|
+
*/const Ye={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"]},_e={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},ke={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]},Ze=({supportingText:e,className:t,duration:n,closeIcon:r=ke,onClose:s,...u})=>{const[l,i]=c.useState(!0),m=ye({className:t,closeIcon:r,duration:n,isVisible:l,onClose:s,supportingText:e});c.useEffect(()=>{n&&setTimeout(()=>{f()},n)},[n]);const f=()=>{i(!1),s==null||s()};return o.jsx(R.AnimatePresence,{children:l&&o.jsx(R.motion.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.1},className:m.snackbar,...u,children:o.jsxs("div",{className:m.container,children:[o.jsx("p",{className:m.supportingText,children:e}),o.jsx(ne,{onClick:()=>f(),className:m.icon,icon:r,arialLabel:"close the snackbar"})]})})})},Je=({selected:e=!1,className:t,activeIcon:n,disabled:r=!1,inactiveIcon:s,onChange:u,onClick:l,onKeyDown:i,ref:m,...f})=>{const[w,v]=c.useState(e),a=y=>{r||(b(),l&&l(y))},h=y=>{r||((y.key===" "||y.key==="Enter")&&(y.preventDefault(),b()),i&&i(y))},b=()=>{v(!w),u==null||u(!w)},j=ge({className:t,isSelected:w,activeIcon:n,inactiveIcon:s,disabled:r,selected:w,onChange:u}),S=c.useRef(null),E=m||S;return o.jsxs(R.motion.div,{role:"switch","aria-checked":w,tabIndex:r?-1:0,onKeyDown:h,onClick:a,ref:E,className:j.switch,...f,children:[o.jsx("input",{type:"hidden",value:w?"1":"0"}),o.jsxs(R.motion.div,{layout:!0,style:{translate:w?"50%":"-50%"},transition:{type:"spring",stiffness:700,damping:30},className:j.handleContainer,children:[o.jsx("div",{className:j.handle,children:(w?n:s)&&o.jsx(H,{className:j.icon,icon:w?n:s})}),o.jsx("div",{className:j.handleStateLayer})]})]})},Me=({className:e,onClick:t,label:n,variant:r="primary",href:s,icon:u,selectedTab:l,setSelectedTab:i,tabsId:m,index:f,onTabSelected:w,scrollable:v=!1,selected:a=!1,ref:h,...b})=>{const j=c.useRef(null),S=h||j,[E,y]=c.useState(a);c.useEffect(()=>{a&&l==null?y(!0):y(l==f&&f!=null)},[l]),c.useEffect(()=>{l==f&&w&&w({ref:S,index:f||0,label:n,icon:u})},[l]);const N=s?"a":"button",I=C=>{i&&i(f??null),t&&t(C)},M=we({className:e,onTabSelected:w,scrollable:v,selectedTab:l,index:f,tabsId:m,selected:E,variant:r,icon:u,label:n,isSelected:E,setSelectedTab:i,href:s});return o.jsxs(N,{...b,role:"tab","aria-selected":E,ref:S,href:s,className:M.tab,onClick:I,...b,children:[o.jsx("span",{className:M.stateLayer,children:o.jsx(Z,{colorName:r==="primary"&&E?"primary":"on-surface",triggerRef:S})}),o.jsxs("span",{className:M.content,children:[u&&o.jsx(H,{icon:u,className:M.icon}),o.jsx("span",{className:M.label,children:n}),E&&o.jsx(R.motion.span,{layoutId:`underline-${m}`,className:M.underline,transition:{duration:.3}})]})]})},Qe=({variant:e="primary",onTabSelected:t,children:n,className:r,selectedTab:s,setSelectedTab:u,scrollable:l=!1})=>{const[i,m]=c.useState(null);let f;s==0||s!=null?f=s:f=i;const w=u||m,v=c.Children.toArray(n).filter(S=>c.isValidElement(S)&&S.type===Me),a=c.useRef(null),h=S=>{if(t==null||t(S),l){const E=a.current,y=S.ref.current;if(E&&y){const N=y.offsetLeft+y.offsetWidth/2-E.offsetWidth/2;E.scrollTo({left:N,behavior:"smooth"})}}},b=c.useMemo(()=>ee(),[]),j=ve({children:n,onTabSelected:t,scrollable:l,selectedTab:f,setSelectedTab:w,className:r,variant:e});return o.jsx("div",{ref:a,role:"tablist",className:j.tabs,children:v.map((S,E)=>c.cloneElement(S,{key:E,index:E,variant:e,selectedTab:f,setSelectedTab:w,tabsId:b,onTabSelected:h,scrollable:l}))})},ze=({variant:e="filled",disabled:t=!1,errorText:n,placeholder:r,suffix:s,name:u,label:l,className:i,supportingText:m,trailingIcon:f,leadingIcon:w,type:v="text",textLine:a="singleLine",autoComplete:h="on",onChange:b,value:j,showSupportingText:S=!1,...E})=>{const[y,N]=c.useState(j??""),[I,M]=c.useState(!1),[C,B]=c.useState(!1),[P,k]=c.useState(S);c.useEffect(()=>{N(j??"")},[j]),c.useEffect(()=>{n!=null&&n.length?B(!0):B(!1)},[n]),c.useEffect(()=>{S?k(S):m!=null&&m.length?k(!0):k(!1)},[P,m]),c.useEffect(()=>{I&&B(!1)},[I]);const p=c.useRef(null),D=()=>{p.current&&!I&&p.current.focus()},A=()=>{M(!0)},q=V=>{const W=V.target.value;N(W),B(!1),typeof b=="function"&&b(W)},G=()=>{M(!1)},U=be({showSupportingText:P,isFocused:I,showErrorIcon:C,disabled:t,name:u,label:l,autoComplete:h,className:i,onChange:b,placeholder:r,supportingText:m,type:v,leadingIcon:w,trailingIcon:f,variant:e,errorText:n,value:y,suffix:s,textLine:a}),[Y]=c.useState(ee());let g,x;switch(a){case"multiLine":x=We,g={};break;case"textAreas":x="textarea",g={};break;case"singleLine":default:x="input",g={type:v};break}return o.jsxs("div",{className:U.textField,...E,children:[o.jsxs("fieldset",{onClick:D,className:U.content,children:[o.jsx("div",{className:U.stateLayer}),w&&o.jsx("div",{className:U.leadingIcon,children:c.isValidElement(w)?w:o.jsx(H,{className:"w-5 h-5",icon:w})}),!(!I&&!y.length||e=="filled")&&o.jsx(R.motion.legend,{variants:{hidden:{width:0,padding:0},visible:{width:"auto",padding:"0 8px"}},initial:"hidden",animate:!I&&!y.length?"hidden":"visible",className:"max-w-full ml-2 px-2 text-body-small h-0",transition:{duration:.2},children:o.jsx("span",{className:"transform inline-flex -translate-y-1/2",children:o.jsx(R.motion.span,{className:U.label,transition:{duration:.3},layoutId:Y,children:l})})}),o.jsxs("div",{className:"flex-1 relative",children:[(!I&&!y.length||e=="filled")&&o.jsx(R.motion.label,{htmlFor:u,className:d("absolute left-4 transition-all duration-300",{"text-body-small top-2":e=="filled"&&!(!I&&!y.length),"text-body-large top-1/2 transform -translate-y-1/2":!(e=="filled"&&!(!I&&!y.length))}),transition:{duration:.3},children:o.jsx(R.motion.span,{className:U.label,transition:{duration:.3},layoutId:e=="outlined"?Y:void 0,children:l})}),o.jsx(x,{ref:p,value:y,onChange:q,className:U.input,id:u,name:u,placeholder:I?r??void 0:"",onFocus:A,onBlur:G,disabled:t,autoComplete:h,"aria-invalid":!!(n!=null&&n.length),"aria-label":l,...g})]}),o.jsx("div",{className:U.activeIndicator}),!C&&o.jsxs(o.Fragment,{children:[f&&o.jsx("div",{onClick:V=>{V.stopPropagation()},className:U.trailingIcon,children:c.isValidElement(f)?f:o.jsx(H,{className:"h-5",icon:f})}),!f&&s&&o.jsx("span",{className:U.suffix,children:s})]}),C&&o.jsx("div",{className:d(U.trailingIcon,{" absolute right-0":!f}),children:o.jsx(H,{className:"h-5 text-error",icon:_e})})]}),P&&o.jsx("p",{className:U.supportingText,children:n!=null&&n.length?n:m!=null&&m.length?m:" "})]})},Te=X("navigationRailItem",({isSelected:e,icon:t,label:n,variant:r})=>({navigationRailItem:d(" group 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:d(" 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:d(" absolute w-full rounded-full h-full left-0 top-0 ",{"group-state-on-surface":!e,"group-state-on-secondary-container":e}),icon:d("size-6 flex"),label:d("w-fit mx-auto",{"text-label-large ":r=="horizontal","text-label-medium":r=="vertical"})})),Ce=({label:e})=>o.jsx("div",{className:" h-9 flex items-center mx-9 mt-3",children:o.jsx("p",{className:"text-label-large text-on-surface-variant",children:e})}),Ve=({className:e,onClick:t,label:n,variant:r="vertical",href:s,icon:u,selectedItem:l,setSelectedItem:i,index:m,onItemSelected:f,selected:w=!1,ref:v,transition:a,isExtended:h,iconSelected:b,style:j,extendedOnly:S,...E})=>{const y=c.useRef(null),N=v||y,[I,M]=c.useState(w);c.useEffect(()=>{w&&l==null?M(!0):M(l==m&&m!=null)},[l]),c.useEffect(()=>{l==m&&f&&f({ref:N,index:m||0,label:n,icon:u})},[l]);const C=s?"a":"button",B=k=>{i&&i(m??null),t&&t(k)},P=Te({isExtended:h,extendedOnly:S,className:e,onItemSelected:f,selectedItem:l,index:m,transition:a,selected:I,variant:r,icon:u,label:n,isSelected:I,setSelectedItem:i,href:s,iconSelected:b});return a={duration:.3,...a},S&&!h?null:o.jsxs(C,{...E,role:"tab","aria-selected":I,ref:N,href:s,className:P.navigationRailItem,onClick:B,style:{transition:a.duration+"s",...j},children:[o.jsxs(R.motion.div,{style:{transition:r=="horizontal"?a.duration+`s, gap ${a.duration/2}s ${a.duration-a.duration/2}s`:a.duration+`s, gap ${a.duration/3}s ${a.duration-a.duration/3}s`},transition:a,className:P.container,children:[o.jsx(R.motion.div,{layout:!0,className:P.stateLayer}),u&&o.jsx(H,{icon:I?b:u,className:P.icon}),o.jsx(R.AnimatePresence,{children:r=="horizontal"&&(()=>{const k={width:0,opacity:0,transition:{...a}},p={width:"auto",opacity:1,transition:{...a,opacity:{duration:a.duration/2,delay:a.duration-a.duration/2}}};return o.jsx(R.motion.span,{initial:k,animate:p,exit:k,className:P.label,children:n})})()})]}),o.jsx(R.AnimatePresence,{children:r=="vertical"&&(()=>{const k={height:0,opacity:0,transition:{...a,opacity:{duration:0}}},p={height:"auto",opacity:1,transition:{...a,opacity:{duration:a.duration/3,delay:a.duration-a.duration/3}}};return o.jsx(R.motion.span,{initial:k,animate:p,exit:k,className:P.label,transition:a,children:n})})()})]})},et=X("navigationRail",({isExtended:e,alignment:t})=>({navigationRail:d("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:d("flex flex-col gap-1 items-start"),menuIcon:"mx-5",segments:d(" flex flex-col overflow-auto min-w-full mt-10",{"w-full":!e,"w-fit items-start":e})})),tt=({variant:e="standard",onItemSelected:t,children:n,className:r,selectedItem:s,extended:u,alignment:l="top",menu:i={closed:{icon:Ye,label:"Open menu"},opened:{icon:ke,label:"Close menu"}},style:m,onExtendedChange:f,transition:w,setSelectedItem:v})=>{const[a,h]=c.useState(null),[b,j]=c.useState(u);let S;s==0||s!=null?S=s:S=a;const E=v||h,y=c.useRef(null),N=k=>{t==null||t(k)};function I(k){const p=[];return c.Children.forEach(k,D=>{c.isValidElement(D)&&D.type===c.Fragment?p.push(...I(D.props.children)):p.push(D)}),p}const M=I(n),C=M.filter(k=>c.isValidElement(k)&&k.type===z),B=et({children:n,onItemSelected:t,selectedItem:S,setSelectedItem:E,className:r,variant:e,extended:b,isExtended:b,alignment:l,menu:i,transition:w,onExtendedChange:f});w={duration:.3,...w};const P=c.useRef(!1);return P.current=!1,c.useEffect(()=>{f==null||f(b??!1)},[b]),o.jsxs("div",{style:{transition:w.duration+"s",...m},ref:y,className:B.navigationRail,children:[o.jsxs("div",{className:B.header,children:[o.jsx(ne,{onClick:()=>j(!b),arialLabel:b?i==null?void 0:i.opened.label:i==null?void 0:i.closed.label,className:B.menuIcon,icon:b?i.opened.icon:i==null?void 0:i.closed.icon}),C.length>0&&c.cloneElement(C[0],{transition:w,isExtended:b,className:"!shadow-none mx-5 "+C[0].props.className})]}),o.jsx("div",{className:B.segments,children:(()=>{let k=0;return M.map(p=>c.isValidElement(p)&&p.type===Ve?c.cloneElement(p,{key:k,index:k++,variant:b?"horizontal":"vertical",selectedItem:S,setSelectedItem:E,onItemSelected:N,transition:w,extendedOnly:P.current,isExtended:b}):c.isValidElement(p)&&p.type===z?null:c.isValidElement(p)&&p.type===Ce?(P.current=!0,b?c.cloneElement(p,{}):null):p)})()}),o.jsx("div",{className:"flex-1 max-h-[160px]"})]})};exports.Button=Le;exports.Card=Ue;exports.Carousel=Xe;exports.CarouselItem=Ie;exports.CustomScroll=T;exports.Divider=qe;exports.Fab=z;exports.Icon=H;exports.IconButton=ne;exports.NavigationRail=tt;exports.NavigationRailItem=Ve;exports.NavigationRailSection=Ce;exports.ProgressIndicator=Ne;exports.RippleEffect=Z;exports.Slider=He;exports.SmoothScroll=Fe;exports.Snackbar=Ze;exports.Switch=Je;exports.SyncedFixedWrapper=Ee;exports.Tab=Me;exports.Tabs=Qe;exports.TextField=ze;exports.ToolTip=te;exports.buttonStyle=ce;exports.cardStyle=ie;exports.carouselItemStyle=ue;exports.carouselStyle=fe;exports.classNames=d;exports.classnames=oe;exports.customScrollStyle=Se;exports.defaultClassNames=X;exports.dividerStyle=de;exports.fabStyle=me;exports.getClassNames=ae;exports.iconButtonStyle=pe;exports.normalize=Re;exports.progressIndicatorStyle=he;exports.sliderStyle=xe;exports.snackbarStyle=ye;exports.switchStyle=ge;exports.tabStyle=we;exports.tabsStyle=ve;exports.textFieldStyle=be;exports.toolStyle=je;
|