@udixio/ui-react 2.10.18 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -3
- package/dist/index.js +35 -31
- package/dist/lib/effects/generateThemeCss.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";var Dn=Object.defineProperty;var An=(e,t,n)=>t in e?Dn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var H=(e,t,n)=>An(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),o=require("react"),Ve=require("react-dom"),Y=require("motion/react"),ht=require("clsx"),Fn=require("tailwind-merge"),ge=require("@udixio/theme"),Ie=require("@udixio/tailwind"),Pn=require("react-textarea-autosize");var $e=typeof document<"u"?document.currentScript:null;const mt=({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}}},[s,r]=o.useState(!0),[c,u]=o.useState(!1),[a,d]=o.useState({x:50,y:50});o.useEffect(()=>{c&&(r(!0),r(!1))},[c]),o.useEffect(()=>{const x=t==null?void 0:t.current;if(x)return x.addEventListener("mousedown",i),x.addEventListener("mouseup",y),x.addEventListener("mouseleave",f),()=>{x.removeEventListener("mousedown",i),x.removeEventListener("mouseup",y),x.removeEventListener("mouseleave",f)}},[t]);const i=x=>{const b=t==null?void 0:t.current,g=b.getBoundingClientRect();u(!0),d({x:(x.clientX-g.left)/b.clientWidth*100,y:(x.clientY-g.top)/b.clientHeight*100})},f=x=>{u(!1)},y=x=>{u(!1)},h=`color-mix(in srgb, var(--state-color,_var(--color-${e})) 10%, transparent)`,m={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 l.jsx(Y.AnimatePresence,{mode:"wait",children:(c||!c&&!s)&&l.jsx(Y.motion.div,{style:m,variants:n,initial:"initial",animate:"animate",exit:"exit",onAnimationComplete:()=>r(!0)})})},pt=Fn.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"]}}}),p=(...e)=>pt(ht.clsx(e)),yt=(...e)=>pt(ht.clsx(e));function $n(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 De=e=>{const t={};e.classNameList.forEach(s=>{var r;if(s)if(typeof s=="string")(t[r=e.default]??(t[r]=[])).push(s);else{const c=s(e.states);Object.entries(c).map(u=>{const[a,d]=u;(t[a]??(t[a]=[])).push(d)})}});const n=t;return Object.entries(t).map(s=>{let[r,c]=s;c=c.reverse(),r==e.default&&c.unshift("relative"),c.unshift($n(r)),n[r]=yt(...c)}),n},ne=(e,t)=>n=>De({classNameList:[n.className,t],default:e,states:n}),Z=(e,t)=>n=>o.useMemo(()=>De({classNameList:[n.className,t],default:e,states:n}),[n]);function Tn(e,t,n){return o.useMemo(()=>De({classNameList:[n==null?void 0:n.className,t],default:e,states:n}),[e,t,n])}const xt=ne("customScroll",({orientation:e,draggable:t,isDragging:n})=>({customScroll:p("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:p("overflow-hidden flex-none sticky",{"left-0 h-full":e==="horizontal","top-0 w-full":e==="vertical"})}));function Wn(e,t){let n=0,s=null,r=null;const c=(u,a)=>{n=Date.now(),t(u,a)};return(u,a)=>{const d=Date.now(),i=e-(d-n);i<=0?(s&&(clearTimeout(s),s=null),c(u,a)):(r={v:u,o:a},s||(s=setTimeout(()=>{s=null;const f=r;r=null,f&&c(f.v,f.o)},i)))}}const vt=({children:e,orientation:t="vertical",scrollSize:n,onScroll:s,className:r,draggable:c=!1,throttleDuration:u=75,scroll:a,setScroll:d})=>{var G,S;const i=o.useRef(null),f=o.useRef(null),[y,h]=o.useState({width:null,height:null});o.useEffect(()=>{if(!i.current)return;const N=new ResizeObserver(D=>{for(const q of D)q.target===i.current&&h({width:q.contentRect.width,height:q.contentRect.height})});return N.observe(i.current),()=>{N.disconnect()}},[i]);const m=o.useRef(null),x=o.useRef(null),b=()=>{const N=f.current;return N?{width:n??N.scrollWidth,height:n??N.scrollHeight}:null},g=()=>{const N=i.current;return N?{width:N.clientWidth,height:N.clientHeight}:null},{scrollYProgress:j,scrollXProgress:L}=Y.useScroll({container:i}),w=o.useRef(null);w.current||(w.current=Wn(u,(N,D)=>{!x.current||!m.current||!i.current||(D===(t==="horizontal"?"x":"y")&&(d==null||d(N)),s&&(t==="horizontal"&&D==="x"&&s({scrollProgress:N,scroll:N*(m.current.width-i.current.clientWidth),scrollTotal:m.current.width-i.current.clientWidth,scrollVisible:x.current.width}),t==="vertical"&&D==="y"&&s({scrollProgress:N,scroll:N*(m.current.height-i.current.clientHeight),scrollTotal:m.current.height-i.current.clientHeight,scrollVisible:x.current.height})))}));const C=(N,D)=>{w.current&&w.current(N,D)};o.useEffect(()=>{y.width&&C(L.get(),"x"),y.height&&C(j.get(),"y")},[y]),o.useEffect(()=>{const N=i.current,D=f.current;if(!N||!D||typeof a!="number")return;const q=(U,J,te)=>Math.min(te,Math.max(J,U));if(t==="horizontal"){const U=Math.max(0,(n??D.scrollWidth)-N.clientWidth);N.scrollLeft=q(a*U,0,U)}else{const U=Math.max(0,(n??D.scrollHeight)-N.clientHeight);N.scrollTop=q(a*U,0,U)}},[a,t,n]),Y.useMotionValueEvent(L,"change",N=>{C(N,"x")}),Y.useMotionValueEvent(j,"change",N=>{C(N,"y")});const[I,v]=o.useState(!1);o.useLayoutEffect(()=>{I||!x.current||!m.current||!s||(s({scrollProgress:0,scroll:0,scrollTotal:t=="vertical"?m.current.height:m.current.width,scrollVisible:t=="vertical"?x.current.height:x.current.width}),v(!0))},[x,m,s]),m.current=b(),x.current=g();const[E,R]=o.useState(!1),M=xt({isDragging:E,children:e,className:r,onScroll:s,orientation:t,scrollSize:n,draggable:c,throttleDuration:u}),[W,k]=o.useState(0),[X,V]=o.useState(0),Q=N=>{if(!c)return;const D=i.current;if(!D||W==null)return;const U=(N.pageX-D.offsetLeft-W)*1.5;D.scrollLeft=X-U},z=N=>{const D=i.current;D&&(R(!0),k(N.pageX-D.offsetLeft),V(D.scrollLeft))},$=N=>{E&&(N.preventDefault(),Q(N))},A=()=>{R(!1)},O=()=>{R(!1)},F=N=>{N.preventDefault()},T=o.useRef(null);return o.useEffect(()=>()=>{T.current&&clearTimeout(T.current)},[]),o.useEffect(()=>{const N=i.current;if(!N)return;const D=q=>{var se,P,_,B;const U=q.detail,J=i.current;if(!J||!U)return;const te=U.orientation??t;if(typeof U.progress=="number")if(te==="horizontal"){const ee=Math.max(0,(((se=m.current)==null?void 0:se.width)??0)-J.clientWidth);J.scrollLeft=Math.min(ee,Math.max(0,U.progress*ee))}else{const ee=Math.max(0,(((P=m.current)==null?void 0:P.height)??0)-J.clientHeight);J.scrollTop=Math.min(ee,Math.max(0,U.progress*ee))}else if(typeof U.scroll=="number")if(te==="horizontal"){const ee=Math.max(0,(((_=m.current)==null?void 0:_.width)??0)-J.clientWidth);J.scrollLeft=Math.min(ee,Math.max(0,U.scroll))}else{const ee=Math.max(0,(((B=m.current)==null?void 0:B.height)??0)-J.clientHeight);J.scrollTop=Math.min(ee,Math.max(0,U.scroll))}};return N.addEventListener("udx:customScroll:set",D),()=>{N.removeEventListener("udx:customScroll:set",D)}},[t]),l.jsxs("div",{className:M.customScroll,ref:i,onMouseDown:z,onMouseMove:$,onMouseUp:A,onMouseLeave:O,onDragStart:F,onScroll:N=>{E||(k(null),R(!0),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{R(!1)},1e3))},children:[l.jsx("div",{ref:f,style:t==="vertical"?{height:((G=x==null?void 0:x.current)==null?void 0:G.height)??"100%"}:{width:((S=x==null?void 0:x.current)==null?void 0:S.width)??"100%"},className:M.track,children:e}),x.current&&m.current&&l.jsxs(l.Fragment,{children:[t==="vertical"&&m.current.height>x.current.height&&l.jsx(Y.motion.div,{className:"flex-none",style:{height:m.current.height-x.current.height}}),t==="horizontal"&&m.current.width>x.current.width&&l.jsx(Y.motion.div,{className:"flex-none",style:{width:m.current.width-x.current.width}})]})]})};var On="1.3.17";function gt(e,t,n){return Math.max(e,Math.min(t,n))}function Bn(e,t,n){return(1-n)*e+n*t}function Hn(e,t,n,s){return Bn(e,t,1-Math.exp(-n*s))}function Vn(e,t){return(e%t+t)%t}var zn=class{constructor(){H(this,"isRunning",!1);H(this,"value",0);H(this,"from",0);H(this,"to",0);H(this,"currentTime",0);H(this,"lerp");H(this,"duration");H(this,"easing");H(this,"onUpdate")}advance(e){var n;if(!this.isRunning)return;let t=!1;if(this.duration&&this.easing){this.currentTime+=e;const s=gt(0,this.currentTime/this.duration,1);t=s>=1;const r=t?1:this.easing(s);this.value=this.from+(this.to-this.from)*r}else this.lerp?(this.value=Hn(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:s,easing:r,onStart:c,onUpdate:u}){this.from=this.value=e,this.to=t,this.lerp=n,this.duration=s,this.easing=r,this.currentTime=0,this.isRunning=!0,c==null||c(),this.onUpdate=u}};function _n(e,t){let n;return function(...s){let r=this;clearTimeout(n),n=setTimeout(()=>{n=void 0,e.apply(r,s)},t)}}var Yn=class{constructor(e,t,{autoResize:n=!0,debounce:s=250}={}){H(this,"width",0);H(this,"height",0);H(this,"scrollHeight",0);H(this,"scrollWidth",0);H(this,"debouncedResize");H(this,"wrapperResizeObserver");H(this,"contentResizeObserver");H(this,"resize",()=>{this.onWrapperResize(),this.onContentResize()});H(this,"onWrapperResize",()=>{this.wrapper instanceof Window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)});H(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=_n(this.resize,s),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}}},wt=class{constructor(){H(this,"events",{})}emit(e,...t){var s;let n=this.events[e]||[];for(let r=0,c=n.length;r<c;r++)(s=n[r])==null||s.call(n,...t)}on(e,t){var n;return(n=this.events[e])!=null&&n.push(t)||(this.events[e]=[t]),()=>{var s;this.events[e]=(s=this.events[e])==null?void 0:s.filter(r=>t!==r)}}off(e,t){var n;this.events[e]=(n=this.events[e])==null?void 0:n.filter(s=>t!==s)}destroy(){this.events={}}},ot=100/6,he={passive:!1},qn=class{constructor(e,t={wheelMultiplier:1,touchMultiplier:1}){H(this,"touchStart",{x:0,y:0});H(this,"lastDelta",{x:0,y:0});H(this,"window",{width:0,height:0});H(this,"emitter",new wt);H(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})});H(this,"onTouchMove",e=>{const{clientX:t,clientY:n}=e.targetTouches?e.targetTouches[0]:e,s=-(t-this.touchStart.x)*this.options.touchMultiplier,r=-(n-this.touchStart.y)*this.options.touchMultiplier;this.touchStart.x=t,this.touchStart.y=n,this.lastDelta={x:s,y:r},this.emitter.emit("scroll",{deltaX:s,deltaY:r,event:e})});H(this,"onTouchEnd",e=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:e})});H(this,"onWheel",e=>{let{deltaX:t,deltaY:n,deltaMode:s}=e;const r=s===1?ot:s===2?this.window.width:1,c=s===1?ot:s===2?this.window.height:1;t*=r,n*=c,t*=this.options.wheelMultiplier,n*=this.options.wheelMultiplier,this.emitter.emit("scroll",{deltaX:t,deltaY:n,event:e})});H(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,he),this.element.addEventListener("touchstart",this.onTouchStart,he),this.element.addEventListener("touchmove",this.onTouchMove,he),this.element.addEventListener("touchend",this.onTouchEnd,he)}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,he),this.element.removeEventListener("touchstart",this.onTouchStart,he),this.element.removeEventListener("touchmove",this.onTouchMove,he),this.element.removeEventListener("touchend",this.onTouchEnd,he)}},it=e=>Math.min(1,1.001-Math.pow(2,-10*e)),Un=class{constructor({wrapper:e=window,content:t=document.documentElement,eventsTarget:n=e,smoothWheel:s=!0,syncTouch:r=!1,syncTouchLerp:c=.075,touchInertiaExponent:u=1.7,duration:a,easing:d,lerp:i=.1,infinite:f=!1,orientation:y="vertical",gestureOrientation:h=y==="horizontal"?"both":"vertical",touchMultiplier:m=1,wheelMultiplier:x=1,autoResize:b=!0,prevent:g,virtualScroll:j,overscroll:L=!0,autoRaf:w=!1,anchors:C=!1,autoToggle:I=!1,allowNestedScroll:v=!1,__experimental__naiveDimensions:E=!1,naiveDimensions:R=E,stopInertiaOnNavigate:M=!1}={}){H(this,"_isScrolling",!1);H(this,"_isStopped",!1);H(this,"_isLocked",!1);H(this,"_preventNextNativeScrollEvent",!1);H(this,"_resetVelocityTimeout",null);H(this,"_rafId",null);H(this,"isTouching");H(this,"time",0);H(this,"userData",{});H(this,"lastVelocity",0);H(this,"velocity",0);H(this,"direction",0);H(this,"options");H(this,"targetScroll");H(this,"animatedScroll");H(this,"animate",new zn);H(this,"emitter",new wt);H(this,"dimensions");H(this,"virtualScroll");H(this,"onScrollEnd",e=>{e instanceof CustomEvent||(this.isScrolling==="smooth"||this.isScrolling===!1)&&e.stopPropagation()});H(this,"dispatchScrollendEvent",()=>{this.options.wrapper.dispatchEvent(new CustomEvent("scrollend",{bubbles:this.options.wrapper===window,detail:{lenisScrollEnd:!0}}))});H(this,"onTransitionEnd",e=>{e.propertyName.includes("overflow")&&this.checkOverflow()});H(this,"onClick",e=>{const n=e.composedPath().filter(s=>s instanceof HTMLAnchorElement&&s.getAttribute("href"));if(this.options.anchors){const s=n.find(r=>{var c;return(c=r.getAttribute("href"))==null?void 0:c.includes("#")});if(s){const r=s.getAttribute("href");if(r){const c=typeof this.options.anchors=="object"&&this.options.anchors?this.options.anchors:void 0,u=`#${r.split("#")[1]}`;this.scrollTo(u,c)}}}this.options.stopInertiaOnNavigate&&n.find(r=>r.host===window.location.host)&&this.reset()});H(this,"onPointerDown",e=>{e.button===1&&this.reset()});H(this,"onVirtualScroll",e=>{if(typeof this.options.virtualScroll=="function"&&this.options.virtualScroll(e)===!1)return;const{deltaX:t,deltaY:n,event:s}=e;if(this.emitter.emit("virtual-scroll",{deltaX:t,deltaY:n,event:s}),s.ctrlKey||s.lenisStopPropagation)return;const r=s.type.includes("touch"),c=s.type.includes("wheel");this.isTouching=s.type==="touchstart"||s.type==="touchmove";const u=t===0&&n===0;if(this.options.syncTouch&&r&&s.type==="touchstart"&&u&&!this.isStopped&&!this.isLocked){this.reset();return}const d=this.options.gestureOrientation==="vertical"&&n===0||this.options.gestureOrientation==="horizontal"&&t===0;if(u||d)return;let i=s.composedPath();i=i.slice(0,i.indexOf(this.rootElement));const f=this.options.prevent;if(i.find(g=>{var j,L,w;return g instanceof HTMLElement&&(typeof f=="function"&&(f==null?void 0:f(g))||((j=g.hasAttribute)==null?void 0:j.call(g,"data-lenis-prevent"))||r&&((L=g.hasAttribute)==null?void 0:L.call(g,"data-lenis-prevent-touch"))||c&&((w=g.hasAttribute)==null?void 0:w.call(g,"data-lenis-prevent-wheel"))||this.options.allowNestedScroll&&this.checkNestedScroll(g,{deltaX:t,deltaY:n}))}))return;if(this.isStopped||this.isLocked){s.cancelable&&s.preventDefault();return}if(!(this.options.syncTouch&&r||this.options.smoothWheel&&c)){this.isScrolling="native",this.animate.stop(),s.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))&&(s.lenisStopPropagation=!0),s.cancelable&&s.preventDefault();const m=r&&this.options.syncTouch,b=r&&s.type==="touchend";b&&(h=Math.sign(this.velocity)*Math.pow(Math.abs(this.velocity),this.options.touchInertiaExponent)),this.scrollTo(this.targetScroll+h,{programmatic:!1,...m?{lerp:b?this.options.syncTouchLerp:1}:{lerp:this.options.lerp,duration:this.options.duration,easing:this.options.easing}})});H(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))}});H(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=On,(!e||e===document.documentElement)&&(e=window),typeof a=="number"&&typeof d!="function"?d=it:typeof d=="function"&&typeof a!="number"&&(a=1),this.options={wrapper:e,content:t,eventsTarget:n,smoothWheel:s,syncTouch:r,syncTouchLerp:c,touchInertiaExponent:u,duration:a,easing:d,lerp:i,infinite:f,gestureOrientation:h,orientation:y,touchMultiplier:m,wheelMultiplier:x,autoResize:b,prevent:g,virtualScroll:j,overscroll:L,autoRaf:w,anchors:C,autoToggle:I,allowNestedScroll:v,naiveDimensions:R,stopInertiaOnNavigate:M},this.dimensions=new Yn(e,t,{autoResize:b}),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 qn(n,{touchMultiplier:m,wheelMultiplier:x}),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:s=!1,programmatic:r=!0,lerp:c=r?this.options.lerp:void 0,duration:u=r?this.options.duration:void 0,easing:a=r?this.options.easing:void 0,onStart:d,onComplete:i,force:f=!1,userData:y}={}){if(!((this.isStopped||this.isLocked)&&!f)){if(typeof e=="string"&&["top","left","start","#"].includes(e))e=0;else if(typeof e=="string"&&["bottom","right","end"].includes(e))e=this.limit;else{let h;if(typeof e=="string"?(h=document.querySelector(e),h||(e==="#top"?e=0:console.warn("Lenis: Target not found",e))):e instanceof HTMLElement&&(e!=null&&e.nodeType)&&(h=e),h){if(this.options.wrapper!==window){const x=this.rootElement.getBoundingClientRect();t-=this.isHorizontal?x.left:x.top}const m=h.getBoundingClientRect();e=(this.isHorizontal?m.left:m.top)+this.animatedScroll}}if(typeof e=="number"){if(e+=t,e=Math.round(e),this.options.infinite){if(r){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=gt(0,e,this.limit);if(e===this.targetScroll){d==null||d(this),i==null||i(this);return}if(this.userData=y??{},n){this.animatedScroll=this.targetScroll=e,this.setScroll(this.scroll),this.reset(),this.preventNextNativeScrollEvent(),this.emit(),i==null||i(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()});return}r||(this.targetScroll=e),typeof u=="number"&&typeof a!="function"?a=it:typeof a=="function"&&typeof u!="number"&&(u=1),this.animate.fromTo(this.animatedScroll,e,{duration:u,easing:a,lerp:c,onStart:()=>{s&&(this.isLocked=!0),this.isScrolling="smooth",d==null||d(this)},onUpdate:(h,m)=>{this.isScrolling="smooth",this.lastVelocity=this.velocity,this.velocity=h-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=h,this.setScroll(this.scroll),r&&(this.targetScroll=h),m||this.emit(),m&&(this.reset(),this.emit(),i==null||i(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()}),this.preventNextNativeScrollEvent())}})}}}preventNextNativeScrollEvent(){this._preventNextNativeScrollEvent=!0,requestAnimationFrame(()=>{this._preventNextNativeScrollEvent=!1})}checkNestedScroll(e,{deltaX:t,deltaY:n}){const s=Date.now(),r=e._lenis??(e._lenis={});let c,u,a,d,i,f,y,h;const m=this.options.gestureOrientation;if(s-(r.time??0)>2e3){r.time=Date.now();const I=window.getComputedStyle(e);r.computedStyle=I;const v=I.overflowX,E=I.overflowY;if(c=["auto","overlay","scroll"].includes(v),u=["auto","overlay","scroll"].includes(E),r.hasOverflowX=c,r.hasOverflowY=u,!c&&!u||m==="vertical"&&!u||m==="horizontal"&&!c)return!1;i=e.scrollWidth,f=e.scrollHeight,y=e.clientWidth,h=e.clientHeight,a=i>y,d=f>h,r.isScrollableX=a,r.isScrollableY=d,r.scrollWidth=i,r.scrollHeight=f,r.clientWidth=y,r.clientHeight=h}else a=r.isScrollableX,d=r.isScrollableY,c=r.hasOverflowX,u=r.hasOverflowY,i=r.scrollWidth,f=r.scrollHeight,y=r.clientWidth,h=r.clientHeight;if(!c&&!u||!a&&!d||m==="vertical"&&(!u||!d)||m==="horizontal"&&(!c||!a))return!1;let x;if(m==="horizontal")x="x";else if(m==="vertical")x="y";else{const I=t!==0,v=n!==0;I&&c&&a&&(x="x"),v&&u&&d&&(x="y")}if(!x)return!1;let b,g,j,L,w;if(x==="x")b=e.scrollLeft,g=i-y,j=t,L=c,w=a;else if(x==="y")b=e.scrollTop,g=f-h,j=n,L=u,w=d;else return!1;return(j>0?b<g:b>0)&&L&&w}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?Vn(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 Xn=({transition:e=1.2,easing:t,orientation:n="vertical",smoothTouch:s=!1,touchMultiplier:r=2,children:c})=>{const u=o.useRef(null),a=o.useRef(null);return o.useEffect(()=>{let d;typeof e=="string"?e.endsWith("ms")?d=parseFloat(e)/1e3:e.endsWith("s")?d=parseFloat(e):d=parseFloat(e)||1.2:d=e;const i=y=>1-Math.pow(1-y,5);u.current=new Un({duration:d,easing:t??i,orientation:n,smoothWheel:!0,touchMultiplier:r,syncTouch:s});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,s,r]),c?l.jsx(l.Fragment,{children:c}):null},ue=({style:e,colorName:t,stateClassName:n="state-ripple-group",children:s,className:r})=>{const c=o.useRef(null),u=o.useRef(null),[a,d]=o.useState(!1),i=bt({isClient:a,stateClassName:n,className:r,colorName:t});return o.useEffect(()=>{if(c.current&&n!=="state-layer"){const y=(n.includes("[")?"group/"+n.split("[")[1].split("]")[0]:"group").replace(/\//g,"\\/"),h=c.current.closest(`.${y}:not(.${y} .${y})`);u.current=h}d(!0)},[]),l.jsxs("div",{ref:c,className:i.stateLayer,style:{"--state-color":`var(--default-color, var(--color-${t}))`,...e},children:[a&&l.jsx(mt,{triggerRef:u}),s]})},Gn=({isClient:e,stateClassName:t})=>({stateLayer:p(["w-full top-0 left-0 h-full absolute pointer-events-none overflow-hidden",t])}),bt=Z("stateLayer",Gn),St=({targetRef:e,children:t})=>{const[n,s]=o.useState(null),r=o.useRef(null),c=()=>{const u=e.current;if(!u)return;const a=u.getBoundingClientRect();s({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 c(),window.addEventListener("scroll",c,!0),window.addEventListener("resize",c),r.current=new ResizeObserver(c),r.current.observe(u),()=>{var a;window.removeEventListener("scroll",c,!0),window.removeEventListener("resize",c),(a=r.current)==null||a.disconnect()}},[e]),n?Ve.createPortal(l.jsx("div",{style:n,children:t}),document.body):null};function Kn(e){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e)}const Jn=({config:e,throttleDelay:t=100,onLoad:n,loadTheme:s=!1,initialCss:r})=>{const[c,u]=o.useState(null),[a,d]=o.useState(r??null),i=o.useRef(null),f=o.useRef(0),y=o.useRef(0),h=o.useRef(null),m=o.useRef(!1),x=o.useRef(n);o.useEffect(()=>{x.current=n},[n]),o.useEffect(()=>{let w=!1;return(async()=>{const C=await ge.loader(e,s);if(w)return;h.current=C,u(C);const I=new Worker(new URL(""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/theme.worker.js").href:new URL("theme.worker.js",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),typeof document>"u"?require("url").pathToFileURL(__filename).href:$e&&$e.tagName.toUpperCase()==="SCRIPT"&&$e.src||new URL("index.cjs",document.baseURI).href),{type:"module"});i.current=I,I.onmessage=v=>{var E;v.data.id>y.current&&(y.current=v.data.id,m.current=!0,d(v.data.css),(E=x.current)==null||E.call(x,h.current))}})(),()=>{var C;w=!0,(C=i.current)==null||C.terminate(),i.current=null}},[]);const b=o.useRef(null),g=o.useRef(0),j=o.useRef(null);o.useEffect(()=>{if(!c)return;const w={...e,sourceColor:e.sourceColor},C=Date.now(),I=C-g.current,v=async E=>{await L(E)};if(g.current===0||I>=t)b.current&&(clearTimeout(b.current),b.current=null),j.current=null,g.current=C,v(w);else if(j.current=w,!b.current){const E=Math.max(0,t-I);b.current=setTimeout(async()=>{b.current=null;const R=j.current;j.current=null,R&&(g.current=Date.now(),await v(R))},E)}return()=>{}},[e,t,c]);const L=async w=>{if(typeof w.sourceColor=="string"&&!Kn(w.sourceColor))throw new Error("Invalid hex color");const C=h.current;if(!C)return;C.context.update(w),C.palettes.sync(w.palettes);const I=i.current;if(!I||!m.current){await C.load();const E=C.plugins.getPlugin(Ie.TailwindPlugin).getInstance().outputCss;d(E),m.current=!0,n==null||n(C);return}const v=++f.current;I.postMessage({id:v,snapshot:ge.serializeThemeContext(C),tailwindOptions:C.plugins.getPlugin(Ie.TailwindPlugin).toSerializable(),fontOptions:C.plugins.getPlugin(ge.FontPlugin).toSerializable()})};return o.useEffect(()=>()=>{b.current&&(clearTimeout(b.current),b.current=null)},[]),a?l.jsx("style",{dangerouslySetInnerHTML:{__html:a}}):null};async function Zn(e,t){const n=await ge.loader(e,!1);return await(t==null?void 0:t(n)),await n.load(),n.plugins.getPlugin(Ie.TailwindPlugin).getInstance().outputCss}function Qn(){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 es(){return typeof window>"u"||!("matchMedia"in window)?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function ze(e){if(!(e instanceof HTMLElement))return!1;const t=e.classList;return Array.from(t).some(n=>n.startsWith("anim-")&&n.includes("scroll"))}function lt(e){if(!(e instanceof HTMLElement))return!1;const t=e.classList;return Array.from(t).some(n=>n.startsWith("anim-"))}function Te(e,t){if(!ze(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 s=e.getAttribute(`data-${t}-end`);s&&e.style.setProperty(`--${t}-range-end`,s);const r=e.hasAttribute(`data-${t}-paused`)||e.classList.contains(`${t}-paused`),c=e.hasAttribute(`data-${t}-run`)||e.classList.contains(`${t}-run`);!r&&!c&&e.setAttribute(`data-${t}-run`,"")}function We(e=document,t){return Array.from(e.querySelectorAll(`[class*="${t}-"][class*="-scroll"]`)).filter(s=>ze(s))}function ts(e=document,t){const n=Array.from(e.querySelectorAll(`[class*="${t}-"]`)),s=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(r=>{if(!(r instanceof HTMLElement))return!1;const c=r.classList;return c.contains(`${t}-in`)||c.contains(`${t}-out`)||Array.from(c).some(d=>d.startsWith(`${t}-`)&&!d.includes("scroll")&&!s.has(d))?!0:!ze(r)})}function ns(e,t){return Array.from(e).some(n=>n.startsWith(t)&&n.includes("-out"))}function at(e,t,n){e.setAttribute(`data-${t}-run`,""),e.setAttribute(`data-${t}-${n}-run`,"")}function ct(e,t,n){const s=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=s}const ss=[0,.2],ut=new WeakSet;function dt(e,t){if(ut.has(e))return;ut.add(e);const n=r=>{r.target===e&&(e.hasAttribute(`data-${t}-in-run`)||e.hasAttribute(`data-${t}-out-run`))&&e.setAttribute(`data-${t}-animating`,"")},s=r=>{r.target===e&&e.removeAttribute(`data-${t}-animating`)};e.addEventListener("animationstart",n),e.addEventListener("animationend",s),e.addEventListener("animationcancel",s)}function _e(e={}){const{prefix:t="anim",once:n=!0}=e;if(es())return()=>{};const s=Qn(),r=new WeakSet;let c=typeof window<"u"&&(window.pageYOffset||window.scrollY)||0,u=!0;const a=()=>{const m=window.pageYOffset||window.scrollY||0;u=m>=c,c=m};typeof window<"u"&&window.addEventListener("scroll",a,{passive:!0});const d=new IntersectionObserver(m=>{for(const x of m){const b=x.target;if(!lt(b)||b.hasAttribute(`data-${t}-animating`))continue;const g=ns(b.classList,t);x.isIntersecting?(g&&ct(b,t,"out"),at(b,t,"in"),n&&d.unobserve(b)):n||(u||ct(b,t,"in"),g&&at(b,t,"out"))}},{threshold:ss}),i=m=>{const x=ts(m||document,t);for(const b of x)r.has(b)||(r.add(b),d.observe(b),dt(b,t))};i();let f,y=null,h=null;if(s)(()=>{h==null&&(h=requestAnimationFrame(()=>{h=null;const x=We(void 0,t);for(const b of x)Te(b,t)}))})(),y=new MutationObserver(x=>{for(const b of x)if(b.type==="attributes"){const g=b.target;g instanceof HTMLElement&&(Te(g,t),lt(g)&&(r.has(g)||(r.add(g),d.observe(g),dt(g,t))))}else if(b.type==="childList"&&b.addedNodes&&b.addedNodes.length){for(const g of Array.from(b.addedNodes))if(g instanceof HTMLElement){const j=We(g,t);for(const L of j)Te(L,t);i(g)}}}),y.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["class",`data-${t}-scroll`,`data-${t}-start`,`data-${t}-end`,`data-${t}-paused`,`data-${t}-run`]}),f=()=>{h!=null&&cancelAnimationFrame(h),y&&y.disconnect()};else{let m;We(void 0,t).length>0&&Promise.resolve().then(()=>require("./scrollDriven.js")).then(b=>{m=b.initScrollViewFallback({once:n})}),f=()=>{typeof m=="function"&&m()}}return()=>{f&&f(),typeof window<"u"&&window.removeEventListener("scroll",a),d.disconnect()}}const rs=_e,os=_e,be=({anchorRef:e,position:t="bottom",children:n,style:s,...r})=>{const u=`--anchor-${o.useId().replace(/:/g,"")}`,[a,d]=o.useState(!1);if(o.useLayoutEffect(()=>{typeof CSS<"u"&&CSS.supports("anchor-name","--a")&&d(!0)},[]),o.useLayoutEffect(()=>{if(a&&e.current){const f=e.current;return f.style.anchorName=u,()=>{e.current&&(e.current.style.anchorName="")}}},[a,e,u]),a){const f={position:"fixed",margin:0,zIndex:9999,positionAnchor:u,positionArea:t,positionTryFallbacks:"flip-block, flip-inline",...s};return Ve.createPortal(l.jsx("div",{style:f,...r,children:n}),document.body)}const i={position:"absolute",pointerEvents:"auto",...s};switch(t){case"top":i.bottom="100%",i.left="50%",i.transform="translateX(-50%)";break;case"top-left":i.bottom="100%",i.left=0;break;case"top-right":i.bottom="100%",i.right=0;break;case"bottom":i.top="100%",i.left="50%",i.transform="translateX(-50%)";break;case"bottom-left":i.top="100%",i.left=0;break;case"bottom-right":i.top="100%",i.right=0;break;case"left":i.right="100%",i.top="50%",i.transform="translateY(-50%)";break;case"right":i.left="100%",i.top="50%",i.transform="translateY(-50%)";break}return l.jsx(St,{targetRef:e,children:l.jsx("div",{style:i,...r,children:n})})},Et=({variant:e,disableTextMargins:t,disabled:n,iconPosition:s,icon:r,isActive:c,loading:u,shape:a,onToggle:d,size:i,allowShapeTransformation:f})=>({button:p(" relative cursor-pointer group/button outline-none inline-block flex w-fit 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&&c)&&{"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&&!c,"bg-primary text-on-primary":!n&&c,"text-on-surface/[38%]":n},e==="filled"&&{"hover:shadow-1":!n,"bg-surface-container text-on-surface-variant":!n&&!c&&d,"bg-primary text-on-primary":!n&&(c&&d||!d),"text-on-surface/[38%]":n},e==="tonal"&&{"hover:shadow-1":!n,"bg-secondary-container text-on-secondary-container":!n&&!c,"bg-secondary text-on-secondary":!n&&c,"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&&!c,"text-inverse-on-surface bg-inverse-surface border-inverse-surface":!n&&c}],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:p("absolute -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/2 h-12 w-full"),stateLayer:p("overflow-hidden",a==="rounded"&&{"rounded-[30px]":i==="xSmall"||i=="small","rounded-[40px]":i==="medium","rounded-[70px]":i==="large"||i=="xLarge"},(a==="squared"||f&&c)&&{"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:p({invisible:u}),icon:p({invisible:u},i==="xSmall"&&"size-5",i==="small"&&"size-5",i==="medium"&&"size-6",i==="large"&&"size-8",i==="xLarge"&&"size-10")}),is=ne("button",Et),Nt=Z("button",Et),kt=({variant:e,interactive:t})=>({card:p(" 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 cursor-pointer":t})}),ls=ne("card",kt),jt=Z("card",kt),Ye=()=>({carouselItem:p("rounded-[28px] overflow-hidden flex-none",{})}),as=ne("carouselItem",Ye),Lt=Z("carouselItem",Ye),Mt=()=>({carousel:p(["w-full h-[400px]"]),track:p("flex h-full w-full")}),cs=ne("carousel",Mt),It=Z("carousel",Mt),Ct=({isChecked:e,isIndeterminate:t,isDisabled:n,isError:s,isFocused:r,isHovered:c})=>({checkbox:p("inline-flex items-center justify-center relative size-4.5 ",{"pointer-events-none opacity-[0.38]":n}),input:p("absolute inset-0 w-full h-full opacity-0 z-10 cursor-pointer"),container:p("relative flex items-center justify-center w-[18px] h-[18px] "),box:p("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":!s&&!n,"border-error":s&&!n,"border-on-surface":n},(e||t)&&{"bg-primary border-primary":!s&&!n,"bg-error border-error":s&&!n,"bg-on-surface border-on-surface":n}),icon:p("z-10 relative text-on-primary w-full h-full flex items-center justify-center pointer-events-none",{"text-on-error":s&&!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"}),us=ne("checkbox",Ct),Rt=Z("checkbox",Ct),Dt=({variant:e,disabled:t,trailingIcon:n,icon:s,isActive:r,isInteractive:c,activated:u,isFocused:a,isDragging:d,isEditing:i})=>({chip:p(" group/chip px-3 py-1.5 rounded-lg flex items-center gap-2 outline-none",{"pl-2":s,"pr-2":n,"cursor-pointer":!t&&c},{" text-on-surface-variant":!u&&!a||i,"bg-secondary-container text-on-secondary-container":(u||a)&&!i},d&&["opacity-100 cursor-grabbing shadow-3"],e==="outlined"&&["border border-outline-variant",{"border-transparent":i}],e==="elevated"&&!i&&["shadow-1 bg-surface-container-low","border border-outline-variant"]),stateLayer:p("rounded-lg overflow-hidden",{}),label:p("outline-none text-nowrap",{"opacity-[0.38]":t}),leadingIcon:p("text-primary size-[18px]",{"opacity-[0.38]":t}),trailingIcon:p("cursor-pointer size-[18px]",{"opacity-[0.38]":t})}),ds=ne("chip",Dt),At=Z("chip",Dt),Ft=({scrollable:e})=>({chips:p(" flex gap-3 outline-none",{"flex-wrap":!e,"overflow-x-auto":e})}),fs=ne("chips",Ft),Pt=Z("chips",Ft),$t=({orientation:e})=>({divider:p("border-outline-variant ",{"h-fit w-full border-t":e==="horizontal"},{"h-auto self-stretch w-fit border-l":e==="vertical"})}),hs=ne("divider",$t),Tt=Z("divider",$t),Wt=({size:e,variant:t,extended:n})=>({fab:p("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:p({"size-6":e=="small"||e=="medium","size-9":e=="large"}),label:p("text-nowrap",{"text-title-medium":e=="small","text-title-large":e=="medium","text-headline-small":e=="large"})}),ms=ne("fab",Wt),Ot=Z("fab",Wt),Bt=({size:e,variant:t,open:n})=>({fabMenu:p("relative inline-flex flex-col items-end"),actions:p("flex flex-col gap-1 items-end absolute bottom-[calc(100%_+_8px)] right-0"),label:p("text-nowrap")}),ps=ne("fabMenu",Bt),Ht=Z("fabMenu",Bt),Vt=({variant:e,disabled:t,onToggle:n,isActive:s,size:r,width:c,shape:u,allowShapeTransformation:a})=>({iconButton:p("rounded-full relative flex transition-all duration-300","group/icon-button cursor-pointer",{"cursor-default":t},u==="rounded"&&{"rounded-[30px]":r==="xSmall"||r=="small","rounded-[40px]":r==="medium","rounded-[70px]":r==="large"||r=="xLarge"},(u==="squared"||a&&s)&&{"rounded-[12px]":r==="xSmall"||r=="small","rounded-[16px]":r==="medium","rounded-[28px]":r==="large"||r=="xLarge"},a&&!t&&{"active:rounded-[12px]":r==="xSmall"||r=="small","active:rounded-[16px]":r==="medium","active:rounded-[28px]":r==="large"||r=="xLarge"},e==="filled"&&[!t&&{"bg-surface-container":!s&&!!n,"bg-primary":s||!n},!!t&&"bg-on-surface/[0.12]"],e==="tonal"&&[!t&&{"bg-secondary-container text-on-secondary-container":!s&&!!n,"bg-secondary text-on-secondary":s||!n},!!t&&"bg-on-surface/[0.12]"],e==="outlined"&&[!t&&{"border border-outline":!s,"border border-transparent bg-inverse-surface":s},!!t&&{"border border-on-surface/[0.12]":!s,"border border-transparent bg-on-surface/[0.12]":s}]),touchTarget:p("absolute -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/2 h-12 w-full"),stateLayer:p("absolute top-0 left-0 h-full w-full overflow-hidden",(u==="rounded"||u==="squared"&&n&&!t&&s&&a)&&{"rounded-[30px]":r==="xSmall"||r=="small","rounded-[40px]":r==="medium","rounded-[70px]":r==="large"||r=="xLarge"},(u==="squared"||u==="rounded"&&n&&!t&&s&&a)&&{"rounded-[12px]":r==="xSmall"||r=="small","rounded-[16px]":r==="medium","rounded-[28px]":r==="large"||r=="xLarge"},a&&!t&&{"group-active/icon-button:rounded-[12px]":r==="xSmall"||r=="small","group-active/icon-button:rounded-[16px]":r==="medium","group-active/icon-button:rounded-[28px]":r==="large"||r=="xLarge"},!t&&[e==="standard"&&{"state-on-surface-variant":!s,"state-primary":s},e==="filled"&&{"state-primary":!s&&!!n,"state-inverse-on-surface":s||!n},e==="tonal"&&{"state-on-surface-variant":!s&&!!n,"state-on-secondary-container":s||!n},e==="outlined"&&{"state-on-surface-variant":!s,"state-on-primary":s}]),icon:p(" transition-all duration-300",{"size-5 p-1.5":r==="xSmall"},{"size-6 p-2":r==="small"},{"size-6 p-4":r==="medium"},{"size-8 p-8":r==="large"},{"size-10 p-12":r==="xLarge"},c=="narrow"&&[{"px-1":r==="xSmall"},{"px-1":r==="small"},{"px-3":r==="medium"},{"px-4":r==="large"},{"px-8":r==="xLarge"}],c=="wide"&&[{"px-2.5":r==="xSmall"},{"px-3.5":r==="small"},{"px-6":r==="medium"},{"px-12":r==="large"},{"px-[72px]":r==="xLarge"}],!t&&[e==="standard"&&{"text-on-surface-variant":!s,"text-primary":s},e==="filled"&&{"text-primary":!s&&!!n,"text-on-primary":s||!n},e==="outlined"&&{"text-on-surface-variant":!s,"text-inverse-on-surface":s}],!!t&&"text-on-surface/[0.38]")}),ys=ne("iconButton",Vt),zt=Z("iconButton",Vt),_t=({variant:e,hasGroups:t})=>({menu:p("z-50 min-w-[112px] max-w-[280px] max-h-[300px] ","flex flex-col",{"overflow-y-auto":!t},{"bg-surface-container":!e||e==="standard","bg-tertiary-container text-on-tertiary-container":e==="vibrant","py-0.5 shadow-2 px-1 rounded-2xl":!t,"bg-transparent ":t})}),xs=ne("menu",_t),Yt=Z("menu",_t),qt=({variant:e})=>({menuGroup:p("flex flex-col gap-0.5 mb-0.5 last:mb-0","rounded-lg py-0.5 px-1 shadow-2 first:rounded-t-2xl last:rounded-b-2xl",{"bg-surface-container":e==="standard","bg-tertiary-container text-on-tertiary-container":e==="vibrant"}),groupLabel:p("px-3 pt-2 text-label-small tracking-wide ",{"text-on-surface-variant":e==="standard","text-on-tertiary-container opacity-80":e==="vibrant"})}),vs=ne("menuGroup",qt),Ut=Z("menuGroup",qt),Xt=({variant:e,isVisible:t})=>({progressIndicator:p((e==="linear-determinate"||e=="linear-indeterminate")&&"flex w-full h-1",e==="linear-indeterminate"&&"relative overflow-hidden rounded-full"),firstTrack:p((e==="linear-determinate"||e==="linear-indeterminate")&&"h-full rounded-full bg-primary-container",{"max-h-0":!t,"max-h-full":t}),activeIndicator:p("h-full rounded-full bg-primary",e==="linear-determinate"&&{"rounded-l-full":!0},(e==="linear-indeterminate"||e==="linear-determinate")&&{"max-h-0":!t,"max-h-full":t},(e==="circular-determinate"||e=="circular-indeterminate")&&["stroke-primary fill-transparent ",{"stroke-[4px]":t,"stroke-[0px]":!t}]),lastTrack:p((e==="linear-determinate"||e=="linear-indeterminate")&&"h-full flex-1 rounded-full bg-primary-container",{"max-h-0":!t,"max-h-full":t}),stop:p("absolute top-1/2 -translate-y-1/2 right-0 bg-primary rounded-full size-1",{"max-h-0":!t,"max-h-full":t})}),gs=ne("progressIndicator",Xt),Gt=Z("progressIndicator",Xt),qe=({variant:e,position:t})=>({sideSheet:p("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:p("w-full overflow-hidden flex flex-col",{}),header:p("p-4 flex items-center gap-2"),content:p("flex-1 overflow-y-auto"),title:p("text-on-surface-variant text-title-large"),closeButton:p("ml-auto"),divider:p({hidden:e=="modal"}),overlay:p("bg-[black]/[0.32] fixed top-0 left-0 w-screen h-screen")}),Kt=ne("sideSheet",qe),ws=Z("sideSheet",qe),Ue=({isChanging:e})=>({slider:p(["relative w-full h-11 flex items-center rounded gap-x-1.5 cursor-pointer min-w-32"]),activeTrack:p(["h-4 relative transition-all duration-100 bg-primary overflow-hidden rounded-l-full "]),inactiveTrack:p(["h-4 relative transition-all duration-100 bg-primary-container rounded-r-full overflow-hidden"]),handle:p(["transform relative transition-all duration-100 bg-primary h-full rounded-full ",{"w-0.5":e,"w-1":!e}]),valueIndicator:p(["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:p(["h-1 w-1 absolute transform -translate-y-1/2 -translate-x-1/2 top-1/2 rounded-full"])}),bs=ne("slider",Ue),Jt=Z("slider",Ue),Zt=()=>({snackbar:p(" rounded bg-inverse-surface "),container:p("pl-4 pr-2 max-w-full py-1 flex items-center flex-wrap"),supportingText:p("text-body-medium text-inverse-on-surface "),icon:p(" ml-auto mr-0 text-inverse-on-surface block dark")}),Ss=ne("snackbar",Zt),Qt=Z("snackbar",Zt),en=({isSelected:e,disabled:t,inactiveIcon:n})=>({switch:p("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:p("flex items-center justify-center absolute",{"left-[14px]":!e},{"right-[14px]":e}),handle:p("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:p("w-[40px] h-[40px] -z-10 rounded-full absolute",{"group-state-primary":!t}),icon:p("w-[16px] h-[16px]",!t&&[{"text-on-primary-container":e},{"text-on-primary":!e}],{"text-on-surface/[0.38]":t})}),Es=ne("switch",en),tn=Z("switch",en),nn=({isSelected:e,icon:t,label:n,variant:s})=>({tab:p("flex-1 group/tab outline-none flex px-4 justify-center items-center cursor-pointer",{"z-10":e},!!(t&&n)&&s==="primary"&&"h-16",!(t&&n&&s==="primary")&&"h-12"),stateLayer:p("absolute w-full h-full overflow-hidden left-1/2 top-1/2 transform -translate-y-1/2 -translate-x-1/2",s==="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},s==="secondary"&&"group-hover/tab:hover-state-on-surface group-focus-visible/tab:focus-state-on-surface"),content:p("flex gap-0.5 h-full justify-center",{relative:s=="primary"},{"":!!(n&&!t)},s==="primary"&&"flex-col items-center",s==="secondary"&&{"flex-col items-center":!(n&&t),"flex-row items-center gap-2":!!(n&&t)}),icon:p("h-6 w-6 p-0.5 !box-border",s==="primary"&&{"text-on-surface-variant":!e,"text-primary":e},s==="secondary"&&{"text-on-surface-variant":!e,"text-on-surface":e}),label:p("text-title-small text-nowrap",s==="primary"&&{"text-on-surface-variant":!e,"text-primary":e},s==="secondary"&&{"text-on-surface-variant":!e,"text-on-surface":e}),underline:p("bg-primary absolute w-full left-0 bottom-0",s==="primary"&&"h-[3px] rounded-t",s==="secondary"&&"h-0.5")}),Ns=ne("tab",nn),sn=Z("tab",nn),rn=({scrollable:e})=>({tabs:p("border-b border-surface-container-highest bg-surface","flex relative ",{"overflow-x-auto":e})}),ks=ne("tabs",rn),on=Z("tabs",rn),ln=()=>({tabPanels:p("overflow-hidden")}),js=ne("tabPanels",ln),an=Z("tabPanels",ln),cn=()=>({tabPanel:p("")}),Ls=ne("tabPanel",cn),un=Z("tabPanel",cn),dn=({disabled:e,leadingIcon:t,trailingIcon:n,variant:s,errorText:r,isFocused:c,value:u,suffix:a,multiline:d})=>({textField:p({"opacity-[.38]":e}),content:p("group/text-field transition-border duration-200 relative flex items-center ",{"h-14":!d},{"border-on-surface-variant":!(r!=null&&r.length)&&!c&&s=="filled","border-outline":!(r!=null&&r.length)&&!c&&s=="outlined","border-primary":!(r!=null&&r.length)&&c,"border-error":!!(r!=null&&r.length)},{"bg-on-surface/[0.04]":e},s=="filled"&&["rounded-t overflow-hidden border-b",{"bg-surface-container-highest":!e}],s=="outlined"&&["border rounded box-border",{"border-[3px]":c}]),stateLayer:p("absolute -z-10 w-full h-full top-0 left-0",{hidden:s=="outlined"},{"group-state-on-surface":!e,"focus-state-on-surface":c}),label:p("inline-flex outline-none whitespace-nowrap",{"text-on-surface-variant":!e&&!(r!=null&&r.length)},{"text-on-surface":e},{"text-error":!!(r!=null&&r.length)},{"text-primary":!(r!=null&&r.length)&&c}),input:p("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},s=="filled"&&" pb-2 pt-6",s=="outlined"&&"py-4 relative z-10"),activeIndicator:p("absolute w-0 inset-x-0 border-rounded mx-auto bottom-0",s=="filled"&&["h-[2px] transition-all duration-300",{"bg-primary":!(r!=null&&r.length)},{"bg-error":!!(r!=null&&r.length)},{"!w-full":c}]),supportingText:p(" text-body-small px-4 pt-1",{"text-on-surface-variant":!e&&!(r!=null&&r.length)},{"text-on-surface":e},{"!w-full":c},{"text-error":!!(r!=null&&r.length)}),leadingIcon:p(["h-12 ml-3 flex items-center justify-center",{"cursor-text":!o.isValidElement(t)}]),trailingIcon:p("h-12 w-12 flex items-center justify-center",{"cursor-text":!o.isValidElement(n)}),suffix:p("text-on-surface-variant pl-0 pr-4",s=="filled"&&" pb-2 pt-6",s=="outlined"&&"py-4 relative z-10")}),Ms=ne("textField",dn),fn=Z("textField",dn),hn=({position:e,variant:t})=>({toolTip:p(" 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:p("pb-2",t=="rich"&&"px-4 pt-3 ",t=="plain"&&"px-2 py-1"),actions:p("flex gap-10 px-1 mt-2",t=="plain"&&"hidden"),subHead:p("text-title-small mb-1",t=="plain"&&"hidden"),supportingText:p(""),content:p("w-full")}),Is=ne("toolTip",hn),mn=Z("toolTip",hn),le=({icon:e,colors:t=[],className:n,...s})=>{if(typeof e=="string"){let f=e,y="";return t[0]&&(y=` fill="${t[0]}" color="${t[0]}"`,f=f.replace(/<path([^>]*?)>/g,'<path$1 fill="currentColor">')),f=f.replace(/<svg([^>]*)>/,(h,m)=>`<svg${m.replace(/\s+(width|height)=["'][^"']*["']/g,"")} width="100%" height="100%"${y}>`),l.jsx("div",{className:p("size-5 box-content inline-flex fill-current",n),style:{color:t[0]||""},dangerouslySetInnerHTML:{__html:f}})}if(e&&typeof e=="object"&&"src"in e){const f=e;return l.jsx("img",{src:f.src,width:f.width,height:f.height,className:p("size-5 box-content",n),style:{filter:t[0]?"brightness(0) saturate(100%) invert(1)":void 0},alt:"","aria-hidden":"true"})}const r=e;if(!(r!=null&&r.prefix))throw new Error(`Invalid icon type: ${typeof e}`);const{icon:c}=r,[u,a,,,d]=c||[],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 l.jsx("svg",{className:p("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",...s,children:typeof d=="string"?l.jsx("path",{className:"fill-current",d}):d.map((f,y)=>l.jsx("path",{d:f},y))})},pn=({variant:e="linear-determinate",value:t=0,transitionDuration:n=1e3,className:s,...r})=>{const[c,u]=o.useState(t),[a]=o.useState(1.5);o.useEffect(()=>{t>100&&(t=100),t<0&&(t=0),u(t)},[t]);const[d,i]=o.useState(!0),f=()=>d?a:a*.5;o.useEffect(()=>{if(e==="circular-indeterminate"&&c!==100){const x=setInterval(()=>{u(d?20:40),i(!d)},f()*1e3);return()=>clearInterval(x)}},[e,d,c]);const[y,h]=o.useState(!1);o.useEffect(()=>{if(c>=100){const x=setTimeout(()=>{h(!1)},n);return()=>{clearTimeout(x)}}else h(!0)},[c,n]);const m=Gt({className:s,variant:e,value:t,transitionDuration:n,isVisible:y});return l.jsxs(l.Fragment,{children:[e==="linear-indeterminate"&&l.jsxs("div",{className:m.progressIndicator,...r,children:[l.jsx(Y.motion.div,{animate:{width:["0%","0%","0%","20%"],marginLeft:["0px","0px","6px","6px"],marginRight:["0px","0px","6px","6px"]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut",times:[0,.499,.5,1]},style:{flexShrink:0},className:m.activeIndicator}),l.jsx(Y.motion.div,{animate:{width:["0%","40%","100%"]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut"},style:{flexShrink:0},className:m.firstTrack}),l.jsx(Y.motion.div,{animate:{width:["20%","60%","20%"]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut",times:[0,.5,1]},style:{flexShrink:0,marginLeft:"6px"},className:m.activeIndicator}),l.jsx("div",{style:{marginLeft:"6px"},className:m.lastTrack})]}),e==="linear-determinate"&&l.jsxs("div",{className:m.progressIndicator,...r,children:[l.jsx("div",{style:{width:`${c}%`,transition:`width ${n}ms ease-in-out ${c==100?", max-height 200ms 0.5s ease-in-out":""}`},className:m.activeIndicator}),l.jsx("div",{style:{marginLeft:c!=100?"6px":"0px",transition:`width ${n}ms ease-in-out ${c==100?`, max-height 200ms 0.5s ease-in-out, margin-left ${n}ms ${n/1.5}ms`:""}`},className:m.lastTrack}),l.jsx("div",{style:{width:"4px",transition:`width ${n}ms ease-in-out, max-height 200ms 0.5s ease-in-out`},className:m.stop})]}),(e==="circular-determinate"||e=="circular-indeterminate")&&l.jsx(Y.motion.svg,{width:"48",height:"48",viewBox:"0 0 48 48",initial:{rotate:-90},animate:{rotate:e==="circular-indeterminate"?270:-90},transition:e==="circular-indeterminate"?{repeat:1/0,duration:f(),ease:"linear"}:{duration:n/1e3},className:m.progressIndicator,...r,children:l.jsx(Y.motion.circle,{cx:"50%",cy:"50%",r:y?"calc(50% - 2px)":"50%",style:{strokeLinecap:"round"},initial:e==="circular-indeterminate"?"hidden":"determinate",animate:e==="circular-indeterminate"?"visible":"determinate",className:m.activeIndicator,variants:{hidden:{pathLength:d?10/100:90/100},visible:{pathLength:d?90/100:10/100},determinate:{pathLength:c/100}},transition:{pathLength:e==="circular-indeterminate"?{type:"tween",ease:"linear",duration:f(),bounce:0}:{type:"tween",ease:"easeInOut",duration:n/1e3}}})},e==="circular-indeterminate"?d+"":"static")]})};function Cs(e){const t={primary:"filled",secondary:"tonal"};return e&&e in t?t[e]:e||"filled"}const me=({variant:e="filled",disabled:t=!1,icon:n,href:s,label:r,disableTextMargins:c,className:u,iconPosition:a="left",loading:d=!1,shape:i="rounded",onClick:f,onToggle:y,activated:h,ref:m,size:x="medium",allowShapeTransformation:b=!0,transition:g,children:j,...L})=>{if(j&&(r=j),!r)throw new Error("Button component requires either a label prop or children content");e=Cs(e);const w=s?"a":"button",C=o.useRef(null),I=m||C,[v,E]=o.useState(h);o.useEffect(()=>{E(h)},[h]),g={duration:.3,...g};const R=k=>{t&&k.preventDefault(),y?(E(!v),y(!v)):f&&f(k)},M=Nt({allowShapeTransformation:b,size:x,disableTextMargins:c,shape:i,href:s,disabled:t,icon:n,iconPosition:a,loading:d,variant:e,transition:g,className:u,isActive:v??!1,onToggle:y,activated:v,label:r,children:r}),W=n?l.jsx(le,{icon:n,className:M.icon}):l.jsx(l.Fragment,{});return l.jsxs(w,{ref:I,href:s,className:M.button,...L,onClick:R,disabled:t,"aria-pressed":y?v:void 0,style:{transition:g.duration+"s"},children:[l.jsx("div",{className:M.touchTarget}),l.jsx(ue,{style:{transition:g.duration+"s"},className:M.stateLayer,colorName:p(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,d&&l.jsx("div",{className:"!absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2",children:l.jsx(pn,{className:()=>({progressIndicator:"h-6 w-6",activeIndicator:p({"!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"})}),l.jsx("span",{className:M.label,children:r}),a==="right"&&W]})},Rs=({variant:e="outlined",className:t,children:n,interactive:s=!1,ref:r,...c})=>{const u=jt({className:t,interactive:s,variant:e,children:n}),a=o.useRef(null),d=r||a;return l.jsxs("div",{...c,ref:d,className:u.card,children:[s&&l.jsx(ue,{className:u.stateLayer,colorName:"on-surface",stateClassName:"state-ripple-group-[card]"}),n]})},ve=(e,t,n=[0,1])=>{const[s,r]=t,[c,u]=n,d=(Math.max(s,Math.min(e,r))-s)/(r-s);return c+d*(u-c)},yn=({className:e,children:t,width:n,index:s=0,outputRange:r,ref:c,...u})=>{const a=o.useRef(null),d=c||a,i=Lt({className:e,index:s,children:t});return l.jsx("div",{ref:d,style:{width:"var(--carousel-item-width, 100%)",maxWidth:r?r[1]+"px":void 0,minWidth:r?r[0]+"px":void 0},className:i.carouselItem,...u,children:t})},Ds=({variant:e="hero",className:t,children:n,ref:s,marginPourcent:r=0,inputRange:c=[.21,.65],outputRange:u=[42,300],gap:a=8,onChange:d,onMetricsChange:i,index:f,scrollSensitivity:y=1.25,...h})=>{const m=o.useRef(null),x=s||m,b=It({index:f,className:t,children:n,variant:e,inputRange:c,outputRange:u,marginPourcent:r,onChange:d,gap:a,scrollSensitivity:y,onMetricsChange:i}),g=o.Children.toArray(n).filter(F=>o.isValidElement(F)&&F.type===yn),j=o.useRef(null),L=o.useRef({scrollProgress:0,scrollTotal:0,scrollVisible:0,scroll:0}),w=o.useRef(0),C=o.useRef(null),I=o.useRef([]).current,[v,E]=o.useState(0);I.length!==g.length&&(I.length=0,g.forEach((F,T)=>{I[T]=o.createRef()}));const R=o.useCallback(()=>{if(!j.current||!x.current)return;const F=w.current,T=L.current.scrollVisible||x.current.clientWidth||0;function G(B,ee){return B.map((oe,pe)=>{const Se=(oe-ee)/Math.abs(B[1]-B[0]);return{itemScrollXCenter:oe,relativeIndex:Se,index:pe,width:0}})}const S=g.map((B,ee)=>{const oe=ee/Math.max(1,g.length-1);return ve(oe,[0,1],[0,1])}),N=G(S,F).sort((B,ee)=>B.index-ee.index);let D=T+a+u[0]+a,q=v;const U=N.sort((B,ee)=>Math.abs(B.relativeIndex)-Math.abs(ee.relativeIndex)).map((B,ee)=>{if(!(D<=0)){if(ee===0&&(q=B.index),B.width=ve(D-a,[u[0],u[1]],[u[0],u[1]]),D-=B.width+a,D!==0&&D<(u[0]+a)*2){const oe=B.width-((u[0]+a)*2-D);D+=B.width,B.width=oe,D-=B.width}else if(D===0&&B.width>=u[0]*2+a){const oe=B.width-(u[0]+a-D);D+=B.width,B.width=oe,D-=B.width}return B}}).filter(Boolean),J=[...U].reverse(),te=[...U].sort((B,ee)=>Math.abs(B.index)-Math.abs(ee.index));J.forEach((B,ee)=>{const oe=J[ee+1];if(!oe)return;const pe=1-(Math.abs(B.relativeIndex)-Math.abs(oe.relativeIndex)),Se=ve(pe,[0,2],[B.width+D,oe.width]);D+=B.width,B.width=Se,D-=B.width});const se=U.length/2,P=ve(Math.abs(te[0].relativeIndex),[te[0].index===0?0:se-1,se],[0,1]),_=ve(P,[0,1],[0,1])*-(u[0]+a);I.forEach((B,ee)=>{if(B.current){const oe=U.find(pe=>pe.index===ee);oe?(B.current.style.setProperty("--carousel-item-width",`${oe.width}px`),B.current.style.display="block"):(B.current.style.setProperty("--carousel-item-width",`${u[0]}px`),B.current.style.display="none")}}),j.current.style.transform=`translateX(${_}px)`,q!==v&&E(q)},[g.length,u,a,v]);o.useLayoutEffect(()=>{R()},[R,g.length]),o.useEffect(()=>{d&&d(v)},[v,d]);const[M,W]=o.useState(0);o.useEffect(()=>{W(v)},[v]);const k=(F,T={})=>{if(!g.length)return 0;const G=I[F];if(!G||!G.current||!j.current)return 0;const S=ve(F/Math.max(1,g.length-1),[0,1],[0,1]);return W(F),j.current.dispatchEvent(new CustomEvent("udx:customScroll:set",{bubbles:!0,detail:{progress:S,orientation:"horizontal",animate:T.animate!==!1}})),S};o.useEffect(()=>{typeof f=="number"&&g.length>0&&f!==v&&k(f)},[f,g.length]);const X=F=>{var T;if(L.current=F,F.scrollTotal>0){(T=C.current)==null||T.stop();const G=w.current??0,S=F.scrollProgress??0;C.current=Y.animate(G,S,{type:"spring",stiffness:260,damping:32,mass:.6,restDelta:5e-4,onUpdate:N=>{w.current=N,requestAnimationFrame(()=>{R()})}})}},V=o.useRef(i);o.useEffect(()=>{V.current=i},[i]);const Q=o.useRef(null);o.useEffect(()=>{const F=V.current;if(!F||!(x!=null&&x.current)||g.length<=0)return;const T=g.length,G=x.current.clientWidth||0,S=u[1],N=w.current,D=(G+a)/(S+a),q=Math.max(1,Math.floor(D)),U=Math.max(1,Math.round(q*(2/3))),J=Math.min(Math.max(0,v),Math.max(0,T-1)),te={total:T,selectedIndex:J,visibleApprox:D,visibleFull:q,stepHalf:U,canPrev:J>0,canNext:J<T-1,scrollProgress:N,viewportWidth:G,itemMaxWidth:S,gap:a},se=Q.current;let P=!se;if(!P){for(const _ in te)if(te[_]!==se[_]){P=!0;break}}P&&(Q.current=te,F(te))},[x,g.length,v,a,u]),o.useEffect(()=>()=>{var F;(F=C.current)==null||F.stop()},[]);const[z,$]=o.useState(0);o.useLayoutEffect(()=>{let F=u[1];const T=L.current;T&&F>T.scrollVisible&&T.scrollVisible>0&&(F=T.scrollVisible);const G=(F+a)*g.length/y;$(G||400)},[x,g.length,a,u,y]);const A=F=>{if(!g.length)return;const T=M??v;switch(F.key){case"ArrowLeft":F.preventDefault(),k(Math.max(0,T-1));break;case"ArrowRight":F.preventDefault(),k(Math.min(g.length-1,T+1));break;case"Home":F.preventDefault(),k(0);break;case"End":F.preventDefault(),k(g.length-1);break;case"Enter":case" ":F.preventDefault(),k(T);break}};o.useEffect(()=>{const F=x.current;if(!F)return;const T=G=>{const S=G.detail;S&&typeof S.index=="number"&&k(S.index)};return F.addEventListener("udx:carousel:centerIndex",T),()=>{F.removeEventListener("udx:carousel:centerIndex",T)}},[x,g.length]);const O=g.map((F,T)=>{var N;const G=(N=F.props)==null?void 0:N.onClick,S=D=>{G==null||G(D)};return o.cloneElement(F,{outputRange:u,ref:I[T],key:T,index:T,role:"option","aria-selected":v===T,tabIndex:v===T?0:-1,onClick:S,onFocus:()=>W(T)})});return l.jsx("div",{className:b.carousel,ref:x,role:"listbox","aria-orientation":"horizontal",onKeyDown:A,...h,children:l.jsx(vt,{draggable:!0,orientation:"horizontal",onScroll:X,scrollSize:z,children:l.jsx("div",{className:b.track,ref:j,style:{gap:`${a}px`,willChange:"transform"},children:O})})})};/*!
|
|
1
|
+
"use strict";var Dn=Object.defineProperty;var An=(e,t,n)=>t in e?Dn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var H=(e,t,n)=>An(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),o=require("react"),Ve=require("react-dom"),Y=require("motion/react"),ht=require("clsx"),Fn=require("tailwind-merge"),ge=require("@udixio/theme"),ke=require("@udixio/tailwind"),Pn=require("react-textarea-autosize");var $e=typeof document<"u"?document.currentScript:null;const mt=({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}}},[s,r]=o.useState(!0),[c,u]=o.useState(!1),[a,d]=o.useState({x:50,y:50});o.useEffect(()=>{c&&(r(!0),r(!1))},[c]),o.useEffect(()=>{const x=t==null?void 0:t.current;if(x)return x.addEventListener("mousedown",i),x.addEventListener("mouseup",y),x.addEventListener("mouseleave",f),()=>{x.removeEventListener("mousedown",i),x.removeEventListener("mouseup",y),x.removeEventListener("mouseleave",f)}},[t]);const i=x=>{const b=t==null?void 0:t.current,g=b.getBoundingClientRect();u(!0),d({x:(x.clientX-g.left)/b.clientWidth*100,y:(x.clientY-g.top)/b.clientHeight*100})},f=x=>{u(!1)},y=x=>{u(!1)},h=`color-mix(in srgb, var(--state-color,_var(--color-${e})) 10%, transparent)`,m={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 l.jsx(Y.AnimatePresence,{mode:"wait",children:(c||!c&&!s)&&l.jsx(Y.motion.div,{style:m,variants:n,initial:"initial",animate:"animate",exit:"exit",onAnimationComplete:()=>r(!0)})})},pt=Fn.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"]}}}),p=(...e)=>pt(ht.clsx(e)),yt=(...e)=>pt(ht.clsx(e));function $n(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 De=e=>{const t={};e.classNameList.forEach(s=>{var r;if(s)if(typeof s=="string")(t[r=e.default]??(t[r]=[])).push(s);else{const c=s(e.states);Object.entries(c).map(u=>{const[a,d]=u;(t[a]??(t[a]=[])).push(d)})}});const n=t;return Object.entries(t).map(s=>{let[r,c]=s;c=c.reverse(),r==e.default&&c.unshift("relative"),c.unshift($n(r)),n[r]=yt(...c)}),n},ne=(e,t)=>n=>De({classNameList:[n.className,t],default:e,states:n}),Z=(e,t)=>n=>o.useMemo(()=>De({classNameList:[n.className,t],default:e,states:n}),[n]);function Tn(e,t,n){return o.useMemo(()=>De({classNameList:[n==null?void 0:n.className,t],default:e,states:n}),[e,t,n])}const xt=ne("customScroll",({orientation:e,draggable:t,isDragging:n})=>({customScroll:p("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:p("overflow-hidden flex-none sticky",{"left-0 h-full":e==="horizontal","top-0 w-full":e==="vertical"})}));function Wn(e,t){let n=0,s=null,r=null;const c=(u,a)=>{n=Date.now(),t(u,a)};return(u,a)=>{const d=Date.now(),i=e-(d-n);i<=0?(s&&(clearTimeout(s),s=null),c(u,a)):(r={v:u,o:a},s||(s=setTimeout(()=>{s=null;const f=r;r=null,f&&c(f.v,f.o)},i)))}}const vt=({children:e,orientation:t="vertical",scrollSize:n,onScroll:s,className:r,draggable:c=!1,throttleDuration:u=75,scroll:a,setScroll:d})=>{var G,S;const i=o.useRef(null),f=o.useRef(null),[y,h]=o.useState({width:null,height:null});o.useEffect(()=>{if(!i.current)return;const N=new ResizeObserver(D=>{for(const q of D)q.target===i.current&&h({width:q.contentRect.width,height:q.contentRect.height})});return N.observe(i.current),()=>{N.disconnect()}},[i]);const m=o.useRef(null),x=o.useRef(null),b=()=>{const N=f.current;return N?{width:n??N.scrollWidth,height:n??N.scrollHeight}:null},g=()=>{const N=i.current;return N?{width:N.clientWidth,height:N.clientHeight}:null},{scrollYProgress:j,scrollXProgress:L}=Y.useScroll({container:i}),w=o.useRef(null);w.current||(w.current=Wn(u,(N,D)=>{!x.current||!m.current||!i.current||(D===(t==="horizontal"?"x":"y")&&(d==null||d(N)),s&&(t==="horizontal"&&D==="x"&&s({scrollProgress:N,scroll:N*(m.current.width-i.current.clientWidth),scrollTotal:m.current.width-i.current.clientWidth,scrollVisible:x.current.width}),t==="vertical"&&D==="y"&&s({scrollProgress:N,scroll:N*(m.current.height-i.current.clientHeight),scrollTotal:m.current.height-i.current.clientHeight,scrollVisible:x.current.height})))}));const C=(N,D)=>{w.current&&w.current(N,D)};o.useEffect(()=>{y.width&&C(L.get(),"x"),y.height&&C(j.get(),"y")},[y]),o.useEffect(()=>{const N=i.current,D=f.current;if(!N||!D||typeof a!="number")return;const q=(U,J,te)=>Math.min(te,Math.max(J,U));if(t==="horizontal"){const U=Math.max(0,(n??D.scrollWidth)-N.clientWidth);N.scrollLeft=q(a*U,0,U)}else{const U=Math.max(0,(n??D.scrollHeight)-N.clientHeight);N.scrollTop=q(a*U,0,U)}},[a,t,n]),Y.useMotionValueEvent(L,"change",N=>{C(N,"x")}),Y.useMotionValueEvent(j,"change",N=>{C(N,"y")});const[I,v]=o.useState(!1);o.useLayoutEffect(()=>{I||!x.current||!m.current||!s||(s({scrollProgress:0,scroll:0,scrollTotal:t=="vertical"?m.current.height:m.current.width,scrollVisible:t=="vertical"?x.current.height:x.current.width}),v(!0))},[x,m,s]),m.current=b(),x.current=g();const[E,R]=o.useState(!1),M=xt({isDragging:E,children:e,className:r,onScroll:s,orientation:t,scrollSize:n,draggable:c,throttleDuration:u}),[W,k]=o.useState(0),[X,V]=o.useState(0),Q=N=>{if(!c)return;const D=i.current;if(!D||W==null)return;const U=(N.pageX-D.offsetLeft-W)*1.5;D.scrollLeft=X-U},z=N=>{const D=i.current;D&&(R(!0),k(N.pageX-D.offsetLeft),V(D.scrollLeft))},$=N=>{E&&(N.preventDefault(),Q(N))},A=()=>{R(!1)},O=()=>{R(!1)},F=N=>{N.preventDefault()},T=o.useRef(null);return o.useEffect(()=>()=>{T.current&&clearTimeout(T.current)},[]),o.useEffect(()=>{const N=i.current;if(!N)return;const D=q=>{var se,P,_,B;const U=q.detail,J=i.current;if(!J||!U)return;const te=U.orientation??t;if(typeof U.progress=="number")if(te==="horizontal"){const ee=Math.max(0,(((se=m.current)==null?void 0:se.width)??0)-J.clientWidth);J.scrollLeft=Math.min(ee,Math.max(0,U.progress*ee))}else{const ee=Math.max(0,(((P=m.current)==null?void 0:P.height)??0)-J.clientHeight);J.scrollTop=Math.min(ee,Math.max(0,U.progress*ee))}else if(typeof U.scroll=="number")if(te==="horizontal"){const ee=Math.max(0,(((_=m.current)==null?void 0:_.width)??0)-J.clientWidth);J.scrollLeft=Math.min(ee,Math.max(0,U.scroll))}else{const ee=Math.max(0,(((B=m.current)==null?void 0:B.height)??0)-J.clientHeight);J.scrollTop=Math.min(ee,Math.max(0,U.scroll))}};return N.addEventListener("udx:customScroll:set",D),()=>{N.removeEventListener("udx:customScroll:set",D)}},[t]),l.jsxs("div",{className:M.customScroll,ref:i,onMouseDown:z,onMouseMove:$,onMouseUp:A,onMouseLeave:O,onDragStart:F,onScroll:N=>{E||(k(null),R(!0),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{R(!1)},1e3))},children:[l.jsx("div",{ref:f,style:t==="vertical"?{height:((G=x==null?void 0:x.current)==null?void 0:G.height)??"100%"}:{width:((S=x==null?void 0:x.current)==null?void 0:S.width)??"100%"},className:M.track,children:e}),x.current&&m.current&&l.jsxs(l.Fragment,{children:[t==="vertical"&&m.current.height>x.current.height&&l.jsx(Y.motion.div,{className:"flex-none",style:{height:m.current.height-x.current.height}}),t==="horizontal"&&m.current.width>x.current.width&&l.jsx(Y.motion.div,{className:"flex-none",style:{width:m.current.width-x.current.width}})]})]})};var On="1.3.17";function gt(e,t,n){return Math.max(e,Math.min(t,n))}function Bn(e,t,n){return(1-n)*e+n*t}function Hn(e,t,n,s){return Bn(e,t,1-Math.exp(-n*s))}function Vn(e,t){return(e%t+t)%t}var zn=class{constructor(){H(this,"isRunning",!1);H(this,"value",0);H(this,"from",0);H(this,"to",0);H(this,"currentTime",0);H(this,"lerp");H(this,"duration");H(this,"easing");H(this,"onUpdate")}advance(e){var n;if(!this.isRunning)return;let t=!1;if(this.duration&&this.easing){this.currentTime+=e;const s=gt(0,this.currentTime/this.duration,1);t=s>=1;const r=t?1:this.easing(s);this.value=this.from+(this.to-this.from)*r}else this.lerp?(this.value=Hn(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:s,easing:r,onStart:c,onUpdate:u}){this.from=this.value=e,this.to=t,this.lerp=n,this.duration=s,this.easing=r,this.currentTime=0,this.isRunning=!0,c==null||c(),this.onUpdate=u}};function _n(e,t){let n;return function(...s){let r=this;clearTimeout(n),n=setTimeout(()=>{n=void 0,e.apply(r,s)},t)}}var Yn=class{constructor(e,t,{autoResize:n=!0,debounce:s=250}={}){H(this,"width",0);H(this,"height",0);H(this,"scrollHeight",0);H(this,"scrollWidth",0);H(this,"debouncedResize");H(this,"wrapperResizeObserver");H(this,"contentResizeObserver");H(this,"resize",()=>{this.onWrapperResize(),this.onContentResize()});H(this,"onWrapperResize",()=>{this.wrapper instanceof Window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)});H(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=_n(this.resize,s),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}}},wt=class{constructor(){H(this,"events",{})}emit(e,...t){var s;let n=this.events[e]||[];for(let r=0,c=n.length;r<c;r++)(s=n[r])==null||s.call(n,...t)}on(e,t){var n;return(n=this.events[e])!=null&&n.push(t)||(this.events[e]=[t]),()=>{var s;this.events[e]=(s=this.events[e])==null?void 0:s.filter(r=>t!==r)}}off(e,t){var n;this.events[e]=(n=this.events[e])==null?void 0:n.filter(s=>t!==s)}destroy(){this.events={}}},ot=100/6,he={passive:!1},qn=class{constructor(e,t={wheelMultiplier:1,touchMultiplier:1}){H(this,"touchStart",{x:0,y:0});H(this,"lastDelta",{x:0,y:0});H(this,"window",{width:0,height:0});H(this,"emitter",new wt);H(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})});H(this,"onTouchMove",e=>{const{clientX:t,clientY:n}=e.targetTouches?e.targetTouches[0]:e,s=-(t-this.touchStart.x)*this.options.touchMultiplier,r=-(n-this.touchStart.y)*this.options.touchMultiplier;this.touchStart.x=t,this.touchStart.y=n,this.lastDelta={x:s,y:r},this.emitter.emit("scroll",{deltaX:s,deltaY:r,event:e})});H(this,"onTouchEnd",e=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:e})});H(this,"onWheel",e=>{let{deltaX:t,deltaY:n,deltaMode:s}=e;const r=s===1?ot:s===2?this.window.width:1,c=s===1?ot:s===2?this.window.height:1;t*=r,n*=c,t*=this.options.wheelMultiplier,n*=this.options.wheelMultiplier,this.emitter.emit("scroll",{deltaX:t,deltaY:n,event:e})});H(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,he),this.element.addEventListener("touchstart",this.onTouchStart,he),this.element.addEventListener("touchmove",this.onTouchMove,he),this.element.addEventListener("touchend",this.onTouchEnd,he)}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,he),this.element.removeEventListener("touchstart",this.onTouchStart,he),this.element.removeEventListener("touchmove",this.onTouchMove,he),this.element.removeEventListener("touchend",this.onTouchEnd,he)}},it=e=>Math.min(1,1.001-Math.pow(2,-10*e)),Un=class{constructor({wrapper:e=window,content:t=document.documentElement,eventsTarget:n=e,smoothWheel:s=!0,syncTouch:r=!1,syncTouchLerp:c=.075,touchInertiaExponent:u=1.7,duration:a,easing:d,lerp:i=.1,infinite:f=!1,orientation:y="vertical",gestureOrientation:h=y==="horizontal"?"both":"vertical",touchMultiplier:m=1,wheelMultiplier:x=1,autoResize:b=!0,prevent:g,virtualScroll:j,overscroll:L=!0,autoRaf:w=!1,anchors:C=!1,autoToggle:I=!1,allowNestedScroll:v=!1,__experimental__naiveDimensions:E=!1,naiveDimensions:R=E,stopInertiaOnNavigate:M=!1}={}){H(this,"_isScrolling",!1);H(this,"_isStopped",!1);H(this,"_isLocked",!1);H(this,"_preventNextNativeScrollEvent",!1);H(this,"_resetVelocityTimeout",null);H(this,"_rafId",null);H(this,"isTouching");H(this,"time",0);H(this,"userData",{});H(this,"lastVelocity",0);H(this,"velocity",0);H(this,"direction",0);H(this,"options");H(this,"targetScroll");H(this,"animatedScroll");H(this,"animate",new zn);H(this,"emitter",new wt);H(this,"dimensions");H(this,"virtualScroll");H(this,"onScrollEnd",e=>{e instanceof CustomEvent||(this.isScrolling==="smooth"||this.isScrolling===!1)&&e.stopPropagation()});H(this,"dispatchScrollendEvent",()=>{this.options.wrapper.dispatchEvent(new CustomEvent("scrollend",{bubbles:this.options.wrapper===window,detail:{lenisScrollEnd:!0}}))});H(this,"onTransitionEnd",e=>{e.propertyName.includes("overflow")&&this.checkOverflow()});H(this,"onClick",e=>{const n=e.composedPath().filter(s=>s instanceof HTMLAnchorElement&&s.getAttribute("href"));if(this.options.anchors){const s=n.find(r=>{var c;return(c=r.getAttribute("href"))==null?void 0:c.includes("#")});if(s){const r=s.getAttribute("href");if(r){const c=typeof this.options.anchors=="object"&&this.options.anchors?this.options.anchors:void 0,u=`#${r.split("#")[1]}`;this.scrollTo(u,c)}}}this.options.stopInertiaOnNavigate&&n.find(r=>r.host===window.location.host)&&this.reset()});H(this,"onPointerDown",e=>{e.button===1&&this.reset()});H(this,"onVirtualScroll",e=>{if(typeof this.options.virtualScroll=="function"&&this.options.virtualScroll(e)===!1)return;const{deltaX:t,deltaY:n,event:s}=e;if(this.emitter.emit("virtual-scroll",{deltaX:t,deltaY:n,event:s}),s.ctrlKey||s.lenisStopPropagation)return;const r=s.type.includes("touch"),c=s.type.includes("wheel");this.isTouching=s.type==="touchstart"||s.type==="touchmove";const u=t===0&&n===0;if(this.options.syncTouch&&r&&s.type==="touchstart"&&u&&!this.isStopped&&!this.isLocked){this.reset();return}const d=this.options.gestureOrientation==="vertical"&&n===0||this.options.gestureOrientation==="horizontal"&&t===0;if(u||d)return;let i=s.composedPath();i=i.slice(0,i.indexOf(this.rootElement));const f=this.options.prevent;if(i.find(g=>{var j,L,w;return g instanceof HTMLElement&&(typeof f=="function"&&(f==null?void 0:f(g))||((j=g.hasAttribute)==null?void 0:j.call(g,"data-lenis-prevent"))||r&&((L=g.hasAttribute)==null?void 0:L.call(g,"data-lenis-prevent-touch"))||c&&((w=g.hasAttribute)==null?void 0:w.call(g,"data-lenis-prevent-wheel"))||this.options.allowNestedScroll&&this.checkNestedScroll(g,{deltaX:t,deltaY:n}))}))return;if(this.isStopped||this.isLocked){s.cancelable&&s.preventDefault();return}if(!(this.options.syncTouch&&r||this.options.smoothWheel&&c)){this.isScrolling="native",this.animate.stop(),s.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))&&(s.lenisStopPropagation=!0),s.cancelable&&s.preventDefault();const m=r&&this.options.syncTouch,b=r&&s.type==="touchend";b&&(h=Math.sign(this.velocity)*Math.pow(Math.abs(this.velocity),this.options.touchInertiaExponent)),this.scrollTo(this.targetScroll+h,{programmatic:!1,...m?{lerp:b?this.options.syncTouchLerp:1}:{lerp:this.options.lerp,duration:this.options.duration,easing:this.options.easing}})});H(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))}});H(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=On,(!e||e===document.documentElement)&&(e=window),typeof a=="number"&&typeof d!="function"?d=it:typeof d=="function"&&typeof a!="number"&&(a=1),this.options={wrapper:e,content:t,eventsTarget:n,smoothWheel:s,syncTouch:r,syncTouchLerp:c,touchInertiaExponent:u,duration:a,easing:d,lerp:i,infinite:f,gestureOrientation:h,orientation:y,touchMultiplier:m,wheelMultiplier:x,autoResize:b,prevent:g,virtualScroll:j,overscroll:L,autoRaf:w,anchors:C,autoToggle:I,allowNestedScroll:v,naiveDimensions:R,stopInertiaOnNavigate:M},this.dimensions=new Yn(e,t,{autoResize:b}),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 qn(n,{touchMultiplier:m,wheelMultiplier:x}),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:s=!1,programmatic:r=!0,lerp:c=r?this.options.lerp:void 0,duration:u=r?this.options.duration:void 0,easing:a=r?this.options.easing:void 0,onStart:d,onComplete:i,force:f=!1,userData:y}={}){if(!((this.isStopped||this.isLocked)&&!f)){if(typeof e=="string"&&["top","left","start","#"].includes(e))e=0;else if(typeof e=="string"&&["bottom","right","end"].includes(e))e=this.limit;else{let h;if(typeof e=="string"?(h=document.querySelector(e),h||(e==="#top"?e=0:console.warn("Lenis: Target not found",e))):e instanceof HTMLElement&&(e!=null&&e.nodeType)&&(h=e),h){if(this.options.wrapper!==window){const x=this.rootElement.getBoundingClientRect();t-=this.isHorizontal?x.left:x.top}const m=h.getBoundingClientRect();e=(this.isHorizontal?m.left:m.top)+this.animatedScroll}}if(typeof e=="number"){if(e+=t,e=Math.round(e),this.options.infinite){if(r){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=gt(0,e,this.limit);if(e===this.targetScroll){d==null||d(this),i==null||i(this);return}if(this.userData=y??{},n){this.animatedScroll=this.targetScroll=e,this.setScroll(this.scroll),this.reset(),this.preventNextNativeScrollEvent(),this.emit(),i==null||i(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()});return}r||(this.targetScroll=e),typeof u=="number"&&typeof a!="function"?a=it:typeof a=="function"&&typeof u!="number"&&(u=1),this.animate.fromTo(this.animatedScroll,e,{duration:u,easing:a,lerp:c,onStart:()=>{s&&(this.isLocked=!0),this.isScrolling="smooth",d==null||d(this)},onUpdate:(h,m)=>{this.isScrolling="smooth",this.lastVelocity=this.velocity,this.velocity=h-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=h,this.setScroll(this.scroll),r&&(this.targetScroll=h),m||this.emit(),m&&(this.reset(),this.emit(),i==null||i(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()}),this.preventNextNativeScrollEvent())}})}}}preventNextNativeScrollEvent(){this._preventNextNativeScrollEvent=!0,requestAnimationFrame(()=>{this._preventNextNativeScrollEvent=!1})}checkNestedScroll(e,{deltaX:t,deltaY:n}){const s=Date.now(),r=e._lenis??(e._lenis={});let c,u,a,d,i,f,y,h;const m=this.options.gestureOrientation;if(s-(r.time??0)>2e3){r.time=Date.now();const I=window.getComputedStyle(e);r.computedStyle=I;const v=I.overflowX,E=I.overflowY;if(c=["auto","overlay","scroll"].includes(v),u=["auto","overlay","scroll"].includes(E),r.hasOverflowX=c,r.hasOverflowY=u,!c&&!u||m==="vertical"&&!u||m==="horizontal"&&!c)return!1;i=e.scrollWidth,f=e.scrollHeight,y=e.clientWidth,h=e.clientHeight,a=i>y,d=f>h,r.isScrollableX=a,r.isScrollableY=d,r.scrollWidth=i,r.scrollHeight=f,r.clientWidth=y,r.clientHeight=h}else a=r.isScrollableX,d=r.isScrollableY,c=r.hasOverflowX,u=r.hasOverflowY,i=r.scrollWidth,f=r.scrollHeight,y=r.clientWidth,h=r.clientHeight;if(!c&&!u||!a&&!d||m==="vertical"&&(!u||!d)||m==="horizontal"&&(!c||!a))return!1;let x;if(m==="horizontal")x="x";else if(m==="vertical")x="y";else{const I=t!==0,v=n!==0;I&&c&&a&&(x="x"),v&&u&&d&&(x="y")}if(!x)return!1;let b,g,j,L,w;if(x==="x")b=e.scrollLeft,g=i-y,j=t,L=c,w=a;else if(x==="y")b=e.scrollTop,g=f-h,j=n,L=u,w=d;else return!1;return(j>0?b<g:b>0)&&L&&w}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?Vn(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 Xn=({transition:e=1.2,easing:t,orientation:n="vertical",smoothTouch:s=!1,touchMultiplier:r=2,children:c})=>{const u=o.useRef(null),a=o.useRef(null);return o.useEffect(()=>{let d;typeof e=="string"?e.endsWith("ms")?d=parseFloat(e)/1e3:e.endsWith("s")?d=parseFloat(e):d=parseFloat(e)||1.2:d=e;const i=y=>1-Math.pow(1-y,5);u.current=new Un({duration:d,easing:t??i,orientation:n,smoothWheel:!0,touchMultiplier:r,syncTouch:s});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,s,r]),c?l.jsx(l.Fragment,{children:c}):null},ue=({style:e,colorName:t,stateClassName:n="state-ripple-group",children:s,className:r})=>{const c=o.useRef(null),u=o.useRef(null),[a,d]=o.useState(!1),i=bt({isClient:a,stateClassName:n,className:r,colorName:t});return o.useEffect(()=>{if(c.current&&n!=="state-layer"){const y=(n.includes("[")?"group/"+n.split("[")[1].split("]")[0]:"group").replace(/\//g,"\\/"),h=c.current.closest(`.${y}:not(.${y} .${y})`);u.current=h}d(!0)},[]),l.jsxs("div",{ref:c,className:i.stateLayer,style:{"--state-color":`var(--default-color, var(--color-${t}))`,...e},children:[a&&l.jsx(mt,{triggerRef:u}),s]})},Gn=({isClient:e,stateClassName:t})=>({stateLayer:p(["w-full top-0 left-0 h-full absolute pointer-events-none overflow-hidden",t])}),bt=Z("stateLayer",Gn),St=({targetRef:e,children:t})=>{const[n,s]=o.useState(null),r=o.useRef(null),c=()=>{const u=e.current;if(!u)return;const a=u.getBoundingClientRect();s({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 c(),window.addEventListener("scroll",c,!0),window.addEventListener("resize",c),r.current=new ResizeObserver(c),r.current.observe(u),()=>{var a;window.removeEventListener("scroll",c,!0),window.removeEventListener("resize",c),(a=r.current)==null||a.disconnect()}},[e]),n?Ve.createPortal(l.jsx("div",{style:n,children:t}),document.body):null};function Kn(e){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e)}const Jn=({config:e,throttleDelay:t=100,onLoad:n,loadTheme:s=!1,initialCss:r})=>{const[c,u]=o.useState(null),[a,d]=o.useState(r??null),i=o.useRef(null),f=o.useRef(0),y=o.useRef(0),h=o.useRef(null),m=o.useRef(!1),x=o.useRef(n);o.useEffect(()=>{x.current=n},[n]),o.useEffect(()=>{let w=!1;return(async()=>{const C=await ge.loader(e,s);if(w)return;h.current=C,u(C);const I=new Worker(new URL(""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/theme.worker.js").href:new URL("theme.worker.js",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),typeof document>"u"?require("url").pathToFileURL(__filename).href:$e&&$e.tagName.toUpperCase()==="SCRIPT"&&$e.src||new URL("index.cjs",document.baseURI).href),{type:"module"});i.current=I,I.onmessage=v=>{var E;v.data.id>y.current&&(y.current=v.data.id,m.current=!0,d(v.data.css),(E=x.current)==null||E.call(x,h.current))}})(),()=>{var C;w=!0,(C=i.current)==null||C.terminate(),i.current=null}},[]);const b=o.useRef(null),g=o.useRef(0),j=o.useRef(null);o.useEffect(()=>{if(!c)return;const w={...e,sourceColor:e.sourceColor},C=Date.now(),I=C-g.current,v=async E=>{await L(E)};if(g.current===0||I>=t)b.current&&(clearTimeout(b.current),b.current=null),j.current=null,g.current=C,v(w);else if(j.current=w,!b.current){const E=Math.max(0,t-I);b.current=setTimeout(async()=>{b.current=null;const R=j.current;j.current=null,R&&(g.current=Date.now(),await v(R))},E)}return()=>{}},[e,t,c]);const L=async w=>{if(typeof w.sourceColor=="string"&&!Kn(w.sourceColor))throw new Error("Invalid hex color");const C=h.current;if(!C)return;C.context.update(w),C.palettes.sync(w.palettes);const I=i.current;if(!I||!m.current){await C.load();const E=C.plugins.getPlugin(ke.TailwindPlugin).getInstance().outputCss;d(E),m.current=!0,n==null||n(C);return}const v=++f.current;I.postMessage({id:v,snapshot:ge.serializeThemeContext(C),tailwindOptions:C.plugins.getPlugin(ke.TailwindPlugin).toSerializable(),fontOptions:C.plugins.getPlugin(ge.FontPlugin).toSerializable()})};return o.useEffect(()=>()=>{b.current&&(clearTimeout(b.current),b.current=null)},[]),a?l.jsx("style",{dangerouslySetInnerHTML:{__html:a}}):null};async function Zn(e,t){var s;(s=e.plugins)==null||s.forEach(r=>{r instanceof ke.TailwindPlugin&&(r.options={...r.options,ssr:!0})});const n=await ge.loader(e,!1);return await(t==null?void 0:t(n)),await n.load(),n.plugins.getPlugin(ke.TailwindPlugin).getInstance().outputCss}function Qn(){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 es(){return typeof window>"u"||!("matchMedia"in window)?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function ze(e){if(!(e instanceof HTMLElement))return!1;const t=e.classList;return Array.from(t).some(n=>n.startsWith("anim-")&&n.includes("scroll"))}function lt(e){if(!(e instanceof HTMLElement))return!1;const t=e.classList;return Array.from(t).some(n=>n.startsWith("anim-"))}function Te(e,t){if(!ze(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 s=e.getAttribute(`data-${t}-end`);s&&e.style.setProperty(`--${t}-range-end`,s);const r=e.hasAttribute(`data-${t}-paused`)||e.classList.contains(`${t}-paused`),c=e.hasAttribute(`data-${t}-run`)||e.classList.contains(`${t}-run`);!r&&!c&&e.setAttribute(`data-${t}-run`,"")}function We(e=document,t){return Array.from(e.querySelectorAll(`[class*="${t}-"][class*="-scroll"]`)).filter(s=>ze(s))}function ts(e=document,t){const n=Array.from(e.querySelectorAll(`[class*="${t}-"]`)),s=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(r=>{if(!(r instanceof HTMLElement))return!1;const c=r.classList;return c.contains(`${t}-in`)||c.contains(`${t}-out`)||Array.from(c).some(d=>d.startsWith(`${t}-`)&&!d.includes("scroll")&&!s.has(d))?!0:!ze(r)})}function ns(e,t){return Array.from(e).some(n=>n.startsWith(t)&&n.includes("-out"))}function at(e,t,n){e.setAttribute(`data-${t}-run`,""),e.setAttribute(`data-${t}-${n}-run`,"")}function ct(e,t,n){const s=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=s}const ss=[0,.2],ut=new WeakSet;function dt(e,t){if(ut.has(e))return;ut.add(e);const n=r=>{r.target===e&&(e.hasAttribute(`data-${t}-in-run`)||e.hasAttribute(`data-${t}-out-run`))&&e.setAttribute(`data-${t}-animating`,"")},s=r=>{r.target===e&&e.removeAttribute(`data-${t}-animating`)};e.addEventListener("animationstart",n),e.addEventListener("animationend",s),e.addEventListener("animationcancel",s)}function _e(e={}){const{prefix:t="anim",once:n=!0}=e;if(es())return()=>{};const s=Qn(),r=new WeakSet;let c=typeof window<"u"&&(window.pageYOffset||window.scrollY)||0,u=!0;const a=()=>{const m=window.pageYOffset||window.scrollY||0;u=m>=c,c=m};typeof window<"u"&&window.addEventListener("scroll",a,{passive:!0});const d=new IntersectionObserver(m=>{for(const x of m){const b=x.target;if(!lt(b)||b.hasAttribute(`data-${t}-animating`))continue;const g=ns(b.classList,t);x.isIntersecting?(g&&ct(b,t,"out"),at(b,t,"in"),n&&d.unobserve(b)):n||(u||ct(b,t,"in"),g&&at(b,t,"out"))}},{threshold:ss}),i=m=>{const x=ts(m||document,t);for(const b of x)r.has(b)||(r.add(b),d.observe(b),dt(b,t))};i();let f,y=null,h=null;if(s)(()=>{h==null&&(h=requestAnimationFrame(()=>{h=null;const x=We(void 0,t);for(const b of x)Te(b,t)}))})(),y=new MutationObserver(x=>{for(const b of x)if(b.type==="attributes"){const g=b.target;g instanceof HTMLElement&&(Te(g,t),lt(g)&&(r.has(g)||(r.add(g),d.observe(g),dt(g,t))))}else if(b.type==="childList"&&b.addedNodes&&b.addedNodes.length){for(const g of Array.from(b.addedNodes))if(g instanceof HTMLElement){const j=We(g,t);for(const L of j)Te(L,t);i(g)}}}),y.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["class",`data-${t}-scroll`,`data-${t}-start`,`data-${t}-end`,`data-${t}-paused`,`data-${t}-run`]}),f=()=>{h!=null&&cancelAnimationFrame(h),y&&y.disconnect()};else{let m;We(void 0,t).length>0&&Promise.resolve().then(()=>require("./scrollDriven.js")).then(b=>{m=b.initScrollViewFallback({once:n})}),f=()=>{typeof m=="function"&&m()}}return()=>{f&&f(),typeof window<"u"&&window.removeEventListener("scroll",a),d.disconnect()}}const rs=_e,os=_e,be=({anchorRef:e,position:t="bottom",children:n,style:s,...r})=>{const u=`--anchor-${o.useId().replace(/:/g,"")}`,[a,d]=o.useState(!1);if(o.useLayoutEffect(()=>{typeof CSS<"u"&&CSS.supports("anchor-name","--a")&&d(!0)},[]),o.useLayoutEffect(()=>{if(a&&e.current){const f=e.current;return f.style.anchorName=u,()=>{e.current&&(e.current.style.anchorName="")}}},[a,e,u]),a){const f={position:"fixed",margin:0,zIndex:9999,positionAnchor:u,positionArea:t,positionTryFallbacks:"flip-block, flip-inline",...s};return Ve.createPortal(l.jsx("div",{style:f,...r,children:n}),document.body)}const i={position:"absolute",pointerEvents:"auto",...s};switch(t){case"top":i.bottom="100%",i.left="50%",i.transform="translateX(-50%)";break;case"top-left":i.bottom="100%",i.left=0;break;case"top-right":i.bottom="100%",i.right=0;break;case"bottom":i.top="100%",i.left="50%",i.transform="translateX(-50%)";break;case"bottom-left":i.top="100%",i.left=0;break;case"bottom-right":i.top="100%",i.right=0;break;case"left":i.right="100%",i.top="50%",i.transform="translateY(-50%)";break;case"right":i.left="100%",i.top="50%",i.transform="translateY(-50%)";break}return l.jsx(St,{targetRef:e,children:l.jsx("div",{style:i,...r,children:n})})},Et=({variant:e,disableTextMargins:t,disabled:n,iconPosition:s,icon:r,isActive:c,loading:u,shape:a,onToggle:d,size:i,allowShapeTransformation:f})=>({button:p(" relative cursor-pointer group/button outline-none inline-block flex w-fit 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&&c)&&{"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&&!c,"bg-primary text-on-primary":!n&&c,"text-on-surface/[38%]":n},e==="filled"&&{"hover:shadow-1":!n,"bg-surface-container text-on-surface-variant":!n&&!c&&d,"bg-primary text-on-primary":!n&&(c&&d||!d),"text-on-surface/[38%]":n},e==="tonal"&&{"hover:shadow-1":!n,"bg-secondary-container text-on-secondary-container":!n&&!c,"bg-secondary text-on-secondary":!n&&c,"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&&!c,"text-inverse-on-surface bg-inverse-surface border-inverse-surface":!n&&c}],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:p("absolute -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/2 h-12 w-full"),stateLayer:p("overflow-hidden",a==="rounded"&&{"rounded-[30px]":i==="xSmall"||i=="small","rounded-[40px]":i==="medium","rounded-[70px]":i==="large"||i=="xLarge"},(a==="squared"||f&&c)&&{"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:p({invisible:u}),icon:p({invisible:u},i==="xSmall"&&"size-5",i==="small"&&"size-5",i==="medium"&&"size-6",i==="large"&&"size-8",i==="xLarge"&&"size-10")}),is=ne("button",Et),Nt=Z("button",Et),kt=({variant:e,interactive:t})=>({card:p(" 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 cursor-pointer":t})}),ls=ne("card",kt),jt=Z("card",kt),Ye=()=>({carouselItem:p("rounded-[28px] overflow-hidden flex-none",{})}),as=ne("carouselItem",Ye),Lt=Z("carouselItem",Ye),Mt=()=>({carousel:p(["w-full h-[400px]"]),track:p("flex h-full w-full")}),cs=ne("carousel",Mt),It=Z("carousel",Mt),Ct=({isChecked:e,isIndeterminate:t,isDisabled:n,isError:s,isFocused:r,isHovered:c})=>({checkbox:p("inline-flex items-center justify-center relative size-4.5 ",{"pointer-events-none opacity-[0.38]":n}),input:p("absolute inset-0 w-full h-full opacity-0 z-10 cursor-pointer"),container:p("relative flex items-center justify-center w-[18px] h-[18px] "),box:p("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":!s&&!n,"border-error":s&&!n,"border-on-surface":n},(e||t)&&{"bg-primary border-primary":!s&&!n,"bg-error border-error":s&&!n,"bg-on-surface border-on-surface":n}),icon:p("z-10 relative text-on-primary w-full h-full flex items-center justify-center pointer-events-none",{"text-on-error":s&&!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"}),us=ne("checkbox",Ct),Rt=Z("checkbox",Ct),Dt=({variant:e,disabled:t,trailingIcon:n,icon:s,isActive:r,isInteractive:c,activated:u,isFocused:a,isDragging:d,isEditing:i})=>({chip:p(" group/chip px-3 py-1.5 rounded-lg flex items-center gap-2 outline-none",{"pl-2":s,"pr-2":n,"cursor-pointer":!t&&c},{" text-on-surface-variant":!u&&!a||i,"bg-secondary-container text-on-secondary-container":(u||a)&&!i},d&&["opacity-100 cursor-grabbing shadow-3"],e==="outlined"&&["border border-outline-variant",{"border-transparent":i}],e==="elevated"&&!i&&["shadow-1 bg-surface-container-low","border border-outline-variant"]),stateLayer:p("rounded-lg overflow-hidden",{}),label:p("outline-none text-nowrap",{"opacity-[0.38]":t}),leadingIcon:p("text-primary size-[18px]",{"opacity-[0.38]":t}),trailingIcon:p("cursor-pointer size-[18px]",{"opacity-[0.38]":t})}),ds=ne("chip",Dt),At=Z("chip",Dt),Ft=({scrollable:e})=>({chips:p(" flex gap-3 outline-none",{"flex-wrap":!e,"overflow-x-auto":e})}),fs=ne("chips",Ft),Pt=Z("chips",Ft),$t=({orientation:e})=>({divider:p("border-outline-variant ",{"h-fit w-full border-t":e==="horizontal"},{"h-auto self-stretch w-fit border-l":e==="vertical"})}),hs=ne("divider",$t),Tt=Z("divider",$t),Wt=({size:e,variant:t,extended:n})=>({fab:p("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:p({"size-6":e=="small"||e=="medium","size-9":e=="large"}),label:p("text-nowrap",{"text-title-medium":e=="small","text-title-large":e=="medium","text-headline-small":e=="large"})}),ms=ne("fab",Wt),Ot=Z("fab",Wt),Bt=({size:e,variant:t,open:n})=>({fabMenu:p("relative inline-flex flex-col items-end"),actions:p("flex flex-col gap-1 items-end absolute bottom-[calc(100%_+_8px)] right-0"),label:p("text-nowrap")}),ps=ne("fabMenu",Bt),Ht=Z("fabMenu",Bt),Vt=({variant:e,disabled:t,onToggle:n,isActive:s,size:r,width:c,shape:u,allowShapeTransformation:a})=>({iconButton:p("rounded-full relative flex transition-all duration-300","group/icon-button cursor-pointer",{"cursor-default":t},u==="rounded"&&{"rounded-[30px]":r==="xSmall"||r=="small","rounded-[40px]":r==="medium","rounded-[70px]":r==="large"||r=="xLarge"},(u==="squared"||a&&s)&&{"rounded-[12px]":r==="xSmall"||r=="small","rounded-[16px]":r==="medium","rounded-[28px]":r==="large"||r=="xLarge"},a&&!t&&{"active:rounded-[12px]":r==="xSmall"||r=="small","active:rounded-[16px]":r==="medium","active:rounded-[28px]":r==="large"||r=="xLarge"},e==="filled"&&[!t&&{"bg-surface-container":!s&&!!n,"bg-primary":s||!n},!!t&&"bg-on-surface/[0.12]"],e==="tonal"&&[!t&&{"bg-secondary-container text-on-secondary-container":!s&&!!n,"bg-secondary text-on-secondary":s||!n},!!t&&"bg-on-surface/[0.12]"],e==="outlined"&&[!t&&{"border border-outline":!s,"border border-transparent bg-inverse-surface":s},!!t&&{"border border-on-surface/[0.12]":!s,"border border-transparent bg-on-surface/[0.12]":s}]),touchTarget:p("absolute -translate-x-1/2 -translate-y-1/2 left-1/2 top-1/2 h-12 w-full"),stateLayer:p("absolute top-0 left-0 h-full w-full overflow-hidden",(u==="rounded"||u==="squared"&&n&&!t&&s&&a)&&{"rounded-[30px]":r==="xSmall"||r=="small","rounded-[40px]":r==="medium","rounded-[70px]":r==="large"||r=="xLarge"},(u==="squared"||u==="rounded"&&n&&!t&&s&&a)&&{"rounded-[12px]":r==="xSmall"||r=="small","rounded-[16px]":r==="medium","rounded-[28px]":r==="large"||r=="xLarge"},a&&!t&&{"group-active/icon-button:rounded-[12px]":r==="xSmall"||r=="small","group-active/icon-button:rounded-[16px]":r==="medium","group-active/icon-button:rounded-[28px]":r==="large"||r=="xLarge"},!t&&[e==="standard"&&{"state-on-surface-variant":!s,"state-primary":s},e==="filled"&&{"state-primary":!s&&!!n,"state-inverse-on-surface":s||!n},e==="tonal"&&{"state-on-surface-variant":!s&&!!n,"state-on-secondary-container":s||!n},e==="outlined"&&{"state-on-surface-variant":!s,"state-on-primary":s}]),icon:p(" transition-all duration-300",{"size-5 p-1.5":r==="xSmall"},{"size-6 p-2":r==="small"},{"size-6 p-4":r==="medium"},{"size-8 p-8":r==="large"},{"size-10 p-12":r==="xLarge"},c=="narrow"&&[{"px-1":r==="xSmall"},{"px-1":r==="small"},{"px-3":r==="medium"},{"px-4":r==="large"},{"px-8":r==="xLarge"}],c=="wide"&&[{"px-2.5":r==="xSmall"},{"px-3.5":r==="small"},{"px-6":r==="medium"},{"px-12":r==="large"},{"px-[72px]":r==="xLarge"}],!t&&[e==="standard"&&{"text-on-surface-variant":!s,"text-primary":s},e==="filled"&&{"text-primary":!s&&!!n,"text-on-primary":s||!n},e==="outlined"&&{"text-on-surface-variant":!s,"text-inverse-on-surface":s}],!!t&&"text-on-surface/[0.38]")}),ys=ne("iconButton",Vt),zt=Z("iconButton",Vt),_t=({variant:e,hasGroups:t})=>({menu:p("z-50 min-w-[112px] max-w-[280px] max-h-[300px] ","flex flex-col",{"overflow-y-auto":!t},{"bg-surface-container":!e||e==="standard","bg-tertiary-container text-on-tertiary-container":e==="vibrant","py-0.5 shadow-2 px-1 rounded-2xl":!t,"bg-transparent ":t})}),xs=ne("menu",_t),Yt=Z("menu",_t),qt=({variant:e})=>({menuGroup:p("flex flex-col gap-0.5 mb-0.5 last:mb-0","rounded-lg py-0.5 px-1 shadow-2 first:rounded-t-2xl last:rounded-b-2xl",{"bg-surface-container":e==="standard","bg-tertiary-container text-on-tertiary-container":e==="vibrant"}),groupLabel:p("px-3 pt-2 text-label-small tracking-wide ",{"text-on-surface-variant":e==="standard","text-on-tertiary-container opacity-80":e==="vibrant"})}),vs=ne("menuGroup",qt),Ut=Z("menuGroup",qt),Xt=({variant:e,isVisible:t})=>({progressIndicator:p((e==="linear-determinate"||e=="linear-indeterminate")&&"flex w-full h-1",e==="linear-indeterminate"&&"relative overflow-hidden rounded-full"),firstTrack:p((e==="linear-determinate"||e==="linear-indeterminate")&&"h-full rounded-full bg-primary-container",{"max-h-0":!t,"max-h-full":t}),activeIndicator:p("h-full rounded-full bg-primary",e==="linear-determinate"&&{"rounded-l-full":!0},(e==="linear-indeterminate"||e==="linear-determinate")&&{"max-h-0":!t,"max-h-full":t},(e==="circular-determinate"||e=="circular-indeterminate")&&["stroke-primary fill-transparent ",{"stroke-[4px]":t,"stroke-[0px]":!t}]),lastTrack:p((e==="linear-determinate"||e=="linear-indeterminate")&&"h-full flex-1 rounded-full bg-primary-container",{"max-h-0":!t,"max-h-full":t}),stop:p("absolute top-1/2 -translate-y-1/2 right-0 bg-primary rounded-full size-1",{"max-h-0":!t,"max-h-full":t})}),gs=ne("progressIndicator",Xt),Gt=Z("progressIndicator",Xt),qe=({variant:e,position:t})=>({sideSheet:p("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:p("w-full overflow-hidden flex flex-col",{}),header:p("p-4 flex items-center gap-2"),content:p("flex-1 overflow-y-auto"),title:p("text-on-surface-variant text-title-large"),closeButton:p("ml-auto"),divider:p({hidden:e=="modal"}),overlay:p("bg-[black]/[0.32] fixed top-0 left-0 w-screen h-screen")}),Kt=ne("sideSheet",qe),ws=Z("sideSheet",qe),Ue=({isChanging:e})=>({slider:p(["relative w-full h-11 flex items-center rounded gap-x-1.5 cursor-pointer min-w-32"]),activeTrack:p(["h-4 relative transition-all duration-100 bg-primary overflow-hidden rounded-l-full "]),inactiveTrack:p(["h-4 relative transition-all duration-100 bg-primary-container rounded-r-full overflow-hidden"]),handle:p(["transform relative transition-all duration-100 bg-primary h-full rounded-full ",{"w-0.5":e,"w-1":!e}]),valueIndicator:p(["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:p(["h-1 w-1 absolute transform -translate-y-1/2 -translate-x-1/2 top-1/2 rounded-full"])}),bs=ne("slider",Ue),Jt=Z("slider",Ue),Zt=()=>({snackbar:p(" rounded bg-inverse-surface "),container:p("pl-4 pr-2 max-w-full py-1 flex items-center flex-wrap"),supportingText:p("text-body-medium text-inverse-on-surface "),icon:p(" ml-auto mr-0 text-inverse-on-surface block dark")}),Ss=ne("snackbar",Zt),Qt=Z("snackbar",Zt),en=({isSelected:e,disabled:t,inactiveIcon:n})=>({switch:p("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:p("flex items-center justify-center absolute",{"left-[14px]":!e},{"right-[14px]":e}),handle:p("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:p("w-[40px] h-[40px] -z-10 rounded-full absolute",{"group-state-primary":!t}),icon:p("w-[16px] h-[16px]",!t&&[{"text-on-primary-container":e},{"text-on-primary":!e}],{"text-on-surface/[0.38]":t})}),Es=ne("switch",en),tn=Z("switch",en),nn=({isSelected:e,icon:t,label:n,variant:s})=>({tab:p("flex-1 group/tab outline-none flex px-4 justify-center items-center cursor-pointer",{"z-10":e},!!(t&&n)&&s==="primary"&&"h-16",!(t&&n&&s==="primary")&&"h-12"),stateLayer:p("absolute w-full h-full overflow-hidden left-1/2 top-1/2 transform -translate-y-1/2 -translate-x-1/2",s==="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},s==="secondary"&&"group-hover/tab:hover-state-on-surface group-focus-visible/tab:focus-state-on-surface"),content:p("flex gap-0.5 h-full justify-center",{relative:s=="primary"},{"":!!(n&&!t)},s==="primary"&&"flex-col items-center",s==="secondary"&&{"flex-col items-center":!(n&&t),"flex-row items-center gap-2":!!(n&&t)}),icon:p("h-6 w-6 p-0.5 !box-border",s==="primary"&&{"text-on-surface-variant":!e,"text-primary":e},s==="secondary"&&{"text-on-surface-variant":!e,"text-on-surface":e}),label:p("text-title-small text-nowrap",s==="primary"&&{"text-on-surface-variant":!e,"text-primary":e},s==="secondary"&&{"text-on-surface-variant":!e,"text-on-surface":e}),underline:p("bg-primary absolute w-full left-0 bottom-0",s==="primary"&&"h-[3px] rounded-t",s==="secondary"&&"h-0.5")}),Ns=ne("tab",nn),sn=Z("tab",nn),rn=({scrollable:e})=>({tabs:p("border-b border-surface-container-highest bg-surface","flex relative ",{"overflow-x-auto":e})}),ks=ne("tabs",rn),on=Z("tabs",rn),ln=()=>({tabPanels:p("overflow-hidden")}),js=ne("tabPanels",ln),an=Z("tabPanels",ln),cn=()=>({tabPanel:p("")}),Ls=ne("tabPanel",cn),un=Z("tabPanel",cn),dn=({disabled:e,leadingIcon:t,trailingIcon:n,variant:s,errorText:r,isFocused:c,value:u,suffix:a,multiline:d})=>({textField:p({"opacity-[.38]":e}),content:p("group/text-field transition-border duration-200 relative flex items-center ",{"h-14":!d},{"border-on-surface-variant":!(r!=null&&r.length)&&!c&&s=="filled","border-outline":!(r!=null&&r.length)&&!c&&s=="outlined","border-primary":!(r!=null&&r.length)&&c,"border-error":!!(r!=null&&r.length)},{"bg-on-surface/[0.04]":e},s=="filled"&&["rounded-t overflow-hidden border-b",{"bg-surface-container-highest":!e}],s=="outlined"&&["border rounded box-border",{"border-[3px]":c}]),stateLayer:p("absolute -z-10 w-full h-full top-0 left-0",{hidden:s=="outlined"},{"group-state-on-surface":!e,"focus-state-on-surface":c}),label:p("inline-flex outline-none whitespace-nowrap",{"text-on-surface-variant":!e&&!(r!=null&&r.length)},{"text-on-surface":e},{"text-error":!!(r!=null&&r.length)},{"text-primary":!(r!=null&&r.length)&&c}),input:p("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},s=="filled"&&" pb-2 pt-6",s=="outlined"&&"py-4 relative z-10"),activeIndicator:p("absolute w-0 inset-x-0 border-rounded mx-auto bottom-0",s=="filled"&&["h-[2px] transition-all duration-300",{"bg-primary":!(r!=null&&r.length)},{"bg-error":!!(r!=null&&r.length)},{"!w-full":c}]),supportingText:p(" text-body-small px-4 pt-1",{"text-on-surface-variant":!e&&!(r!=null&&r.length)},{"text-on-surface":e},{"!w-full":c},{"text-error":!!(r!=null&&r.length)}),leadingIcon:p(["h-12 ml-3 flex items-center justify-center",{"cursor-text":!o.isValidElement(t)}]),trailingIcon:p("h-12 w-12 flex items-center justify-center",{"cursor-text":!o.isValidElement(n)}),suffix:p("text-on-surface-variant pl-0 pr-4",s=="filled"&&" pb-2 pt-6",s=="outlined"&&"py-4 relative z-10")}),Ms=ne("textField",dn),fn=Z("textField",dn),hn=({position:e,variant:t})=>({toolTip:p(" 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:p("pb-2",t=="rich"&&"px-4 pt-3 ",t=="plain"&&"px-2 py-1"),actions:p("flex gap-10 px-1 mt-2",t=="plain"&&"hidden"),subHead:p("text-title-small mb-1",t=="plain"&&"hidden"),supportingText:p(""),content:p("w-full")}),Is=ne("toolTip",hn),mn=Z("toolTip",hn),le=({icon:e,colors:t=[],className:n,...s})=>{if(typeof e=="string"){let f=e,y="";return t[0]&&(y=` fill="${t[0]}" color="${t[0]}"`,f=f.replace(/<path([^>]*?)>/g,'<path$1 fill="currentColor">')),f=f.replace(/<svg([^>]*)>/,(h,m)=>`<svg${m.replace(/\s+(width|height)=["'][^"']*["']/g,"")} width="100%" height="100%"${y}>`),l.jsx("div",{className:p("size-5 box-content inline-flex fill-current",n),style:{color:t[0]||""},dangerouslySetInnerHTML:{__html:f}})}if(e&&typeof e=="object"&&"src"in e){const f=e;return l.jsx("img",{src:f.src,width:f.width,height:f.height,className:p("size-5 box-content",n),style:{filter:t[0]?"brightness(0) saturate(100%) invert(1)":void 0},alt:"","aria-hidden":"true"})}const r=e;if(!(r!=null&&r.prefix))throw new Error(`Invalid icon type: ${typeof e}`);const{icon:c}=r,[u,a,,,d]=c||[],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 l.jsx("svg",{className:p("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",...s,children:typeof d=="string"?l.jsx("path",{className:"fill-current",d}):d.map((f,y)=>l.jsx("path",{d:f},y))})},pn=({variant:e="linear-determinate",value:t=0,transitionDuration:n=1e3,className:s,...r})=>{const[c,u]=o.useState(t),[a]=o.useState(1.5);o.useEffect(()=>{t>100&&(t=100),t<0&&(t=0),u(t)},[t]);const[d,i]=o.useState(!0),f=()=>d?a:a*.5;o.useEffect(()=>{if(e==="circular-indeterminate"&&c!==100){const x=setInterval(()=>{u(d?20:40),i(!d)},f()*1e3);return()=>clearInterval(x)}},[e,d,c]);const[y,h]=o.useState(!1);o.useEffect(()=>{if(c>=100){const x=setTimeout(()=>{h(!1)},n);return()=>{clearTimeout(x)}}else h(!0)},[c,n]);const m=Gt({className:s,variant:e,value:t,transitionDuration:n,isVisible:y});return l.jsxs(l.Fragment,{children:[e==="linear-indeterminate"&&l.jsxs("div",{className:m.progressIndicator,...r,children:[l.jsx(Y.motion.div,{animate:{width:["0%","0%","0%","20%"],marginLeft:["0px","0px","6px","6px"],marginRight:["0px","0px","6px","6px"]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut",times:[0,.499,.5,1]},style:{flexShrink:0},className:m.activeIndicator}),l.jsx(Y.motion.div,{animate:{width:["0%","40%","100%"]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut"},style:{flexShrink:0},className:m.firstTrack}),l.jsx(Y.motion.div,{animate:{width:["20%","60%","20%"]},transition:{duration:1.5,repeat:1/0,ease:"easeInOut",times:[0,.5,1]},style:{flexShrink:0,marginLeft:"6px"},className:m.activeIndicator}),l.jsx("div",{style:{marginLeft:"6px"},className:m.lastTrack})]}),e==="linear-determinate"&&l.jsxs("div",{className:m.progressIndicator,...r,children:[l.jsx("div",{style:{width:`${c}%`,transition:`width ${n}ms ease-in-out ${c==100?", max-height 200ms 0.5s ease-in-out":""}`},className:m.activeIndicator}),l.jsx("div",{style:{marginLeft:c!=100?"6px":"0px",transition:`width ${n}ms ease-in-out ${c==100?`, max-height 200ms 0.5s ease-in-out, margin-left ${n}ms ${n/1.5}ms`:""}`},className:m.lastTrack}),l.jsx("div",{style:{width:"4px",transition:`width ${n}ms ease-in-out, max-height 200ms 0.5s ease-in-out`},className:m.stop})]}),(e==="circular-determinate"||e=="circular-indeterminate")&&l.jsx(Y.motion.svg,{width:"48",height:"48",viewBox:"0 0 48 48",initial:{rotate:-90},animate:{rotate:e==="circular-indeterminate"?270:-90},transition:e==="circular-indeterminate"?{repeat:1/0,duration:f(),ease:"linear"}:{duration:n/1e3},className:m.progressIndicator,...r,children:l.jsx(Y.motion.circle,{cx:"50%",cy:"50%",r:y?"calc(50% - 2px)":"50%",style:{strokeLinecap:"round"},initial:e==="circular-indeterminate"?"hidden":"determinate",animate:e==="circular-indeterminate"?"visible":"determinate",className:m.activeIndicator,variants:{hidden:{pathLength:d?10/100:90/100},visible:{pathLength:d?90/100:10/100},determinate:{pathLength:c/100}},transition:{pathLength:e==="circular-indeterminate"?{type:"tween",ease:"linear",duration:f(),bounce:0}:{type:"tween",ease:"easeInOut",duration:n/1e3}}})},e==="circular-indeterminate"?d+"":"static")]})};function Cs(e){const t={primary:"filled",secondary:"tonal"};return e&&e in t?t[e]:e||"filled"}const me=({variant:e="filled",disabled:t=!1,icon:n,href:s,label:r,disableTextMargins:c,className:u,iconPosition:a="left",loading:d=!1,shape:i="rounded",onClick:f,onToggle:y,activated:h,ref:m,size:x="medium",allowShapeTransformation:b=!0,transition:g,children:j,...L})=>{if(j&&(r=j),!r)throw new Error("Button component requires either a label prop or children content");e=Cs(e);const w=s?"a":"button",C=o.useRef(null),I=m||C,[v,E]=o.useState(h);o.useEffect(()=>{E(h)},[h]),g={duration:.3,...g};const R=k=>{t&&k.preventDefault(),y?(E(!v),y(!v)):f&&f(k)},M=Nt({allowShapeTransformation:b,size:x,disableTextMargins:c,shape:i,href:s,disabled:t,icon:n,iconPosition:a,loading:d,variant:e,transition:g,className:u,isActive:v??!1,onToggle:y,activated:v,label:r,children:r}),W=n?l.jsx(le,{icon:n,className:M.icon}):l.jsx(l.Fragment,{});return l.jsxs(w,{ref:I,href:s,className:M.button,...L,onClick:R,disabled:t,"aria-pressed":y?v:void 0,style:{transition:g.duration+"s"},children:[l.jsx("div",{className:M.touchTarget}),l.jsx(ue,{style:{transition:g.duration+"s"},className:M.stateLayer,colorName:p(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,d&&l.jsx("div",{className:"!absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2",children:l.jsx(pn,{className:()=>({progressIndicator:"h-6 w-6",activeIndicator:p({"!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"})}),l.jsx("span",{className:M.label,children:r}),a==="right"&&W]})},Rs=({variant:e="outlined",className:t,children:n,interactive:s=!1,ref:r,...c})=>{const u=jt({className:t,interactive:s,variant:e,children:n}),a=o.useRef(null),d=r||a;return l.jsxs("div",{...c,ref:d,className:u.card,children:[s&&l.jsx(ue,{className:u.stateLayer,colorName:"on-surface",stateClassName:"state-ripple-group-[card]"}),n]})},ve=(e,t,n=[0,1])=>{const[s,r]=t,[c,u]=n,d=(Math.max(s,Math.min(e,r))-s)/(r-s);return c+d*(u-c)},yn=({className:e,children:t,width:n,index:s=0,outputRange:r,ref:c,...u})=>{const a=o.useRef(null),d=c||a,i=Lt({className:e,index:s,children:t});return l.jsx("div",{ref:d,style:{width:"var(--carousel-item-width, 100%)",maxWidth:r?r[1]+"px":void 0,minWidth:r?r[0]+"px":void 0},className:i.carouselItem,...u,children:t})},Ds=({variant:e="hero",className:t,children:n,ref:s,marginPourcent:r=0,inputRange:c=[.21,.65],outputRange:u=[42,300],gap:a=8,onChange:d,onMetricsChange:i,index:f,scrollSensitivity:y=1.25,...h})=>{const m=o.useRef(null),x=s||m,b=It({index:f,className:t,children:n,variant:e,inputRange:c,outputRange:u,marginPourcent:r,onChange:d,gap:a,scrollSensitivity:y,onMetricsChange:i}),g=o.Children.toArray(n).filter(F=>o.isValidElement(F)&&F.type===yn),j=o.useRef(null),L=o.useRef({scrollProgress:0,scrollTotal:0,scrollVisible:0,scroll:0}),w=o.useRef(0),C=o.useRef(null),I=o.useRef([]).current,[v,E]=o.useState(0);I.length!==g.length&&(I.length=0,g.forEach((F,T)=>{I[T]=o.createRef()}));const R=o.useCallback(()=>{if(!j.current||!x.current)return;const F=w.current,T=L.current.scrollVisible||x.current.clientWidth||0;function G(B,ee){return B.map((oe,pe)=>{const Se=(oe-ee)/Math.abs(B[1]-B[0]);return{itemScrollXCenter:oe,relativeIndex:Se,index:pe,width:0}})}const S=g.map((B,ee)=>{const oe=ee/Math.max(1,g.length-1);return ve(oe,[0,1],[0,1])}),N=G(S,F).sort((B,ee)=>B.index-ee.index);let D=T+a+u[0]+a,q=v;const U=N.sort((B,ee)=>Math.abs(B.relativeIndex)-Math.abs(ee.relativeIndex)).map((B,ee)=>{if(!(D<=0)){if(ee===0&&(q=B.index),B.width=ve(D-a,[u[0],u[1]],[u[0],u[1]]),D-=B.width+a,D!==0&&D<(u[0]+a)*2){const oe=B.width-((u[0]+a)*2-D);D+=B.width,B.width=oe,D-=B.width}else if(D===0&&B.width>=u[0]*2+a){const oe=B.width-(u[0]+a-D);D+=B.width,B.width=oe,D-=B.width}return B}}).filter(Boolean),J=[...U].reverse(),te=[...U].sort((B,ee)=>Math.abs(B.index)-Math.abs(ee.index));J.forEach((B,ee)=>{const oe=J[ee+1];if(!oe)return;const pe=1-(Math.abs(B.relativeIndex)-Math.abs(oe.relativeIndex)),Se=ve(pe,[0,2],[B.width+D,oe.width]);D+=B.width,B.width=Se,D-=B.width});const se=U.length/2,P=ve(Math.abs(te[0].relativeIndex),[te[0].index===0?0:se-1,se],[0,1]),_=ve(P,[0,1],[0,1])*-(u[0]+a);I.forEach((B,ee)=>{if(B.current){const oe=U.find(pe=>pe.index===ee);oe?(B.current.style.setProperty("--carousel-item-width",`${oe.width}px`),B.current.style.display="block"):(B.current.style.setProperty("--carousel-item-width",`${u[0]}px`),B.current.style.display="none")}}),j.current.style.transform=`translateX(${_}px)`,q!==v&&E(q)},[g.length,u,a,v]);o.useLayoutEffect(()=>{R()},[R,g.length]),o.useEffect(()=>{d&&d(v)},[v,d]);const[M,W]=o.useState(0);o.useEffect(()=>{W(v)},[v]);const k=(F,T={})=>{if(!g.length)return 0;const G=I[F];if(!G||!G.current||!j.current)return 0;const S=ve(F/Math.max(1,g.length-1),[0,1],[0,1]);return W(F),j.current.dispatchEvent(new CustomEvent("udx:customScroll:set",{bubbles:!0,detail:{progress:S,orientation:"horizontal",animate:T.animate!==!1}})),S};o.useEffect(()=>{typeof f=="number"&&g.length>0&&f!==v&&k(f)},[f,g.length]);const X=F=>{var T;if(L.current=F,F.scrollTotal>0){(T=C.current)==null||T.stop();const G=w.current??0,S=F.scrollProgress??0;C.current=Y.animate(G,S,{type:"spring",stiffness:260,damping:32,mass:.6,restDelta:5e-4,onUpdate:N=>{w.current=N,requestAnimationFrame(()=>{R()})}})}},V=o.useRef(i);o.useEffect(()=>{V.current=i},[i]);const Q=o.useRef(null);o.useEffect(()=>{const F=V.current;if(!F||!(x!=null&&x.current)||g.length<=0)return;const T=g.length,G=x.current.clientWidth||0,S=u[1],N=w.current,D=(G+a)/(S+a),q=Math.max(1,Math.floor(D)),U=Math.max(1,Math.round(q*(2/3))),J=Math.min(Math.max(0,v),Math.max(0,T-1)),te={total:T,selectedIndex:J,visibleApprox:D,visibleFull:q,stepHalf:U,canPrev:J>0,canNext:J<T-1,scrollProgress:N,viewportWidth:G,itemMaxWidth:S,gap:a},se=Q.current;let P=!se;if(!P){for(const _ in te)if(te[_]!==se[_]){P=!0;break}}P&&(Q.current=te,F(te))},[x,g.length,v,a,u]),o.useEffect(()=>()=>{var F;(F=C.current)==null||F.stop()},[]);const[z,$]=o.useState(0);o.useLayoutEffect(()=>{let F=u[1];const T=L.current;T&&F>T.scrollVisible&&T.scrollVisible>0&&(F=T.scrollVisible);const G=(F+a)*g.length/y;$(G||400)},[x,g.length,a,u,y]);const A=F=>{if(!g.length)return;const T=M??v;switch(F.key){case"ArrowLeft":F.preventDefault(),k(Math.max(0,T-1));break;case"ArrowRight":F.preventDefault(),k(Math.min(g.length-1,T+1));break;case"Home":F.preventDefault(),k(0);break;case"End":F.preventDefault(),k(g.length-1);break;case"Enter":case" ":F.preventDefault(),k(T);break}};o.useEffect(()=>{const F=x.current;if(!F)return;const T=G=>{const S=G.detail;S&&typeof S.index=="number"&&k(S.index)};return F.addEventListener("udx:carousel:centerIndex",T),()=>{F.removeEventListener("udx:carousel:centerIndex",T)}},[x,g.length]);const O=g.map((F,T)=>{var N;const G=(N=F.props)==null?void 0:N.onClick,S=D=>{G==null||G(D)};return o.cloneElement(F,{outputRange:u,ref:I[T],key:T,index:T,role:"option","aria-selected":v===T,tabIndex:v===T?0:-1,onClick:S,onFocus:()=>W(T)})});return l.jsx("div",{className:b.carousel,ref:x,role:"listbox","aria-orientation":"horizontal",onKeyDown:A,...h,children:l.jsx(vt,{draggable:!0,orientation:"horizontal",onScroll:X,scrollSize:z,children:l.jsx("div",{className:b.track,ref:j,style:{gap:`${a}px`,willChange:"transform"},children:O})})})};/*!
|
|
2
2
|
* Font Awesome Free 7.2.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 2026 Fonticons, Inc.
|
|
5
|
-
*/var As={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"]},Fs={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"]},Ps={prefix:"fas",iconName:"chevron-up",icon:[448,512,[],"f077","M201.4 105.4c12.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 173.3 54.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z"]},xn={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"]},$s={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"]},Xe={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"]},ke={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"]},Ts=ke,vn={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"]},Ws={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"]},Os={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 Bs=({checked:e,defaultChecked:t,indeterminate:n=!1,disabled:s=!1,error:r=!1,onChange:c,id:u,name:a,value:d,style:i,className:f,...y})=>{const h=o.useId(),m=u||h,x=e!==void 0,[b,g]=o.useState(t??!1),j=x?e:b,[L,w]=o.useState(!1),C=o.useRef(null);o.useEffect(()=>{C.current&&(C.current.indeterminate=n)},[n]);const I=E=>{s||(x||g(E.target.checked),c&&c(E))},v=Rt({isChecked:!!j,isIndeterminate:n,isDisabled:s,isError:r,isFocused:L,isHovered:!1});return l.jsx("div",{className:p(v.checkbox,f,"group/checkbox"),style:i,children:l.jsxs(ue,{stateClassName:v.stateLayer,colorName:j||n?"primary":"on-surface",children:[l.jsx("input",{ref:C,type:"checkbox",id:m,name:a,value:d,checked:j,disabled:s,onChange:I,onFocus:()=>w(!0),onBlur:()=>w(!1),className:v.input,...y}),l.jsx("div",{className:v.box}),l.jsx(Y.AnimatePresence,{children:(j||n)&&l.jsx(Y.motion.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},transition:{duration:.15},className:v.icon,children:l.jsx(le,{icon:n?As:Xe,className:"size-3.5"})})})]})})},Be=({variant:e="outlined",disabled:t=!1,icon:n,href:s,label:r,className:c,onClick:u,onToggle:a,activated:d,ref:i,onRemove:f,editable:y,onEditStart:h,onEditCommit:m,onEditCancel:x,onChange:b,transition:g,children:j,editing:L,...w})=>{if(j&&(r=j),r===void 0&&!y)throw new Error("Chip component requires either a label prop or children content");const C=s?"a":"button",I=o.useRef(null),v=i||I,[E,R]=o.useState(d),[M,W]=o.useState(!1),[k,X]=o.useState(L&&y),[V,Q]=o.useState(!1),[z,$]=o.useState(typeof r=="string"?r:""),A=o.useRef(null);o.useEffect(()=>{R(d)},[d]),o.useEffect(()=>{if(L&&X(L),y&&M){const P=setTimeout(()=>{w!=null&&w.draggable&&V||X(!0)},1e3);return()=>clearTimeout(P)}else M||X(!1)},[M,y,V,w,z]),o.useEffect(()=>{if(k){$(typeof r=="string"?r:"");const P=te.current||A.current;if(P){P.focus();const _=document.createRange();_.selectNodeContents(P),_.collapse(!1);const B=window.getSelection();B==null||B.removeAllRanges(),B==null||B.addRange(_)}}},[k]),g={duration:.3,...g};const O=P=>{t&&P.preventDefault(),a?(R(!E),a(!E)):u&&u(P)},F=!!a||!!f||!!u||!!s||!!y;d&&(n=Xe);const{onFocus:T,onBlur:G,onKeyDown:S,onDragStart:N,onDragEnd:D,onDoubleClick:q,...U}=w??{},J=At({href:s,disabled:t,icon:n,variant:e,transition:g,className:c,isActive:E??!1,onToggle:a,activated:E,label:r,isInteractive:F,children:r,isFocused:M,isDragging:V,onEditCommit:m,isEditing:k}),te=o.useRef(null),se=()=>{const P=(z??"").trim();if(!P){f&&f();return}m==null||m(P)};return l.jsxs(C,{contentEditable:!1,ref:v,href:s,className:J.chip,...U,onClick:P=>{k||O(P)},draggable:!t&&!!(w!=null&&w.draggable),onDragStart:P=>{!t&&(w!=null&&w.draggable)&&Q(!0),N==null||N(P)},onDragEnd:P=>{w!=null&&w.draggable&&Q(!1),D==null||D(P)},onDoubleClick:P=>{!t&&y&&!k&&(h==null||h(),P.preventDefault(),P.stopPropagation()),q==null||q(P)},onFocus:P=>{F&&W(!0),T==null||T(P)},onBlur:P=>{W(!1),G==null||G(P)},onKeyDown:P=>{const _=P.key;if(!t&&k){_==="Enter"?(P.preventDefault(),se()):_==="Escape"?(P.preventDefault(),x==null||x()):f&&(z==null?void 0:z.trim())===""&&(_==="Backspace"||_==="Delete"||_==="Del")&&(P.preventDefault(),P.stopPropagation(),f());return}if(!t&&M){if(y&&!a&&(_==="F2"||_==="Enter")){P.preventDefault(),h==null||h();return}if(a&&(_==="Enter"||_===" "||_==="Spacebar")){P.preventDefault();const B=!E;R(B),a(B)}f&&(_==="Backspace"||_==="Delete"||_==="Del")&&(P.preventDefault(),P.stopPropagation(),f())}S==null||S(P)},disabled:t,"aria-pressed":a?E:void 0,style:{transition:g.duration+"s"},children:[F&&!t&&!k&&l.jsx(ue,{style:{transition:g.duration+"s"},className:J.stateLayer,colorName:p({"on-surface-variant":!E,"on-secondary-container":E}),stateClassName:"state-ripple-group-[chip]"}),n&&l.jsx(le,{icon:n,className:J.leadingIcon}),l.jsx("span",{ref:te,contentEditable:!!y&&!!k,suppressContentEditableWarning:!0,className:J.label,role:y?"textbox":void 0,spellCheck:!1,onInput:P=>{const _=P.currentTarget.innerText;$(_),b==null||b(_)},onBlur:P=>{y&&k&&se()},onKeyDown:P=>{if(y&&k&&P.key==="Enter"){P.preventDefault(),P.stopPropagation(),se();return}y&&k&&P.key==="Escape"&&(P.preventDefault(),P.stopPropagation(),x==null||x())},children:r}),f&&!k&&l.jsx(le,{icon:ke,className:J.trailingIcon,onMouseDown:P=>{P.preventDefault(),P.stopPropagation()},onClick:P=>{P.stopPropagation(),t||f()}})]})},Hs=({variant:e,disabled:t,isActive:n})=>({menuItem:p("group/menu-item text-start overflow-hidden flex items-center h-12 px-3 cursor-pointer outline-none select-none shrink-0 ","text-label-large","transition-colors duration-200","rounded-xl",{"text-on-surface":!e||e==="standard","opacity-38 pointer-events-none":t},(e==="vibrant"||n)&&["bg-secondary-container text-on-secondary-container"]),itemLabel:p("flex-1 truncate"),itemIcon:p("w-6 h-6 flex items-center justify-center menu-item-icon"),leadingIcon:p("mr-3"),trailingIcon:p("ml-3")}),Vs=Z("menuItem",Hs),Ce=({label:e,children:t,leadingIcon:n,trailingIcon:s,disabled:r,variant:c="standard",href:u,onClick:a,onToggle:d,activated:i=!1,className:f,...y})=>{let h=null;const m=[];o.Children.forEach(t,k=>{var X,V;o.isValidElement(k)&&(((X=k.type)==null?void 0:X.name)==="Menu"||((V=k.type)==null?void 0:V.displayName)==="Menu")?h=k:m.push(k)});const x=m.length>0?m:e,[b,g]=o.useState(!1),[j,L]=o.useState(i);j&&(n=Xe);const w=o.useRef(null),C=o.useRef(null);o.useEffect(()=>{L(i)},[i]);const I=Vs({variant:c,disabled:r,className:f,activated:j,isActive:j}),v=k=>{if(console.log("refrefd",r,h,d),r){k.preventDefault();return}if(h){k.stopPropagation();return}d?(L(!j),d(!j)):(console.log("click",a),a==null||a(k))},E=()=>{C.current&&(clearTimeout(C.current),C.current=null),!r&&h&&g(!0)},R=()=>{h&&(C.current=setTimeout(()=>{g(!1)},150))};o.useEffect(()=>()=>{C.current&&clearTimeout(C.current)},[]);const M=s??(h?xn:void 0),W=u?"a":"button";return l.jsxs(W,{ref:w,href:u,className:I.menuItem,onClick:v,onMouseEnter:E,onMouseLeave:R,role:"option","aria-haspopup":!!h,"aria-expanded":b,"aria-pressed":d?j:void 0,tabIndex:r?-1:0,disabled:u?void 0:r,onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),h?g(!b):v(k)),k.key==="ArrowRight"&&h&&(g(!0),k.stopPropagation()),k.key==="ArrowLeft"&&b&&(g(!1),k.stopPropagation())},...y,children:[l.jsx(ue,{className:"absolute inset-0 pointer-events-none",colorName:p(c==="vibrant"||j?"on-tertiary-container":"on-secondary-container"),stateClassName:"state-ripple-group-[menu-item]"}),n&&l.jsx("div",{className:p(I.itemIcon,I.leadingIcon,"z-10 relative"),children:o.isValidElement(n)?n:l.jsx(le,{icon:n})}),l.jsx("span",{className:p(I.itemLabel,"z-10 relative"),children:x}),M&&l.jsx("div",{className:p(I.itemIcon,I.trailingIcon,"z-10 relative"),children:o.isValidElement(M)?M:l.jsx(le,{icon:M})}),h&&b&&l.jsx(be,{anchorRef:w,position:"inline-end span-block-end",hoverOpen:!0,children:l.jsx("div",{onMouseEnter:E,onMouseLeave:R,children:h})})]})},je=({orientation:e="horizontal",className:t,...n})=>{const s=Tt({orientation:e,className:t});return l.jsx("hr",{className:s.divider,...n})},zs=({props:e})=>({headline:p("px-3 py-1 text-label-small opacity-60 mt-1",{"text-on-surface-variant":!(e!=null&&e.variant)||e.variant==="standard"})}),_s=Z("menu-headline",zs),Ge=({label:e,children:t,variant:n,className:s,...r})=>{const c=_s({variant:n,className:s});return l.jsx("div",{className:c.headline,role:"group","aria-label":e,...r,children:t??e})},He=({children:e,className:t,variant:n,label:s,...r})=>{const c=Ut({children:e,className:t,variant:n,label:s,...r});return l.jsxs("div",{className:c.menuGroup,role:"group",...r,children:[s&&l.jsx("div",{className:c.groupLabel,children:s}),e]})},Ke=({children:e,className:t,variant:n="standard",...s})=>{const r=o.Children.toArray(e).some(d=>o.isValidElement(d)&&d.type===He),c=Yt({children:e,className:t,variant:n,hasGroups:r,...s}),u=o.useRef(null),a=d=>o.Children.map(d,i=>{if(!o.isValidElement(i))return i;if(i.type===He){const f=a(i.props.children);return o.cloneElement(i,{children:f,variant:n})}return i.type===Ce?o.cloneElement(i,{variant:i.props.variant??n}):i.type===Ge?o.cloneElement(i,{variant:n}):i.type===je?o.cloneElement(i,{className:p("my-1",i.props.className)}):i});return l.jsxs("div",{ref:u,className:c.menu,role:"listbox",...s,children:[a(e),o.Children.count(e)===0&&l.jsx("div",{className:"px-4 py-3 text-on-surface-variant opacity-60 italic text-body-medium",children:"No options"})]})},Ys=({trigger:e,children:t,...n})=>{const[s,r]=o.useState(null),c=o.useRef(null),u=f=>{f.preventDefault(),r({mouseX:f.clientX,mouseY:f.clientY})},a=()=>{r(null)},d=()=>{a()};o.useEffect(()=>{if(!s)return;const f=()=>r(null);return window.addEventListener("click",f),window.addEventListener("scroll",f,!0),()=>{window.removeEventListener("click",f),window.removeEventListener("scroll",f,!0)}},[s]);const i=o.isValidElement(e)?o.cloneElement(e,{onContextMenu:f=>{var y,h;u(f),(h=(y=e.props).onContextMenu)==null||h.call(y,f)}}):l.jsx("div",{onContextMenu:u,className:"inline-block",children:e});return l.jsxs(l.Fragment,{children:[i,l.jsx("div",{ref:c,style:{position:"fixed",top:(s==null?void 0:s.mouseY)??0,left:(s==null?void 0:s.mouseX)??0,width:1,height:1,pointerEvents:"none",visibility:"hidden"}}),s&&l.jsx(be,{anchorRef:c,position:"bottom right",onClick:f=>f.stopPropagation(),children:l.jsx(Ke,{onClick:d,...n,children:t})})]})},ie=[];for(let e=0;e<256;++e)ie.push((e+256).toString(16).slice(1));function qs(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 Oe;const Us=new Uint8Array(16);function Xs(){if(!Oe){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Oe=crypto.getRandomValues.bind(crypto)}return Oe(Us)}const Gs=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ft={randomUUID:Gs};function gn(e,t,n){var r;if(ft.randomUUID&&!e)return ft.randomUUID();e=e||{};const s=e.random??((r=e.rng)==null?void 0:r.call(e))??Xs();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,qs(s)}const Ks=({variant:e="input",className:t,scrollable:n=!0,draggable:s=!1,items:r,onItemsChange:c})=>{const u=r??[],a=o.useRef(null),[d,i]=o.useState(!1),f=o.useRef(new WeakMap),y=o.useCallback(v=>{const E=f.current;let R=E.get(v);return R||(R=gn(),E.set(v,R)),R},[]);o.useEffect(()=>{var v,E;d&&(e=="input"?(v=C.current)==null||v.focus():(E=a.current)==null||E.focus())},[d]);const h=o.useRef([]),m=o.useRef(!1),x=o.useCallback(v=>{c==null||c(v(u))},[c,u]),b=o.useCallback(v=>{x(E=>E.filter((R,M)=>M!==v))},[x]),g=Pt({scrollable:n,className:t,variant:e}),j=o.useCallback((v="")=>{if(e!=="input"||m.current)return;m.current=!0;const E={label:v},R=y(E),M=[...u,E];c==null||c(M),requestAnimationFrame(()=>{w(R),m.current=!1})},[e,c,u,y]),[L,w]=o.useState(null);o.useEffect(()=>{var v;if(L){const E=u.findIndex(R=>y(R)===L);if(E!==-1){const R=h.current[E];(v=R==null?void 0:R.focus)==null||v.call(R);const M=a.current,W=R.offsetLeft+R.offsetWidth/2-M.offsetWidth/2;M.scrollTo({left:W,behavior:"smooth"})}}},[L,u,y]);const C=o.useRef(null),I=(d||u.length===0)&&e==="input";return l.jsxs("div",{ref:a,role:"list","aria-label":"Chips",className:g.chips,tabIndex:e==="input"?0:void 0,onFocus:v=>{v.target===v.currentTarget&&i(!0)},onBlur:()=>{i(!1)},onKeyDown:v=>{var X;if(e!=="input")return;const E=v.key,M=v.target===v.currentTarget;if(!d)return;const W=document.activeElement,k=h.current.findIndex(V=>V===W);if(E==="ArrowLeft"){v.preventDefault();const V=k>0?k-1:u.length-1,Q=y(u[V]);w(Q);return}if(E==="ArrowRight"){v.preventDefault();const V=k>=0?(k+1)%Math.max(1,u.length):0,Q=y(u[V]);w(Q);return}if(E==="Home"){v.preventDefault();const V=y(u[0]);w(V);return}if(E==="End"){v.preventDefault();const V=y(u[u.length-1]);w(V);return}if(M&&E==="Backspace"){if(v.preventDefault(),u.length>0){const V=h.current[u.length-1];(X=V==null?void 0:V.focus)==null||X.call(V)}return}},children:[u.map((v,E)=>{const R=y(v),M=e==="input",W=M?{editable:!0,editing:L===R,onEditCommit:k=>{i(!0),x(X=>X.map((V,Q)=>Q===E?{...V,label:k}:V))},onEditCancel:()=>{i(!0)},onChange:()=>{if(h.current.length==E+1){const k=a.current;requestAnimationFrame(()=>{k.scrollTo({left:k.scrollWidth,behavior:"smooth"})})}}}:{};return l.jsx(Be,{ref:k=>h.current[E]=k,label:v.label??"",icon:v.icon,activated:v.activated,disabled:v.disabled,variant:v.variant,href:v.href,draggable:s,...W,onToggle:v.activated===void 0?void 0:k=>x(X=>X.map((V,Q)=>Q===E?{...V,activated:k}:V)),onBlur:()=>{L===R&&w(null)},onRemove:M?()=>{i(!0),b(E)}:void 0},R)}),d&&l.jsxs(l.Fragment,{children:[l.jsx(je,{orientation:"vertical",className:"animate-[var(--animate-blink)] border-outline",style:{"--animate-blink":"blink 1s cubic-bezier(0.4, 0, 0.6, 1) infinite"}}),l.jsx("style",{children:`
|
|
5
|
+
*/var As={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"]},Fs={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"]},Ps={prefix:"fas",iconName:"chevron-up",icon:[448,512,[],"f077","M201.4 105.4c12.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 173.3 54.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z"]},xn={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"]},$s={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"]},Xe={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"]},je={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"]},Ts=je,vn={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"]},Ws={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"]},Os={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 Bs=({checked:e,defaultChecked:t,indeterminate:n=!1,disabled:s=!1,error:r=!1,onChange:c,id:u,name:a,value:d,style:i,className:f,...y})=>{const h=o.useId(),m=u||h,x=e!==void 0,[b,g]=o.useState(t??!1),j=x?e:b,[L,w]=o.useState(!1),C=o.useRef(null);o.useEffect(()=>{C.current&&(C.current.indeterminate=n)},[n]);const I=E=>{s||(x||g(E.target.checked),c&&c(E))},v=Rt({isChecked:!!j,isIndeterminate:n,isDisabled:s,isError:r,isFocused:L,isHovered:!1});return l.jsx("div",{className:p(v.checkbox,f,"group/checkbox"),style:i,children:l.jsxs(ue,{stateClassName:v.stateLayer,colorName:j||n?"primary":"on-surface",children:[l.jsx("input",{ref:C,type:"checkbox",id:m,name:a,value:d,checked:j,disabled:s,onChange:I,onFocus:()=>w(!0),onBlur:()=>w(!1),className:v.input,...y}),l.jsx("div",{className:v.box}),l.jsx(Y.AnimatePresence,{children:(j||n)&&l.jsx(Y.motion.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},transition:{duration:.15},className:v.icon,children:l.jsx(le,{icon:n?As:Xe,className:"size-3.5"})})})]})})},Be=({variant:e="outlined",disabled:t=!1,icon:n,href:s,label:r,className:c,onClick:u,onToggle:a,activated:d,ref:i,onRemove:f,editable:y,onEditStart:h,onEditCommit:m,onEditCancel:x,onChange:b,transition:g,children:j,editing:L,...w})=>{if(j&&(r=j),r===void 0&&!y)throw new Error("Chip component requires either a label prop or children content");const C=s?"a":"button",I=o.useRef(null),v=i||I,[E,R]=o.useState(d),[M,W]=o.useState(!1),[k,X]=o.useState(L&&y),[V,Q]=o.useState(!1),[z,$]=o.useState(typeof r=="string"?r:""),A=o.useRef(null);o.useEffect(()=>{R(d)},[d]),o.useEffect(()=>{if(L&&X(L),y&&M){const P=setTimeout(()=>{w!=null&&w.draggable&&V||X(!0)},1e3);return()=>clearTimeout(P)}else M||X(!1)},[M,y,V,w,z]),o.useEffect(()=>{if(k){$(typeof r=="string"?r:"");const P=te.current||A.current;if(P){P.focus();const _=document.createRange();_.selectNodeContents(P),_.collapse(!1);const B=window.getSelection();B==null||B.removeAllRanges(),B==null||B.addRange(_)}}},[k]),g={duration:.3,...g};const O=P=>{t&&P.preventDefault(),a?(R(!E),a(!E)):u&&u(P)},F=!!a||!!f||!!u||!!s||!!y;d&&(n=Xe);const{onFocus:T,onBlur:G,onKeyDown:S,onDragStart:N,onDragEnd:D,onDoubleClick:q,...U}=w??{},J=At({href:s,disabled:t,icon:n,variant:e,transition:g,className:c,isActive:E??!1,onToggle:a,activated:E,label:r,isInteractive:F,children:r,isFocused:M,isDragging:V,onEditCommit:m,isEditing:k}),te=o.useRef(null),se=()=>{const P=(z??"").trim();if(!P){f&&f();return}m==null||m(P)};return l.jsxs(C,{contentEditable:!1,ref:v,href:s,className:J.chip,...U,onClick:P=>{k||O(P)},draggable:!t&&!!(w!=null&&w.draggable),onDragStart:P=>{!t&&(w!=null&&w.draggable)&&Q(!0),N==null||N(P)},onDragEnd:P=>{w!=null&&w.draggable&&Q(!1),D==null||D(P)},onDoubleClick:P=>{!t&&y&&!k&&(h==null||h(),P.preventDefault(),P.stopPropagation()),q==null||q(P)},onFocus:P=>{F&&W(!0),T==null||T(P)},onBlur:P=>{W(!1),G==null||G(P)},onKeyDown:P=>{const _=P.key;if(!t&&k){_==="Enter"?(P.preventDefault(),se()):_==="Escape"?(P.preventDefault(),x==null||x()):f&&(z==null?void 0:z.trim())===""&&(_==="Backspace"||_==="Delete"||_==="Del")&&(P.preventDefault(),P.stopPropagation(),f());return}if(!t&&M){if(y&&!a&&(_==="F2"||_==="Enter")){P.preventDefault(),h==null||h();return}if(a&&(_==="Enter"||_===" "||_==="Spacebar")){P.preventDefault();const B=!E;R(B),a(B)}f&&(_==="Backspace"||_==="Delete"||_==="Del")&&(P.preventDefault(),P.stopPropagation(),f())}S==null||S(P)},disabled:t,"aria-pressed":a?E:void 0,style:{transition:g.duration+"s"},children:[F&&!t&&!k&&l.jsx(ue,{style:{transition:g.duration+"s"},className:J.stateLayer,colorName:p({"on-surface-variant":!E,"on-secondary-container":E}),stateClassName:"state-ripple-group-[chip]"}),n&&l.jsx(le,{icon:n,className:J.leadingIcon}),l.jsx("span",{ref:te,contentEditable:!!y&&!!k,suppressContentEditableWarning:!0,className:J.label,role:y?"textbox":void 0,spellCheck:!1,onInput:P=>{const _=P.currentTarget.innerText;$(_),b==null||b(_)},onBlur:P=>{y&&k&&se()},onKeyDown:P=>{if(y&&k&&P.key==="Enter"){P.preventDefault(),P.stopPropagation(),se();return}y&&k&&P.key==="Escape"&&(P.preventDefault(),P.stopPropagation(),x==null||x())},children:r}),f&&!k&&l.jsx(le,{icon:je,className:J.trailingIcon,onMouseDown:P=>{P.preventDefault(),P.stopPropagation()},onClick:P=>{P.stopPropagation(),t||f()}})]})},Hs=({variant:e,disabled:t,isActive:n})=>({menuItem:p("group/menu-item text-start overflow-hidden flex items-center h-12 px-3 cursor-pointer outline-none select-none shrink-0 ","text-label-large","transition-colors duration-200","rounded-xl",{"text-on-surface":!e||e==="standard","opacity-38 pointer-events-none":t},(e==="vibrant"||n)&&["bg-secondary-container text-on-secondary-container"]),itemLabel:p("flex-1 truncate"),itemIcon:p("w-6 h-6 flex items-center justify-center menu-item-icon"),leadingIcon:p("mr-3"),trailingIcon:p("ml-3")}),Vs=Z("menuItem",Hs),Ce=({label:e,children:t,leadingIcon:n,trailingIcon:s,disabled:r,variant:c="standard",href:u,onClick:a,onToggle:d,activated:i=!1,className:f,...y})=>{let h=null;const m=[];o.Children.forEach(t,k=>{var X,V;o.isValidElement(k)&&(((X=k.type)==null?void 0:X.name)==="Menu"||((V=k.type)==null?void 0:V.displayName)==="Menu")?h=k:m.push(k)});const x=m.length>0?m:e,[b,g]=o.useState(!1),[j,L]=o.useState(i);j&&(n=Xe);const w=o.useRef(null),C=o.useRef(null);o.useEffect(()=>{L(i)},[i]);const I=Vs({variant:c,disabled:r,className:f,activated:j,isActive:j}),v=k=>{if(console.log("refrefd",r,h,d),r){k.preventDefault();return}if(h){k.stopPropagation();return}d?(L(!j),d(!j)):(console.log("click",a),a==null||a(k))},E=()=>{C.current&&(clearTimeout(C.current),C.current=null),!r&&h&&g(!0)},R=()=>{h&&(C.current=setTimeout(()=>{g(!1)},150))};o.useEffect(()=>()=>{C.current&&clearTimeout(C.current)},[]);const M=s??(h?xn:void 0),W=u?"a":"button";return l.jsxs(W,{ref:w,href:u,className:I.menuItem,onClick:v,onMouseEnter:E,onMouseLeave:R,role:"option","aria-haspopup":!!h,"aria-expanded":b,"aria-pressed":d?j:void 0,tabIndex:r?-1:0,disabled:u?void 0:r,onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),h?g(!b):v(k)),k.key==="ArrowRight"&&h&&(g(!0),k.stopPropagation()),k.key==="ArrowLeft"&&b&&(g(!1),k.stopPropagation())},...y,children:[l.jsx(ue,{className:"absolute inset-0 pointer-events-none",colorName:p(c==="vibrant"||j?"on-tertiary-container":"on-secondary-container"),stateClassName:"state-ripple-group-[menu-item]"}),n&&l.jsx("div",{className:p(I.itemIcon,I.leadingIcon,"z-10 relative"),children:o.isValidElement(n)?n:l.jsx(le,{icon:n})}),l.jsx("span",{className:p(I.itemLabel,"z-10 relative"),children:x}),M&&l.jsx("div",{className:p(I.itemIcon,I.trailingIcon,"z-10 relative"),children:o.isValidElement(M)?M:l.jsx(le,{icon:M})}),h&&b&&l.jsx(be,{anchorRef:w,position:"inline-end span-block-end",hoverOpen:!0,children:l.jsx("div",{onMouseEnter:E,onMouseLeave:R,children:h})})]})},Le=({orientation:e="horizontal",className:t,...n})=>{const s=Tt({orientation:e,className:t});return l.jsx("hr",{className:s.divider,...n})},zs=({props:e})=>({headline:p("px-3 py-1 text-label-small opacity-60 mt-1",{"text-on-surface-variant":!(e!=null&&e.variant)||e.variant==="standard"})}),_s=Z("menu-headline",zs),Ge=({label:e,children:t,variant:n,className:s,...r})=>{const c=_s({variant:n,className:s});return l.jsx("div",{className:c.headline,role:"group","aria-label":e,...r,children:t??e})},He=({children:e,className:t,variant:n,label:s,...r})=>{const c=Ut({children:e,className:t,variant:n,label:s,...r});return l.jsxs("div",{className:c.menuGroup,role:"group",...r,children:[s&&l.jsx("div",{className:c.groupLabel,children:s}),e]})},Ke=({children:e,className:t,variant:n="standard",...s})=>{const r=o.Children.toArray(e).some(d=>o.isValidElement(d)&&d.type===He),c=Yt({children:e,className:t,variant:n,hasGroups:r,...s}),u=o.useRef(null),a=d=>o.Children.map(d,i=>{if(!o.isValidElement(i))return i;if(i.type===He){const f=a(i.props.children);return o.cloneElement(i,{children:f,variant:n})}return i.type===Ce?o.cloneElement(i,{variant:i.props.variant??n}):i.type===Ge?o.cloneElement(i,{variant:n}):i.type===Le?o.cloneElement(i,{className:p("my-1",i.props.className)}):i});return l.jsxs("div",{ref:u,className:c.menu,role:"listbox",...s,children:[a(e),o.Children.count(e)===0&&l.jsx("div",{className:"px-4 py-3 text-on-surface-variant opacity-60 italic text-body-medium",children:"No options"})]})},Ys=({trigger:e,children:t,...n})=>{const[s,r]=o.useState(null),c=o.useRef(null),u=f=>{f.preventDefault(),r({mouseX:f.clientX,mouseY:f.clientY})},a=()=>{r(null)},d=()=>{a()};o.useEffect(()=>{if(!s)return;const f=()=>r(null);return window.addEventListener("click",f),window.addEventListener("scroll",f,!0),()=>{window.removeEventListener("click",f),window.removeEventListener("scroll",f,!0)}},[s]);const i=o.isValidElement(e)?o.cloneElement(e,{onContextMenu:f=>{var y,h;u(f),(h=(y=e.props).onContextMenu)==null||h.call(y,f)}}):l.jsx("div",{onContextMenu:u,className:"inline-block",children:e});return l.jsxs(l.Fragment,{children:[i,l.jsx("div",{ref:c,style:{position:"fixed",top:(s==null?void 0:s.mouseY)??0,left:(s==null?void 0:s.mouseX)??0,width:1,height:1,pointerEvents:"none",visibility:"hidden"}}),s&&l.jsx(be,{anchorRef:c,position:"bottom right",onClick:f=>f.stopPropagation(),children:l.jsx(Ke,{onClick:d,...n,children:t})})]})},ie=[];for(let e=0;e<256;++e)ie.push((e+256).toString(16).slice(1));function qs(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 Oe;const Us=new Uint8Array(16);function Xs(){if(!Oe){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Oe=crypto.getRandomValues.bind(crypto)}return Oe(Us)}const Gs=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ft={randomUUID:Gs};function gn(e,t,n){var r;if(ft.randomUUID&&!e)return ft.randomUUID();e=e||{};const s=e.random??((r=e.rng)==null?void 0:r.call(e))??Xs();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,qs(s)}const Ks=({variant:e="input",className:t,scrollable:n=!0,draggable:s=!1,items:r,onItemsChange:c})=>{const u=r??[],a=o.useRef(null),[d,i]=o.useState(!1),f=o.useRef(new WeakMap),y=o.useCallback(v=>{const E=f.current;let R=E.get(v);return R||(R=gn(),E.set(v,R)),R},[]);o.useEffect(()=>{var v,E;d&&(e=="input"?(v=C.current)==null||v.focus():(E=a.current)==null||E.focus())},[d]);const h=o.useRef([]),m=o.useRef(!1),x=o.useCallback(v=>{c==null||c(v(u))},[c,u]),b=o.useCallback(v=>{x(E=>E.filter((R,M)=>M!==v))},[x]),g=Pt({scrollable:n,className:t,variant:e}),j=o.useCallback((v="")=>{if(e!=="input"||m.current)return;m.current=!0;const E={label:v},R=y(E),M=[...u,E];c==null||c(M),requestAnimationFrame(()=>{w(R),m.current=!1})},[e,c,u,y]),[L,w]=o.useState(null);o.useEffect(()=>{var v;if(L){const E=u.findIndex(R=>y(R)===L);if(E!==-1){const R=h.current[E];(v=R==null?void 0:R.focus)==null||v.call(R);const M=a.current,W=R.offsetLeft+R.offsetWidth/2-M.offsetWidth/2;M.scrollTo({left:W,behavior:"smooth"})}}},[L,u,y]);const C=o.useRef(null),I=(d||u.length===0)&&e==="input";return l.jsxs("div",{ref:a,role:"list","aria-label":"Chips",className:g.chips,tabIndex:e==="input"?0:void 0,onFocus:v=>{v.target===v.currentTarget&&i(!0)},onBlur:()=>{i(!1)},onKeyDown:v=>{var X;if(e!=="input")return;const E=v.key,M=v.target===v.currentTarget;if(!d)return;const W=document.activeElement,k=h.current.findIndex(V=>V===W);if(E==="ArrowLeft"){v.preventDefault();const V=k>0?k-1:u.length-1,Q=y(u[V]);w(Q);return}if(E==="ArrowRight"){v.preventDefault();const V=k>=0?(k+1)%Math.max(1,u.length):0,Q=y(u[V]);w(Q);return}if(E==="Home"){v.preventDefault();const V=y(u[0]);w(V);return}if(E==="End"){v.preventDefault();const V=y(u[u.length-1]);w(V);return}if(M&&E==="Backspace"){if(v.preventDefault(),u.length>0){const V=h.current[u.length-1];(X=V==null?void 0:V.focus)==null||X.call(V)}return}},children:[u.map((v,E)=>{const R=y(v),M=e==="input",W=M?{editable:!0,editing:L===R,onEditCommit:k=>{i(!0),x(X=>X.map((V,Q)=>Q===E?{...V,label:k}:V))},onEditCancel:()=>{i(!0)},onChange:()=>{if(h.current.length==E+1){const k=a.current;requestAnimationFrame(()=>{k.scrollTo({left:k.scrollWidth,behavior:"smooth"})})}}}:{};return l.jsx(Be,{ref:k=>h.current[E]=k,label:v.label??"",icon:v.icon,activated:v.activated,disabled:v.disabled,variant:v.variant,href:v.href,draggable:s,...W,onToggle:v.activated===void 0?void 0:k=>x(X=>X.map((V,Q)=>Q===E?{...V,activated:k}:V)),onBlur:()=>{L===R&&w(null)},onRemove:M?()=>{i(!0),b(E)}:void 0},R)}),d&&l.jsxs(l.Fragment,{children:[l.jsx(Le,{orientation:"vertical",className:"animate-[var(--animate-blink)] border-outline",style:{"--animate-blink":"blink 1s cubic-bezier(0.4, 0, 0.6, 1) infinite"}}),l.jsx("style",{children:`
|
|
6
6
|
@keyframes blink {
|
|
7
7
|
0%, 50% { opacity: 1; }
|
|
8
8
|
50.01%, 100% { opacity: 0; }
|
|
9
9
|
}
|
|
10
|
-
`})]}),I&&l.jsx(Be,{ref:C,className:"opacity-0",draggable:s,editable:!0,editing:!0,onChange:v=>{var E;if(v=v.replace(/( )+/g," ").trim(),console.log("Ghost chip onChange",v,!!v),v)j(v);else if(u.length>0){const R=h.current[u.length-1];(E=R==null?void 0:R.focus)==null||E.call(R)}},onEditCommit:()=>{},onBlur:()=>{i(!1)},onFocus:v=>{i(!0),v.stopPropagation()},children:" "})]})};function wn({trigger:e=["hover","focus"],isOpen:t,defaultOpen:n=!1,onOpenChange:s,openDelay:r=400,closeDelay:c=150,id:u}={}){const a=o.useId(),d=u??`tooltip-${a}`,i=Array.isArray(e)?e:[e],f=typeof t=="boolean",[y,h]=o.useState(n?"hovered":"hidden"),[m,x]=o.useState(!1),b=o.useRef(null),g=o.useRef(null),j=o.useCallback(()=>{b.current&&(clearTimeout(b.current),b.current=null),g.current&&(clearTimeout(g.current),g.current=null)},[]);o.useEffect(()=>()=>j(),[j]);const L=o.useCallback($=>{if(f){const A=$!=="hidden";s==null||s(A)}else{h($);const A=$!=="hidden";s==null||s(A)}},[f,s]),w=f?t?"hovered":"hidden":y,C=w!=="hidden",I=$=>{switch($){case"hidden":return 0;case"hovered":return 1;case"focused":return 2;case"clicked":return 3;default:return 0}},v=o.useCallback($=>{j(),!(I($)<=I(w))&&(b.current=setTimeout(()=>{L($)},r))},[j,r,w,L]),E=o.useCallback($=>{j(),g.current=setTimeout(()=>{(!f&&I(y)<=I($)||f)&&L("hidden")},c)},[j,c,y,f,L]),R=o.useCallback(()=>{i.includes("hover")&&v("hovered")},[i,v]),M=o.useCallback(()=>{i.includes("hover")&&(w==="focused"||w==="clicked"||m||E("hovered"))},[i,w,m,E]),W=o.useCallback(()=>{i.includes("focus")&&(j(),L("focused"))},[i,j,L]),k=o.useCallback(()=>{if(i.includes("focus")&&w!=="clicked"){if(i.includes("hover")&&m){L("hovered");return}E("focused")}},[i,w,m,E,L]),X=o.useCallback(()=>{i.includes("click")&&(j(),L(w==="clicked"?"hidden":"clicked"))},[i,w,j,L]),V=o.useCallback($=>{$.key==="Escape"&&C&&(j(),L("hidden"),$.preventDefault())},[C,j,L]),Q=o.useCallback(()=>{x(!0),j()},[j]),z=o.useCallback(()=>{x(!1),i.includes("hover")&&w==="hovered"&&E("hovered")},[i,w,E]);return{triggerProps:{"aria-describedby":C?d:void 0,onMouseEnter:R,onMouseLeave:M,onFocus:W,onBlur:k,onClick:X,onKeyDown:V},tooltipProps:{id:d,role:"tooltip","aria-hidden":!C,onMouseEnter:Q,onMouseLeave:z},isOpen:C,state:w}}const Je=({variant:e="plain",buttons:t,className:n,children:s,title:r,text:c,content:u,position:a,targetRef:d,ref:i,trigger:f=["hover","focus"],transition:y,openDelay:h=400,closeDelay:m=150,isOpen:x,defaultOpen:b=!1,onOpenChange:g,id:j,anchorRef:L,...w})=>{const I=a||(e==="rich"?"bottom-right":"bottom");if(y={duration:.3,...y},!s&&!d)throw new Error("Tooltip must have a child or a targetRef");t&&!Array.isArray(t)&&(t=[t]);const v=o.useRef(null),R=L||(d||v),{triggerProps:M,tooltipProps:W,isOpen:k}=wn({trigger:f,isOpen:x,defaultOpen:b,onOpenChange:g,openDelay:h,closeDelay:m,id:j}),X=!d&&o.isValidElement(s)?o.cloneElement(s,{ref:v,...M,onMouseEnter:z=>{var $,A;M.onMouseEnter(),(A=($=s.props)==null?void 0:$.onMouseEnter)==null||A.call($,z)},onMouseLeave:z=>{var $,A;M.onMouseLeave(),(A=($=s.props)==null?void 0:$.onMouseLeave)==null||A.call($,z)},onFocus:z=>{var $,A;M.onFocus(),(A=($=s.props)==null?void 0:$.onFocus)==null||A.call($,z)},onBlur:z=>{var $,A;M.onBlur(),(A=($=s.props)==null?void 0:$.onBlur)==null||A.call($,z)},onClick:z=>{var $,A;M.onClick(),(A=($=s.props)==null?void 0:$.onClick)==null||A.call($,z)},onKeyDown:z=>{var $,A;M.onKeyDown(z),(A=($=s.props)==null?void 0:$.onKeyDown)==null||A.call($,z)}}):s;o.useEffect(()=>{if(!d)return;const z=d.current;if(!z)return;const $=()=>M.onMouseEnter(),A=()=>M.onMouseLeave(),O=()=>M.onFocus(),F=()=>M.onBlur(),T=()=>M.onClick(),G=S=>M.onKeyDown(S);return z.addEventListener("mouseenter",$),z.addEventListener("mouseleave",A),z.addEventListener("focus",O,!0),z.addEventListener("blur",F,!0),z.addEventListener("click",T),z.addEventListener("keydown",G),M["aria-describedby"]?z.setAttribute("aria-describedby",M["aria-describedby"]):z.removeAttribute("aria-describedby"),()=>{z.removeEventListener("mouseenter",$),z.removeEventListener("mouseleave",A),z.removeEventListener("focus",O,!0),z.removeEventListener("blur",F,!0),z.removeEventListener("click",T),z.removeEventListener("keydown",G)}},[d,M]);const V=mn({variant:e,buttons:t,className:n,title:r,text:c,position:I,trigger:f,targetRef:d,children:s}),Q={open:{opacity:1,height:"auto"},close:{opacity:0,height:16}};return l.jsxs(l.Fragment,{children:[X,l.jsx(Y.AnimatePresence,{children:k&&l.jsx(be,{anchorRef:R,position:I,children:l.jsx(Y.motion.div,{initial:"close",variants:Q,animate:"open",transition:{duration:y.duration},exit:"close",className:V.toolTip,...w,...W,children:l.jsx("div",{className:V.container,children:u?l.jsx("div",{className:V.content,children:u}):l.jsxs(l.Fragment,{children:[r&&l.jsx("div",{className:V.subHead,children:r}),c&&l.jsx("div",{className:V.supportingText,children:c}),t&&l.jsx("div",{className:V.actions,children:Array.isArray(t)&&t.map((z,$)=>l.jsx(me,{size:"small",variant:"text",...z},$))})]})})})})})]})},Re=({className:e,label:t,variant:n="primary",size:s="medium",href:r,type:c,icon:u,extended:a=!1,ref:d,transition:i,children:f,...y})=>{if(f&&(t=f),!t)throw new Error("FAB component requires either a label prop or children content");const h=r?"a":"button",m=Ot({href:r,icon:u,extended:a,label:t,size:s,variant:n,className:e,transition:i,children:t});i={duration:.3,...i};const x=o.useRef(null),b=d||x,g={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 l.jsxs(h,{...y,ref:b,href:r,"aria-label":a?void 0:t,className:m.fab,children:[l.jsx(Je,{trigger:a?null:void 0,text:t,targetRef:b}),l.jsx(ue,{style:{transition:i.duration+"s"},className:m.stateLayer,colorName:p({"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]"}),l.jsx(le,{icon:u,className:m.icon}),l.jsx(Y.AnimatePresence,{children:a&&l.jsx(Y.motion.span,{variants:g,initial:"hidden",animate:"visible",exit:"hidden",className:m.label,children:t})})]})},we=({variant:e="standard",href:t,disabled:n=!1,title:s,label:r,onToggle:c,activated:u=!1,onClick:a,icon:d,size:i="medium",iconSelected:f,className:y,ref:h,width:m="default",shape:x="rounded",allowShapeTransformation:b=!0,transition:g,children:j,...L})=>{if(j&&(r=j),!r)throw new Error("IconButton component requires either a label prop or children content to provide an accessible aria-label");!s&&s!==null&&(s=r);const[w,C]=o.useState(u),I=W=>{n&&W.preventDefault(),c?(C(!w),c(!w)):a&&a(W)};o.useEffect(()=>{C(u)},[u]);const v=t?"a":"button",E=zt({transition:g,shape:x,allowShapeTransformation:b,width:m,href:t,activated:w,label:r,iconSelected:f,isActive:w,onToggle:c,disabled:n,icon:d,variant:e,className:y,size:i,children:r,...L}),R=o.useRef(null),M=h||R;return g={duration:.3,...g},l.jsxs(v,{disabled:n,href:t,style:{transition:g.duration+"s"},className:E.iconButton,"aria-label":r,...L,title:void 0,onClick:I,ref:M,children:[s!==null&&l.jsx(Je,{targetRef:M,trigger:n?null:void 0,text:s}),l.jsx("div",{className:E.touchTarget}),l.jsx(ue,{style:{transition:g.duration+"s"},className:E.stateLayer,colorName:p(e==="standard"&&{"on-surface-variant":!w,"on-primary":w},e==="filled"&&{"on-surface-variant":!w&&!!c,"on-primary":w||!c},e==="tonal"&&{"on-secondary":w&&!!c,"on-secondary-container":!w||!c},e==="outlined"&&{"inverse-on-surface":w&&!!c,"on-surface-variant":!w||!c}),stateClassName:"state-ripple-group-[icon-button]"}),d?l.jsx(le,{icon:d,className:E.icon}):j]})},Js=({className:e,label:t,variant:n="primary",size:s="medium",href:r,icon:c,extended:u=!1,ref:a,transition:d,children:i,open:f,defaultOpen:y=!1,onOpenChange:h,...m})=>{d={duration:.3,ease:"easeInOut",...d};const x=o.useRef(null),b=a||x,g=typeof f=="boolean",[j,L]=o.useState(y),w=g?f:j,C=k=>{g||L(k),h==null||h(k)},I=o.Children.toArray(i).filter(k=>o.isValidElement(k)&&k.type===me),v=Ht({href:r,icon:c,extended:u,label:t,size:s,variant:n,className:e,transition:d,children:t,open:w}),E=Y.motion.create(Re),R=Y.motion.create(we),M=k=>l.jsx(E,{icon:c,extended:u,label:t,variant:n+"Container",size:s,className:v.fab+" "+(e??""),"aria-expanded":w,onClick:()=>C(!0),style:{transition:"border-radius 0.3s ease-in-out"},transition:{duration:d.duration,ease:"easeInOut",borderRadius:{duration:d.duration,ease:"easeInOut"},background:{duration:d.duration,ease:"easeInOut"},...d},...k}),W=o.useId();return l.jsxs("div",{className:v.fabMenu,ref:b,...m,children:[l.jsx(Y.AnimatePresence,{children:w&&l.jsx("div",{className:v.actions,role:"menu","aria-hidden":!w,children:(()=>{const k=I.length;return I.map((X,V)=>{X.props;const Q=k-1-V,z=((d==null?void 0:d.delay)??0)+Q*.06,$={open:{overflow:"visible",opacity:1,width:"auto",transition:{...d,delay:z,opacity:{delay:(d==null?void 0:d.duration)/2+z}}},close:{overflow:"hidden",opacity:0,width:0,transition:{...d,delay:z,opacity:{duration:(d==null?void 0:d.duration)/1.5}}}};return l.jsx(Y.motion.div,{initial:"close",animate:"open",variants:$,transition:d,exit:"close",children:o.cloneElement(X,{key:V,shape:"rounded",variant:"filled",className:()=>({button:p("max-w-full overflow-hidden text-nowrap",{"px-0":!w,"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:p({"state-on-primary-container":n==="primary","state-on-secondary-container":n==="secondary","state-on-tertiary-container":n==="tertiary"})})})})})})()})}),M({className:"invisible pointer-events-none"}),l.jsxs("div",{className:"absolute right-0 top-0",children:[!w&&M({className:"",layout:!0,layoutId:"fab-menu"+W}),w&&l.jsx(l.Fragment,{children:l.jsx(R,{layout:!0,layoutId:"fab-menu"+W,variant:"filled",className:()=>({iconButton:p({"bg-primary text-on-primary":n==="primary","bg-secondary text-on-secondary":n==="secondary","bg-tertiary text-on-tertiary":n==="tertiary"}),stateLayer:p({"[--default-color:var(--color-on-primary)]":n==="primary","[--default-color:var(--color-on-secondary)]":n==="secondary","[--default-color:var(--color-on-tertiary)]":n==="tertiary"})}),style:{transition:"border-radius 0.3s ease-in-out"},transition:{duration:d.duration,ease:"easeInOut",borderRadius:{duration:d.duration,ease:"easeInOut"},background:{duration:d.duration,ease:"easeInOut"},...d},icon:Ts,onClick:()=>C(!1),children:"Close"})})]})]})},Zs=({className:e,valueFormatter:t,step:n=10,name:s,value:r=0,min:c=0,max:u=100,marks:a=[{value:0,label:"0"},{value:100,label:"100"}],ref:d,onChange:i,...f})=>{const y=A=>{const O=m(),F=h();return A===1/0?100:A===-1/0?0:(A-O)/(F-O)*100},h=(A=!1)=>A?u:u==1/0?a[(a==null?void 0:a.length)-1].value:u,m=(A=!1)=>A?c:c==-1/0?a[0].value:c,x=A=>{const O=m(!1);return(h(!1)-O)*A/100+O},[b,g]=o.useState(!1),j=o.useRef(null),L=d||j,[w,C]=o.useState(r),[I,v]=o.useState(y(r)),[E,R]=o.useState(!1);o.useEffect(()=>{C(r),v(y(r))},[r]);const M=A=>{R(!0),g(!0),X(A)},W=()=>{R(!1),g(!1)};o.useEffect(()=>(E?(window.addEventListener("mouseup",W),window.addEventListener("mousemove",X),window.addEventListener("touchend",W),window.addEventListener("touchmove",X)):(window.removeEventListener("mouseup",W),window.removeEventListener("mousemove",X),window.removeEventListener("touchend",W),window.removeEventListener("touchmove",X)),()=>{window.removeEventListener("mouseup",W),window.removeEventListener("mousemove",X),window.removeEventListener("touchend",W),window.removeEventListener("touchmove",X)}),[E]);const k=Jt({className:e,isChanging:b,marks:a,max:u,min:c,name:s,step:n,value:w,valueFormatter:t,onChange:i}),X=A=>{const O=L==null?void 0:L.current;if(O){const F=O.getBoundingClientRect().left,G=((A.type==="touchmove"||A.type==="touchstart"?A.touches[0].clientX:A.clientX)-F)/O.offsetWidth*100;V({percent:G})}},V=({percent:A,value:O})=>{if(A){if(A>=100){C(h(!0)),v(100);return}if(A<=0){C(m(!0)),v(0);return}O=x(A),O==m()&&(O=m(!0)),O==h()&&(O=h(!0))}else if(O!=null){if(O>=h()){C(h(!0)),v(100);return}if(O<=m()){C(m(!0)),v(0);return}A=y(O)}else return;n!=null?O=Math.round((O-m())/n)*n+m():a&&(O=a.reduce((F,T,G)=>{let S=T.value===1/0?h():T.value===-1/0?m():T.value,N=F.value===1/0?h():F.value===-1/0?m():F.value;return S=Math.abs(S-O),N=Math.abs(N-O),S<N?T:F}).value),O>=h()&&(O=h(!0)),O<=m()&&(O=m(!0)),A=y(O),C(O),v(A),i&&i(O)},[Q,z]=o.useState(0);o.useEffect(()=>{const A=()=>{L.current&&z(L.current.offsetWidth)};return A(),window.addEventListener("resize",A),()=>{window.removeEventListener("resize",A)}},[]);const $=A=>{switch(A.key){case"ArrowRight":if(n)V({value:w+n});else if(a){const O=a.find(F=>F.value>w);O&&V({value:O.value})}break;case"ArrowLeft":if(n)V({value:w-n});else if(a){const O=a.slice(0).reverse().find((F,T,G)=>w===1/0?T===1:F.value<w);O&&V({value:O.value})}break;default:return}};return l.jsxs("div",{tabIndex:0,onKeyDown:$,role:"slider","aria-valuemin":m(!0),"aria-valuemax":h(!0),"aria-valuenow":w,"aria-valuetext":w.toString(),className:k.slider,onMouseDown:M,onClick:X,ref:L,onTouchStart:M,onDragStart:A=>A.preventDefault(),...f,children:[l.jsx("input",{type:"hidden",name:s,value:w}),l.jsx("div",{className:k.activeTrack,style:{flex:I/100}}),l.jsx("div",{className:k.handle,children:l.jsx(Y.AnimatePresence,{children:b&&l.jsx(Y.motion.div,{className:k.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(w):w})})}),l.jsx("div",{className:k.inactiveTrack,style:{flex:1-I/100}}),l.jsx("div",{className:"w-[calc(100%-12px)] h-full absolute -translate-x-1/2 transform left-1/2",children:a&&a.map((A,O)=>{let F=null;const T=(b?9:10)/Q*100,G=y(A.value);return G<=I-T?F=!0:G>=I+T&&(F=!1),l.jsx("div",{className:p(k.dot,{"bg-primary-container":F!=null&&F,"bg-primary":F!=null&&!F}),style:{left:`${y(A.value)}%`}},O)})})]})},Qs=({variant:e="standard",className:t,children:n,title:s,position:r="right",extended:c,divider:u,onExtendedChange:a,closeIcon:d=ke,transition:i,...f})=>{i={duration:.3,...i};const[y,h]=o.useState(c??!0),m=Kt({transition:i,title:s,position:r,closeIcon:d,className:t,children:n,onExtendedChange:a,divider:u,isExtended:y,extended:y,variant:e});o.useEffect(()=>{a==null||a(y??!1)},[y]),o.useEffect(()=>{c!=null&&h(c)},[c]);const x={close:{width:0},open:{width:"auto"}},b=()=>l.jsxs(l.Fragment,{children:[l.jsx(Y.AnimatePresence,{children:e=="modal"&&y&&l.jsx(Y.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:i,onClick:()=>h(!1),className:m.overlay})}),l.jsx(Y.AnimatePresence,{children:y&&l.jsxs("div",{...f,className:m.sideSheet,style:{transition:i.duration+"s"},children:[l.jsxs(Y.motion.div,{variants:x,initial:c===!1?"open":"close",animate:"open",exit:"close",className:m.container,children:[l.jsxs("div",{className:m.header,children:[s&&l.jsx("p",{className:m.title,children:s}),l.jsx(we,{size:"small",label:"close",icon:d,onClick:()=>h(!1),className:m.closeButton})]}),l.jsx("div",{className:m.content,style:{transition:i.duration+"s"},children:n})]}),(u==null&&e=="standard"?!0:u)&&l.jsx(je,{className:m.divider,orientation:"vertical"})]})})]});return e=="modal"?Ve.createPortal(b(),document.body):b()},er=({message:e,className:t,duration:n,closeIcon:s=ke,onClose:r,...c})=>{const[u,a]=o.useState(!0),d=Qt({className:t,closeIcon:s,duration:n,isVisible:u,onClose:r,message:e});o.useEffect(()=>{n&&setTimeout(()=>{i()},n)},[n]);const i=()=>{a(!1),r==null||r()};return l.jsx(Y.AnimatePresence,{children:u&&l.jsx(Y.motion.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.1},className:d.snackbar,...c,children:l.jsxs("div",{className:d.container,children:[l.jsx("p",{className:d.supportingText,children:e}),l.jsx(we,{onClick:()=>i(),className:d.icon,icon:s,label:"close the snackbar"})]})})})},tr=({selected:e=!1,className:t,activeIcon:n,disabled:s=!1,inactiveIcon:r,onChange:c,onClick:u,onKeyDown:a,ref:d,...i})=>{const[f,y]=o.useState(e);o.useEffect(()=>{y(e)},[e]);const h=L=>{s||(x(),u&&u(L))},m=L=>{s||((L.key===" "||L.key==="Enter")&&(L.preventDefault(),x()),a&&a(L))},x=()=>{y(!f),c==null||c(!f)},b=tn({className:t,isSelected:f,activeIcon:n,inactiveIcon:r,disabled:s,selected:f,onChange:c}),g=o.useRef(null),j=d||g;return l.jsxs(Y.motion.div,{role:"switch","aria-checked":f,tabIndex:s?-1:0,onKeyDown:m,onClick:h,ref:j,className:b.switch,...i,children:[l.jsx("input",{type:"hidden",value:f?"1":"0"}),l.jsxs(Y.motion.div,{layout:!0,style:{translate:f?"50%":"-50%"},transition:{type:"spring",stiffness:700,damping:30},className:b.handleContainer,children:[l.jsx("div",{className:b.handle,children:(f?n:r)&&l.jsx(le,{className:b.icon,icon:f?n:r})}),l.jsx("div",{className:b.handleStateLayer})]})]})},bn=({className:e,onClick:t,label:n,variant:s="primary",href:r,icon:c,selectedTab:u,setSelectedTab:a,tabsId:d,index:i,onTabSelected:f,scrollable:y=!1,selected:h=!1,children:m,ref:x,...b})=>{const g=o.useRef(null),j=x||g,L=n??(typeof m=="string"?m:void 0),[w,C]=o.useState(h);o.useEffect(()=>{h&&u==null?C(!0):C(u==i&&i!=null)},[u]),o.useEffect(()=>{u==i&&f&&f({ref:j,index:i||0,label:L,icon:c})},[u]);const I=r?"a":"button",v=R=>{a&&a(i??null),t&&t(R)},E=sn({className:e,onTabSelected:f,scrollable:y,selectedTab:u,index:i,tabsId:d,selected:w,variant:s,icon:c,label:L,isSelected:w,setSelectedTab:a,href:r});return l.jsxs(I,{...b,role:"tab","aria-selected":w,ref:j,href:r,className:E.tab,onClick:v,...b,children:[l.jsx(ue,{style:{transition:.3+"s"},className:E.stateLayer,colorName:s==="primary"&&w?"primary":"on-surface",stateClassName:"state-ripple-group-[tab]"}),l.jsxs("span",{className:E.content,children:[c&&l.jsx(le,{icon:c,className:E.icon}),l.jsx("span",{className:E.label,children:L}),w&&l.jsx(Y.motion.span,{layoutId:`underline-${d}`,className:E.underline,transition:{duration:.3}})]})]})},Ze=o.createContext(null),nr=({variant:e="primary",onTabSelected:t,children:n,className:s,selectedTab:r,setSelectedTab:c,scrollable:u=!1})=>{const a=o.useContext(Ze),[d,i]=o.useState(null);let f;r===0||r!=null?f=r:a?f=a.selectedTab:f=d;const y=c??(a==null?void 0:a.setSelectedTab)??i,h=o.Children.toArray(n).filter(j=>o.isValidElement(j)&&j.type===bn),m=o.useRef(null),x=j=>{if(t==null||t(j),u){const L=m.current,w=j.ref.current;if(L&&w){const C=w.offsetLeft+w.offsetWidth/2-L.offsetWidth/2;L.scrollTo({left:C,behavior:"smooth"})}}},b=o.useMemo(()=>(a==null?void 0:a.tabsId)??gn(),[a==null?void 0:a.tabsId]),g=on({children:n,onTabSelected:t,scrollable:u,selectedTab:f,setSelectedTab:y,className:s,variant:e});return l.jsx("div",{ref:m,role:"tablist",className:g.tabs,children:h.map((j,L)=>o.cloneElement(j,{key:L,index:L,variant:e,selectedTab:f,setSelectedTab:y,tabsId:b,onTabSelected:x,scrollable:u}))})},sr=({children:e,selectedTab:t,setSelectedTab:n,defaultTab:s=0})=>{const[r,c]=o.useState(s),u=o.useRef(null),a=t!==void 0?t:r,d=n??c,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:d,previousTab:u.current,direction:i,tabsId:f}),[a,d,i,f]);return l.jsx(Ze.Provider,{value:y,children:e})},Sn=({children:e,className:t,isSelected:n=!1})=>{const s=un({children:e,className:t,isSelected:n});return l.jsx("div",{className:s.tabPanel,children:e})},rr=({children:e,className:t})=>{const n=o.useContext(Ze);if(!n)return console.warn("TabPanels must be used within a TabGroup"),null;const{selectedTab:s,direction:r,tabsId:c}=n,u=o.Children.toArray(e).filter(d=>o.isValidElement(d)&&d.type===Sn),a=an({children:e,className:t});return l.jsx("div",{className:a.tabPanels,children:l.jsx(Y.AnimatePresence,{initial:!1,custom:r,mode:"popLayout",children:u.map((d,i)=>s===i&&l.jsx(Y.motion.div,{custom:r,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-${c}-${i}`,children:o.cloneElement(d,{isSelected:!0})},i))})})},or=({hasSelected:e})=>({datePicker:p("inline-flex flex-col bg-surface-container-high rounded-[28px] p-3 select-none","min-w-[320px]"),header:p("flex items-center justify-between h-12 mb-2 px-2"),monthNav:p("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:p("text-label-large text-on-surface font-bold capitalize"),weekDays:p("grid grid-cols-7 mb-2"),weekDay:p("h-10 flex items-center justify-center text-body-small text-on-surface-variant"),daysGrid:p("grid grid-cols-7 row-auto gap-y-2"),dayCell:p("flex items-center justify-center h-10 p-0 relative"),dayButton:p("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")}),ir=Z("datePicker",or),En=({value:e,defaultValue:t,onChange:n,minDate:s,maxDate:r,shouldDisableDate:c,locale:u="default",weekStartDay:a=0,className:d,style:i,mode:f="single",...y})=>{const[h,m]=o.useState(()=>{const S=D=>D instanceof Date?D:Array.isArray(D)&&D[0]?D[0]:null,N=S(e)||S(t)||new Date;return new Date(N.getFullYear(),N.getMonth(),1)}),[x,b]=o.useState(0),[g,j]=o.useState("day"),L=e!==void 0,[w,C]=o.useState(t||null),I=L?e||null:w,v=(S,N)=>new Date(S,N+1,0).getDate(),E=o.useMemo(()=>{const S=h.getFullYear(),N=h.getMonth(),D=v(S,N),U=(new Date(S,N,1).getDay()-a+7)%7,J=[],te=v(S,N-1);for(let _=U-1;_>=0;_--)J.push({date:new Date(S,N-1,te-_),isCurrentMonth:!1});for(let _=1;_<=D;_++)J.push({date:new Date(S,N,_),isCurrentMonth:!0});const P=42-J.length;for(let _=1;_<=P;_++)J.push({date:new Date(S,N+1,_),isCurrentMonth:!1});return J},[h,a]),R=o.useMemo(()=>{const S=new Date().getFullYear(),N=S-100,D=S+100,q=[];for(let U=N;U<=D;U++)q.push(U);return q},[]),M=o.useRef(null);o.useEffect(()=>{if(g==="year"&&M.current){const S=M.current.querySelector('[data-selected="true"]');S&&S.scrollIntoView({block:"center"})}},[g]);const W=o.useMemo(()=>new Intl.DateTimeFormat(u,{month:"long",year:"numeric"}),[u]),k=o.useMemo(()=>new Intl.DateTimeFormat(u,{weekday:"narrow"}),[u]),X=o.useMemo(()=>{const S=new Date(2023,0,1+a);return Array.from({length:7}).map((N,D)=>{const q=new Date(S);return q.setDate(S.getDate()+D),k.format(q).charAt(0).toUpperCase()})},[k,a]),V=()=>{b(-1),m(S=>new Date(S.getFullYear(),S.getMonth()-1,1))},Q=()=>{b(1),m(S=>new Date(S.getFullYear(),S.getMonth()+1,1))},z=S=>{m(N=>new Date(S,N.getMonth(),1)),j("day")},$=(S,N)=>S?S.getDate()===N.getDate()&&S.getMonth()===N.getMonth()&&S.getFullYear()===N.getFullYear():!1,A=S=>$(new Date,S),O=S=>{let N=S;if(f==="single")N=S;else{const D=I,[q,U]=Array.isArray(D)?D:[null,null];!q||q&&U?N=[S,null]:S<q?N=[S,q]:N=[q,S]}L||C(N),n&&n(N)},F=S=>{if(f==="single")return{isSelected:$(I,S),isStart:!1,isEnd:!1,isInRange:!1};const N=Array.isArray(I)?I:[I,null],[D,q]=N,U=$(D,S),J=$(q,S);let te=!1;if(D&&q){const se=new Date(D.getFullYear(),D.getMonth(),D.getDate()).getTime(),P=new Date(q.getFullYear(),q.getMonth(),q.getDate()).getTime(),_=new Date(S.getFullYear(),S.getMonth(),S.getDate()).getTime();te=_>se&&_<P}return{isSelected:U||J,isStart:U,isEnd:J,isInRange:te}},T=ir({hasSelected:!!I}),G={enter:S=>({x:S>0?"100%":"-100%",opacity:0}),center:{x:0,opacity:1},exit:S=>({x:S<0?"100%":"-100%",opacity:0})};return l.jsxs("div",{className:p(T.datePicker,d),style:i,...y,children:[l.jsxs("div",{className:T.header,children:[l.jsxs(me,{variant:"text",disableTextMargins:!0,size:"small",onClick:()=>j(S=>S==="day"?"year":"day"),className:"text-label-large font-bold capitalize text-on-surface hover:bg-surface-container-highest",children:[l.jsx("span",{className:"mr-2",children:g==="day"?W.format(h):h.getFullYear()}),l.jsx(le,{icon:vn,className:p("w-3 h-3 transition-transform duration-200 inline",g==="year"&&"rotate-180")})]}),g==="day"&&l.jsxs("div",{className:"flex items-center",children:[l.jsx(we,{size:"xSmall",allowShapeTransformation:!1,onClick:V,icon:Ws,label:"Previous month",title:null}),l.jsx(we,{size:"xSmall",allowShapeTransformation:!1,onClick:Q,icon:xn,label:"Next month",title:null})]})]}),g==="year"?l.jsx("div",{className:"h-[280px] overflow-y-auto grid grid-cols-3 gap-2 p-2 scrollbar-hide",ref:M,children:R.map(S=>l.jsx(me,{size:"small",variant:S===h.getFullYear()?"filled":"text",onClick:()=>z(S),"data-selected":S===h.getFullYear(),className:p("w-full",{"text-on-surface":S!==h.getFullYear()}),label:S.toString(),children:S},S))}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:T.weekDays,children:X.map((S,N)=>l.jsx("div",{className:T.weekDay,children:S},N))}),l.jsx("div",{className:"overflow-hidden relative min-h-[240px]",children:l.jsx(Y.AnimatePresence,{mode:"popLayout",initial:!1,custom:x,children:l.jsx(Y.motion.div,{custom:x,variants:G,initial:"enter",animate:"center",exit:"exit",transition:{type:"spring",bounce:0,duration:.3},className:T.daysGrid,children:E.map((S,N)=>{if(!S.isCurrentMonth)return l.jsx("div",{className:T.dayCell},N);const{isSelected:D,isStart:q,isEnd:U,isInRange:J}=F(S.date),te=A(S.date),se=s&&S.date<s||r&&S.date>r||(c==null?void 0:c(S.date));return l.jsx("div",{className:p(T.dayCell,J&&"bg-primary/20",q&&(I==null?void 0:I[1])&&"bg-gradient-to-r from-transparent to-primary/20",U&&(I==null?void 0:I[0])&&"bg-gradient-to-l from-transparent to-primary/20"),children:l.jsx(me,{className:()=>({button:p("aspect-square h-[40px] p-0",{"text-on-surface":!D&&!te,"opacity-50":se}),stateLayer:p({"!bg-transparent":se})}),size:"small",allowShapeTransformation:!1,variant:p({filled:D,outlined:te,text:!D&&!te}),label:S.date.getDate().toString(),onClick:()=>O(S.date),disabled:se,children:S.date.getDate().toString()})},N)})},h.toISOString())})})]})]})},lr=({variant:e="filled",autoFocus:t,disabled:n=!1,errorText:s,placeholder:r,suffix:c,name:u,label:a,className:d,supportingText:i,trailingIcon:f,leadingIcon:y,type:h="text",multiline:m=!1,autoComplete:x="on",onChange:b,value:g,defaultValue:j,showSupportingText:L,id:w,style:C,ref:I,onFocus:v,onBlur:E,options:R,children:M,...W})=>{var nt;const k=o.useId(),X=w||k,V=`${X}-helper`,Q=g!==void 0,[z,$]=o.useState(j??""),A=Q?g:z,[O,F]=o.useState(!1),[T,G]=o.useState(!!(s!=null&&s.length)),S=o.useRef(null),N=I||S,D=o.useRef(null),q=o.useRef(null),U=o.useRef(null),J=L??(!!(s!=null&&s.length)||!!(i!=null&&i.length));o.useEffect(()=>{G(!!(s!=null&&s.length))},[s]);const te=()=>{N.current&&!O&&!n&&h!=="select"&&N.current.focus()};o.useEffect(()=>{if(!(!t||n)&&h!=="select"){const K=window.requestAnimationFrame(()=>{te()});return()=>window.cancelAnimationFrame(K)}},[t,n,N,h]),o.useEffect(()=>{O?(G(!1),v==null||v()):(s!=null&&s.length&&G(!0),E==null||E())},[O]);const se=K=>{const re=K.target.value;Q||$(re),G(!1),b&&b(K)},P=h==="date",[_,B]=o.useState(!1),[ee,oe]=o.useState(null),pe=o.useMemo(()=>{const K=String(A);if(!K)return null;const[re,xe,Ee]=K.split("-").map(Number);return re&&xe&&Ee?new Date(re,xe-1,Ee):null},[A]),Se=()=>{n||(_?B(!1):(oe(pe),B(!0)))};o.useEffect(()=>{_?F(!0):(!ae||!de)&&F(!1)},[_]),o.useEffect(()=>{if(!_)return;const K=fe=>{var Ne,Me;return fe?((Ne=D.current)==null?void 0:Ne.contains(fe))||((Me=U.current)==null?void 0:Me.contains(fe)):!1},re=fe=>{var st,rt;const Ne=fe.target,Me=(st=U.current)==null?void 0:st.contains(Ne),Rn=(rt=q.current)==null?void 0:rt.contains(Ne);!Me&&!Rn&&B(!1)},xe=fe=>{K(fe.target)||B(!1)},Ee=fe=>{fe.key==="Escape"&&B(!1)};return document.addEventListener("pointerdown",re),document.addEventListener("focusin",xe),document.addEventListener("keydown",Ee),()=>{document.removeEventListener("pointerdown",re),document.removeEventListener("focusin",xe),document.removeEventListener("keydown",Ee)}},[_]);const jn=()=>{const K=ee?ee.toLocaleDateString("en-CA"):"";Q||$(K),b&&b({target:{value:K,name:u,type:h}}),B(!1)},ae=h==="select",[de,Ae]=o.useState(!1),Fe=o.useRef(null),Qe=o.useMemo(()=>{if(ae&&R){const K=R.find(re=>String(re.value)===String(A));return K?K.label:A}return A},[A,ae,R]),et=()=>{n||(Ae(!de),F(!de))},tt=K=>{if(Q||$(String(K)),b){const re={target:{value:String(K),name:u,type:h}};b(re)}Ae(!1),F(!1)};o.useEffect(()=>{if(!de)return;const K=re=>{D.current&&!D.current.contains(re.target)&&Fe.current&&!Fe.current.contains(re.target)&&(Ae(!1),F(!1))};return document.addEventListener("mousedown",K),()=>{document.removeEventListener("mousedown",K)}},[de]);const ye=o.useMemo(()=>{if(f)return f;if(P)return Fs;if(ae)return de?Ps:vn},[f,P,ae,de]),Ln=P||ae?"[&::-webkit-calendar-picker-indicator]:hidden cursor-pointer selection:bg-transparent":"",ce=fn({showSupportingText:J,isFocused:O,showErrorIcon:T,disabled:n,name:u,label:a,autoComplete:x,className:d,onChange:b,placeholder:r,supportingText:i,type:h,leadingIcon:y,trailingIcon:ye,variant:e,errorText:s,value:String(Qe),suffix:c,multiline:m}),Mn=m?Pn:"input",In=m?{}:{type:ae?"text":h,readOnly:ae},Pe=O||typeof A=="string"&&A.length>0||h=="date"||ae&&de,Le=Pe&&e==="outlined",Cn=!Le;return l.jsxs("div",{ref:D,className:ce.textField,style:C,children:[l.jsxs("fieldset",{onClick:()=>{ae?et():te()},className:ce.content,role:"presentation",children:[l.jsx("div",{className:ce.stateLayer}),y&&l.jsx("div",{className:ce.leadingIcon,children:o.isValidElement(y)?y:l.jsx(le,{className:"w-5 h-5",icon:y})}),l.jsx(Y.motion.legend,{"aria-hidden":"true",variants:{hidden:{width:0,padding:0},visible:{width:"auto",padding:"0 8px"}},initial:Le?"visible":"hidden",animate:Le?"visible":"hidden",className:"max-w-full ml-2 px-2 text-body-small h-0 overflow-hidden whitespace-nowrap",transition:{duration:.2},children:l.jsx("span",{className:"transform inline-flex -translate-y-1/2 opacity-0",children:a})}),l.jsxs("div",{className:"flex-1 relative",children:[Cn&&l.jsx(Y.motion.label,{htmlFor:X,className:p("absolute left-4 transition-all duration-300 pointer-events-none",{"text-body-small top-2":e=="filled"&&Pe,"text-body-large top-1/2 transform -translate-y-1/2":!(e=="filled"&&Pe)}),transition:{duration:.3},layoutId:e==="outlined"?`${X}-label`:void 0,children:l.jsx("span",{className:ce.label,children:a})}),Le&&l.jsx(Y.motion.label,{htmlFor:X,className:p("absolute left-2 -top-3 px-1 text-body-small z-10",ce.label),layoutId:`${X}-label`,transition:{duration:.3},children:a}),l.jsx(Mn,{...W,ref:N,value:Qe,onChange:se,className:p(ce.input,Ln),id:X,name:u,placeholder:O?r??void 0:"",onFocus:()=>{ae||F(!0)},onBlur:()=>{ae||F(!1)},disabled:n,autoComplete:x,"aria-invalid":!!(s!=null&&s.length),"aria-describedby":J?V:void 0,...In})]}),l.jsx("div",{className:ce.activeIndicator}),!T&&l.jsxs(l.Fragment,{children:[ye&&l.jsx("div",{ref:P?q:void 0,onClick:K=>{K.stopPropagation(),P&&Se(),ae&&et()},className:p(ce.trailingIcon,(P||ae)&&"cursor-pointer"),children:l.jsx("div",{className:"flex items-center justify-center w-full h-full",children:o.isValidElement(ye)?ye:l.jsx(le,{className:"h-5",icon:ye})})}),!ye&&c&&l.jsx("span",{className:ce.suffix,children:c})]}),T&&l.jsx("div",{className:p(ce.trailingIcon,{" absolute right-0":!ye}),children:l.jsx(le,{className:"h-5 text-error",icon:$s})})]}),J&&l.jsx("p",{className:ce.supportingText,id:V,children:s!=null&&s.length?s:i!=null&&i.length?i:" "}),P&&_&&l.jsx(l.Fragment,{children:l.jsx(be,{anchorRef:D,position:"bottom",children:l.jsxs("div",{ref:U,className:"z-50 shadow-xl rounded-[28px] bg-surface-container-high overflow-hidden",children:[l.jsx(En,{className:"",value:ee,onChange:oe}),l.jsxs("div",{className:"flex justify-end gap-2 p-4 pt-0",children:[l.jsx(me,{variant:"text",size:"small",onClick:()=>B(!1),children:"Cancel"}),l.jsx(me,{variant:"filled",size:"small",onClick:jn,children:"OK"})]})]})})}),ae&&de&&l.jsx(be,{anchorRef:D,position:"bottom",style:{width:(nt=D.current)==null?void 0:nt.offsetWidth},children:l.jsx("div",{ref:Fe,children:l.jsx(Ke,{className:"max-w-full",selected:A,children:M?o.Children.map(M,K=>o.isValidElement(K)&&K.type===Ce?o.cloneElement(K,{onClick:re=>{K.props.onClick&&K.props.onClick(re),tt(K.props.value??"")}}):K):R==null?void 0:R.map((K,re)=>K.type==="divider"?l.jsx(je,{className:"my-1"},re):K.type==="headline"?l.jsx(Ge,{label:K.label},re):l.jsx(Ce,{onClick:xe=>{K.onClick&&K.onClick(xe),tt(K.value??"")},...K,children:K.label},K.value??re))})})})]})},ar=({isSelected:e,icon:t,label:n,variant:s})=>({navigationRailItem:p(" 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]":s=="vertical","gap-0 h-[66px]":s=="horizontal"}),container:p(" w-fit flex justify-center relative rounded-full items-center mx-5",{"bg-secondary-container overflow-hidden":e,"gap-2 ":s=="horizontal","gap-0 ":s=="vertical","p-4":!n},n&&["px-4",{"py-1 ":s=="vertical","py-4 ":s=="horizontal"}]),stateLayer:p("rounded-full"),icon:p("size-6 flex"),label:p("w-fit mx-auto text-nowrap",{"text-label-large ":s=="horizontal","text-label-medium":s=="vertical"})}),cr=Z("navigationRailItem",ar),Nn=({label:e})=>l.jsx("div",{className:" h-9 flex items-center mx-9 mt-3",children:l.jsx("p",{className:"text-label-large text-on-surface-variant",children:e})}),kn=({className:e,onClick:t,label:n,variant:s="vertical",href:r,icon:c,selectedItem:u,setSelectedItem:a,index:d,onItemSelected:i,selected:f=!1,ref:y,transition:h,isExtended:m,iconSelected:x,style:b,extendedOnly:g,children:j,...L})=>{j&&(n=j);const w=o.useRef(null),C=y||w,[I,v]=o.useState(f);o.useEffect(()=>{f&&u==null?v(!0):v(u==d&&d!=null)},[u]),o.useEffect(()=>{u==d&&i&&i({ref:C,index:d||0,label:n,icon:c})},[u]);const E=r?"a":"button",R=W=>{a&&a(d??null),t&&t(W)},M=cr({isExtended:m,extendedOnly:g,className:e,onItemSelected:i,selectedItem:u,index:d,transition:h,selected:I,variant:s,icon:c,label:n,isSelected:I,setSelectedItem:a,href:r,children:n,iconSelected:x});return h={duration:.3,...h},g&&!m?null:l.jsxs(E,{...L,role:"tab","aria-selected":I,ref:C,href:r,className:M.navigationRailItem,onClick:R,style:{transition:h.duration+"s",...b},children:[l.jsxs(Y.motion.div,{style:{transition:s=="horizontal"?h.duration+`s, gap ${h.duration/2}s ${h.duration-h.duration/2}s`:h.duration+`s, gap ${h.duration/3}s ${h.duration-h.duration/3}s`},transition:h,className:M.container,children:[l.jsx(ue,{style:{transition:h.duration+"s"},className:M.stateLayer,colorName:p({"on-surface":!I,"on-secondary-container":I}),stateClassName:"state-ripple-group-[navigation-rail-item]"}),c&&l.jsx(le,{icon:I?x:c,className:M.icon}),l.jsx(Y.AnimatePresence,{children:s=="horizontal"&&(()=>{const W={width:0,opacity:0,transition:{...h}},k={width:"auto",opacity:1,transition:{...h,opacity:{duration:h.duration/2,delay:h.duration-h.duration/2}}};return l.jsx(Y.motion.span,{initial:W,animate:k,exit:W,className:M.label,children:n})})()})]}),l.jsx(Y.AnimatePresence,{children:s=="vertical"&&(()=>{const W={height:0,opacity:0,transition:{...h,opacity:{duration:0}}},k={height:"auto",opacity:1,transition:{...h,opacity:{duration:h.duration/3,delay:h.duration-h.duration/3}}};return l.jsx(Y.motion.span,{initial:k,animate:k,exit:W,className:M.label,transition:h,children:n})})()})]})},ur=({isExtended:e,alignment:t})=>({navigationRail:p("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:p("flex flex-col gap-1 items-start"),menuIcon:"mx-5",segments:p(" flex flex-col overflow-auto min-w-full mt-10",{"w-full":!e,"w-fit items-start":e})}),dr=Z("navigationRail",ur),fr=({variant:e="standard",onItemSelected:t,children:n,className:s,selectedItem:r,extended:c,alignment:u="top",menu:a={closed:{icon:Os,label:"Open menu"},opened:{icon:ke,label:"Close menu"}},style:d,onExtendedChange:i,transition:f,setSelectedItem:y})=>{const[h,m]=o.useState(null),[x,b]=o.useState(c);let g;r==0||r!=null?g=r:g=h;const j=y||m,L=o.useRef(null),w=M=>{t==null||t(M)};function C(M){const W=[];return o.Children.forEach(M,k=>{o.isValidElement(k)&&k.type===o.Fragment?W.push(...C(k.props.children)):W.push(k)}),W}const I=C(n),v=I.filter(M=>o.isValidElement(M)&&M.type===Re),E=dr({children:n,onItemSelected:t,selectedItem:g,setSelectedItem:j,className:s,variant:e,extended:x,isExtended:x,alignment:u,menu:a,transition:f,onExtendedChange:i});f={duration:.3,...f};const R=o.useRef(!1);return R.current=!1,o.useEffect(()=>{i==null||i(x??!1)},[x]),l.jsxs("div",{style:{transition:f.duration+"s",...d},ref:L,className:E.navigationRail,children:[l.jsxs("div",{className:E.header,children:[l.jsx(we,{onClick:()=>b(!x),label:x?a==null?void 0:a.opened.label:a==null?void 0:a.closed.label,className:E.menuIcon,icon:x?a.opened.icon:a==null?void 0:a.closed.icon}),v.length>0&&o.cloneElement(v[0],{transition:f,isExtended:x,className:"!shadow-none mx-5 "+v[0].props.className})]}),l.jsx("div",{className:E.segments,children:(()=>{let M=0;return I.map(W=>o.isValidElement(W)&&W.type===kn?o.cloneElement(W,{key:M,index:M++,variant:x?"horizontal":"vertical",selectedItem:g,setSelectedItem:j,onItemSelected:w,transition:f,extendedOnly:R.current,isExtended:x}):o.isValidElement(W)&&W.type===Re?null:o.isValidElement(W)&&W.type===Nn?(R.current=!0,x?o.cloneElement(W,{}):null):W)})()}),l.jsx("div",{className:"flex-1 max-h-[160px]"})]})};function hr(e){return ge.defineConfig({variant:ge.Variants.Udixio,...e,plugins:[new ge.FontPlugin(e),new Ie.TailwindPlugin(e)]})}exports.AnchorPositioner=be;exports.AnimateOnScrollInit=rs;exports.Button=me;exports.Card=Rs;exports.Carousel=Ds;exports.CarouselItem=yn;exports.Checkbox=Bs;exports.Chip=Be;exports.Chips=Ks;exports.ContextMenu=Ys;exports.CustomScroll=vt;exports.DatePicker=En;exports.Divider=je;exports.Fab=Re;exports.FabMenu=Js;exports.Icon=le;exports.IconButton=we;exports.Menu=Ke;exports.MenuGroup=He;exports.MenuHeadline=Ge;exports.MenuItem=Ce;exports.NavigationRail=fr;exports.NavigationRailItem=kn;exports.NavigationRailSection=Nn;exports.ProgressIndicator=pn;exports.RippleEffect=mt;exports.SideSheet=Qs;exports.Slider=Zs;exports.SmoothScroll=Xn;exports.Snackbar=er;exports.State=ue;exports.Switch=tr;exports.SyncedFixedWrapper=St;exports.Tab=bn;exports.TabGroup=sr;exports.TabPanel=Sn;exports.TabPanels=rr;exports.Tabs=nr;exports.TextField=lr;exports.ThemeProvider=Jn;exports.Tooltip=Je;exports.animateOnScroll=os;exports.buttonStyle=is;exports.cardStyle=ls;exports.carouselItemConfig=Ye;exports.carouselItemStyle=as;exports.carouselStyle=cs;exports.checkboxStyle=us;exports.chipStyle=ds;exports.chipsStyle=fs;exports.classNames=p;exports.classnames=yt;exports.createUseClassNames=Z;exports.customScrollStyle=xt;exports.defaultClassNames=ne;exports.defineConfig=hr;exports.dividerStyle=hs;exports.fabMenuStyle=ps;exports.fabStyle=ms;exports.generateThemeCss=Zn;exports.getClassNames=De;exports.iconButtonStyle=ys;exports.initAnimateOnScroll=_e;exports.menuGroupStyle=vs;exports.menuStyle=xs;exports.normalize=ve;exports.progressIndicatorStyle=gs;exports.sideSheetConfig=qe;exports.sideSheetStyle=Kt;exports.sliderConfig=Ue;exports.sliderStyle=bs;exports.snackbarStyle=Ss;exports.switchStyle=Es;exports.tabPanelStyle=Ls;exports.tabPanelsStyle=js;exports.tabStyle=Ns;exports.tabsStyle=ks;exports.textFieldStyle=Ms;exports.toolStyle=Is;exports.useButtonStyle=Nt;exports.useCardStyle=jt;exports.useCarouselItemStyle=Lt;exports.useCarouselStyle=It;exports.useCheckboxStyle=Rt;exports.useChipStyle=At;exports.useChipsStyle=Pt;exports.useClassNames=Tn;exports.useDividerStyle=Tt;exports.useFabMenuStyle=Ht;exports.useFabStyle=Ot;exports.useIconButtonStyle=zt;exports.useMenuGroupStyle=Ut;exports.useMenuStyle=Yt;exports.useProgressIndicatorStyle=Gt;exports.useSideSheetStyle=ws;exports.useSliderStyle=Jt;exports.useSnackbarStyle=Qt;exports.useStateStyle=bt;exports.useSwitchStyle=tn;exports.useTabPanelStyle=un;exports.useTabPanelsStyle=an;exports.useTabStyle=sn;exports.useTabsStyle=on;exports.useTextFieldStyle=fn;exports.useToolTipStyle=mn;exports.useTooltipTrigger=wn;
|
|
10
|
+
`})]}),I&&l.jsx(Be,{ref:C,className:"opacity-0",draggable:s,editable:!0,editing:!0,onChange:v=>{var E;if(v=v.replace(/( )+/g," ").trim(),console.log("Ghost chip onChange",v,!!v),v)j(v);else if(u.length>0){const R=h.current[u.length-1];(E=R==null?void 0:R.focus)==null||E.call(R)}},onEditCommit:()=>{},onBlur:()=>{i(!1)},onFocus:v=>{i(!0),v.stopPropagation()},children:" "})]})};function wn({trigger:e=["hover","focus"],isOpen:t,defaultOpen:n=!1,onOpenChange:s,openDelay:r=400,closeDelay:c=150,id:u}={}){const a=o.useId(),d=u??`tooltip-${a}`,i=Array.isArray(e)?e:[e],f=typeof t=="boolean",[y,h]=o.useState(n?"hovered":"hidden"),[m,x]=o.useState(!1),b=o.useRef(null),g=o.useRef(null),j=o.useCallback(()=>{b.current&&(clearTimeout(b.current),b.current=null),g.current&&(clearTimeout(g.current),g.current=null)},[]);o.useEffect(()=>()=>j(),[j]);const L=o.useCallback($=>{if(f){const A=$!=="hidden";s==null||s(A)}else{h($);const A=$!=="hidden";s==null||s(A)}},[f,s]),w=f?t?"hovered":"hidden":y,C=w!=="hidden",I=$=>{switch($){case"hidden":return 0;case"hovered":return 1;case"focused":return 2;case"clicked":return 3;default:return 0}},v=o.useCallback($=>{j(),!(I($)<=I(w))&&(b.current=setTimeout(()=>{L($)},r))},[j,r,w,L]),E=o.useCallback($=>{j(),g.current=setTimeout(()=>{(!f&&I(y)<=I($)||f)&&L("hidden")},c)},[j,c,y,f,L]),R=o.useCallback(()=>{i.includes("hover")&&v("hovered")},[i,v]),M=o.useCallback(()=>{i.includes("hover")&&(w==="focused"||w==="clicked"||m||E("hovered"))},[i,w,m,E]),W=o.useCallback(()=>{i.includes("focus")&&(j(),L("focused"))},[i,j,L]),k=o.useCallback(()=>{if(i.includes("focus")&&w!=="clicked"){if(i.includes("hover")&&m){L("hovered");return}E("focused")}},[i,w,m,E,L]),X=o.useCallback(()=>{i.includes("click")&&(j(),L(w==="clicked"?"hidden":"clicked"))},[i,w,j,L]),V=o.useCallback($=>{$.key==="Escape"&&C&&(j(),L("hidden"),$.preventDefault())},[C,j,L]),Q=o.useCallback(()=>{x(!0),j()},[j]),z=o.useCallback(()=>{x(!1),i.includes("hover")&&w==="hovered"&&E("hovered")},[i,w,E]);return{triggerProps:{"aria-describedby":C?d:void 0,onMouseEnter:R,onMouseLeave:M,onFocus:W,onBlur:k,onClick:X,onKeyDown:V},tooltipProps:{id:d,role:"tooltip","aria-hidden":!C,onMouseEnter:Q,onMouseLeave:z},isOpen:C,state:w}}const Je=({variant:e="plain",buttons:t,className:n,children:s,title:r,text:c,content:u,position:a,targetRef:d,ref:i,trigger:f=["hover","focus"],transition:y,openDelay:h=400,closeDelay:m=150,isOpen:x,defaultOpen:b=!1,onOpenChange:g,id:j,anchorRef:L,...w})=>{const I=a||(e==="rich"?"bottom-right":"bottom");if(y={duration:.3,...y},!s&&!d)throw new Error("Tooltip must have a child or a targetRef");t&&!Array.isArray(t)&&(t=[t]);const v=o.useRef(null),R=L||(d||v),{triggerProps:M,tooltipProps:W,isOpen:k}=wn({trigger:f,isOpen:x,defaultOpen:b,onOpenChange:g,openDelay:h,closeDelay:m,id:j}),X=!d&&o.isValidElement(s)?o.cloneElement(s,{ref:v,...M,onMouseEnter:z=>{var $,A;M.onMouseEnter(),(A=($=s.props)==null?void 0:$.onMouseEnter)==null||A.call($,z)},onMouseLeave:z=>{var $,A;M.onMouseLeave(),(A=($=s.props)==null?void 0:$.onMouseLeave)==null||A.call($,z)},onFocus:z=>{var $,A;M.onFocus(),(A=($=s.props)==null?void 0:$.onFocus)==null||A.call($,z)},onBlur:z=>{var $,A;M.onBlur(),(A=($=s.props)==null?void 0:$.onBlur)==null||A.call($,z)},onClick:z=>{var $,A;M.onClick(),(A=($=s.props)==null?void 0:$.onClick)==null||A.call($,z)},onKeyDown:z=>{var $,A;M.onKeyDown(z),(A=($=s.props)==null?void 0:$.onKeyDown)==null||A.call($,z)}}):s;o.useEffect(()=>{if(!d)return;const z=d.current;if(!z)return;const $=()=>M.onMouseEnter(),A=()=>M.onMouseLeave(),O=()=>M.onFocus(),F=()=>M.onBlur(),T=()=>M.onClick(),G=S=>M.onKeyDown(S);return z.addEventListener("mouseenter",$),z.addEventListener("mouseleave",A),z.addEventListener("focus",O,!0),z.addEventListener("blur",F,!0),z.addEventListener("click",T),z.addEventListener("keydown",G),M["aria-describedby"]?z.setAttribute("aria-describedby",M["aria-describedby"]):z.removeAttribute("aria-describedby"),()=>{z.removeEventListener("mouseenter",$),z.removeEventListener("mouseleave",A),z.removeEventListener("focus",O,!0),z.removeEventListener("blur",F,!0),z.removeEventListener("click",T),z.removeEventListener("keydown",G)}},[d,M]);const V=mn({variant:e,buttons:t,className:n,title:r,text:c,position:I,trigger:f,targetRef:d,children:s}),Q={open:{opacity:1,height:"auto"},close:{opacity:0,height:16}};return l.jsxs(l.Fragment,{children:[X,l.jsx(Y.AnimatePresence,{children:k&&l.jsx(be,{anchorRef:R,position:I,children:l.jsx(Y.motion.div,{initial:"close",variants:Q,animate:"open",transition:{duration:y.duration},exit:"close",className:V.toolTip,...w,...W,children:l.jsx("div",{className:V.container,children:u?l.jsx("div",{className:V.content,children:u}):l.jsxs(l.Fragment,{children:[r&&l.jsx("div",{className:V.subHead,children:r}),c&&l.jsx("div",{className:V.supportingText,children:c}),t&&l.jsx("div",{className:V.actions,children:Array.isArray(t)&&t.map((z,$)=>l.jsx(me,{size:"small",variant:"text",...z},$))})]})})})})})]})},Re=({className:e,label:t,variant:n="primary",size:s="medium",href:r,type:c,icon:u,extended:a=!1,ref:d,transition:i,children:f,...y})=>{if(f&&(t=f),!t)throw new Error("FAB component requires either a label prop or children content");const h=r?"a":"button",m=Ot({href:r,icon:u,extended:a,label:t,size:s,variant:n,className:e,transition:i,children:t});i={duration:.3,...i};const x=o.useRef(null),b=d||x,g={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 l.jsxs(h,{...y,ref:b,href:r,"aria-label":a?void 0:t,className:m.fab,children:[l.jsx(Je,{trigger:a?null:void 0,text:t,targetRef:b}),l.jsx(ue,{style:{transition:i.duration+"s"},className:m.stateLayer,colorName:p({"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]"}),l.jsx(le,{icon:u,className:m.icon}),l.jsx(Y.AnimatePresence,{children:a&&l.jsx(Y.motion.span,{variants:g,initial:"hidden",animate:"visible",exit:"hidden",className:m.label,children:t})})]})},we=({variant:e="standard",href:t,disabled:n=!1,title:s,label:r,onToggle:c,activated:u=!1,onClick:a,icon:d,size:i="medium",iconSelected:f,className:y,ref:h,width:m="default",shape:x="rounded",allowShapeTransformation:b=!0,transition:g,children:j,...L})=>{if(j&&(r=j),!r)throw new Error("IconButton component requires either a label prop or children content to provide an accessible aria-label");!s&&s!==null&&(s=r);const[w,C]=o.useState(u),I=W=>{n&&W.preventDefault(),c?(C(!w),c(!w)):a&&a(W)};o.useEffect(()=>{C(u)},[u]);const v=t?"a":"button",E=zt({transition:g,shape:x,allowShapeTransformation:b,width:m,href:t,activated:w,label:r,iconSelected:f,isActive:w,onToggle:c,disabled:n,icon:d,variant:e,className:y,size:i,children:r,...L}),R=o.useRef(null),M=h||R;return g={duration:.3,...g},l.jsxs(v,{disabled:n,href:t,style:{transition:g.duration+"s"},className:E.iconButton,"aria-label":r,...L,title:void 0,onClick:I,ref:M,children:[s!==null&&l.jsx(Je,{targetRef:M,trigger:n?null:void 0,text:s}),l.jsx("div",{className:E.touchTarget}),l.jsx(ue,{style:{transition:g.duration+"s"},className:E.stateLayer,colorName:p(e==="standard"&&{"on-surface-variant":!w,"on-primary":w},e==="filled"&&{"on-surface-variant":!w&&!!c,"on-primary":w||!c},e==="tonal"&&{"on-secondary":w&&!!c,"on-secondary-container":!w||!c},e==="outlined"&&{"inverse-on-surface":w&&!!c,"on-surface-variant":!w||!c}),stateClassName:"state-ripple-group-[icon-button]"}),d?l.jsx(le,{icon:d,className:E.icon}):j]})},Js=({className:e,label:t,variant:n="primary",size:s="medium",href:r,icon:c,extended:u=!1,ref:a,transition:d,children:i,open:f,defaultOpen:y=!1,onOpenChange:h,...m})=>{d={duration:.3,ease:"easeInOut",...d};const x=o.useRef(null),b=a||x,g=typeof f=="boolean",[j,L]=o.useState(y),w=g?f:j,C=k=>{g||L(k),h==null||h(k)},I=o.Children.toArray(i).filter(k=>o.isValidElement(k)&&k.type===me),v=Ht({href:r,icon:c,extended:u,label:t,size:s,variant:n,className:e,transition:d,children:t,open:w}),E=Y.motion.create(Re),R=Y.motion.create(we),M=k=>l.jsx(E,{icon:c,extended:u,label:t,variant:n+"Container",size:s,className:v.fab+" "+(e??""),"aria-expanded":w,onClick:()=>C(!0),style:{transition:"border-radius 0.3s ease-in-out"},transition:{duration:d.duration,ease:"easeInOut",borderRadius:{duration:d.duration,ease:"easeInOut"},background:{duration:d.duration,ease:"easeInOut"},...d},...k}),W=o.useId();return l.jsxs("div",{className:v.fabMenu,ref:b,...m,children:[l.jsx(Y.AnimatePresence,{children:w&&l.jsx("div",{className:v.actions,role:"menu","aria-hidden":!w,children:(()=>{const k=I.length;return I.map((X,V)=>{X.props;const Q=k-1-V,z=((d==null?void 0:d.delay)??0)+Q*.06,$={open:{overflow:"visible",opacity:1,width:"auto",transition:{...d,delay:z,opacity:{delay:(d==null?void 0:d.duration)/2+z}}},close:{overflow:"hidden",opacity:0,width:0,transition:{...d,delay:z,opacity:{duration:(d==null?void 0:d.duration)/1.5}}}};return l.jsx(Y.motion.div,{initial:"close",animate:"open",variants:$,transition:d,exit:"close",children:o.cloneElement(X,{key:V,shape:"rounded",variant:"filled",className:()=>({button:p("max-w-full overflow-hidden text-nowrap",{"px-0":!w,"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:p({"state-on-primary-container":n==="primary","state-on-secondary-container":n==="secondary","state-on-tertiary-container":n==="tertiary"})})})})})})()})}),M({className:"invisible pointer-events-none"}),l.jsxs("div",{className:"absolute right-0 top-0",children:[!w&&M({className:"",layout:!0,layoutId:"fab-menu"+W}),w&&l.jsx(l.Fragment,{children:l.jsx(R,{layout:!0,layoutId:"fab-menu"+W,variant:"filled",className:()=>({iconButton:p({"bg-primary text-on-primary":n==="primary","bg-secondary text-on-secondary":n==="secondary","bg-tertiary text-on-tertiary":n==="tertiary"}),stateLayer:p({"[--default-color:var(--color-on-primary)]":n==="primary","[--default-color:var(--color-on-secondary)]":n==="secondary","[--default-color:var(--color-on-tertiary)]":n==="tertiary"})}),style:{transition:"border-radius 0.3s ease-in-out"},transition:{duration:d.duration,ease:"easeInOut",borderRadius:{duration:d.duration,ease:"easeInOut"},background:{duration:d.duration,ease:"easeInOut"},...d},icon:Ts,onClick:()=>C(!1),children:"Close"})})]})]})},Zs=({className:e,valueFormatter:t,step:n=10,name:s,value:r=0,min:c=0,max:u=100,marks:a=[{value:0,label:"0"},{value:100,label:"100"}],ref:d,onChange:i,...f})=>{const y=A=>{const O=m(),F=h();return A===1/0?100:A===-1/0?0:(A-O)/(F-O)*100},h=(A=!1)=>A?u:u==1/0?a[(a==null?void 0:a.length)-1].value:u,m=(A=!1)=>A?c:c==-1/0?a[0].value:c,x=A=>{const O=m(!1);return(h(!1)-O)*A/100+O},[b,g]=o.useState(!1),j=o.useRef(null),L=d||j,[w,C]=o.useState(r),[I,v]=o.useState(y(r)),[E,R]=o.useState(!1);o.useEffect(()=>{C(r),v(y(r))},[r]);const M=A=>{R(!0),g(!0),X(A)},W=()=>{R(!1),g(!1)};o.useEffect(()=>(E?(window.addEventListener("mouseup",W),window.addEventListener("mousemove",X),window.addEventListener("touchend",W),window.addEventListener("touchmove",X)):(window.removeEventListener("mouseup",W),window.removeEventListener("mousemove",X),window.removeEventListener("touchend",W),window.removeEventListener("touchmove",X)),()=>{window.removeEventListener("mouseup",W),window.removeEventListener("mousemove",X),window.removeEventListener("touchend",W),window.removeEventListener("touchmove",X)}),[E]);const k=Jt({className:e,isChanging:b,marks:a,max:u,min:c,name:s,step:n,value:w,valueFormatter:t,onChange:i}),X=A=>{const O=L==null?void 0:L.current;if(O){const F=O.getBoundingClientRect().left,G=((A.type==="touchmove"||A.type==="touchstart"?A.touches[0].clientX:A.clientX)-F)/O.offsetWidth*100;V({percent:G})}},V=({percent:A,value:O})=>{if(A){if(A>=100){C(h(!0)),v(100);return}if(A<=0){C(m(!0)),v(0);return}O=x(A),O==m()&&(O=m(!0)),O==h()&&(O=h(!0))}else if(O!=null){if(O>=h()){C(h(!0)),v(100);return}if(O<=m()){C(m(!0)),v(0);return}A=y(O)}else return;n!=null?O=Math.round((O-m())/n)*n+m():a&&(O=a.reduce((F,T,G)=>{let S=T.value===1/0?h():T.value===-1/0?m():T.value,N=F.value===1/0?h():F.value===-1/0?m():F.value;return S=Math.abs(S-O),N=Math.abs(N-O),S<N?T:F}).value),O>=h()&&(O=h(!0)),O<=m()&&(O=m(!0)),A=y(O),C(O),v(A),i&&i(O)},[Q,z]=o.useState(0);o.useEffect(()=>{const A=()=>{L.current&&z(L.current.offsetWidth)};return A(),window.addEventListener("resize",A),()=>{window.removeEventListener("resize",A)}},[]);const $=A=>{switch(A.key){case"ArrowRight":if(n)V({value:w+n});else if(a){const O=a.find(F=>F.value>w);O&&V({value:O.value})}break;case"ArrowLeft":if(n)V({value:w-n});else if(a){const O=a.slice(0).reverse().find((F,T,G)=>w===1/0?T===1:F.value<w);O&&V({value:O.value})}break;default:return}};return l.jsxs("div",{tabIndex:0,onKeyDown:$,role:"slider","aria-valuemin":m(!0),"aria-valuemax":h(!0),"aria-valuenow":w,"aria-valuetext":w.toString(),className:k.slider,onMouseDown:M,onClick:X,ref:L,onTouchStart:M,onDragStart:A=>A.preventDefault(),...f,children:[l.jsx("input",{type:"hidden",name:s,value:w}),l.jsx("div",{className:k.activeTrack,style:{flex:I/100}}),l.jsx("div",{className:k.handle,children:l.jsx(Y.AnimatePresence,{children:b&&l.jsx(Y.motion.div,{className:k.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(w):w})})}),l.jsx("div",{className:k.inactiveTrack,style:{flex:1-I/100}}),l.jsx("div",{className:"w-[calc(100%-12px)] h-full absolute -translate-x-1/2 transform left-1/2",children:a&&a.map((A,O)=>{let F=null;const T=(b?9:10)/Q*100,G=y(A.value);return G<=I-T?F=!0:G>=I+T&&(F=!1),l.jsx("div",{className:p(k.dot,{"bg-primary-container":F!=null&&F,"bg-primary":F!=null&&!F}),style:{left:`${y(A.value)}%`}},O)})})]})},Qs=({variant:e="standard",className:t,children:n,title:s,position:r="right",extended:c,divider:u,onExtendedChange:a,closeIcon:d=je,transition:i,...f})=>{i={duration:.3,...i};const[y,h]=o.useState(c??!0),m=Kt({transition:i,title:s,position:r,closeIcon:d,className:t,children:n,onExtendedChange:a,divider:u,isExtended:y,extended:y,variant:e});o.useEffect(()=>{a==null||a(y??!1)},[y]),o.useEffect(()=>{c!=null&&h(c)},[c]);const x={close:{width:0},open:{width:"auto"}},b=()=>l.jsxs(l.Fragment,{children:[l.jsx(Y.AnimatePresence,{children:e=="modal"&&y&&l.jsx(Y.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:i,onClick:()=>h(!1),className:m.overlay})}),l.jsx(Y.AnimatePresence,{children:y&&l.jsxs("div",{...f,className:m.sideSheet,style:{transition:i.duration+"s"},children:[l.jsxs(Y.motion.div,{variants:x,initial:c===!1?"open":"close",animate:"open",exit:"close",className:m.container,children:[l.jsxs("div",{className:m.header,children:[s&&l.jsx("p",{className:m.title,children:s}),l.jsx(we,{size:"small",label:"close",icon:d,onClick:()=>h(!1),className:m.closeButton})]}),l.jsx("div",{className:m.content,style:{transition:i.duration+"s"},children:n})]}),(u==null&&e=="standard"?!0:u)&&l.jsx(Le,{className:m.divider,orientation:"vertical"})]})})]});return e=="modal"?Ve.createPortal(b(),document.body):b()},er=({message:e,className:t,duration:n,closeIcon:s=je,onClose:r,...c})=>{const[u,a]=o.useState(!0),d=Qt({className:t,closeIcon:s,duration:n,isVisible:u,onClose:r,message:e});o.useEffect(()=>{n&&setTimeout(()=>{i()},n)},[n]);const i=()=>{a(!1),r==null||r()};return l.jsx(Y.AnimatePresence,{children:u&&l.jsx(Y.motion.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.1},className:d.snackbar,...c,children:l.jsxs("div",{className:d.container,children:[l.jsx("p",{className:d.supportingText,children:e}),l.jsx(we,{onClick:()=>i(),className:d.icon,icon:s,label:"close the snackbar"})]})})})},tr=({selected:e=!1,className:t,activeIcon:n,disabled:s=!1,inactiveIcon:r,onChange:c,onClick:u,onKeyDown:a,ref:d,...i})=>{const[f,y]=o.useState(e);o.useEffect(()=>{y(e)},[e]);const h=L=>{s||(x(),u&&u(L))},m=L=>{s||((L.key===" "||L.key==="Enter")&&(L.preventDefault(),x()),a&&a(L))},x=()=>{y(!f),c==null||c(!f)},b=tn({className:t,isSelected:f,activeIcon:n,inactiveIcon:r,disabled:s,selected:f,onChange:c}),g=o.useRef(null),j=d||g;return l.jsxs(Y.motion.div,{role:"switch","aria-checked":f,tabIndex:s?-1:0,onKeyDown:m,onClick:h,ref:j,className:b.switch,...i,children:[l.jsx("input",{type:"hidden",value:f?"1":"0"}),l.jsxs(Y.motion.div,{layout:!0,style:{translate:f?"50%":"-50%"},transition:{type:"spring",stiffness:700,damping:30},className:b.handleContainer,children:[l.jsx("div",{className:b.handle,children:(f?n:r)&&l.jsx(le,{className:b.icon,icon:f?n:r})}),l.jsx("div",{className:b.handleStateLayer})]})]})},bn=({className:e,onClick:t,label:n,variant:s="primary",href:r,icon:c,selectedTab:u,setSelectedTab:a,tabsId:d,index:i,onTabSelected:f,scrollable:y=!1,selected:h=!1,children:m,ref:x,...b})=>{const g=o.useRef(null),j=x||g,L=n??(typeof m=="string"?m:void 0),[w,C]=o.useState(h);o.useEffect(()=>{h&&u==null?C(!0):C(u==i&&i!=null)},[u]),o.useEffect(()=>{u==i&&f&&f({ref:j,index:i||0,label:L,icon:c})},[u]);const I=r?"a":"button",v=R=>{a&&a(i??null),t&&t(R)},E=sn({className:e,onTabSelected:f,scrollable:y,selectedTab:u,index:i,tabsId:d,selected:w,variant:s,icon:c,label:L,isSelected:w,setSelectedTab:a,href:r});return l.jsxs(I,{...b,role:"tab","aria-selected":w,ref:j,href:r,className:E.tab,onClick:v,...b,children:[l.jsx(ue,{style:{transition:.3+"s"},className:E.stateLayer,colorName:s==="primary"&&w?"primary":"on-surface",stateClassName:"state-ripple-group-[tab]"}),l.jsxs("span",{className:E.content,children:[c&&l.jsx(le,{icon:c,className:E.icon}),l.jsx("span",{className:E.label,children:L}),w&&l.jsx(Y.motion.span,{layoutId:`underline-${d}`,className:E.underline,transition:{duration:.3}})]})]})},Ze=o.createContext(null),nr=({variant:e="primary",onTabSelected:t,children:n,className:s,selectedTab:r,setSelectedTab:c,scrollable:u=!1})=>{const a=o.useContext(Ze),[d,i]=o.useState(null);let f;r===0||r!=null?f=r:a?f=a.selectedTab:f=d;const y=c??(a==null?void 0:a.setSelectedTab)??i,h=o.Children.toArray(n).filter(j=>o.isValidElement(j)&&j.type===bn),m=o.useRef(null),x=j=>{if(t==null||t(j),u){const L=m.current,w=j.ref.current;if(L&&w){const C=w.offsetLeft+w.offsetWidth/2-L.offsetWidth/2;L.scrollTo({left:C,behavior:"smooth"})}}},b=o.useMemo(()=>(a==null?void 0:a.tabsId)??gn(),[a==null?void 0:a.tabsId]),g=on({children:n,onTabSelected:t,scrollable:u,selectedTab:f,setSelectedTab:y,className:s,variant:e});return l.jsx("div",{ref:m,role:"tablist",className:g.tabs,children:h.map((j,L)=>o.cloneElement(j,{key:L,index:L,variant:e,selectedTab:f,setSelectedTab:y,tabsId:b,onTabSelected:x,scrollable:u}))})},sr=({children:e,selectedTab:t,setSelectedTab:n,defaultTab:s=0})=>{const[r,c]=o.useState(s),u=o.useRef(null),a=t!==void 0?t:r,d=n??c,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:d,previousTab:u.current,direction:i,tabsId:f}),[a,d,i,f]);return l.jsx(Ze.Provider,{value:y,children:e})},Sn=({children:e,className:t,isSelected:n=!1})=>{const s=un({children:e,className:t,isSelected:n});return l.jsx("div",{className:s.tabPanel,children:e})},rr=({children:e,className:t})=>{const n=o.useContext(Ze);if(!n)return console.warn("TabPanels must be used within a TabGroup"),null;const{selectedTab:s,direction:r,tabsId:c}=n,u=o.Children.toArray(e).filter(d=>o.isValidElement(d)&&d.type===Sn),a=an({children:e,className:t});return l.jsx("div",{className:a.tabPanels,children:l.jsx(Y.AnimatePresence,{initial:!1,custom:r,mode:"popLayout",children:u.map((d,i)=>s===i&&l.jsx(Y.motion.div,{custom:r,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-${c}-${i}`,children:o.cloneElement(d,{isSelected:!0})},i))})})},or=({hasSelected:e})=>({datePicker:p("inline-flex flex-col bg-surface-container-high rounded-[28px] p-3 select-none","min-w-[320px]"),header:p("flex items-center justify-between h-12 mb-2 px-2"),monthNav:p("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:p("text-label-large text-on-surface font-bold capitalize"),weekDays:p("grid grid-cols-7 mb-2"),weekDay:p("h-10 flex items-center justify-center text-body-small text-on-surface-variant"),daysGrid:p("grid grid-cols-7 row-auto gap-y-2"),dayCell:p("flex items-center justify-center h-10 p-0 relative"),dayButton:p("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")}),ir=Z("datePicker",or),En=({value:e,defaultValue:t,onChange:n,minDate:s,maxDate:r,shouldDisableDate:c,locale:u="default",weekStartDay:a=0,className:d,style:i,mode:f="single",...y})=>{const[h,m]=o.useState(()=>{const S=D=>D instanceof Date?D:Array.isArray(D)&&D[0]?D[0]:null,N=S(e)||S(t)||new Date;return new Date(N.getFullYear(),N.getMonth(),1)}),[x,b]=o.useState(0),[g,j]=o.useState("day"),L=e!==void 0,[w,C]=o.useState(t||null),I=L?e||null:w,v=(S,N)=>new Date(S,N+1,0).getDate(),E=o.useMemo(()=>{const S=h.getFullYear(),N=h.getMonth(),D=v(S,N),U=(new Date(S,N,1).getDay()-a+7)%7,J=[],te=v(S,N-1);for(let _=U-1;_>=0;_--)J.push({date:new Date(S,N-1,te-_),isCurrentMonth:!1});for(let _=1;_<=D;_++)J.push({date:new Date(S,N,_),isCurrentMonth:!0});const P=42-J.length;for(let _=1;_<=P;_++)J.push({date:new Date(S,N+1,_),isCurrentMonth:!1});return J},[h,a]),R=o.useMemo(()=>{const S=new Date().getFullYear(),N=S-100,D=S+100,q=[];for(let U=N;U<=D;U++)q.push(U);return q},[]),M=o.useRef(null);o.useEffect(()=>{if(g==="year"&&M.current){const S=M.current.querySelector('[data-selected="true"]');S&&S.scrollIntoView({block:"center"})}},[g]);const W=o.useMemo(()=>new Intl.DateTimeFormat(u,{month:"long",year:"numeric"}),[u]),k=o.useMemo(()=>new Intl.DateTimeFormat(u,{weekday:"narrow"}),[u]),X=o.useMemo(()=>{const S=new Date(2023,0,1+a);return Array.from({length:7}).map((N,D)=>{const q=new Date(S);return q.setDate(S.getDate()+D),k.format(q).charAt(0).toUpperCase()})},[k,a]),V=()=>{b(-1),m(S=>new Date(S.getFullYear(),S.getMonth()-1,1))},Q=()=>{b(1),m(S=>new Date(S.getFullYear(),S.getMonth()+1,1))},z=S=>{m(N=>new Date(S,N.getMonth(),1)),j("day")},$=(S,N)=>S?S.getDate()===N.getDate()&&S.getMonth()===N.getMonth()&&S.getFullYear()===N.getFullYear():!1,A=S=>$(new Date,S),O=S=>{let N=S;if(f==="single")N=S;else{const D=I,[q,U]=Array.isArray(D)?D:[null,null];!q||q&&U?N=[S,null]:S<q?N=[S,q]:N=[q,S]}L||C(N),n&&n(N)},F=S=>{if(f==="single")return{isSelected:$(I,S),isStart:!1,isEnd:!1,isInRange:!1};const N=Array.isArray(I)?I:[I,null],[D,q]=N,U=$(D,S),J=$(q,S);let te=!1;if(D&&q){const se=new Date(D.getFullYear(),D.getMonth(),D.getDate()).getTime(),P=new Date(q.getFullYear(),q.getMonth(),q.getDate()).getTime(),_=new Date(S.getFullYear(),S.getMonth(),S.getDate()).getTime();te=_>se&&_<P}return{isSelected:U||J,isStart:U,isEnd:J,isInRange:te}},T=ir({hasSelected:!!I}),G={enter:S=>({x:S>0?"100%":"-100%",opacity:0}),center:{x:0,opacity:1},exit:S=>({x:S<0?"100%":"-100%",opacity:0})};return l.jsxs("div",{className:p(T.datePicker,d),style:i,...y,children:[l.jsxs("div",{className:T.header,children:[l.jsxs(me,{variant:"text",disableTextMargins:!0,size:"small",onClick:()=>j(S=>S==="day"?"year":"day"),className:"text-label-large font-bold capitalize text-on-surface hover:bg-surface-container-highest",children:[l.jsx("span",{className:"mr-2",children:g==="day"?W.format(h):h.getFullYear()}),l.jsx(le,{icon:vn,className:p("w-3 h-3 transition-transform duration-200 inline",g==="year"&&"rotate-180")})]}),g==="day"&&l.jsxs("div",{className:"flex items-center",children:[l.jsx(we,{size:"xSmall",allowShapeTransformation:!1,onClick:V,icon:Ws,label:"Previous month",title:null}),l.jsx(we,{size:"xSmall",allowShapeTransformation:!1,onClick:Q,icon:xn,label:"Next month",title:null})]})]}),g==="year"?l.jsx("div",{className:"h-[280px] overflow-y-auto grid grid-cols-3 gap-2 p-2 scrollbar-hide",ref:M,children:R.map(S=>l.jsx(me,{size:"small",variant:S===h.getFullYear()?"filled":"text",onClick:()=>z(S),"data-selected":S===h.getFullYear(),className:p("w-full",{"text-on-surface":S!==h.getFullYear()}),label:S.toString(),children:S},S))}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:T.weekDays,children:X.map((S,N)=>l.jsx("div",{className:T.weekDay,children:S},N))}),l.jsx("div",{className:"overflow-hidden relative min-h-[240px]",children:l.jsx(Y.AnimatePresence,{mode:"popLayout",initial:!1,custom:x,children:l.jsx(Y.motion.div,{custom:x,variants:G,initial:"enter",animate:"center",exit:"exit",transition:{type:"spring",bounce:0,duration:.3},className:T.daysGrid,children:E.map((S,N)=>{if(!S.isCurrentMonth)return l.jsx("div",{className:T.dayCell},N);const{isSelected:D,isStart:q,isEnd:U,isInRange:J}=F(S.date),te=A(S.date),se=s&&S.date<s||r&&S.date>r||(c==null?void 0:c(S.date));return l.jsx("div",{className:p(T.dayCell,J&&"bg-primary/20",q&&(I==null?void 0:I[1])&&"bg-gradient-to-r from-transparent to-primary/20",U&&(I==null?void 0:I[0])&&"bg-gradient-to-l from-transparent to-primary/20"),children:l.jsx(me,{className:()=>({button:p("aspect-square h-[40px] p-0",{"text-on-surface":!D&&!te,"opacity-50":se}),stateLayer:p({"!bg-transparent":se})}),size:"small",allowShapeTransformation:!1,variant:p({filled:D,outlined:te,text:!D&&!te}),label:S.date.getDate().toString(),onClick:()=>O(S.date),disabled:se,children:S.date.getDate().toString()})},N)})},h.toISOString())})})]})]})},lr=({variant:e="filled",autoFocus:t,disabled:n=!1,errorText:s,placeholder:r,suffix:c,name:u,label:a,className:d,supportingText:i,trailingIcon:f,leadingIcon:y,type:h="text",multiline:m=!1,autoComplete:x="on",onChange:b,value:g,defaultValue:j,showSupportingText:L,id:w,style:C,ref:I,onFocus:v,onBlur:E,options:R,children:M,...W})=>{var nt;const k=o.useId(),X=w||k,V=`${X}-helper`,Q=g!==void 0,[z,$]=o.useState(j??""),A=Q?g:z,[O,F]=o.useState(!1),[T,G]=o.useState(!!(s!=null&&s.length)),S=o.useRef(null),N=I||S,D=o.useRef(null),q=o.useRef(null),U=o.useRef(null),J=L??(!!(s!=null&&s.length)||!!(i!=null&&i.length));o.useEffect(()=>{G(!!(s!=null&&s.length))},[s]);const te=()=>{N.current&&!O&&!n&&h!=="select"&&N.current.focus()};o.useEffect(()=>{if(!(!t||n)&&h!=="select"){const K=window.requestAnimationFrame(()=>{te()});return()=>window.cancelAnimationFrame(K)}},[t,n,N,h]),o.useEffect(()=>{O?(G(!1),v==null||v()):(s!=null&&s.length&&G(!0),E==null||E())},[O]);const se=K=>{const re=K.target.value;Q||$(re),G(!1),b&&b(K)},P=h==="date",[_,B]=o.useState(!1),[ee,oe]=o.useState(null),pe=o.useMemo(()=>{const K=String(A);if(!K)return null;const[re,xe,Ee]=K.split("-").map(Number);return re&&xe&&Ee?new Date(re,xe-1,Ee):null},[A]),Se=()=>{n||(_?B(!1):(oe(pe),B(!0)))};o.useEffect(()=>{_?F(!0):(!ae||!de)&&F(!1)},[_]),o.useEffect(()=>{if(!_)return;const K=fe=>{var Ne,Ie;return fe?((Ne=D.current)==null?void 0:Ne.contains(fe))||((Ie=U.current)==null?void 0:Ie.contains(fe)):!1},re=fe=>{var st,rt;const Ne=fe.target,Ie=(st=U.current)==null?void 0:st.contains(Ne),Rn=(rt=q.current)==null?void 0:rt.contains(Ne);!Ie&&!Rn&&B(!1)},xe=fe=>{K(fe.target)||B(!1)},Ee=fe=>{fe.key==="Escape"&&B(!1)};return document.addEventListener("pointerdown",re),document.addEventListener("focusin",xe),document.addEventListener("keydown",Ee),()=>{document.removeEventListener("pointerdown",re),document.removeEventListener("focusin",xe),document.removeEventListener("keydown",Ee)}},[_]);const jn=()=>{const K=ee?ee.toLocaleDateString("en-CA"):"";Q||$(K),b&&b({target:{value:K,name:u,type:h}}),B(!1)},ae=h==="select",[de,Ae]=o.useState(!1),Fe=o.useRef(null),Qe=o.useMemo(()=>{if(ae&&R){const K=R.find(re=>String(re.value)===String(A));return K?K.label:A}return A},[A,ae,R]),et=()=>{n||(Ae(!de),F(!de))},tt=K=>{if(Q||$(String(K)),b){const re={target:{value:String(K),name:u,type:h}};b(re)}Ae(!1),F(!1)};o.useEffect(()=>{if(!de)return;const K=re=>{D.current&&!D.current.contains(re.target)&&Fe.current&&!Fe.current.contains(re.target)&&(Ae(!1),F(!1))};return document.addEventListener("mousedown",K),()=>{document.removeEventListener("mousedown",K)}},[de]);const ye=o.useMemo(()=>{if(f)return f;if(P)return Fs;if(ae)return de?Ps:vn},[f,P,ae,de]),Ln=P||ae?"[&::-webkit-calendar-picker-indicator]:hidden cursor-pointer selection:bg-transparent":"",ce=fn({showSupportingText:J,isFocused:O,showErrorIcon:T,disabled:n,name:u,label:a,autoComplete:x,className:d,onChange:b,placeholder:r,supportingText:i,type:h,leadingIcon:y,trailingIcon:ye,variant:e,errorText:s,value:String(Qe),suffix:c,multiline:m}),Mn=m?Pn:"input",In=m?{}:{type:ae?"text":h,readOnly:ae},Pe=O||typeof A=="string"&&A.length>0||h=="date"||ae&&de,Me=Pe&&e==="outlined",Cn=!Me;return l.jsxs("div",{ref:D,className:ce.textField,style:C,children:[l.jsxs("fieldset",{onClick:()=>{ae?et():te()},className:ce.content,role:"presentation",children:[l.jsx("div",{className:ce.stateLayer}),y&&l.jsx("div",{className:ce.leadingIcon,children:o.isValidElement(y)?y:l.jsx(le,{className:"w-5 h-5",icon:y})}),l.jsx(Y.motion.legend,{"aria-hidden":"true",variants:{hidden:{width:0,padding:0},visible:{width:"auto",padding:"0 8px"}},initial:Me?"visible":"hidden",animate:Me?"visible":"hidden",className:"max-w-full ml-2 px-2 text-body-small h-0 overflow-hidden whitespace-nowrap",transition:{duration:.2},children:l.jsx("span",{className:"transform inline-flex -translate-y-1/2 opacity-0",children:a})}),l.jsxs("div",{className:"flex-1 relative",children:[Cn&&l.jsx(Y.motion.label,{htmlFor:X,className:p("absolute left-4 transition-all duration-300 pointer-events-none",{"text-body-small top-2":e=="filled"&&Pe,"text-body-large top-1/2 transform -translate-y-1/2":!(e=="filled"&&Pe)}),transition:{duration:.3},layoutId:e==="outlined"?`${X}-label`:void 0,children:l.jsx("span",{className:ce.label,children:a})}),Me&&l.jsx(Y.motion.label,{htmlFor:X,className:p("absolute left-2 -top-3 px-1 text-body-small z-10",ce.label),layoutId:`${X}-label`,transition:{duration:.3},children:a}),l.jsx(Mn,{...W,ref:N,value:Qe,onChange:se,className:p(ce.input,Ln),id:X,name:u,placeholder:O?r??void 0:"",onFocus:()=>{ae||F(!0)},onBlur:()=>{ae||F(!1)},disabled:n,autoComplete:x,"aria-invalid":!!(s!=null&&s.length),"aria-describedby":J?V:void 0,...In})]}),l.jsx("div",{className:ce.activeIndicator}),!T&&l.jsxs(l.Fragment,{children:[ye&&l.jsx("div",{ref:P?q:void 0,onClick:K=>{K.stopPropagation(),P&&Se(),ae&&et()},className:p(ce.trailingIcon,(P||ae)&&"cursor-pointer"),children:l.jsx("div",{className:"flex items-center justify-center w-full h-full",children:o.isValidElement(ye)?ye:l.jsx(le,{className:"h-5",icon:ye})})}),!ye&&c&&l.jsx("span",{className:ce.suffix,children:c})]}),T&&l.jsx("div",{className:p(ce.trailingIcon,{" absolute right-0":!ye}),children:l.jsx(le,{className:"h-5 text-error",icon:$s})})]}),J&&l.jsx("p",{className:ce.supportingText,id:V,children:s!=null&&s.length?s:i!=null&&i.length?i:" "}),P&&_&&l.jsx(l.Fragment,{children:l.jsx(be,{anchorRef:D,position:"bottom",children:l.jsxs("div",{ref:U,className:"z-50 shadow-xl rounded-[28px] bg-surface-container-high overflow-hidden",children:[l.jsx(En,{className:"",value:ee,onChange:oe}),l.jsxs("div",{className:"flex justify-end gap-2 p-4 pt-0",children:[l.jsx(me,{variant:"text",size:"small",onClick:()=>B(!1),children:"Cancel"}),l.jsx(me,{variant:"filled",size:"small",onClick:jn,children:"OK"})]})]})})}),ae&&de&&l.jsx(be,{anchorRef:D,position:"bottom",style:{width:(nt=D.current)==null?void 0:nt.offsetWidth},children:l.jsx("div",{ref:Fe,children:l.jsx(Ke,{className:"max-w-full",selected:A,children:M?o.Children.map(M,K=>o.isValidElement(K)&&K.type===Ce?o.cloneElement(K,{onClick:re=>{K.props.onClick&&K.props.onClick(re),tt(K.props.value??"")}}):K):R==null?void 0:R.map((K,re)=>K.type==="divider"?l.jsx(Le,{className:"my-1"},re):K.type==="headline"?l.jsx(Ge,{label:K.label},re):l.jsx(Ce,{onClick:xe=>{K.onClick&&K.onClick(xe),tt(K.value??"")},...K,children:K.label},K.value??re))})})})]})},ar=({isSelected:e,icon:t,label:n,variant:s})=>({navigationRailItem:p(" 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]":s=="vertical","gap-0 h-[66px]":s=="horizontal"}),container:p(" w-fit flex justify-center relative rounded-full items-center mx-5",{"bg-secondary-container overflow-hidden":e,"gap-2 ":s=="horizontal","gap-0 ":s=="vertical","p-4":!n},n&&["px-4",{"py-1 ":s=="vertical","py-4 ":s=="horizontal"}]),stateLayer:p("rounded-full"),icon:p("size-6 flex"),label:p("w-fit mx-auto text-nowrap",{"text-label-large ":s=="horizontal","text-label-medium":s=="vertical"})}),cr=Z("navigationRailItem",ar),Nn=({label:e})=>l.jsx("div",{className:" h-9 flex items-center mx-9 mt-3",children:l.jsx("p",{className:"text-label-large text-on-surface-variant",children:e})}),kn=({className:e,onClick:t,label:n,variant:s="vertical",href:r,icon:c,selectedItem:u,setSelectedItem:a,index:d,onItemSelected:i,selected:f=!1,ref:y,transition:h,isExtended:m,iconSelected:x,style:b,extendedOnly:g,children:j,...L})=>{j&&(n=j);const w=o.useRef(null),C=y||w,[I,v]=o.useState(f);o.useEffect(()=>{f&&u==null?v(!0):v(u==d&&d!=null)},[u]),o.useEffect(()=>{u==d&&i&&i({ref:C,index:d||0,label:n,icon:c})},[u]);const E=r?"a":"button",R=W=>{a&&a(d??null),t&&t(W)},M=cr({isExtended:m,extendedOnly:g,className:e,onItemSelected:i,selectedItem:u,index:d,transition:h,selected:I,variant:s,icon:c,label:n,isSelected:I,setSelectedItem:a,href:r,children:n,iconSelected:x});return h={duration:.3,...h},g&&!m?null:l.jsxs(E,{...L,role:"tab","aria-selected":I,ref:C,href:r,className:M.navigationRailItem,onClick:R,style:{transition:h.duration+"s",...b},children:[l.jsxs(Y.motion.div,{style:{transition:s=="horizontal"?h.duration+`s, gap ${h.duration/2}s ${h.duration-h.duration/2}s`:h.duration+`s, gap ${h.duration/3}s ${h.duration-h.duration/3}s`},transition:h,className:M.container,children:[l.jsx(ue,{style:{transition:h.duration+"s"},className:M.stateLayer,colorName:p({"on-surface":!I,"on-secondary-container":I}),stateClassName:"state-ripple-group-[navigation-rail-item]"}),c&&l.jsx(le,{icon:I?x:c,className:M.icon}),l.jsx(Y.AnimatePresence,{children:s=="horizontal"&&(()=>{const W={width:0,opacity:0,transition:{...h}},k={width:"auto",opacity:1,transition:{...h,opacity:{duration:h.duration/2,delay:h.duration-h.duration/2}}};return l.jsx(Y.motion.span,{initial:W,animate:k,exit:W,className:M.label,children:n})})()})]}),l.jsx(Y.AnimatePresence,{children:s=="vertical"&&(()=>{const W={height:0,opacity:0,transition:{...h,opacity:{duration:0}}},k={height:"auto",opacity:1,transition:{...h,opacity:{duration:h.duration/3,delay:h.duration-h.duration/3}}};return l.jsx(Y.motion.span,{initial:k,animate:k,exit:W,className:M.label,transition:h,children:n})})()})]})},ur=({isExtended:e,alignment:t})=>({navigationRail:p("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:p("flex flex-col gap-1 items-start"),menuIcon:"mx-5",segments:p(" flex flex-col overflow-auto min-w-full mt-10",{"w-full":!e,"w-fit items-start":e})}),dr=Z("navigationRail",ur),fr=({variant:e="standard",onItemSelected:t,children:n,className:s,selectedItem:r,extended:c,alignment:u="top",menu:a={closed:{icon:Os,label:"Open menu"},opened:{icon:je,label:"Close menu"}},style:d,onExtendedChange:i,transition:f,setSelectedItem:y})=>{const[h,m]=o.useState(null),[x,b]=o.useState(c);let g;r==0||r!=null?g=r:g=h;const j=y||m,L=o.useRef(null),w=M=>{t==null||t(M)};function C(M){const W=[];return o.Children.forEach(M,k=>{o.isValidElement(k)&&k.type===o.Fragment?W.push(...C(k.props.children)):W.push(k)}),W}const I=C(n),v=I.filter(M=>o.isValidElement(M)&&M.type===Re),E=dr({children:n,onItemSelected:t,selectedItem:g,setSelectedItem:j,className:s,variant:e,extended:x,isExtended:x,alignment:u,menu:a,transition:f,onExtendedChange:i});f={duration:.3,...f};const R=o.useRef(!1);return R.current=!1,o.useEffect(()=>{i==null||i(x??!1)},[x]),l.jsxs("div",{style:{transition:f.duration+"s",...d},ref:L,className:E.navigationRail,children:[l.jsxs("div",{className:E.header,children:[l.jsx(we,{onClick:()=>b(!x),label:x?a==null?void 0:a.opened.label:a==null?void 0:a.closed.label,className:E.menuIcon,icon:x?a.opened.icon:a==null?void 0:a.closed.icon}),v.length>0&&o.cloneElement(v[0],{transition:f,isExtended:x,className:"!shadow-none mx-5 "+v[0].props.className})]}),l.jsx("div",{className:E.segments,children:(()=>{let M=0;return I.map(W=>o.isValidElement(W)&&W.type===kn?o.cloneElement(W,{key:M,index:M++,variant:x?"horizontal":"vertical",selectedItem:g,setSelectedItem:j,onItemSelected:w,transition:f,extendedOnly:R.current,isExtended:x}):o.isValidElement(W)&&W.type===Re?null:o.isValidElement(W)&&W.type===Nn?(R.current=!0,x?o.cloneElement(W,{}):null):W)})()}),l.jsx("div",{className:"flex-1 max-h-[160px]"})]})};function hr(e){return ge.defineConfig({variant:ge.Variants.Udixio,...e,plugins:[new ge.FontPlugin(e),new ke.TailwindPlugin(e)]})}exports.AnchorPositioner=be;exports.AnimateOnScrollInit=rs;exports.Button=me;exports.Card=Rs;exports.Carousel=Ds;exports.CarouselItem=yn;exports.Checkbox=Bs;exports.Chip=Be;exports.Chips=Ks;exports.ContextMenu=Ys;exports.CustomScroll=vt;exports.DatePicker=En;exports.Divider=Le;exports.Fab=Re;exports.FabMenu=Js;exports.Icon=le;exports.IconButton=we;exports.Menu=Ke;exports.MenuGroup=He;exports.MenuHeadline=Ge;exports.MenuItem=Ce;exports.NavigationRail=fr;exports.NavigationRailItem=kn;exports.NavigationRailSection=Nn;exports.ProgressIndicator=pn;exports.RippleEffect=mt;exports.SideSheet=Qs;exports.Slider=Zs;exports.SmoothScroll=Xn;exports.Snackbar=er;exports.State=ue;exports.Switch=tr;exports.SyncedFixedWrapper=St;exports.Tab=bn;exports.TabGroup=sr;exports.TabPanel=Sn;exports.TabPanels=rr;exports.Tabs=nr;exports.TextField=lr;exports.ThemeProvider=Jn;exports.Tooltip=Je;exports.animateOnScroll=os;exports.buttonStyle=is;exports.cardStyle=ls;exports.carouselItemConfig=Ye;exports.carouselItemStyle=as;exports.carouselStyle=cs;exports.checkboxStyle=us;exports.chipStyle=ds;exports.chipsStyle=fs;exports.classNames=p;exports.classnames=yt;exports.createUseClassNames=Z;exports.customScrollStyle=xt;exports.defaultClassNames=ne;exports.defineConfig=hr;exports.dividerStyle=hs;exports.fabMenuStyle=ps;exports.fabStyle=ms;exports.generateThemeCss=Zn;exports.getClassNames=De;exports.iconButtonStyle=ys;exports.initAnimateOnScroll=_e;exports.menuGroupStyle=vs;exports.menuStyle=xs;exports.normalize=ve;exports.progressIndicatorStyle=gs;exports.sideSheetConfig=qe;exports.sideSheetStyle=Kt;exports.sliderConfig=Ue;exports.sliderStyle=bs;exports.snackbarStyle=Ss;exports.switchStyle=Es;exports.tabPanelStyle=Ls;exports.tabPanelsStyle=js;exports.tabStyle=Ns;exports.tabsStyle=ks;exports.textFieldStyle=Ms;exports.toolStyle=Is;exports.useButtonStyle=Nt;exports.useCardStyle=jt;exports.useCarouselItemStyle=Lt;exports.useCarouselStyle=It;exports.useCheckboxStyle=Rt;exports.useChipStyle=At;exports.useChipsStyle=Pt;exports.useClassNames=Tn;exports.useDividerStyle=Tt;exports.useFabMenuStyle=Ht;exports.useFabStyle=Ot;exports.useIconButtonStyle=zt;exports.useMenuGroupStyle=Ut;exports.useMenuStyle=Yt;exports.useProgressIndicatorStyle=Gt;exports.useSideSheetStyle=ws;exports.useSliderStyle=Jt;exports.useSnackbarStyle=Qt;exports.useStateStyle=bt;exports.useSwitchStyle=tn;exports.useTabPanelStyle=un;exports.useTabPanelsStyle=an;exports.useTabStyle=sn;exports.useTabsStyle=on;exports.useTextFieldStyle=fn;exports.useToolTipStyle=mn;exports.useTooltipTrigger=wn;
|
package/dist/index.js
CHANGED
|
@@ -2,13 +2,13 @@ var an = Object.defineProperty;
|
|
|
2
2
|
var cn = (e, t, n) => t in e ? an(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var H = (e, t, n) => cn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import { jsx as u, jsxs as j, Fragment as me } from "react/jsx-runtime";
|
|
5
|
-
import Y, { useState as X, useEffect as _, useMemo as ve, useRef as z, useLayoutEffect as Ae, useId as Ce, useCallback as he, isValidElement as Ie, cloneElement as
|
|
5
|
+
import Y, { useState as X, useEffect as _, useMemo as ve, useRef as z, useLayoutEffect as Ae, useId as Ce, useCallback as he, isValidElement as Ie, cloneElement as Be, createContext as un, useContext as vt, Children as dn, Fragment as fn } from "react";
|
|
6
6
|
import { createPortal as Ke } from "react-dom";
|
|
7
7
|
import { AnimatePresence as pe, motion as se, useScroll as hn, useMotionValueEvent as it, animate as mn } from "motion/react";
|
|
8
8
|
import { clsx as gt } from "clsx";
|
|
9
9
|
import { extendTailwindMerge as pn } from "tailwind-merge";
|
|
10
10
|
import { loader as wt, FontPlugin as bt, serializeThemeContext as yn, defineConfig as vn, Variants as gn } from "@udixio/theme";
|
|
11
|
-
import { TailwindPlugin as
|
|
11
|
+
import { TailwindPlugin as We } from "@udixio/tailwind";
|
|
12
12
|
import wn from "react-textarea-autosize";
|
|
13
13
|
const bn = ({
|
|
14
14
|
colorName: e = "on-surface",
|
|
@@ -1351,7 +1351,7 @@ const ns = ({
|
|
|
1351
1351
|
const M = o.current;
|
|
1352
1352
|
if (!M || !h.current) {
|
|
1353
1353
|
await C.load();
|
|
1354
|
-
const S = C.plugins.getPlugin(
|
|
1354
|
+
const S = C.plugins.getPlugin(We).getInstance().outputCss;
|
|
1355
1355
|
c(S), h.current = !0, n == null || n(C);
|
|
1356
1356
|
return;
|
|
1357
1357
|
}
|
|
@@ -1359,7 +1359,7 @@ const ns = ({
|
|
|
1359
1359
|
M.postMessage({
|
|
1360
1360
|
id: v,
|
|
1361
1361
|
snapshot: yn(C),
|
|
1362
|
-
tailwindOptions: C.plugins.getPlugin(
|
|
1362
|
+
tailwindOptions: C.plugins.getPlugin(We).toSerializable(),
|
|
1363
1363
|
fontOptions: C.plugins.getPlugin(bt).toSerializable()
|
|
1364
1364
|
});
|
|
1365
1365
|
};
|
|
@@ -1368,8 +1368,12 @@ const ns = ({
|
|
|
1368
1368
|
}, []), i ? /* @__PURE__ */ u("style", { dangerouslySetInnerHTML: { __html: i } }) : null;
|
|
1369
1369
|
};
|
|
1370
1370
|
async function rs(e, t) {
|
|
1371
|
+
var r;
|
|
1372
|
+
(r = e.plugins) == null || r.forEach((s) => {
|
|
1373
|
+
s instanceof We && (s.options = { ...s.options, ssr: !0 });
|
|
1374
|
+
});
|
|
1371
1375
|
const n = await wt(e, !1);
|
|
1372
|
-
return await (t == null ? void 0 : t(n)), await n.load(), n.plugins.getPlugin(
|
|
1376
|
+
return await (t == null ? void 0 : t(n)), await n.load(), n.plugins.getPlugin(We).getInstance().outputCss;
|
|
1373
1377
|
}
|
|
1374
1378
|
function Bn() {
|
|
1375
1379
|
if (typeof window > "u") return !1;
|
|
@@ -1540,7 +1544,7 @@ function kt(e = {}) {
|
|
|
1540
1544
|
d && d(), typeof window < "u" && window.removeEventListener("scroll", i), c.disconnect();
|
|
1541
1545
|
};
|
|
1542
1546
|
}
|
|
1543
|
-
const ss = kt, os = kt,
|
|
1547
|
+
const ss = kt, os = kt, Fe = ({
|
|
1544
1548
|
anchorRef: e,
|
|
1545
1549
|
position: t = "bottom",
|
|
1546
1550
|
children: n,
|
|
@@ -3238,11 +3242,11 @@ var vr = {
|
|
|
3238
3242
|
prefix: "fas",
|
|
3239
3243
|
iconName: "check",
|
|
3240
3244
|
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"]
|
|
3241
|
-
},
|
|
3245
|
+
}, Pe = {
|
|
3242
3246
|
prefix: "fas",
|
|
3243
3247
|
iconName: "xmark",
|
|
3244
3248
|
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"]
|
|
3245
|
-
}, xr =
|
|
3249
|
+
}, xr = Pe, Gt = {
|
|
3246
3250
|
prefix: "fas",
|
|
3247
3251
|
iconName: "chevron-down",
|
|
3248
3252
|
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"]
|
|
@@ -3518,7 +3522,7 @@ const $s = ({
|
|
|
3518
3522
|
d && !k && /* @__PURE__ */ u(
|
|
3519
3523
|
fe,
|
|
3520
3524
|
{
|
|
3521
|
-
icon:
|
|
3525
|
+
icon: Pe,
|
|
3522
3526
|
className: ee.trailingIcon,
|
|
3523
3527
|
onMouseDown: (W) => {
|
|
3524
3528
|
W.preventDefault(), W.stopPropagation();
|
|
@@ -3668,7 +3672,7 @@ const $s = ({
|
|
|
3668
3672
|
}
|
|
3669
3673
|
),
|
|
3670
3674
|
f && b && /* @__PURE__ */ u(
|
|
3671
|
-
|
|
3675
|
+
Fe,
|
|
3672
3676
|
{
|
|
3673
3677
|
anchorRef: w,
|
|
3674
3678
|
position: "inline-end span-block-end",
|
|
@@ -3796,7 +3800,7 @@ const $s = ({
|
|
|
3796
3800
|
}
|
|
3797
3801
|
),
|
|
3798
3802
|
r && /* @__PURE__ */ u(
|
|
3799
|
-
|
|
3803
|
+
Fe,
|
|
3800
3804
|
{
|
|
3801
3805
|
anchorRef: l,
|
|
3802
3806
|
position: "bottom right",
|
|
@@ -4181,7 +4185,7 @@ const en = ({
|
|
|
4181
4185
|
openDelay: f,
|
|
4182
4186
|
closeDelay: h,
|
|
4183
4187
|
id: L
|
|
4184
|
-
}), J = !c && Ie(r) ?
|
|
4188
|
+
}), J = !c && Ie(r) ? Be(r, {
|
|
4185
4189
|
ref: v,
|
|
4186
4190
|
...I,
|
|
4187
4191
|
// Merge event handlers if the child already has them
|
|
@@ -4245,7 +4249,7 @@ const en = ({
|
|
|
4245
4249
|
return /* @__PURE__ */ j(me, { children: [
|
|
4246
4250
|
J,
|
|
4247
4251
|
/* @__PURE__ */ u(pe, { children: k && /* @__PURE__ */ u(
|
|
4248
|
-
|
|
4252
|
+
Fe,
|
|
4249
4253
|
{
|
|
4250
4254
|
anchorRef: D,
|
|
4251
4255
|
position: M,
|
|
@@ -4852,7 +4856,7 @@ const en = ({
|
|
|
4852
4856
|
extended: l,
|
|
4853
4857
|
divider: a,
|
|
4854
4858
|
onExtendedChange: i,
|
|
4855
|
-
closeIcon: c =
|
|
4859
|
+
closeIcon: c = Pe,
|
|
4856
4860
|
transition: o,
|
|
4857
4861
|
...d
|
|
4858
4862
|
}) => {
|
|
@@ -4944,7 +4948,7 @@ const en = ({
|
|
|
4944
4948
|
message: e,
|
|
4945
4949
|
className: t,
|
|
4946
4950
|
duration: n,
|
|
4947
|
-
closeIcon: r =
|
|
4951
|
+
closeIcon: r = Pe,
|
|
4948
4952
|
onClose: s,
|
|
4949
4953
|
...l
|
|
4950
4954
|
}) => {
|
|
@@ -5614,12 +5618,12 @@ const en = ({
|
|
|
5614
5618
|
}, [q]), _(() => {
|
|
5615
5619
|
if (!q) return;
|
|
5616
5620
|
const Q = (we) => {
|
|
5617
|
-
var $e,
|
|
5618
|
-
return we ? (($e = R.current) == null ? void 0 : $e.contains(we)) || ((
|
|
5621
|
+
var $e, Te;
|
|
5622
|
+
return we ? (($e = R.current) == null ? void 0 : $e.contains(we)) || ((Te = G.current) == null ? void 0 : Te.contains(we)) : !1;
|
|
5619
5623
|
}, ae = (we) => {
|
|
5620
5624
|
var st, ot;
|
|
5621
|
-
const $e = we.target,
|
|
5622
|
-
!
|
|
5625
|
+
const $e = we.target, Te = (st = G.current) == null ? void 0 : st.contains($e), ln = (ot = K.current) == null ? void 0 : ot.contains($e);
|
|
5626
|
+
!Te && !ln && B(!1);
|
|
5623
5627
|
}, ke = (we) => {
|
|
5624
5628
|
Q(we.target) || B(!1);
|
|
5625
5629
|
}, Re = (we) => {
|
|
@@ -5697,7 +5701,7 @@ const en = ({
|
|
|
5697
5701
|
}), rn = h ? wn : "input", sn = h ? {} : {
|
|
5698
5702
|
type: de ? "text" : f,
|
|
5699
5703
|
readOnly: de
|
|
5700
|
-
}, Ye = T || typeof $ == "string" && $.length > 0 || f == "date" || de && ge,
|
|
5704
|
+
}, Ye = T || typeof $ == "string" && $.length > 0 || f == "date" || de && ge, Oe = Ye && e === "outlined", on = !Oe;
|
|
5701
5705
|
return /* @__PURE__ */ j("div", { ref: R, className: ye.textField, style: C, children: [
|
|
5702
5706
|
/* @__PURE__ */ j(
|
|
5703
5707
|
"fieldset",
|
|
@@ -5718,8 +5722,8 @@ const en = ({
|
|
|
5718
5722
|
hidden: { width: 0, padding: 0 },
|
|
5719
5723
|
visible: { width: "auto", padding: "0 8px" }
|
|
5720
5724
|
},
|
|
5721
|
-
initial:
|
|
5722
|
-
animate:
|
|
5725
|
+
initial: Oe ? "visible" : "hidden",
|
|
5726
|
+
animate: Oe ? "visible" : "hidden",
|
|
5723
5727
|
className: "max-w-full ml-2 px-2 text-body-small h-0 overflow-hidden whitespace-nowrap",
|
|
5724
5728
|
transition: { duration: 0.2 },
|
|
5725
5729
|
children: /* @__PURE__ */ u("span", { className: "transform inline-flex -translate-y-1/2 opacity-0", children: i })
|
|
@@ -5742,7 +5746,7 @@ const en = ({
|
|
|
5742
5746
|
children: /* @__PURE__ */ u("span", { className: ye.label, children: i })
|
|
5743
5747
|
}
|
|
5744
5748
|
),
|
|
5745
|
-
|
|
5749
|
+
Oe && /* @__PURE__ */ u(
|
|
5746
5750
|
se.label,
|
|
5747
5751
|
{
|
|
5748
5752
|
htmlFor: J,
|
|
@@ -5823,7 +5827,7 @@ const en = ({
|
|
|
5823
5827
|
}
|
|
5824
5828
|
),
|
|
5825
5829
|
ee && /* @__PURE__ */ u("p", { className: ye.supportingText, id: V, children: r != null && r.length ? r : o != null && o.length ? o : " " }),
|
|
5826
|
-
W && q && /* @__PURE__ */ u(me, { children: /* @__PURE__ */ u(
|
|
5830
|
+
W && q && /* @__PURE__ */ u(me, { children: /* @__PURE__ */ u(Fe, { anchorRef: R, position: "bottom", children: /* @__PURE__ */ j(
|
|
5827
5831
|
"div",
|
|
5828
5832
|
{
|
|
5829
5833
|
ref: G,
|
|
@@ -5861,7 +5865,7 @@ const en = ({
|
|
|
5861
5865
|
}
|
|
5862
5866
|
) }) }),
|
|
5863
5867
|
de && ge && /* @__PURE__ */ u(
|
|
5864
|
-
|
|
5868
|
+
Fe,
|
|
5865
5869
|
{
|
|
5866
5870
|
anchorRef: R,
|
|
5867
5871
|
position: "bottom",
|
|
@@ -6117,7 +6121,7 @@ const en = ({
|
|
|
6117
6121
|
label: "Open menu"
|
|
6118
6122
|
},
|
|
6119
6123
|
opened: {
|
|
6120
|
-
icon:
|
|
6124
|
+
icon: Pe,
|
|
6121
6125
|
label: "Close menu"
|
|
6122
6126
|
}
|
|
6123
6127
|
},
|
|
@@ -6175,7 +6179,7 @@ const en = ({
|
|
|
6175
6179
|
icon: y ? i.opened.icon : i == null ? void 0 : i.closed.icon
|
|
6176
6180
|
}
|
|
6177
6181
|
),
|
|
6178
|
-
v.length > 0 &&
|
|
6182
|
+
v.length > 0 && Be(v[0], {
|
|
6179
6183
|
transition: d,
|
|
6180
6184
|
isExtended: y,
|
|
6181
6185
|
className: "!shadow-none mx-5 " + v[0].props.className
|
|
@@ -6183,7 +6187,7 @@ const en = ({
|
|
|
6183
6187
|
] }),
|
|
6184
6188
|
/* @__PURE__ */ u("div", { className: S.segments, children: (() => {
|
|
6185
6189
|
let I = 0;
|
|
6186
|
-
return M.map((O) => Ie(O) && O.type === zr ?
|
|
6190
|
+
return M.map((O) => Ie(O) && O.type === zr ? Be(
|
|
6187
6191
|
O,
|
|
6188
6192
|
{
|
|
6189
6193
|
key: I,
|
|
@@ -6197,7 +6201,7 @@ const en = ({
|
|
|
6197
6201
|
extendedOnly: D.current,
|
|
6198
6202
|
isExtended: y
|
|
6199
6203
|
}
|
|
6200
|
-
) : Ie(O) && O.type === je ? null : Ie(O) && O.type === Hr ? (D.current = !0, y ?
|
|
6204
|
+
) : Ie(O) && O.type === je ? null : Ie(O) && O.type === Hr ? (D.current = !0, y ? Be(O, {}) : null) : O);
|
|
6201
6205
|
})() }),
|
|
6202
6206
|
/* @__PURE__ */ u("div", { className: "flex-1 max-h-[160px]" })
|
|
6203
6207
|
]
|
|
@@ -6208,11 +6212,11 @@ function Xs(e) {
|
|
|
6208
6212
|
return vn({
|
|
6209
6213
|
variant: gn.Udixio,
|
|
6210
6214
|
...e,
|
|
6211
|
-
plugins: [new bt(e), new
|
|
6215
|
+
plugins: [new bt(e), new We(e)]
|
|
6212
6216
|
});
|
|
6213
6217
|
}
|
|
6214
6218
|
export {
|
|
6215
|
-
|
|
6219
|
+
Fe as AnchorPositioner,
|
|
6216
6220
|
ss as AnimateOnScrollInit,
|
|
6217
6221
|
Le as Button,
|
|
6218
6222
|
Ds as Card,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateThemeCss.d.ts","sourceRoot":"","sources":["../../../src/lib/effects/generateThemeCss.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,eAAe,EAAU,MAAM,eAAe,CAAC;AAGvE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,eAAe,EACvB,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GACzC,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"generateThemeCss.d.ts","sourceRoot":"","sources":["../../../src/lib/effects/generateThemeCss.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,eAAe,EAAU,MAAM,eAAe,CAAC;AAGvE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,eAAe,EACvB,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GACzC,OAAO,CAAC,MAAM,CAAC,CAajB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@udixio/ui-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"react": "^19.1.1",
|
|
41
41
|
"react-dom": "^19.1.1",
|
|
42
|
-
"@udixio/theme": "2.1.
|
|
43
|
-
"@udixio/tailwind": "2.
|
|
42
|
+
"@udixio/theme": "2.1.22",
|
|
43
|
+
"@udixio/tailwind": "2.5.0"
|
|
44
44
|
},
|
|
45
45
|
"repository": {
|
|
46
46
|
"type": "git",
|