@udixio/ui-react 2.9.17 → 2.9.18
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
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";var nn=Object.defineProperty;var sn=(e,t,n)=>t in e?nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var P=(e,t,n)=>sn(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),o=require("react"),X=require("motion/react"),Xe=require("clsx"),rn=require("tailwind-merge"),Ue=require("react-dom"),be=require("@udixio/theme"),Ke=require("@udixio/tailwind"),on=require("react-textarea-autosize"),Ge=({colorName:e="on-surface",triggerRef:t})=>{const n={initial:{opacity:1,"--r":"25%"},animate:{opacity:1,"--r":"100%",transition:{duration:.5}},exit:{opacity:0,"--r":"100%",transition:{duration:.3}}},[r,s]=o.useState(!0),[d,u]=o.useState(!1),[a,l]=o.useState({x:50,y:50});o.useEffect(()=>{d&&(s(!0),s(!1))},[d]),o.useEffect(()=>{const m=t==null?void 0:t.current;if(m)return m.addEventListener("mousedown",i),m.addEventListener("mouseup",y),m.addEventListener("mouseleave",f),()=>{m.removeEventListener("mousedown",i),m.removeEventListener("mouseup",y),m.removeEventListener("mouseleave",f)}},[t]);const i=m=>{const S=t==null?void 0:t.current,w=S.getBoundingClientRect();u(!0),l({x:(m.clientX-w.left)/S.clientWidth*100,y:(m.clientY-w.top)/S.clientHeight*100})},f=m=>{u(!1)},y=m=>{u(!1)},h=`color-mix(in srgb, var(--state-color,_var(--color-${e})) 10%, transparent)`,p={position:"absolute",inset:0,width:"100%",height:"100%","--x":a.x+"%","--y":a.y+"%","--r":"0%",background:`radial-gradient(ellipse at var(--x) var(--y), ${h} var(--r), transparent calc(var(--r) * 2))`,pointerEvents:"none"};return c.jsx(X.AnimatePresence,{mode:"wait",children:(d||!d&&!r)&&c.jsx(X.motion.div,{style:p,variants:n,initial:"initial",animate:"animate",exit:"exit",onAnimationComplete:()=>s(!0)})})},Je=rn.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"]}}}),x=(...e)=>Je(Xe.clsx(e)),Ze=(...e)=>Je(Xe.clsx(e));function ln(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 Ne=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 d=r(e.states);Object.entries(d).map(u=>{const[a,l]=u;(t[a]??(t[a]=[])).push(l)})}});const n=t;return Object.entries(t).map(r=>{let[s,d]=r;d=d.reverse(),s==e.default&&d.unshift("relative"),d.unshift(ln(s)),n[s]=Ze(...d)}),n},te=(e,t)=>n=>Ne({classNameList:[n.className,t],default:e,states:n}),Q=(e,t)=>n=>o.useMemo(()=>Ne({classNameList:[n.className,t],default:e,states:n}),[n]);function an(e,t,n){return o.useMemo(()=>Ne({classNameList:[n==null?void 0:n.className,t],default:e,states:n}),[e,t,n])}const Qe=te("customScroll",({orientation:e,draggable:t,isDragging:n})=>({customScroll:x("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:x("overflow-hidden flex-none sticky",{"left-0 h-full":e==="horizontal","top-0 w-full":e==="vertical"})}));function cn(e,t){let n=0,r=null,s=null;const d=(u,a)=>{n=Date.now(),t(u,a)};return(u,a)=>{const l=Date.now(),i=e-(l-n);i<=0?(r&&(clearTimeout(r),r=null),d(u,a)):(s={v:u,o:a},r||(r=setTimeout(()=>{r=null;const f=s;s=null,f&&d(f.v,f.o)},i)))}}const et=({children:e,orientation:t="vertical",scrollSize:n,onScroll:r,className:s,draggable:d=!1,throttleDuration:u=75,scroll:a,setScroll:l})=>{var ee,k;const i=o.useRef(null),f=o.useRef(null),[y,h]=o.useState({width:null,height:null});o.useEffect(()=>{if(!i.current)return;const j=new ResizeObserver(E=>{for(const $ of E)$.target===i.current&&h({width:$.contentRect.width,height:$.contentRect.height})});return j.observe(i.current),()=>{j.disconnect()}},[i]);const p=o.useRef(null),m=o.useRef(null),S=()=>{const j=f.current;return j?{width:n??j.scrollWidth,height:n??j.scrollHeight}:null},w=()=>{const j=i.current;return j?{width:j.clientWidth,height:j.clientHeight}:null},{scrollYProgress:I,scrollXProgress:b}=X.useScroll({container:i}),g=o.useRef(null);g.current||(g.current=cn(u,(j,E)=>{!m.current||!p.current||!i.current||(E===(t==="horizontal"?"x":"y")&&(l==null||l(j)),r&&(t==="horizontal"&&E==="x"&&r({scrollProgress:j,scroll:j*(p.current.width-i.current.clientWidth),scrollTotal:p.current.width-i.current.clientWidth,scrollVisible:m.current.width}),t==="vertical"&&E==="y"&&r({scrollProgress:j,scroll:j*(p.current.height-i.current.clientHeight),scrollTotal:p.current.height-i.current.clientHeight,scrollVisible:m.current.height})))}));const H=(j,E)=>{g.current&&g.current(j,E)};o.useEffect(()=>{y.width&&H(b.get(),"x"),y.height&&H(I.get(),"y")},[y]),o.useEffect(()=>{const j=i.current,E=f.current;if(!j||!E||typeof a!="number")return;const $=(T,Y,_)=>Math.min(_,Math.max(Y,T));if(t==="horizontal"){const T=Math.max(0,(n??E.scrollWidth)-j.clientWidth);j.scrollLeft=$(a*T,0,T)}else{const T=Math.max(0,(n??E.scrollHeight)-j.clientHeight);j.scrollTop=$(a*T,0,T)}},[a,t,n]),X.useMotionValueEvent(b,"change",j=>{H(j,"x")}),X.useMotionValueEvent(I,"change",j=>{H(j,"y")});const[D,v]=o.useState(!1);o.useLayoutEffect(()=>{D||!m.current||!p.current||!r||(r({scrollProgress:0,scroll:0,scrollTotal:t=="vertical"?p.current.height:p.current.width,scrollVisible:t=="vertical"?m.current.height:m.current.width}),v(!0))},[m,p,r]),p.current=S(),m.current=w();const[N,F]=o.useState(!1),L=Qe({isDragging:N,children:e,className:s,onScroll:r,orientation:t,scrollSize:n,draggable:d,throttleDuration:u}),[W,M]=o.useState(0),[z,O]=o.useState(0),Z=j=>{if(!d)return;const E=i.current;if(!E||W==null)return;const T=(j.pageX-E.offsetLeft-W)*1.5;E.scrollLeft=z-T},B=j=>{const E=i.current;E&&(F(!0),M(j.pageX-E.offsetLeft),O(E.scrollLeft))},C=j=>{N&&(j.preventDefault(),Z(j))},R=()=>{F(!1)},V=()=>{F(!1)},K=j=>{j.preventDefault()},G=o.useRef(null);return o.useEffect(()=>()=>{G.current&&clearTimeout(G.current)},[]),o.useEffect(()=>{const j=i.current;if(!j)return;const E=$=>{var J,A,q,ne;const T=$.detail,Y=i.current;if(!Y||!T)return;const _=T.orientation??t;if(typeof T.progress=="number")if(_==="horizontal"){const le=Math.max(0,(((J=p.current)==null?void 0:J.width)??0)-Y.clientWidth);Y.scrollLeft=Math.min(le,Math.max(0,T.progress*le))}else{const le=Math.max(0,(((A=p.current)==null?void 0:A.height)??0)-Y.clientHeight);Y.scrollTop=Math.min(le,Math.max(0,T.progress*le))}else if(typeof T.scroll=="number")if(_==="horizontal"){const le=Math.max(0,(((q=p.current)==null?void 0:q.width)??0)-Y.clientWidth);Y.scrollLeft=Math.min(le,Math.max(0,T.scroll))}else{const le=Math.max(0,(((ne=p.current)==null?void 0:ne.height)??0)-Y.clientHeight);Y.scrollTop=Math.min(le,Math.max(0,T.scroll))}};return j.addEventListener("udx:customScroll:set",E),()=>{j.removeEventListener("udx:customScroll:set",E)}},[t]),c.jsxs("div",{className:L.customScroll,ref:i,onMouseDown:B,onMouseMove:C,onMouseUp:R,onMouseLeave:V,onDragStart:K,onScroll:j=>{N||(M(null),F(!0),G.current&&clearTimeout(G.current),G.current=setTimeout(()=>{F(!1)},1e3))},children:[c.jsx("div",{ref:f,style:t==="vertical"?{height:((ee=m==null?void 0:m.current)==null?void 0:ee.height)??"100%"}:{width:((k=m==null?void 0:m.current)==null?void 0:k.width)??"100%"},className:L.track,children:e}),m.current&&p.current&&c.jsxs(c.Fragment,{children:[t==="vertical"&&p.current.height>m.current.height&&c.jsx(X.motion.div,{className:"flex-none",style:{height:p.current.height-m.current.height}}),t==="horizontal"&&p.current.width>m.current.width&&c.jsx(X.motion.div,{className:"flex-none",style:{width:p.current.width-m.current.width}})]})]})};var un="1.3.17";function tt(e,t,n){return Math.max(e,Math.min(t,n))}function dn(e,t,n){return(1-n)*e+n*t}function fn(e,t,n,r){return dn(e,t,1-Math.exp(-n*r))}function hn(e,t){return(e%t+t)%t}var mn=class{constructor(){P(this,"isRunning",!1);P(this,"value",0);P(this,"from",0);P(this,"to",0);P(this,"currentTime",0);P(this,"lerp");P(this,"duration");P(this,"easing");P(this,"onUpdate")}advance(e){var n;if(!this.isRunning)return;let t=!1;if(this.duration&&this.easing){this.currentTime+=e;const r=tt(0,this.currentTime/this.duration,1);t=r>=1;const s=t?1:this.easing(r);this.value=this.from+(this.to-this.from)*s}else this.lerp?(this.value=fn(this.value,this.to,this.lerp*60,e),Math.round(this.value)===this.to&&(this.value=this.to,t=!0)):(this.value=this.to,t=!0);t&&this.stop(),(n=this.onUpdate)==null||n.call(this,this.value,t)}stop(){this.isRunning=!1}fromTo(e,t,{lerp:n,duration:r,easing:s,onStart:d,onUpdate:u}){this.from=this.value=e,this.to=t,this.lerp=n,this.duration=r,this.easing=s,this.currentTime=0,this.isRunning=!0,d==null||d(),this.onUpdate=u}};function pn(e,t){let n;return function(...r){let s=this;clearTimeout(n),n=setTimeout(()=>{n=void 0,e.apply(s,r)},t)}}var yn=class{constructor(e,t,{autoResize:n=!0,debounce:r=250}={}){P(this,"width",0);P(this,"height",0);P(this,"scrollHeight",0);P(this,"scrollWidth",0);P(this,"debouncedResize");P(this,"wrapperResizeObserver");P(this,"contentResizeObserver");P(this,"resize",()=>{this.onWrapperResize(),this.onContentResize()});P(this,"onWrapperResize",()=>{this.wrapper instanceof Window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)});P(this,"onContentResize",()=>{this.wrapper instanceof Window?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)});this.wrapper=e,this.content=t,n&&(this.debouncedResize=pn(this.resize,r),this.wrapper instanceof Window?window.addEventListener("resize",this.debouncedResize,!1):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){var e,t;(e=this.wrapperResizeObserver)==null||e.disconnect(),(t=this.contentResizeObserver)==null||t.disconnect(),this.wrapper===window&&this.debouncedResize&&window.removeEventListener("resize",this.debouncedResize,!1)}get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}},nt=class{constructor(){P(this,"events",{})}emit(e,...t){var r;let n=this.events[e]||[];for(let s=0,d=n.length;s<d;s++)(r=n[s])==null||r.call(n,...t)}on(e,t){var n;return(n=this.events[e])!=null&&n.push(t)||(this.events[e]=[t]),()=>{var r;this.events[e]=(r=this.events[e])==null?void 0:r.filter(s=>t!==s)}}off(e,t){var n;this.events[e]=(n=this.events[e])==null?void 0:n.filter(r=>t!==r)}destroy(){this.events={}}},Te=100/6,pe={passive:!1},xn=class{constructor(e,t={wheelMultiplier:1,touchMultiplier:1}){P(this,"touchStart",{x:0,y:0});P(this,"lastDelta",{x:0,y:0});P(this,"window",{width:0,height:0});P(this,"emitter",new nt);P(this,"onTouchStart",e=>{const{clientX:t,clientY:n}=e.targetTouches?e.targetTouches[0]:e;this.touchStart.x=t,this.touchStart.y=n,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:e})});P(this,"onTouchMove",e=>{const{clientX:t,clientY:n}=e.targetTouches?e.targetTouches[0]:e,r=-(t-this.touchStart.x)*this.options.touchMultiplier,s=-(n-this.touchStart.y)*this.options.touchMultiplier;this.touchStart.x=t,this.touchStart.y=n,this.lastDelta={x:r,y:s},this.emitter.emit("scroll",{deltaX:r,deltaY:s,event:e})});P(this,"onTouchEnd",e=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:e})});P(this,"onWheel",e=>{let{deltaX:t,deltaY:n,deltaMode:r}=e;const s=r===1?Te:r===2?this.window.width:1,d=r===1?Te:r===2?this.window.height:1;t*=s,n*=d,t*=this.options.wheelMultiplier,n*=this.options.wheelMultiplier,this.emitter.emit("scroll",{deltaX:t,deltaY:n,event:e})});P(this,"onWindowResize",()=>{this.window={width:window.innerWidth,height:window.innerHeight}});this.element=e,this.options=t,window.addEventListener("resize",this.onWindowResize,!1),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,pe),this.element.addEventListener("touchstart",this.onTouchStart,pe),this.element.addEventListener("touchmove",this.onTouchMove,pe),this.element.addEventListener("touchend",this.onTouchEnd,pe)}on(e,t){return this.emitter.on(e,t)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize,!1),this.element.removeEventListener("wheel",this.onWheel,pe),this.element.removeEventListener("touchstart",this.onTouchStart,pe),this.element.removeEventListener("touchmove",this.onTouchMove,pe),this.element.removeEventListener("touchend",this.onTouchEnd,pe)}},He=e=>Math.min(1,1.001-Math.pow(2,-10*e)),vn=class{constructor({wrapper:e=window,content:t=document.documentElement,eventsTarget:n=e,smoothWheel:r=!0,syncTouch:s=!1,syncTouchLerp:d=.075,touchInertiaExponent:u=1.7,duration:a,easing:l,lerp:i=.1,infinite:f=!1,orientation:y="vertical",gestureOrientation:h=y==="horizontal"?"both":"vertical",touchMultiplier:p=1,wheelMultiplier:m=1,autoResize:S=!0,prevent:w,virtualScroll:I,overscroll:b=!0,autoRaf:g=!1,anchors:H=!1,autoToggle:D=!1,allowNestedScroll:v=!1,__experimental__naiveDimensions:N=!1,naiveDimensions:F=N,stopInertiaOnNavigate:L=!1}={}){P(this,"_isScrolling",!1);P(this,"_isStopped",!1);P(this,"_isLocked",!1);P(this,"_preventNextNativeScrollEvent",!1);P(this,"_resetVelocityTimeout",null);P(this,"_rafId",null);P(this,"isTouching");P(this,"time",0);P(this,"userData",{});P(this,"lastVelocity",0);P(this,"velocity",0);P(this,"direction",0);P(this,"options");P(this,"targetScroll");P(this,"animatedScroll");P(this,"animate",new mn);P(this,"emitter",new nt);P(this,"dimensions");P(this,"virtualScroll");P(this,"onScrollEnd",e=>{e instanceof CustomEvent||(this.isScrolling==="smooth"||this.isScrolling===!1)&&e.stopPropagation()});P(this,"dispatchScrollendEvent",()=>{this.options.wrapper.dispatchEvent(new CustomEvent("scrollend",{bubbles:this.options.wrapper===window,detail:{lenisScrollEnd:!0}}))});P(this,"onTransitionEnd",e=>{e.propertyName.includes("overflow")&&this.checkOverflow()});P(this,"onClick",e=>{const n=e.composedPath().filter(r=>r instanceof HTMLAnchorElement&&r.getAttribute("href"));if(this.options.anchors){const r=n.find(s=>{var d;return(d=s.getAttribute("href"))==null?void 0:d.includes("#")});if(r){const s=r.getAttribute("href");if(s){const d=typeof this.options.anchors=="object"&&this.options.anchors?this.options.anchors:void 0,u=`#${s.split("#")[1]}`;this.scrollTo(u,d)}}}this.options.stopInertiaOnNavigate&&n.find(s=>s.host===window.location.host)&&this.reset()});P(this,"onPointerDown",e=>{e.button===1&&this.reset()});P(this,"onVirtualScroll",e=>{if(typeof this.options.virtualScroll=="function"&&this.options.virtualScroll(e)===!1)return;const{deltaX:t,deltaY:n,event:r}=e;if(this.emitter.emit("virtual-scroll",{deltaX:t,deltaY:n,event:r}),r.ctrlKey||r.lenisStopPropagation)return;const s=r.type.includes("touch"),d=r.type.includes("wheel");this.isTouching=r.type==="touchstart"||r.type==="touchmove";const u=t===0&&n===0;if(this.options.syncTouch&&s&&r.type==="touchstart"&&u&&!this.isStopped&&!this.isLocked){this.reset();return}const l=this.options.gestureOrientation==="vertical"&&n===0||this.options.gestureOrientation==="horizontal"&&t===0;if(u||l)return;let i=r.composedPath();i=i.slice(0,i.indexOf(this.rootElement));const f=this.options.prevent;if(i.find(w=>{var I,b,g;return w instanceof HTMLElement&&(typeof f=="function"&&(f==null?void 0:f(w))||((I=w.hasAttribute)==null?void 0:I.call(w,"data-lenis-prevent"))||s&&((b=w.hasAttribute)==null?void 0:b.call(w,"data-lenis-prevent-touch"))||d&&((g=w.hasAttribute)==null?void 0:g.call(w,"data-lenis-prevent-wheel"))||this.options.allowNestedScroll&&this.checkNestedScroll(w,{deltaX:t,deltaY:n}))}))return;if(this.isStopped||this.isLocked){r.cancelable&&r.preventDefault();return}if(!(this.options.syncTouch&&s||this.options.smoothWheel&&d)){this.isScrolling="native",this.animate.stop(),r.lenisStopPropagation=!0;return}let h=n;this.options.gestureOrientation==="both"?h=Math.abs(n)>Math.abs(t)?n:t:this.options.gestureOrientation==="horizontal"&&(h=t),(!this.options.overscroll||this.options.infinite||this.options.wrapper!==window&&this.limit>0&&(this.animatedScroll>0&&this.animatedScroll<this.limit||this.animatedScroll===0&&n>0||this.animatedScroll===this.limit&&n<0))&&(r.lenisStopPropagation=!0),r.cancelable&&r.preventDefault();const p=s&&this.options.syncTouch,S=s&&r.type==="touchend";S&&(h=Math.sign(this.velocity)*Math.pow(Math.abs(this.velocity),this.options.touchInertiaExponent)),this.scrollTo(this.targetScroll+h,{programmatic:!1,...p?{lerp:S?this.options.syncTouchLerp:1}:{lerp:this.options.lerp,duration:this.options.duration,easing:this.options.easing}})});P(this,"onNativeScroll",()=>{if(this._resetVelocityTimeout!==null&&(clearTimeout(this._resetVelocityTimeout),this._resetVelocityTimeout=null),this._preventNextNativeScrollEvent){this._preventNextNativeScrollEvent=!1;return}if(this.isScrolling===!1||this.isScrolling==="native"){const e=this.animatedScroll;this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity,this.velocity=this.animatedScroll-e,this.direction=Math.sign(this.animatedScroll-e),this.isStopped||(this.isScrolling="native"),this.emit(),this.velocity!==0&&(this._resetVelocityTimeout=setTimeout(()=>{this.lastVelocity=this.velocity,this.velocity=0,this.isScrolling=!1,this.emit()},400))}});P(this,"raf",e=>{const t=e-(this.time||e);this.time=e,this.animate.advance(t*.001),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))});window.lenisVersion=un,(!e||e===document.documentElement)&&(e=window),typeof a=="number"&&typeof l!="function"?l=He:typeof l=="function"&&typeof a!="number"&&(a=1),this.options={wrapper:e,content:t,eventsTarget:n,smoothWheel:r,syncTouch:s,syncTouchLerp:d,touchInertiaExponent:u,duration:a,easing:l,lerp:i,infinite:f,gestureOrientation:h,orientation:y,touchMultiplier:p,wheelMultiplier:m,autoResize:S,prevent:w,virtualScroll:I,overscroll:b,autoRaf:g,anchors:H,autoToggle:D,allowNestedScroll:v,naiveDimensions:F,stopInertiaOnNavigate:L},this.dimensions=new yn(e,t,{autoResize:S}),this.updateClassName(),this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll,!1),this.options.wrapper.addEventListener("scrollend",this.onScrollEnd,{capture:!0}),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.addEventListener("click",this.onClick,!1),this.options.wrapper.addEventListener("pointerdown",this.onPointerDown,!1),this.virtualScroll=new xn(n,{touchMultiplier:p,wheelMultiplier:m}),this.virtualScroll.on("scroll",this.onVirtualScroll),this.options.autoToggle&&(this.checkOverflow(),this.rootElement.addEventListener("transitionend",this.onTransitionEnd,{passive:!0})),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))}destroy(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll,!1),this.options.wrapper.removeEventListener("scrollend",this.onScrollEnd,{capture:!0}),this.options.wrapper.removeEventListener("pointerdown",this.onPointerDown,!1),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.removeEventListener("click",this.onClick,!1),this.virtualScroll.destroy(),this.dimensions.destroy(),this.cleanUpClassName(),this._rafId&&cancelAnimationFrame(this._rafId)}on(e,t){return this.emitter.on(e,t)}off(e,t){return this.emitter.off(e,t)}get overflow(){const e=this.isHorizontal?"overflow-x":"overflow-y";return getComputedStyle(this.rootElement)[e]}checkOverflow(){["hidden","clip"].includes(this.overflow)?this.internalStop():this.internalStart()}setScroll(e){this.isHorizontal?this.options.wrapper.scrollTo({left:e,behavior:"instant"}):this.options.wrapper.scrollTo({top:e,behavior:"instant"})}resize(){this.dimensions.resize(),this.animatedScroll=this.targetScroll=this.actualScroll,this.emit()}emit(){this.emitter.emit("scroll",this)}reset(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity=0,this.animate.stop()}start(){if(this.isStopped){if(this.options.autoToggle){this.rootElement.style.removeProperty("overflow");return}this.internalStart()}}internalStart(){this.isStopped&&(this.reset(),this.isStopped=!1,this.emit())}stop(){if(!this.isStopped){if(this.options.autoToggle){this.rootElement.style.setProperty("overflow","clip");return}this.internalStop()}}internalStop(){this.isStopped||(this.reset(),this.isStopped=!0,this.emit())}scrollTo(e,{offset:t=0,immediate:n=!1,lock:r=!1,programmatic:s=!0,lerp:d=s?this.options.lerp:void 0,duration:u=s?this.options.duration:void 0,easing:a=s?this.options.easing:void 0,onStart:l,onComplete:i,force:f=!1,userData:y}={}){if(!((this.isStopped||this.isLocked)&&!f)){if(typeof e=="string"&&["top","left","start","#"].includes(e))e=0;else if(typeof e=="string"&&["bottom","right","end"].includes(e))e=this.limit;else{let h;if(typeof e=="string"?(h=document.querySelector(e),h||(e==="#top"?e=0:console.warn("Lenis: Target not found",e))):e instanceof HTMLElement&&(e!=null&&e.nodeType)&&(h=e),h){if(this.options.wrapper!==window){const m=this.rootElement.getBoundingClientRect();t-=this.isHorizontal?m.left:m.top}const p=h.getBoundingClientRect();e=(this.isHorizontal?p.left:p.top)+this.animatedScroll}}if(typeof e=="number"){if(e+=t,e=Math.round(e),this.options.infinite){if(s){this.targetScroll=this.animatedScroll=this.scroll;const h=e-this.animatedScroll;h>this.limit/2?e=e-this.limit:h<-this.limit/2&&(e=e+this.limit)}}else e=tt(0,e,this.limit);if(e===this.targetScroll){l==null||l(this),i==null||i(this);return}if(this.userData=y??{},n){this.animatedScroll=this.targetScroll=e,this.setScroll(this.scroll),this.reset(),this.preventNextNativeScrollEvent(),this.emit(),i==null||i(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()});return}s||(this.targetScroll=e),typeof u=="number"&&typeof a!="function"?a=He:typeof a=="function"&&typeof u!="number"&&(u=1),this.animate.fromTo(this.animatedScroll,e,{duration:u,easing:a,lerp:d,onStart:()=>{r&&(this.isLocked=!0),this.isScrolling="smooth",l==null||l(this)},onUpdate:(h,p)=>{this.isScrolling="smooth",this.lastVelocity=this.velocity,this.velocity=h-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=h,this.setScroll(this.scroll),s&&(this.targetScroll=h),p||this.emit(),p&&(this.reset(),this.emit(),i==null||i(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()}),this.preventNextNativeScrollEvent())}})}}}preventNextNativeScrollEvent(){this._preventNextNativeScrollEvent=!0,requestAnimationFrame(()=>{this._preventNextNativeScrollEvent=!1})}checkNestedScroll(e,{deltaX:t,deltaY:n}){const r=Date.now(),s=e._lenis??(e._lenis={});let d,u,a,l,i,f,y,h;const p=this.options.gestureOrientation;if(r-(s.time??0)>2e3){s.time=Date.now();const D=window.getComputedStyle(e);s.computedStyle=D;const v=D.overflowX,N=D.overflowY;if(d=["auto","overlay","scroll"].includes(v),u=["auto","overlay","scroll"].includes(N),s.hasOverflowX=d,s.hasOverflowY=u,!d&&!u||p==="vertical"&&!u||p==="horizontal"&&!d)return!1;i=e.scrollWidth,f=e.scrollHeight,y=e.clientWidth,h=e.clientHeight,a=i>y,l=f>h,s.isScrollableX=a,s.isScrollableY=l,s.scrollWidth=i,s.scrollHeight=f,s.clientWidth=y,s.clientHeight=h}else a=s.isScrollableX,l=s.isScrollableY,d=s.hasOverflowX,u=s.hasOverflowY,i=s.scrollWidth,f=s.scrollHeight,y=s.clientWidth,h=s.clientHeight;if(!d&&!u||!a&&!l||p==="vertical"&&(!u||!l)||p==="horizontal"&&(!d||!a))return!1;let m;if(p==="horizontal")m="x";else if(p==="vertical")m="y";else{const D=t!==0,v=n!==0;D&&d&&a&&(m="x"),v&&u&&l&&(m="y")}if(!m)return!1;let S,w,I,b,g;if(m==="x")S=e.scrollLeft,w=i-y,I=t,b=d,g=a;else if(m==="y")S=e.scrollTop,w=f-h,I=n,b=u,g=l;else return!1;return(I>0?S<w:S>0)&&b&&g}get rootElement(){return this.options.wrapper===window?document.documentElement:this.options.wrapper}get limit(){return this.options.naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?"x":"y"]}get isHorizontal(){return this.options.orientation==="horizontal"}get actualScroll(){const e=this.options.wrapper;return this.isHorizontal?e.scrollX??e.scrollLeft:e.scrollY??e.scrollTop}get scroll(){return this.options.infinite?hn(this.animatedScroll,this.limit):this.animatedScroll}get progress(){return this.limit===0?1:this.scroll/this.limit}get isScrolling(){return this._isScrolling}set isScrolling(e){this._isScrolling!==e&&(this._isScrolling=e,this.updateClassName())}get isStopped(){return this._isStopped}set isStopped(e){this._isStopped!==e&&(this._isStopped=e,this.updateClassName())}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this.updateClassName())}get isSmooth(){return this.isScrolling==="smooth"}get className(){let e="lenis";return this.options.autoToggle&&(e+=" lenis-autoToggle"),this.isStopped&&(e+=" lenis-stopped"),this.isLocked&&(e+=" lenis-locked"),this.isScrolling&&(e+=" lenis-scrolling"),this.isScrolling==="smooth"&&(e+=" lenis-smooth"),e}updateClassName(){this.cleanUpClassName(),this.rootElement.className=`${this.rootElement.className} ${this.className}`.trim()}cleanUpClassName(){this.rootElement.className=this.rootElement.className.replace(/lenis(-\w+)?/g,"").trim()}};const gn=({transition:e=1.2,easing:t,orientation:n="vertical",smoothTouch:r=!1,touchMultiplier:s=2,children:d})=>{const u=o.useRef(null),a=o.useRef(null);return o.useEffect(()=>{let l;typeof e=="string"?e.endsWith("ms")?l=parseFloat(e)/1e3:e.endsWith("s")?l=parseFloat(e):l=parseFloat(e)||1.2:l=e;const i=y=>1-Math.pow(1-y,5);u.current=new vn({duration:l,easing:t??i,orientation:n,smoothWheel:!0,touchMultiplier:s,syncTouch:r});const f=y=>{var h;(h=u.current)==null||h.raf(y),a.current=requestAnimationFrame(f)};return a.current=requestAnimationFrame(f),()=>{var y;a.current!==null&&cancelAnimationFrame(a.current),(y=u.current)==null||y.destroy(),u.current=null}},[e,t,n,r,s]),d?c.jsx(c.Fragment,{children:d}):null},me=({style:e,colorName:t,stateClassName:n="state-ripple-group",children:r,className:s})=>{const d=o.useRef(null),u=o.useRef(null),[a,l]=o.useState(!1),i=st({isClient:a,stateClassName:n,className:s,colorName:t});return o.useEffect(()=>{if(d.current&&n!=="state-layer"){const y=(n.includes("[")?"group/"+n.split("[")[1].split("]")[0]:"group").replace(/\//g,"\\/"),h=d.current.closest(`.${y}:not(.${y} .${y})`);u.current=h}l(!0)},[]),c.jsxs("div",{ref:d,className:i.stateLayer,style:{"--state-color":`var(--default-color, var(--color-${t}))`,...e},children:[a&&c.jsx(Ge,{triggerRef:u}),r]})},wn=({isClient:e,stateClassName:t})=>({stateLayer:x(["w-full top-0 left-0 h-full absolute pointer-events-none overflow-hidden",t])}),st=Q("stateLayer",wn),rt=({targetRef:e,children:t})=>{const[n,r]=o.useState(null),s=o.useRef(null),d=()=>{const u=e.current;if(!u)return;const a=u.getBoundingClientRect();r({position:"fixed",top:a.top,left:a.left,width:a.width,height:a.height,pointerEvents:"none",zIndex:999})};return o.useEffect(()=>{const u=e.current;if(u)return d(),window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),s.current=new ResizeObserver(d),s.current.observe(u),()=>{var a;window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d),(a=s.current)==null||a.disconnect()}},[e]),n?Ue.createPortal(c.jsx("div",{style:n,children:t}),document.body):null};function bn(e){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e)}const Sn=({config:e,throttleDelay:t=100,onLoad:n,loadTheme:r=!1})=>{const[s,d]=o.useState(null);o.useEffect(()=>{(async()=>{const h=await be.loader(e,r);d(h)})()},[]);const[u,a]=o.useState(null),l=o.useRef(null),i=o.useRef(0),f=o.useRef(null);o.useEffect(()=>{if(!s)return;const h={...e,sourceColor:e.sourceColor},p=Date.now(),m=p-i.current,S=async w=>{await y(w)};if(i.current===0||m>=t)l.current&&(clearTimeout(l.current),l.current=null),f.current=null,i.current=p,S(h);else if(f.current=h,!l.current){const w=Math.max(0,t-m);l.current=setTimeout(async()=>{l.current=null;const I=f.current;f.current=null,I&&(i.current=Date.now(),await S(I))},w)}return()=>{}},[e,t,s]);const y=async h=>{if(typeof h.sourceColor=="string"&&!bn(h.sourceColor))throw new Error("Invalid hex color");if(!s)return;s.context.update(h),await s.load();const p=s==null?void 0:s.plugins.getPlugin(Ke.TailwindPlugin).getInstance().outputCss;a(p),n==null||n(s)};return o.useEffect(()=>()=>{l.current&&(clearTimeout(l.current),l.current=null)},[]),u?c.jsx("style",{dangerouslySetInnerHTML:{__html:u}}):null};function Nn(){if(typeof window>"u")return!1;try{if(window.CSS&&typeof window.CSS.supports=="function")return CSS.supports("animation-timeline: view()")||CSS.supports("animation-timeline: scroll()")||CSS.supports("view-timeline-name: --a")}catch{}return!1}function En(){return typeof window>"u"||!("matchMedia"in window)?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function Ie(e){if(!(e instanceof HTMLElement))return!1;const t=e.classList;return Array.from(t).some(n=>n.startsWith("anim-")&&n.includes("scroll"))}function Oe(e){if(!(e instanceof HTMLElement))return!1;const t=e.classList;return Array.from(t).some(n=>n.startsWith("anim-"))}function Ee(e,t){if(!Ie(e))return;if(e.hasAttribute(`data-${t}-scroll`)){const u=(e.getAttribute(`data-${t}-scroll`)||"").trim().toLowerCase(),a=u==="x"||u==="inline"?"inline":u==="y"||u==="block"?"block":"auto";e.classList.contains(`${t}-timeline`)||e.classList.contains(`${t}-timeline-inline`)||e.classList.contains(`${t}-timeline-block`)||e.classList.contains(`${t}-timeline-x`)||e.classList.contains(`${t}-timeline-y`)||(a==="inline"?e.classList.add(`${t}-timeline-inline`):a==="block"?e.classList.add(`${t}-timeline-block`):e.classList.add(`${t}-scroll`))}const n=e.getAttribute(`data-${t}-start`);n&&e.style.setProperty(`--${t}-range-start`,n);const r=e.getAttribute(`data-${t}-end`);r&&e.style.setProperty(`--${t}-range-end`,r);const s=e.hasAttribute(`data-${t}-paused`)||e.classList.contains(`${t}-paused`),d=e.hasAttribute(`data-${t}-run`)||e.classList.contains(`${t}-run`);!s&&!d&&e.setAttribute(`data-${t}-run`,"")}function ke(e=document,t){return Array.from(e.querySelectorAll(`[class*="${t}-"][class*="-scroll"]`)).filter(r=>Ie(r))}function kn(e=document,t){const n=Array.from(e.querySelectorAll(`[class*="${t}-"]`)),r=new Set([`${t}-run`,`${t}-in`,`${t}-out`,`${t}-in-run`,`${t}-out-run`,`${t}-paused`,`${t}-timeline`,`${t}-timeline-inline`,`${t}-timeline-block`,`${t}-timeline-x`,`${t}-timeline-y`,`${t}-scroll`]);return n.filter(s=>{if(!(s instanceof HTMLElement))return!1;const d=s.classList;return d.contains(`${t}-in`)||d.contains(`${t}-out`)||Array.from(d).some(l=>l.startsWith(`${t}-`)&&!l.includes("scroll")&&!r.has(l))?!0:!Ie(s)})}function jn(e,t){return Array.from(e).some(n=>n.startsWith(t)&&n.includes("-out"))}function Ve(e,t,n){e.setAttribute(`data-${t}-run`,""),e.setAttribute(`data-${t}-${n}-run`,"")}function ze(e,t,n){const r=e.style.animationName;e.style.animationName="none",e.removeAttribute(`data-${t}-run`),n?e.removeAttribute(`data-${t}-${n}-run`):(e.removeAttribute(`data-${t}-in-run`),e.removeAttribute(`data-${t}-out-run`)),e.offsetWidth,e.style.animationName=r}const Ln=[0,.2],Ye=new WeakSet;function _e(e,t){if(Ye.has(e))return;Ye.add(e);const n=s=>{s.target===e&&(e.hasAttribute(`data-${t}-in-run`)||e.hasAttribute(`data-${t}-out-run`))&&e.setAttribute(`data-${t}-animating`,"")},r=s=>{s.target===e&&e.removeAttribute(`data-${t}-animating`)};e.addEventListener("animationstart",n),e.addEventListener("animationend",r),e.addEventListener("animationcancel",r)}function Me(e={}){const{prefix:t="anim",once:n=!0}=e;if(En())return()=>{};const r=Nn(),s=new WeakSet;let d=typeof window<"u"&&(window.pageYOffset||window.scrollY)||0,u=!0;const a=()=>{const p=window.pageYOffset||window.scrollY||0;u=p>=d,d=p};typeof window<"u"&&window.addEventListener("scroll",a,{passive:!0});const l=new IntersectionObserver(p=>{for(const m of p){const S=m.target;if(!Oe(S)||S.hasAttribute(`data-${t}-animating`))continue;const w=jn(S.classList,t);m.isIntersecting?(w&&ze(S,t,"out"),Ve(S,t,"in"),n&&l.unobserve(S)):n||(u||ze(S,t,"in"),w&&Ve(S,t,"out"))}},{threshold:Ln}),i=p=>{const m=kn(p||document,t);for(const S of m)s.has(S)||(s.add(S),l.observe(S),_e(S,t))};i();let f,y=null,h=null;if(r)(()=>{h==null&&(h=requestAnimationFrame(()=>{h=null;const m=ke(void 0,t);for(const S of m)Ee(S,t)}))})(),y=new MutationObserver(m=>{for(const S of m)if(S.type==="attributes"){const w=S.target;w instanceof HTMLElement&&(Ee(w,t),Oe(w)&&(s.has(w)||(s.add(w),l.observe(w),_e(w,t))))}else if(S.type==="childList"&&S.addedNodes&&S.addedNodes.length){for(const w of Array.from(S.addedNodes))if(w instanceof HTMLElement){const I=ke(w,t);for(const b of I)Ee(b,t);i(w)}}}),y.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["class",`data-${t}-scroll`,`data-${t}-start`,`data-${t}-end`,`data-${t}-paused`,`data-${t}-run`]}),f=()=>{h!=null&&cancelAnimationFrame(h),y&&y.disconnect()};else{let p;ke(void 0,t).length>0&&Promise.resolve().then(()=>require("./scrollDriven-DWAu7CR0.cjs")).then(S=>{p=S.initScrollViewFallback({once:n})}),f=()=>{typeof p=="function"&&p()}}return()=>{f&&f(),typeof window<"u"&&window.removeEventListener("scroll",a),l.disconnect()}}const In=Me,Mn=Me,Ce=({anchorRef:e,position:t="bottom",children:n,style:r})=>{const d=`--anchor-${o.useId().replace(/:/g,"")}`,[u,a]=o.useState(!1);if(o.useLayoutEffect(()=>{typeof CSS<"u"&&CSS.supports("anchor-name","--a")&&a(!0)},[]),o.useLayoutEffect(()=>{if(u&&e.current){const i=e.current;return i.style.anchorName=d,()=>{e.current&&(e.current.style.anchorName="")}}},[u,e,d]),u){const f={position:"fixed",margin:0,zIndex:9999,positionAnchor:d,positionArea:{top:"top",bottom:"bottom",left:"left",right:"right","top-left":"top left","top-right":"top right","bottom-left":"bottom left","bottom-right":"bottom right"}[t],positionTryFallbacks:"flip-block, flip-inline",...r};return c.jsx("div",{style:f,children:n})}const l={position:"absolute",pointerEvents:"auto",...r};switch(t){case"top":l.bottom="100%",l.left="50%",l.transform="translateX(-50%)";break;case"top-left":l.bottom="100%",l.left=0;break;case"top-right":l.bottom="100%",l.right=0;break;case"bottom":l.top="100%",l.left="50%",l.transform="translateX(-50%)";break;case"bottom-left":l.top="100%",l.left=0;break;case"bottom-right":l.top="100%",l.right=0;break;case"left":l.right="100%",l.top="50%",l.transform="translateY(-50%)";break;case"right":l.left="100%",l.top="50%",l.transform="translateY(-50%)";break}return c.jsx(rt,{targetRef:e,children:c.jsx("div",{style:l,children:n})})},ot=({variant:e,disableTextMargins:t,disabled:n,iconPosition:r,icon:s,isActive:d,loading:u,shape:a,onToggle:l,size:i,allowShapeTransformation:f})=>({button:x(" relative cursor-pointer group/button outline-none inline-block flex justify-center items-center ",i==="xSmall"&&"text-label-large px-3 py-1.5 gap-1",i==="small"&&"text-label-large px-4 py-2.5 gap-2",i==="medium"&&"text-title-medium px-6 py-4 gap-2",i==="large"&&"text-headline-small px-12 py-8 gap-3",i==="xLarge"&&"text-headline-large px-16 py-12 gap-4",a==="rounded"&&{"rounded-[30px]":i==="xSmall"||i=="small","rounded-[40px]":i==="medium","rounded-[70px]":i==="large"||i=="xLarge"},(a==="squared"||f&&d)&&{"rounded-[12px]":i==="xSmall"||i=="small","rounded-[16px]":i==="medium","rounded-[28px]":i==="large"||i=="xLarge"},f&&!n&&{"active:rounded-[12px]":i==="xSmall"||i=="small","active:rounded-[16px]":i==="medium","active:rounded-[28px]":i==="large"||i=="xLarge"},e==="elevated"&&{"shadow-1 hover:shadow-2":!n,"bg-surface-container-low text-primary":!n&&!d,"bg-primary text-on-primary":!n&&d,"text-on-surface/[38%]":n},e==="filled"&&{"hover:shadow-1":!n,"bg-surface-container text-on-surface-variant":!n&&!d&&l,"bg-primary text-on-primary":!n&&(d&&l||!l),"text-on-surface/[38%]":n},e==="tonal"&&{"hover:shadow-1":!n,"bg-secondary-container text-on-secondary-container":!n&&!d,"bg-secondary text-on-secondary":!n&&d,"text-on-surface/[0.38]":n},e==="outlined"&&[" border",{"border-on-surface/[0.12] text-on-surface/[0.38]":n,"text-primary border-outline focus:border-primary":!n&&!d,"text-inverse-on-surface bg-inverse-surface border-inverse-surface":!n&&d}],e==="text"&&["w-fit",{"text-primary":!n,"text-on-surface/[0.38]":n},t&&[i==="xSmall"&&"-mx-3 ",i==="small"&&"-mx-4 ",i==="medium"&&"-mx-6 ",i==="large"&&"-mx-12",i==="xLarge"&&"-mx-16 "]],n&&"cursor-default"),touchTarget:x("absolute -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/2 h-12 w-full"),stateLayer:x("overflow-hidden",a==="rounded"&&{"rounded-[30px]":i==="xSmall"||i=="small","rounded-[40px]":i==="medium","rounded-[70px]":i==="large"||i=="xLarge"},(a==="squared"||f&&d)&&{"rounded-[12px]":i==="xSmall"||i=="small","rounded-[16px]":i==="medium","rounded-[28px]":i==="large"||i=="xLarge"},f&&!n&&{"group-active/button:rounded-[12px]":i==="xSmall"||i=="small","group-active/button:rounded-[16px]":i==="medium","group-active/button:rounded-[28px]":i==="large"||i=="xLarge"}),label:x({invisible:u}),icon:x({invisible:u},i==="xSmall"&&"size-5",i==="small"&&"size-5",i==="medium"&&"size-6",i==="large"&&"size-8",i==="xLarge"&&"size-10")}),Cn=te("button",ot),it=Q("button",ot),lt=({variant:e,isInteractive:t})=>({card:x(" rounded-xl overflow-hidden ",e==="outlined"&&"bg-surface border border-outline-variant",e==="elevated"&&"bg-surface-container-low shadow-1",e==="filled"&&"bg-surface-container-highest",{"group/card":t})}),Rn=te("card",lt),at=Q("card",lt),Re=({width:e})=>({carouselItem:x("rounded-[28px] overflow-hidden flex-none",{hidden:e===void 0,"flex-1":e==null})}),Dn=te("carouselItem",Re),ct=Q("carouselItem",Re),ut=()=>({carousel:x(["w-full h-[400px]"]),track:x("flex h-full w-full")}),Fn=te("carousel",ut),dt=Q("carousel",ut),ft=({isChecked:e,isIndeterminate:t,isDisabled:n,isError:r,isFocused:s,isHovered:d})=>({checkbox:x("inline-flex items-center justify-center relative size-4.5 ",{"pointer-events-none opacity-[0.38]":n}),input:x("absolute inset-0 w-full h-full opacity-0 z-10 cursor-pointer"),container:x("relative flex items-center justify-center w-[18px] h-[18px] "),box:x("absolute left-1/2 top-1/2 -translate-1/2 to rounded-[2px] size-4 border-2 transition-colors duration-200",!e&&!t&&{"border-on-surface-variant":!r&&!n,"border-error":r&&!n,"border-on-surface":n},(e||t)&&{"bg-primary border-primary":!r&&!n,"bg-error border-error":r&&!n,"bg-on-surface border-on-surface":n}),icon:x("z-10 relative text-on-primary w-full h-full flex items-center justify-center pointer-events-none",{"text-on-error":r&&!n,"text-surface":n}),stateLayer:"size-10 state-ripple-group-[checkbox] rounded-full cursor-pointer pointer-events-auto absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2"}),An=te("checkbox",ft),ht=Q("checkbox",ft),mt=({variant:e,disabled:t,trailingIcon:n,icon:r,isActive:s,isInteractive:d,activated:u,isFocused:a,isDragging:l,isEditing:i})=>({chip:x(" group/chip px-3 py-1.5 rounded-lg flex items-center gap-2 outline-none",{"pl-2":r,"pr-2":n,"cursor-pointer":!t&&d},{" text-on-surface-variant":!u&&!a||i,"bg-secondary-container text-on-secondary-container":(u||a)&&!i},l&&["opacity-100 cursor-grabbing shadow-3"],e==="outlined"&&["border border-outline-variant",{"border-transparent":i}],e==="elevated"&&!i&&["shadow-1 bg-surface-container-low","border border-outline-variant"]),stateLayer:x("rounded-lg overflow-hidden",{}),label:x("outline-none text-nowrap",{"opacity-[0.38]":t}),leadingIcon:x("text-primary size-[18px]",{"opacity-[0.38]":t}),trailingIcon:x("cursor-pointer size-[18px]",{"opacity-[0.38]":t})}),$n=te("chip",mt),pt=Q("chip",mt),yt=({scrollable:e})=>({chips:x(" flex gap-3 outline-none",{"flex-wrap":!e,"overflow-x-auto":e})}),Wn=te("chips",yt),xt=Q("chips",yt),vt=({orientation:e})=>({divider:x("border-outline-variant ",{"h-fit w-full border-t":e==="horizontal"},{"h-auto self-stretch w-fit border-l":e==="vertical"})}),Pn=te("divider",vt),gt=Q("divider",vt),wt=({size:e,variant:t,extended:n})=>({fab:x("flex shadow-3 hover:shadow-4 group/fab overflow-hidden outline-none items-center cursor-pointer",{"rounded-[12px]":e=="small","rounded-[16px]":e=="medium","rounded-[28px]":e=="large"},{"p-2":e=="small","p-4":e=="medium","p-[30px]":e=="large"},t==="primary"&&"bg-primary text-on-primary",t==="secondary"&&"bg-secondary text-on-secondary",t==="tertiary"&&"bg-tertiary text-on-tertiary",t==="primaryContainer"&&"bg-primary-container text-on-primary-container",t==="secondaryContainer"&&"bg-secondary-container text-on-secondary-container",t==="tertiaryContainer"&&"bg-tertiary-container text-on-tertiary-container"),icon:x({"size-6":e=="small"||e=="medium","size-9":e=="large"}),label:x("text-nowrap",{"text-title-medium":e=="small","text-title-large":e=="medium","text-headline-small":e=="large"})}),Bn=te("fab",wt),bt=Q("fab",wt),St=({size:e,variant:t,open:n})=>({fabMenu:x("relative inline-flex flex-col items-end"),actions:x("flex flex-col gap-1 items-end absolute bottom-[calc(100%_+_8px)] right-0"),label:x("text-nowrap")}),Tn=te("fabMenu",St),Nt=Q("fabMenu",St),Et=({variant:e,disabled:t,onToggle:n,isActive:r,size:s,width:d,shape:u,allowShapeTransformation:a})=>({iconButton:x("rounded-full relative flex transition-all duration-300","group/icon-button cursor-pointer",{"cursor-default":t},u==="rounded"&&{"rounded-[30px]":s==="xSmall"||s=="small","rounded-[40px]":s==="medium","rounded-[70px]":s==="large"||s=="xLarge"},(u==="squared"||a&&r)&&{"rounded-[12px]":s==="xSmall"||s=="small","rounded-[16px]":s==="medium","rounded-[28px]":s==="large"||s=="xLarge"},a&&!t&&{"active:rounded-[12px]":s==="xSmall"||s=="small","active:rounded-[16px]":s==="medium","active:rounded-[28px]":s==="large"||s=="xLarge"},e==="filled"&&[!t&&{"bg-surface-container":!r&&!!n,"bg-primary":r||!n},!!t&&"bg-on-surface/[0.12]"],e==="tonal"&&[!t&&{"bg-secondary-container text-on-secondary-container":!r&&!!n,"bg-secondary text-on-secondary":r||!n},!!t&&"bg-on-surface/[0.12]"],e==="outlined"&&[!t&&{"border border-outline":!r,"border border-transparent bg-inverse-surface":r},!!t&&{"border border-on-surface/[0.12]":!r,"border border-transparent bg-on-surface/[0.12]":r}]),touchTarget:x("absolute -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/2 h-12 w-full"),stateLayer:x("absolute top-0 left-0 h-full w-full overflow-hidden",(u==="rounded"||u==="squared"&&n&&!t&&r&&a)&&{"rounded-[30px]":s==="xSmall"||s=="small","rounded-[40px]":s==="medium","rounded-[70px]":s==="large"||s=="xLarge"},(u==="squared"||u==="rounded"&&n&&!t&&r&&a)&&{"rounded-[12px]":s==="xSmall"||s=="small","rounded-[16px]":s==="medium","rounded-[28px]":s==="large"||s=="xLarge"},a&&!t&&{"group-active/icon-button:rounded-[12px]":s==="xSmall"||s=="small","group-active/icon-button:rounded-[16px]":s==="medium","group-active/icon-button:rounded-[28px]":s==="large"||s=="xLarge"},!t&&[e==="standard"&&{"state-on-surface-variant":!r,"state-primary":r},e==="filled"&&{"state-primary":!r&&!!n,"state-inverse-on-surface":r||!n},e==="tonal"&&{"state-on-surface-variant":!r&&!!n,"state-on-secondary-container":r||!n},e==="outlined"&&{"state-on-surface-variant":!r,"state-on-primary":r}]),icon:x(" 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"},d=="narrow"&&[{"px-1":s==="xSmall"},{"px-1":s==="small"},{"px-3":s==="medium"},{"px-4":s==="large"},{"px-8":s==="xLarge"}],d=="wide"&&[{"px-2.5":s==="xSmall"},{"px-3.5":s==="small"},{"px-6":s==="medium"},{"px-12":s==="large"},{"px-[72px]":s==="xLarge"}],!t&&[e==="standard"&&{"text-on-surface-variant":!r,"text-primary":r},e==="filled"&&{"text-primary":!r&&!!n,"text-on-primary":r||!n},e==="outlined"&&{"text-on-surface-variant":!r,"text-inverse-on-surface":r}],!!t&&"text-on-surface/[0.38]")}),Hn=te("iconButton",Et),kt=Q("iconButton",Et),jt=({variant:e,isVisible:t})=>({progressIndicator:x((e==="linear-determinate"||e=="linear-indeterminate")&&"flex w-full h-1"),track:x("h-full rounded-full bg-primary rounded-l-full",{"max-h-0":!t,"max-h-full":t}),activeIndicator:x({"max-h-0":!t,"max-h-full":t},(e==="linear-determinate"||e=="linear-indeterminate")&&"h-full flex-1 rounded-full bg-primary-container",(e==="circular-determinate"||e=="circular-indeterminate")&&["stroke-primary fill-transparent ",{"stroke-[4px]":t,"stroke-[0px]":!t}]),stop:x("absolute top-1/2 -translate-y-1/2 right-0 bg-primary rounded-full size-1",{"max-h-0":!t,"max-h-full":t})}),On=te("progressIndicator",jt),Lt=Q("progressIndicator",jt),De=({variant:e,position:t})=>({sideSheet:x("bg-surface flex justify-between max-w-xs z-10",{"flex-row-reverse":t=="right","h-full":e=="standard"},e=="modal"&&["rounded-2xl fixed top-0 m-[1rem] h-[calc(100dvh-2rem)]",{"right-0":t=="right","left-0":t=="left"}]),container:x("w-full overflow-hidden flex flex-col",{}),header:x("p-4 flex items-center gap-2"),content:x("flex-1 overflow-y-auto"),title:x("text-on-surface-variant text-title-large"),closeButton:x("ml-auto"),divider:x({hidden:e=="modal"}),overlay:x("bg-[black]/[0.32] fixed top-0 left-0 w-screen h-screen")}),It=te("sideSheet",De),Vn=Q("sideSheet",De),Fe=({isChanging:e})=>({slider:x(["relative w-full h-11 flex items-center rounded gap-x-1.5 cursor-pointer min-w-32"]),activeTrack:x(["h-4 relative transition-all duration-100 bg-primary overflow-hidden rounded-l-full "]),inactiveTrack:x(["h-4 relative transition-all duration-100 bg-primary-container rounded-r-full overflow-hidden"]),handle:x(["transform relative transition-all duration-100 bg-primary h-full rounded-full ",{"w-0.5":e,"w-1":!e}]),valueIndicator:x(["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:x(["h-1 w-1 absolute transform -translate-y-1/2 -translate-x-1/2 top-1/2 rounded-full"])}),zn=te("slider",Fe),Mt=Q("slider",Fe),Ct=()=>({snackbar:x(" rounded bg-inverse-surface "),container:x("pl-4 pr-2 max-w-full py-1 flex items-center flex-wrap"),supportingText:x("text-body-medium text-inverse-on-surface "),icon:x(" ml-auto mr-0 text-inverse-on-surface block dark")}),Yn=te("snackbar",Ct),Rt=Q("snackbar",Ct),Dt=({isSelected:e,disabled:t,inactiveIcon:n})=>({switch:x("group/switch w-[52px] h-[32px] outline-none rounded-full border-2 flex items-center",{"bg-on-surface/[0.12] border-transparent":t},!t&&["cursor-pointer ",{"bg-primary border-primary":e},{"bg-surface-container border-outline":!e}]),handleContainer:x("flex items-center justify-center absolute",{"left-[14px]":!e},{"right-[14px]":e}),handle:x("transition-all duration-100 z-10 rounded-full flex items-center justify-center",{"w-[16px] h-[16px]":!e&&!n},{"w-[24px] h-[24px]":!(!e&&!n)},!t&&["cursor-pointer group-active/switch:h-[28px] group-active/switch:w-[28px]",{"bg-on-primary group-hover/switch:bg-primary-container":e},{"bg-outline group-hover/switch:bg-on-surface-variant":!e}],{"bg-surface":t}),handleStateLayer:x("w-[40px] h-[40px] -z-10 rounded-full absolute",{"group-state-primary":!t}),icon:x("w-[16px] h-[16px]",!t&&[{"text-on-primary-container":e},{"text-on-primary":!e}],{"text-on-surface/[0.38]":t})}),_n=te("switch",Dt),Ft=Q("switch",Dt),At=({isSelected:e,icon:t,label:n,variant:r})=>({tab:x("flex-1 group/tab outline-none flex px-4 justify-center items-center cursor-pointer",{"z-10":e},!!(t&&n)&&r==="primary"&&"h-16",!(t&&n&&r==="primary")&&"h-12"),stateLayer:x("absolute w-full h-full overflow-hidden left-1/2 top-1/2 transform -translate-y-1/2 -translate-x-1/2",r==="primary"&&{"group-hover/tab:hover-state-on-surface group-focus-visible/tab:focus-state-on-surface":!e,"group-hover/tab:hover-state-primary group-focus-visible/tab:focus-state-primary":e},r==="secondary"&&"group-hover/tab:hover-state-on-surface group-focus-visible/tab:focus-state-on-surface"),content:x("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:x("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:x("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:x("bg-primary absolute w-full left-0 bottom-0",r==="primary"&&"h-[3px] rounded-t",r==="secondary"&&"h-0.5")}),qn=te("tab",At),$t=Q("tab",At),Wt=({scrollable:e})=>({tabs:x("border-b border-surface-container-highest bg-surface","flex relative ",{"overflow-x-auto":e})}),Xn=te("tabs",Wt),Pt=Q("tabs",Wt),Bt=()=>({tabPanels:x("overflow-hidden")}),Un=te("tabPanels",Bt),Tt=Q("tabPanels",Bt),Ht=()=>({tabPanel:x("")}),Kn=te("tabPanel",Ht),Ot=Q("tabPanel",Ht),Vt=({disabled:e,leadingIcon:t,trailingIcon:n,variant:r,errorText:s,isFocused:d,value:u,suffix:a,multiline:l})=>({textField:x({"opacity-[.38]":e}),content:x("group/text-field transition-border duration-200 relative flex items-center ",{"h-14":!l},{"border-on-surface-variant":!(s!=null&&s.length)&&!d&&r=="filled","border-outline":!(s!=null&&s.length)&&!d&&r=="outlined","border-primary":!(s!=null&&s.length)&&d,"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]":d}]),stateLayer:x("absolute -z-10 w-full h-full top-0 left-0",{hidden:r=="outlined"},{"group-state-on-surface":!e,"focus-state-on-surface":d}),label:x("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)&&d}),input:x("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":!!a},r=="filled"&&" pb-2 pt-6",r=="outlined"&&"py-4 relative z-10"),activeIndicator:x("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":d}]),supportingText:x(" text-body-small px-4 pt-1",{"text-on-surface-variant":!e&&!(s!=null&&s.length)},{"text-on-surface":e},{"!w-full":d},{"text-error":!!(s!=null&&s.length)}),leadingIcon:x(["h-12 ml-3 flex items-center justify-center",{"cursor-text":!o.isValidElement(t)}]),trailingIcon:x("h-12 w-12 flex items-center justify-center",{"cursor-text":!o.isValidElement(n)}),suffix:x("text-on-surface-variant pl-0 pr-4",r=="filled"&&" pb-2 pt-6",r=="outlined"&&"py-4 relative z-10")}),Gn=te("textField",Vt),zt=Q("textField",Vt),Yt=({position:e,variant:t})=>({toolTip:x(" pointer-events-auto w-max z-10 absolute m-1 w-max-content max-w-[312px]",t=="rich"&&"bg-surface-container rounded-2xl text-on-surface-container shadow-2",t=="plain"&&"bg-inverse-surface rounded text-inverse-on-surface ",{"bottom-full left-1/2 -translate-x-1/2":e=="top","top-full left-1/2 -translate-x-1/2":e=="bottom","right-full top-1/2 -translate-y-1/2":e=="left","left-full top-1/2 -translate-y-1/2":e=="right","bottom-full right-full":e=="top-left","bottom-full left-full":e=="top-right","top-full right-full":e=="bottom-left","top-full left-full":e=="bottom-right"}),container:x("pb-2",t=="rich"&&"px-4 pt-3 ",t=="plain"&&"px-2 py-1"),actions:x("flex gap-10 px-1 mt-2",t=="plain"&&"hidden"),subHead:x("text-title-small mb-1",t=="plain"&&"hidden"),supportingText:x(""),content:x("w-full")}),Jn=te("toolTip",Yt),_t=Q("toolTip",Yt),ce=({icon:e,colors:t=[],className:n,...r})=>{if(typeof e=="string"){let f=e;return t[0]&&(f=f.replace(/<svg([^>]*)>/,`<svg$1 fill="${t[0]}" color="${t[0]}">`),f=f.replace(/<path([^>]*?)>/g,'<path$1 fill="currentColor">')),c.jsx("div",{className:x("size-5 box-content inline-flex fill-current",n),style:{color:t[0]||"inherit"},dangerouslySetInnerHTML:{__html:f}})}if(e&&typeof e=="object"&&"src"in e){const f=e;return c.jsx("img",{src:f.src,width:f.width,height:f.height,className:x("size-5 box-content",n),style:{filter:t[0]?"brightness(0) saturate(100%) invert(1)":void 0},alt:"","aria-hidden":"true"})}const s=e;if(!(s!=null&&s.prefix))throw new Error(`Invalid icon type: ${typeof e}`);const{icon:d}=s,[u,a,,,l]=d||[],i=f=>{switch(f.length){case 2:return{"--fa-primary-color":f[0]||"inherit","--fa-secondary-color":f[1]||"inherit"};case 1:return{color:f[0]};default:return{}}};return c.jsx("svg",{className:x("size-5 box-content",n),style:{...i(t)},xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${u} ${a}`,role:"img","aria-hidden":"true",...r,children:typeof l=="string"?c.jsx("path",{className:"fill-current",d:l}):l.map((f,y)=>c.jsx("path",{d:f},y))})},qt=({variant:e="linear-determinate",value:t=0,transitionDuration:n=1e3,className:r,...s})=>{const[d,u]=o.useState(t),[a]=o.useState(1.5);o.useEffect(()=>{t>100&&(t=100),t<0&&(t=0),u(t)},[t]);const[l,i]=o.useState(!0),f=()=>l?a:a*.5;o.useEffect(()=>{if((e==="circular-indeterminate"||e==="linear-indeterminate")&&d!==100){const m=setInterval(()=>{u(l?10:90),i(!l)},f()*1e3);return()=>clearInterval(m)}},[e,l,d]);const[y,h]=o.useState(!1);o.useEffect(()=>{if(d>=100){const m=setTimeout(()=>{h(!1)},n);return()=>{clearTimeout(m)}}else h(!0)},[d,n]);const p=Lt({className:r,variant:e,value:t,transitionDuration:n,isVisible:y});return c.jsxs(c.Fragment,{children:[(e==="linear-determinate"||e=="linear-indeterminate")&&c.jsxs("div",{className:p.progressIndicator,...s,children:[c.jsx("div",{style:{width:`${d}%`,transition:`width ${n}ms ease-in-out ${d==100?", max-height 200ms 0.5s ease-in-out":""}`},className:p.track}),c.jsx("div",{style:{marginLeft:d!=100?"6px":"0px",transition:`width ${n}ms ease-in-out ${d==100?`, max-height 200ms 0.5s ease-in-out, margin-left ${n}ms ${n/1.5}ms`:""}`},className:p.activeIndicator}),c.jsx("div",{style:{width:"4 px",transition:`width ${n}ms ease-in-out, max-height 200ms 0.5s ease-in-out`},className:p.stop})]}),(e==="circular-determinate"||e=="circular-indeterminate")&&c.jsx(X.motion.svg,{width:"48",height:"48",viewBox:"0 0 48 48",initial:{rotate:-90},animate:{rotate:270},transition:{repeat:1/0,duration:f(),ease:"linear"},className:p.progressIndicator,...s,children:c.jsx(X.motion.circle,{cx:"50%",cy:"50%",r:y?"calc(50% - 2px)":"50%",style:{strokeLinecap:"round"},initial:"hidden",animate:"visible",className:p.activeIndicator,variants:{hidden:{pathLength:l?10/100:90/100},visible:{pathLength:l?90/100:10/100}},transition:{pathLength:{type:"tween",ease:"linear",duration:f(),bounce:0}}})},l+"")]})};function Zn(e){const t={primary:"filled",secondary:"tonal"};return e&&e in t?t[e]:e||"filled"}const ye=({variant:e="filled",disabled:t=!1,icon:n,href:r,label:s,disableTextMargins:d,className:u,iconPosition:a="left",loading:l=!1,shape:i="rounded",onClick:f,onToggle:y,activated:h,ref:p,size:m="medium",allowShapeTransformation:S=!0,transition:w,children:I,...b})=>{if(I&&(s=I),!s)throw new Error("Button component requires either a label prop or children content");e=Zn(e);const g=r?"a":"button",H=o.useRef(null),D=p||H,[v,N]=o.useState(h);o.useEffect(()=>{N(h)},[h]),w={duration:.3,...w};const F=M=>{t&&M.preventDefault(),y?(N(!v),y(!v)):f&&f(M)},L=it({allowShapeTransformation:S,size:m,disableTextMargins:d,shape:i,href:r,disabled:t,icon:n,iconPosition:a,loading:l,variant:e,transition:w,className:u,isActive:v??!1,onToggle:y,activated:v,label:s,children:s}),W=n?c.jsx(ce,{icon:n,className:L.icon}):c.jsx(c.Fragment,{});return c.jsxs(g,{ref:D,href:r,className:L.button,...b,onClick:F,disabled:t,"aria-pressed":y?v:void 0,style:{transition:w.duration+"s"},children:[c.jsx("div",{className:L.touchTarget}),c.jsx(me,{style:{transition:w.duration+"s"},className:L.stateLayer,colorName:x(e==="filled"&&{"on-surface-variant":!v&&!!y,"on-primary":v||!y},e==="elevated"&&{"on-primary":v&&!!y,primary:!v||!y},e==="tonal"&&{"on-secondary":v&&!!y,"on-secondary-container":!v||!y},e==="outlined"&&{"inverse-on-surface":v&&!!y,"on-surface-variant":!v||!y},e==="text"&&"primary"),stateClassName:"state-ripple-group-[button]"}),a==="left"&&W,l&&c.jsx("div",{className:"!absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2",children:c.jsx(qt,{className:()=>({progressIndicator:"h-6 w-6",activeIndicator:x({"!stroke-primary":e==="elevated"&&!t,"!stroke-on-surface/[38%]":e==="elevated"&&t},{"!stroke-on-primary":e==="filled"&&!t,"!stroke-on-surface/[38%]":e==="filled"&&t},{"!stroke-on-secondary-container":e==="tonal"&&!t,"!stroke-on-surface/[38%]":e==="tonal"&&t},{"!stroke-primary":e==="outlined"&&!t,"!stroke-on-surface/[38%]":e==="outlined"&&t},{"!stroke-primary":e==="text"&&!t,"!stroke-on-surface/[38%]":e==="text"&&t})}),variant:"circular-indeterminate"})}),c.jsx("span",{className:L.label,children:s}),a==="right"&&W]})},Qn=({variant:e="outlined",className:t,children:n,interactive:r=!1,ref:s,...d})=>{const u=at({className:t,isInteractive:r,variant:e,children:n}),a=o.useRef(null),l=s||a;return c.jsxs("div",{...d,ref:l,className:u.card,children:[r&&c.jsx(me,{className:u.stateLayer,colorName:"on-surface",stateClassName:"state-ripple-group-[card]"}),n]})},xe=(e,t,n=[0,1])=>{const[r,s]=t,[d,u]=n,l=(Math.max(r,Math.min(e,s))-r)/(s-r);return d+l*(u-d)},Xt=({className:e,children:t,width:n,index:r=0,outputRange:s,ref:d,...u})=>{const a=o.useRef(null),l=d||a,i=ct({className:e,index:r,width:n,children:t,outputRange:s});return c.jsx("div",{ref:l,style:{width:n+"px",maxWidth:s[1]+"px",minWidth:s[0]+"px",willChange:"width"},transition:{duration:.5,ease:"linear"},className:i.carouselItem,...u,children:t})},es=({variant:e="hero",className:t,children:n,ref:r,marginPourcent:s=0,inputRange:d=[.21,.65],outputRange:u=[42,300],gap:a=8,onChange:l,onMetricsChange:i,index:f,scrollSensitivity:y=1.25,...h})=>{const p=o.useRef(null),m=r||p,[S,w]=o.useState(0),I=dt({index:f,className:t,children:n,variant:e,inputRange:d,outputRange:u,marginPourcent:s,onChange:l,gap:a,scrollSensitivity:y,onMetricsChange:i}),b=o.Children.toArray(n).filter(E=>o.isValidElement(E)&&E.type===Xt),g=o.useRef(null),[H,D]=o.useState({}),[v,N]=o.useState(null),F=o.useRef(0),L=o.useRef(null),W=()=>{var he,oe;if(!g.current||!m.current||(v==null?void 0:v.scrollProgress)===void 0)return[];const E=(v==null?void 0:v.scrollVisible)??((he=m.current)==null?void 0:he.clientWidth)??0;function $(U,re){return U.map((se,fe)=>{const ge=(se-re)/Math.abs(U[1]-U[0]);return{itemScrollXCenter:se,relativeIndex:ge,index:fe,width:0}})}const T=b.map((U,re)=>{if(!M[re].current||!g.current)return 0;const fe=re/(b.length-1);return xe(fe,[0,1],[0,1])}),Y=$(T,(v==null?void 0:v.scrollProgress)??0).sort((U,re)=>U.index-re.index);let _=(((oe=m.current)==null?void 0:oe.clientWidth)??E)+a+u[0]+a;const J=Y.sort((U,re)=>Math.abs(U.relativeIndex)-Math.abs(re.relativeIndex)).map((U,re)=>{if(!(_<=0)){if(re==0&&O(U.index),U.width=xe(_-a,[u[0],u[1]],[u[0],u[1]]),_-=U.width+a,_!=0&&_<(u[0]+a)*2){const se=U.width-((u[0]+a)*2-_);_+=U.width,U.width=se,_-=U.width}else if(_==0&&U.width>=u[0]*2+a){const se=U.width-(u[0]+a-_);_+=U.width,U.width=se,_-=U.width}return U}}).filter(Boolean),A=J.reverse(),q=[...J].sort((U,re)=>Math.abs(U.index)-Math.abs(re.index));A.forEach((U,re)=>{const se=A[re+1];if(!se)return;const fe=1-(Math.abs(U.relativeIndex)-Math.abs(se==null?void 0:se.relativeIndex)),ge=xe(fe,[0,2],[U.width+_,se.width]);_+=U.width,U.width=ge,_-=U.width});const ne=J.length/2,le=xe(Math.abs(q[0].relativeIndex),[q[0].index==0?0:ne-1,ne],[0,1]),ue=xe(le,[0,1],[0,1])*-(u[0]+a);return w(ue),Object.fromEntries(J.map(U=>[U.index,U.width]))},M=o.useRef([]).current,[z,O]=o.useState(0);o.useEffect(()=>{l&&l(z)},[z]),o.useEffect(()=>{typeof f=="number"&&b.length>0&&f!==z&&C(f)},[f,b.length]),o.useEffect(()=>{B(z)},[z]),M.length!==b.length&&b.forEach((E,$)=>{M[$]||(M[$]=o.createRef())});const[Z,B]=o.useState(0),C=(E,$={})=>{if(!b.length)return 0;const T=M[E];if(!T||!T.current||!g.current)return 0;const Y=xe(E/Math.max(1,b.length-1),[0,1],[0,1]);return B(E),g.current.dispatchEvent(new CustomEvent("udx:customScroll:set",{bubbles:!0,detail:{progress:Y,orientation:"horizontal",animate:$.animate!==!1}})),Y},R=b.map((E,$)=>{var J;const T=(J=E.props)==null?void 0:J.onClick,Y=A=>{T==null||T(A)},_=()=>B($);return o.cloneElement(E,{width:H[$],outputRange:u,ref:M[$],key:$,index:$,role:"option","aria-selected":z===$,tabIndex:z===$?0:-1,onClick:Y,onFocus:_})}),V=E=>{var $;if(E.scrollTotal>0){($=L.current)==null||$.stop();const T=F.current??0,Y=E.scrollProgress??0;L.current=X.animate(T,Y,{type:"spring",stiffness:260,damping:32,mass:.6,restDelta:5e-4,onUpdate:_=>{F.current=_,N({...E,scrollProgress:_})}})}};o.useEffect(()=>{const E=W();D(E)},[v]);const K=o.useRef(i);o.useEffect(()=>{K.current=i},[i]);const G=o.useRef(null);o.useEffect(()=>{var re;const E=K.current;if(!E||!(m!=null&&m.current))return;const $=b.length;if($<=0)return;const T=((re=m.current)==null?void 0:re.clientWidth)??0,Y=u[1],_=F.current??(v==null?void 0:v.scrollProgress)??0,J=(T+a)/(Y+a),A=Math.max(1,Math.floor(J)),q=Math.max(1,Math.round(A*(2/3))),ne=Math.min(Math.max(0,z),Math.max(0,$-1)),le=ne>0,ue=ne<$-1,he={total:$,selectedIndex:ne,visibleApprox:J,visibleFull:A,stepHalf:q,canPrev:le,canNext:ue,scrollProgress:_,viewportWidth:T,itemMaxWidth:Y,gap:a},oe=G.current;let U=!oe;if(!U){for(const se in he)if(he[se]!==oe[se]){U=!0;break}}U&&(G.current=he,E(he))},[m,b.length,z,v,a,u]),o.useEffect(()=>()=>{var E;(E=L.current)==null||E.stop()},[]);const[ee,k]=o.useState(0);o.useLayoutEffect(()=>{let E=u[1];v&&E>v.scrollVisible&&(E=v.scrollVisible);const $=(E+a)*R.length/y;k($)},[m,M,v]);const j=E=>{if(!b.length)return;const $=Z??z;switch(E.key){case"ArrowLeft":E.preventDefault(),C(Math.max(0,$-1));break;case"ArrowRight":E.preventDefault(),C(Math.min(b.length-1,$+1));break;case"Home":E.preventDefault(),C(0);break;case"End":E.preventDefault(),C(b.length-1);break;case"Enter":case" ":E.preventDefault(),C($);break}};return o.useEffect(()=>{const E=m.current;if(!E)return;const $=T=>{const Y=T.detail;Y&&typeof Y.index=="number"&&C(Y.index)};return E.addEventListener("udx:carousel:centerIndex",$),()=>{E.removeEventListener("udx:carousel:centerIndex",$)}},[m,b.length]),c.jsx("div",{className:I.carousel,ref:m,role:"listbox","aria-orientation":"horizontal",onKeyDown:j,...h,children:c.jsx(et,{draggable:!0,orientation:"horizontal",onScroll:V,scrollSize:ee,children:c.jsx("div",{className:I.track,ref:g,style:{gap:`${a}px`,translate:S,willChange:"translate"},children:R})})})};/*!
|
|
1
|
+
"use strict";var nn=Object.defineProperty;var sn=(e,t,n)=>t in e?nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var P=(e,t,n)=>sn(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),o=require("react"),X=require("motion/react"),Ue=require("clsx"),rn=require("tailwind-merge"),Ie=require("react-dom"),be=require("@udixio/theme"),Ke=require("@udixio/tailwind"),on=require("react-textarea-autosize"),Ge=({colorName:e="on-surface",triggerRef:t})=>{const n={initial:{opacity:1,"--r":"25%"},animate:{opacity:1,"--r":"100%",transition:{duration:.5}},exit:{opacity:0,"--r":"100%",transition:{duration:.3}}},[r,s]=o.useState(!0),[d,u]=o.useState(!1),[a,l]=o.useState({x:50,y:50});o.useEffect(()=>{d&&(s(!0),s(!1))},[d]),o.useEffect(()=>{const m=t==null?void 0:t.current;if(m)return m.addEventListener("mousedown",i),m.addEventListener("mouseup",y),m.addEventListener("mouseleave",f),()=>{m.removeEventListener("mousedown",i),m.removeEventListener("mouseup",y),m.removeEventListener("mouseleave",f)}},[t]);const i=m=>{const S=t==null?void 0:t.current,w=S.getBoundingClientRect();u(!0),l({x:(m.clientX-w.left)/S.clientWidth*100,y:(m.clientY-w.top)/S.clientHeight*100})},f=m=>{u(!1)},y=m=>{u(!1)},h=`color-mix(in srgb, var(--state-color,_var(--color-${e})) 10%, transparent)`,p={position:"absolute",inset:0,width:"100%",height:"100%","--x":a.x+"%","--y":a.y+"%","--r":"0%",background:`radial-gradient(ellipse at var(--x) var(--y), ${h} var(--r), transparent calc(var(--r) * 2))`,pointerEvents:"none"};return c.jsx(X.AnimatePresence,{mode:"wait",children:(d||!d&&!r)&&c.jsx(X.motion.div,{style:p,variants:n,initial:"initial",animate:"animate",exit:"exit",onAnimationComplete:()=>s(!0)})})},Je=rn.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"]}}}),x=(...e)=>Je(Ue.clsx(e)),Ze=(...e)=>Je(Ue.clsx(e));function ln(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 Ne=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 d=r(e.states);Object.entries(d).map(u=>{const[a,l]=u;(t[a]??(t[a]=[])).push(l)})}});const n=t;return Object.entries(t).map(r=>{let[s,d]=r;d=d.reverse(),s==e.default&&d.unshift("relative"),d.unshift(ln(s)),n[s]=Ze(...d)}),n},te=(e,t)=>n=>Ne({classNameList:[n.className,t],default:e,states:n}),Q=(e,t)=>n=>o.useMemo(()=>Ne({classNameList:[n.className,t],default:e,states:n}),[n]);function an(e,t,n){return o.useMemo(()=>Ne({classNameList:[n==null?void 0:n.className,t],default:e,states:n}),[e,t,n])}const Qe=te("customScroll",({orientation:e,draggable:t,isDragging:n})=>({customScroll:x("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:x("overflow-hidden flex-none sticky",{"left-0 h-full":e==="horizontal","top-0 w-full":e==="vertical"})}));function cn(e,t){let n=0,r=null,s=null;const d=(u,a)=>{n=Date.now(),t(u,a)};return(u,a)=>{const l=Date.now(),i=e-(l-n);i<=0?(r&&(clearTimeout(r),r=null),d(u,a)):(s={v:u,o:a},r||(r=setTimeout(()=>{r=null;const f=s;s=null,f&&d(f.v,f.o)},i)))}}const et=({children:e,orientation:t="vertical",scrollSize:n,onScroll:r,className:s,draggable:d=!1,throttleDuration:u=75,scroll:a,setScroll:l})=>{var ee,k;const i=o.useRef(null),f=o.useRef(null),[y,h]=o.useState({width:null,height:null});o.useEffect(()=>{if(!i.current)return;const j=new ResizeObserver(E=>{for(const $ of E)$.target===i.current&&h({width:$.contentRect.width,height:$.contentRect.height})});return j.observe(i.current),()=>{j.disconnect()}},[i]);const p=o.useRef(null),m=o.useRef(null),S=()=>{const j=f.current;return j?{width:n??j.scrollWidth,height:n??j.scrollHeight}:null},w=()=>{const j=i.current;return j?{width:j.clientWidth,height:j.clientHeight}:null},{scrollYProgress:I,scrollXProgress:b}=X.useScroll({container:i}),g=o.useRef(null);g.current||(g.current=cn(u,(j,E)=>{!m.current||!p.current||!i.current||(E===(t==="horizontal"?"x":"y")&&(l==null||l(j)),r&&(t==="horizontal"&&E==="x"&&r({scrollProgress:j,scroll:j*(p.current.width-i.current.clientWidth),scrollTotal:p.current.width-i.current.clientWidth,scrollVisible:m.current.width}),t==="vertical"&&E==="y"&&r({scrollProgress:j,scroll:j*(p.current.height-i.current.clientHeight),scrollTotal:p.current.height-i.current.clientHeight,scrollVisible:m.current.height})))}));const H=(j,E)=>{g.current&&g.current(j,E)};o.useEffect(()=>{y.width&&H(b.get(),"x"),y.height&&H(I.get(),"y")},[y]),o.useEffect(()=>{const j=i.current,E=f.current;if(!j||!E||typeof a!="number")return;const $=(T,Y,_)=>Math.min(_,Math.max(Y,T));if(t==="horizontal"){const T=Math.max(0,(n??E.scrollWidth)-j.clientWidth);j.scrollLeft=$(a*T,0,T)}else{const T=Math.max(0,(n??E.scrollHeight)-j.clientHeight);j.scrollTop=$(a*T,0,T)}},[a,t,n]),X.useMotionValueEvent(b,"change",j=>{H(j,"x")}),X.useMotionValueEvent(I,"change",j=>{H(j,"y")});const[D,v]=o.useState(!1);o.useLayoutEffect(()=>{D||!m.current||!p.current||!r||(r({scrollProgress:0,scroll:0,scrollTotal:t=="vertical"?p.current.height:p.current.width,scrollVisible:t=="vertical"?m.current.height:m.current.width}),v(!0))},[m,p,r]),p.current=S(),m.current=w();const[N,F]=o.useState(!1),L=Qe({isDragging:N,children:e,className:s,onScroll:r,orientation:t,scrollSize:n,draggable:d,throttleDuration:u}),[W,M]=o.useState(0),[z,O]=o.useState(0),Z=j=>{if(!d)return;const E=i.current;if(!E||W==null)return;const T=(j.pageX-E.offsetLeft-W)*1.5;E.scrollLeft=z-T},B=j=>{const E=i.current;E&&(F(!0),M(j.pageX-E.offsetLeft),O(E.scrollLeft))},C=j=>{N&&(j.preventDefault(),Z(j))},R=()=>{F(!1)},V=()=>{F(!1)},K=j=>{j.preventDefault()},G=o.useRef(null);return o.useEffect(()=>()=>{G.current&&clearTimeout(G.current)},[]),o.useEffect(()=>{const j=i.current;if(!j)return;const E=$=>{var J,A,q,ne;const T=$.detail,Y=i.current;if(!Y||!T)return;const _=T.orientation??t;if(typeof T.progress=="number")if(_==="horizontal"){const le=Math.max(0,(((J=p.current)==null?void 0:J.width)??0)-Y.clientWidth);Y.scrollLeft=Math.min(le,Math.max(0,T.progress*le))}else{const le=Math.max(0,(((A=p.current)==null?void 0:A.height)??0)-Y.clientHeight);Y.scrollTop=Math.min(le,Math.max(0,T.progress*le))}else if(typeof T.scroll=="number")if(_==="horizontal"){const le=Math.max(0,(((q=p.current)==null?void 0:q.width)??0)-Y.clientWidth);Y.scrollLeft=Math.min(le,Math.max(0,T.scroll))}else{const le=Math.max(0,(((ne=p.current)==null?void 0:ne.height)??0)-Y.clientHeight);Y.scrollTop=Math.min(le,Math.max(0,T.scroll))}};return j.addEventListener("udx:customScroll:set",E),()=>{j.removeEventListener("udx:customScroll:set",E)}},[t]),c.jsxs("div",{className:L.customScroll,ref:i,onMouseDown:B,onMouseMove:C,onMouseUp:R,onMouseLeave:V,onDragStart:K,onScroll:j=>{N||(M(null),F(!0),G.current&&clearTimeout(G.current),G.current=setTimeout(()=>{F(!1)},1e3))},children:[c.jsx("div",{ref:f,style:t==="vertical"?{height:((ee=m==null?void 0:m.current)==null?void 0:ee.height)??"100%"}:{width:((k=m==null?void 0:m.current)==null?void 0:k.width)??"100%"},className:L.track,children:e}),m.current&&p.current&&c.jsxs(c.Fragment,{children:[t==="vertical"&&p.current.height>m.current.height&&c.jsx(X.motion.div,{className:"flex-none",style:{height:p.current.height-m.current.height}}),t==="horizontal"&&p.current.width>m.current.width&&c.jsx(X.motion.div,{className:"flex-none",style:{width:p.current.width-m.current.width}})]})]})};var un="1.3.17";function tt(e,t,n){return Math.max(e,Math.min(t,n))}function dn(e,t,n){return(1-n)*e+n*t}function fn(e,t,n,r){return dn(e,t,1-Math.exp(-n*r))}function hn(e,t){return(e%t+t)%t}var mn=class{constructor(){P(this,"isRunning",!1);P(this,"value",0);P(this,"from",0);P(this,"to",0);P(this,"currentTime",0);P(this,"lerp");P(this,"duration");P(this,"easing");P(this,"onUpdate")}advance(e){var n;if(!this.isRunning)return;let t=!1;if(this.duration&&this.easing){this.currentTime+=e;const r=tt(0,this.currentTime/this.duration,1);t=r>=1;const s=t?1:this.easing(r);this.value=this.from+(this.to-this.from)*s}else this.lerp?(this.value=fn(this.value,this.to,this.lerp*60,e),Math.round(this.value)===this.to&&(this.value=this.to,t=!0)):(this.value=this.to,t=!0);t&&this.stop(),(n=this.onUpdate)==null||n.call(this,this.value,t)}stop(){this.isRunning=!1}fromTo(e,t,{lerp:n,duration:r,easing:s,onStart:d,onUpdate:u}){this.from=this.value=e,this.to=t,this.lerp=n,this.duration=r,this.easing=s,this.currentTime=0,this.isRunning=!0,d==null||d(),this.onUpdate=u}};function pn(e,t){let n;return function(...r){let s=this;clearTimeout(n),n=setTimeout(()=>{n=void 0,e.apply(s,r)},t)}}var yn=class{constructor(e,t,{autoResize:n=!0,debounce:r=250}={}){P(this,"width",0);P(this,"height",0);P(this,"scrollHeight",0);P(this,"scrollWidth",0);P(this,"debouncedResize");P(this,"wrapperResizeObserver");P(this,"contentResizeObserver");P(this,"resize",()=>{this.onWrapperResize(),this.onContentResize()});P(this,"onWrapperResize",()=>{this.wrapper instanceof Window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)});P(this,"onContentResize",()=>{this.wrapper instanceof Window?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)});this.wrapper=e,this.content=t,n&&(this.debouncedResize=pn(this.resize,r),this.wrapper instanceof Window?window.addEventListener("resize",this.debouncedResize,!1):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){var e,t;(e=this.wrapperResizeObserver)==null||e.disconnect(),(t=this.contentResizeObserver)==null||t.disconnect(),this.wrapper===window&&this.debouncedResize&&window.removeEventListener("resize",this.debouncedResize,!1)}get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}},nt=class{constructor(){P(this,"events",{})}emit(e,...t){var r;let n=this.events[e]||[];for(let s=0,d=n.length;s<d;s++)(r=n[s])==null||r.call(n,...t)}on(e,t){var n;return(n=this.events[e])!=null&&n.push(t)||(this.events[e]=[t]),()=>{var r;this.events[e]=(r=this.events[e])==null?void 0:r.filter(s=>t!==s)}}off(e,t){var n;this.events[e]=(n=this.events[e])==null?void 0:n.filter(r=>t!==r)}destroy(){this.events={}}},He=100/6,pe={passive:!1},xn=class{constructor(e,t={wheelMultiplier:1,touchMultiplier:1}){P(this,"touchStart",{x:0,y:0});P(this,"lastDelta",{x:0,y:0});P(this,"window",{width:0,height:0});P(this,"emitter",new nt);P(this,"onTouchStart",e=>{const{clientX:t,clientY:n}=e.targetTouches?e.targetTouches[0]:e;this.touchStart.x=t,this.touchStart.y=n,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:e})});P(this,"onTouchMove",e=>{const{clientX:t,clientY:n}=e.targetTouches?e.targetTouches[0]:e,r=-(t-this.touchStart.x)*this.options.touchMultiplier,s=-(n-this.touchStart.y)*this.options.touchMultiplier;this.touchStart.x=t,this.touchStart.y=n,this.lastDelta={x:r,y:s},this.emitter.emit("scroll",{deltaX:r,deltaY:s,event:e})});P(this,"onTouchEnd",e=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:e})});P(this,"onWheel",e=>{let{deltaX:t,deltaY:n,deltaMode:r}=e;const s=r===1?He:r===2?this.window.width:1,d=r===1?He:r===2?this.window.height:1;t*=s,n*=d,t*=this.options.wheelMultiplier,n*=this.options.wheelMultiplier,this.emitter.emit("scroll",{deltaX:t,deltaY:n,event:e})});P(this,"onWindowResize",()=>{this.window={width:window.innerWidth,height:window.innerHeight}});this.element=e,this.options=t,window.addEventListener("resize",this.onWindowResize,!1),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,pe),this.element.addEventListener("touchstart",this.onTouchStart,pe),this.element.addEventListener("touchmove",this.onTouchMove,pe),this.element.addEventListener("touchend",this.onTouchEnd,pe)}on(e,t){return this.emitter.on(e,t)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize,!1),this.element.removeEventListener("wheel",this.onWheel,pe),this.element.removeEventListener("touchstart",this.onTouchStart,pe),this.element.removeEventListener("touchmove",this.onTouchMove,pe),this.element.removeEventListener("touchend",this.onTouchEnd,pe)}},Oe=e=>Math.min(1,1.001-Math.pow(2,-10*e)),vn=class{constructor({wrapper:e=window,content:t=document.documentElement,eventsTarget:n=e,smoothWheel:r=!0,syncTouch:s=!1,syncTouchLerp:d=.075,touchInertiaExponent:u=1.7,duration:a,easing:l,lerp:i=.1,infinite:f=!1,orientation:y="vertical",gestureOrientation:h=y==="horizontal"?"both":"vertical",touchMultiplier:p=1,wheelMultiplier:m=1,autoResize:S=!0,prevent:w,virtualScroll:I,overscroll:b=!0,autoRaf:g=!1,anchors:H=!1,autoToggle:D=!1,allowNestedScroll:v=!1,__experimental__naiveDimensions:N=!1,naiveDimensions:F=N,stopInertiaOnNavigate:L=!1}={}){P(this,"_isScrolling",!1);P(this,"_isStopped",!1);P(this,"_isLocked",!1);P(this,"_preventNextNativeScrollEvent",!1);P(this,"_resetVelocityTimeout",null);P(this,"_rafId",null);P(this,"isTouching");P(this,"time",0);P(this,"userData",{});P(this,"lastVelocity",0);P(this,"velocity",0);P(this,"direction",0);P(this,"options");P(this,"targetScroll");P(this,"animatedScroll");P(this,"animate",new mn);P(this,"emitter",new nt);P(this,"dimensions");P(this,"virtualScroll");P(this,"onScrollEnd",e=>{e instanceof CustomEvent||(this.isScrolling==="smooth"||this.isScrolling===!1)&&e.stopPropagation()});P(this,"dispatchScrollendEvent",()=>{this.options.wrapper.dispatchEvent(new CustomEvent("scrollend",{bubbles:this.options.wrapper===window,detail:{lenisScrollEnd:!0}}))});P(this,"onTransitionEnd",e=>{e.propertyName.includes("overflow")&&this.checkOverflow()});P(this,"onClick",e=>{const n=e.composedPath().filter(r=>r instanceof HTMLAnchorElement&&r.getAttribute("href"));if(this.options.anchors){const r=n.find(s=>{var d;return(d=s.getAttribute("href"))==null?void 0:d.includes("#")});if(r){const s=r.getAttribute("href");if(s){const d=typeof this.options.anchors=="object"&&this.options.anchors?this.options.anchors:void 0,u=`#${s.split("#")[1]}`;this.scrollTo(u,d)}}}this.options.stopInertiaOnNavigate&&n.find(s=>s.host===window.location.host)&&this.reset()});P(this,"onPointerDown",e=>{e.button===1&&this.reset()});P(this,"onVirtualScroll",e=>{if(typeof this.options.virtualScroll=="function"&&this.options.virtualScroll(e)===!1)return;const{deltaX:t,deltaY:n,event:r}=e;if(this.emitter.emit("virtual-scroll",{deltaX:t,deltaY:n,event:r}),r.ctrlKey||r.lenisStopPropagation)return;const s=r.type.includes("touch"),d=r.type.includes("wheel");this.isTouching=r.type==="touchstart"||r.type==="touchmove";const u=t===0&&n===0;if(this.options.syncTouch&&s&&r.type==="touchstart"&&u&&!this.isStopped&&!this.isLocked){this.reset();return}const l=this.options.gestureOrientation==="vertical"&&n===0||this.options.gestureOrientation==="horizontal"&&t===0;if(u||l)return;let i=r.composedPath();i=i.slice(0,i.indexOf(this.rootElement));const f=this.options.prevent;if(i.find(w=>{var I,b,g;return w instanceof HTMLElement&&(typeof f=="function"&&(f==null?void 0:f(w))||((I=w.hasAttribute)==null?void 0:I.call(w,"data-lenis-prevent"))||s&&((b=w.hasAttribute)==null?void 0:b.call(w,"data-lenis-prevent-touch"))||d&&((g=w.hasAttribute)==null?void 0:g.call(w,"data-lenis-prevent-wheel"))||this.options.allowNestedScroll&&this.checkNestedScroll(w,{deltaX:t,deltaY:n}))}))return;if(this.isStopped||this.isLocked){r.cancelable&&r.preventDefault();return}if(!(this.options.syncTouch&&s||this.options.smoothWheel&&d)){this.isScrolling="native",this.animate.stop(),r.lenisStopPropagation=!0;return}let h=n;this.options.gestureOrientation==="both"?h=Math.abs(n)>Math.abs(t)?n:t:this.options.gestureOrientation==="horizontal"&&(h=t),(!this.options.overscroll||this.options.infinite||this.options.wrapper!==window&&this.limit>0&&(this.animatedScroll>0&&this.animatedScroll<this.limit||this.animatedScroll===0&&n>0||this.animatedScroll===this.limit&&n<0))&&(r.lenisStopPropagation=!0),r.cancelable&&r.preventDefault();const p=s&&this.options.syncTouch,S=s&&r.type==="touchend";S&&(h=Math.sign(this.velocity)*Math.pow(Math.abs(this.velocity),this.options.touchInertiaExponent)),this.scrollTo(this.targetScroll+h,{programmatic:!1,...p?{lerp:S?this.options.syncTouchLerp:1}:{lerp:this.options.lerp,duration:this.options.duration,easing:this.options.easing}})});P(this,"onNativeScroll",()=>{if(this._resetVelocityTimeout!==null&&(clearTimeout(this._resetVelocityTimeout),this._resetVelocityTimeout=null),this._preventNextNativeScrollEvent){this._preventNextNativeScrollEvent=!1;return}if(this.isScrolling===!1||this.isScrolling==="native"){const e=this.animatedScroll;this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity,this.velocity=this.animatedScroll-e,this.direction=Math.sign(this.animatedScroll-e),this.isStopped||(this.isScrolling="native"),this.emit(),this.velocity!==0&&(this._resetVelocityTimeout=setTimeout(()=>{this.lastVelocity=this.velocity,this.velocity=0,this.isScrolling=!1,this.emit()},400))}});P(this,"raf",e=>{const t=e-(this.time||e);this.time=e,this.animate.advance(t*.001),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))});window.lenisVersion=un,(!e||e===document.documentElement)&&(e=window),typeof a=="number"&&typeof l!="function"?l=Oe:typeof l=="function"&&typeof a!="number"&&(a=1),this.options={wrapper:e,content:t,eventsTarget:n,smoothWheel:r,syncTouch:s,syncTouchLerp:d,touchInertiaExponent:u,duration:a,easing:l,lerp:i,infinite:f,gestureOrientation:h,orientation:y,touchMultiplier:p,wheelMultiplier:m,autoResize:S,prevent:w,virtualScroll:I,overscroll:b,autoRaf:g,anchors:H,autoToggle:D,allowNestedScroll:v,naiveDimensions:F,stopInertiaOnNavigate:L},this.dimensions=new yn(e,t,{autoResize:S}),this.updateClassName(),this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll,!1),this.options.wrapper.addEventListener("scrollend",this.onScrollEnd,{capture:!0}),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.addEventListener("click",this.onClick,!1),this.options.wrapper.addEventListener("pointerdown",this.onPointerDown,!1),this.virtualScroll=new xn(n,{touchMultiplier:p,wheelMultiplier:m}),this.virtualScroll.on("scroll",this.onVirtualScroll),this.options.autoToggle&&(this.checkOverflow(),this.rootElement.addEventListener("transitionend",this.onTransitionEnd,{passive:!0})),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))}destroy(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll,!1),this.options.wrapper.removeEventListener("scrollend",this.onScrollEnd,{capture:!0}),this.options.wrapper.removeEventListener("pointerdown",this.onPointerDown,!1),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.removeEventListener("click",this.onClick,!1),this.virtualScroll.destroy(),this.dimensions.destroy(),this.cleanUpClassName(),this._rafId&&cancelAnimationFrame(this._rafId)}on(e,t){return this.emitter.on(e,t)}off(e,t){return this.emitter.off(e,t)}get overflow(){const e=this.isHorizontal?"overflow-x":"overflow-y";return getComputedStyle(this.rootElement)[e]}checkOverflow(){["hidden","clip"].includes(this.overflow)?this.internalStop():this.internalStart()}setScroll(e){this.isHorizontal?this.options.wrapper.scrollTo({left:e,behavior:"instant"}):this.options.wrapper.scrollTo({top:e,behavior:"instant"})}resize(){this.dimensions.resize(),this.animatedScroll=this.targetScroll=this.actualScroll,this.emit()}emit(){this.emitter.emit("scroll",this)}reset(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity=0,this.animate.stop()}start(){if(this.isStopped){if(this.options.autoToggle){this.rootElement.style.removeProperty("overflow");return}this.internalStart()}}internalStart(){this.isStopped&&(this.reset(),this.isStopped=!1,this.emit())}stop(){if(!this.isStopped){if(this.options.autoToggle){this.rootElement.style.setProperty("overflow","clip");return}this.internalStop()}}internalStop(){this.isStopped||(this.reset(),this.isStopped=!0,this.emit())}scrollTo(e,{offset:t=0,immediate:n=!1,lock:r=!1,programmatic:s=!0,lerp:d=s?this.options.lerp:void 0,duration:u=s?this.options.duration:void 0,easing:a=s?this.options.easing:void 0,onStart:l,onComplete:i,force:f=!1,userData:y}={}){if(!((this.isStopped||this.isLocked)&&!f)){if(typeof e=="string"&&["top","left","start","#"].includes(e))e=0;else if(typeof e=="string"&&["bottom","right","end"].includes(e))e=this.limit;else{let h;if(typeof e=="string"?(h=document.querySelector(e),h||(e==="#top"?e=0:console.warn("Lenis: Target not found",e))):e instanceof HTMLElement&&(e!=null&&e.nodeType)&&(h=e),h){if(this.options.wrapper!==window){const m=this.rootElement.getBoundingClientRect();t-=this.isHorizontal?m.left:m.top}const p=h.getBoundingClientRect();e=(this.isHorizontal?p.left:p.top)+this.animatedScroll}}if(typeof e=="number"){if(e+=t,e=Math.round(e),this.options.infinite){if(s){this.targetScroll=this.animatedScroll=this.scroll;const h=e-this.animatedScroll;h>this.limit/2?e=e-this.limit:h<-this.limit/2&&(e=e+this.limit)}}else e=tt(0,e,this.limit);if(e===this.targetScroll){l==null||l(this),i==null||i(this);return}if(this.userData=y??{},n){this.animatedScroll=this.targetScroll=e,this.setScroll(this.scroll),this.reset(),this.preventNextNativeScrollEvent(),this.emit(),i==null||i(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()});return}s||(this.targetScroll=e),typeof u=="number"&&typeof a!="function"?a=Oe:typeof a=="function"&&typeof u!="number"&&(u=1),this.animate.fromTo(this.animatedScroll,e,{duration:u,easing:a,lerp:d,onStart:()=>{r&&(this.isLocked=!0),this.isScrolling="smooth",l==null||l(this)},onUpdate:(h,p)=>{this.isScrolling="smooth",this.lastVelocity=this.velocity,this.velocity=h-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=h,this.setScroll(this.scroll),s&&(this.targetScroll=h),p||this.emit(),p&&(this.reset(),this.emit(),i==null||i(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()}),this.preventNextNativeScrollEvent())}})}}}preventNextNativeScrollEvent(){this._preventNextNativeScrollEvent=!0,requestAnimationFrame(()=>{this._preventNextNativeScrollEvent=!1})}checkNestedScroll(e,{deltaX:t,deltaY:n}){const r=Date.now(),s=e._lenis??(e._lenis={});let d,u,a,l,i,f,y,h;const p=this.options.gestureOrientation;if(r-(s.time??0)>2e3){s.time=Date.now();const D=window.getComputedStyle(e);s.computedStyle=D;const v=D.overflowX,N=D.overflowY;if(d=["auto","overlay","scroll"].includes(v),u=["auto","overlay","scroll"].includes(N),s.hasOverflowX=d,s.hasOverflowY=u,!d&&!u||p==="vertical"&&!u||p==="horizontal"&&!d)return!1;i=e.scrollWidth,f=e.scrollHeight,y=e.clientWidth,h=e.clientHeight,a=i>y,l=f>h,s.isScrollableX=a,s.isScrollableY=l,s.scrollWidth=i,s.scrollHeight=f,s.clientWidth=y,s.clientHeight=h}else a=s.isScrollableX,l=s.isScrollableY,d=s.hasOverflowX,u=s.hasOverflowY,i=s.scrollWidth,f=s.scrollHeight,y=s.clientWidth,h=s.clientHeight;if(!d&&!u||!a&&!l||p==="vertical"&&(!u||!l)||p==="horizontal"&&(!d||!a))return!1;let m;if(p==="horizontal")m="x";else if(p==="vertical")m="y";else{const D=t!==0,v=n!==0;D&&d&&a&&(m="x"),v&&u&&l&&(m="y")}if(!m)return!1;let S,w,I,b,g;if(m==="x")S=e.scrollLeft,w=i-y,I=t,b=d,g=a;else if(m==="y")S=e.scrollTop,w=f-h,I=n,b=u,g=l;else return!1;return(I>0?S<w:S>0)&&b&&g}get rootElement(){return this.options.wrapper===window?document.documentElement:this.options.wrapper}get limit(){return this.options.naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?"x":"y"]}get isHorizontal(){return this.options.orientation==="horizontal"}get actualScroll(){const e=this.options.wrapper;return this.isHorizontal?e.scrollX??e.scrollLeft:e.scrollY??e.scrollTop}get scroll(){return this.options.infinite?hn(this.animatedScroll,this.limit):this.animatedScroll}get progress(){return this.limit===0?1:this.scroll/this.limit}get isScrolling(){return this._isScrolling}set isScrolling(e){this._isScrolling!==e&&(this._isScrolling=e,this.updateClassName())}get isStopped(){return this._isStopped}set isStopped(e){this._isStopped!==e&&(this._isStopped=e,this.updateClassName())}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this.updateClassName())}get isSmooth(){return this.isScrolling==="smooth"}get className(){let e="lenis";return this.options.autoToggle&&(e+=" lenis-autoToggle"),this.isStopped&&(e+=" lenis-stopped"),this.isLocked&&(e+=" lenis-locked"),this.isScrolling&&(e+=" lenis-scrolling"),this.isScrolling==="smooth"&&(e+=" lenis-smooth"),e}updateClassName(){this.cleanUpClassName(),this.rootElement.className=`${this.rootElement.className} ${this.className}`.trim()}cleanUpClassName(){this.rootElement.className=this.rootElement.className.replace(/lenis(-\w+)?/g,"").trim()}};const gn=({transition:e=1.2,easing:t,orientation:n="vertical",smoothTouch:r=!1,touchMultiplier:s=2,children:d})=>{const u=o.useRef(null),a=o.useRef(null);return o.useEffect(()=>{let l;typeof e=="string"?e.endsWith("ms")?l=parseFloat(e)/1e3:e.endsWith("s")?l=parseFloat(e):l=parseFloat(e)||1.2:l=e;const i=y=>1-Math.pow(1-y,5);u.current=new vn({duration:l,easing:t??i,orientation:n,smoothWheel:!0,touchMultiplier:s,syncTouch:r});const f=y=>{var h;(h=u.current)==null||h.raf(y),a.current=requestAnimationFrame(f)};return a.current=requestAnimationFrame(f),()=>{var y;a.current!==null&&cancelAnimationFrame(a.current),(y=u.current)==null||y.destroy(),u.current=null}},[e,t,n,r,s]),d?c.jsx(c.Fragment,{children:d}):null},me=({style:e,colorName:t,stateClassName:n="state-ripple-group",children:r,className:s})=>{const d=o.useRef(null),u=o.useRef(null),[a,l]=o.useState(!1),i=st({isClient:a,stateClassName:n,className:s,colorName:t});return o.useEffect(()=>{if(d.current&&n!=="state-layer"){const y=(n.includes("[")?"group/"+n.split("[")[1].split("]")[0]:"group").replace(/\//g,"\\/"),h=d.current.closest(`.${y}:not(.${y} .${y})`);u.current=h}l(!0)},[]),c.jsxs("div",{ref:d,className:i.stateLayer,style:{"--state-color":`var(--default-color, var(--color-${t}))`,...e},children:[a&&c.jsx(Ge,{triggerRef:u}),r]})},wn=({isClient:e,stateClassName:t})=>({stateLayer:x(["w-full top-0 left-0 h-full absolute pointer-events-none overflow-hidden",t])}),st=Q("stateLayer",wn),rt=({targetRef:e,children:t})=>{const[n,r]=o.useState(null),s=o.useRef(null),d=()=>{const u=e.current;if(!u)return;const a=u.getBoundingClientRect();r({position:"fixed",top:a.top,left:a.left,width:a.width,height:a.height,pointerEvents:"none",zIndex:999})};return o.useEffect(()=>{const u=e.current;if(u)return d(),window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),s.current=new ResizeObserver(d),s.current.observe(u),()=>{var a;window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d),(a=s.current)==null||a.disconnect()}},[e]),n?Ie.createPortal(c.jsx("div",{style:n,children:t}),document.body):null};function bn(e){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e)}const Sn=({config:e,throttleDelay:t=100,onLoad:n,loadTheme:r=!1})=>{const[s,d]=o.useState(null);o.useEffect(()=>{(async()=>{const h=await be.loader(e,r);d(h)})()},[]);const[u,a]=o.useState(null),l=o.useRef(null),i=o.useRef(0),f=o.useRef(null);o.useEffect(()=>{if(!s)return;const h={...e,sourceColor:e.sourceColor},p=Date.now(),m=p-i.current,S=async w=>{await y(w)};if(i.current===0||m>=t)l.current&&(clearTimeout(l.current),l.current=null),f.current=null,i.current=p,S(h);else if(f.current=h,!l.current){const w=Math.max(0,t-m);l.current=setTimeout(async()=>{l.current=null;const I=f.current;f.current=null,I&&(i.current=Date.now(),await S(I))},w)}return()=>{}},[e,t,s]);const y=async h=>{if(typeof h.sourceColor=="string"&&!bn(h.sourceColor))throw new Error("Invalid hex color");if(!s)return;s.context.update(h),await s.load();const p=s==null?void 0:s.plugins.getPlugin(Ke.TailwindPlugin).getInstance().outputCss;a(p),n==null||n(s)};return o.useEffect(()=>()=>{l.current&&(clearTimeout(l.current),l.current=null)},[]),u?c.jsx("style",{dangerouslySetInnerHTML:{__html:u}}):null};function Nn(){if(typeof window>"u")return!1;try{if(window.CSS&&typeof window.CSS.supports=="function")return CSS.supports("animation-timeline: view()")||CSS.supports("animation-timeline: scroll()")||CSS.supports("view-timeline-name: --a")}catch{}return!1}function En(){return typeof window>"u"||!("matchMedia"in window)?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function Me(e){if(!(e instanceof HTMLElement))return!1;const t=e.classList;return Array.from(t).some(n=>n.startsWith("anim-")&&n.includes("scroll"))}function Ve(e){if(!(e instanceof HTMLElement))return!1;const t=e.classList;return Array.from(t).some(n=>n.startsWith("anim-"))}function Ee(e,t){if(!Me(e))return;if(e.hasAttribute(`data-${t}-scroll`)){const u=(e.getAttribute(`data-${t}-scroll`)||"").trim().toLowerCase(),a=u==="x"||u==="inline"?"inline":u==="y"||u==="block"?"block":"auto";e.classList.contains(`${t}-timeline`)||e.classList.contains(`${t}-timeline-inline`)||e.classList.contains(`${t}-timeline-block`)||e.classList.contains(`${t}-timeline-x`)||e.classList.contains(`${t}-timeline-y`)||(a==="inline"?e.classList.add(`${t}-timeline-inline`):a==="block"?e.classList.add(`${t}-timeline-block`):e.classList.add(`${t}-scroll`))}const n=e.getAttribute(`data-${t}-start`);n&&e.style.setProperty(`--${t}-range-start`,n);const r=e.getAttribute(`data-${t}-end`);r&&e.style.setProperty(`--${t}-range-end`,r);const s=e.hasAttribute(`data-${t}-paused`)||e.classList.contains(`${t}-paused`),d=e.hasAttribute(`data-${t}-run`)||e.classList.contains(`${t}-run`);!s&&!d&&e.setAttribute(`data-${t}-run`,"")}function ke(e=document,t){return Array.from(e.querySelectorAll(`[class*="${t}-"][class*="-scroll"]`)).filter(r=>Me(r))}function kn(e=document,t){const n=Array.from(e.querySelectorAll(`[class*="${t}-"]`)),r=new Set([`${t}-run`,`${t}-in`,`${t}-out`,`${t}-in-run`,`${t}-out-run`,`${t}-paused`,`${t}-timeline`,`${t}-timeline-inline`,`${t}-timeline-block`,`${t}-timeline-x`,`${t}-timeline-y`,`${t}-scroll`]);return n.filter(s=>{if(!(s instanceof HTMLElement))return!1;const d=s.classList;return d.contains(`${t}-in`)||d.contains(`${t}-out`)||Array.from(d).some(l=>l.startsWith(`${t}-`)&&!l.includes("scroll")&&!r.has(l))?!0:!Me(s)})}function jn(e,t){return Array.from(e).some(n=>n.startsWith(t)&&n.includes("-out"))}function ze(e,t,n){e.setAttribute(`data-${t}-run`,""),e.setAttribute(`data-${t}-${n}-run`,"")}function Ye(e,t,n){const r=e.style.animationName;e.style.animationName="none",e.removeAttribute(`data-${t}-run`),n?e.removeAttribute(`data-${t}-${n}-run`):(e.removeAttribute(`data-${t}-in-run`),e.removeAttribute(`data-${t}-out-run`)),e.offsetWidth,e.style.animationName=r}const Ln=[0,.2],_e=new WeakSet;function qe(e,t){if(_e.has(e))return;_e.add(e);const n=s=>{s.target===e&&(e.hasAttribute(`data-${t}-in-run`)||e.hasAttribute(`data-${t}-out-run`))&&e.setAttribute(`data-${t}-animating`,"")},r=s=>{s.target===e&&e.removeAttribute(`data-${t}-animating`)};e.addEventListener("animationstart",n),e.addEventListener("animationend",r),e.addEventListener("animationcancel",r)}function Ce(e={}){const{prefix:t="anim",once:n=!0}=e;if(En())return()=>{};const r=Nn(),s=new WeakSet;let d=typeof window<"u"&&(window.pageYOffset||window.scrollY)||0,u=!0;const a=()=>{const p=window.pageYOffset||window.scrollY||0;u=p>=d,d=p};typeof window<"u"&&window.addEventListener("scroll",a,{passive:!0});const l=new IntersectionObserver(p=>{for(const m of p){const S=m.target;if(!Ve(S)||S.hasAttribute(`data-${t}-animating`))continue;const w=jn(S.classList,t);m.isIntersecting?(w&&Ye(S,t,"out"),ze(S,t,"in"),n&&l.unobserve(S)):n||(u||Ye(S,t,"in"),w&&ze(S,t,"out"))}},{threshold:Ln}),i=p=>{const m=kn(p||document,t);for(const S of m)s.has(S)||(s.add(S),l.observe(S),qe(S,t))};i();let f,y=null,h=null;if(r)(()=>{h==null&&(h=requestAnimationFrame(()=>{h=null;const m=ke(void 0,t);for(const S of m)Ee(S,t)}))})(),y=new MutationObserver(m=>{for(const S of m)if(S.type==="attributes"){const w=S.target;w instanceof HTMLElement&&(Ee(w,t),Ve(w)&&(s.has(w)||(s.add(w),l.observe(w),qe(w,t))))}else if(S.type==="childList"&&S.addedNodes&&S.addedNodes.length){for(const w of Array.from(S.addedNodes))if(w instanceof HTMLElement){const I=ke(w,t);for(const b of I)Ee(b,t);i(w)}}}),y.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["class",`data-${t}-scroll`,`data-${t}-start`,`data-${t}-end`,`data-${t}-paused`,`data-${t}-run`]}),f=()=>{h!=null&&cancelAnimationFrame(h),y&&y.disconnect()};else{let p;ke(void 0,t).length>0&&Promise.resolve().then(()=>require("./scrollDriven-DWAu7CR0.cjs")).then(S=>{p=S.initScrollViewFallback({once:n})}),f=()=>{typeof p=="function"&&p()}}return()=>{f&&f(),typeof window<"u"&&window.removeEventListener("scroll",a),l.disconnect()}}const In=Ce,Mn=Ce,Re=({anchorRef:e,position:t="bottom",children:n,style:r})=>{const d=`--anchor-${o.useId().replace(/:/g,"")}`,[u,a]=o.useState(!1);if(o.useLayoutEffect(()=>{typeof CSS<"u"&&CSS.supports("anchor-name","--a")&&a(!0)},[]),o.useLayoutEffect(()=>{if(u&&e.current){const i=e.current;return i.style.anchorName=d,()=>{e.current&&(e.current.style.anchorName="")}}},[u,e,d]),u){const f={position:"fixed",margin:0,zIndex:9999,positionAnchor:d,positionArea:{top:"top",bottom:"bottom",left:"left",right:"right","top-left":"top left","top-right":"top right","bottom-left":"bottom left","bottom-right":"bottom right"}[t],positionTryFallbacks:"flip-block, flip-inline",...r};return Ie.createPortal(c.jsx("div",{style:f,children:n}),document.body)}const l={position:"absolute",pointerEvents:"auto",...r};switch(t){case"top":l.bottom="100%",l.left="50%",l.transform="translateX(-50%)";break;case"top-left":l.bottom="100%",l.left=0;break;case"top-right":l.bottom="100%",l.right=0;break;case"bottom":l.top="100%",l.left="50%",l.transform="translateX(-50%)";break;case"bottom-left":l.top="100%",l.left=0;break;case"bottom-right":l.top="100%",l.right=0;break;case"left":l.right="100%",l.top="50%",l.transform="translateY(-50%)";break;case"right":l.left="100%",l.top="50%",l.transform="translateY(-50%)";break}return c.jsx(rt,{targetRef:e,children:c.jsx("div",{style:l,children:n})})},ot=({variant:e,disableTextMargins:t,disabled:n,iconPosition:r,icon:s,isActive:d,loading:u,shape:a,onToggle:l,size:i,allowShapeTransformation:f})=>({button:x(" relative cursor-pointer group/button outline-none inline-block flex justify-center items-center ",i==="xSmall"&&"text-label-large px-3 py-1.5 gap-1",i==="small"&&"text-label-large px-4 py-2.5 gap-2",i==="medium"&&"text-title-medium px-6 py-4 gap-2",i==="large"&&"text-headline-small px-12 py-8 gap-3",i==="xLarge"&&"text-headline-large px-16 py-12 gap-4",a==="rounded"&&{"rounded-[30px]":i==="xSmall"||i=="small","rounded-[40px]":i==="medium","rounded-[70px]":i==="large"||i=="xLarge"},(a==="squared"||f&&d)&&{"rounded-[12px]":i==="xSmall"||i=="small","rounded-[16px]":i==="medium","rounded-[28px]":i==="large"||i=="xLarge"},f&&!n&&{"active:rounded-[12px]":i==="xSmall"||i=="small","active:rounded-[16px]":i==="medium","active:rounded-[28px]":i==="large"||i=="xLarge"},e==="elevated"&&{"shadow-1 hover:shadow-2":!n,"bg-surface-container-low text-primary":!n&&!d,"bg-primary text-on-primary":!n&&d,"text-on-surface/[38%]":n},e==="filled"&&{"hover:shadow-1":!n,"bg-surface-container text-on-surface-variant":!n&&!d&&l,"bg-primary text-on-primary":!n&&(d&&l||!l),"text-on-surface/[38%]":n},e==="tonal"&&{"hover:shadow-1":!n,"bg-secondary-container text-on-secondary-container":!n&&!d,"bg-secondary text-on-secondary":!n&&d,"text-on-surface/[0.38]":n},e==="outlined"&&[" border",{"border-on-surface/[0.12] text-on-surface/[0.38]":n,"text-primary border-outline focus:border-primary":!n&&!d,"text-inverse-on-surface bg-inverse-surface border-inverse-surface":!n&&d}],e==="text"&&["w-fit",{"text-primary":!n,"text-on-surface/[0.38]":n},t&&[i==="xSmall"&&"-mx-3 ",i==="small"&&"-mx-4 ",i==="medium"&&"-mx-6 ",i==="large"&&"-mx-12",i==="xLarge"&&"-mx-16 "]],n&&"cursor-default"),touchTarget:x("absolute -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/2 h-12 w-full"),stateLayer:x("overflow-hidden",a==="rounded"&&{"rounded-[30px]":i==="xSmall"||i=="small","rounded-[40px]":i==="medium","rounded-[70px]":i==="large"||i=="xLarge"},(a==="squared"||f&&d)&&{"rounded-[12px]":i==="xSmall"||i=="small","rounded-[16px]":i==="medium","rounded-[28px]":i==="large"||i=="xLarge"},f&&!n&&{"group-active/button:rounded-[12px]":i==="xSmall"||i=="small","group-active/button:rounded-[16px]":i==="medium","group-active/button:rounded-[28px]":i==="large"||i=="xLarge"}),label:x({invisible:u}),icon:x({invisible:u},i==="xSmall"&&"size-5",i==="small"&&"size-5",i==="medium"&&"size-6",i==="large"&&"size-8",i==="xLarge"&&"size-10")}),Cn=te("button",ot),it=Q("button",ot),lt=({variant:e,isInteractive:t})=>({card:x(" rounded-xl overflow-hidden ",e==="outlined"&&"bg-surface border border-outline-variant",e==="elevated"&&"bg-surface-container-low shadow-1",e==="filled"&&"bg-surface-container-highest",{"group/card":t})}),Rn=te("card",lt),at=Q("card",lt),De=({width:e})=>({carouselItem:x("rounded-[28px] overflow-hidden flex-none",{hidden:e===void 0,"flex-1":e==null})}),Dn=te("carouselItem",De),ct=Q("carouselItem",De),ut=()=>({carousel:x(["w-full h-[400px]"]),track:x("flex h-full w-full")}),Fn=te("carousel",ut),dt=Q("carousel",ut),ft=({isChecked:e,isIndeterminate:t,isDisabled:n,isError:r,isFocused:s,isHovered:d})=>({checkbox:x("inline-flex items-center justify-center relative size-4.5 ",{"pointer-events-none opacity-[0.38]":n}),input:x("absolute inset-0 w-full h-full opacity-0 z-10 cursor-pointer"),container:x("relative flex items-center justify-center w-[18px] h-[18px] "),box:x("absolute left-1/2 top-1/2 -translate-1/2 to rounded-[2px] size-4 border-2 transition-colors duration-200",!e&&!t&&{"border-on-surface-variant":!r&&!n,"border-error":r&&!n,"border-on-surface":n},(e||t)&&{"bg-primary border-primary":!r&&!n,"bg-error border-error":r&&!n,"bg-on-surface border-on-surface":n}),icon:x("z-10 relative text-on-primary w-full h-full flex items-center justify-center pointer-events-none",{"text-on-error":r&&!n,"text-surface":n}),stateLayer:"size-10 state-ripple-group-[checkbox] rounded-full cursor-pointer pointer-events-auto absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2"}),An=te("checkbox",ft),ht=Q("checkbox",ft),mt=({variant:e,disabled:t,trailingIcon:n,icon:r,isActive:s,isInteractive:d,activated:u,isFocused:a,isDragging:l,isEditing:i})=>({chip:x(" group/chip px-3 py-1.5 rounded-lg flex items-center gap-2 outline-none",{"pl-2":r,"pr-2":n,"cursor-pointer":!t&&d},{" text-on-surface-variant":!u&&!a||i,"bg-secondary-container text-on-secondary-container":(u||a)&&!i},l&&["opacity-100 cursor-grabbing shadow-3"],e==="outlined"&&["border border-outline-variant",{"border-transparent":i}],e==="elevated"&&!i&&["shadow-1 bg-surface-container-low","border border-outline-variant"]),stateLayer:x("rounded-lg overflow-hidden",{}),label:x("outline-none text-nowrap",{"opacity-[0.38]":t}),leadingIcon:x("text-primary size-[18px]",{"opacity-[0.38]":t}),trailingIcon:x("cursor-pointer size-[18px]",{"opacity-[0.38]":t})}),$n=te("chip",mt),pt=Q("chip",mt),yt=({scrollable:e})=>({chips:x(" flex gap-3 outline-none",{"flex-wrap":!e,"overflow-x-auto":e})}),Wn=te("chips",yt),xt=Q("chips",yt),vt=({orientation:e})=>({divider:x("border-outline-variant ",{"h-fit w-full border-t":e==="horizontal"},{"h-auto self-stretch w-fit border-l":e==="vertical"})}),Pn=te("divider",vt),gt=Q("divider",vt),wt=({size:e,variant:t,extended:n})=>({fab:x("flex shadow-3 hover:shadow-4 group/fab overflow-hidden outline-none items-center cursor-pointer",{"rounded-[12px]":e=="small","rounded-[16px]":e=="medium","rounded-[28px]":e=="large"},{"p-2":e=="small","p-4":e=="medium","p-[30px]":e=="large"},t==="primary"&&"bg-primary text-on-primary",t==="secondary"&&"bg-secondary text-on-secondary",t==="tertiary"&&"bg-tertiary text-on-tertiary",t==="primaryContainer"&&"bg-primary-container text-on-primary-container",t==="secondaryContainer"&&"bg-secondary-container text-on-secondary-container",t==="tertiaryContainer"&&"bg-tertiary-container text-on-tertiary-container"),icon:x({"size-6":e=="small"||e=="medium","size-9":e=="large"}),label:x("text-nowrap",{"text-title-medium":e=="small","text-title-large":e=="medium","text-headline-small":e=="large"})}),Bn=te("fab",wt),bt=Q("fab",wt),St=({size:e,variant:t,open:n})=>({fabMenu:x("relative inline-flex flex-col items-end"),actions:x("flex flex-col gap-1 items-end absolute bottom-[calc(100%_+_8px)] right-0"),label:x("text-nowrap")}),Tn=te("fabMenu",St),Nt=Q("fabMenu",St),Et=({variant:e,disabled:t,onToggle:n,isActive:r,size:s,width:d,shape:u,allowShapeTransformation:a})=>({iconButton:x("rounded-full relative flex transition-all duration-300","group/icon-button cursor-pointer",{"cursor-default":t},u==="rounded"&&{"rounded-[30px]":s==="xSmall"||s=="small","rounded-[40px]":s==="medium","rounded-[70px]":s==="large"||s=="xLarge"},(u==="squared"||a&&r)&&{"rounded-[12px]":s==="xSmall"||s=="small","rounded-[16px]":s==="medium","rounded-[28px]":s==="large"||s=="xLarge"},a&&!t&&{"active:rounded-[12px]":s==="xSmall"||s=="small","active:rounded-[16px]":s==="medium","active:rounded-[28px]":s==="large"||s=="xLarge"},e==="filled"&&[!t&&{"bg-surface-container":!r&&!!n,"bg-primary":r||!n},!!t&&"bg-on-surface/[0.12]"],e==="tonal"&&[!t&&{"bg-secondary-container text-on-secondary-container":!r&&!!n,"bg-secondary text-on-secondary":r||!n},!!t&&"bg-on-surface/[0.12]"],e==="outlined"&&[!t&&{"border border-outline":!r,"border border-transparent bg-inverse-surface":r},!!t&&{"border border-on-surface/[0.12]":!r,"border border-transparent bg-on-surface/[0.12]":r}]),touchTarget:x("absolute -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/2 h-12 w-full"),stateLayer:x("absolute top-0 left-0 h-full w-full overflow-hidden",(u==="rounded"||u==="squared"&&n&&!t&&r&&a)&&{"rounded-[30px]":s==="xSmall"||s=="small","rounded-[40px]":s==="medium","rounded-[70px]":s==="large"||s=="xLarge"},(u==="squared"||u==="rounded"&&n&&!t&&r&&a)&&{"rounded-[12px]":s==="xSmall"||s=="small","rounded-[16px]":s==="medium","rounded-[28px]":s==="large"||s=="xLarge"},a&&!t&&{"group-active/icon-button:rounded-[12px]":s==="xSmall"||s=="small","group-active/icon-button:rounded-[16px]":s==="medium","group-active/icon-button:rounded-[28px]":s==="large"||s=="xLarge"},!t&&[e==="standard"&&{"state-on-surface-variant":!r,"state-primary":r},e==="filled"&&{"state-primary":!r&&!!n,"state-inverse-on-surface":r||!n},e==="tonal"&&{"state-on-surface-variant":!r&&!!n,"state-on-secondary-container":r||!n},e==="outlined"&&{"state-on-surface-variant":!r,"state-on-primary":r}]),icon:x(" 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"},d=="narrow"&&[{"px-1":s==="xSmall"},{"px-1":s==="small"},{"px-3":s==="medium"},{"px-4":s==="large"},{"px-8":s==="xLarge"}],d=="wide"&&[{"px-2.5":s==="xSmall"},{"px-3.5":s==="small"},{"px-6":s==="medium"},{"px-12":s==="large"},{"px-[72px]":s==="xLarge"}],!t&&[e==="standard"&&{"text-on-surface-variant":!r,"text-primary":r},e==="filled"&&{"text-primary":!r&&!!n,"text-on-primary":r||!n},e==="outlined"&&{"text-on-surface-variant":!r,"text-inverse-on-surface":r}],!!t&&"text-on-surface/[0.38]")}),Hn=te("iconButton",Et),kt=Q("iconButton",Et),jt=({variant:e,isVisible:t})=>({progressIndicator:x((e==="linear-determinate"||e=="linear-indeterminate")&&"flex w-full h-1"),track:x("h-full rounded-full bg-primary rounded-l-full",{"max-h-0":!t,"max-h-full":t}),activeIndicator:x({"max-h-0":!t,"max-h-full":t},(e==="linear-determinate"||e=="linear-indeterminate")&&"h-full flex-1 rounded-full bg-primary-container",(e==="circular-determinate"||e=="circular-indeterminate")&&["stroke-primary fill-transparent ",{"stroke-[4px]":t,"stroke-[0px]":!t}]),stop:x("absolute top-1/2 -translate-y-1/2 right-0 bg-primary rounded-full size-1",{"max-h-0":!t,"max-h-full":t})}),On=te("progressIndicator",jt),Lt=Q("progressIndicator",jt),Fe=({variant:e,position:t})=>({sideSheet:x("bg-surface flex justify-between max-w-xs z-10",{"flex-row-reverse":t=="right","h-full":e=="standard"},e=="modal"&&["rounded-2xl fixed top-0 m-[1rem] h-[calc(100dvh-2rem)]",{"right-0":t=="right","left-0":t=="left"}]),container:x("w-full overflow-hidden flex flex-col",{}),header:x("p-4 flex items-center gap-2"),content:x("flex-1 overflow-y-auto"),title:x("text-on-surface-variant text-title-large"),closeButton:x("ml-auto"),divider:x({hidden:e=="modal"}),overlay:x("bg-[black]/[0.32] fixed top-0 left-0 w-screen h-screen")}),It=te("sideSheet",Fe),Vn=Q("sideSheet",Fe),Ae=({isChanging:e})=>({slider:x(["relative w-full h-11 flex items-center rounded gap-x-1.5 cursor-pointer min-w-32"]),activeTrack:x(["h-4 relative transition-all duration-100 bg-primary overflow-hidden rounded-l-full "]),inactiveTrack:x(["h-4 relative transition-all duration-100 bg-primary-container rounded-r-full overflow-hidden"]),handle:x(["transform relative transition-all duration-100 bg-primary h-full rounded-full ",{"w-0.5":e,"w-1":!e}]),valueIndicator:x(["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:x(["h-1 w-1 absolute transform -translate-y-1/2 -translate-x-1/2 top-1/2 rounded-full"])}),zn=te("slider",Ae),Mt=Q("slider",Ae),Ct=()=>({snackbar:x(" rounded bg-inverse-surface "),container:x("pl-4 pr-2 max-w-full py-1 flex items-center flex-wrap"),supportingText:x("text-body-medium text-inverse-on-surface "),icon:x(" ml-auto mr-0 text-inverse-on-surface block dark")}),Yn=te("snackbar",Ct),Rt=Q("snackbar",Ct),Dt=({isSelected:e,disabled:t,inactiveIcon:n})=>({switch:x("group/switch w-[52px] h-[32px] outline-none rounded-full border-2 flex items-center",{"bg-on-surface/[0.12] border-transparent":t},!t&&["cursor-pointer ",{"bg-primary border-primary":e},{"bg-surface-container border-outline":!e}]),handleContainer:x("flex items-center justify-center absolute",{"left-[14px]":!e},{"right-[14px]":e}),handle:x("transition-all duration-100 z-10 rounded-full flex items-center justify-center",{"w-[16px] h-[16px]":!e&&!n},{"w-[24px] h-[24px]":!(!e&&!n)},!t&&["cursor-pointer group-active/switch:h-[28px] group-active/switch:w-[28px]",{"bg-on-primary group-hover/switch:bg-primary-container":e},{"bg-outline group-hover/switch:bg-on-surface-variant":!e}],{"bg-surface":t}),handleStateLayer:x("w-[40px] h-[40px] -z-10 rounded-full absolute",{"group-state-primary":!t}),icon:x("w-[16px] h-[16px]",!t&&[{"text-on-primary-container":e},{"text-on-primary":!e}],{"text-on-surface/[0.38]":t})}),_n=te("switch",Dt),Ft=Q("switch",Dt),At=({isSelected:e,icon:t,label:n,variant:r})=>({tab:x("flex-1 group/tab outline-none flex px-4 justify-center items-center cursor-pointer",{"z-10":e},!!(t&&n)&&r==="primary"&&"h-16",!(t&&n&&r==="primary")&&"h-12"),stateLayer:x("absolute w-full h-full overflow-hidden left-1/2 top-1/2 transform -translate-y-1/2 -translate-x-1/2",r==="primary"&&{"group-hover/tab:hover-state-on-surface group-focus-visible/tab:focus-state-on-surface":!e,"group-hover/tab:hover-state-primary group-focus-visible/tab:focus-state-primary":e},r==="secondary"&&"group-hover/tab:hover-state-on-surface group-focus-visible/tab:focus-state-on-surface"),content:x("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:x("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:x("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:x("bg-primary absolute w-full left-0 bottom-0",r==="primary"&&"h-[3px] rounded-t",r==="secondary"&&"h-0.5")}),qn=te("tab",At),$t=Q("tab",At),Wt=({scrollable:e})=>({tabs:x("border-b border-surface-container-highest bg-surface","flex relative ",{"overflow-x-auto":e})}),Xn=te("tabs",Wt),Pt=Q("tabs",Wt),Bt=()=>({tabPanels:x("overflow-hidden")}),Un=te("tabPanels",Bt),Tt=Q("tabPanels",Bt),Ht=()=>({tabPanel:x("")}),Kn=te("tabPanel",Ht),Ot=Q("tabPanel",Ht),Vt=({disabled:e,leadingIcon:t,trailingIcon:n,variant:r,errorText:s,isFocused:d,value:u,suffix:a,multiline:l})=>({textField:x({"opacity-[.38]":e}),content:x("group/text-field transition-border duration-200 relative flex items-center ",{"h-14":!l},{"border-on-surface-variant":!(s!=null&&s.length)&&!d&&r=="filled","border-outline":!(s!=null&&s.length)&&!d&&r=="outlined","border-primary":!(s!=null&&s.length)&&d,"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]":d}]),stateLayer:x("absolute -z-10 w-full h-full top-0 left-0",{hidden:r=="outlined"},{"group-state-on-surface":!e,"focus-state-on-surface":d}),label:x("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)&&d}),input:x("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":!!a},r=="filled"&&" pb-2 pt-6",r=="outlined"&&"py-4 relative z-10"),activeIndicator:x("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":d}]),supportingText:x(" text-body-small px-4 pt-1",{"text-on-surface-variant":!e&&!(s!=null&&s.length)},{"text-on-surface":e},{"!w-full":d},{"text-error":!!(s!=null&&s.length)}),leadingIcon:x(["h-12 ml-3 flex items-center justify-center",{"cursor-text":!o.isValidElement(t)}]),trailingIcon:x("h-12 w-12 flex items-center justify-center",{"cursor-text":!o.isValidElement(n)}),suffix:x("text-on-surface-variant pl-0 pr-4",r=="filled"&&" pb-2 pt-6",r=="outlined"&&"py-4 relative z-10")}),Gn=te("textField",Vt),zt=Q("textField",Vt),Yt=({position:e,variant:t})=>({toolTip:x(" pointer-events-auto w-max z-10 absolute m-1 w-max-content max-w-[312px]",t=="rich"&&"bg-surface-container rounded-2xl text-on-surface-container shadow-2",t=="plain"&&"bg-inverse-surface rounded text-inverse-on-surface ",{"bottom-full left-1/2 -translate-x-1/2":e=="top","top-full left-1/2 -translate-x-1/2":e=="bottom","right-full top-1/2 -translate-y-1/2":e=="left","left-full top-1/2 -translate-y-1/2":e=="right","bottom-full right-full":e=="top-left","bottom-full left-full":e=="top-right","top-full right-full":e=="bottom-left","top-full left-full":e=="bottom-right"}),container:x("pb-2",t=="rich"&&"px-4 pt-3 ",t=="plain"&&"px-2 py-1"),actions:x("flex gap-10 px-1 mt-2",t=="plain"&&"hidden"),subHead:x("text-title-small mb-1",t=="plain"&&"hidden"),supportingText:x(""),content:x("w-full")}),Jn=te("toolTip",Yt),_t=Q("toolTip",Yt),ce=({icon:e,colors:t=[],className:n,...r})=>{if(typeof e=="string"){let f=e;return t[0]&&(f=f.replace(/<svg([^>]*)>/,`<svg$1 fill="${t[0]}" color="${t[0]}">`),f=f.replace(/<path([^>]*?)>/g,'<path$1 fill="currentColor">')),c.jsx("div",{className:x("size-5 box-content inline-flex fill-current",n),style:{color:t[0]||"inherit"},dangerouslySetInnerHTML:{__html:f}})}if(e&&typeof e=="object"&&"src"in e){const f=e;return c.jsx("img",{src:f.src,width:f.width,height:f.height,className:x("size-5 box-content",n),style:{filter:t[0]?"brightness(0) saturate(100%) invert(1)":void 0},alt:"","aria-hidden":"true"})}const s=e;if(!(s!=null&&s.prefix))throw new Error(`Invalid icon type: ${typeof e}`);const{icon:d}=s,[u,a,,,l]=d||[],i=f=>{switch(f.length){case 2:return{"--fa-primary-color":f[0]||"inherit","--fa-secondary-color":f[1]||"inherit"};case 1:return{color:f[0]};default:return{}}};return c.jsx("svg",{className:x("size-5 box-content",n),style:{...i(t)},xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${u} ${a}`,role:"img","aria-hidden":"true",...r,children:typeof l=="string"?c.jsx("path",{className:"fill-current",d:l}):l.map((f,y)=>c.jsx("path",{d:f},y))})},qt=({variant:e="linear-determinate",value:t=0,transitionDuration:n=1e3,className:r,...s})=>{const[d,u]=o.useState(t),[a]=o.useState(1.5);o.useEffect(()=>{t>100&&(t=100),t<0&&(t=0),u(t)},[t]);const[l,i]=o.useState(!0),f=()=>l?a:a*.5;o.useEffect(()=>{if((e==="circular-indeterminate"||e==="linear-indeterminate")&&d!==100){const m=setInterval(()=>{u(l?10:90),i(!l)},f()*1e3);return()=>clearInterval(m)}},[e,l,d]);const[y,h]=o.useState(!1);o.useEffect(()=>{if(d>=100){const m=setTimeout(()=>{h(!1)},n);return()=>{clearTimeout(m)}}else h(!0)},[d,n]);const p=Lt({className:r,variant:e,value:t,transitionDuration:n,isVisible:y});return c.jsxs(c.Fragment,{children:[(e==="linear-determinate"||e=="linear-indeterminate")&&c.jsxs("div",{className:p.progressIndicator,...s,children:[c.jsx("div",{style:{width:`${d}%`,transition:`width ${n}ms ease-in-out ${d==100?", max-height 200ms 0.5s ease-in-out":""}`},className:p.track}),c.jsx("div",{style:{marginLeft:d!=100?"6px":"0px",transition:`width ${n}ms ease-in-out ${d==100?`, max-height 200ms 0.5s ease-in-out, margin-left ${n}ms ${n/1.5}ms`:""}`},className:p.activeIndicator}),c.jsx("div",{style:{width:"4 px",transition:`width ${n}ms ease-in-out, max-height 200ms 0.5s ease-in-out`},className:p.stop})]}),(e==="circular-determinate"||e=="circular-indeterminate")&&c.jsx(X.motion.svg,{width:"48",height:"48",viewBox:"0 0 48 48",initial:{rotate:-90},animate:{rotate:270},transition:{repeat:1/0,duration:f(),ease:"linear"},className:p.progressIndicator,...s,children:c.jsx(X.motion.circle,{cx:"50%",cy:"50%",r:y?"calc(50% - 2px)":"50%",style:{strokeLinecap:"round"},initial:"hidden",animate:"visible",className:p.activeIndicator,variants:{hidden:{pathLength:l?10/100:90/100},visible:{pathLength:l?90/100:10/100}},transition:{pathLength:{type:"tween",ease:"linear",duration:f(),bounce:0}}})},l+"")]})};function Zn(e){const t={primary:"filled",secondary:"tonal"};return e&&e in t?t[e]:e||"filled"}const ye=({variant:e="filled",disabled:t=!1,icon:n,href:r,label:s,disableTextMargins:d,className:u,iconPosition:a="left",loading:l=!1,shape:i="rounded",onClick:f,onToggle:y,activated:h,ref:p,size:m="medium",allowShapeTransformation:S=!0,transition:w,children:I,...b})=>{if(I&&(s=I),!s)throw new Error("Button component requires either a label prop or children content");e=Zn(e);const g=r?"a":"button",H=o.useRef(null),D=p||H,[v,N]=o.useState(h);o.useEffect(()=>{N(h)},[h]),w={duration:.3,...w};const F=M=>{t&&M.preventDefault(),y?(N(!v),y(!v)):f&&f(M)},L=it({allowShapeTransformation:S,size:m,disableTextMargins:d,shape:i,href:r,disabled:t,icon:n,iconPosition:a,loading:l,variant:e,transition:w,className:u,isActive:v??!1,onToggle:y,activated:v,label:s,children:s}),W=n?c.jsx(ce,{icon:n,className:L.icon}):c.jsx(c.Fragment,{});return c.jsxs(g,{ref:D,href:r,className:L.button,...b,onClick:F,disabled:t,"aria-pressed":y?v:void 0,style:{transition:w.duration+"s"},children:[c.jsx("div",{className:L.touchTarget}),c.jsx(me,{style:{transition:w.duration+"s"},className:L.stateLayer,colorName:x(e==="filled"&&{"on-surface-variant":!v&&!!y,"on-primary":v||!y},e==="elevated"&&{"on-primary":v&&!!y,primary:!v||!y},e==="tonal"&&{"on-secondary":v&&!!y,"on-secondary-container":!v||!y},e==="outlined"&&{"inverse-on-surface":v&&!!y,"on-surface-variant":!v||!y},e==="text"&&"primary"),stateClassName:"state-ripple-group-[button]"}),a==="left"&&W,l&&c.jsx("div",{className:"!absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2",children:c.jsx(qt,{className:()=>({progressIndicator:"h-6 w-6",activeIndicator:x({"!stroke-primary":e==="elevated"&&!t,"!stroke-on-surface/[38%]":e==="elevated"&&t},{"!stroke-on-primary":e==="filled"&&!t,"!stroke-on-surface/[38%]":e==="filled"&&t},{"!stroke-on-secondary-container":e==="tonal"&&!t,"!stroke-on-surface/[38%]":e==="tonal"&&t},{"!stroke-primary":e==="outlined"&&!t,"!stroke-on-surface/[38%]":e==="outlined"&&t},{"!stroke-primary":e==="text"&&!t,"!stroke-on-surface/[38%]":e==="text"&&t})}),variant:"circular-indeterminate"})}),c.jsx("span",{className:L.label,children:s}),a==="right"&&W]})},Qn=({variant:e="outlined",className:t,children:n,interactive:r=!1,ref:s,...d})=>{const u=at({className:t,isInteractive:r,variant:e,children:n}),a=o.useRef(null),l=s||a;return c.jsxs("div",{...d,ref:l,className:u.card,children:[r&&c.jsx(me,{className:u.stateLayer,colorName:"on-surface",stateClassName:"state-ripple-group-[card]"}),n]})},xe=(e,t,n=[0,1])=>{const[r,s]=t,[d,u]=n,l=(Math.max(r,Math.min(e,s))-r)/(s-r);return d+l*(u-d)},Xt=({className:e,children:t,width:n,index:r=0,outputRange:s,ref:d,...u})=>{const a=o.useRef(null),l=d||a,i=ct({className:e,index:r,width:n,children:t,outputRange:s});return c.jsx("div",{ref:l,style:{width:n+"px",maxWidth:s[1]+"px",minWidth:s[0]+"px",willChange:"width"},transition:{duration:.5,ease:"linear"},className:i.carouselItem,...u,children:t})},es=({variant:e="hero",className:t,children:n,ref:r,marginPourcent:s=0,inputRange:d=[.21,.65],outputRange:u=[42,300],gap:a=8,onChange:l,onMetricsChange:i,index:f,scrollSensitivity:y=1.25,...h})=>{const p=o.useRef(null),m=r||p,[S,w]=o.useState(0),I=dt({index:f,className:t,children:n,variant:e,inputRange:d,outputRange:u,marginPourcent:s,onChange:l,gap:a,scrollSensitivity:y,onMetricsChange:i}),b=o.Children.toArray(n).filter(E=>o.isValidElement(E)&&E.type===Xt),g=o.useRef(null),[H,D]=o.useState({}),[v,N]=o.useState(null),F=o.useRef(0),L=o.useRef(null),W=()=>{var he,oe;if(!g.current||!m.current||(v==null?void 0:v.scrollProgress)===void 0)return[];const E=(v==null?void 0:v.scrollVisible)??((he=m.current)==null?void 0:he.clientWidth)??0;function $(U,re){return U.map((se,fe)=>{const ge=(se-re)/Math.abs(U[1]-U[0]);return{itemScrollXCenter:se,relativeIndex:ge,index:fe,width:0}})}const T=b.map((U,re)=>{if(!M[re].current||!g.current)return 0;const fe=re/(b.length-1);return xe(fe,[0,1],[0,1])}),Y=$(T,(v==null?void 0:v.scrollProgress)??0).sort((U,re)=>U.index-re.index);let _=(((oe=m.current)==null?void 0:oe.clientWidth)??E)+a+u[0]+a;const J=Y.sort((U,re)=>Math.abs(U.relativeIndex)-Math.abs(re.relativeIndex)).map((U,re)=>{if(!(_<=0)){if(re==0&&O(U.index),U.width=xe(_-a,[u[0],u[1]],[u[0],u[1]]),_-=U.width+a,_!=0&&_<(u[0]+a)*2){const se=U.width-((u[0]+a)*2-_);_+=U.width,U.width=se,_-=U.width}else if(_==0&&U.width>=u[0]*2+a){const se=U.width-(u[0]+a-_);_+=U.width,U.width=se,_-=U.width}return U}}).filter(Boolean),A=J.reverse(),q=[...J].sort((U,re)=>Math.abs(U.index)-Math.abs(re.index));A.forEach((U,re)=>{const se=A[re+1];if(!se)return;const fe=1-(Math.abs(U.relativeIndex)-Math.abs(se==null?void 0:se.relativeIndex)),ge=xe(fe,[0,2],[U.width+_,se.width]);_+=U.width,U.width=ge,_-=U.width});const ne=J.length/2,le=xe(Math.abs(q[0].relativeIndex),[q[0].index==0?0:ne-1,ne],[0,1]),ue=xe(le,[0,1],[0,1])*-(u[0]+a);return w(ue),Object.fromEntries(J.map(U=>[U.index,U.width]))},M=o.useRef([]).current,[z,O]=o.useState(0);o.useEffect(()=>{l&&l(z)},[z]),o.useEffect(()=>{typeof f=="number"&&b.length>0&&f!==z&&C(f)},[f,b.length]),o.useEffect(()=>{B(z)},[z]),M.length!==b.length&&b.forEach((E,$)=>{M[$]||(M[$]=o.createRef())});const[Z,B]=o.useState(0),C=(E,$={})=>{if(!b.length)return 0;const T=M[E];if(!T||!T.current||!g.current)return 0;const Y=xe(E/Math.max(1,b.length-1),[0,1],[0,1]);return B(E),g.current.dispatchEvent(new CustomEvent("udx:customScroll:set",{bubbles:!0,detail:{progress:Y,orientation:"horizontal",animate:$.animate!==!1}})),Y},R=b.map((E,$)=>{var J;const T=(J=E.props)==null?void 0:J.onClick,Y=A=>{T==null||T(A)},_=()=>B($);return o.cloneElement(E,{width:H[$],outputRange:u,ref:M[$],key:$,index:$,role:"option","aria-selected":z===$,tabIndex:z===$?0:-1,onClick:Y,onFocus:_})}),V=E=>{var $;if(E.scrollTotal>0){($=L.current)==null||$.stop();const T=F.current??0,Y=E.scrollProgress??0;L.current=X.animate(T,Y,{type:"spring",stiffness:260,damping:32,mass:.6,restDelta:5e-4,onUpdate:_=>{F.current=_,N({...E,scrollProgress:_})}})}};o.useEffect(()=>{const E=W();D(E)},[v]);const K=o.useRef(i);o.useEffect(()=>{K.current=i},[i]);const G=o.useRef(null);o.useEffect(()=>{var re;const E=K.current;if(!E||!(m!=null&&m.current))return;const $=b.length;if($<=0)return;const T=((re=m.current)==null?void 0:re.clientWidth)??0,Y=u[1],_=F.current??(v==null?void 0:v.scrollProgress)??0,J=(T+a)/(Y+a),A=Math.max(1,Math.floor(J)),q=Math.max(1,Math.round(A*(2/3))),ne=Math.min(Math.max(0,z),Math.max(0,$-1)),le=ne>0,ue=ne<$-1,he={total:$,selectedIndex:ne,visibleApprox:J,visibleFull:A,stepHalf:q,canPrev:le,canNext:ue,scrollProgress:_,viewportWidth:T,itemMaxWidth:Y,gap:a},oe=G.current;let U=!oe;if(!U){for(const se in he)if(he[se]!==oe[se]){U=!0;break}}U&&(G.current=he,E(he))},[m,b.length,z,v,a,u]),o.useEffect(()=>()=>{var E;(E=L.current)==null||E.stop()},[]);const[ee,k]=o.useState(0);o.useLayoutEffect(()=>{let E=u[1];v&&E>v.scrollVisible&&(E=v.scrollVisible);const $=(E+a)*R.length/y;k($)},[m,M,v]);const j=E=>{if(!b.length)return;const $=Z??z;switch(E.key){case"ArrowLeft":E.preventDefault(),C(Math.max(0,$-1));break;case"ArrowRight":E.preventDefault(),C(Math.min(b.length-1,$+1));break;case"Home":E.preventDefault(),C(0);break;case"End":E.preventDefault(),C(b.length-1);break;case"Enter":case" ":E.preventDefault(),C($);break}};return o.useEffect(()=>{const E=m.current;if(!E)return;const $=T=>{const Y=T.detail;Y&&typeof Y.index=="number"&&C(Y.index)};return E.addEventListener("udx:carousel:centerIndex",$),()=>{E.removeEventListener("udx:carousel:centerIndex",$)}},[m,b.length]),c.jsx("div",{className:I.carousel,ref:m,role:"listbox","aria-orientation":"horizontal",onKeyDown:j,...h,children:c.jsx(et,{draggable:!0,orientation:"horizontal",onScroll:V,scrollSize:ee,children:c.jsx("div",{className:I.track,ref:g,style:{gap:`${a}px`,translate:S,willChange:"translate"},children:R})})})};/*!
|
|
2
2
|
* Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com
|
|
3
3
|
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
4
4
|
* Copyright 2025 Fonticons, Inc.
|
|
5
|
-
*/var ts={prefix:"fas",iconName:"minus",icon:[448,512,[8211,8722,10134,"subtract"],"f068","M0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32z"]},ns={prefix:"fas",iconName:"calendar-days",icon:[448,512,["calendar-alt"],"f073","M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 32 0c35.3 0 64 28.7 64 64l0 288c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 128C0 92.7 28.7 64 64 64l32 0 0-32c0-17.7 14.3-32 32-32zM64 240l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm128 0l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM64 368l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm112 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z"]},ss={prefix:"fas",iconName:"chevron-right",icon:[320,512,[9002],"f054","M311.1 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L243.2 256 73.9 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"]},rs={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-192a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.6 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"]},Ut={prefix:"fas",iconName:"check",icon:[448,512,[10003,10004],"f00c","M434.8 70.1c14.3 10.4 17.5 30.4 7.1 44.7l-256 352c-5.5 7.6-14 12.3-23.4 13.1s-18.5-2.7-25.1-9.3l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l101.5 101.5 234-321.7c10.4-14.3 30.4-17.5 44.7-7.1z"]},we={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]},os=we,is={prefix:"fas",iconName:"chevron-down",icon:[448,512,[],"f078","M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"]},ls={prefix:"fas",iconName:"chevron-left",icon:[320,512,[9001],"f053","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"]},as={prefix:"fas",iconName:"bars",icon:[448,512,["navicon"],"f0c9","M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]};const cs=({checked:e,defaultChecked:t,indeterminate:n=!1,disabled:r=!1,error:s=!1,onChange:d,id:u,name:a,value:l,style:i,className:f,...y})=>{const h=o.useId(),p=u||h,m=e!==void 0,[S,w]=o.useState(t??!1),I=m?e:S,[b,g]=o.useState(!1),H=o.useRef(null);o.useEffect(()=>{H.current&&(H.current.indeterminate=n)},[n]);const D=N=>{r||(m||w(N.target.checked),d&&d(N))},v=ht({isChecked:!!I,isIndeterminate:n,isDisabled:r,isError:s,isFocused:b,isHovered:!1});return c.jsx("div",{className:x(v.checkbox,f,"group/checkbox"),style:i,children:c.jsxs(me,{stateClassName:v.stateLayer,colorName:I||n?"primary":"on-surface",children:[c.jsx("input",{ref:H,type:"checkbox",id:p,name:a,value:l,checked:I,disabled:r,onChange:D,onFocus:()=>g(!0),onBlur:()=>g(!1),className:v.input,...y}),c.jsx("div",{className:v.box}),c.jsx(X.AnimatePresence,{children:(I||n)&&c.jsx(X.motion.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},transition:{duration:.15},className:v.icon,children:c.jsx(ce,{icon:n?ts:Ut,className:"size-3.5"})})})]})})},Le=({variant:e="outlined",disabled:t=!1,icon:n,href:r,label:s,className:d,onClick:u,onToggle:a,activated:l,ref:i,onRemove:f,editable:y,onEditStart:h,onEditCommit:p,onEditCancel:m,onChange:S,transition:w,children:I,editing:b,...g})=>{if(I&&(s=I),s===void 0&&!y)throw new Error("Chip component requires either a label prop or children content");const H=r?"a":"button",D=o.useRef(null),v=i||D,[N,F]=o.useState(l),[L,W]=o.useState(!1),[M,z]=o.useState(b&&y),[O,Z]=o.useState(!1),[B,C]=o.useState(typeof s=="string"?s:""),R=o.useRef(null);o.useEffect(()=>{F(l)},[l]),o.useEffect(()=>{if(b&&z(b),y&&L){const A=setTimeout(()=>{g!=null&&g.draggable&&O||z(!0)},1e3);return()=>clearTimeout(A)}else L||z(!1)},[L,y,O,g,B]),o.useEffect(()=>{if(M){C(typeof s=="string"?s:"");const A=_.current||R.current;if(A){A.focus();const q=document.createRange();q.selectNodeContents(A),q.collapse(!1);const ne=window.getSelection();ne==null||ne.removeAllRanges(),ne==null||ne.addRange(q)}}},[M]),w={duration:.3,...w};const V=A=>{t&&A.preventDefault(),a?(F(!N),a(!N)):u&&u(A)},K=!!a||!!f||!!u||!!r||!!y;l&&(n=Ut);const{onFocus:G,onBlur:ee,onKeyDown:k,onDragStart:j,onDragEnd:E,onDoubleClick:$,...T}=g??{},Y=pt({href:r,disabled:t,icon:n,variant:e,transition:w,className:d,isActive:N??!1,onToggle:a,activated:N,label:s,isInteractive:K,children:s,isFocused:L,isDragging:O,onEditCommit:p,isEditing:M}),_=o.useRef(null),J=()=>{const A=(B??"").trim();if(!A){f&&f();return}p==null||p(A)};return c.jsxs(H,{contentEditable:!1,ref:v,href:r,className:Y.chip,...T,onClick:A=>{M||V(A)},draggable:!t&&!!(g!=null&&g.draggable),onDragStart:A=>{!t&&(g!=null&&g.draggable)&&Z(!0),j==null||j(A)},onDragEnd:A=>{g!=null&&g.draggable&&Z(!1),E==null||E(A)},onDoubleClick:A=>{!t&&y&&!M&&(h==null||h(),A.preventDefault(),A.stopPropagation()),$==null||$(A)},onFocus:A=>{K&&W(!0),G==null||G(A)},onBlur:A=>{W(!1),ee==null||ee(A)},onKeyDown:A=>{const q=A.key;if(!t&&M){q==="Enter"?(A.preventDefault(),J()):q==="Escape"?(A.preventDefault(),m==null||m()):f&&(B==null?void 0:B.trim())===""&&(q==="Backspace"||q==="Delete"||q==="Del")&&(A.preventDefault(),A.stopPropagation(),f());return}if(!t&&L){if(y&&!a&&(q==="F2"||q==="Enter")){A.preventDefault(),h==null||h();return}if(a&&(q==="Enter"||q===" "||q==="Spacebar")){A.preventDefault();const ne=!N;F(ne),a(ne)}f&&(q==="Backspace"||q==="Delete"||q==="Del")&&(A.preventDefault(),A.stopPropagation(),f())}k==null||k(A)},disabled:t,"aria-pressed":a?N:void 0,style:{transition:w.duration+"s"},children:[K&&!t&&!M&&c.jsx(me,{style:{transition:w.duration+"s"},className:Y.stateLayer,colorName:x({"on-surface-variant":!N,"on-secondary-container":N}),stateClassName:"state-ripple-group-[chip]"}),n&&c.jsx(ce,{icon:n,className:Y.leadingIcon}),c.jsx("span",{ref:_,contentEditable:!!y&&!!M,suppressContentEditableWarning:!0,className:Y.label,role:y?"textbox":void 0,spellCheck:!1,onInput:A=>{const q=A.currentTarget.innerText;C(q),S==null||S(q)},onBlur:A=>{y&&M&&J()},onKeyDown:A=>{if(y&&M&&A.key==="Enter"){A.preventDefault(),A.stopPropagation(),J();return}y&&M&&A.key==="Escape"&&(A.preventDefault(),A.stopPropagation(),m==null||m())},children:s}),f&&!M&&c.jsx(ce,{icon:we,className:Y.trailingIcon,onMouseDown:A=>{A.preventDefault(),A.stopPropagation()},onClick:A=>{A.stopPropagation(),t||f()}})]})},Ae=({orientation:e="horizontal",className:t,...n})=>{const r=gt({orientation:e,className:t});return c.jsx("hr",{className:r.divider,...n})},ie=[];for(let e=0;e<256;++e)ie.push((e+256).toString(16).slice(1));function us(e,t=0){return(ie[e[t+0]]+ie[e[t+1]]+ie[e[t+2]]+ie[e[t+3]]+"-"+ie[e[t+4]]+ie[e[t+5]]+"-"+ie[e[t+6]]+ie[e[t+7]]+"-"+ie[e[t+8]]+ie[e[t+9]]+"-"+ie[e[t+10]]+ie[e[t+11]]+ie[e[t+12]]+ie[e[t+13]]+ie[e[t+14]]+ie[e[t+15]]).toLowerCase()}let je;const ds=new Uint8Array(16);function fs(){if(!je){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");je=crypto.getRandomValues.bind(crypto)}return je(ds)}const hs=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qe={randomUUID:hs};function Kt(e,t,n){var s;if(qe.randomUUID&&!e)return qe.randomUUID();e=e||{};const r=e.random??((s=e.rng)==null?void 0:s.call(e))??fs();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,us(r)}const ms=({variant:e="input",className:t,scrollable:n=!0,draggable:r=!1,items:s,onItemsChange:d})=>{const u=s??[],a=o.useRef(null),[l,i]=o.useState(!1),f=o.useRef(new WeakMap),y=o.useCallback(v=>{const N=f.current;let F=N.get(v);return F||(F=Kt(),N.set(v,F)),F},[]);o.useEffect(()=>{var v,N;l&&(e=="input"?(v=H.current)==null||v.focus():(N=a.current)==null||N.focus())},[l]);const h=o.useRef([]),p=o.useRef(!1),m=o.useCallback(v=>{d==null||d(v(u))},[d,u]),S=o.useCallback(v=>{m(N=>N.filter((F,L)=>L!==v))},[m]),w=xt({scrollable:n,className:t,variant:e}),I=o.useCallback((v="")=>{if(e!=="input"||p.current)return;p.current=!0;const N={label:v},F=y(N),L=[...u,N];d==null||d(L),requestAnimationFrame(()=>{g(F),p.current=!1})},[e,d,u,y]),[b,g]=o.useState(null);o.useEffect(()=>{var v;if(b){const N=u.findIndex(F=>y(F)===b);if(N!==-1){const F=h.current[N];(v=F==null?void 0:F.focus)==null||v.call(F);const L=a.current,W=F.offsetLeft+F.offsetWidth/2-L.offsetWidth/2;L.scrollTo({left:W,behavior:"smooth"})}}},[b,u,y]);const H=o.useRef(null),D=(l||u.length===0)&&e==="input";return c.jsxs("div",{ref:a,role:"list","aria-label":"Chips",className:w.chips,tabIndex:e==="input"?0:void 0,onFocus:v=>{v.target===v.currentTarget&&i(!0)},onBlur:()=>{i(!1)},onKeyDown:v=>{var z;if(e!=="input")return;const N=v.key,L=v.target===v.currentTarget;if(!l)return;const W=document.activeElement,M=h.current.findIndex(O=>O===W);if(N==="ArrowLeft"){v.preventDefault();const O=M>0?M-1:u.length-1,Z=y(u[O]);g(Z);return}if(N==="ArrowRight"){v.preventDefault();const O=M>=0?(M+1)%Math.max(1,u.length):0,Z=y(u[O]);g(Z);return}if(N==="Home"){v.preventDefault();const O=y(u[0]);g(O);return}if(N==="End"){v.preventDefault();const O=y(u[u.length-1]);g(O);return}if(L&&N==="Backspace"){if(v.preventDefault(),u.length>0){const O=h.current[u.length-1];(z=O==null?void 0:O.focus)==null||z.call(O)}return}},children:[u.map((v,N)=>{const F=y(v),L=e==="input",W=L?{editable:!0,editing:b===F,onEditCommit:M=>{i(!0),m(z=>z.map((O,Z)=>Z===N?{...O,label:M}:O))},onEditCancel:()=>{i(!0)},onChange:()=>{if(h.current.length==N+1){const M=a.current;requestAnimationFrame(()=>{M.scrollTo({left:M.scrollWidth,behavior:"smooth"})})}}}:{};return c.jsx(Le,{ref:M=>h.current[N]=M,label:v.label??"",icon:v.icon,activated:v.activated,disabled:v.disabled,variant:v.variant,href:v.href,draggable:r,...W,onToggle:v.activated===void 0?void 0:M=>m(z=>z.map((O,Z)=>Z===N?{...O,activated:M}:O)),onBlur:()=>{b===F&&g(null)},onRemove:L?()=>{i(!0),S(N)}:void 0},F)}),l&&c.jsxs(c.Fragment,{children:[c.jsx(Ae,{orientation:"vertical",className:"animate-[var(--animate-blink)] border-outline",style:{"--animate-blink":"blink 1s cubic-bezier(0.4, 0, 0.6, 1) infinite"}}),c.jsx("style",{children:`
|
|
5
|
+
*/var ts={prefix:"fas",iconName:"minus",icon:[448,512,[8211,8722,10134,"subtract"],"f068","M0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32z"]},ns={prefix:"fas",iconName:"calendar-days",icon:[448,512,["calendar-alt"],"f073","M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 32 0c35.3 0 64 28.7 64 64l0 288c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 128C0 92.7 28.7 64 64 64l32 0 0-32c0-17.7 14.3-32 32-32zM64 240l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm128 0l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM64 368l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm112 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z"]},ss={prefix:"fas",iconName:"chevron-right",icon:[320,512,[9002],"f054","M311.1 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L243.2 256 73.9 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"]},rs={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-192a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.6 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"]},Ut={prefix:"fas",iconName:"check",icon:[448,512,[10003,10004],"f00c","M434.8 70.1c14.3 10.4 17.5 30.4 7.1 44.7l-256 352c-5.5 7.6-14 12.3-23.4 13.1s-18.5-2.7-25.1-9.3l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l101.5 101.5 234-321.7c10.4-14.3 30.4-17.5 44.7-7.1z"]},we={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]},os=we,is={prefix:"fas",iconName:"chevron-down",icon:[448,512,[],"f078","M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"]},ls={prefix:"fas",iconName:"chevron-left",icon:[320,512,[9001],"f053","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"]},as={prefix:"fas",iconName:"bars",icon:[448,512,["navicon"],"f0c9","M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]};const cs=({checked:e,defaultChecked:t,indeterminate:n=!1,disabled:r=!1,error:s=!1,onChange:d,id:u,name:a,value:l,style:i,className:f,...y})=>{const h=o.useId(),p=u||h,m=e!==void 0,[S,w]=o.useState(t??!1),I=m?e:S,[b,g]=o.useState(!1),H=o.useRef(null);o.useEffect(()=>{H.current&&(H.current.indeterminate=n)},[n]);const D=N=>{r||(m||w(N.target.checked),d&&d(N))},v=ht({isChecked:!!I,isIndeterminate:n,isDisabled:r,isError:s,isFocused:b,isHovered:!1});return c.jsx("div",{className:x(v.checkbox,f,"group/checkbox"),style:i,children:c.jsxs(me,{stateClassName:v.stateLayer,colorName:I||n?"primary":"on-surface",children:[c.jsx("input",{ref:H,type:"checkbox",id:p,name:a,value:l,checked:I,disabled:r,onChange:D,onFocus:()=>g(!0),onBlur:()=>g(!1),className:v.input,...y}),c.jsx("div",{className:v.box}),c.jsx(X.AnimatePresence,{children:(I||n)&&c.jsx(X.motion.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},transition:{duration:.15},className:v.icon,children:c.jsx(ce,{icon:n?ts:Ut,className:"size-3.5"})})})]})})},Le=({variant:e="outlined",disabled:t=!1,icon:n,href:r,label:s,className:d,onClick:u,onToggle:a,activated:l,ref:i,onRemove:f,editable:y,onEditStart:h,onEditCommit:p,onEditCancel:m,onChange:S,transition:w,children:I,editing:b,...g})=>{if(I&&(s=I),s===void 0&&!y)throw new Error("Chip component requires either a label prop or children content");const H=r?"a":"button",D=o.useRef(null),v=i||D,[N,F]=o.useState(l),[L,W]=o.useState(!1),[M,z]=o.useState(b&&y),[O,Z]=o.useState(!1),[B,C]=o.useState(typeof s=="string"?s:""),R=o.useRef(null);o.useEffect(()=>{F(l)},[l]),o.useEffect(()=>{if(b&&z(b),y&&L){const A=setTimeout(()=>{g!=null&&g.draggable&&O||z(!0)},1e3);return()=>clearTimeout(A)}else L||z(!1)},[L,y,O,g,B]),o.useEffect(()=>{if(M){C(typeof s=="string"?s:"");const A=_.current||R.current;if(A){A.focus();const q=document.createRange();q.selectNodeContents(A),q.collapse(!1);const ne=window.getSelection();ne==null||ne.removeAllRanges(),ne==null||ne.addRange(q)}}},[M]),w={duration:.3,...w};const V=A=>{t&&A.preventDefault(),a?(F(!N),a(!N)):u&&u(A)},K=!!a||!!f||!!u||!!r||!!y;l&&(n=Ut);const{onFocus:G,onBlur:ee,onKeyDown:k,onDragStart:j,onDragEnd:E,onDoubleClick:$,...T}=g??{},Y=pt({href:r,disabled:t,icon:n,variant:e,transition:w,className:d,isActive:N??!1,onToggle:a,activated:N,label:s,isInteractive:K,children:s,isFocused:L,isDragging:O,onEditCommit:p,isEditing:M}),_=o.useRef(null),J=()=>{const A=(B??"").trim();if(!A){f&&f();return}p==null||p(A)};return c.jsxs(H,{contentEditable:!1,ref:v,href:r,className:Y.chip,...T,onClick:A=>{M||V(A)},draggable:!t&&!!(g!=null&&g.draggable),onDragStart:A=>{!t&&(g!=null&&g.draggable)&&Z(!0),j==null||j(A)},onDragEnd:A=>{g!=null&&g.draggable&&Z(!1),E==null||E(A)},onDoubleClick:A=>{!t&&y&&!M&&(h==null||h(),A.preventDefault(),A.stopPropagation()),$==null||$(A)},onFocus:A=>{K&&W(!0),G==null||G(A)},onBlur:A=>{W(!1),ee==null||ee(A)},onKeyDown:A=>{const q=A.key;if(!t&&M){q==="Enter"?(A.preventDefault(),J()):q==="Escape"?(A.preventDefault(),m==null||m()):f&&(B==null?void 0:B.trim())===""&&(q==="Backspace"||q==="Delete"||q==="Del")&&(A.preventDefault(),A.stopPropagation(),f());return}if(!t&&L){if(y&&!a&&(q==="F2"||q==="Enter")){A.preventDefault(),h==null||h();return}if(a&&(q==="Enter"||q===" "||q==="Spacebar")){A.preventDefault();const ne=!N;F(ne),a(ne)}f&&(q==="Backspace"||q==="Delete"||q==="Del")&&(A.preventDefault(),A.stopPropagation(),f())}k==null||k(A)},disabled:t,"aria-pressed":a?N:void 0,style:{transition:w.duration+"s"},children:[K&&!t&&!M&&c.jsx(me,{style:{transition:w.duration+"s"},className:Y.stateLayer,colorName:x({"on-surface-variant":!N,"on-secondary-container":N}),stateClassName:"state-ripple-group-[chip]"}),n&&c.jsx(ce,{icon:n,className:Y.leadingIcon}),c.jsx("span",{ref:_,contentEditable:!!y&&!!M,suppressContentEditableWarning:!0,className:Y.label,role:y?"textbox":void 0,spellCheck:!1,onInput:A=>{const q=A.currentTarget.innerText;C(q),S==null||S(q)},onBlur:A=>{y&&M&&J()},onKeyDown:A=>{if(y&&M&&A.key==="Enter"){A.preventDefault(),A.stopPropagation(),J();return}y&&M&&A.key==="Escape"&&(A.preventDefault(),A.stopPropagation(),m==null||m())},children:s}),f&&!M&&c.jsx(ce,{icon:we,className:Y.trailingIcon,onMouseDown:A=>{A.preventDefault(),A.stopPropagation()},onClick:A=>{A.stopPropagation(),t||f()}})]})},$e=({orientation:e="horizontal",className:t,...n})=>{const r=gt({orientation:e,className:t});return c.jsx("hr",{className:r.divider,...n})},ie=[];for(let e=0;e<256;++e)ie.push((e+256).toString(16).slice(1));function us(e,t=0){return(ie[e[t+0]]+ie[e[t+1]]+ie[e[t+2]]+ie[e[t+3]]+"-"+ie[e[t+4]]+ie[e[t+5]]+"-"+ie[e[t+6]]+ie[e[t+7]]+"-"+ie[e[t+8]]+ie[e[t+9]]+"-"+ie[e[t+10]]+ie[e[t+11]]+ie[e[t+12]]+ie[e[t+13]]+ie[e[t+14]]+ie[e[t+15]]).toLowerCase()}let je;const ds=new Uint8Array(16);function fs(){if(!je){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");je=crypto.getRandomValues.bind(crypto)}return je(ds)}const hs=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Xe={randomUUID:hs};function Kt(e,t,n){var s;if(Xe.randomUUID&&!e)return Xe.randomUUID();e=e||{};const r=e.random??((s=e.rng)==null?void 0:s.call(e))??fs();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,us(r)}const ms=({variant:e="input",className:t,scrollable:n=!0,draggable:r=!1,items:s,onItemsChange:d})=>{const u=s??[],a=o.useRef(null),[l,i]=o.useState(!1),f=o.useRef(new WeakMap),y=o.useCallback(v=>{const N=f.current;let F=N.get(v);return F||(F=Kt(),N.set(v,F)),F},[]);o.useEffect(()=>{var v,N;l&&(e=="input"?(v=H.current)==null||v.focus():(N=a.current)==null||N.focus())},[l]);const h=o.useRef([]),p=o.useRef(!1),m=o.useCallback(v=>{d==null||d(v(u))},[d,u]),S=o.useCallback(v=>{m(N=>N.filter((F,L)=>L!==v))},[m]),w=xt({scrollable:n,className:t,variant:e}),I=o.useCallback((v="")=>{if(e!=="input"||p.current)return;p.current=!0;const N={label:v},F=y(N),L=[...u,N];d==null||d(L),requestAnimationFrame(()=>{g(F),p.current=!1})},[e,d,u,y]),[b,g]=o.useState(null);o.useEffect(()=>{var v;if(b){const N=u.findIndex(F=>y(F)===b);if(N!==-1){const F=h.current[N];(v=F==null?void 0:F.focus)==null||v.call(F);const L=a.current,W=F.offsetLeft+F.offsetWidth/2-L.offsetWidth/2;L.scrollTo({left:W,behavior:"smooth"})}}},[b,u,y]);const H=o.useRef(null),D=(l||u.length===0)&&e==="input";return c.jsxs("div",{ref:a,role:"list","aria-label":"Chips",className:w.chips,tabIndex:e==="input"?0:void 0,onFocus:v=>{v.target===v.currentTarget&&i(!0)},onBlur:()=>{i(!1)},onKeyDown:v=>{var z;if(e!=="input")return;const N=v.key,L=v.target===v.currentTarget;if(!l)return;const W=document.activeElement,M=h.current.findIndex(O=>O===W);if(N==="ArrowLeft"){v.preventDefault();const O=M>0?M-1:u.length-1,Z=y(u[O]);g(Z);return}if(N==="ArrowRight"){v.preventDefault();const O=M>=0?(M+1)%Math.max(1,u.length):0,Z=y(u[O]);g(Z);return}if(N==="Home"){v.preventDefault();const O=y(u[0]);g(O);return}if(N==="End"){v.preventDefault();const O=y(u[u.length-1]);g(O);return}if(L&&N==="Backspace"){if(v.preventDefault(),u.length>0){const O=h.current[u.length-1];(z=O==null?void 0:O.focus)==null||z.call(O)}return}},children:[u.map((v,N)=>{const F=y(v),L=e==="input",W=L?{editable:!0,editing:b===F,onEditCommit:M=>{i(!0),m(z=>z.map((O,Z)=>Z===N?{...O,label:M}:O))},onEditCancel:()=>{i(!0)},onChange:()=>{if(h.current.length==N+1){const M=a.current;requestAnimationFrame(()=>{M.scrollTo({left:M.scrollWidth,behavior:"smooth"})})}}}:{};return c.jsx(Le,{ref:M=>h.current[N]=M,label:v.label??"",icon:v.icon,activated:v.activated,disabled:v.disabled,variant:v.variant,href:v.href,draggable:r,...W,onToggle:v.activated===void 0?void 0:M=>m(z=>z.map((O,Z)=>Z===N?{...O,activated:M}:O)),onBlur:()=>{b===F&&g(null)},onRemove:L?()=>{i(!0),S(N)}:void 0},F)}),l&&c.jsxs(c.Fragment,{children:[c.jsx($e,{orientation:"vertical",className:"animate-[var(--animate-blink)] border-outline",style:{"--animate-blink":"blink 1s cubic-bezier(0.4, 0, 0.6, 1) infinite"}}),c.jsx("style",{children:`
|
|
6
6
|
@keyframes blink {
|
|
7
7
|
0%, 50% { opacity: 1; }
|
|
8
8
|
50.01%, 100% { opacity: 0; }
|
|
9
9
|
}
|
|
10
|
-
`})]}),D&&c.jsx(Le,{ref:H,className:"opacity-0",draggable:r,editable:!0,editing:!0,onChange:v=>{var N;if(v=v.replace(/( )+/g," ").trim(),console.log("Ghost chip onChange",v,!!v),v)I(v);else if(u.length>0){const F=h.current[u.length-1];(N=F==null?void 0:F.focus)==null||N.call(F)}},onEditCommit:()=>{},onBlur:()=>{i(!1)},onFocus:v=>{i(!0),v.stopPropagation()},children:" "})]})};function Gt({trigger:e=["hover","focus"],isOpen:t,defaultOpen:n=!1,onOpenChange:r,openDelay:s=400,closeDelay:d=150,id:u}={}){const a=o.useId(),l=u??`tooltip-${a}`,i=Array.isArray(e)?e:[e],f=typeof t=="boolean",[y,h]=o.useState(n?"hovered":"hidden"),[p,m]=o.useState(!1),S=o.useRef(null),w=o.useRef(null),I=o.useCallback(()=>{S.current&&(clearTimeout(S.current),S.current=null),w.current&&(clearTimeout(w.current),w.current=null)},[]);o.useEffect(()=>()=>I(),[I]);const b=o.useCallback(C=>{if(f){const R=C!=="hidden";r==null||r(R)}else{h(C);const R=C!=="hidden";r==null||r(R)}},[f,r]),g=f?t?"hovered":"hidden":y,H=g!=="hidden",D=C=>{switch(C){case"hidden":return 0;case"hovered":return 1;case"focused":return 2;case"clicked":return 3;default:return 0}},v=o.useCallback(C=>{I(),!(D(C)<=D(g))&&(S.current=setTimeout(()=>{b(C)},s))},[I,s,g,b]),N=o.useCallback(C=>{I(),w.current=setTimeout(()=>{(!f&&D(y)<=D(C)||f)&&b("hidden")},d)},[I,d,y,f,b]),F=o.useCallback(()=>{i.includes("hover")&&v("hovered")},[i,v]),L=o.useCallback(()=>{i.includes("hover")&&(g==="focused"||g==="clicked"||p||N("hovered"))},[i,g,p,N]),W=o.useCallback(()=>{i.includes("focus")&&(I(),b("focused"))},[i,I,b]),M=o.useCallback(()=>{if(i.includes("focus")&&g!=="clicked"){if(i.includes("hover")&&p){b("hovered");return}N("focused")}},[i,g,p,N,b]),z=o.useCallback(()=>{i.includes("click")&&(I(),b(g==="clicked"?"hidden":"clicked"))},[i,g,I,b]),O=o.useCallback(C=>{C.key==="Escape"&&H&&(I(),b("hidden"),C.preventDefault())},[H,I,b]),Z=o.useCallback(()=>{m(!0),I()},[I]),B=o.useCallback(()=>{m(!1),i.includes("hover")&&g==="hovered"&&N("hovered")},[i,g,N]);return{triggerProps:{"aria-describedby":H?l:void 0,onMouseEnter:F,onMouseLeave:L,onFocus:W,onBlur:M,onClick:z,onKeyDown:O},tooltipProps:{id:l,role:"tooltip","aria-hidden":!H,onMouseEnter:Z,onMouseLeave:B},isOpen:H,state:g}}const $e=({variant:e="plain",buttons:t,className:n,children:r,title:s,text:d,content:u,position:a,targetRef:l,ref:i,trigger:f=["hover","focus"],transition:y,openDelay:h=400,closeDelay:p=150,isOpen:m,defaultOpen:S=!1,onOpenChange:w,id:I,anchorRef:b,...g})=>{const D=a||(e==="rich"?"bottom-right":"bottom");if(y={duration:.3,...y},!r&&!l)throw new Error("Tooltip must have a child or a targetRef");t&&!Array.isArray(t)&&(t=[t]);const v=o.useRef(null),F=b||(l||v),{triggerProps:L,tooltipProps:W,isOpen:M}=Gt({trigger:f,isOpen:m,defaultOpen:S,onOpenChange:w,openDelay:h,closeDelay:p,id:I}),z=!l&&o.isValidElement(r)?o.cloneElement(r,{ref:v,...L,onMouseEnter:B=>{var C,R;L.onMouseEnter(),(R=(C=r.props)==null?void 0:C.onMouseEnter)==null||R.call(C,B)},onMouseLeave:B=>{var C,R;L.onMouseLeave(),(R=(C=r.props)==null?void 0:C.onMouseLeave)==null||R.call(C,B)},onFocus:B=>{var C,R;L.onFocus(),(R=(C=r.props)==null?void 0:C.onFocus)==null||R.call(C,B)},onBlur:B=>{var C,R;L.onBlur(),(R=(C=r.props)==null?void 0:C.onBlur)==null||R.call(C,B)},onClick:B=>{var C,R;L.onClick(),(R=(C=r.props)==null?void 0:C.onClick)==null||R.call(C,B)},onKeyDown:B=>{var C,R;L.onKeyDown(B),(R=(C=r.props)==null?void 0:C.onKeyDown)==null||R.call(C,B)}}):r;o.useEffect(()=>{if(!l)return;const B=l.current;if(!B)return;const C=()=>L.onMouseEnter(),R=()=>L.onMouseLeave(),V=()=>L.onFocus(),K=()=>L.onBlur(),G=()=>L.onClick(),ee=k=>L.onKeyDown(k);return B.addEventListener("mouseenter",C),B.addEventListener("mouseleave",R),B.addEventListener("focus",V,!0),B.addEventListener("blur",K,!0),B.addEventListener("click",G),B.addEventListener("keydown",ee),L["aria-describedby"]?B.setAttribute("aria-describedby",L["aria-describedby"]):B.removeAttribute("aria-describedby"),()=>{B.removeEventListener("mouseenter",C),B.removeEventListener("mouseleave",R),B.removeEventListener("focus",V,!0),B.removeEventListener("blur",K,!0),B.removeEventListener("click",G),B.removeEventListener("keydown",ee)}},[l,L]);const O=_t({variant:e,buttons:t,className:n,title:s,text:d,position:D,trigger:f,targetRef:l,children:r}),Z={open:{opacity:1,height:"auto"},close:{opacity:0,height:16}};return c.jsxs(c.Fragment,{children:[z,c.jsx(X.AnimatePresence,{children:M&&c.jsx(Ce,{anchorRef:F,position:D,children:c.jsx(X.motion.div,{initial:"close",variants:Z,animate:"open",transition:{duration:y.duration},exit:"close",className:O.toolTip,...g,...W,children:c.jsx("div",{className:O.container,children:u?c.jsx("div",{className:O.content,children:u}):c.jsxs(c.Fragment,{children:[s&&c.jsx("div",{className:O.subHead,children:s}),d&&c.jsx("div",{className:O.supportingText,children:d}),t&&c.jsx("div",{className:O.actions,children:Array.isArray(t)&&t.map((B,C)=>c.jsx(ye,{size:"small",variant:"text",...B},C))})]})})})})})]})},Se=({className:e,label:t,variant:n="primary",size:r="medium",href:s,type:d,icon:u,extended:a=!1,ref:l,transition:i,children:f,...y})=>{if(f&&(t=f),!t)throw new Error("FAB component requires either a label prop or children content");const h=s?"a":"button",p=bt({href:s,icon:u,extended:a,label:t,size:r,variant:n,className:e,transition:i,children:t});i={duration:.3,...i};const m=o.useRef(null),S=l||m,w={visible:{width:"auto",marginLeft:12,opacity:1,transition:{...i,opacity:{duration:i.duration/2,delay:i.duration-i.duration/2}}},hidden:{width:0,marginLeft:0,opacity:0,transition:{...i,marginLeft:{duration:i.duration/2,delay:i.duration-i.duration/2}}}};return c.jsxs(h,{...y,ref:S,href:s,"aria-label":a?void 0:t,className:p.fab,children:[c.jsx($e,{trigger:a?null:void 0,text:t,targetRef:S}),c.jsx(me,{style:{transition:i.duration+"s"},className:p.stateLayer,colorName:x({"on-primary":n=="primary","on-secondary":n=="secondary","on-tertiary":n=="tertiary","on-primary-container":n=="primaryContainer","on-secondary-container":n=="secondaryContainer","on-tertiary-container":n=="tertiaryContainer"}),stateClassName:"state-ripple-group-[fab]"}),c.jsx(ce,{icon:u,className:p.icon}),c.jsx(X.AnimatePresence,{children:a&&c.jsx(X.motion.span,{variants:w,initial:"hidden",animate:"visible",exit:"hidden",className:p.label,children:t})})]})},ve=({variant:e="standard",href:t,disabled:n=!1,title:r,label:s,onToggle:d,activated:u=!1,onClick:a,icon:l,size:i="medium",iconSelected:f,className:y,ref:h,width:p="default",shape:m="rounded",allowShapeTransformation:S=!0,transition:w,children:I,...b})=>{if(I&&(s=I),!s)throw new Error("IconButton component requires either a label prop or children content to provide an accessible aria-label");!r&&r!==null&&(r=s);const[g,H]=o.useState(u),D=W=>{n&&W.preventDefault(),d?(H(!g),d(!g)):a&&a(W)};o.useEffect(()=>{H(u)},[u]);const v=t?"a":"button",N=kt({transition:w,shape:m,allowShapeTransformation:S,width:p,href:t,activated:g,label:s,iconSelected:f,isActive:g,onToggle:d,disabled:n,icon:l,variant:e,className:y,size:i,children:s,...b}),F=o.useRef(null),L=h||F;return w={duration:.3,...w},c.jsxs(v,{disabled:n,href:t,style:{transition:w.duration+"s"},className:N.iconButton,"aria-label":s,...b,title:void 0,onClick:D,ref:L,children:[r!==null&&c.jsx($e,{targetRef:L,trigger:n?null:void 0,text:r}),c.jsx("div",{className:N.touchTarget}),c.jsx(me,{style:{transition:w.duration+"s"},className:N.stateLayer,colorName:x(e==="standard"&&{"on-surface-variant":!g,"on-primary":g},e==="filled"&&{"on-surface-variant":!g&&!!d,"on-primary":g||!d},e==="tonal"&&{"on-secondary":g&&!!d,"on-secondary-container":!g||!d},e==="outlined"&&{"inverse-on-surface":g&&!!d,"on-surface-variant":!g||!d}),stateClassName:"state-ripple-group-[icon-button]"}),l?c.jsx(ce,{icon:l,className:N.icon}):I]})},ps=({className:e,label:t,variant:n="primary",size:r="medium",href:s,icon:d,extended:u=!1,ref:a,transition:l,children:i,open:f,defaultOpen:y=!1,onOpenChange:h,...p})=>{l={duration:.3,ease:"easeInOut",...l};const m=o.useRef(null),S=a||m,w=typeof f=="boolean",[I,b]=o.useState(y),g=w?f:I,H=M=>{w||b(M),h==null||h(M)},D=o.Children.toArray(i).filter(M=>o.isValidElement(M)&&M.type===ye),v=Nt({href:s,icon:d,extended:u,label:t,size:r,variant:n,className:e,transition:l,children:t,open:g}),N=X.motion.create(Se),F=X.motion.create(ve),L=M=>c.jsx(N,{icon:d,extended:u,label:t,variant:n+"Container",size:r,className:v.fab+" "+(e??""),"aria-expanded":g,onClick:()=>H(!0),style:{transition:"border-radius 0.3s ease-in-out"},transition:{duration:l.duration,ease:"easeInOut",borderRadius:{duration:l.duration,ease:"easeInOut"},background:{duration:l.duration,ease:"easeInOut"},...l},...M}),W=o.useId();return c.jsxs("div",{className:v.fabMenu,ref:S,...p,children:[c.jsx(X.AnimatePresence,{children:g&&c.jsx("div",{className:v.actions,role:"menu","aria-hidden":!g,children:(()=>{const M=D.length;return D.map((z,O)=>{z.props;const Z=M-1-O,B=((l==null?void 0:l.delay)??0)+Z*.06,C={open:{overflow:"visible",opacity:1,width:"auto",transition:{...l,delay:B,opacity:{delay:(l==null?void 0:l.duration)/2+B}}},close:{overflow:"hidden",opacity:0,width:0,transition:{...l,delay:B,opacity:{duration:(l==null?void 0:l.duration)/1.5}}}};return c.jsx(X.motion.div,{initial:"close",animate:"open",variants:C,transition:l,exit:"close",children:o.cloneElement(z,{key:O,shape:"rounded",variant:"filled",className:()=>({button:x("max-w-full overflow-hidden text-nowrap",{"px-0":!g,"bg-primary-container text-on-primary-container ":n==="primary","bg-secondary-container text-on-secondary-container":n==="secondary","bg-tertiary-container text-on-tertiary-container":n==="tertiary"}),stateLayer:x({"state-on-primary-container":n==="primary","state-on-secondary-container":n==="secondary","state-on-tertiary-container":n==="tertiary"})})})})})})()})}),L({className:"invisible pointer-events-none"}),c.jsxs("div",{className:"absolute right-0 top-0",children:[!g&&L({className:"",layout:!0,layoutId:"fab-menu"+W}),g&&c.jsx(c.Fragment,{children:c.jsx(F,{layout:!0,layoutId:"fab-menu"+W,variant:"filled",className:()=>({iconButton:x({"bg-primary text-on-primary":n==="primary","bg-secondary text-on-secondary":n==="secondary","bg-tertiary text-on-tertiary":n==="tertiary"}),stateLayer:x({"[--default-color:var(--color-on-primary)]":n==="primary","[--default-color:var(--color-on-secondary)]":n==="secondary","[--default-color:var(--color-on-tertiary)]":n==="tertiary"})}),style:{transition:"border-radius 0.3s ease-in-out"},transition:{duration:l.duration,ease:"easeInOut",borderRadius:{duration:l.duration,ease:"easeInOut"},background:{duration:l.duration,ease:"easeInOut"},...l},icon:os,onClick:()=>H(!1),children:"Close"})})]})]})},ys=({className:e,valueFormatter:t,step:n=10,name:r,value:s=0,min:d=0,max:u=100,marks:a=[{value:0,label:"0"},{value:100,label:"100"}],ref:l,onChange:i,...f})=>{const y=R=>{const V=p(),K=h();return R===1/0?100:R===-1/0?0:(R-V)/(K-V)*100},h=(R=!1)=>R?u:u==1/0?a[(a==null?void 0:a.length)-1].value:u,p=(R=!1)=>R?d:d==-1/0?a[0].value:d,m=R=>{const V=p(!1);return(h(!1)-V)*R/100+V},[S,w]=o.useState(!1),I=o.useRef(null),b=l||I,[g,H]=o.useState(s),[D,v]=o.useState(y(s)),[N,F]=o.useState(!1);o.useEffect(()=>{H(s),v(y(s))},[s]);const L=R=>{F(!0),w(!0),z(R)},W=()=>{F(!1),w(!1)};o.useEffect(()=>(N?(window.addEventListener("mouseup",W),window.addEventListener("mousemove",z),window.addEventListener("touchend",W),window.addEventListener("touchmove",z)):(window.removeEventListener("mouseup",W),window.removeEventListener("mousemove",z),window.removeEventListener("touchend",W),window.removeEventListener("touchmove",z)),()=>{window.removeEventListener("mouseup",W),window.removeEventListener("mousemove",z),window.removeEventListener("touchend",W),window.removeEventListener("touchmove",z)}),[N]);const M=Mt({className:e,isChanging:S,marks:a,max:u,min:d,name:r,step:n,value:g,valueFormatter:t,onChange:i}),z=R=>{const V=b==null?void 0:b.current;if(V){const K=V.getBoundingClientRect().left,ee=((R.type==="touchmove"||R.type==="touchstart"?R.touches[0].clientX:R.clientX)-K)/V.offsetWidth*100;O({percent:ee})}},O=({percent:R,value:V})=>{if(R){if(R>=100){H(h(!0)),v(100);return}if(R<=0){H(p(!0)),v(0);return}V=m(R),V==p()&&(V=p(!0)),V==h()&&(V=h(!0))}else if(V!=null){if(V>=h()){H(h(!0)),v(100);return}if(V<=p()){H(p(!0)),v(0);return}R=y(V)}else return;n!=null?V=Math.round((V-p())/n)*n+p():a&&(V=a.reduce((K,G,ee)=>{let k=G.value===1/0?h():G.value===-1/0?p():G.value,j=K.value===1/0?h():K.value===-1/0?p():K.value;return k=Math.abs(k-V),j=Math.abs(j-V),k<j?G:K}).value),V>=h()&&(V=h(!0)),V<=p()&&(V=p(!0)),R=y(V),H(V),v(R),i&&i(V)},[Z,B]=o.useState(0);o.useEffect(()=>{const R=()=>{b.current&&B(b.current.offsetWidth)};return R(),window.addEventListener("resize",R),()=>{window.removeEventListener("resize",R)}},[]);const C=R=>{switch(R.key){case"ArrowRight":if(n)O({value:g+n});else if(a){const V=a.find(K=>K.value>g);V&&O({value:V.value})}break;case"ArrowLeft":if(n)O({value:g-n});else if(a){const V=a.slice(0).reverse().find((K,G,ee)=>g===1/0?G===1:K.value<g);V&&O({value:V.value})}break;default:return}};return c.jsxs("div",{tabIndex:0,onKeyDown:C,role:"slider","aria-valuemin":p(!0),"aria-valuemax":h(!0),"aria-valuenow":g,"aria-valuetext":g.toString(),className:M.slider,onMouseDown:L,onClick:z,ref:b,onTouchStart:L,onDragStart:R=>R.preventDefault(),...f,children:[c.jsx("input",{type:"hidden",name:r,value:g}),c.jsx("div",{className:M.activeTrack,style:{flex:D/100}}),c.jsx("div",{className:M.handle,children:c.jsx(X.AnimatePresence,{children:S&&c.jsx(X.motion.div,{className:M.valueIndicator,initial:"hidden",animate:"visible",exit:"hidden",style:{translate:"-50%",transformOrigin:"center bottom",textWrap:"nowrap"},variants:{visible:{opacity:1,scale:1},hidden:{opacity:1,scale:0}},transition:{duration:.1},children:t?t(g):g})})}),c.jsx("div",{className:M.inactiveTrack,style:{flex:1-D/100}}),c.jsx("div",{className:"w-[calc(100%-12px)] h-full absolute -translate-x-1/2 transform left-1/2",children:a&&a.map((R,V)=>{let K=null;const G=(S?9:10)/Z*100,ee=y(R.value);return ee<=D-G?K=!0:ee>=D+G&&(K=!1),c.jsx("div",{className:x(M.dot,{"bg-primary-container":K!=null&&K,"bg-primary":K!=null&&!K}),style:{left:`${y(R.value)}%`}},V)})})]})},xs=({variant:e="standard",className:t,children:n,title:r,position:s="right",extended:d,divider:u,onExtendedChange:a,closeIcon:l=we,transition:i,...f})=>{i={duration:.3,...i};const[y,h]=o.useState(d??!0),p=It({transition:i,title:r,position:s,closeIcon:l,className:t,children:n,onExtendedChange:a,divider:u,isExtended:y,extended:y,variant:e});o.useEffect(()=>{a==null||a(y??!1)},[y]),o.useEffect(()=>{d!=null&&h(d)},[d]);const m={close:{width:0},open:{width:"auto"}},S=()=>c.jsxs(c.Fragment,{children:[c.jsx(X.AnimatePresence,{children:e=="modal"&&y&&c.jsx(X.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:i,onClick:()=>h(!1),className:p.overlay})}),c.jsx(X.AnimatePresence,{children:y&&c.jsxs("div",{...f,className:p.sideSheet,style:{transition:i.duration+"s"},children:[c.jsxs(X.motion.div,{variants:m,initial:d===!1?"open":"close",animate:"open",exit:"close",className:p.container,children:[c.jsxs("div",{className:p.header,children:[r&&c.jsx("p",{className:p.title,children:r}),c.jsx(ve,{size:"small",label:"close",icon:l,onClick:()=>h(!1),className:p.closeButton})]}),c.jsx("div",{className:p.content,style:{transition:i.duration+"s"},children:n})]}),(u==null&&e=="standard"?!0:u)&&c.jsx(Ae,{className:p.divider,orientation:"vertical"})]})})]});return e=="modal"?Ue.createPortal(S(),document.body):S()},vs=({message:e,className:t,duration:n,closeIcon:r=we,onClose:s,...d})=>{const[u,a]=o.useState(!0),l=Rt({className:t,closeIcon:r,duration:n,isVisible:u,onClose:s,message:e});o.useEffect(()=>{n&&setTimeout(()=>{i()},n)},[n]);const i=()=>{a(!1),s==null||s()};return c.jsx(X.AnimatePresence,{children:u&&c.jsx(X.motion.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.1},className:l.snackbar,...d,children:c.jsxs("div",{className:l.container,children:[c.jsx("p",{className:l.supportingText,children:e}),c.jsx(ve,{onClick:()=>i(),className:l.icon,icon:r,label:"close the snackbar"})]})})})},gs=({selected:e=!1,className:t,activeIcon:n,disabled:r=!1,inactiveIcon:s,onChange:d,onClick:u,onKeyDown:a,ref:l,...i})=>{const[f,y]=o.useState(e);o.useEffect(()=>{y(e)},[e]);const h=b=>{r||(m(),u&&u(b))},p=b=>{r||((b.key===" "||b.key==="Enter")&&(b.preventDefault(),m()),a&&a(b))},m=()=>{y(!f),d==null||d(!f)},S=Ft({className:t,isSelected:f,activeIcon:n,inactiveIcon:s,disabled:r,selected:f,onChange:d}),w=o.useRef(null),I=l||w;return c.jsxs(X.motion.div,{role:"switch","aria-checked":f,tabIndex:r?-1:0,onKeyDown:p,onClick:h,ref:I,className:S.switch,...i,children:[c.jsx("input",{type:"hidden",value:f?"1":"0"}),c.jsxs(X.motion.div,{layout:!0,style:{translate:f?"50%":"-50%"},transition:{type:"spring",stiffness:700,damping:30},className:S.handleContainer,children:[c.jsx("div",{className:S.handle,children:(f?n:s)&&c.jsx(ce,{className:S.icon,icon:f?n:s})}),c.jsx("div",{className:S.handleStateLayer})]})]})},Jt=({className:e,onClick:t,label:n,variant:r="primary",href:s,icon:d,selectedTab:u,setSelectedTab:a,tabsId:l,index:i,onTabSelected:f,scrollable:y=!1,selected:h=!1,children:p,ref:m,...S})=>{const w=o.useRef(null),I=m||w,b=n??(typeof p=="string"?p:void 0),[g,H]=o.useState(h);o.useEffect(()=>{h&&u==null?H(!0):H(u==i&&i!=null)},[u]),o.useEffect(()=>{u==i&&f&&f({ref:I,index:i||0,label:b,icon:d})},[u]);const D=s?"a":"button",v=F=>{a&&a(i??null),t&&t(F)},N=$t({className:e,onTabSelected:f,scrollable:y,selectedTab:u,index:i,tabsId:l,selected:g,variant:r,icon:d,label:b,isSelected:g,setSelectedTab:a,href:s});return c.jsxs(D,{...S,role:"tab","aria-selected":g,ref:I,href:s,className:N.tab,onClick:v,...S,children:[c.jsx(me,{style:{transition:.3+"s"},className:N.stateLayer,colorName:r==="primary"&&g?"primary":"on-surface",stateClassName:"state-ripple-group-[tab]"}),c.jsxs("span",{className:N.content,children:[d&&c.jsx(ce,{icon:d,className:N.icon}),c.jsx("span",{className:N.label,children:b}),g&&c.jsx(X.motion.span,{layoutId:`underline-${l}`,className:N.underline,transition:{duration:.3}})]})]})},We=o.createContext(null),ws=({variant:e="primary",onTabSelected:t,children:n,className:r,selectedTab:s,setSelectedTab:d,scrollable:u=!1})=>{const a=o.useContext(We),[l,i]=o.useState(null);let f;s===0||s!=null?f=s:a?f=a.selectedTab:f=l;const y=d??(a==null?void 0:a.setSelectedTab)??i,h=o.Children.toArray(n).filter(I=>o.isValidElement(I)&&I.type===Jt),p=o.useRef(null),m=I=>{if(t==null||t(I),u){const b=p.current,g=I.ref.current;if(b&&g){const H=g.offsetLeft+g.offsetWidth/2-b.offsetWidth/2;b.scrollTo({left:H,behavior:"smooth"})}}},S=o.useMemo(()=>(a==null?void 0:a.tabsId)??Kt(),[a==null?void 0:a.tabsId]),w=Pt({children:n,onTabSelected:t,scrollable:u,selectedTab:f,setSelectedTab:y,className:r,variant:e});return c.jsx("div",{ref:p,role:"tablist",className:w.tabs,children:h.map((I,b)=>o.cloneElement(I,{key:b,index:b,variant:e,selectedTab:f,setSelectedTab:y,tabsId:S,onTabSelected:m,scrollable:u}))})},bs=({children:e,selectedTab:t,setSelectedTab:n,defaultTab:r=0})=>{const[s,d]=o.useState(r),u=o.useRef(null),a=t!==void 0?t:s,l=n??d,i=u.current!==null&&a!==null?a>u.current?1:-1:0;a!==u.current&&(u.current=a);const f=o.useId(),y=o.useMemo(()=>({selectedTab:a,setSelectedTab:l,previousTab:u.current,direction:i,tabsId:f}),[a,l,i,f]);return c.jsx(We.Provider,{value:y,children:e})},Zt=({children:e,className:t,isSelected:n=!1})=>{const r=Ot({children:e,className:t,isSelected:n});return c.jsx("div",{className:r.tabPanel,children:e})},Ss=({children:e,className:t})=>{const n=o.useContext(We);if(!n)return console.warn("TabPanels must be used within a TabGroup"),null;const{selectedTab:r,direction:s,tabsId:d}=n,u=o.Children.toArray(e).filter(l=>o.isValidElement(l)&&l.type===Zt),a=Tt({children:e,className:t});return c.jsx("div",{className:a.tabPanels,children:c.jsx(X.AnimatePresence,{initial:!1,custom:s,mode:"popLayout",children:u.map((l,i)=>r===i&&c.jsx(X.motion.div,{custom:s,variants:{enter:f=>({x:f*100+"%",opacity:1}),center:{x:0,opacity:1},exit:f=>({x:f*-100+"%",opacity:1})},initial:"enter",animate:"center",exit:"exit",transition:{type:"spring",stiffness:400,damping:40},role:"tabpanel","aria-labelledby":`tab-${d}-${i}`,children:o.cloneElement(l,{isSelected:!0})},i))})})},Ns=({hasSelected:e})=>({datePicker:x("inline-flex flex-col bg-surface-container-high rounded-[28px] p-3 select-none","min-w-[320px]"),header:x("flex items-center justify-between h-12 mb-2 px-2"),monthNav:x("flex items-center justify-center w-10 h-10 rounded-full text-on-surface-variant hover:bg-on-surface-variant/8 transition-colors cursor-pointer"),monthLabel:x("text-label-large text-on-surface font-bold capitalize"),weekDays:x("grid grid-cols-7 mb-2"),weekDay:x("h-10 flex items-center justify-center text-body-small text-on-surface-variant"),daysGrid:x("grid grid-cols-7 row-auto gap-y-2"),dayCell:x("flex items-center justify-center h-10 p-0 relative"),dayButton:x("w-10 h-10 rounded-full flex items-center justify-center text-body-large transition-all duration-200 relative overflow-hidden z-10 outline-none")}),Es=Q("datePicker",Ns),Qt=({value:e,defaultValue:t,onChange:n,minDate:r,maxDate:s,shouldDisableDate:d,locale:u="default",weekStartDay:a=0,className:l,style:i,mode:f="single",...y})=>{const[h,p]=o.useState(()=>{const k=E=>E instanceof Date?E:Array.isArray(E)&&E[0]?E[0]:null,j=k(e)||k(t)||new Date;return new Date(j.getFullYear(),j.getMonth(),1)}),[m,S]=o.useState(0),[w,I]=o.useState("day"),b=e!==void 0,[g,H]=o.useState(t||null),D=b?e||null:g,v=(k,j)=>new Date(k,j+1,0).getDate(),N=o.useMemo(()=>{const k=h.getFullYear(),j=h.getMonth(),E=v(k,j),T=(new Date(k,j,1).getDay()-a+7)%7,Y=[],_=v(k,j-1);for(let q=T-1;q>=0;q--)Y.push({date:new Date(k,j-1,_-q),isCurrentMonth:!1});for(let q=1;q<=E;q++)Y.push({date:new Date(k,j,q),isCurrentMonth:!0});const A=42-Y.length;for(let q=1;q<=A;q++)Y.push({date:new Date(k,j+1,q),isCurrentMonth:!1});return Y},[h,a]),F=o.useMemo(()=>{const k=new Date().getFullYear(),j=k-100,E=k+100,$=[];for(let T=j;T<=E;T++)$.push(T);return $},[]),L=o.useRef(null);o.useEffect(()=>{if(w==="year"&&L.current){const k=L.current.querySelector('[data-selected="true"]');k&&k.scrollIntoView({block:"center"})}},[w]);const W=o.useMemo(()=>new Intl.DateTimeFormat(u,{month:"long",year:"numeric"}),[u]),M=o.useMemo(()=>new Intl.DateTimeFormat(u,{weekday:"narrow"}),[u]),z=o.useMemo(()=>{const k=new Date(2023,0,1+a);return Array.from({length:7}).map((j,E)=>{const $=new Date(k);return $.setDate(k.getDate()+E),M.format($).charAt(0).toUpperCase()})},[M,a]),O=()=>{S(-1),p(k=>new Date(k.getFullYear(),k.getMonth()-1,1))},Z=()=>{S(1),p(k=>new Date(k.getFullYear(),k.getMonth()+1,1))},B=k=>{p(j=>new Date(k,j.getMonth(),1)),I("day")},C=(k,j)=>k?k.getDate()===j.getDate()&&k.getMonth()===j.getMonth()&&k.getFullYear()===j.getFullYear():!1,R=k=>C(new Date,k),V=k=>{let j=k;if(f==="single")j=k;else{const E=D,[$,T]=Array.isArray(E)?E:[null,null];!$||$&&T?j=[k,null]:k<$?j=[k,$]:j=[$,k]}b||H(j),n&&n(j)},K=k=>{if(f==="single")return{isSelected:C(D,k),isStart:!1,isEnd:!1,isInRange:!1};const j=Array.isArray(D)?D:[D,null],[E,$]=j,T=C(E,k),Y=C($,k);let _=!1;if(E&&$){const J=new Date(E.getFullYear(),E.getMonth(),E.getDate()).getTime(),A=new Date($.getFullYear(),$.getMonth(),$.getDate()).getTime(),q=new Date(k.getFullYear(),k.getMonth(),k.getDate()).getTime();_=q>J&&q<A}return{isSelected:T||Y,isStart:T,isEnd:Y,isInRange:_}},G=Es({hasSelected:!!D}),ee={enter:k=>({x:k>0?"100%":"-100%",opacity:0}),center:{x:0,opacity:1},exit:k=>({x:k<0?"100%":"-100%",opacity:0})};return c.jsxs("div",{className:x(G.datePicker,l),style:i,...y,children:[c.jsxs("div",{className:G.header,children:[c.jsxs(ye,{variant:"text",disableTextMargins:!0,size:"small",onClick:()=>I(k=>k==="day"?"year":"day"),className:"text-label-large font-bold capitalize text-on-surface hover:bg-surface-container-highest",children:[c.jsx("span",{className:"mr-2",children:w==="day"?W.format(h):h.getFullYear()}),c.jsx(ce,{icon:is,className:x("w-3 h-3 transition-transform duration-200 inline",w==="year"&&"rotate-180")})]}),w==="day"&&c.jsxs("div",{className:"flex items-center",children:[c.jsx(ve,{size:"xSmall",allowShapeTransformation:!1,onClick:O,icon:ls,label:"Previous month",title:null}),c.jsx(ve,{size:"xSmall",allowShapeTransformation:!1,onClick:Z,icon:ss,label:"Next month",title:null})]})]}),w==="year"?c.jsx("div",{className:"h-[280px] overflow-y-auto grid grid-cols-3 gap-2 p-2 scrollbar-hide",ref:L,children:F.map(k=>c.jsx(ye,{size:"small",variant:k===h.getFullYear()?"filled":"text",onClick:()=>B(k),"data-selected":k===h.getFullYear(),className:x("w-full",{"text-on-surface":k!==h.getFullYear()}),label:k.toString(),children:k},k))}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:G.weekDays,children:z.map((k,j)=>c.jsx("div",{className:G.weekDay,children:k},j))}),c.jsx("div",{className:"overflow-hidden relative min-h-[240px]",children:c.jsx(X.AnimatePresence,{mode:"popLayout",initial:!1,custom:m,children:c.jsx(X.motion.div,{custom:m,variants:ee,initial:"enter",animate:"center",exit:"exit",transition:{type:"spring",bounce:0,duration:.3},className:G.daysGrid,children:N.map((k,j)=>{if(!k.isCurrentMonth)return c.jsx("div",{className:G.dayCell},j);const{isSelected:E,isStart:$,isEnd:T,isInRange:Y}=K(k.date),_=R(k.date),J=r&&k.date<r||s&&k.date>s||(d==null?void 0:d(k.date));return c.jsx("div",{className:x(G.dayCell,Y&&"bg-primary/20",$&&(D==null?void 0:D[1])&&"bg-gradient-to-r from-transparent to-primary/20",T&&(D==null?void 0:D[0])&&"bg-gradient-to-l from-transparent to-primary/20"),children:c.jsx(ye,{className:()=>({button:x("aspect-square h-[40px] p-0",{"text-on-surface":!E&&!_,"opacity-50":J}),stateLayer:x({"!bg-transparent":J})}),size:"small",allowShapeTransformation:!1,variant:x({filled:E,outlined:_,text:!E&&!_}),label:k.date.getDate().toString(),onClick:()=>V(k.date),disabled:J,children:k.date.getDate().toString()})},j)})},h.toISOString())})})]})]})},ks=({variant:e="filled",disabled:t=!1,errorText:n,placeholder:r,suffix:s,name:d,label:u,className:a,supportingText:l,trailingIcon:i,leadingIcon:f,type:y="text",multiline:h=!1,autoComplete:p="on",onChange:m,value:S,defaultValue:w,showSupportingText:I,id:b,style:g,ref:H,...D})=>{const v=o.useId(),N=b||v,F=`${N}-helper`,L=S!==void 0,[W,M]=o.useState(w??""),z=L?S:W,[O,Z]=o.useState(!1),[B,C]=o.useState(!!(n!=null&&n.length)),R=o.useRef(null),V=H||R,K=o.useRef(null),G=o.useRef(null),ee=I??(!!(n!=null&&n.length)||!!(l!=null&&l.length));o.useEffect(()=>{C(!!(n!=null&&n.length))},[n]);const k=()=>{V.current&&!O&&V.current.focus()},j=ae=>{var de;Z(!0),C(!1),(de=D.onFocus)==null||de.call(D,ae)},E=ae=>{const de=ae.target.value;L||M(de),C(!1),m&&m(ae)},$=ae=>{var de;Z(!1),n!=null&&n.length&&C(!0),(de=D.onBlur)==null||de.call(D,ae)},T=y==="date",[Y,_]=o.useState(!1),[J,A]=o.useState(null),q=o.useMemo(()=>{const ae=String(z);if(!ae)return null;const[de,Pe,Be]=ae.split("-").map(Number);return de&&Pe&&Be?new Date(de,Pe-1,Be):null},[z]),ne=()=>{t||(A(q),_(!0))},le=()=>{const ae=J?J.toLocaleDateString("en-CA"):"";L||M(ae),m&&m({target:{value:ae,name:d,type:y}}),_(!1)},ue=T&&!i?ns:i,he=T?"[&::-webkit-calendar-picker-indicator]:hidden cursor-pointer":"",oe=zt({showSupportingText:ee,isFocused:O,showErrorIcon:B,disabled:t,name:d,label:u,autoComplete:p,className:a,onChange:m,placeholder:r,supportingText:l,type:y,leadingIcon:f,trailingIcon:ue,variant:e,errorText:n,value:String(z),suffix:s,multiline:h}),U=h?on:"input",re=h?{}:{type:y},se=O||typeof z=="string"&&z.length>0||y=="date",fe=se&&e==="outlined",ge=!fe;return c.jsxs("div",{ref:K,className:oe.textField,style:g,children:[c.jsxs("fieldset",{onClick:k,className:oe.content,role:"presentation",children:[c.jsx("div",{className:oe.stateLayer}),f&&c.jsx("div",{className:oe.leadingIcon,children:o.isValidElement(f)?f:c.jsx(ce,{className:"w-5 h-5",icon:f})}),c.jsx(X.motion.legend,{"aria-hidden":"true",variants:{hidden:{width:0,padding:0},visible:{width:"auto",padding:"0 8px"}},initial:fe?"visible":"hidden",animate:fe?"visible":"hidden",className:"max-w-full ml-2 px-2 text-body-small h-0 overflow-hidden whitespace-nowrap",transition:{duration:.2},children:c.jsx("span",{className:"transform inline-flex -translate-y-1/2 opacity-0",children:u})}),c.jsxs("div",{className:"flex-1 relative",children:[ge&&c.jsx(X.motion.label,{htmlFor:N,className:x("absolute left-4 transition-all duration-300 pointer-events-none",{"text-body-small top-2":e=="filled"&&se,"text-body-large top-1/2 transform -translate-y-1/2":!(e=="filled"&&se)}),transition:{duration:.3},layoutId:e==="outlined"?`${N}-label`:void 0,children:c.jsx("span",{className:oe.label,children:u})}),fe&&c.jsx(X.motion.label,{htmlFor:N,className:x("absolute left-2 -top-3 px-1 text-body-small z-10",oe.label),layoutId:`${N}-label`,transition:{duration:.3},children:u}),c.jsx(U,{...D,ref:V,value:z,onChange:E,className:x(oe.input,he),id:N,name:d,placeholder:O?r??void 0:"",onFocus:j,onBlur:$,disabled:t,autoComplete:p,"aria-invalid":!!(n!=null&&n.length),"aria-describedby":ee?F:void 0,...re})]}),c.jsx("div",{className:oe.activeIndicator}),!B&&c.jsxs(c.Fragment,{children:[ue&&c.jsx("div",{ref:T?G:void 0,onClick:ae=>{ae.stopPropagation(),T&&ne()},className:x(oe.trailingIcon,T&&"cursor-pointer"),children:c.jsx("div",{className:"flex items-center justify-center w-full h-full",children:o.isValidElement(ue)?ue:c.jsx(ce,{className:"h-5",icon:ue})})}),!ue&&s&&c.jsx("span",{className:oe.suffix,children:s})]}),B&&c.jsx("div",{className:x(oe.trailingIcon,{" absolute right-0":!ue}),children:c.jsx(ce,{className:"h-5 text-error",icon:rs})})]}),ee&&c.jsx("p",{className:oe.supportingText,id:F,children:n!=null&&n.length?n:l!=null&&l.length?l:" "}),T&&Y&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 z-40 bg-transparent",onClick:()=>_(!1)}),c.jsx(Ce,{anchorRef:K,position:"bottom",children:c.jsxs("div",{className:"z-50 shadow-xl rounded-[28px] bg-surface-container-high overflow-hidden",children:[c.jsx(Qt,{className:"",value:J,onChange:A}),c.jsxs("div",{className:"flex justify-end gap-2 p-4 pt-0",children:[c.jsx(ye,{variant:"text",size:"small",onClick:()=>_(!1),children:"Cancel"}),c.jsx(ye,{variant:"filled",size:"small",onClick:le,children:"OK"})]})]})})]})]})},js=({isSelected:e,icon:t,label:n,variant:r})=>({navigationRailItem:x(" group/navigation-rail-item flex flex-col pt-1 pb-1.5 cursor-pointer",{"text-on-surface-variant":!e,"text-on-secondary-container":e,"gap-2 h-[68px]":r=="vertical","gap-0 h-[66px]":r=="horizontal"}),container:x(" 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:x("rounded-full"),icon:x("size-6 flex"),label:x("w-fit mx-auto text-nowrap",{"text-label-large ":r=="horizontal","text-label-medium":r=="vertical"})}),Ls=Q("navigationRailItem",js),en=({label:e})=>c.jsx("div",{className:" h-9 flex items-center mx-9 mt-3",children:c.jsx("p",{className:"text-label-large text-on-surface-variant",children:e})}),tn=({className:e,onClick:t,label:n,variant:r="vertical",href:s,icon:d,selectedItem:u,setSelectedItem:a,index:l,onItemSelected:i,selected:f=!1,ref:y,transition:h,isExtended:p,iconSelected:m,style:S,extendedOnly:w,children:I,...b})=>{I&&(n=I);const g=o.useRef(null),H=y||g,[D,v]=o.useState(f);o.useEffect(()=>{f&&u==null?v(!0):v(u==l&&l!=null)},[u]),o.useEffect(()=>{u==l&&i&&i({ref:H,index:l||0,label:n,icon:d})},[u]);const N=s?"a":"button",F=W=>{a&&a(l??null),t&&t(W)},L=Ls({isExtended:p,extendedOnly:w,className:e,onItemSelected:i,selectedItem:u,index:l,transition:h,selected:D,variant:r,icon:d,label:n,isSelected:D,setSelectedItem:a,href:s,children:n,iconSelected:m});return h={duration:.3,...h},w&&!p?null:c.jsxs(N,{...b,role:"tab","aria-selected":D,ref:H,href:s,className:L.navigationRailItem,onClick:F,style:{transition:h.duration+"s",...S},children:[c.jsxs(X.motion.div,{style:{transition:r=="horizontal"?h.duration+`s, gap ${h.duration/2}s ${h.duration-h.duration/2}s`:h.duration+`s, gap ${h.duration/3}s ${h.duration-h.duration/3}s`},transition:h,className:L.container,children:[c.jsx(me,{style:{transition:h.duration+"s"},className:L.stateLayer,colorName:x({"on-surface":!D,"on-secondary-container":D}),stateClassName:"state-ripple-group-[navigation-rail-item]"}),d&&c.jsx(ce,{icon:D?m:d,className:L.icon}),c.jsx(X.AnimatePresence,{children:r=="horizontal"&&(()=>{const W={width:0,opacity:0,transition:{...h}},M={width:"auto",opacity:1,transition:{...h,opacity:{duration:h.duration/2,delay:h.duration-h.duration/2}}};return c.jsx(X.motion.span,{initial:W,animate:M,exit:W,className:L.label,children:n})})()})]}),c.jsx(X.AnimatePresence,{children:r=="vertical"&&(()=>{const W={height:0,opacity:0,transition:{...h,opacity:{duration:0}}},M={height:"auto",opacity:1,transition:{...h,opacity:{duration:h.duration/3,delay:h.duration-h.duration/3}}};return c.jsx(X.motion.span,{initial:M,animate:M,exit:W,className:L.label,transition:h,children:n})})()})]})},Is=({isExtended:e,alignment:t})=>({navigationRail:x("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:x("flex flex-col gap-1 items-start"),menuIcon:"mx-5",segments:x(" flex flex-col overflow-auto min-w-full mt-10",{"w-full":!e,"w-fit items-start":e})}),Ms=Q("navigationRail",Is),Cs=({variant:e="standard",onItemSelected:t,children:n,className:r,selectedItem:s,extended:d,alignment:u="top",menu:a={closed:{icon:as,label:"Open menu"},opened:{icon:we,label:"Close menu"}},style:l,onExtendedChange:i,transition:f,setSelectedItem:y})=>{const[h,p]=o.useState(null),[m,S]=o.useState(d);let w;s==0||s!=null?w=s:w=h;const I=y||p,b=o.useRef(null),g=L=>{t==null||t(L)};function H(L){const W=[];return o.Children.forEach(L,M=>{o.isValidElement(M)&&M.type===o.Fragment?W.push(...H(M.props.children)):W.push(M)}),W}const D=H(n),v=D.filter(L=>o.isValidElement(L)&&L.type===Se),N=Ms({children:n,onItemSelected:t,selectedItem:w,setSelectedItem:I,className:r,variant:e,extended:m,isExtended:m,alignment:u,menu:a,transition:f,onExtendedChange:i});f={duration:.3,...f};const F=o.useRef(!1);return F.current=!1,o.useEffect(()=>{i==null||i(m??!1)},[m]),c.jsxs("div",{style:{transition:f.duration+"s",...l},ref:b,className:N.navigationRail,children:[c.jsxs("div",{className:N.header,children:[c.jsx(ve,{onClick:()=>S(!m),label:m?a==null?void 0:a.opened.label:a==null?void 0:a.closed.label,className:N.menuIcon,icon:m?a.opened.icon:a==null?void 0:a.closed.icon}),v.length>0&&o.cloneElement(v[0],{transition:f,isExtended:m,className:"!shadow-none mx-5 "+v[0].props.className})]}),c.jsx("div",{className:N.segments,children:(()=>{let L=0;return D.map(W=>o.isValidElement(W)&&W.type===tn?o.cloneElement(W,{key:L,index:L++,variant:m?"horizontal":"vertical",selectedItem:w,setSelectedItem:I,onItemSelected:g,transition:f,extendedOnly:F.current,isExtended:m}):o.isValidElement(W)&&W.type===Se?null:o.isValidElement(W)&&W.type===en?(F.current=!0,m?o.cloneElement(W,{}):null):W)})()}),c.jsx("div",{className:"flex-1 max-h-[160px]"})]})};function Rs(e){return be.defineConfig({variant:be.Variants.Udixio,...e,plugins:[new be.FontPlugin(e),new Ke.TailwindPlugin(e)]})}exports.AnchorPositioner=Ce;exports.AnimateOnScrollInit=In;exports.Button=ye;exports.Card=Qn;exports.Carousel=es;exports.CarouselItem=Xt;exports.Checkbox=cs;exports.Chip=Le;exports.Chips=ms;exports.CustomScroll=et;exports.DatePicker=Qt;exports.Divider=Ae;exports.Fab=Se;exports.FabMenu=ps;exports.Icon=ce;exports.IconButton=ve;exports.NavigationRail=Cs;exports.NavigationRailItem=tn;exports.NavigationRailSection=en;exports.ProgressIndicator=qt;exports.RippleEffect=Ge;exports.SideSheet=xs;exports.Slider=ys;exports.SmoothScroll=gn;exports.Snackbar=vs;exports.State=me;exports.Switch=gs;exports.SyncedFixedWrapper=rt;exports.Tab=Jt;exports.TabGroup=bs;exports.TabPanel=Zt;exports.TabPanels=Ss;exports.Tabs=ws;exports.TextField=ks;exports.ThemeProvider=Sn;exports.Tooltip=$e;exports.animateOnScroll=Mn;exports.buttonStyle=Cn;exports.cardStyle=Rn;exports.carouselItemConfig=Re;exports.carouselItemStyle=Dn;exports.carouselStyle=Fn;exports.checkboxStyle=An;exports.chipStyle=$n;exports.chipsStyle=Wn;exports.classNames=x;exports.classnames=Ze;exports.createUseClassNames=Q;exports.customScrollStyle=Qe;exports.defaultClassNames=te;exports.defineConfig=Rs;exports.dividerStyle=Pn;exports.fabMenuStyle=Tn;exports.fabStyle=Bn;exports.getClassNames=Ne;exports.iconButtonStyle=Hn;exports.initAnimateOnScroll=Me;exports.normalize=xe;exports.progressIndicatorStyle=On;exports.sideSheetConfig=De;exports.sideSheetStyle=It;exports.sliderConfig=Fe;exports.sliderStyle=zn;exports.snackbarStyle=Yn;exports.switchStyle=_n;exports.tabPanelStyle=Kn;exports.tabPanelsStyle=Un;exports.tabStyle=qn;exports.tabsStyle=Xn;exports.textFieldStyle=Gn;exports.toolStyle=Jn;exports.useButtonStyle=it;exports.useCardStyle=at;exports.useCarouselItemStyle=ct;exports.useCarouselStyle=dt;exports.useCheckboxStyle=ht;exports.useChipStyle=pt;exports.useChipsStyle=xt;exports.useClassNames=an;exports.useDividerStyle=gt;exports.useFabMenuStyle=Nt;exports.useFabStyle=bt;exports.useIconButtonStyle=kt;exports.useProgressIndicatorStyle=Lt;exports.useSideSheetStyle=Vn;exports.useSliderStyle=Mt;exports.useSnackbarStyle=Rt;exports.useStateStyle=st;exports.useSwitchStyle=Ft;exports.useTabPanelStyle=Ot;exports.useTabPanelsStyle=Tt;exports.useTabStyle=$t;exports.useTabsStyle=Pt;exports.useTextFieldStyle=zt;exports.useToolTipStyle=_t;exports.useTooltipTrigger=Gt;
|
|
10
|
+
`})]}),D&&c.jsx(Le,{ref:H,className:"opacity-0",draggable:r,editable:!0,editing:!0,onChange:v=>{var N;if(v=v.replace(/( )+/g," ").trim(),console.log("Ghost chip onChange",v,!!v),v)I(v);else if(u.length>0){const F=h.current[u.length-1];(N=F==null?void 0:F.focus)==null||N.call(F)}},onEditCommit:()=>{},onBlur:()=>{i(!1)},onFocus:v=>{i(!0),v.stopPropagation()},children:" "})]})};function Gt({trigger:e=["hover","focus"],isOpen:t,defaultOpen:n=!1,onOpenChange:r,openDelay:s=400,closeDelay:d=150,id:u}={}){const a=o.useId(),l=u??`tooltip-${a}`,i=Array.isArray(e)?e:[e],f=typeof t=="boolean",[y,h]=o.useState(n?"hovered":"hidden"),[p,m]=o.useState(!1),S=o.useRef(null),w=o.useRef(null),I=o.useCallback(()=>{S.current&&(clearTimeout(S.current),S.current=null),w.current&&(clearTimeout(w.current),w.current=null)},[]);o.useEffect(()=>()=>I(),[I]);const b=o.useCallback(C=>{if(f){const R=C!=="hidden";r==null||r(R)}else{h(C);const R=C!=="hidden";r==null||r(R)}},[f,r]),g=f?t?"hovered":"hidden":y,H=g!=="hidden",D=C=>{switch(C){case"hidden":return 0;case"hovered":return 1;case"focused":return 2;case"clicked":return 3;default:return 0}},v=o.useCallback(C=>{I(),!(D(C)<=D(g))&&(S.current=setTimeout(()=>{b(C)},s))},[I,s,g,b]),N=o.useCallback(C=>{I(),w.current=setTimeout(()=>{(!f&&D(y)<=D(C)||f)&&b("hidden")},d)},[I,d,y,f,b]),F=o.useCallback(()=>{i.includes("hover")&&v("hovered")},[i,v]),L=o.useCallback(()=>{i.includes("hover")&&(g==="focused"||g==="clicked"||p||N("hovered"))},[i,g,p,N]),W=o.useCallback(()=>{i.includes("focus")&&(I(),b("focused"))},[i,I,b]),M=o.useCallback(()=>{if(i.includes("focus")&&g!=="clicked"){if(i.includes("hover")&&p){b("hovered");return}N("focused")}},[i,g,p,N,b]),z=o.useCallback(()=>{i.includes("click")&&(I(),b(g==="clicked"?"hidden":"clicked"))},[i,g,I,b]),O=o.useCallback(C=>{C.key==="Escape"&&H&&(I(),b("hidden"),C.preventDefault())},[H,I,b]),Z=o.useCallback(()=>{m(!0),I()},[I]),B=o.useCallback(()=>{m(!1),i.includes("hover")&&g==="hovered"&&N("hovered")},[i,g,N]);return{triggerProps:{"aria-describedby":H?l:void 0,onMouseEnter:F,onMouseLeave:L,onFocus:W,onBlur:M,onClick:z,onKeyDown:O},tooltipProps:{id:l,role:"tooltip","aria-hidden":!H,onMouseEnter:Z,onMouseLeave:B},isOpen:H,state:g}}const We=({variant:e="plain",buttons:t,className:n,children:r,title:s,text:d,content:u,position:a,targetRef:l,ref:i,trigger:f=["hover","focus"],transition:y,openDelay:h=400,closeDelay:p=150,isOpen:m,defaultOpen:S=!1,onOpenChange:w,id:I,anchorRef:b,...g})=>{const D=a||(e==="rich"?"bottom-right":"bottom");if(y={duration:.3,...y},!r&&!l)throw new Error("Tooltip must have a child or a targetRef");t&&!Array.isArray(t)&&(t=[t]);const v=o.useRef(null),F=b||(l||v),{triggerProps:L,tooltipProps:W,isOpen:M}=Gt({trigger:f,isOpen:m,defaultOpen:S,onOpenChange:w,openDelay:h,closeDelay:p,id:I}),z=!l&&o.isValidElement(r)?o.cloneElement(r,{ref:v,...L,onMouseEnter:B=>{var C,R;L.onMouseEnter(),(R=(C=r.props)==null?void 0:C.onMouseEnter)==null||R.call(C,B)},onMouseLeave:B=>{var C,R;L.onMouseLeave(),(R=(C=r.props)==null?void 0:C.onMouseLeave)==null||R.call(C,B)},onFocus:B=>{var C,R;L.onFocus(),(R=(C=r.props)==null?void 0:C.onFocus)==null||R.call(C,B)},onBlur:B=>{var C,R;L.onBlur(),(R=(C=r.props)==null?void 0:C.onBlur)==null||R.call(C,B)},onClick:B=>{var C,R;L.onClick(),(R=(C=r.props)==null?void 0:C.onClick)==null||R.call(C,B)},onKeyDown:B=>{var C,R;L.onKeyDown(B),(R=(C=r.props)==null?void 0:C.onKeyDown)==null||R.call(C,B)}}):r;o.useEffect(()=>{if(!l)return;const B=l.current;if(!B)return;const C=()=>L.onMouseEnter(),R=()=>L.onMouseLeave(),V=()=>L.onFocus(),K=()=>L.onBlur(),G=()=>L.onClick(),ee=k=>L.onKeyDown(k);return B.addEventListener("mouseenter",C),B.addEventListener("mouseleave",R),B.addEventListener("focus",V,!0),B.addEventListener("blur",K,!0),B.addEventListener("click",G),B.addEventListener("keydown",ee),L["aria-describedby"]?B.setAttribute("aria-describedby",L["aria-describedby"]):B.removeAttribute("aria-describedby"),()=>{B.removeEventListener("mouseenter",C),B.removeEventListener("mouseleave",R),B.removeEventListener("focus",V,!0),B.removeEventListener("blur",K,!0),B.removeEventListener("click",G),B.removeEventListener("keydown",ee)}},[l,L]);const O=_t({variant:e,buttons:t,className:n,title:s,text:d,position:D,trigger:f,targetRef:l,children:r}),Z={open:{opacity:1,height:"auto"},close:{opacity:0,height:16}};return c.jsxs(c.Fragment,{children:[z,c.jsx(X.AnimatePresence,{children:M&&c.jsx(Re,{anchorRef:F,position:D,children:c.jsx(X.motion.div,{initial:"close",variants:Z,animate:"open",transition:{duration:y.duration},exit:"close",className:O.toolTip,...g,...W,children:c.jsx("div",{className:O.container,children:u?c.jsx("div",{className:O.content,children:u}):c.jsxs(c.Fragment,{children:[s&&c.jsx("div",{className:O.subHead,children:s}),d&&c.jsx("div",{className:O.supportingText,children:d}),t&&c.jsx("div",{className:O.actions,children:Array.isArray(t)&&t.map((B,C)=>c.jsx(ye,{size:"small",variant:"text",...B},C))})]})})})})})]})},Se=({className:e,label:t,variant:n="primary",size:r="medium",href:s,type:d,icon:u,extended:a=!1,ref:l,transition:i,children:f,...y})=>{if(f&&(t=f),!t)throw new Error("FAB component requires either a label prop or children content");const h=s?"a":"button",p=bt({href:s,icon:u,extended:a,label:t,size:r,variant:n,className:e,transition:i,children:t});i={duration:.3,...i};const m=o.useRef(null),S=l||m,w={visible:{width:"auto",marginLeft:12,opacity:1,transition:{...i,opacity:{duration:i.duration/2,delay:i.duration-i.duration/2}}},hidden:{width:0,marginLeft:0,opacity:0,transition:{...i,marginLeft:{duration:i.duration/2,delay:i.duration-i.duration/2}}}};return c.jsxs(h,{...y,ref:S,href:s,"aria-label":a?void 0:t,className:p.fab,children:[c.jsx(We,{trigger:a?null:void 0,text:t,targetRef:S}),c.jsx(me,{style:{transition:i.duration+"s"},className:p.stateLayer,colorName:x({"on-primary":n=="primary","on-secondary":n=="secondary","on-tertiary":n=="tertiary","on-primary-container":n=="primaryContainer","on-secondary-container":n=="secondaryContainer","on-tertiary-container":n=="tertiaryContainer"}),stateClassName:"state-ripple-group-[fab]"}),c.jsx(ce,{icon:u,className:p.icon}),c.jsx(X.AnimatePresence,{children:a&&c.jsx(X.motion.span,{variants:w,initial:"hidden",animate:"visible",exit:"hidden",className:p.label,children:t})})]})},ve=({variant:e="standard",href:t,disabled:n=!1,title:r,label:s,onToggle:d,activated:u=!1,onClick:a,icon:l,size:i="medium",iconSelected:f,className:y,ref:h,width:p="default",shape:m="rounded",allowShapeTransformation:S=!0,transition:w,children:I,...b})=>{if(I&&(s=I),!s)throw new Error("IconButton component requires either a label prop or children content to provide an accessible aria-label");!r&&r!==null&&(r=s);const[g,H]=o.useState(u),D=W=>{n&&W.preventDefault(),d?(H(!g),d(!g)):a&&a(W)};o.useEffect(()=>{H(u)},[u]);const v=t?"a":"button",N=kt({transition:w,shape:m,allowShapeTransformation:S,width:p,href:t,activated:g,label:s,iconSelected:f,isActive:g,onToggle:d,disabled:n,icon:l,variant:e,className:y,size:i,children:s,...b}),F=o.useRef(null),L=h||F;return w={duration:.3,...w},c.jsxs(v,{disabled:n,href:t,style:{transition:w.duration+"s"},className:N.iconButton,"aria-label":s,...b,title:void 0,onClick:D,ref:L,children:[r!==null&&c.jsx(We,{targetRef:L,trigger:n?null:void 0,text:r}),c.jsx("div",{className:N.touchTarget}),c.jsx(me,{style:{transition:w.duration+"s"},className:N.stateLayer,colorName:x(e==="standard"&&{"on-surface-variant":!g,"on-primary":g},e==="filled"&&{"on-surface-variant":!g&&!!d,"on-primary":g||!d},e==="tonal"&&{"on-secondary":g&&!!d,"on-secondary-container":!g||!d},e==="outlined"&&{"inverse-on-surface":g&&!!d,"on-surface-variant":!g||!d}),stateClassName:"state-ripple-group-[icon-button]"}),l?c.jsx(ce,{icon:l,className:N.icon}):I]})},ps=({className:e,label:t,variant:n="primary",size:r="medium",href:s,icon:d,extended:u=!1,ref:a,transition:l,children:i,open:f,defaultOpen:y=!1,onOpenChange:h,...p})=>{l={duration:.3,ease:"easeInOut",...l};const m=o.useRef(null),S=a||m,w=typeof f=="boolean",[I,b]=o.useState(y),g=w?f:I,H=M=>{w||b(M),h==null||h(M)},D=o.Children.toArray(i).filter(M=>o.isValidElement(M)&&M.type===ye),v=Nt({href:s,icon:d,extended:u,label:t,size:r,variant:n,className:e,transition:l,children:t,open:g}),N=X.motion.create(Se),F=X.motion.create(ve),L=M=>c.jsx(N,{icon:d,extended:u,label:t,variant:n+"Container",size:r,className:v.fab+" "+(e??""),"aria-expanded":g,onClick:()=>H(!0),style:{transition:"border-radius 0.3s ease-in-out"},transition:{duration:l.duration,ease:"easeInOut",borderRadius:{duration:l.duration,ease:"easeInOut"},background:{duration:l.duration,ease:"easeInOut"},...l},...M}),W=o.useId();return c.jsxs("div",{className:v.fabMenu,ref:S,...p,children:[c.jsx(X.AnimatePresence,{children:g&&c.jsx("div",{className:v.actions,role:"menu","aria-hidden":!g,children:(()=>{const M=D.length;return D.map((z,O)=>{z.props;const Z=M-1-O,B=((l==null?void 0:l.delay)??0)+Z*.06,C={open:{overflow:"visible",opacity:1,width:"auto",transition:{...l,delay:B,opacity:{delay:(l==null?void 0:l.duration)/2+B}}},close:{overflow:"hidden",opacity:0,width:0,transition:{...l,delay:B,opacity:{duration:(l==null?void 0:l.duration)/1.5}}}};return c.jsx(X.motion.div,{initial:"close",animate:"open",variants:C,transition:l,exit:"close",children:o.cloneElement(z,{key:O,shape:"rounded",variant:"filled",className:()=>({button:x("max-w-full overflow-hidden text-nowrap",{"px-0":!g,"bg-primary-container text-on-primary-container ":n==="primary","bg-secondary-container text-on-secondary-container":n==="secondary","bg-tertiary-container text-on-tertiary-container":n==="tertiary"}),stateLayer:x({"state-on-primary-container":n==="primary","state-on-secondary-container":n==="secondary","state-on-tertiary-container":n==="tertiary"})})})})})})()})}),L({className:"invisible pointer-events-none"}),c.jsxs("div",{className:"absolute right-0 top-0",children:[!g&&L({className:"",layout:!0,layoutId:"fab-menu"+W}),g&&c.jsx(c.Fragment,{children:c.jsx(F,{layout:!0,layoutId:"fab-menu"+W,variant:"filled",className:()=>({iconButton:x({"bg-primary text-on-primary":n==="primary","bg-secondary text-on-secondary":n==="secondary","bg-tertiary text-on-tertiary":n==="tertiary"}),stateLayer:x({"[--default-color:var(--color-on-primary)]":n==="primary","[--default-color:var(--color-on-secondary)]":n==="secondary","[--default-color:var(--color-on-tertiary)]":n==="tertiary"})}),style:{transition:"border-radius 0.3s ease-in-out"},transition:{duration:l.duration,ease:"easeInOut",borderRadius:{duration:l.duration,ease:"easeInOut"},background:{duration:l.duration,ease:"easeInOut"},...l},icon:os,onClick:()=>H(!1),children:"Close"})})]})]})},ys=({className:e,valueFormatter:t,step:n=10,name:r,value:s=0,min:d=0,max:u=100,marks:a=[{value:0,label:"0"},{value:100,label:"100"}],ref:l,onChange:i,...f})=>{const y=R=>{const V=p(),K=h();return R===1/0?100:R===-1/0?0:(R-V)/(K-V)*100},h=(R=!1)=>R?u:u==1/0?a[(a==null?void 0:a.length)-1].value:u,p=(R=!1)=>R?d:d==-1/0?a[0].value:d,m=R=>{const V=p(!1);return(h(!1)-V)*R/100+V},[S,w]=o.useState(!1),I=o.useRef(null),b=l||I,[g,H]=o.useState(s),[D,v]=o.useState(y(s)),[N,F]=o.useState(!1);o.useEffect(()=>{H(s),v(y(s))},[s]);const L=R=>{F(!0),w(!0),z(R)},W=()=>{F(!1),w(!1)};o.useEffect(()=>(N?(window.addEventListener("mouseup",W),window.addEventListener("mousemove",z),window.addEventListener("touchend",W),window.addEventListener("touchmove",z)):(window.removeEventListener("mouseup",W),window.removeEventListener("mousemove",z),window.removeEventListener("touchend",W),window.removeEventListener("touchmove",z)),()=>{window.removeEventListener("mouseup",W),window.removeEventListener("mousemove",z),window.removeEventListener("touchend",W),window.removeEventListener("touchmove",z)}),[N]);const M=Mt({className:e,isChanging:S,marks:a,max:u,min:d,name:r,step:n,value:g,valueFormatter:t,onChange:i}),z=R=>{const V=b==null?void 0:b.current;if(V){const K=V.getBoundingClientRect().left,ee=((R.type==="touchmove"||R.type==="touchstart"?R.touches[0].clientX:R.clientX)-K)/V.offsetWidth*100;O({percent:ee})}},O=({percent:R,value:V})=>{if(R){if(R>=100){H(h(!0)),v(100);return}if(R<=0){H(p(!0)),v(0);return}V=m(R),V==p()&&(V=p(!0)),V==h()&&(V=h(!0))}else if(V!=null){if(V>=h()){H(h(!0)),v(100);return}if(V<=p()){H(p(!0)),v(0);return}R=y(V)}else return;n!=null?V=Math.round((V-p())/n)*n+p():a&&(V=a.reduce((K,G,ee)=>{let k=G.value===1/0?h():G.value===-1/0?p():G.value,j=K.value===1/0?h():K.value===-1/0?p():K.value;return k=Math.abs(k-V),j=Math.abs(j-V),k<j?G:K}).value),V>=h()&&(V=h(!0)),V<=p()&&(V=p(!0)),R=y(V),H(V),v(R),i&&i(V)},[Z,B]=o.useState(0);o.useEffect(()=>{const R=()=>{b.current&&B(b.current.offsetWidth)};return R(),window.addEventListener("resize",R),()=>{window.removeEventListener("resize",R)}},[]);const C=R=>{switch(R.key){case"ArrowRight":if(n)O({value:g+n});else if(a){const V=a.find(K=>K.value>g);V&&O({value:V.value})}break;case"ArrowLeft":if(n)O({value:g-n});else if(a){const V=a.slice(0).reverse().find((K,G,ee)=>g===1/0?G===1:K.value<g);V&&O({value:V.value})}break;default:return}};return c.jsxs("div",{tabIndex:0,onKeyDown:C,role:"slider","aria-valuemin":p(!0),"aria-valuemax":h(!0),"aria-valuenow":g,"aria-valuetext":g.toString(),className:M.slider,onMouseDown:L,onClick:z,ref:b,onTouchStart:L,onDragStart:R=>R.preventDefault(),...f,children:[c.jsx("input",{type:"hidden",name:r,value:g}),c.jsx("div",{className:M.activeTrack,style:{flex:D/100}}),c.jsx("div",{className:M.handle,children:c.jsx(X.AnimatePresence,{children:S&&c.jsx(X.motion.div,{className:M.valueIndicator,initial:"hidden",animate:"visible",exit:"hidden",style:{translate:"-50%",transformOrigin:"center bottom",textWrap:"nowrap"},variants:{visible:{opacity:1,scale:1},hidden:{opacity:1,scale:0}},transition:{duration:.1},children:t?t(g):g})})}),c.jsx("div",{className:M.inactiveTrack,style:{flex:1-D/100}}),c.jsx("div",{className:"w-[calc(100%-12px)] h-full absolute -translate-x-1/2 transform left-1/2",children:a&&a.map((R,V)=>{let K=null;const G=(S?9:10)/Z*100,ee=y(R.value);return ee<=D-G?K=!0:ee>=D+G&&(K=!1),c.jsx("div",{className:x(M.dot,{"bg-primary-container":K!=null&&K,"bg-primary":K!=null&&!K}),style:{left:`${y(R.value)}%`}},V)})})]})},xs=({variant:e="standard",className:t,children:n,title:r,position:s="right",extended:d,divider:u,onExtendedChange:a,closeIcon:l=we,transition:i,...f})=>{i={duration:.3,...i};const[y,h]=o.useState(d??!0),p=It({transition:i,title:r,position:s,closeIcon:l,className:t,children:n,onExtendedChange:a,divider:u,isExtended:y,extended:y,variant:e});o.useEffect(()=>{a==null||a(y??!1)},[y]),o.useEffect(()=>{d!=null&&h(d)},[d]);const m={close:{width:0},open:{width:"auto"}},S=()=>c.jsxs(c.Fragment,{children:[c.jsx(X.AnimatePresence,{children:e=="modal"&&y&&c.jsx(X.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:i,onClick:()=>h(!1),className:p.overlay})}),c.jsx(X.AnimatePresence,{children:y&&c.jsxs("div",{...f,className:p.sideSheet,style:{transition:i.duration+"s"},children:[c.jsxs(X.motion.div,{variants:m,initial:d===!1?"open":"close",animate:"open",exit:"close",className:p.container,children:[c.jsxs("div",{className:p.header,children:[r&&c.jsx("p",{className:p.title,children:r}),c.jsx(ve,{size:"small",label:"close",icon:l,onClick:()=>h(!1),className:p.closeButton})]}),c.jsx("div",{className:p.content,style:{transition:i.duration+"s"},children:n})]}),(u==null&&e=="standard"?!0:u)&&c.jsx($e,{className:p.divider,orientation:"vertical"})]})})]});return e=="modal"?Ie.createPortal(S(),document.body):S()},vs=({message:e,className:t,duration:n,closeIcon:r=we,onClose:s,...d})=>{const[u,a]=o.useState(!0),l=Rt({className:t,closeIcon:r,duration:n,isVisible:u,onClose:s,message:e});o.useEffect(()=>{n&&setTimeout(()=>{i()},n)},[n]);const i=()=>{a(!1),s==null||s()};return c.jsx(X.AnimatePresence,{children:u&&c.jsx(X.motion.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.1},className:l.snackbar,...d,children:c.jsxs("div",{className:l.container,children:[c.jsx("p",{className:l.supportingText,children:e}),c.jsx(ve,{onClick:()=>i(),className:l.icon,icon:r,label:"close the snackbar"})]})})})},gs=({selected:e=!1,className:t,activeIcon:n,disabled:r=!1,inactiveIcon:s,onChange:d,onClick:u,onKeyDown:a,ref:l,...i})=>{const[f,y]=o.useState(e);o.useEffect(()=>{y(e)},[e]);const h=b=>{r||(m(),u&&u(b))},p=b=>{r||((b.key===" "||b.key==="Enter")&&(b.preventDefault(),m()),a&&a(b))},m=()=>{y(!f),d==null||d(!f)},S=Ft({className:t,isSelected:f,activeIcon:n,inactiveIcon:s,disabled:r,selected:f,onChange:d}),w=o.useRef(null),I=l||w;return c.jsxs(X.motion.div,{role:"switch","aria-checked":f,tabIndex:r?-1:0,onKeyDown:p,onClick:h,ref:I,className:S.switch,...i,children:[c.jsx("input",{type:"hidden",value:f?"1":"0"}),c.jsxs(X.motion.div,{layout:!0,style:{translate:f?"50%":"-50%"},transition:{type:"spring",stiffness:700,damping:30},className:S.handleContainer,children:[c.jsx("div",{className:S.handle,children:(f?n:s)&&c.jsx(ce,{className:S.icon,icon:f?n:s})}),c.jsx("div",{className:S.handleStateLayer})]})]})},Jt=({className:e,onClick:t,label:n,variant:r="primary",href:s,icon:d,selectedTab:u,setSelectedTab:a,tabsId:l,index:i,onTabSelected:f,scrollable:y=!1,selected:h=!1,children:p,ref:m,...S})=>{const w=o.useRef(null),I=m||w,b=n??(typeof p=="string"?p:void 0),[g,H]=o.useState(h);o.useEffect(()=>{h&&u==null?H(!0):H(u==i&&i!=null)},[u]),o.useEffect(()=>{u==i&&f&&f({ref:I,index:i||0,label:b,icon:d})},[u]);const D=s?"a":"button",v=F=>{a&&a(i??null),t&&t(F)},N=$t({className:e,onTabSelected:f,scrollable:y,selectedTab:u,index:i,tabsId:l,selected:g,variant:r,icon:d,label:b,isSelected:g,setSelectedTab:a,href:s});return c.jsxs(D,{...S,role:"tab","aria-selected":g,ref:I,href:s,className:N.tab,onClick:v,...S,children:[c.jsx(me,{style:{transition:.3+"s"},className:N.stateLayer,colorName:r==="primary"&&g?"primary":"on-surface",stateClassName:"state-ripple-group-[tab]"}),c.jsxs("span",{className:N.content,children:[d&&c.jsx(ce,{icon:d,className:N.icon}),c.jsx("span",{className:N.label,children:b}),g&&c.jsx(X.motion.span,{layoutId:`underline-${l}`,className:N.underline,transition:{duration:.3}})]})]})},Pe=o.createContext(null),ws=({variant:e="primary",onTabSelected:t,children:n,className:r,selectedTab:s,setSelectedTab:d,scrollable:u=!1})=>{const a=o.useContext(Pe),[l,i]=o.useState(null);let f;s===0||s!=null?f=s:a?f=a.selectedTab:f=l;const y=d??(a==null?void 0:a.setSelectedTab)??i,h=o.Children.toArray(n).filter(I=>o.isValidElement(I)&&I.type===Jt),p=o.useRef(null),m=I=>{if(t==null||t(I),u){const b=p.current,g=I.ref.current;if(b&&g){const H=g.offsetLeft+g.offsetWidth/2-b.offsetWidth/2;b.scrollTo({left:H,behavior:"smooth"})}}},S=o.useMemo(()=>(a==null?void 0:a.tabsId)??Kt(),[a==null?void 0:a.tabsId]),w=Pt({children:n,onTabSelected:t,scrollable:u,selectedTab:f,setSelectedTab:y,className:r,variant:e});return c.jsx("div",{ref:p,role:"tablist",className:w.tabs,children:h.map((I,b)=>o.cloneElement(I,{key:b,index:b,variant:e,selectedTab:f,setSelectedTab:y,tabsId:S,onTabSelected:m,scrollable:u}))})},bs=({children:e,selectedTab:t,setSelectedTab:n,defaultTab:r=0})=>{const[s,d]=o.useState(r),u=o.useRef(null),a=t!==void 0?t:s,l=n??d,i=u.current!==null&&a!==null?a>u.current?1:-1:0;a!==u.current&&(u.current=a);const f=o.useId(),y=o.useMemo(()=>({selectedTab:a,setSelectedTab:l,previousTab:u.current,direction:i,tabsId:f}),[a,l,i,f]);return c.jsx(Pe.Provider,{value:y,children:e})},Zt=({children:e,className:t,isSelected:n=!1})=>{const r=Ot({children:e,className:t,isSelected:n});return c.jsx("div",{className:r.tabPanel,children:e})},Ss=({children:e,className:t})=>{const n=o.useContext(Pe);if(!n)return console.warn("TabPanels must be used within a TabGroup"),null;const{selectedTab:r,direction:s,tabsId:d}=n,u=o.Children.toArray(e).filter(l=>o.isValidElement(l)&&l.type===Zt),a=Tt({children:e,className:t});return c.jsx("div",{className:a.tabPanels,children:c.jsx(X.AnimatePresence,{initial:!1,custom:s,mode:"popLayout",children:u.map((l,i)=>r===i&&c.jsx(X.motion.div,{custom:s,variants:{enter:f=>({x:f*100+"%",opacity:1}),center:{x:0,opacity:1},exit:f=>({x:f*-100+"%",opacity:1})},initial:"enter",animate:"center",exit:"exit",transition:{type:"spring",stiffness:400,damping:40},role:"tabpanel","aria-labelledby":`tab-${d}-${i}`,children:o.cloneElement(l,{isSelected:!0})},i))})})},Ns=({hasSelected:e})=>({datePicker:x("inline-flex flex-col bg-surface-container-high rounded-[28px] p-3 select-none","min-w-[320px]"),header:x("flex items-center justify-between h-12 mb-2 px-2"),monthNav:x("flex items-center justify-center w-10 h-10 rounded-full text-on-surface-variant hover:bg-on-surface-variant/8 transition-colors cursor-pointer"),monthLabel:x("text-label-large text-on-surface font-bold capitalize"),weekDays:x("grid grid-cols-7 mb-2"),weekDay:x("h-10 flex items-center justify-center text-body-small text-on-surface-variant"),daysGrid:x("grid grid-cols-7 row-auto gap-y-2"),dayCell:x("flex items-center justify-center h-10 p-0 relative"),dayButton:x("w-10 h-10 rounded-full flex items-center justify-center text-body-large transition-all duration-200 relative overflow-hidden z-10 outline-none")}),Es=Q("datePicker",Ns),Qt=({value:e,defaultValue:t,onChange:n,minDate:r,maxDate:s,shouldDisableDate:d,locale:u="default",weekStartDay:a=0,className:l,style:i,mode:f="single",...y})=>{const[h,p]=o.useState(()=>{const k=E=>E instanceof Date?E:Array.isArray(E)&&E[0]?E[0]:null,j=k(e)||k(t)||new Date;return new Date(j.getFullYear(),j.getMonth(),1)}),[m,S]=o.useState(0),[w,I]=o.useState("day"),b=e!==void 0,[g,H]=o.useState(t||null),D=b?e||null:g,v=(k,j)=>new Date(k,j+1,0).getDate(),N=o.useMemo(()=>{const k=h.getFullYear(),j=h.getMonth(),E=v(k,j),T=(new Date(k,j,1).getDay()-a+7)%7,Y=[],_=v(k,j-1);for(let q=T-1;q>=0;q--)Y.push({date:new Date(k,j-1,_-q),isCurrentMonth:!1});for(let q=1;q<=E;q++)Y.push({date:new Date(k,j,q),isCurrentMonth:!0});const A=42-Y.length;for(let q=1;q<=A;q++)Y.push({date:new Date(k,j+1,q),isCurrentMonth:!1});return Y},[h,a]),F=o.useMemo(()=>{const k=new Date().getFullYear(),j=k-100,E=k+100,$=[];for(let T=j;T<=E;T++)$.push(T);return $},[]),L=o.useRef(null);o.useEffect(()=>{if(w==="year"&&L.current){const k=L.current.querySelector('[data-selected="true"]');k&&k.scrollIntoView({block:"center"})}},[w]);const W=o.useMemo(()=>new Intl.DateTimeFormat(u,{month:"long",year:"numeric"}),[u]),M=o.useMemo(()=>new Intl.DateTimeFormat(u,{weekday:"narrow"}),[u]),z=o.useMemo(()=>{const k=new Date(2023,0,1+a);return Array.from({length:7}).map((j,E)=>{const $=new Date(k);return $.setDate(k.getDate()+E),M.format($).charAt(0).toUpperCase()})},[M,a]),O=()=>{S(-1),p(k=>new Date(k.getFullYear(),k.getMonth()-1,1))},Z=()=>{S(1),p(k=>new Date(k.getFullYear(),k.getMonth()+1,1))},B=k=>{p(j=>new Date(k,j.getMonth(),1)),I("day")},C=(k,j)=>k?k.getDate()===j.getDate()&&k.getMonth()===j.getMonth()&&k.getFullYear()===j.getFullYear():!1,R=k=>C(new Date,k),V=k=>{let j=k;if(f==="single")j=k;else{const E=D,[$,T]=Array.isArray(E)?E:[null,null];!$||$&&T?j=[k,null]:k<$?j=[k,$]:j=[$,k]}b||H(j),n&&n(j)},K=k=>{if(f==="single")return{isSelected:C(D,k),isStart:!1,isEnd:!1,isInRange:!1};const j=Array.isArray(D)?D:[D,null],[E,$]=j,T=C(E,k),Y=C($,k);let _=!1;if(E&&$){const J=new Date(E.getFullYear(),E.getMonth(),E.getDate()).getTime(),A=new Date($.getFullYear(),$.getMonth(),$.getDate()).getTime(),q=new Date(k.getFullYear(),k.getMonth(),k.getDate()).getTime();_=q>J&&q<A}return{isSelected:T||Y,isStart:T,isEnd:Y,isInRange:_}},G=Es({hasSelected:!!D}),ee={enter:k=>({x:k>0?"100%":"-100%",opacity:0}),center:{x:0,opacity:1},exit:k=>({x:k<0?"100%":"-100%",opacity:0})};return c.jsxs("div",{className:x(G.datePicker,l),style:i,...y,children:[c.jsxs("div",{className:G.header,children:[c.jsxs(ye,{variant:"text",disableTextMargins:!0,size:"small",onClick:()=>I(k=>k==="day"?"year":"day"),className:"text-label-large font-bold capitalize text-on-surface hover:bg-surface-container-highest",children:[c.jsx("span",{className:"mr-2",children:w==="day"?W.format(h):h.getFullYear()}),c.jsx(ce,{icon:is,className:x("w-3 h-3 transition-transform duration-200 inline",w==="year"&&"rotate-180")})]}),w==="day"&&c.jsxs("div",{className:"flex items-center",children:[c.jsx(ve,{size:"xSmall",allowShapeTransformation:!1,onClick:O,icon:ls,label:"Previous month",title:null}),c.jsx(ve,{size:"xSmall",allowShapeTransformation:!1,onClick:Z,icon:ss,label:"Next month",title:null})]})]}),w==="year"?c.jsx("div",{className:"h-[280px] overflow-y-auto grid grid-cols-3 gap-2 p-2 scrollbar-hide",ref:L,children:F.map(k=>c.jsx(ye,{size:"small",variant:k===h.getFullYear()?"filled":"text",onClick:()=>B(k),"data-selected":k===h.getFullYear(),className:x("w-full",{"text-on-surface":k!==h.getFullYear()}),label:k.toString(),children:k},k))}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:G.weekDays,children:z.map((k,j)=>c.jsx("div",{className:G.weekDay,children:k},j))}),c.jsx("div",{className:"overflow-hidden relative min-h-[240px]",children:c.jsx(X.AnimatePresence,{mode:"popLayout",initial:!1,custom:m,children:c.jsx(X.motion.div,{custom:m,variants:ee,initial:"enter",animate:"center",exit:"exit",transition:{type:"spring",bounce:0,duration:.3},className:G.daysGrid,children:N.map((k,j)=>{if(!k.isCurrentMonth)return c.jsx("div",{className:G.dayCell},j);const{isSelected:E,isStart:$,isEnd:T,isInRange:Y}=K(k.date),_=R(k.date),J=r&&k.date<r||s&&k.date>s||(d==null?void 0:d(k.date));return c.jsx("div",{className:x(G.dayCell,Y&&"bg-primary/20",$&&(D==null?void 0:D[1])&&"bg-gradient-to-r from-transparent to-primary/20",T&&(D==null?void 0:D[0])&&"bg-gradient-to-l from-transparent to-primary/20"),children:c.jsx(ye,{className:()=>({button:x("aspect-square h-[40px] p-0",{"text-on-surface":!E&&!_,"opacity-50":J}),stateLayer:x({"!bg-transparent":J})}),size:"small",allowShapeTransformation:!1,variant:x({filled:E,outlined:_,text:!E&&!_}),label:k.date.getDate().toString(),onClick:()=>V(k.date),disabled:J,children:k.date.getDate().toString()})},j)})},h.toISOString())})})]})]})},ks=({variant:e="filled",disabled:t=!1,errorText:n,placeholder:r,suffix:s,name:d,label:u,className:a,supportingText:l,trailingIcon:i,leadingIcon:f,type:y="text",multiline:h=!1,autoComplete:p="on",onChange:m,value:S,defaultValue:w,showSupportingText:I,id:b,style:g,ref:H,...D})=>{const v=o.useId(),N=b||v,F=`${N}-helper`,L=S!==void 0,[W,M]=o.useState(w??""),z=L?S:W,[O,Z]=o.useState(!1),[B,C]=o.useState(!!(n!=null&&n.length)),R=o.useRef(null),V=H||R,K=o.useRef(null),G=o.useRef(null),ee=I??(!!(n!=null&&n.length)||!!(l!=null&&l.length));o.useEffect(()=>{C(!!(n!=null&&n.length))},[n]);const k=()=>{V.current&&!O&&V.current.focus()},j=ae=>{var de;Z(!0),C(!1),(de=D.onFocus)==null||de.call(D,ae)},E=ae=>{const de=ae.target.value;L||M(de),C(!1),m&&m(ae)},$=ae=>{var de;Z(!1),n!=null&&n.length&&C(!0),(de=D.onBlur)==null||de.call(D,ae)},T=y==="date",[Y,_]=o.useState(!1),[J,A]=o.useState(null),q=o.useMemo(()=>{const ae=String(z);if(!ae)return null;const[de,Be,Te]=ae.split("-").map(Number);return de&&Be&&Te?new Date(de,Be-1,Te):null},[z]),ne=()=>{t||(A(q),_(!0))},le=()=>{const ae=J?J.toLocaleDateString("en-CA"):"";L||M(ae),m&&m({target:{value:ae,name:d,type:y}}),_(!1)},ue=T&&!i?ns:i,he=T?"[&::-webkit-calendar-picker-indicator]:hidden cursor-pointer":"",oe=zt({showSupportingText:ee,isFocused:O,showErrorIcon:B,disabled:t,name:d,label:u,autoComplete:p,className:a,onChange:m,placeholder:r,supportingText:l,type:y,leadingIcon:f,trailingIcon:ue,variant:e,errorText:n,value:String(z),suffix:s,multiline:h}),U=h?on:"input",re=h?{}:{type:y},se=O||typeof z=="string"&&z.length>0||y=="date",fe=se&&e==="outlined",ge=!fe;return c.jsxs("div",{ref:K,className:oe.textField,style:g,children:[c.jsxs("fieldset",{onClick:k,className:oe.content,role:"presentation",children:[c.jsx("div",{className:oe.stateLayer}),f&&c.jsx("div",{className:oe.leadingIcon,children:o.isValidElement(f)?f:c.jsx(ce,{className:"w-5 h-5",icon:f})}),c.jsx(X.motion.legend,{"aria-hidden":"true",variants:{hidden:{width:0,padding:0},visible:{width:"auto",padding:"0 8px"}},initial:fe?"visible":"hidden",animate:fe?"visible":"hidden",className:"max-w-full ml-2 px-2 text-body-small h-0 overflow-hidden whitespace-nowrap",transition:{duration:.2},children:c.jsx("span",{className:"transform inline-flex -translate-y-1/2 opacity-0",children:u})}),c.jsxs("div",{className:"flex-1 relative",children:[ge&&c.jsx(X.motion.label,{htmlFor:N,className:x("absolute left-4 transition-all duration-300 pointer-events-none",{"text-body-small top-2":e=="filled"&&se,"text-body-large top-1/2 transform -translate-y-1/2":!(e=="filled"&&se)}),transition:{duration:.3},layoutId:e==="outlined"?`${N}-label`:void 0,children:c.jsx("span",{className:oe.label,children:u})}),fe&&c.jsx(X.motion.label,{htmlFor:N,className:x("absolute left-2 -top-3 px-1 text-body-small z-10",oe.label),layoutId:`${N}-label`,transition:{duration:.3},children:u}),c.jsx(U,{...D,ref:V,value:z,onChange:E,className:x(oe.input,he),id:N,name:d,placeholder:O?r??void 0:"",onFocus:j,onBlur:$,disabled:t,autoComplete:p,"aria-invalid":!!(n!=null&&n.length),"aria-describedby":ee?F:void 0,...re})]}),c.jsx("div",{className:oe.activeIndicator}),!B&&c.jsxs(c.Fragment,{children:[ue&&c.jsx("div",{ref:T?G:void 0,onClick:ae=>{ae.stopPropagation(),T&&ne()},className:x(oe.trailingIcon,T&&"cursor-pointer"),children:c.jsx("div",{className:"flex items-center justify-center w-full h-full",children:o.isValidElement(ue)?ue:c.jsx(ce,{className:"h-5",icon:ue})})}),!ue&&s&&c.jsx("span",{className:oe.suffix,children:s})]}),B&&c.jsx("div",{className:x(oe.trailingIcon,{" absolute right-0":!ue}),children:c.jsx(ce,{className:"h-5 text-error",icon:rs})})]}),ee&&c.jsx("p",{className:oe.supportingText,id:F,children:n!=null&&n.length?n:l!=null&&l.length?l:" "}),T&&Y&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 z-40 bg-transparent",onClick:()=>_(!1)}),c.jsx(Re,{anchorRef:K,position:"bottom",children:c.jsxs("div",{className:"z-50 shadow-xl rounded-[28px] bg-surface-container-high overflow-hidden",children:[c.jsx(Qt,{className:"",value:J,onChange:A}),c.jsxs("div",{className:"flex justify-end gap-2 p-4 pt-0",children:[c.jsx(ye,{variant:"text",size:"small",onClick:()=>_(!1),children:"Cancel"}),c.jsx(ye,{variant:"filled",size:"small",onClick:le,children:"OK"})]})]})})]})]})},js=({isSelected:e,icon:t,label:n,variant:r})=>({navigationRailItem:x(" group/navigation-rail-item flex flex-col pt-1 pb-1.5 cursor-pointer",{"text-on-surface-variant":!e,"text-on-secondary-container":e,"gap-2 h-[68px]":r=="vertical","gap-0 h-[66px]":r=="horizontal"}),container:x(" 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:x("rounded-full"),icon:x("size-6 flex"),label:x("w-fit mx-auto text-nowrap",{"text-label-large ":r=="horizontal","text-label-medium":r=="vertical"})}),Ls=Q("navigationRailItem",js),en=({label:e})=>c.jsx("div",{className:" h-9 flex items-center mx-9 mt-3",children:c.jsx("p",{className:"text-label-large text-on-surface-variant",children:e})}),tn=({className:e,onClick:t,label:n,variant:r="vertical",href:s,icon:d,selectedItem:u,setSelectedItem:a,index:l,onItemSelected:i,selected:f=!1,ref:y,transition:h,isExtended:p,iconSelected:m,style:S,extendedOnly:w,children:I,...b})=>{I&&(n=I);const g=o.useRef(null),H=y||g,[D,v]=o.useState(f);o.useEffect(()=>{f&&u==null?v(!0):v(u==l&&l!=null)},[u]),o.useEffect(()=>{u==l&&i&&i({ref:H,index:l||0,label:n,icon:d})},[u]);const N=s?"a":"button",F=W=>{a&&a(l??null),t&&t(W)},L=Ls({isExtended:p,extendedOnly:w,className:e,onItemSelected:i,selectedItem:u,index:l,transition:h,selected:D,variant:r,icon:d,label:n,isSelected:D,setSelectedItem:a,href:s,children:n,iconSelected:m});return h={duration:.3,...h},w&&!p?null:c.jsxs(N,{...b,role:"tab","aria-selected":D,ref:H,href:s,className:L.navigationRailItem,onClick:F,style:{transition:h.duration+"s",...S},children:[c.jsxs(X.motion.div,{style:{transition:r=="horizontal"?h.duration+`s, gap ${h.duration/2}s ${h.duration-h.duration/2}s`:h.duration+`s, gap ${h.duration/3}s ${h.duration-h.duration/3}s`},transition:h,className:L.container,children:[c.jsx(me,{style:{transition:h.duration+"s"},className:L.stateLayer,colorName:x({"on-surface":!D,"on-secondary-container":D}),stateClassName:"state-ripple-group-[navigation-rail-item]"}),d&&c.jsx(ce,{icon:D?m:d,className:L.icon}),c.jsx(X.AnimatePresence,{children:r=="horizontal"&&(()=>{const W={width:0,opacity:0,transition:{...h}},M={width:"auto",opacity:1,transition:{...h,opacity:{duration:h.duration/2,delay:h.duration-h.duration/2}}};return c.jsx(X.motion.span,{initial:W,animate:M,exit:W,className:L.label,children:n})})()})]}),c.jsx(X.AnimatePresence,{children:r=="vertical"&&(()=>{const W={height:0,opacity:0,transition:{...h,opacity:{duration:0}}},M={height:"auto",opacity:1,transition:{...h,opacity:{duration:h.duration/3,delay:h.duration-h.duration/3}}};return c.jsx(X.motion.span,{initial:M,animate:M,exit:W,className:L.label,transition:h,children:n})})()})]})},Is=({isExtended:e,alignment:t})=>({navigationRail:x("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:x("flex flex-col gap-1 items-start"),menuIcon:"mx-5",segments:x(" flex flex-col overflow-auto min-w-full mt-10",{"w-full":!e,"w-fit items-start":e})}),Ms=Q("navigationRail",Is),Cs=({variant:e="standard",onItemSelected:t,children:n,className:r,selectedItem:s,extended:d,alignment:u="top",menu:a={closed:{icon:as,label:"Open menu"},opened:{icon:we,label:"Close menu"}},style:l,onExtendedChange:i,transition:f,setSelectedItem:y})=>{const[h,p]=o.useState(null),[m,S]=o.useState(d);let w;s==0||s!=null?w=s:w=h;const I=y||p,b=o.useRef(null),g=L=>{t==null||t(L)};function H(L){const W=[];return o.Children.forEach(L,M=>{o.isValidElement(M)&&M.type===o.Fragment?W.push(...H(M.props.children)):W.push(M)}),W}const D=H(n),v=D.filter(L=>o.isValidElement(L)&&L.type===Se),N=Ms({children:n,onItemSelected:t,selectedItem:w,setSelectedItem:I,className:r,variant:e,extended:m,isExtended:m,alignment:u,menu:a,transition:f,onExtendedChange:i});f={duration:.3,...f};const F=o.useRef(!1);return F.current=!1,o.useEffect(()=>{i==null||i(m??!1)},[m]),c.jsxs("div",{style:{transition:f.duration+"s",...l},ref:b,className:N.navigationRail,children:[c.jsxs("div",{className:N.header,children:[c.jsx(ve,{onClick:()=>S(!m),label:m?a==null?void 0:a.opened.label:a==null?void 0:a.closed.label,className:N.menuIcon,icon:m?a.opened.icon:a==null?void 0:a.closed.icon}),v.length>0&&o.cloneElement(v[0],{transition:f,isExtended:m,className:"!shadow-none mx-5 "+v[0].props.className})]}),c.jsx("div",{className:N.segments,children:(()=>{let L=0;return D.map(W=>o.isValidElement(W)&&W.type===tn?o.cloneElement(W,{key:L,index:L++,variant:m?"horizontal":"vertical",selectedItem:w,setSelectedItem:I,onItemSelected:g,transition:f,extendedOnly:F.current,isExtended:m}):o.isValidElement(W)&&W.type===Se?null:o.isValidElement(W)&&W.type===en?(F.current=!0,m?o.cloneElement(W,{}):null):W)})()}),c.jsx("div",{className:"flex-1 max-h-[160px]"})]})};function Rs(e){return be.defineConfig({variant:be.Variants.Udixio,...e,plugins:[new be.FontPlugin(e),new Ke.TailwindPlugin(e)]})}exports.AnchorPositioner=Re;exports.AnimateOnScrollInit=In;exports.Button=ye;exports.Card=Qn;exports.Carousel=es;exports.CarouselItem=Xt;exports.Checkbox=cs;exports.Chip=Le;exports.Chips=ms;exports.CustomScroll=et;exports.DatePicker=Qt;exports.Divider=$e;exports.Fab=Se;exports.FabMenu=ps;exports.Icon=ce;exports.IconButton=ve;exports.NavigationRail=Cs;exports.NavigationRailItem=tn;exports.NavigationRailSection=en;exports.ProgressIndicator=qt;exports.RippleEffect=Ge;exports.SideSheet=xs;exports.Slider=ys;exports.SmoothScroll=gn;exports.Snackbar=vs;exports.State=me;exports.Switch=gs;exports.SyncedFixedWrapper=rt;exports.Tab=Jt;exports.TabGroup=bs;exports.TabPanel=Zt;exports.TabPanels=Ss;exports.Tabs=ws;exports.TextField=ks;exports.ThemeProvider=Sn;exports.Tooltip=We;exports.animateOnScroll=Mn;exports.buttonStyle=Cn;exports.cardStyle=Rn;exports.carouselItemConfig=De;exports.carouselItemStyle=Dn;exports.carouselStyle=Fn;exports.checkboxStyle=An;exports.chipStyle=$n;exports.chipsStyle=Wn;exports.classNames=x;exports.classnames=Ze;exports.createUseClassNames=Q;exports.customScrollStyle=Qe;exports.defaultClassNames=te;exports.defineConfig=Rs;exports.dividerStyle=Pn;exports.fabMenuStyle=Tn;exports.fabStyle=Bn;exports.getClassNames=Ne;exports.iconButtonStyle=Hn;exports.initAnimateOnScroll=Ce;exports.normalize=xe;exports.progressIndicatorStyle=On;exports.sideSheetConfig=Fe;exports.sideSheetStyle=It;exports.sliderConfig=Ae;exports.sliderStyle=zn;exports.snackbarStyle=Yn;exports.switchStyle=_n;exports.tabPanelStyle=Kn;exports.tabPanelsStyle=Un;exports.tabStyle=qn;exports.tabsStyle=Xn;exports.textFieldStyle=Gn;exports.toolStyle=Jn;exports.useButtonStyle=it;exports.useCardStyle=at;exports.useCarouselItemStyle=ct;exports.useCarouselStyle=dt;exports.useCheckboxStyle=ht;exports.useChipStyle=pt;exports.useChipsStyle=xt;exports.useClassNames=an;exports.useDividerStyle=gt;exports.useFabMenuStyle=Nt;exports.useFabStyle=bt;exports.useIconButtonStyle=kt;exports.useProgressIndicatorStyle=Lt;exports.useSideSheetStyle=Vn;exports.useSliderStyle=Mt;exports.useSnackbarStyle=Rt;exports.useStateStyle=st;exports.useSwitchStyle=Ft;exports.useTabPanelStyle=Ot;exports.useTabPanelsStyle=Tt;exports.useTabStyle=$t;exports.useTabsStyle=Pt;exports.useTextFieldStyle=zt;exports.useToolTipStyle=_t;exports.useTooltipTrigger=Gt;
|
package/dist/index.js
CHANGED
|
@@ -2,11 +2,11 @@ var Wt = Object.defineProperty;
|
|
|
2
2
|
var At = (e, t, n) => t in e ? Wt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var B = (e, t, n) => At(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import { jsx as d, jsxs as K, Fragment as ye } from "react/jsx-runtime";
|
|
5
|
-
import Q, { useState as V, useEffect as _, useMemo as be, useRef as j, useLayoutEffect as $e, useId as Ee, useCallback as me, isValidElement as Ie, cloneElement as Re, createContext as Ft, useContext as
|
|
6
|
-
import { AnimatePresence as pe, motion as ne, useScroll as Pt, useMotionValueEvent as
|
|
7
|
-
import { clsx as
|
|
5
|
+
import Q, { useState as V, useEffect as _, useMemo as be, useRef as j, useLayoutEffect as $e, useId as Ee, useCallback as me, isValidElement as Ie, cloneElement as Re, createContext as Ft, useContext as Qe, Children as Bt, Fragment as Ht } from "react";
|
|
6
|
+
import { AnimatePresence as pe, motion as ne, useScroll as Pt, useMotionValueEvent as Ye, animate as Ot } from "motion/react";
|
|
7
|
+
import { clsx as et } from "clsx";
|
|
8
8
|
import { extendTailwindMerge as zt } from "tailwind-merge";
|
|
9
|
-
import { createPortal as
|
|
9
|
+
import { createPortal as He } from "react-dom";
|
|
10
10
|
import { loader as Tt, defineConfig as Vt, FontPlugin as Yt, Variants as _t } from "@udixio/theme";
|
|
11
11
|
import { TailwindPlugin as tt } from "@udixio/tailwind";
|
|
12
12
|
import Xt from "react-textarea-autosize";
|
|
@@ -103,11 +103,11 @@ const qt = ({
|
|
|
103
103
|
font: ["font"]
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
}), y = (...e) => nt(
|
|
106
|
+
}), y = (...e) => nt(et(e)), Ut = (...e) => nt(et(e));
|
|
107
107
|
function jt(e) {
|
|
108
108
|
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
109
109
|
}
|
|
110
|
-
const
|
|
110
|
+
const Pe = (e) => {
|
|
111
111
|
const t = {};
|
|
112
112
|
e.classNameList.forEach((s) => {
|
|
113
113
|
var r;
|
|
@@ -127,12 +127,12 @@ const He = (e) => {
|
|
|
127
127
|
let [r, c] = s;
|
|
128
128
|
c = c.reverse(), r == e.default && c.unshift("relative"), c.unshift(jt(r)), n[r] = Ut(...c);
|
|
129
129
|
}), n;
|
|
130
|
-
}, oe = (e, t) => (n) =>
|
|
130
|
+
}, oe = (e, t) => (n) => Pe({
|
|
131
131
|
classNameList: [n.className, t],
|
|
132
132
|
default: e,
|
|
133
133
|
states: n
|
|
134
134
|
}), re = (e, t) => (n) => be(
|
|
135
|
-
() =>
|
|
135
|
+
() => Pe({
|
|
136
136
|
classNameList: [n.className, t],
|
|
137
137
|
default: e,
|
|
138
138
|
states: n
|
|
@@ -141,7 +141,7 @@ const He = (e) => {
|
|
|
141
141
|
);
|
|
142
142
|
function Sr(e, t, n) {
|
|
143
143
|
return be(
|
|
144
|
-
() =>
|
|
144
|
+
() => Pe({
|
|
145
145
|
classNameList: [n == null ? void 0 : n.className, t],
|
|
146
146
|
default: e,
|
|
147
147
|
states: n
|
|
@@ -270,9 +270,9 @@ const Jt = ({
|
|
|
270
270
|
const P = Math.max(0, (n ?? N.scrollHeight) - k.clientHeight);
|
|
271
271
|
k.scrollTop = A(i * P, 0, P);
|
|
272
272
|
}
|
|
273
|
-
}, [i, t, n]),
|
|
273
|
+
}, [i, t, n]), Ye(b, "change", (k) => {
|
|
274
274
|
O(k, "x");
|
|
275
|
-
}),
|
|
275
|
+
}), Ye(M, "change", (k) => {
|
|
276
276
|
O(k, "y");
|
|
277
277
|
});
|
|
278
278
|
const [R, v] = V(!1);
|
|
@@ -545,7 +545,7 @@ var sn = class {
|
|
|
545
545
|
destroy() {
|
|
546
546
|
this.events = {};
|
|
547
547
|
}
|
|
548
|
-
},
|
|
548
|
+
}, _e = 100 / 6, Se = { passive: !1 }, on = class {
|
|
549
549
|
constructor(e, t = { wheelMultiplier: 1, touchMultiplier: 1 }) {
|
|
550
550
|
B(this, "touchStart", {
|
|
551
551
|
x: 0,
|
|
@@ -598,7 +598,7 @@ var sn = class {
|
|
|
598
598
|
/** Event handler for 'wheel' event */
|
|
599
599
|
B(this, "onWheel", (e) => {
|
|
600
600
|
let { deltaX: t, deltaY: n, deltaMode: s } = e;
|
|
601
|
-
const r = s === 1 ?
|
|
601
|
+
const r = s === 1 ? _e : s === 2 ? this.window.width : 1, c = s === 1 ? _e : s === 2 ? this.window.height : 1;
|
|
602
602
|
t *= r, n *= c, t *= this.options.wheelMultiplier, n *= this.options.wheelMultiplier, this.emitter.emit("scroll", { deltaX: t, deltaY: n, event: e });
|
|
603
603
|
});
|
|
604
604
|
B(this, "onWindowResize", () => {
|
|
@@ -642,7 +642,7 @@ var sn = class {
|
|
|
642
642
|
Se
|
|
643
643
|
);
|
|
644
644
|
}
|
|
645
|
-
},
|
|
645
|
+
}, Xe = (e) => Math.min(1, 1.001 - Math.pow(2, -10 * e)), ln = class {
|
|
646
646
|
constructor({
|
|
647
647
|
wrapper: e = window,
|
|
648
648
|
content: t = document.documentElement,
|
|
@@ -848,7 +848,7 @@ var sn = class {
|
|
|
848
848
|
const t = e - (this.time || e);
|
|
849
849
|
this.time = e, this.animate.advance(t * 1e-3), this.options.autoRaf && (this._rafId = requestAnimationFrame(this.raf));
|
|
850
850
|
});
|
|
851
|
-
window.lenisVersion = Zt, (!e || e === document.documentElement) && (e = window), typeof i == "number" && typeof l != "function" ? l =
|
|
851
|
+
window.lenisVersion = Zt, (!e || e === document.documentElement) && (e = window), typeof i == "number" && typeof l != "function" ? l = Xe : typeof l == "function" && typeof i != "number" && (i = 1), this.options = {
|
|
852
852
|
wrapper: e,
|
|
853
853
|
content: t,
|
|
854
854
|
eventsTarget: n,
|
|
@@ -1039,7 +1039,7 @@ var sn = class {
|
|
|
1039
1039
|
});
|
|
1040
1040
|
return;
|
|
1041
1041
|
}
|
|
1042
|
-
r || (this.targetScroll = e), typeof a == "number" && typeof i != "function" ? i =
|
|
1042
|
+
r || (this.targetScroll = e), typeof a == "number" && typeof i != "function" ? i = Xe : typeof i == "function" && typeof a != "number" && (a = 1), this.animate.fromTo(this.animatedScroll, e, {
|
|
1043
1043
|
duration: a,
|
|
1044
1044
|
easing: i,
|
|
1045
1045
|
lerp: c,
|
|
@@ -1282,7 +1282,7 @@ const Nr = ({
|
|
|
1282
1282
|
var i;
|
|
1283
1283
|
window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c), (i = r.current) == null || i.disconnect();
|
|
1284
1284
|
};
|
|
1285
|
-
}, [e]), n ?
|
|
1285
|
+
}, [e]), n ? He(/* @__PURE__ */ d("div", { style: n, children: t }), document.body) : null;
|
|
1286
1286
|
};
|
|
1287
1287
|
function dn(e) {
|
|
1288
1288
|
return /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e);
|
|
@@ -1350,20 +1350,20 @@ function fn() {
|
|
|
1350
1350
|
function hn() {
|
|
1351
1351
|
return typeof window > "u" || !("matchMedia" in window) ? !1 : window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
1352
1352
|
}
|
|
1353
|
-
function
|
|
1353
|
+
function Oe(e) {
|
|
1354
1354
|
if (!(e instanceof HTMLElement)) return !1;
|
|
1355
1355
|
const t = e.classList;
|
|
1356
1356
|
return Array.from(t).some(
|
|
1357
1357
|
(n) => n.startsWith("anim-") && n.includes("scroll")
|
|
1358
1358
|
);
|
|
1359
1359
|
}
|
|
1360
|
-
function
|
|
1360
|
+
function qe(e) {
|
|
1361
1361
|
if (!(e instanceof HTMLElement)) return !1;
|
|
1362
1362
|
const t = e.classList;
|
|
1363
1363
|
return Array.from(t).some((n) => n.startsWith("anim-"));
|
|
1364
1364
|
}
|
|
1365
1365
|
function We(e, t) {
|
|
1366
|
-
if (!
|
|
1366
|
+
if (!Oe(e)) return;
|
|
1367
1367
|
if (e.hasAttribute(`data-${t}-scroll`)) {
|
|
1368
1368
|
const a = (e.getAttribute(`data-${t}-scroll`) || "").trim().toLowerCase(), i = a === "x" || a === "inline" ? "inline" : a === "y" || a === "block" ? "block" : "auto";
|
|
1369
1369
|
e.classList.contains(`${t}-timeline`) || e.classList.contains(`${t}-timeline-inline`) || e.classList.contains(`${t}-timeline-block`) || e.classList.contains(`${t}-timeline-x`) || e.classList.contains(`${t}-timeline-y`) || (i === "inline" ? e.classList.add(`${t}-timeline-inline`) : i === "block" ? e.classList.add(`${t}-timeline-block`) : e.classList.add(`${t}-scroll`));
|
|
@@ -1380,7 +1380,7 @@ function Ae(e = document, t) {
|
|
|
1380
1380
|
e.querySelectorAll(
|
|
1381
1381
|
`[class*="${t}-"][class*="-scroll"]`
|
|
1382
1382
|
)
|
|
1383
|
-
).filter((s) =>
|
|
1383
|
+
).filter((s) => Oe(s));
|
|
1384
1384
|
}
|
|
1385
1385
|
function pn(e = document, t) {
|
|
1386
1386
|
const n = Array.from(
|
|
@@ -1404,7 +1404,7 @@ function pn(e = document, t) {
|
|
|
1404
1404
|
const c = r.classList;
|
|
1405
1405
|
return c.contains(`${t}-in`) || c.contains(`${t}-out`) || Array.from(c).some(
|
|
1406
1406
|
(l) => l.startsWith(`${t}-`) && !l.includes("scroll") && !s.has(l)
|
|
1407
|
-
) ? !0 : !
|
|
1407
|
+
) ? !0 : !Oe(r);
|
|
1408
1408
|
});
|
|
1409
1409
|
}
|
|
1410
1410
|
function mn(e, t) {
|
|
@@ -1412,17 +1412,17 @@ function mn(e, t) {
|
|
|
1412
1412
|
(n) => n.startsWith(t) && n.includes("-out")
|
|
1413
1413
|
);
|
|
1414
1414
|
}
|
|
1415
|
-
function
|
|
1415
|
+
function Ue(e, t, n) {
|
|
1416
1416
|
e.setAttribute(`data-${t}-run`, ""), e.setAttribute(`data-${t}-${n}-run`, "");
|
|
1417
1417
|
}
|
|
1418
|
-
function
|
|
1418
|
+
function je(e, t, n) {
|
|
1419
1419
|
const s = e.style.animationName;
|
|
1420
1420
|
e.style.animationName = "none", e.removeAttribute(`data-${t}-run`), n ? e.removeAttribute(`data-${t}-${n}-run`) : (e.removeAttribute(`data-${t}-in-run`), e.removeAttribute(`data-${t}-out-run`)), e.offsetWidth, e.style.animationName = s;
|
|
1421
1421
|
}
|
|
1422
|
-
const yn = [0, 0.2],
|
|
1423
|
-
function
|
|
1424
|
-
if (
|
|
1425
|
-
|
|
1422
|
+
const yn = [0, 0.2], Ke = /* @__PURE__ */ new WeakSet();
|
|
1423
|
+
function Ge(e, t) {
|
|
1424
|
+
if (Ke.has(e)) return;
|
|
1425
|
+
Ke.add(e);
|
|
1426
1426
|
const n = (r) => {
|
|
1427
1427
|
r.target === e && (e.hasAttribute(`data-${t}-in-run`) || e.hasAttribute(`data-${t}-out-run`)) && e.setAttribute(`data-${t}-animating`, "");
|
|
1428
1428
|
}, s = (r) => {
|
|
@@ -1446,16 +1446,16 @@ function ot(e = {}) {
|
|
|
1446
1446
|
(p) => {
|
|
1447
1447
|
for (const h of p) {
|
|
1448
1448
|
const x = h.target;
|
|
1449
|
-
if (!
|
|
1449
|
+
if (!qe(x) || x.hasAttribute(`data-${t}-animating`)) continue;
|
|
1450
1450
|
const w = mn(x.classList, t);
|
|
1451
|
-
h.isIntersecting ? (w &&
|
|
1451
|
+
h.isIntersecting ? (w && je(x, t, "out"), Ue(x, t, "in"), n && l.unobserve(x)) : n || (a || je(x, t, "in"), w && Ue(x, t, "out"));
|
|
1452
1452
|
}
|
|
1453
1453
|
},
|
|
1454
1454
|
{ threshold: yn }
|
|
1455
1455
|
), o = (p) => {
|
|
1456
1456
|
const h = pn(p || document, t);
|
|
1457
1457
|
for (const x of h)
|
|
1458
|
-
r.has(x) || (r.add(x), l.observe(x),
|
|
1458
|
+
r.has(x) || (r.add(x), l.observe(x), Ge(x, t));
|
|
1459
1459
|
};
|
|
1460
1460
|
o();
|
|
1461
1461
|
let u, m = null, f = null;
|
|
@@ -1470,7 +1470,7 @@ function ot(e = {}) {
|
|
|
1470
1470
|
for (const x of h)
|
|
1471
1471
|
if (x.type === "attributes") {
|
|
1472
1472
|
const w = x.target;
|
|
1473
|
-
w instanceof HTMLElement && (We(w, t),
|
|
1473
|
+
w instanceof HTMLElement && (We(w, t), qe(w) && (r.has(w) || (r.add(w), l.observe(w), Ge(w, t))));
|
|
1474
1474
|
} else if (x.type === "childList" && x.addedNodes && x.addedNodes.length) {
|
|
1475
1475
|
for (const w of Array.from(x.addedNodes))
|
|
1476
1476
|
if (w instanceof HTMLElement) {
|
|
@@ -1541,7 +1541,10 @@ const kr = ot, Ir = ot, it = ({
|
|
|
1541
1541
|
positionTryFallbacks: "flip-block, flip-inline",
|
|
1542
1542
|
...s
|
|
1543
1543
|
};
|
|
1544
|
-
return
|
|
1544
|
+
return He(
|
|
1545
|
+
/* @__PURE__ */ d("div", { style: u, children: n }),
|
|
1546
|
+
document.body
|
|
1547
|
+
);
|
|
1545
1548
|
}
|
|
1546
1549
|
const l = {
|
|
1547
1550
|
position: "absolute",
|
|
@@ -3221,7 +3224,7 @@ const Jr = ({
|
|
|
3221
3224
|
)
|
|
3222
3225
|
}
|
|
3223
3226
|
);
|
|
3224
|
-
},
|
|
3227
|
+
}, Je = ({
|
|
3225
3228
|
variant: e = "outlined",
|
|
3226
3229
|
disabled: t = !1,
|
|
3227
3230
|
icon: n,
|
|
@@ -3438,11 +3441,11 @@ function Zn() {
|
|
|
3438
3441
|
}
|
|
3439
3442
|
return Fe(Jn);
|
|
3440
3443
|
}
|
|
3441
|
-
const Qn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
3444
|
+
const Qn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ze = { randomUUID: Qn };
|
|
3442
3445
|
function Rt(e, t, n) {
|
|
3443
3446
|
var r;
|
|
3444
|
-
if (
|
|
3445
|
-
return
|
|
3447
|
+
if (Ze.randomUUID && !e)
|
|
3448
|
+
return Ze.randomUUID();
|
|
3446
3449
|
e = e || {};
|
|
3447
3450
|
const s = e.random ?? ((r = e.rng) == null ? void 0 : r.call(e)) ?? Zn();
|
|
3448
3451
|
if (s.length < 16)
|
|
@@ -3587,7 +3590,7 @@ const Zr = ({
|
|
|
3587
3590
|
}
|
|
3588
3591
|
} : {};
|
|
3589
3592
|
return /* @__PURE__ */ d(
|
|
3590
|
-
|
|
3593
|
+
Je,
|
|
3591
3594
|
{
|
|
3592
3595
|
ref: (E) => f.current[S] = E,
|
|
3593
3596
|
label: v.label ?? "",
|
|
@@ -3632,7 +3635,7 @@ const Zr = ({
|
|
|
3632
3635
|
` })
|
|
3633
3636
|
] }),
|
|
3634
3637
|
R && /* @__PURE__ */ d(
|
|
3635
|
-
|
|
3638
|
+
Je,
|
|
3636
3639
|
{
|
|
3637
3640
|
ref: O,
|
|
3638
3641
|
className: "opacity-0",
|
|
@@ -4556,7 +4559,7 @@ const $t = ({
|
|
|
4556
4559
|
}
|
|
4557
4560
|
) })
|
|
4558
4561
|
] });
|
|
4559
|
-
return e == "modal" ?
|
|
4562
|
+
return e == "modal" ? He(x(), document.body) : x();
|
|
4560
4563
|
}, ns = ({
|
|
4561
4564
|
message: e,
|
|
4562
4565
|
className: t,
|
|
@@ -4756,7 +4759,7 @@ const $t = ({
|
|
|
4756
4759
|
]
|
|
4757
4760
|
}
|
|
4758
4761
|
);
|
|
4759
|
-
},
|
|
4762
|
+
}, ze = Ft(null), ss = ({
|
|
4760
4763
|
variant: e = "primary",
|
|
4761
4764
|
onTabSelected: t,
|
|
4762
4765
|
children: n,
|
|
@@ -4765,7 +4768,7 @@ const $t = ({
|
|
|
4765
4768
|
setSelectedTab: c,
|
|
4766
4769
|
scrollable: a = !1
|
|
4767
4770
|
}) => {
|
|
4768
|
-
const i =
|
|
4771
|
+
const i = Qe(ze), [l, o] = V(
|
|
4769
4772
|
null
|
|
4770
4773
|
);
|
|
4771
4774
|
let u;
|
|
@@ -4822,7 +4825,7 @@ const $t = ({
|
|
|
4822
4825
|
}),
|
|
4823
4826
|
[i, l, o, u]
|
|
4824
4827
|
);
|
|
4825
|
-
return /* @__PURE__ */ d(
|
|
4828
|
+
return /* @__PURE__ */ d(ze.Provider, { value: m, children: e });
|
|
4826
4829
|
}, nr = ({
|
|
4827
4830
|
children: e,
|
|
4828
4831
|
className: t,
|
|
@@ -4838,7 +4841,7 @@ const $t = ({
|
|
|
4838
4841
|
children: e,
|
|
4839
4842
|
className: t
|
|
4840
4843
|
}) => {
|
|
4841
|
-
const n =
|
|
4844
|
+
const n = Qe(ze);
|
|
4842
4845
|
if (!n)
|
|
4843
4846
|
return console.warn("TabPanels must be used within a TabGroup"), null;
|
|
4844
4847
|
const { selectedTab: s, direction: r, tabsId: c } = n, a = Q.Children.toArray(e).filter(
|
|
@@ -5210,8 +5213,8 @@ const $t = ({
|
|
|
5210
5213
|
}, P = m === "date", [X, q] = V(!1), [ee, W] = V(null), U = be(() => {
|
|
5211
5214
|
const fe = String(Y);
|
|
5212
5215
|
if (!fe) return null;
|
|
5213
|
-
const [ge,
|
|
5214
|
-
return ge &&
|
|
5216
|
+
const [ge, Te, Ve] = fe.split("-").map(Number);
|
|
5217
|
+
return ge && Te && Ve ? new Date(ge, Te - 1, Ve) : null;
|
|
5215
5218
|
}, [Y]), ie = () => {
|
|
5216
5219
|
t || (W(U), q(!0));
|
|
5217
5220
|
}, de = () => {
|
|
@@ -5738,7 +5741,7 @@ export {
|
|
|
5738
5741
|
Gr as Carousel,
|
|
5739
5742
|
Tn as CarouselItem,
|
|
5740
5743
|
Jr as Checkbox,
|
|
5741
|
-
|
|
5744
|
+
Je as Chip,
|
|
5742
5745
|
Zr as Chips,
|
|
5743
5746
|
Jt as CustomScroll,
|
|
5744
5747
|
or as DatePicker,
|
|
@@ -5785,7 +5788,7 @@ export {
|
|
|
5785
5788
|
Ar as dividerStyle,
|
|
5786
5789
|
Br as fabMenuStyle,
|
|
5787
5790
|
Fr as fabStyle,
|
|
5788
|
-
|
|
5791
|
+
Pe as getClassNames,
|
|
5789
5792
|
Hr as iconButtonStyle,
|
|
5790
5793
|
ot as initAnimateOnScroll,
|
|
5791
5794
|
ke as normalize,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnchorPositioner.d.ts","sourceRoot":"","sources":["../../../src/lib/components/AnchorPositioner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,aAAa,EACb,SAAS,EAIV,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AnchorPositioner.d.ts","sourceRoot":"","sources":["../../../src/lib/components/AnchorPositioner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,aAAa,EACb,SAAS,EAIV,MAAM,OAAO,CAAC;AAIf,MAAM,MAAM,QAAQ,GAChB,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,CAAC;AAEnB,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACzC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,GAAI,2CAK9B,qBAAqB,4CAsGvB,CAAC"}
|
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@ import React, {
|
|
|
6
6
|
useState,
|
|
7
7
|
} from 'react';
|
|
8
8
|
import { SyncedFixedWrapper } from '../effects';
|
|
9
|
+
import { createPortal } from 'react-dom';
|
|
9
10
|
|
|
10
11
|
export type Position =
|
|
11
12
|
| 'top'
|
|
@@ -76,7 +77,10 @@ export const AnchorPositioner = ({
|
|
|
76
77
|
...style,
|
|
77
78
|
} as any;
|
|
78
79
|
|
|
79
|
-
return
|
|
80
|
+
return createPortal(
|
|
81
|
+
<div style={floatingStyles}>{children}</div>,
|
|
82
|
+
document.body,
|
|
83
|
+
);
|
|
80
84
|
}
|
|
81
85
|
|
|
82
86
|
const fallbackStyles: CSSProperties = {
|