@tsiky/components-r19 7.0.10 → 7.0.11

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.js CHANGED
@@ -8269,7 +8269,7 @@
8269
8269
  ${g}px !important;
8270
8270
  top: ${p}px !important;
8271
8271
  }
8272
- `),()=>{x.contains(m)&&x.removeChild(m)}},[t]),o.jsx(xle,{isPresent:t,childRef:r,sizeRef:s,children:te.cloneElement(e,{ref:l})})}const _le=({children:e,initial:t,isPresent:n,onExitComplete:c,custom:i,presenceAffectsLayout:r,mode:s,anchorX:d,root:l})=>{const h=Bt(Lle),u=k.useId();let p=!0,y=k.useMemo(()=>(p=!1,{id:u,initial:t,isPresent:n,custom:i,onExitComplete:f=>{h.set(f,!0);for(const g of h.values())if(!g)return;c&&c()},register:f=>(h.set(f,!1),()=>h.delete(f))}),[n,h,c]);return r&&p&&(y={...y}),k.useMemo(()=>{h.forEach((f,g)=>h.set(g,!1))},[n]),te.useEffect(()=>{!n&&!h.size&&c&&c()},[n]),s==="popLayout"&&(e=o.jsx(Mle,{isPresent:n,anchorX:d,root:l,children:e})),o.jsx(wL.Provider,{value:y,children:e})};function Lle(){return new Map}function eq(e=!0){const t=k.useContext(wL);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:c,register:i}=t,r=k.useId();k.useEffect(()=>{if(e)return i(r)},[e]);const s=k.useCallback(()=>e&&c&&c(r),[r,c,e]);return!n&&c?[!1,s]:[!0]}const ri=e=>e.key||"";function XC(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const Ile=({children:e,custom:t,initial:n=!0,onExitComplete:c,presenceAffectsLayout:i=!0,mode:r="sync",propagate:s=!1,anchorX:d="left",root:l})=>{const[h,u]=eq(s),p=k.useMemo(()=>XC(e),[e]),y=s&&!h?[]:p.map(ri),f=k.useRef(!0),g=k.useRef(p),m=Bt(()=>new Map),[x,M]=k.useState(p),[v,I]=k.useState(p);bw(()=>{f.current=!1,g.current=p;for(let C=0;C<v.length;C++){const _=ri(v[C]);y.includes(_)?m.delete(_):m.get(_)!==!0&&m.set(_,!1)}},[v,y.length,y.join("-")]);const b=[];if(p!==x){let C=[...p];for(let _=0;_<v.length;_++){const L=v[_],S=ri(L);y.includes(S)||(C.splice(_,0,L),b.push(L))}return r==="wait"&&b.length&&(C=b),I(XC(C)),M(p),null}process.env.NODE_ENV!=="production"&&r==="wait"&&v.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:w}=k.useContext(Lw);return o.jsx(o.Fragment,{children:v.map(C=>{const _=ri(C),L=s&&!h?!1:p===v||y.includes(_),S=()=>{if(m.has(_))m.set(_,!0);else return;let N=!0;m.forEach(j=>{j||(N=!1)}),N&&(w?.(),I(g.current),s&&u?.(),c&&c())};return o.jsx(_le,{isPresent:L,initial:!f.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:r,root:l,onExitComplete:L?void 0:S,anchorX:d,children:C},_)})})},tq=k.createContext({strict:!1}),YC={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},i1={};for(const e in YC)i1[e]={isEnabled:t=>YC[e].some(n=>!!t[n])};function ble(e){for(const t in e)i1[t]={...i1[t],...e[t]}}const wle=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function xL(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||wle.has(e)}let aq=e=>!xL(e);function Cle(e){typeof e=="function"&&(aq=t=>t.startsWith("on")?!xL(t):e(t))}try{Cle(require("@emotion/is-prop-valid").default)}catch{}function Nle(e,t,n){const c={};for(const i in e)i==="values"&&typeof e.values=="object"||(aq(i)||n===!0&&xL(i)||!t&&!xL(i)||e.draggable&&i.startsWith("onDrag"))&&(c[i]=e[i]);return c}const NL=k.createContext({});function SL(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function U1(e){return typeof e=="string"||Array.isArray(e)}const Gw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Kw=["initial",...Gw];function jL(e){return SL(e.animate)||Kw.some(t=>U1(e[t]))}function nq(e){return!!(jL(e)||e.variants)}function Sle(e,t){if(jL(e)){const{initial:n,animate:c}=e;return{initial:n===!1||U1(n)?n:void 0,animate:U1(c)?c:void 0}}return e.inherit!==!1?t:{}}function jle(e){const{initial:t,animate:n}=Sle(e,k.useContext(NL));return k.useMemo(()=>({initial:t,animate:n}),[JC(t),JC(n)])}function JC(e){return Array.isArray(e)?e.join(" "):e}const W1={};function $le(e){for(const t in e)W1[t]=e[t],Aw(t)&&(W1[t].isCSSVariable=!0)}function oq(e,{layout:t,layoutId:n}){return l1.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!W1[e]||e==="opacity")}const qle={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ale=d1.length;function zle(e,t,n){let c="",i=!0;for(let r=0;r<Ale;r++){const s=d1[r],d=e[s];if(d===void 0)continue;let l=!0;if(typeof d=="number"?l=d===(s.startsWith("scale")?1:0):l=parseFloat(d)===0,!l||n){const h=K$(d,Ow[s]);if(!l){i=!1;const u=qle[s]||s;c+=`${u}(${h}) `}n&&(t[s]=h)}}return c=c.trim(),n?c=n(t,i?"":c):i&&(c="none"),c}function Zw(e,t,n){const{style:c,vars:i,transformOrigin:r}=e;let s=!1,d=!1;for(const l in t){const h=t[l];if(l1.has(l)){s=!0;continue}else if(Aw(l)){i[l]=h;continue}else{const u=K$(h,Ow[l]);l.startsWith("origin")?(d=!0,r[l]=u):c[l]=u}}if(t.transform||(s||n?c.transform=zle(t,e.transform,n):c.transform&&(c.transform="none")),d){const{originX:l="50%",originY:h="50%",originZ:u=0}=r;c.transformOrigin=`${l} ${h} ${u}`}}const Xw=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function cq(e,t,n){for(const c in t)!Ae(t[c])&&!oq(c,n)&&(e[c]=t[c])}function Vle({transformTemplate:e},t){return k.useMemo(()=>{const n=Xw();return Zw(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Ple(e,t){const n=e.style||{},c={};return cq(c,n,e),Object.assign(c,Vle(e,t)),c}function Tle(e,t){const n={},c=Ple(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,c.userSelect=c.WebkitUserSelect=c.WebkitTouchCallout="none",c.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=c,n}const Hle={offset:"stroke-dashoffset",array:"stroke-dasharray"},Dle={offset:"strokeDashoffset",array:"strokeDasharray"};function Ble(e,t,n=1,c=0,i=!0){e.pathLength=1;const r=i?Hle:Dle;e[r.offset]=Q.transform(-c);const s=Q.transform(t),d=Q.transform(n);e[r.array]=`${s} ${d}`}function iq(e,{attrX:t,attrY:n,attrScale:c,pathLength:i,pathSpacing:r=1,pathOffset:s=0,...d},l,h,u){if(Zw(e,d,h),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:y}=e;p.transform&&(y.transform=p.transform,delete p.transform),(y.transform||p.transformOrigin)&&(y.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),y.transform&&(y.transformBox=u?.transformBox??"fill-box",delete p.transformBox),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),c!==void 0&&(p.scale=c),i!==void 0&&Ble(p,i,r,s,!1)}const rq=()=>({...Xw(),attrs:{}}),sq=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Rle(e,t,n,c){const i=k.useMemo(()=>{const r=rq();return iq(r,t,sq(c),e.transformTemplate,e.style),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};cq(r,e.style,e),i.style={...r,...i.style}}return i}const Fle=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Yw(e){return typeof e!="string"||e.includes("-")?!1:!!(Fle.indexOf(e)>-1||/[A-Z]/u.test(e))}function Ele(e,t,n,{latestValues:c},i,r=!1){const d=(Yw(e)?Rle:Tle)(t,c,i,e),l=Nle(t,typeof e=="string",r),h=e!==k.Fragment?{...l,...d,ref:n}:{},{children:u}=t,p=k.useMemo(()=>Ae(u)?u.get():u,[u]);return k.createElement(e,{...h,children:p})}function QC(e){const t=[{},{}];return e?.values.forEach((n,c)=>{t[0][c]=n.get(),t[1][c]=n.getVelocity()}),t}function Jw(e,t,n,c){if(typeof t=="function"){const[i,r]=QC(c);t=t(n!==void 0?n:e.custom,i,r)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,r]=QC(c);t=t(n!==void 0?n:e.custom,i,r)}return t}function lL(e){return Ae(e)?e.get():e}function Ole({scrapeMotionValuesFromProps:e,createRenderState:t},n,c,i){return{latestValues:Ule(n,c,i,e),renderState:t()}}function Ule(e,t,n,c){const i={},r=c(e,{});for(const y in r)i[y]=lL(r[y]);let{initial:s,animate:d}=e;const l=jL(e),h=nq(e);t&&h&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),d===void 0&&(d=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const p=u?d:s;if(p&&typeof p!="boolean"&&!SL(p)){const y=Array.isArray(p)?p:[p];for(let f=0;f<y.length;f++){const g=Jw(e,y[f]);if(g){const{transitionEnd:m,transition:x,...M}=g;for(const v in M){let I=M[v];if(Array.isArray(I)){const b=u?I.length-1:0;I=I[b]}I!==null&&(i[v]=I)}for(const v in m)i[v]=m[v]}}}return i}const dq=e=>(t,n)=>{const c=k.useContext(NL),i=k.useContext(wL),r=()=>Ole(e,t,c,i);return n?r():Bt(r)};function Qw(e,t,n){const{style:c}=e,i={};for(const r in c)(Ae(c[r])||t.style&&Ae(t.style[r])||oq(r,e)||n?.getValue(r)?.liveStyle!==void 0)&&(i[r]=c[r]);return i}const Wle=dq({scrapeMotionValuesFromProps:Qw,createRenderState:Xw});function lq(e,t,n){const c=Qw(e,t,n);for(const i in e)if(Ae(e[i])||Ae(t[i])){const r=d1.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;c[r]=e[i]}return c}const Gle=dq({scrapeMotionValuesFromProps:lq,createRenderState:rq}),Kle=Symbol.for("motionComponentSymbol");function Xc(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Zle(e,t,n){return k.useCallback(c=>{c&&e.onMount&&e.onMount(c),t&&(c?t.mount(c):t.unmount()),n&&(typeof n=="function"?n(c):Xc(n)&&(n.current=c))},[t])}const eC=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Xle="framerAppearId",hq="data-"+eC(Xle),uq=k.createContext({});function Yle(e,t,n,c,i){const{visualElement:r}=k.useContext(NL),s=k.useContext(tq),d=k.useContext(wL),l=k.useContext(CL).reducedMotion,h=k.useRef(null);c=c||s.renderer,!h.current&&c&&(h.current=c(e,{visualState:t,parent:r,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:l}));const u=h.current,p=k.useContext(uq);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&Jle(h.current,n,i,p);const y=k.useRef(!1);k.useInsertionEffect(()=>{u&&y.current&&u.update(n,d)});const f=n[hq],g=k.useRef(!!f&&!window.MotionHandoffIsComplete?.(f)&&window.MotionHasOptimisedAnimation?.(f));return bw(()=>{u&&(y.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),k.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(f)}),g.current=!1),u.enteringChildren=void 0)}),u}function Jle(e,t,n,c){const{layoutId:i,layout:r,drag:s,dragConstraints:d,layoutScroll:l,layoutRoot:h,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:pq(e.parent)),e.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!s||d&&Xc(d),visualElement:e,animationType:typeof r=="string"?r:"both",initialPromotionConfig:c,crossfade:u,layoutScroll:l,layoutRoot:h})}function pq(e){if(e)return e.options.allowProjection!==!1?e.projection:pq(e.parent)}function tI(e,{forwardMotionProps:t=!1}={},n,c){n&&ble(n);const i=Yw(e)?Gle:Wle;function r(d,l){let h;const u={...k.useContext(CL),...d,layoutId:Qle(d)},{isStatic:p}=u,y=jle(d),f=i(d,p);if(!p&&Iw){ehe(u,n);const g=the(u);h=g.MeasureLayout,y.visualElement=Yle(e,f,u,c,g.ProjectionNode)}return o.jsxs(NL.Provider,{value:y,children:[h&&y.visualElement?o.jsx(h,{visualElement:y.visualElement,...u}):null,Ele(e,d,Zle(f,y.visualElement,l),f,p,t)]})}r.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=k.forwardRef(r);return s[Kle]=e,s}function Qle({layoutId:e}){const t=k.useContext(Lw).id;return t&&e!==void 0?t+"-"+e:e}function ehe(e,t){const n=k.useContext(tq).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const c="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?r1(!1,c,"lazy-strict-mode"):st(!1,c,"lazy-strict-mode")}}function the(e){const{drag:t,layout:n}=i1;if(!t&&!n)return{};const c={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?c.MeasureLayout:void 0,ProjectionNode:c.ProjectionNode}}function ahe(e,t){if(typeof Proxy>"u")return tI;const n=new Map,c=(r,s)=>tI(r,s,e,t),i=(r,s)=>(process.env.NODE_ENV!=="production"&&jw(!1,"motion() is deprecated. Use motion.create() instead."),c(r,s));return new Proxy(i,{get:(r,s)=>s==="create"?c:(n.has(s)||n.set(s,tI(s,void 0,e,t)),n.get(s))})}function yq({top:e,left:t,right:n,bottom:c}){return{x:{min:t,max:n},y:{min:e,max:c}}}function nhe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ohe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),c=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:c.y,right:c.x}}function aI(e){return e===void 0||e===1}function hw({scale:e,scaleX:t,scaleY:n}){return!aI(e)||!aI(t)||!aI(n)}function Sc(e){return hw(e)||kq(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function kq(e){return eN(e.x)||eN(e.y)}function eN(e){return e&&e!=="0%"}function ML(e,t,n){const c=e-n,i=t*c;return n+i}function tN(e,t,n,c,i){return i!==void 0&&(e=ML(e,i,c)),ML(e,n,c)+t}function uw(e,t=0,n=1,c,i){e.min=tN(e.min,t,n,c,i),e.max=tN(e.max,t,n,c,i)}function mq(e,{x:t,y:n}){uw(e.x,t.translate,t.scale,t.originPoint),uw(e.y,n.translate,n.scale,n.originPoint)}const aN=.999999999999,nN=1.0000000000001;function che(e,t,n,c=!1){const i=n.length;if(!i)return;t.x=t.y=1;let r,s;for(let d=0;d<i;d++){r=n[d],s=r.projectionDelta;const{visualElement:l}=r.options;l&&l.props.style&&l.props.style.display==="contents"||(c&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Jc(e,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,mq(e,s)),c&&Sc(r.latestValues)&&Jc(e,r.latestValues))}t.x<nN&&t.x>aN&&(t.x=1),t.y<nN&&t.y>aN&&(t.y=1)}function Yc(e,t){e.min=e.min+t,e.max=e.max+t}function oN(e,t,n,c,i=.5){const r=ge(e.min,e.max,i);uw(e,t,n,r,c)}function Jc(e,t){oN(e.x,t.x,t.scaleX,t.scale,t.originX),oN(e.y,t.y,t.scaleY,t.scale,t.originY)}function fq(e,t){return yq(ohe(e.getBoundingClientRect(),t))}function ihe(e,t,n){const c=fq(e,n),{scroll:i}=t;return i&&(Yc(c.x,i.offset.x),Yc(c.y,i.offset.y)),c}const cN=()=>({translate:0,scale:1,origin:0,originPoint:0}),Qc=()=>({x:cN(),y:cN()}),iN=()=>({min:0,max:0}),Ie=()=>({x:iN(),y:iN()}),pw={current:null},gq={current:!1};function rhe(){if(gq.current=!0,!!Iw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>pw.current=e.matches;e.addEventListener("change",t),t()}else pw.current=!1}const she=new WeakMap;function dhe(e,t,n){for(const c in t){const i=t[c],r=n[c];if(Ae(i))e.addValue(c,i);else if(Ae(r))e.addValue(c,Dc(i,{owner:e}));else if(r!==i)if(e.hasValue(c)){const s=e.getValue(c);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(c);e.addValue(c,Dc(s!==void 0?s:i,{owner:e}))}}for(const c in n)t[c]===void 0&&e.removeValue(c);return t}const rN=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class lhe{scrapeMotionValuesFromProps(t,n,c){return{}}constructor({parent:t,props:n,presenceContext:c,reducedMotionConfig:i,blockInitialAnimation:r,visualState:s},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Fw,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=We.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,fe.render(this.render,!1,!0))};const{latestValues:l,renderState:h}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=h,this.parent=t,this.props=n,this.presenceContext=c,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=d,this.blockInitialAnimation=!!r,this.isControllingVariants=jL(n),this.isVariantNode=nq(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in p){const f=p[y];l[y]!==void 0&&Ae(f)&&f.set(l[y])}}mount(t){this.current=t,she.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,c)=>this.bindToMotionValue(c,n)),gq.current||rhe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:pw.current,process.env.NODE_ENV!=="production"&&jw(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),bt(this.notifyUpdate),bt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const c=l1.has(t);c&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&fe.preRender(this.notifyUpdate),c&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),r&&r(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in i1){const n=i1[t];if(!n)continue;const{isEnabled:c,Feature:i}=n;if(!this.features[t]&&i&&c(this.props)&&(this.features[t]=new i(this)),this.features[t]){const r=this.features[t];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ie()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let c=0;c<rN.length;c++){const i=rN[c];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,s=t[r];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=dhe(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const c=this.values.get(t);n!==c&&(c&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let c=this.values.get(t);return c===void 0&&n!==void 0&&(c=Dc(n===null?void 0:n,{owner:this}),this.addValue(t,c)),c}readValue(t,n){let c=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return c!=null&&(typeof c=="string"&&(d$(c)||h$(c))?c=parseFloat(c):!fle(c)&&Dt.test(n)&&(c=G$(t,n)),this.setBaseTarget(t,Ae(c)?c.get():c)),Ae(c)?c.get():c}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let c;if(typeof n=="string"||typeof n=="object"){const r=Jw(this.props,n,this.presenceContext?.custom);r&&(c=r[t])}if(n&&c!==void 0)return c;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Ae(i)?i:this.initialValues[t]!==void 0&&c===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Sw),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Uw.render(this.render)}}class vq extends lhe{constructor(){super(...arguments),this.KeyframeResolver=ole}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:c}){delete n[t],delete c[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ae(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function xq(e,{style:t,vars:n},c,i){const r=e.style;let s;for(s in t)r[s]=t[s];i?.applyProjectionStyles(r,c);for(s in n)r.setProperty(s,n[s])}function hhe(e){return window.getComputedStyle(e)}class uhe extends vq{constructor(){super(...arguments),this.type="html",this.renderInstance=xq}readValueFromInstance(t,n){if(l1.has(n))return this.projection?.isProjecting?ow(n):_0e(t,n);{const c=hhe(t),i=(Aw(n)?c.getPropertyValue(n):c[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return fq(t,n)}build(t,n,c){Zw(t,n,c.transformTemplate)}scrapeMotionValuesFromProps(t,n,c){return Qw(t,n,c)}}const Mq=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function phe(e,t,n,c){xq(e,t,void 0,c);for(const i in t.attrs)e.setAttribute(Mq.has(i)?i:eC(i),t.attrs[i])}class yhe extends vq{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ie}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(l1.has(n)){const c=W$(n);return c&&c.default||0}return n=Mq.has(n)?n:eC(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,c){return lq(t,n,c)}build(t,n,c){iq(t,n,this.isSVGTag,c.transformTemplate,c.style)}renderInstance(t,n,c,i){phe(t,n,c,i)}mount(t){this.isSVGTag=sq(t.tagName),super.mount(t)}}const khe=(e,t)=>Yw(e)?new yhe(t):new uhe(t,{allowProjection:e!==k.Fragment});function c1(e,t,n){const c=e.getProps();return Jw(c,t,n!==void 0?n:c.custom,e)}const yw=e=>Array.isArray(e);function mhe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Dc(n))}function fhe(e){return yw(e)?e[e.length-1]||0:e}function ghe(e,t){const n=c1(e,t);let{transitionEnd:c={},transition:i={},...r}=n||{};r={...r,...c};for(const s in r){const d=fhe(r[s]);mhe(e,s,d)}}function vhe(e){return!!(Ae(e)&&e.add)}function kw(e,t){const n=e.getValue("willChange");if(vhe(n))return n.add(t);if(!n&&It.WillChange){const c=new It.WillChange("auto");e.addValue("willChange",c),c.add(t)}}function _q(e){return e.props[hq]}const xhe=e=>e!==null;function Mhe(e,{repeat:t,repeatType:n="loop"},c){const i=e.filter(xhe),r=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[r]}const _he={type:"spring",stiffness:500,damping:25,restSpeed:10},Lhe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Ihe={type:"keyframes",duration:.8},bhe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},whe=(e,{keyframes:t})=>t.length>2?Ihe:l1.has(e)?e.startsWith("scale")?Lhe(t[1]):_he:bhe;function Che({when:e,delay:t,delayChildren:n,staggerChildren:c,staggerDirection:i,repeat:r,repeatType:s,repeatDelay:d,from:l,elapsed:h,...u}){return!!Object.keys(u).length}const tC=(e,t,n,c={},i,r)=>s=>{const d=Ew(c,e)||{},l=d.delay||c.delay||0;let{elapsed:h=0}=c;h=h-rt(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...d,delay:-h,onUpdate:y=>{t.set(y),d.onUpdate&&d.onUpdate(y)},onComplete:()=>{s(),d.onComplete&&d.onComplete()},name:e,motionValue:t,element:r?void 0:i};Che(d)||Object.assign(u,whe(e,u)),u.duration&&(u.duration=rt(u.duration)),u.repeatDelay&&(u.repeatDelay=rt(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let p=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(dw(u),u.delay===0&&(p=!0)),(It.instantAnimations||It.skipAnimations)&&(p=!0,dw(u),u.delay=0),u.allowFlatten=!d.type&&!d.ease,p&&!r&&t.get()!==void 0){const y=Mhe(u.keyframes,d);if(y!==void 0){fe.update(()=>{u.onUpdate(y),u.onComplete()});return}}return d.isSync?new Rw(u):new U0e(u)};function Nhe({protectedKeys:e,needsAnimating:t},n){const c=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,c}function Lq(e,t,{delay:n=0,transitionOverride:c,type:i}={}){let{transition:r=e.getDefaultTransition(),transitionEnd:s,...d}=t;c&&(r=c);const l=[],h=i&&e.animationState&&e.animationState.getState()[i];for(const u in d){const p=e.getValue(u,e.latestValues[u]??null),y=d[u];if(y===void 0||h&&Nhe(h,u))continue;const f={delay:n,...Ew(r||{},u)},g=p.get();if(g!==void 0&&!p.isAnimating&&!Array.isArray(y)&&y===g&&!f.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const M=_q(e);if(M){const v=window.MotionHandoffAnimation(M,u,fe);v!==null&&(f.startTime=v,m=!0)}}kw(e,u),p.start(tC(u,p,y,e.shouldReduceMotion&&E$.has(u)?{type:!1}:f,e,m));const x=p.animation;x&&l.push(x)}return s&&Promise.all(l).then(()=>{fe.update(()=>{s&&ghe(e,s)})}),l}function Iq(e,t,n,c=0,i=1){const r=Array.from(e).sort((h,u)=>h.sortNodePosition(u)).indexOf(t),s=e.size,d=(s-1)*c;return typeof n=="function"?n(r,s):i===1?r*c:d-r*c}function mw(e,t,n={}){const c=c1(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=c||{};n.transitionOverride&&(i=n.transitionOverride);const r=c?()=>Promise.all(Lq(e,c,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:h=0,staggerChildren:u,staggerDirection:p}=i;return She(e,t,l,h,u,p,n)}:()=>Promise.resolve(),{when:d}=i;if(d){const[l,h]=d==="beforeChildren"?[r,s]:[s,r];return l().then(()=>h())}else return Promise.all([r(),s(n.delay)])}function She(e,t,n=0,c=0,i=0,r=1,s){const d=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),d.push(mw(l,t,{...s,delay:n+(typeof c=="function"?0:c)+Iq(e.variantChildren,l,c,i,r)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(d)}function jhe(e,t,n={}){e.notify("AnimationStart",t);let c;if(Array.isArray(t)){const i=t.map(r=>mw(e,r,n));c=Promise.all(i)}else if(typeof t=="string")c=mw(e,t,n);else{const i=typeof t=="function"?c1(e,t,n.custom):t;c=Promise.all(Lq(e,i,n))}return c.then(()=>{e.notify("AnimationComplete",t)})}function bq(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let c=0;c<n;c++)if(t[c]!==e[c])return!1;return!0}const $he=Kw.length;function wq(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?wq(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<$he;n++){const c=Kw[n],i=e.props[c];(U1(i)||i===!1)&&(t[c]=i)}return t}const qhe=[...Gw].reverse(),Ahe=Gw.length;function zhe(e){return t=>Promise.all(t.map(({animation:n,options:c})=>jhe(e,n,c)))}function Vhe(e){let t=zhe(e),n=sN(),c=!0;const i=l=>(h,u)=>{const p=c1(e,u,l==="exit"?e.presenceContext?.custom:void 0);if(p){const{transition:y,transitionEnd:f,...g}=p;h={...h,...g,...f}}return h};function r(l){t=l(e)}function s(l){const{props:h}=e,u=wq(e.parent)||{},p=[],y=new Set;let f={},g=1/0;for(let x=0;x<Ahe;x++){const M=qhe[x],v=n[M],I=h[M]!==void 0?h[M]:u[M],b=U1(I),w=M===l?v.isActive:null;w===!1&&(g=x);let C=I===u[M]&&I!==h[M]&&b;if(C&&c&&e.manuallyAnimateOnMount&&(C=!1),v.protectedKeys={...f},!v.isActive&&w===null||!I&&!v.prevProp||SL(I)||typeof I=="boolean")continue;const _=Phe(v.prevProp,I);let L=_||M===l&&v.isActive&&!C&&b||x>g&&b,S=!1;const N=Array.isArray(I)?I:[I];let j=N.reduce(i(M),{});w===!1&&(j={});const{prevResolvedValues:q={}}=v,H={...q,...j},B=$=>{L=!0,y.has($)&&(S=!0,y.delete($)),v.needsAnimating[$]=!0;const D=e.getValue($);D&&(D.liveStyle=!1)};for(const $ in H){const D=j[$],R=q[$];if(f.hasOwnProperty($))continue;let V=!1;yw(D)&&yw(R)?V=!bq(D,R):V=D!==R,V?D!=null?B($):y.add($):D!==void 0&&y.has($)?B($):v.protectedKeys[$]=!0}v.prevProp=I,v.prevResolvedValues=j,v.isActive&&(f={...f,...j}),c&&e.blockInitialAnimation&&(L=!1);const A=C&&_;L&&(!A||S)&&p.push(...N.map($=>{const D={type:M};if(typeof $=="string"&&c&&!A&&e.manuallyAnimateOnMount&&e.parent){const{parent:R}=e,V=c1(R,$);if(R.enteringChildren&&V){const{delayChildren:O}=V.transition||{};D.delay=Iq(R.enteringChildren,e,O)}}return{animation:$,options:D}}))}if(y.size){const x={};if(typeof h.initial!="boolean"){const M=c1(e,Array.isArray(h.initial)?h.initial[0]:h.initial);M&&M.transition&&(x.transition=M.transition)}y.forEach(M=>{const v=e.getBaseTarget(M),I=e.getValue(M);I&&(I.liveStyle=!0),x[M]=v??null}),p.push({animation:x})}let m=!!p.length;return c&&(h.initial===!1||h.initial===h.animate)&&!e.manuallyAnimateOnMount&&(m=!1),c=!1,m?t(p):Promise.resolve()}function d(l,h){if(n[l].isActive===h)return Promise.resolve();e.variantChildren?.forEach(p=>p.animationState?.setActive(l,h)),n[l].isActive=h;const u=s(l);for(const p in n)n[p].protectedKeys={};return u}return{animateChanges:s,setActive:d,setAnimateFunction:r,getState:()=>n,reset:()=>{n=sN()}}}function Phe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!bq(t,e):!1}function Ot(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function sN(){return{animate:Ot(!0),whileInView:Ot(),whileHover:Ot(),whileTap:Ot(),whileDrag:Ot(),whileFocus:Ot(),exit:Ot()}}class Rt{constructor(t){this.isMounted=!1,this.node=t}update(){}}class The extends Rt{constructor(t){super(t),t.animationState||(t.animationState=Vhe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();SL(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Hhe=0;class Dhe extends Rt{constructor(){super(...arguments),this.id=Hhe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:c}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===c)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Bhe={animation:{Feature:The},exit:{Feature:Dhe}};function G1(e,t,n,c={passive:!0}){return e.addEventListener(t,n,c),()=>e.removeEventListener(t,n)}function J1(e){return{point:{x:e.pageX,y:e.pageY}}}const Rhe=e=>t=>Ww(t)&&e(t,J1(t));function H1(e,t,n,c){return G1(e,t,Rhe(n),c)}const Cq=1e-4,Fhe=1-Cq,Ehe=1+Cq,Nq=.01,Ohe=0-Nq,Uhe=0+Nq;function Re(e){return e.max-e.min}function Whe(e,t,n){return Math.abs(e-t)<=n}function dN(e,t,n,c=.5){e.origin=c,e.originPoint=ge(t.min,t.max,e.origin),e.scale=Re(n)/Re(t),e.translate=ge(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Fhe&&e.scale<=Ehe||isNaN(e.scale))&&(e.scale=1),(e.translate>=Ohe&&e.translate<=Uhe||isNaN(e.translate))&&(e.translate=0)}function D1(e,t,n,c){dN(e.x,t.x,n.x,c?c.originX:void 0),dN(e.y,t.y,n.y,c?c.originY:void 0)}function lN(e,t,n){e.min=n.min+t.min,e.max=e.min+Re(t)}function Ghe(e,t,n){lN(e.x,t.x,n.x),lN(e.y,t.y,n.y)}function hN(e,t,n){e.min=t.min-n.min,e.max=e.min+Re(t)}function B1(e,t,n){hN(e.x,t.x,n.x),hN(e.y,t.y,n.y)}function et(e){return[e("x"),e("y")]}const Sq=({current:e})=>e?e.ownerDocument.defaultView:null,uN=(e,t)=>Math.abs(e-t);function Khe(e,t){const n=uN(e.x,t.x),c=uN(e.y,t.y);return Math.sqrt(n**2+c**2)}class jq{constructor(t,n,{transformPagePoint:c,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=oI(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,g=Khe(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!f&&!g)return;const{point:m}=y,{timestamp:x}=qe;this.history.push({...m,timestamp:x});const{onStart:M,onMove:v}=this.handlers;f||(M&&M(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,y)},this.handlePointerMove=(y,f)=>{this.lastMoveEvent=y,this.lastMoveEventInfo=nI(f,this.transformPagePoint),fe.update(this.updatePoint,!0)},this.handlePointerUp=(y,f)=>{this.end();const{onEnd:g,onSessionEnd:m,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const M=oI(y.type==="pointercancel"?this.lastMoveEventInfo:nI(f,this.transformPagePoint),this.history);this.startEvent&&g&&g(y,M),m&&m(y,M)},!Ww(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=c,this.distanceThreshold=s,this.contextWindow=i||window;const d=J1(t),l=nI(d,this.transformPagePoint),{point:h}=l,{timestamp:u}=qe;this.history=[{...h,timestamp:u}];const{onSessionStart:p}=n;p&&p(t,oI(l,this.history)),this.removeListeners=Z1(H1(this.contextWindow,"pointermove",this.handlePointerMove),H1(this.contextWindow,"pointerup",this.handlePointerUp),H1(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),bt(this.updatePoint)}}function nI(e,t){return t?{point:t(e.point)}:e}function pN(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oI({point:e},t){return{point:e,delta:pN(e,$q(t)),offset:pN(e,Zhe(t)),velocity:Xhe(t,.1)}}function Zhe(e){return e[0]}function $q(e){return e[e.length-1]}function Xhe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,c=null;const i=$q(e);for(;n>=0&&(c=e[n],!(i.timestamp-c.timestamp>rt(t)));)n--;if(!c)return{x:0,y:0};const r=tt(i.timestamp-c.timestamp);if(r===0)return{x:0,y:0};const s={x:(i.x-c.x)/r,y:(i.y-c.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Yhe(e,{min:t,max:n},c){return t!==void 0&&e<t?e=c?ge(t,e,c.min):Math.max(e,t):n!==void 0&&e>n&&(e=c?ge(n,e,c.max):Math.min(e,n)),e}function yN(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Jhe(e,{top:t,left:n,bottom:c,right:i}){return{x:yN(e.x,n,i),y:yN(e.y,t,c)}}function kN(e,t){let n=t.min-e.min,c=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,c]=[c,n]),{min:n,max:c}}function Qhe(e,t){return{x:kN(e.x,t.x),y:kN(e.y,t.y)}}function eue(e,t){let n=.5;const c=Re(e),i=Re(t);return i>c?n=F1(t.min,t.max-c,e.min):c>i&&(n=F1(e.min,e.max-i,t.min)),Lt(0,1,n)}function tue(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const fw=.35;function aue(e=fw){return e===!1?e=0:e===!0&&(e=fw),{x:mN(e,"left","right"),y:mN(e,"top","bottom")}}function mN(e,t,n){return{min:fN(e,t),max:fN(e,n)}}function fN(e,t){return typeof e=="number"?e:e[t]||0}const nue=new WeakMap;class oue{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ie(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:c}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=p=>{const{dragSnapToOrigin:y}=this.getProps();y?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(J1(p).point)},s=(p,y)=>{const{drag:f,dragPropagation:g,onDragStart:m}=this.getProps();if(f&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=sle(f),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=y,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),et(M=>{let v=this.getAxisMotionValue(M).get()||0;if(mt.test(v)){const{projection:I}=this.visualElement;if(I&&I.layout){const b=I.layout.layoutBox[M];b&&(v=Re(b)*(parseFloat(v)/100))}}this.originPoint[M]=v}),m&&fe.postRender(()=>m(p,y)),kw(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},d=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y;const{dragPropagation:f,dragDirectionLock:g,onDirectionLock:m,onDrag:x}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:M}=y;if(g&&this.currentDirection===null){this.currentDirection=cue(M),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",y.point,M),this.updateAxis("y",y.point,M),this.visualElement.render(),x&&x(p,y)},l=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y,this.stop(p,y),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>et(p=>this.getAnimationState(p)==="paused"&&this.getAxisMotionValue(p).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new jq(t,{onSessionStart:r,onStart:s,onMove:d,onSessionEnd:l,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:c,contextWindow:Sq(this.visualElement)})}stop(t,n){const c=t||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!c)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:d}=this.getProps();d&&fe.postRender(()=>d(c,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:c}=this.getProps();!c&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,c){const{drag:i}=this.getProps();if(!c||!si(t,i,this.currentDirection))return;const r=this.getAxisMotionValue(t);let s=this.originPoint[t]+c[t];this.constraints&&this.constraints[t]&&(s=Yhe(s,this.constraints[t],this.elastic[t])),r.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),c=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&Xc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&c?this.constraints=Jhe(c.layoutBox,t):this.constraints=!1,this.elastic=aue(n),i!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&et(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=tue(c.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Xc(t))return!1;const c=t.current;st(c!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=ihe(c,i.root,this.visualElement.getTransformPagePoint());let s=Qhe(i.layout.layoutBox,r);if(n){const d=n(nhe(s));this.hasMutatedConstraints=!!d,d&&(s=yq(d))}return s}startAnimation(t){const{drag:n,dragMomentum:c,dragElastic:i,dragTransition:r,dragSnapToOrigin:s,onDragTransitionEnd:d}=this.getProps(),l=this.constraints||{},h=et(u=>{if(!si(u,n,this.currentDirection))return;let p=l&&l[u]||{};s&&(p={min:0,max:0});const y=i?200:1e6,f=i?40:1e7,g={type:"inertia",velocity:c?t[u]:0,bounceStiffness:y,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...r,...p};return this.startAxisValueAnimation(u,g)});return Promise.all(h).then(d)}startAxisValueAnimation(t,n){const c=this.getAxisMotionValue(t);return kw(this.visualElement,t),c.start(tC(t,c,0,n,this.visualElement,!1))}stopAnimation(){et(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){et(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,c=this.visualElement.getProps(),i=c[n];return i||this.visualElement.getValue(t,(c.initial?c.initial[t]:void 0)||0)}snapToCursor(t){et(n=>{const{drag:c}=this.getProps();if(!si(n,c,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:d}=i.layout.layoutBox[n];r.set(t[n]-ge(s,d,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:c}=this.visualElement;if(!Xc(n)||!c||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};et(s=>{const d=this.getAxisMotionValue(s);if(d&&this.constraints!==!1){const l=d.get();i[s]=eue({min:l,max:l},this.constraints[s])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",c.root&&c.root.updateScroll(),c.updateLayout(),this.resolveConstraints(),et(s=>{if(!si(s,t,null))return;const d=this.getAxisMotionValue(s),{min:l,max:h}=this.constraints[s];d.set(ge(l,h,i[s]))})}addListeners(){if(!this.visualElement.current)return;nue.set(this.visualElement,this);const t=this.visualElement.current,n=H1(t,"pointerdown",l=>{const{drag:h,dragListener:u=!0}=this.getProps();h&&u&&this.start(l)}),c=()=>{const{dragConstraints:l}=this.getProps();Xc(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",c);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),fe.read(c);const s=G1(window,"resize",()=>this.scalePositionWithinConstraints()),d=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:h})=>{this.isDragging&&h&&(et(u=>{const p=this.getAxisMotionValue(u);p&&(this.originPoint[u]+=l[u].translate,p.set(p.get()+l[u].translate))}),this.visualElement.render())});return()=>{s(),n(),r(),d&&d()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:c=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:s=fw,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:c,dragPropagation:i,dragConstraints:r,dragElastic:s,dragMomentum:d}}}function si(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function cue(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class iue extends Rt{constructor(t){super(t),this.removeGroupControls=nt,this.removeListeners=nt,this.controls=new oue(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||nt}unmount(){this.removeGroupControls(),this.removeListeners()}}const gN=e=>(t,n)=>{e&&fe.postRender(()=>e(t,n))};class rue extends Rt{constructor(){super(...arguments),this.removePointerDownListener=nt}onPointerDown(t){this.session=new jq(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Sq(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:c,onPanEnd:i}=this.node.getProps();return{onSessionStart:gN(t),onStart:gN(n),onMove:c,onEnd:(r,s)=>{delete this.session,i&&fe.postRender(()=>i(r,s))}}}mount(){this.removePointerDownListener=H1(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const hL={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function vN(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const k1={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Q.test(e))e=parseFloat(e);else return e;const n=vN(e,t.target.x),c=vN(e,t.target.y);return`${n}% ${c}%`}},sue={correct:(e,{treeScale:t,projectionDelta:n})=>{const c=e,i=Dt.parse(e);if(i.length>5)return c;const r=Dt.createTransformer(e),s=typeof i[0]!="number"?1:0,d=n.x.scale*t.x,l=n.y.scale*t.y;i[0+s]/=d,i[1+s]/=l;const h=ge(d,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=h),typeof i[3+s]=="number"&&(i[3+s]/=h),r(i)}};let cI=!1;class due extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:c,layoutId:i}=this.props,{projection:r}=t;$le(lue),r&&(n.group&&n.group.add(r),c&&c.register&&i&&c.register(r),cI&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),hL.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:c,drag:i,isPresent:r}=this.props,{projection:s}=c;return s&&(s.isPresent=r,cI=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==r?s.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?s.promote():s.relegate()||fe.postRender(()=>{const d=s.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Uw.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:c}=this.props,{projection:i}=t;cI=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),c&&c.deregister&&c.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function qq(e){const[t,n]=eq(),c=k.useContext(Lw);return o.jsx(due,{...e,layoutGroup:c,switchLayoutGroup:k.useContext(uq),isPresent:t,safeToRemove:n})}const lue={borderRadius:{...k1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:k1,borderTopRightRadius:k1,borderBottomLeftRadius:k1,borderBottomRightRadius:k1,boxShadow:sue};function hue(e,t,n){const c=Ae(e)?e:Dc(e);return c.start(tC("",c,t,n)),c.animation}const uue=(e,t)=>e.depth-t.depth;class pue{constructor(){this.children=[],this.isDirty=!1}add(t){ww(this.children,t),this.isDirty=!0}remove(t){Cw(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(uue),this.isDirty=!1,this.children.forEach(t)}}function yue(e,t){const n=We.now(),c=({timestamp:i})=>{const r=i-n;r>=t&&(bt(c),e(r-t))};return fe.setup(c,!0),()=>bt(c)}const Aq=["TopLeft","TopRight","BottomLeft","BottomRight"],kue=Aq.length,xN=e=>typeof e=="string"?parseFloat(e):e,MN=e=>typeof e=="number"||Q.test(e);function mue(e,t,n,c,i,r){i?(e.opacity=ge(0,n.opacity??1,fue(c)),e.opacityExit=ge(t.opacity??1,0,gue(c))):r&&(e.opacity=ge(t.opacity??1,n.opacity??1,c));for(let s=0;s<kue;s++){const d=`border${Aq[s]}Radius`;let l=_N(t,d),h=_N(n,d);if(l===void 0&&h===void 0)continue;l||(l=0),h||(h=0),l===0||h===0||MN(l)===MN(h)?(e[d]=Math.max(ge(xN(l),xN(h),c),0),(mt.test(h)||mt.test(l))&&(e[d]+="%")):e[d]=h}(t.rotate||n.rotate)&&(e.rotate=ge(t.rotate||0,n.rotate||0,c))}function _N(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const fue=zq(0,.5,v$),gue=zq(.5,.95,nt);function zq(e,t,n){return c=>c<e?0:c>t?1:n(F1(e,t,c))}function LN(e,t){e.min=t.min,e.max=t.max}function Xe(e,t){LN(e.x,t.x),LN(e.y,t.y)}function IN(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function bN(e,t,n,c,i){return e-=t,e=ML(e,1/n,c),i!==void 0&&(e=ML(e,1/i,c)),e}function vue(e,t=0,n=1,c=.5,i,r=e,s=e){if(mt.test(t)&&(t=parseFloat(t),t=ge(s.min,s.max,t/100)-s.min),typeof t!="number")return;let d=ge(r.min,r.max,c);e===r&&(d-=t),e.min=bN(e.min,t,n,d,i),e.max=bN(e.max,t,n,d,i)}function wN(e,t,[n,c,i],r,s){vue(e,t[n],t[c],t[i],t.scale,r,s)}const xue=["x","scaleX","originX"],Mue=["y","scaleY","originY"];function CN(e,t,n,c){wN(e.x,t,xue,n?n.x:void 0,c?c.x:void 0),wN(e.y,t,Mue,n?n.y:void 0,c?c.y:void 0)}function NN(e){return e.translate===0&&e.scale===1}function Vq(e){return NN(e.x)&&NN(e.y)}function SN(e,t){return e.min===t.min&&e.max===t.max}function _ue(e,t){return SN(e.x,t.x)&&SN(e.y,t.y)}function jN(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Pq(e,t){return jN(e.x,t.x)&&jN(e.y,t.y)}function $N(e){return Re(e.x)/Re(e.y)}function qN(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Lue{constructor(){this.members=[]}add(t){ww(this.members,t),t.scheduleRender()}remove(t){if(Cw(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let c;for(let i=n;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1){c=r;break}}return c?(this.promote(c),!0):!1}promote(t,n){const c=this.lead;if(t!==c&&(this.prevLead=c,this.lead=t,t.show(),c)){c.instance&&c.scheduleRender(),t.scheduleRender(),t.resumeFrom=c,n&&(t.resumeFrom.preserveOpacity=!0),c.snapshot&&(t.snapshot=c.snapshot,t.snapshot.latestValues=c.animationValues||c.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&c.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:c}=t;n.onExitComplete&&n.onExitComplete(),c&&c.options.onExitComplete&&c.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Iue(e,t,n){let c="";const i=e.x.translate/t.x,r=e.y.translate/t.y,s=n?.z||0;if((i||r||s)&&(c=`translate3d(${i}px, ${r}px, ${s}px) `),(t.x!==1||t.y!==1)&&(c+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:h,rotate:u,rotateX:p,rotateY:y,skewX:f,skewY:g}=n;h&&(c=`perspective(${h}px) ${c}`),u&&(c+=`rotate(${u}deg) `),p&&(c+=`rotateX(${p}deg) `),y&&(c+=`rotateY(${y}deg) `),f&&(c+=`skewX(${f}deg) `),g&&(c+=`skewY(${g}deg) `)}const d=e.x.scale*t.x,l=e.y.scale*t.y;return(d!==1||l!==1)&&(c+=`scale(${d}, ${l})`),c||"none"}const iI=["","X","Y","Z"],bue=1e3;let wue=0;function rI(e,t,n,c){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),c&&(c[e]=0))}function Tq(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=_q(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",fe,!(i||r))}const{parent:c}=e;c&&!c.hasCheckedOptimisedAppear&&Tq(c)}function Hq({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:c,resetTransform:i}){return class{constructor(s={},d=t?.()){this.id=wue++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Sue),this.nodes.forEach(Aue),this.nodes.forEach(zue),this.nodes.forEach(jue)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new pue)}addEventListener(s,d){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Sw),this.eventHandlers.get(s).add(d)}notifyListeners(s,...d){const l=this.eventHandlers.get(s);l&&l.notify(...d)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=Q$(s)&&!yle(s),this.instance=s;const{layoutId:d,layout:l,visualElement:h}=this.options;if(h&&!h.current&&h.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||d)&&(this.isLayoutDirty=!0),e){let u,p=0;const y=()=>this.root.updateBlockedByResize=!1;fe.read(()=>{p=window.innerWidth}),e(s,()=>{const f=window.innerWidth;f!==p&&(p=f,this.root.updateBlockedByResize=!0,u&&u(),u=yue(y,250),hL.hasAnimatedSinceResize&&(hL.hasAnimatedSinceResize=!1,this.nodes.forEach(VN)))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&h&&(d||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:p,hasRelativeLayoutChanged:y,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||h.getDefaultTransition()||Due,{onLayoutAnimationStart:m,onLayoutAnimationComplete:x}=h.getProps(),M=!this.targetLayout||!Pq(this.targetLayout,f),v=!p&&y;if(this.options.layoutRoot||this.resumeFrom||v||p&&(M||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const I={...Ew(g,"layout"),onPlay:m,onComplete:x};(h.shouldReduceMotion||this.options.layoutRoot)&&(I.delay=0,I.type=!1),this.startAnimation(I),this.setAnimationOrigin(u,v)}else p||VN(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),bt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Vue),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Tq(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const p=this.path[u];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:d,layout:l}=this.options;if(d===void 0&&!l)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(AN);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(zN);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(que),this.nodes.forEach(Cue),this.nodes.forEach(Nue)):this.nodes.forEach(zN),this.clearAllSnapshots();const d=We.now();qe.delta=Lt(0,1e3/60,d-qe.timestamp),qe.timestamp=d,qe.isProcessing=!0,ZL.update.process(qe),ZL.preRender.process(qe),ZL.render.process(qe),qe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Uw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach($ue),this.sharedNodes.forEach(Pue)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,fe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){fe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Re(this.snapshot.measuredBox.x)&&!Re(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Ie(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(d=!1),d&&this.instance){const l=c(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!Vq(this.projectionDelta),l=this.getTransformTemplate(),h=l?l(this.latestValues,""):void 0,u=h!==this.prevTransformTemplateValue;s&&this.instance&&(d||Sc(this.latestValues)||u)&&(i(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const d=this.measurePageBox();let l=this.removeElementScroll(d);return s&&(l=this.removeTransform(l)),Bue(l),{animationId:this.root.animationId,measuredBox:d,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return Ie();const d=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Rue))){const{scroll:h}=this.root;h&&(Yc(d.x,h.offset.x),Yc(d.y,h.offset.y))}return d}removeElementScroll(s){const d=Ie();if(Xe(d,s),this.scroll?.wasRoot)return d;for(let l=0;l<this.path.length;l++){const h=this.path[l],{scroll:u,options:p}=h;h!==this.root&&u&&p.layoutScroll&&(u.wasRoot&&Xe(d,s),Yc(d.x,u.offset.x),Yc(d.y,u.offset.y))}return d}applyTransform(s,d=!1){const l=Ie();Xe(l,s);for(let h=0;h<this.path.length;h++){const u=this.path[h];!d&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Jc(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Sc(u.latestValues)&&Jc(l,u.latestValues)}return Sc(this.latestValues)&&Jc(l,this.latestValues),l}removeTransform(s){const d=Ie();Xe(d,s);for(let l=0;l<this.path.length;l++){const h=this.path[l];if(!h.instance||!Sc(h.latestValues))continue;hw(h.latestValues)&&h.updateSnapshot();const u=Ie(),p=h.measurePageBox();Xe(u,p),CN(d,h.latestValues,h.snapshot?h.snapshot.layoutBox:void 0,u)}return Sc(this.latestValues)&&CN(d,this.latestValues),d}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==qe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==d;if(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:p}=this.options;if(!(!this.layout||!(u||p))){if(this.resolvedRelativeTargetAt=qe.timestamp,!this.targetDelta&&!this.relativeTarget){const y=this.getClosestProjectingParent();y&&y.layout&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ie(),this.relativeTargetOrigin=Ie(),B1(this.relativeTargetOrigin,this.layout.layoutBox,y.layout.layoutBox),Xe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ie(),this.targetWithTransforms=Ie()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Ghe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Xe(this.target,this.layout.layoutBox),mq(this.target,this.targetDelta)):Xe(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const y=this.getClosestProjectingParent();y&&!!y.resumingFrom==!!this.resumingFrom&&!y.options.layoutScroll&&y.target&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ie(),this.relativeTargetOrigin=Ie(),B1(this.relativeTargetOrigin,this.target,y.target),Xe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||hw(this.parent.latestValues)||kq(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const s=this.getLead(),d=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===qe.timestamp&&(l=!1),l)return;const{layout:h,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(h||u))return;Xe(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,y=this.treeScale.y;che(this.layoutCorrected,this.treeScale,this.path,d),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=Ie());const{target:f}=s;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(IN(this.prevProjectionDelta.x,this.projectionDelta.x),IN(this.prevProjectionDelta.y,this.projectionDelta.y)),D1(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==y||!qN(this.projectionDelta.x,this.prevProjectionDelta.x)||!qN(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Qc(),this.projectionDelta=Qc(),this.projectionDeltaWithTransform=Qc()}setAnimationOrigin(s,d=!1){const l=this.snapshot,h=l?l.latestValues:{},u={...this.latestValues},p=Qc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const y=Ie(),f=l?l.source:void 0,g=this.layout?this.layout.source:void 0,m=f!==g,x=this.getStack(),M=!x||x.members.length<=1,v=!!(m&&!M&&this.options.crossfade===!0&&!this.path.some(Hue));this.animationProgress=0;let I;this.mixTargetDelta=b=>{const w=b/1e3;PN(p.x,s.x,w),PN(p.y,s.y,w),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(B1(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Tue(this.relativeTarget,this.relativeTargetOrigin,y,w),I&&_ue(this.relativeTarget,I)&&(this.isProjectionDirty=!1),I||(I=Ie()),Xe(I,this.relativeTarget)),m&&(this.animationValues=u,mue(u,h,this.latestValues,w,v,M)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(bt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=fe.update(()=>{hL.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Dc(0)),this.currentAnimation=hue(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),s.onUpdate&&s.onUpdate(d)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(bue),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:d,target:l,layout:h,latestValues:u}=s;if(!(!d||!l||!h)){if(this!==s&&this.layout&&h&&Dq(this.options.animationType,this.layout.layoutBox,h.layoutBox)){l=this.target||Ie();const p=Re(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+p;const y=Re(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+y}Xe(d,l),Jc(d,u),D1(this.projectionDeltaWithTransform,this.layoutCorrected,d,u)}}registerSharedNode(s,d){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Lue),this.sharedNodes.get(s).add(d);const h=d.options.initialPromotionConfig;d.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(d):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:d,preserveFollowOpacity:l}={}){const h=this.getStack();h&&h.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let d=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(d=!0),!d)return;const h={};l.z&&rI("z",s,h,this.animationValues);for(let u=0;u<iI.length;u++)rI(`rotate${iI[u]}`,s,h,this.animationValues),rI(`skew${iI[u]}`,s,h,this.animationValues);s.render();for(const u in h)s.setStaticValue(u,h[u]),this.animationValues&&(this.animationValues[u]=h[u]);s.scheduleRender()}applyProjectionStyles(s,d){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=lL(d?.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=lL(d?.pointerEvents)||""),this.hasProjected&&!Sc(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=h.animationValues||h.latestValues;this.applyTransformsToTarget();let p=Iue(this.projectionDeltaWithTransform,this.treeScale,u);l&&(p=l(u,p)),s.transform=p;const{x:y,y:f}=this.projectionDelta;s.transformOrigin=`${y.origin*100}% ${f.origin*100}% 0`,h.animationValues?s.opacity=h===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=h===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in W1){if(u[g]===void 0)continue;const{correct:m,applyTo:x,isCSSVariable:M}=W1[g],v=p==="none"?u[g]:m(u[g],h);if(x){const I=x.length;for(let b=0;b<I;b++)s[x[b]]=v}else M?this.options.visualElement.renderState.vars[g]=v:s[g]=v}this.options.layoutId&&(s.pointerEvents=h===this?lL(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(AN),this.root.sharedNodes.clear()}}}function Cue(e){e.updateLayout()}function Nue(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:c}=e.layout,{animationType:i}=e.options,r=t.source!==e.layout.source;i==="size"?et(u=>{const p=r?t.measuredBox[u]:t.layoutBox[u],y=Re(p);p.min=n[u].min,p.max=p.min+y}):Dq(i,t.layoutBox,n)&&et(u=>{const p=r?t.measuredBox[u]:t.layoutBox[u],y=Re(n[u]);p.max=p.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+y)});const s=Qc();D1(s,n,t.layoutBox);const d=Qc();r?D1(d,e.applyTransform(c,!0),t.measuredBox):D1(d,n,t.layoutBox);const l=!Vq(s);let h=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:p,layout:y}=u;if(p&&y){const f=Ie();B1(f,t.layoutBox,p.layoutBox);const g=Ie();B1(g,n,y.layoutBox),Pq(f,g)||(h=!0),u.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=f,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:d,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:h})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function Sue(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function jue(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function $ue(e){e.clearSnapshot()}function AN(e){e.clearMeasurements()}function zN(e){e.isLayoutDirty=!1}function que(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function VN(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Aue(e){e.resolveTargetDelta()}function zue(e){e.calcProjection()}function Vue(e){e.resetSkewAndRotation()}function Pue(e){e.removeLeadSnapshot()}function PN(e,t,n){e.translate=ge(t.translate,0,n),e.scale=ge(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function TN(e,t,n,c){e.min=ge(t.min,n.min,c),e.max=ge(t.max,n.max,c)}function Tue(e,t,n,c){TN(e.x,t.x,n.x,c),TN(e.y,t.y,n.y,c)}function Hue(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Due={duration:.45,ease:[.4,0,.1,1]},HN=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),DN=HN("applewebkit/")&&!HN("chrome/")?Math.round:nt;function BN(e){e.min=DN(e.min),e.max=DN(e.max)}function Bue(e){BN(e.x),BN(e.y)}function Dq(e,t,n){return e==="position"||e==="preserve-aspect"&&!Whe($N(t),$N(n),.2)}function Rue(e){return e!==e.root&&e.scroll?.wasRoot}const Fue=Hq({attachResizeListener:(e,t)=>G1(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),sI={current:void 0},Bq=Hq({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!sI.current){const e=new Fue({});e.mount(window),e.setOptions({layoutScroll:!0}),sI.current=e}return sI.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Eue={pan:{Feature:rue},drag:{Feature:iue,ProjectionNode:Bq,MeasureLayout:qq}};function RN(e,t,n){const{props:c}=e;e.animationState&&c.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=c[i];r&&fe.postRender(()=>r(t,J1(t)))}class Oue extends Rt{mount(){const{current:t}=this.node;t&&(this.unmount=dle(t,(n,c)=>(RN(this.node,c,"Start"),i=>RN(this.node,i,"End"))))}unmount(){}}class Uue extends Rt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Z1(G1(this.node.current,"focus",()=>this.onFocus()),G1(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function FN(e,t,n){const{props:c}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&c.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=c[i];r&&fe.postRender(()=>r(t,J1(t)))}class Wue extends Rt{mount(){const{current:t}=this.node;t&&(this.unmount=ple(t,(n,c)=>(FN(this.node,c,"Start"),(i,{success:r})=>FN(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const gw=new WeakMap,dI=new WeakMap,Gue=e=>{const t=gw.get(e.target);t&&t(e)},Kue=e=>{e.forEach(Gue)};function Zue({root:e,...t}){const n=e||document;dI.has(n)||dI.set(n,{});const c=dI.get(n),i=JSON.stringify(t);return c[i]||(c[i]=new IntersectionObserver(Kue,{root:e,...t})),c[i]}function Xue(e,t,n){const c=Zue(t);return gw.set(e,n),c.observe(e),()=>{gw.delete(e),c.unobserve(e)}}const Yue={some:0,all:1};class Jue extends Rt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:c,amount:i="some",once:r}=t,s={root:n?n.current:void 0,rootMargin:c,threshold:typeof i=="number"?i:Yue[i]},d=l=>{const{isIntersecting:h}=l;if(this.isInView===h||(this.isInView=h,r&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:u,onViewportLeave:p}=this.node.getProps(),y=h?u:p;y&&y(l)};return Xue(this.node.current,s,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Que(t,n))&&this.startObserver()}unmount(){}}function Que({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const epe={inView:{Feature:Jue},tap:{Feature:Wue},focus:{Feature:Uue},hover:{Feature:Oue}},tpe={layout:{ProjectionNode:Bq,MeasureLayout:qq}},ape={...Bhe,...epe,...Eue,...tpe},aC=ahe(ape,khe);function Rq(e){const t=Bt(()=>Dc(e)),{isStatic:n}=k.useContext(CL);if(n){const[,c]=k.useState(e);k.useEffect(()=>t.on("change",c),[])}return t}function Fq(e,t){const n=Rq(t()),c=()=>n.set(t());return c(),bw(()=>{const i=()=>fe.preRender(c,!1,!0),r=e.map(s=>s.on("change",i));return()=>{r.forEach(s=>s()),bt(c)}}),n}function npe(e){T1.current=[],e();const t=Fq(T1.current,e);return T1.current=void 0,t}function ope(e,t,n,c){if(typeof e=="function")return npe(e);const i=typeof t=="function"?t:kle(t,n,c);return Array.isArray(e)?EN(e,i):EN([e],([r])=>i(r))}function EN(e,t){const n=Bt(()=>[]);return Fq(e,()=>{n.length=0;const c=e.length;for(let i=0;i<c;i++)n[i]=e[i].get();return t(n)})}class cpe{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,n){this.componentControls.forEach(c=>{c.start(t.nativeEvent||t,n)})}cancel(){this.componentControls.forEach(t=>{t.cancel()})}stop(){this.componentControls.forEach(t=>{t.stop()})}}const ipe=()=>new cpe;function rpe(){return Bt(ipe)}const Eq=k.createContext(null);function spe(e,t,n,c){if(!c)return e;const i=e.findIndex(u=>u.value===t);if(i===-1)return e;const r=c>0?1:-1,s=e[i+r];if(!s)return e;const d=e[i],l=s.layout,h=ge(l.min,l.max,.5);return r===1&&d.layout.max+n>h||r===-1&&d.layout.min+n<h?Mde(e,i,i+r):e}function dpe({children:e,as:t="ul",axis:n="y",onReorder:c,values:i,...r},s){const d=Bt(()=>aC[t]),l=[],h=k.useRef(!1);st(!!i,"Reorder.Group must be provided a values prop","reorder-values");const u={axis:n,registerItem:(p,y)=>{const f=l.findIndex(g=>p===g.value);f!==-1?l[f].layout=y[n]:l.push({value:p,layout:y[n]}),l.sort(upe)},updateOrder:(p,y,f)=>{if(h.current)return;const g=spe(l,p,y,f);l!==g&&(h.current=!0,c(g.map(hpe).filter(m=>i.indexOf(m)!==-1)))}};return k.useEffect(()=>{h.current=!1}),o.jsx(d,{...r,ref:s,ignoreStrict:!0,children:o.jsx(Eq.Provider,{value:u,children:e})})}const lpe=k.forwardRef(dpe);function hpe(e){return e.value}function upe(e,t){return e.layout.min-t.layout.min}function ON(e,t=0){return Ae(e)?e:Rq(t)}function ppe({children:e,style:t={},value:n,as:c="li",onDrag:i,layout:r=!0,...s},d){const l=Bt(()=>aC[c]),h=k.useContext(Eq),u={x:ON(t.x),y:ON(t.y)},p=ope([u.x,u.y],([m,x])=>m||x?1:"unset");st(!!h,"Reorder.Item must be a child of Reorder.Group","reorder-item-child");const{axis:y,registerItem:f,updateOrder:g}=h;return o.jsx(l,{drag:y,...s,dragSnapToOrigin:!0,style:{...t,x:u.x,y:u.y,zIndex:p},layout:r,onDrag:(m,x)=>{const{velocity:M}=x;M[y]&&g(n,u[y].get(),M[y]),i&&i(m,x)},onLayoutMeasure:m=>f(n,m),ref:d,ignoreStrict:!0,children:e})}const ype=k.forwardRef(ppe),_L=[o.jsx(V1,{size:18}),o.jsx(zt,{size:18}),o.jsx(A1,{size:18}),o.jsx(Vt,{size:18}),o.jsx(I1,{size:18}),o.jsx(L1,{size:18})],kpe=({items:e,onReorder:t,draggable:n=!1,className:c,header:i,headerStyle:r,itemsDraggable:s=!0})=>{const[d,l]=k.useState(e??[]);return k.useEffect(()=>{e&&Array.isArray(e)?(e.forEach((h,u)=>{if(h.icon==null&&(h.icon=_L[u%_L.length]),typeof h.text=="string"&&h.text.includes("/")){const p=String(h.text).split("/"),y=p[0].trim(),g=p.slice(1).join("/").trim().match(/^(\d+)(.*)$/);if(g){const m=g[1],x=g[2]??"",M=m.padStart(3,"0");h.text=`${y} / ${M}${x}`}}}),l(e)):l([])},[e]),o.jsxs("div",{className:`trend-list ${c??""}`,draggable:n,style:{position:"relative"},children:[o.jsx("div",{className:"trend-header",style:r,children:i??"Trend"}),o.jsx("div",{className:"trend-list-body",style:{opacity:n?0:1},children:o.jsx(lpe,{axis:"y",values:d,onReorder:h=>{l(h),t?.(h)},style:{display:"flex",flexDirection:"column",gap:8},children:d.map((h,u)=>o.jsx(mpe,{value:h,index:u,itemsDraggable:s},String(h.id)))})}),n&&o.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:o.jsx(a.Move,{size:48,strokeWidth:1.5,style:{opacity:.8}})})]})};function mpe({value:e,index:t}){const n=rpe(),c=_L[t%_L.length]??null;return o.jsx(ype,{value:e,dragListener:!1,dragControls:n,style:{listStyle:"none"},onDragStart:()=>{try{document.body.classList.add("is-dragging")}catch{}},onDragEnd:()=>{try{document.body.classList.remove("is-dragging")}catch{}},children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[o.jsx("div",{className:"reorder-handle","aria-hidden":!0,onPointerDown:i=>n.start(i),style:{width:28,height:28,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",userSelect:"none"},children:o.jsx("svg",{width:"25",height:"25",viewBox:"0 0 24 24","aria-hidden":!0,children:o.jsxs("g",{fill:"currentColor",children:[o.jsx("circle",{cx:"8",cy:"6",r:"2"}),o.jsx("circle",{cx:"16",cy:"6",r:"2"}),o.jsx("circle",{cx:"8",cy:"12",r:"2"}),o.jsx("circle",{cx:"16",cy:"12",r:"2"}),o.jsx("circle",{cx:"8",cy:"18",r:"2"}),o.jsx("circle",{cx:"16",cy:"18",r:"2"})]})})}),o.jsx("div",{style:{flex:1},children:o.jsx(s$,{title:e.title,subtitle:e.subtitle,text:e.text,background:e.background,titleStyle:e.titleStyle,subtitleStyle:e.subtitleStyle,textStyle:e.textStyle,itemStyle:e.itemStyle,icon:e.icon??c})})]})})}function fpe(e,t){return t.required?t.type==="checkbox"&&!e?{isValid:!1,error:`${t.label} est requis`}:!e||typeof e=="string"&&e.trim()===""?{isValid:!1,error:`${t.label} est requis`}:null:null}function gpe(e){return!e||typeof e=="string"&&e.trim()===""}function vpe(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?null:{isValid:!1,error:"Format d'email invalide"}}function xpe(e){return/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/.test(e)?null:{isValid:!1,error:"Format d'URL invalide"}}function Mpe(e,t){const n=Number(e);return isNaN(n)?{isValid:!1,error:"Doit être un nombre valide"}:t.validation?.min!==void 0&&n<Number(t.validation.min)?{isValid:!1,error:`Doit être ≥ ${t.validation.min}`}:t.validation?.max!==void 0&&n>Number(t.validation.max)?{isValid:!1,error:`Doit être ≤ ${t.validation.max}`}:null}function _pe(e,t){return t.validation?.minDate&&new Date(e)<new Date(t.validation.minDate)?{isValid:!1,error:`Doit être après ${t.validation.minDate}`}:t.validation?.maxDate&&new Date(e)>new Date(t.validation.maxDate)?{isValid:!1,error:`Doit être avant ${t.validation.maxDate}`}:null}function Lpe(e,t){if(t.validation?.acceptedTypes){const n=t.validation.acceptedTypes.split(","),c=e.type;if(!n.some(i=>c.match(i.replace("*",".*"))))return{isValid:!1,error:`Type de fichier non supporté: ${c}`}}return t.validation?.maxFileSize&&e.size>t.validation.maxFileSize?{isValid:!1,error:`Fichier trop volumineux (max ${t.validation.maxFileSize/1048576}MB)`}:null}function Ipe(e,t){return t.validation?t.validation.minLength&&e.length<t.validation.minLength?{isValid:!1,error:`Minimum ${t.validation.minLength} caractères`}:t.validation.maxLength&&e.length>t.validation.maxLength?{isValid:!1,error:`Maximum ${t.validation.maxLength} caractères`}:t.validation.pattern&&!new RegExp(t.validation.pattern).test(e)?{isValid:!1,error:"Format invalide"}:null:null}function LL(e,t){const n=fpe(e,t);if(n)return n;if(gpe(e))return{isValid:!0};const c=e.toString();switch(t.type){case"email":{const r=vpe(c);if(r)return r;break}case"url":{const r=xpe(c);if(r)return r;break}case"number":{const r=Mpe(e,t);if(r)return r;break}case"date":case"month":case"week":case"time":case"datetime-local":{const r=_pe(e,t);if(r)return r;break}case"file":{const r=Lpe(e,t);if(r)return r;break}}const i=Ipe(c,t);return i||{isValid:!0}}function Oq(e,t){const n={};let c=!0;for(const i of t){const r=LL(e[i.name],i);r.isValid||(n[i.name]=r.error,c=!1)}return{isValid:c,errors:n}}const bpe="_formContainer_14ads_1",wpe="_headerLine_14ads_17",Cpe="_formTitle_14ads_25",Npe="_formDescription_14ads_30",Spe="_sectionTitle_14ads_37",jpe="_sectionHelp_14ads_44",$pe="_fieldHelp_14ads_50",qpe="_gridContainer_14ads_58",Ape="_fieldGridItem_14ads_70",zpe="_sectionFull_14ads_105",Vpe="_formFooter_14ads_110",Ppe="_footerLeft_14ads_118",Tpe="_footerRight_14ads_119",Hpe="_cancelLink_14ads_125",Dpe="_submitButton_14ads_136",Bpe="_fieldLabel_14ads_148",Rpe="_inputWrapper_14ads_163",Fpe="_inputInner_14ads_187",Epe="_hasPrefix_14ads_196",Ope="_inputBase_14ads_196",Upe="_iconPrefix_14ads_292",Wpe="_iconSuffix_14ads_293",Gpe="_passwordToggle_14ads_319",Kpe="_fieldError_14ads_365",Zpe="_fieldInvalid_14ads_372",me={formContainer:bpe,headerLine:wpe,formTitle:Cpe,formDescription:Npe,sectionTitle:Spe,sectionHelp:jpe,fieldHelp:$pe,gridContainer:qpe,fieldGridItem:Ape,sectionFull:zpe,formFooter:Vpe,footerLeft:Ppe,footerRight:Tpe,cancelLink:Hpe,submitButton:Dpe,fieldLabel:Bpe,inputWrapper:Rpe,inputInner:Fpe,hasPrefix:Epe,inputBase:Ope,iconPrefix:Upe,iconSuffix:Wpe,passwordToggle:Gpe,fieldError:Kpe,fieldInvalid:Zpe},Uq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const[s,d]=k.useState(!1),l=e.type==="password",h=e.attributes?.showPasswordToggle??!0,u=l?s?"text":"password":e.type,p=e.attributes?.iconComponent??(e.attributes?.icon?_t[e.attributes.icon]:null),y=e.attributes?.iconPosition??"suffix",f=g=>{n(g.target.value)};return o.jsxs("div",{className:me.inputWrapper,children:[o.jsx("label",{className:`${me.fieldLabel} ${e.required?"required":""}`,htmlFor:e.name,children:e.label}),o.jsxs("div",{className:`${me.inputInner} ${p&&y==="prefix"?me.hasPrefix:""}`,children:[p&&y==="prefix"&&o.jsx("span",{className:me.iconPrefix,children:o.jsx(p,{size:16})}),o.jsx("input",{id:e.name,name:e.name,type:u,placeholder:e.placeholder,className:`${me.inputBase} ${i?me.fieldInvalid:""}`,value:t??"",onChange:f,onBlur:c,disabled:!!e.disabled,"aria-invalid":!!i,"aria-describedby":e.help?`${e.name}-help`:void 0}),l&&h&&o.jsx("button",{type:"button","aria-label":s?"Masquer le mot de passe":"Afficher le mot de passe",className:me.passwordToggle,onClick:()=>d(g=>!g),children:s?o.jsx(S1,{size:16}):o.jsx(j1,{size:16})}),p&&y==="suffix"&&!l&&o.jsx("span",{className:me.iconSuffix,children:o.jsx(p,{size:16})})]}),r&&i&&o.jsx("span",{className:me.fieldError,children:i})]})},Xpe="_fieldGroup_yb3zi_7",Ype="_fieldLabel_yb3zi_11",Jpe="_required_yb3zi_17",Qpe="_fieldInput_yb3zi_22",eye="_fieldInvalid_yb3zi_40",tye="_fieldValid_yb3zi_44",aye="_fieldError_yb3zi_48",nye="_radioGroup_yb3zi_57",Pt={fieldGroup:Xpe,fieldLabel:Ype,required:Jpe,fieldInput:Qpe,fieldInvalid:eye,fieldValid:tye,fieldError:aye,radioGroup:nye},$L=({field:e,children:t,error:n,touched:c})=>{const i=c&&n;return o.jsxs("div",{className:Pt.fieldGroup,children:[e.type!=="checkbox"&&e.type!=="radio"&&o.jsx("label",{className:`${Pt.fieldLabel} ${e.required?Pt.required:""}`,children:e.label}),t,i&&o.jsx("span",{className:Pt.fieldError,children:n})]})},Wq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=r&&i,d=r&&!i&&t,l=["form-control",Pt.fieldInput,s?Pt.fieldInvalid:"",d?Pt.fieldValid:""].filter(Boolean).join(" ");return o.jsx($L,{field:e,error:i,touched:r,children:o.jsx("textarea",{className:l,placeholder:e.placeholder,value:t||"",onChange:h=>n(h.target.value),onBlur:c,rows:4})})},oye="_wrapper_117u4_1",cye="_wrapperInvalid_117u4_15",iye="_nativeSelect_117u4_19",rye="_display_117u4_30",sye="_topLabel_117u4_37",dye="_valueLine_117u4_45",lye="_valuePlaceholder_117u4_53",hye="_valueActive_117u4_57",uye="_caret_117u4_61",pye="_error_117u4_75",yye="_optionStyle_117u4_89",Ye={wrapper:oye,wrapperInvalid:cye,nativeSelect:iye,display:rye,topLabel:sye,valueLine:dye,valuePlaceholder:lye,valueActive:hye,caret:uye,error:pye,optionStyle:yye},nC=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=!!(r&&i),d=e.label||"",l=e.placeholder||"",h=e.options?.find(u=>String(u.value)===String(t))?.label??"";return o.jsxs("div",{className:`${Ye.wrapper} ${s?Ye.wrapperInvalid:""} ${t?Ye.wrapperHasValue:""}`,children:[o.jsxs("select",{id:e.name,name:e.name,className:Ye.nativeSelect,value:t??"",onChange:u=>n(u.target.value),onBlur:c,"aria-invalid":s,"aria-label":d,children:[o.jsx("option",{value:"",disabled:!0,hidden:!0,children:l||`Sélectionnez ${d?.toLowerCase()||""}`}),e.options?.map((u,p)=>o.jsx("option",{value:u.value,className:Ye.optionStyle,children:u.label},p))]}),o.jsxs("div",{className:Ye.display,children:[d&&o.jsx("span",{className:Ye.topLabel,children:d}),o.jsx("span",{className:`${Ye.valueLine} ${t?Ye.valueActive:Ye.valuePlaceholder}`,children:t?h:l}),o.jsx("span",{className:Ye.caret,"aria-hidden":"true"})]}),s&&o.jsx("span",{className:Ye.error,children:i})]})},Gq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsx($L,{field:e,error:i,touched:r,children:o.jsxs("div",{className:"form-check",children:[o.jsx("input",{type:"checkbox",className:"form-check-input",id:e.name,checked:!!t,onChange:s=>n(s.target.checked),onBlur:c}),o.jsx("label",{className:"form-check-label",htmlFor:e.name,children:e.label})]})}),Kq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsx($L,{field:e,error:i,touched:r,children:o.jsx("div",{className:Pt.radioGroup,children:e.options?.map(s=>o.jsxs("div",{className:"form-check",children:[o.jsx("input",{type:"radio",className:"form-check-input",id:`${e.name}-${s.value}`,name:e.name,value:s.value,checked:t===s.value,onChange:d=>n(d.target.value),onBlur:c}),o.jsx("label",{className:"form-check-label",htmlFor:`${e.name}-${s.value}`,children:s.label})]},s.value))})}),kye="_fileInputContainer_r2guc_3",mye="_customFileInput_r2guc_8",fye="_fileInputLabel_r2guc_12",gye="_dragOver_r2guc_39",vye="_uploadIcon_r2guc_44",xye="_uploadText_r2guc_50",Mye="_uploadHint_r2guc_56",_ye="_fileList_r2guc_60",Lye="_fileListTitle_r2guc_69",Iye="_fileItem_r2guc_80",bye="_fileIcon_r2guc_96",wye="_fileName_r2guc_102",Cye="_fileSize_r2guc_108",Nye="_removeButton_r2guc_114",Sye="_errorText_r2guc_129",Pe={fileInputContainer:kye,customFileInput:mye,fileInputLabel:fye,dragOver:gye,uploadIcon:vye,uploadText:xye,uploadHint:Mye,fileList:_ye,fileListTitle:Lye,fileItem:Iye,fileIcon:bye,fileName:wye,fileSize:Cye,removeButton:Nye,errorText:Sye},Zq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=k.useRef(null),[d,l]=k.useState(!1),h=x=>{n(x.target.files)},u=()=>{s.current&&s.current.click()},p=x=>{x.preventDefault(),l(!0)},y=()=>{l(!1)},f=x=>{x.preventDefault(),l(!1),x.dataTransfer.files&&x.dataTransfer.files.length>0&&n(x.dataTransfer.files)},g=x=>{if(!t)return;const M=Array.from(t);M.splice(x,1);const v=new DataTransfer;M.forEach(I=>v.items.add(I)),n(v.files)},m=x=>{if(x===0)return"0 Bytes";const M=1024,v=["Bytes","KB","MB","GB"],I=Math.floor(Math.log(x)/Math.log(M));return parseFloat((x/Math.pow(M,I)).toFixed(2))+" "+v[I]};return o.jsxs("div",{className:`${Pe.fileInputContainer} ${r&&i?Pe.hasError:""}`,children:[o.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,e.required&&o.jsx("span",{className:"text-danger",children:" *"})]}),o.jsx("input",{type:"file",id:e.name,name:e.name,multiple:e.attributes?.multiple||!1,accept:e.attributes?.accept,onChange:h,onBlur:c,ref:s,className:Pe.customFileInput}),o.jsxs("label",{htmlFor:e.name,className:`${Pe.fileInputLabel} ${d?Pe.dragOver:""}`,onDragOver:p,onDragLeave:y,onDrop:f,onClick:u,tabIndex:0,children:[o.jsx("div",{className:Pe.uploadIcon,children:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",fill:"currentColor",viewBox:"0 0 16 16",children:[o.jsx("path",{d:"M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"}),o.jsx("path",{d:"M7.646 1.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 2.707V11.5a.5.5 0 0 1-1 0V2.707L5.354 4.854a.5.5 0 1 1-.708-.708l3-3z"})]})}),o.jsx("div",{className:Pe.uploadText,children:d?"Déposez vos fichiers ici":"Cliquez ou glissez-déposez pour téléverser"}),o.jsxs("div",{className:Pe.uploadHint,children:[e.attributes?.accept||"Tous les fichiers"," ",e.attributes?.multiple?"(Multiple autorisé)":""]})]}),t&&t.length>0&&o.jsxs("div",{className:Pe.fileList,children:[o.jsx("div",{className:Pe.fileListTitle,children:"Fichiers sélectionnés:"}),o.jsx("ul",{children:Array.from(t).map((x,M)=>o.jsxs("li",{className:Pe.fileItem,children:[o.jsx("div",{className:Pe.fileIcon,children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:o.jsx("path",{d:"M4 0h5.293A1 1 0 0 1 10 .293L13.707 4a1 1 0 0 1 .293.707V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm5.5 1.5v2a1 1 0 0 0 1 1h2l-3-3z"})})}),o.jsx("div",{className:Pe.fileName,children:x.name}),o.jsx("div",{className:Pe.fileSize,children:m(x.size)}),o.jsx("button",{type:"button",className:Pe.removeButton,onClick:v=>{v.stopPropagation(),g(M)},"aria-label":`Supprimer ${x.name}`,children:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:[o.jsx("path",{d:"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"}),o.jsx("path",{fillRule:"evenodd",d:"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"})]})})]},M))})]}),r&&i&&o.jsx("div",{className:Pe.errorText,children:i})]})},jye="_container_ecah4_2",$ye="_label_ecah4_6",qye="_requiredIndicator_ecah4_13",Aye="_input_ecah4_18",zye="_inputError_ecah4_49",Vye="_errorMessage_ecah4_58",Wc={container:jye,label:$ye,requiredIndicator:qye,input:Aye,inputError:zye,errorMessage:Vye},Xq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r,labelColor:s="black",backgroundColor:d="white"})=>{const l=e.type==="month"?"month":e.type==="week"?"week":e.type==="time"?"time":e.type==="datetime-local"?"datetime-local":"date";return o.jsxs("div",{className:Wc.container,children:[o.jsxs("label",{htmlFor:e.name,className:Wc.label,style:{color:s},children:[e.label,e.required&&o.jsx("span",{className:Wc.requiredIndicator,children:"*"})]}),o.jsx("input",{type:l,id:e.name,name:e.name,value:t||"",onChange:h=>n(h.target.value),onBlur:c,className:`${Wc.input} ${r&&i?Wc.inputError:""}`,style:{color:s,backgroundColor:d},min:e.validation?.min,max:e.validation?.max,step:e.type==="time"?e.attributes?.step:void 0,disabled:e.disabled}),r&&i&&o.jsx("div",{className:Wc.errorMessage,children:i})]})},Pye="_rangeContainer_cyqk3_3",Tye={rangeContainer:Pye},Yq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsxs("div",{className:`mb-3 ${Tye.rangeContainer}`,children:[o.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,": ",t,e.required&&o.jsx("span",{className:"text-danger",children:" *"})]}),o.jsx("input",{type:"range",id:e.name,name:e.name,value:t||0,onChange:s=>n(s.target.value),onBlur:c,className:`form-range ${r&&i?"is-invalid":""}`,min:e.validation?.min||0,max:e.validation?.max||100,step:e.attributes?.step||1}),r&&i&&o.jsx("div",{className:"invalid-feedback",children:i})]}),Hye="_colorPickerContainer_1wxgj_2",Dye="_colorInput_1wxgj_19",Bye="_colorValue_1wxgj_39",lI={colorPickerContainer:Hye,colorInput:Dye,colorValue:Bye},Jq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsxs("div",{className:"mb-3",children:[o.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,e.required&&o.jsx("span",{className:"text-danger",children:" *"})]}),o.jsxs("div",{className:lI.colorPickerContainer,children:[o.jsx("input",{type:"color",id:e.name,name:e.name,value:t||"#000000",onChange:s=>n(s.target.value),onBlur:c,className:lI.colorInput}),o.jsx("span",{className:lI.colorValue,children:t})]}),r&&i&&o.jsx("div",{className:"invalid-feedback",children:i})]}),Qq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=["date","month","week","time","datetime-local"];if(e.type==="file")return o.jsx(Zq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(s.includes(e.type))return o.jsx(Xq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(e.type==="range")return o.jsx(Yq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(e.type==="color")return o.jsx(Jq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});switch(e.type){case"textarea":return o.jsx(Wq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"select":return o.jsx(nC,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"checkbox":return o.jsx(Gq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"radio":return o.jsx(Kq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});default:return o.jsx(Uq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})}};var hI,UN;function Rye(){if(UN)return hI;UN=1;function e(){this.__data__=[],this.size=0}return hI=e,hI}var uI,WN;function eA(){if(WN)return uI;WN=1;function e(t,n){return t===n||t!==t&&n!==n}return uI=e,uI}var pI,GN;function qL(){if(GN)return pI;GN=1;var e=eA();function t(n,c){for(var i=n.length;i--;)if(e(n[i][0],c))return i;return-1}return pI=t,pI}var yI,KN;function Fye(){if(KN)return yI;KN=1;var e=qL(),t=Array.prototype,n=t.splice;function c(i){var r=this.__data__,s=e(r,i);if(s<0)return!1;var d=r.length-1;return s==d?r.pop():n.call(r,s,1),--this.size,!0}return yI=c,yI}var kI,ZN;function Eye(){if(ZN)return kI;ZN=1;var e=qL();function t(n){var c=this.__data__,i=e(c,n);return i<0?void 0:c[i][1]}return kI=t,kI}var mI,XN;function Oye(){if(XN)return mI;XN=1;var e=qL();function t(n){return e(this.__data__,n)>-1}return mI=t,mI}var fI,YN;function Uye(){if(YN)return fI;YN=1;var e=qL();function t(n,c){var i=this.__data__,r=e(i,n);return r<0?(++this.size,i.push([n,c])):i[r][1]=c,this}return fI=t,fI}var gI,JN;function AL(){if(JN)return gI;JN=1;var e=Rye(),t=Fye(),n=Eye(),c=Oye(),i=Uye();function r(s){var d=-1,l=s==null?0:s.length;for(this.clear();++d<l;){var h=s[d];this.set(h[0],h[1])}}return r.prototype.clear=e,r.prototype.delete=t,r.prototype.get=n,r.prototype.has=c,r.prototype.set=i,gI=r,gI}var vI,QN;function Wye(){if(QN)return vI;QN=1;var e=AL();function t(){this.__data__=new e,this.size=0}return vI=t,vI}var xI,eS;function Gye(){if(eS)return xI;eS=1;function e(t){var n=this.__data__,c=n.delete(t);return this.size=n.size,c}return xI=e,xI}var MI,tS;function Kye(){if(tS)return MI;tS=1;function e(t){return this.__data__.get(t)}return MI=e,MI}var _I,aS;function Zye(){if(aS)return _I;aS=1;function e(t){return this.__data__.has(t)}return _I=e,_I}var LI,nS;function tA(){if(nS)return LI;nS=1;var e=typeof a.commonjsGlobal=="object"&&a.commonjsGlobal&&a.commonjsGlobal.Object===Object&&a.commonjsGlobal;return LI=e,LI}var II,oS;function wt(){if(oS)return II;oS=1;var e=tA(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return II=n,II}var bI,cS;function oC(){if(cS)return bI;cS=1;var e=wt(),t=e.Symbol;return bI=t,bI}var wI,iS;function Xye(){if(iS)return wI;iS=1;var e=oC(),t=Object.prototype,n=t.hasOwnProperty,c=t.toString,i=e?e.toStringTag:void 0;function r(s){var d=n.call(s,i),l=s[i];try{s[i]=void 0;var h=!0}catch{}var u=c.call(s);return h&&(d?s[i]=l:delete s[i]),u}return wI=r,wI}var CI,rS;function Yye(){if(rS)return CI;rS=1;var e=Object.prototype,t=e.toString;function n(c){return t.call(c)}return CI=n,CI}var NI,sS;function zL(){if(sS)return NI;sS=1;var e=oC(),t=Xye(),n=Yye(),c="[object Null]",i="[object Undefined]",r=e?e.toStringTag:void 0;function s(d){return d==null?d===void 0?i:c:r&&r in Object(d)?t(d):n(d)}return NI=s,NI}var SI,dS;function aA(){if(dS)return SI;dS=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return SI=e,SI}var jI,lS;function nA(){if(lS)return jI;lS=1;var e=zL(),t=aA(),n="[object AsyncFunction]",c="[object Function]",i="[object GeneratorFunction]",r="[object Proxy]";function s(d){if(!t(d))return!1;var l=e(d);return l==c||l==i||l==n||l==r}return jI=s,jI}var $I,hS;function Jye(){if(hS)return $I;hS=1;var e=wt(),t=e["__core-js_shared__"];return $I=t,$I}var qI,uS;function Qye(){if(uS)return qI;uS=1;var e=Jye(),t=function(){var c=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""}();function n(c){return!!t&&t in c}return qI=n,qI}var AI,pS;function oA(){if(pS)return AI;pS=1;var e=Function.prototype,t=e.toString;function n(c){if(c!=null){try{return t.call(c)}catch{}try{return c+""}catch{}}return""}return AI=n,AI}var zI,yS;function e4e(){if(yS)return zI;yS=1;var e=nA(),t=Qye(),n=aA(),c=oA(),i=/[\\^$.*+?()[\]{}|]/g,r=/^\[object .+?Constructor\]$/,s=Function.prototype,d=Object.prototype,l=s.toString,h=d.hasOwnProperty,u=RegExp("^"+l.call(h).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(y){if(!n(y)||t(y))return!1;var f=e(y)?u:r;return f.test(c(y))}return zI=p,zI}var VI,kS;function t4e(){if(kS)return VI;kS=1;function e(t,n){return t?.[n]}return VI=e,VI}var PI,mS;function h1(){if(mS)return PI;mS=1;var e=e4e(),t=t4e();function n(c,i){var r=t(c,i);return e(r)?r:void 0}return PI=n,PI}var TI,fS;function cC(){if(fS)return TI;fS=1;var e=h1(),t=wt(),n=e(t,"Map");return TI=n,TI}var HI,gS;function VL(){if(gS)return HI;gS=1;var e=h1(),t=e(Object,"create");return HI=t,HI}var DI,vS;function a4e(){if(vS)return DI;vS=1;var e=VL();function t(){this.__data__=e?e(null):{},this.size=0}return DI=t,DI}var BI,xS;function n4e(){if(xS)return BI;xS=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return BI=e,BI}var RI,MS;function o4e(){if(MS)return RI;MS=1;var e=VL(),t="__lodash_hash_undefined__",n=Object.prototype,c=n.hasOwnProperty;function i(r){var s=this.__data__;if(e){var d=s[r];return d===t?void 0:d}return c.call(s,r)?s[r]:void 0}return RI=i,RI}var FI,_S;function c4e(){if(_S)return FI;_S=1;var e=VL(),t=Object.prototype,n=t.hasOwnProperty;function c(i){var r=this.__data__;return e?r[i]!==void 0:n.call(r,i)}return FI=c,FI}var EI,LS;function i4e(){if(LS)return EI;LS=1;var e=VL(),t="__lodash_hash_undefined__";function n(c,i){var r=this.__data__;return this.size+=this.has(c)?0:1,r[c]=e&&i===void 0?t:i,this}return EI=n,EI}var OI,IS;function r4e(){if(IS)return OI;IS=1;var e=a4e(),t=n4e(),n=o4e(),c=c4e(),i=i4e();function r(s){var d=-1,l=s==null?0:s.length;for(this.clear();++d<l;){var h=s[d];this.set(h[0],h[1])}}return r.prototype.clear=e,r.prototype.delete=t,r.prototype.get=n,r.prototype.has=c,r.prototype.set=i,OI=r,OI}var UI,bS;function s4e(){if(bS)return UI;bS=1;var e=r4e(),t=AL(),n=cC();function c(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return UI=c,UI}var WI,wS;function d4e(){if(wS)return WI;wS=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return WI=e,WI}var GI,CS;function PL(){if(CS)return GI;CS=1;var e=d4e();function t(n,c){var i=n.__data__;return e(c)?i[typeof c=="string"?"string":"hash"]:i.map}return GI=t,GI}var KI,NS;function l4e(){if(NS)return KI;NS=1;var e=PL();function t(n){var c=e(this,n).delete(n);return this.size-=c?1:0,c}return KI=t,KI}var ZI,SS;function h4e(){if(SS)return ZI;SS=1;var e=PL();function t(n){return e(this,n).get(n)}return ZI=t,ZI}var XI,jS;function u4e(){if(jS)return XI;jS=1;var e=PL();function t(n){return e(this,n).has(n)}return XI=t,XI}var YI,$S;function p4e(){if($S)return YI;$S=1;var e=PL();function t(n,c){var i=e(this,n),r=i.size;return i.set(n,c),this.size+=i.size==r?0:1,this}return YI=t,YI}var JI,qS;function cA(){if(qS)return JI;qS=1;var e=s4e(),t=l4e(),n=h4e(),c=u4e(),i=p4e();function r(s){var d=-1,l=s==null?0:s.length;for(this.clear();++d<l;){var h=s[d];this.set(h[0],h[1])}}return r.prototype.clear=e,r.prototype.delete=t,r.prototype.get=n,r.prototype.has=c,r.prototype.set=i,JI=r,JI}var QI,AS;function y4e(){if(AS)return QI;AS=1;var e=AL(),t=cC(),n=cA(),c=200;function i(r,s){var d=this.__data__;if(d instanceof e){var l=d.__data__;if(!t||l.length<c-1)return l.push([r,s]),this.size=++d.size,this;d=this.__data__=new n(l)}return d.set(r,s),this.size=d.size,this}return QI=i,QI}var eb,zS;function k4e(){if(zS)return eb;zS=1;var e=AL(),t=Wye(),n=Gye(),c=Kye(),i=Zye(),r=y4e();function s(d){var l=this.__data__=new e(d);this.size=l.size}return s.prototype.clear=t,s.prototype.delete=n,s.prototype.get=c,s.prototype.has=i,s.prototype.set=r,eb=s,eb}var tb,VS;function m4e(){if(VS)return tb;VS=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return tb=t,tb}var ab,PS;function f4e(){if(PS)return ab;PS=1;function e(t){return this.__data__.has(t)}return ab=e,ab}var nb,TS;function g4e(){if(TS)return nb;TS=1;var e=cA(),t=m4e(),n=f4e();function c(i){var r=-1,s=i==null?0:i.length;for(this.__data__=new e;++r<s;)this.add(i[r])}return c.prototype.add=c.prototype.push=t,c.prototype.has=n,nb=c,nb}var ob,HS;function v4e(){if(HS)return ob;HS=1;function e(t,n){for(var c=-1,i=t==null?0:t.length;++c<i;)if(n(t[c],c,t))return!0;return!1}return ob=e,ob}var cb,DS;function x4e(){if(DS)return cb;DS=1;function e(t,n){return t.has(n)}return cb=e,cb}var ib,BS;function iA(){if(BS)return ib;BS=1;var e=g4e(),t=v4e(),n=x4e(),c=1,i=2;function r(s,d,l,h,u,p){var y=l&c,f=s.length,g=d.length;if(f!=g&&!(y&&g>f))return!1;var m=p.get(s),x=p.get(d);if(m&&x)return m==d&&x==s;var M=-1,v=!0,I=l&i?new e:void 0;for(p.set(s,d),p.set(d,s);++M<f;){var b=s[M],w=d[M];if(h)var C=y?h(w,b,M,d,s,p):h(b,w,M,s,d,p);if(C!==void 0){if(C)continue;v=!1;break}if(I){if(!t(d,function(_,L){if(!n(I,L)&&(b===_||u(b,_,l,h,p)))return I.push(L)})){v=!1;break}}else if(!(b===w||u(b,w,l,h,p))){v=!1;break}}return p.delete(s),p.delete(d),v}return ib=r,ib}var rb,RS;function M4e(){if(RS)return rb;RS=1;var e=wt(),t=e.Uint8Array;return rb=t,rb}var sb,FS;function _4e(){if(FS)return sb;FS=1;function e(t){var n=-1,c=Array(t.size);return t.forEach(function(i,r){c[++n]=[r,i]}),c}return sb=e,sb}var db,ES;function L4e(){if(ES)return db;ES=1;function e(t){var n=-1,c=Array(t.size);return t.forEach(function(i){c[++n]=i}),c}return db=e,db}var lb,OS;function I4e(){if(OS)return lb;OS=1;var e=oC(),t=M4e(),n=eA(),c=iA(),i=_4e(),r=L4e(),s=1,d=2,l="[object Boolean]",h="[object Date]",u="[object Error]",p="[object Map]",y="[object Number]",f="[object RegExp]",g="[object Set]",m="[object String]",x="[object Symbol]",M="[object ArrayBuffer]",v="[object DataView]",I=e?e.prototype:void 0,b=I?I.valueOf:void 0;function w(C,_,L,S,N,j,q){switch(L){case v:if(C.byteLength!=_.byteLength||C.byteOffset!=_.byteOffset)return!1;C=C.buffer,_=_.buffer;case M:return!(C.byteLength!=_.byteLength||!j(new t(C),new t(_)));case l:case h:case y:return n(+C,+_);case u:return C.name==_.name&&C.message==_.message;case f:case m:return C==_+"";case p:var H=i;case g:var B=S&s;if(H||(H=r),C.size!=_.size&&!B)return!1;var A=q.get(C);if(A)return A==_;S|=d,q.set(C,_);var z=c(H(C),H(_),S,N,j,q);return q.delete(C),z;case x:if(b)return b.call(C)==b.call(_)}return!1}return lb=w,lb}var hb,US;function b4e(){if(US)return hb;US=1;function e(t,n){for(var c=-1,i=n.length,r=t.length;++c<i;)t[r+c]=n[c];return t}return hb=e,hb}var ub,WS;function iC(){if(WS)return ub;WS=1;var e=Array.isArray;return ub=e,ub}var pb,GS;function w4e(){if(GS)return pb;GS=1;var e=b4e(),t=iC();function n(c,i,r){var s=i(c);return t(c)?s:e(s,r(c))}return pb=n,pb}var yb,KS;function C4e(){if(KS)return yb;KS=1;function e(t,n){for(var c=-1,i=t==null?0:t.length,r=0,s=[];++c<i;){var d=t[c];n(d,c,t)&&(s[r++]=d)}return s}return yb=e,yb}var kb,ZS;function N4e(){if(ZS)return kb;ZS=1;function e(){return[]}return kb=e,kb}var mb,XS;function S4e(){if(XS)return mb;XS=1;var e=C4e(),t=N4e(),n=Object.prototype,c=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,r=i?function(s){return s==null?[]:(s=Object(s),e(i(s),function(d){return c.call(s,d)}))}:t;return mb=r,mb}var fb,YS;function j4e(){if(YS)return fb;YS=1;function e(t,n){for(var c=-1,i=Array(t);++c<t;)i[c]=n(c);return i}return fb=e,fb}var gb,JS;function TL(){if(JS)return gb;JS=1;function e(t){return t!=null&&typeof t=="object"}return gb=e,gb}var vb,QS;function $4e(){if(QS)return vb;QS=1;var e=zL(),t=TL(),n="[object Arguments]";function c(i){return t(i)&&e(i)==n}return vb=c,vb}var xb,ej;function q4e(){if(ej)return xb;ej=1;var e=$4e(),t=TL(),n=Object.prototype,c=n.hasOwnProperty,i=n.propertyIsEnumerable,r=e(function(){return arguments}())?e:function(s){return t(s)&&c.call(s,"callee")&&!i.call(s,"callee")};return xb=r,xb}var M1={exports:{}},Mb,tj;function A4e(){if(tj)return Mb;tj=1;function e(){return!1}return Mb=e,Mb}M1.exports;var aj;function rA(){return aj||(aj=1,function(e,t){var n=wt(),c=A4e(),i=t&&!t.nodeType&&t,r=i&&!0&&e&&!e.nodeType&&e,s=r&&r.exports===i,d=s?n.Buffer:void 0,l=d?d.isBuffer:void 0,h=l||c;e.exports=h}(M1,M1.exports)),M1.exports}var _b,nj;function z4e(){if(nj)return _b;nj=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(c,i){var r=typeof c;return i=i??e,!!i&&(r=="number"||r!="symbol"&&t.test(c))&&c>-1&&c%1==0&&c<i}return _b=n,_b}var Lb,oj;function sA(){if(oj)return Lb;oj=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return Lb=t,Lb}var Ib,cj;function V4e(){if(cj)return Ib;cj=1;var e=zL(),t=sA(),n=TL(),c="[object Arguments]",i="[object Array]",r="[object Boolean]",s="[object Date]",d="[object Error]",l="[object Function]",h="[object Map]",u="[object Number]",p="[object Object]",y="[object RegExp]",f="[object Set]",g="[object String]",m="[object WeakMap]",x="[object ArrayBuffer]",M="[object DataView]",v="[object Float32Array]",I="[object Float64Array]",b="[object Int8Array]",w="[object Int16Array]",C="[object Int32Array]",_="[object Uint8Array]",L="[object Uint8ClampedArray]",S="[object Uint16Array]",N="[object Uint32Array]",j={};j[v]=j[I]=j[b]=j[w]=j[C]=j[_]=j[L]=j[S]=j[N]=!0,j[c]=j[i]=j[x]=j[r]=j[M]=j[s]=j[d]=j[l]=j[h]=j[u]=j[p]=j[y]=j[f]=j[g]=j[m]=!1;function q(H){return n(H)&&t(H.length)&&!!j[e(H)]}return Ib=q,Ib}var bb,ij;function P4e(){if(ij)return bb;ij=1;function e(t){return function(n){return t(n)}}return bb=e,bb}var _1={exports:{}};_1.exports;var rj;function T4e(){return rj||(rj=1,function(e,t){var n=tA(),c=t&&!t.nodeType&&t,i=c&&!0&&e&&!e.nodeType&&e,r=i&&i.exports===c,s=r&&n.process,d=function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();e.exports=d}(_1,_1.exports)),_1.exports}var wb,sj;function dA(){if(sj)return wb;sj=1;var e=V4e(),t=P4e(),n=T4e(),c=n&&n.isTypedArray,i=c?t(c):e;return wb=i,wb}var Cb,dj;function H4e(){if(dj)return Cb;dj=1;var e=j4e(),t=q4e(),n=iC(),c=rA(),i=z4e(),r=dA(),s=Object.prototype,d=s.hasOwnProperty;function l(h,u){var p=n(h),y=!p&&t(h),f=!p&&!y&&c(h),g=!p&&!y&&!f&&r(h),m=p||y||f||g,x=m?e(h.length,String):[],M=x.length;for(var v in h)(u||d.call(h,v))&&!(m&&(v=="length"||f&&(v=="offset"||v=="parent")||g&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||i(v,M)))&&x.push(v);return x}return Cb=l,Cb}var Nb,lj;function D4e(){if(lj)return Nb;lj=1;var e=Object.prototype;function t(n){var c=n&&n.constructor,i=typeof c=="function"&&c.prototype||e;return n===i}return Nb=t,Nb}var Sb,hj;function B4e(){if(hj)return Sb;hj=1;function e(t,n){return function(c){return t(n(c))}}return Sb=e,Sb}var jb,uj;function R4e(){if(uj)return jb;uj=1;var e=B4e(),t=e(Object.keys,Object);return jb=t,jb}var $b,pj;function F4e(){if(pj)return $b;pj=1;var e=D4e(),t=R4e(),n=Object.prototype,c=n.hasOwnProperty;function i(r){if(!e(r))return t(r);var s=[];for(var d in Object(r))c.call(r,d)&&d!="constructor"&&s.push(d);return s}return $b=i,$b}var qb,yj;function E4e(){if(yj)return qb;yj=1;var e=nA(),t=sA();function n(c){return c!=null&&t(c.length)&&!e(c)}return qb=n,qb}var Ab,kj;function O4e(){if(kj)return Ab;kj=1;var e=H4e(),t=F4e(),n=E4e();function c(i){return n(i)?e(i):t(i)}return Ab=c,Ab}var zb,mj;function U4e(){if(mj)return zb;mj=1;var e=w4e(),t=S4e(),n=O4e();function c(i){return e(i,n,t)}return zb=c,zb}var Vb,fj;function W4e(){if(fj)return Vb;fj=1;var e=U4e(),t=1,n=Object.prototype,c=n.hasOwnProperty;function i(r,s,d,l,h,u){var p=d&t,y=e(r),f=y.length,g=e(s),m=g.length;if(f!=m&&!p)return!1;for(var x=f;x--;){var M=y[x];if(!(p?M in s:c.call(s,M)))return!1}var v=u.get(r),I=u.get(s);if(v&&I)return v==s&&I==r;var b=!0;u.set(r,s),u.set(s,r);for(var w=p;++x<f;){M=y[x];var C=r[M],_=s[M];if(l)var L=p?l(_,C,M,s,r,u):l(C,_,M,r,s,u);if(!(L===void 0?C===_||h(C,_,d,l,u):L)){b=!1;break}w||(w=M=="constructor")}if(b&&!w){var S=r.constructor,N=s.constructor;S!=N&&"constructor"in r&&"constructor"in s&&!(typeof S=="function"&&S instanceof S&&typeof N=="function"&&N instanceof N)&&(b=!1)}return u.delete(r),u.delete(s),b}return Vb=i,Vb}var Pb,gj;function G4e(){if(gj)return Pb;gj=1;var e=h1(),t=wt(),n=e(t,"DataView");return Pb=n,Pb}var Tb,vj;function K4e(){if(vj)return Tb;vj=1;var e=h1(),t=wt(),n=e(t,"Promise");return Tb=n,Tb}var Hb,xj;function Z4e(){if(xj)return Hb;xj=1;var e=h1(),t=wt(),n=e(t,"Set");return Hb=n,Hb}var Db,Mj;function X4e(){if(Mj)return Db;Mj=1;var e=h1(),t=wt(),n=e(t,"WeakMap");return Db=n,Db}var Bb,_j;function Y4e(){if(_j)return Bb;_j=1;var e=G4e(),t=cC(),n=K4e(),c=Z4e(),i=X4e(),r=zL(),s=oA(),d="[object Map]",l="[object Object]",h="[object Promise]",u="[object Set]",p="[object WeakMap]",y="[object DataView]",f=s(e),g=s(t),m=s(n),x=s(c),M=s(i),v=r;return(e&&v(new e(new ArrayBuffer(1)))!=y||t&&v(new t)!=d||n&&v(n.resolve())!=h||c&&v(new c)!=u||i&&v(new i)!=p)&&(v=function(I){var b=r(I),w=b==l?I.constructor:void 0,C=w?s(w):"";if(C)switch(C){case f:return y;case g:return d;case m:return h;case x:return u;case M:return p}return b}),Bb=v,Bb}var Rb,Lj;function J4e(){if(Lj)return Rb;Lj=1;var e=k4e(),t=iA(),n=I4e(),c=W4e(),i=Y4e(),r=iC(),s=rA(),d=dA(),l=1,h="[object Arguments]",u="[object Array]",p="[object Object]",y=Object.prototype,f=y.hasOwnProperty;function g(m,x,M,v,I,b){var w=r(m),C=r(x),_=w?u:i(m),L=C?u:i(x);_=_==h?p:_,L=L==h?p:L;var S=_==p,N=L==p,j=_==L;if(j&&s(m)){if(!s(x))return!1;w=!0,S=!1}if(j&&!S)return b||(b=new e),w||d(m)?t(m,x,M,v,I,b):n(m,x,_,M,v,I,b);if(!(M&l)){var q=S&&f.call(m,"__wrapped__"),H=N&&f.call(x,"__wrapped__");if(q||H){var B=q?m.value():m,A=H?x.value():x;return b||(b=new e),I(B,A,M,v,b)}}return j?(b||(b=new e),c(m,x,M,v,I,b)):!1}return Rb=g,Rb}var Fb,Ij;function Q4e(){if(Ij)return Fb;Ij=1;var e=J4e(),t=TL();function n(c,i,r,s,d){return c===i?!0:c==null||i==null||!t(c)&&!t(i)?c!==c&&i!==i:e(c,i,r,s,n,d)}return Fb=n,Fb}var Eb,bj;function e5e(){if(bj)return Eb;bj=1;var e=Q4e();function t(n,c){return e(n,c)}return Eb=t,Eb}var t5e=e5e();const a5e=a.getDefaultExportFromCjs(t5e),n5e=({schema:e,initialData:t={},onSubmit:n,submitLabel:c,submitIcon:i,submitIconPosition:r="left",onCancel:s,cancelLabel:d="Retour",cancelIcon:l})=>{const[h,u]=k.useState(t),[p,y]=k.useState({}),[f,g]=k.useState({}),[m,x]=k.useState(!1),M=k.useRef(t);k.useEffect(()=>{a5e(M.current,t)||(u(t),M.current=t)},[t]);const v=(L,S)=>{const N={...h,[L]:S};if(u(N),f[L]){const j=e.fields.find(q=>q.name===L);if(j){const q=LL(S,j);y(H=>({...H,[L]:q.isValid?"":q.error}))}}},I=L=>{if(!f[L]){g(N=>({...N,[L]:!0}));const S=e.fields.find(N=>N.name===L);if(S){const N=LL(h[L],S);y(j=>({...j,[L]:N.isValid?"":N.error}))}}},b=async L=>{L.preventDefault(),x(!0);const S=e.fields.reduce((j,q)=>(q.type!=="section"&&(j[q.name]=!0),j),{});g(S);const N=Oq(h,e.fields.filter(j=>j.type!=="section"));if(y(N.errors),N.isValid)try{await n(h)}catch(j){console.error("Erreur lors de la soumission:",j),y(q=>({...q,__global:"Une erreur est survenue lors de la soumission"}))}x(!1)},w=l?_t[l]:null,C=i&&_t[i]||e.submitIcon&&_t[e.submitIcon]||null,_=e.columns&&e.columns>0?Math.floor(e.columns):12;return o.jsxs("div",{className:me.formContainer,children:[o.jsx("div",{className:me.headerLine,children:o.jsx("h2",{className:me.formTitle,children:e.title})}),e.description&&o.jsx("p",{className:me.formDescription,children:e.description}),p.__global&&o.jsx("div",{className:`alert alert-danger ${me.globalError}`,children:p.__global}),o.jsxs("form",{onSubmit:b,children:[o.jsx("div",{className:me.gridContainer,style:{gridTemplateColumns:`repeat(${_}, minmax(0, 1fr))`},children:e.fields.map(L=>{if(L.type==="section")return o.jsxs("div",{className:me.sectionFull,children:[o.jsx("h5",{className:me.sectionTitle,children:L.label}),L.help&&o.jsx("p",{className:me.sectionHelp,children:L.help})]},L.name);const N={gridColumn:`span ${Math.max(1,Math.min(_,L.gridCol??_))}`};return o.jsxs("div",{className:me.fieldGridItem,style:N,children:[o.jsx(Qq,{field:L,value:h[L.name],onChange:j=>v(L.name,j),onBlur:()=>I(L.name),error:p[L.name],touched:f[L.name]}),L.help&&o.jsx("small",{className:me.fieldHelp,children:L.help})]},L.name)})}),o.jsxs("div",{className:me.formFooter,children:[o.jsx("div",{className:me.footerLeft,children:s&&o.jsxs("button",{type:"button",className:me.cancelLink,onClick:s,children:[w&&o.jsx(w,{size:16,className:"me-2"})," ",d]})}),o.jsx("div",{className:me.footerRight,children:o.jsx(uL,{type:"submit",variant:"primary",size:"md",className:me.submitButton,disabled:m,children:m?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"spinner-border spinner-border-sm me-2",role:"status"}),"Validation..."]}):o.jsxs(o.Fragment,{children:[C&&(r==="left"||e.submitIconPosition==="left")&&o.jsx(C,{size:16,className:"me-2"}),c||e.submitText||"Valider",C&&(r==="right"||e.submitIconPosition==="right")&&o.jsx(C,{size:16,className:"ms-2"})]})})})]})]})]})};function o5e(e){return{title:e._formTitle||"Formulaire",description:e._formDescription,fields:e._fieldMetadata||[],submitText:e._submitText||"Valider"}}const wj=new Map,vw=({path:e,style:t,width:n=24,height:c=24,keepColors:i=!1,onClick:r})=>{const s=/^https?:\/\//.test(e),[d,l]=k.useState("");if(k.useEffect(()=>{if(s)return;e&&(async()=>{try{let u=wj.get(e);u||(u=fetch(e).then(m=>{if(!m.ok)throw new Error(`Failed to load ${e}`);return m.text()}),wj.set(e,u));let p=await u;const y=t?.width||`${n}px`,f=t?.height||`${c}px`;i||(p=p.replace(/fill="[^"]*"/g,'fill="currentColor"'),p=p.replace(/fill='[^']*'/g,"fill='currentColor'"));const g=i?`width="${y}" height="${f}"`:`width="${y}" height="${f}" fill="currentColor"`;p=p.replace(/<svg/,`<svg ${g}`),l(p)}catch(u){console.error(`Failed to load icon: ${e}`,u)}})()},[e,s,t?.width,t?.height,n,c]),s){const h=t?.width||`${n}px`,u=t?.height||`${c}px`;return o.jsx("span",{onClick:r,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",color:t?.color||"inherit",...t},children:o.jsx("img",{src:e,alt:"",style:{display:"block",width:h,height:u}})})}return d?o.jsx("span",{onClick:r,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",color:t?.color||"inherit",...t},dangerouslySetInnerHTML:{__html:d}}):null},c5e="_container_1gljv_85",i5e="_tableWrapper_1gljv_111",r5e="_tableControls_1gljv_117",s5e="_controlsRight_1gljv_128",d5e="_limitedRows_1gljv_151",l5e="_table_1gljv_111",h5e="_headerCell_1gljv_206",u5e="_headerContent_1gljv_220",p5e="_headerWords_1gljv_229",y5e="_headerWord_1gljv_229",k5e="_cellContent_1gljv_276",m5e="_alignLeft_1gljv_286",f5e="_alignCenter_1gljv_290",g5e="_alignRight_1gljv_294",v5e="_tableCell_1gljv_298",x5e="_tableRow_1gljv_308",M5e="_emptyRow_1gljv_385",_5e="_toggleFiltersButton_1gljv_393",L5e="_toggleSortButton_1gljv_394",I5e="_buttonTextCompact_1gljv_415",b5e="_uppercaseSmall_1gljv_450",w5e="_filtersPanel_1gljv_463",C5e="_filtersPanelInline_1gljv_481",N5e="_filtersPanelHorizontal_1gljv_492",S5e="_filtersRow_1gljv_492",j5e="_filtersActionsHorizontal_1gljv_525",$5e="_filterItemInline_1gljv_542",q5e="_filterLabel_1gljv_571",A5e="_filterInput_1gljv_576",z5e="_filterSelect_1gljv_577",V5e="_operatorSelect_1gljv_578",P5e="_operatorInput_1gljv_579",T5e="_activeFilterTag_1gljv_597",H5e="_actionsGroup_1gljv_609",D5e="_applyButton_1gljv_615",B5e="_cancelButton_1gljv_625",R5e="_columnSorterContainer_1gljv_649",F5e="_sorterControls_1gljv_654",E5e="_sortDropdownWrapper_1gljv_659",O5e="_sortDropdown_1gljv_659",U5e="_sortDropdownHeader_1gljv_679",W5e="_closeButton_1gljv_688",G5e="_sortDropdownContent_1gljv_703",K5e="_sortDropdownItem_1gljv_709",Z5e="_sortDirectionButtons_1gljv_734",X5e="_sortDirectionButton_1gljv_734",Y5e="_activeSort_1gljv_757",J5e="_sortActions_1gljv_764",Q5e="_paginationButton_1gljv_842",eke="_pageSizeSelect_1gljv_844",tke="_topPagination_1gljv_853",ake="_paginationContainer_1gljv_861",nke="_leftGroup_1gljv_874",oke="_pageSizeControls_1gljv_882",cke="_paginationInfo_1gljv_908",ike="_paginationControls_1gljv_916",rke="_disabledButton_1gljv_947",ske="_activeButton_1gljv_952",dke="_navigationButton_1gljv_962",lke="_operatorFilterContainer_1gljv_1010",hke="_rangeSeparator_1gljv_1016",uke="_activeFiltersSection_1gljv_1179",pke="_activeFiltersRow_1gljv_1184",yke="_activeFiltersList_1gljv_1192",kke="_clearAllButton_1gljv_1200",mke="_removeFilterButton_1gljv_1221",fke="_sortIndicator_1gljv_1272",gke="_active_1gljv_349",vke="_clearSortButton_1gljv_1371",xke="_loaderSpinner_1gljv_2743",Mke="_loaderSpinnerSmall_1gljv_2755",_ke="_paginationLoading_1gljv_2772",Lke="_loadingButton_1gljv_2780",Ike="_loadingIndicator_1gljv_2791",T={container:c5e,tableWrapper:i5e,tableControls:r5e,controlsRight:s5e,limitedRows:d5e,table:l5e,headerCell:h5e,headerContent:u5e,headerWords:p5e,headerWord:y5e,cellContent:k5e,alignLeft:m5e,alignCenter:f5e,alignRight:g5e,tableCell:v5e,tableRow:x5e,emptyRow:M5e,toggleFiltersButton:_5e,toggleSortButton:L5e,buttonTextCompact:I5e,uppercaseSmall:b5e,filtersPanel:w5e,filtersPanelInline:C5e,filtersPanelHorizontal:N5e,filtersRow:S5e,filtersActionsHorizontal:j5e,filterItemInline:$5e,filterLabel:q5e,filterInput:A5e,filterSelect:z5e,operatorSelect:V5e,operatorInput:P5e,activeFilterTag:T5e,actionsGroup:H5e,applyButton:D5e,cancelButton:B5e,columnSorterContainer:R5e,sorterControls:F5e,sortDropdownWrapper:E5e,sortDropdown:O5e,sortDropdownHeader:U5e,closeButton:W5e,sortDropdownContent:G5e,sortDropdownItem:K5e,sortDirectionButtons:Z5e,sortDirectionButton:X5e,activeSort:Y5e,sortActions:J5e,paginationButton:Q5e,pageSizeSelect:eke,topPagination:tke,paginationContainer:ake,leftGroup:nke,pageSizeControls:oke,paginationInfo:cke,paginationControls:ike,disabledButton:rke,activeButton:ske,navigationButton:dke,operatorFilterContainer:lke,rangeSeparator:hke,activeFiltersSection:uke,activeFiltersRow:pke,activeFiltersList:yke,clearAllButton:kke,removeFilterButton:mke,sortIndicator:fke,active:gke,clearSortButton:vke,loaderSpinner:xke,loaderSpinnerSmall:Mke,paginationLoading:_ke,loadingButton:Lke,loadingIndicator:Ike},bke=({config:e,value:t,onChange:n,disabled:c})=>o.jsxs("select",{value:t===""?"":String(t),onChange:i=>n(i.target.value===""?"":i.target.value==="true"),disabled:c,className:T.filterSelect,children:[o.jsx("option",{value:"",children:`Filtrer ${e.label}...`}),o.jsx("option",{value:"true",children:"Oui"}),o.jsx("option",{value:"false",children:"Non"})]}),wke=({config:e,value:t,onChange:n,disabled:c})=>o.jsx("input",{type:"date",value:t||"",onChange:i=>n(i.target.value),placeholder:`Filtrer ${e.label}...`,disabled:c,className:T.filterInput}),Cke=({config:e,value:t,onChange:n,disabled:c})=>{const[i,r]=k.useState([]);k.useEffect(()=>{(async()=>{if(e.asyncOptions)try{const l=await e.asyncOptions();r(l??[])}catch(l){console.error("Erreur chargement options MultiSelect:",l),r([])}else r(e.options??[])})()},[e]);const s=d=>{const l=Array.from(d.target.selectedOptions,h=>h.value);n(l)};return o.jsx("select",{multiple:!0,value:t.map(String),onChange:s,disabled:c,className:T.filterMultiSelect,children:i.map((d,l)=>o.jsx("option",{value:String(d.value),children:d.label},l))})},Cj=({config:e,value:t,onChange:n,disabled:c})=>{const[i,r]=k.useState(t||""),s=d=>{const l=d.target.value===""?"":Number(d.target.value);r(l),n(l)};return o.jsx("input",{type:"number",value:i,onChange:s,placeholder:e.placeholder||`Filtrer ${e.label}...`,disabled:c,className:T.filterInput})},Nke=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=k.useState([]),[s,d]=k.useState(!1);k.useEffect(()=>{(async()=>{if(e.asyncOptions){d(!0);try{const u=await e.asyncOptions();r(u)}catch(u){console.error("Error loading options:",u)}finally{d(!1)}}else r(e.options||[])})()},[e]);const l=h=>{const u=h.target.value;n(u)};return s?o.jsx("div",{children:"Chargement..."}):o.jsxs("select",{value:String(t||""),onChange:l,disabled:c,className:T.filterInput,children:[o.jsx("option",{value:"",children:"Select..."}),i.map(h=>o.jsx("option",{value:h.value,children:h.label},h.value))]})},Ske=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=k.useState("");k.useEffect(()=>{r(typeof t=="string"?t:String(t||""))},[t]);const s=d=>{const l=d.target.value;r(l),n(l)};return o.jsx("input",{type:"text",value:i,onChange:s,placeholder:e.placeholder||`Filtrer ${e.label}...`,disabled:c,className:T.filterInput})},jke=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=k.useState(t?.operator||""),[s,d]=k.useState(t?.value||"");k.useEffect(()=>{i&&s&&n({operator:i,value:s})},[i,s,n]);const l=u=>{r(u.target.value)},h=u=>{d(u.target.value)};return o.jsxs("div",{className:T.operatorFilterContainer,children:[o.jsxs("select",{value:i,onChange:l,disabled:c,className:T.operatorSelect,children:[o.jsx("option",{value:"",children:"Sélectionner un opérateur"}),e.operators.map(u=>o.jsx("option",{value:String(u.value),children:u.label},String(u.value)))]}),o.jsx("input",{type:"text",value:s,onChange:h,placeholder:"Valeur",disabled:c||!i,className:T.operatorInput})]})},$ke=({value:e,onChange:t,disabled:n})=>{const c=e||{},i=s=>{t({...c,start:s.target.value})},r=s=>{t({...c,end:s.target.value})};return o.jsxs("div",{className:T.dateRangeContainer,children:[o.jsx("input",{type:"date",value:c.start||"",onChange:i,disabled:n,className:T.filterInput}),o.jsx("span",{className:T.rangeSeparator,children:"→"}),o.jsx("input",{type:"date",value:c.end||"",onChange:r,disabled:n,className:T.filterInput})]})},qke=({config:e,value:t,onChange:n,disabled:c})=>{switch(e.type){case"text":case"search":return o.jsx(Ske,{config:e,value:t,onChange:n,disabled:c});case"number":return o.jsx(Cj,{config:e,value:t,onChange:n,disabled:c});case"range":return o.jsx(Cj,{config:e,value:t,onChange:n,disabled:c});case"select":return o.jsx(Nke,{config:e,value:t,onChange:n,disabled:c});case"operator":return o.jsx(jke,{config:e,value:t,onChange:n,disabled:c});case"multiselect":return o.jsx(Cke,{config:e,value:t,onChange:n,disabled:c});case"date":return o.jsx(wke,{config:e,value:t,onChange:n,disabled:c});case"daterange":return o.jsx($ke,{config:e,value:t??{start:"",end:""},onChange:n,disabled:c});case"boolean":return o.jsx(bke,{config:e,value:t,onChange:n,disabled:c});default:return o.jsxs("div",{children:["Type de filtre non supporté: ",e.type]})}},lA=({filters:e,externalFilters:t=[],onFiltersChange:n,onApply:c,isControlled:i=!1})=>{const[r,s]=k.useState([]),[d,l]=k.useState(()=>{const g={};return e.forEach(m=>{m.type==="daterange"?g[m.id]={start:"",end:""}:g[m.id]=m.defaultValue??""}),g});k.useEffect(()=>{if(!i)return;const g={...d??{}};e.forEach(m=>{m.id in g||(g[m.id]=m.type==="daterange"?{start:"",end:""}:m.defaultValue??"")}),(t||[]).forEach(m=>{!m||!m.id||(g[m.id]=m.value)}),l(g),s(t??[])},[i,JSON.stringify(t||[]),JSON.stringify(e.map(g=>g.id))]);const h=i?t:r,u=k.useCallback((g,m)=>{l(x=>({...x,[g]:m}))},[]),p=k.useCallback(async()=>{const g=[],m={...d};for(const[x,M]of Object.entries(m)){const v=e.find(w=>w.id===x);if(!v)continue;let I=M;try{typeof M=="function"&&(I=await M(m)),typeof v.executeOnApply=="function"&&(I=await v.executeOnApply(I,m))}catch{continue}if(v.type==="daterange"){const w=I?.start??"",C=I?.end??"",_=typeof w=="string"?w.trim()==="":!w,L=typeof C=="string"?C.trim()==="":!C;if(_&&L)continue}I==null||typeof I=="string"&&I.trim()===""||Array.isArray(I)&&I.length===0||typeof I=="object"&&!Array.isArray(I)&&Object.keys(I).length===0||g.push({id:x,type:v.type,value:I,label:v.label})}return i?n?.(g):(s(g),c?.(g)),g},[d,e,i,n,c]),y=k.useCallback(g=>{l(m=>({...m,[g]:void 0})),u(g,void 0)},[u]),f=k.useCallback(()=>{const g={};e.forEach(m=>{m.type==="daterange"?g[m.id]={start:"",end:""}:g[m.id]=m.defaultValue??""}),l(g),i?n?.([]):(s([]),c?.([]))},[e,i,n,c]);return{appliedFilters:h,tempFilters:d,updateFilter:u,applyFilters:p,clearFilter:y,clearAllFilters:f}},Ake=(e,t)=>{if(e==null)return!1;const n=t.value;if(n==null)return!1;switch(t.type){case"text":case"search":return String(e).toLowerCase().includes(String(n).toLowerCase());case"number":case"range":return Number(e)===Number(n);case"select":case"multiselect":return Array.isArray(n)?n.includes(e)||n.map(c=>String(c)).includes(String(e)):String(e)===String(n);case"boolean":return!!e==!!n;case"date":return new Date(e).getTime()===new Date(String(n)).getTime();case"daterange":try{if(!n||typeof n!="object")return!1;const c=n;if(!c.start||!c.end)return!1;const i=c.start,r=c.end;if(typeof i!="string"||typeof r!="string"||!i.trim()||!r.trim())return!1;const s=new Date(e).getTime(),d=new Date(i).getTime(),l=new Date(r).getTime();return isNaN(s)||isNaN(d)||isNaN(l)?!1:s>=d&&s<=l}catch(c){return console.error("Error processing daterange filter:",c),!1}case"operator":if(typeof n=="object"&&n!==null){const c=n;if(!("operator"in c)||!("value"in c))return!1;const{operator:i,value:r}=c,s=Number(e),d=Number(r);if(isNaN(s)||isNaN(d))return String(e).includes(String(r));switch(i){case"equals":return s===d;case"gt":return s>d;case"lt":return s<d;case"gte":return s>=d;case"lte":return s<=d;default:return String(e).includes(String(r))}}return!1;default:return String(e).toLowerCase().includes(String(n).toLowerCase())}};function hA(e,t,n="",c={key:null,direction:"asc"},i=1,r=10,s=[]){const d=Math.max(1,r),l=(n||"").trim().toLowerCase(),h=k.useMemo(()=>{let m=e;return l&&(m=m.filter(x=>t.some(M=>{const v=x.data[M.id];return v==null?!1:String(v).toLowerCase().includes(l)}))),s.length>0&&(m=m.filter(x=>s.every(M=>{try{const v=x.data[M.id];return Ake(v,M)}catch(v){return console.error("Error applying filter:",v),!1}}))),m},[e,t,l,s]),u=k.useMemo(()=>{if(!c?.key)return h;const m=c.key;return[...h].sort((x,M)=>{const v=x.data[m],I=M.data[m];if(v==null)return 1;if(I==null)return-1;if(typeof v=="number"&&typeof I=="number")return c.direction==="desc"?I-v:v-I;if(v instanceof Date&&I instanceof Date){const w=v.getTime()-I.getTime();return c.direction==="desc"?-w:w}const b=String(v).localeCompare(String(I),void 0,{numeric:!0,sensitivity:"base"});return c.direction==="desc"?-b:b})},[h,c]),p=u,y=Math.ceil(u.length/d),f=0,g=Math.min(i*d,u.length);return{paginatedData:p,sortedData:u,filteredData:h,totalPages:y,startIndex:f,endIndex:g}}const uA=({value:e})=>e,pA=({value:e})=>k.createElement("a",{href:`mailto:${e}`,className:"email-link"},e),yA=({value:e})=>k.createElement("a",{href:String(e),target:"_blank",rel:"noopener noreferrer",className:"text-link"},e),kA=({value:e})=>{if(!e)return null;const t={success:"success-badge",warning:"warning-badge",error:"error-badge",info:"info-badge",default:"default-badge"},n=typeof e=="object"?e.type:"default",c=typeof e=="object"?e.text:e,i=t[n]||t.default;return k.createElement("span",{className:`badge ${i}`},c)},mA=({value:e})=>{try{return new Date(e).toLocaleDateString()}catch{return String(e)}},fA=({value:e})=>k.createElement("span",{className:"number-value"},Number(e).toLocaleString()),gA=({value:e})=>k.createElement("span",{className:"currency-value"},new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR"}).format(Number(e))),vA=({value:e})=>k.createElement("div",{className:"image-container"},k.createElement("img",{src:e,alt:"Table content",className:"table-image",onError:t=>t.currentTarget.style.display="none"})),xw={renderers:{text:uA,email:pA,link:yA,badge:kA,date:mA,number:fA,currency:gA,image:vA},icons:{sortAsc:k.createElement(Ac,{className:"sort-icon active",size:14}),sortDesc:k.createElement(Ht,{className:"sort-icon active",size:14}),sortDefault:k.createElement(a1,{className:"sort-icon",size:14})}},zke=(e,t)=>{xw.renderers[e]&&console.warn(`Le renderer "${e}" existe déjà et sera écrasé.`),xw.renderers[e]=t},Vke=({filters:e,externalFilters:t=[],onFiltersChange:n,onApply:c,isControlled:i=!1,debounceTimeout:r=300,expanded:s,onToggle:d,panelPlacement:l="top",onPanelHeightChange:h,label:u="Advanced-Filters",applyLabel:p="Apply",cancelLabel:y="Cancel",clearLabel:f="Clear",applyDisabled:g=!1,loading:m=!1})=>{const[x,M]=k.useState(!1),v=typeof s=="boolean"?s:x,{appliedFilters:I,tempFilters:b,updateFilter:w,applyFilters:C,clearAllFilters:_}=lA({filters:e,externalFilters:t,onFiltersChange:n,onApply:c,isControlled:i}),L=k.useRef(null),S=k.useRef(null);k.useEffect(()=>{if(v&&L.current){const A=L.current.getBoundingClientRect().height;h?.(A)}else h?.(0)},[v,e,b,h]);const N=()=>{typeof s=="boolean"?d?.(!s):M(A=>{const z=!A;return d?.(z),z})},j=()=>e.map(A=>{const z=b?.[A.id];return z==null||typeof z=="string"&&z.trim()===""?null:{id:A.id,label:A.label,value:z}}).filter(Boolean),q=async()=>{let A;try{A=await C()}catch{A=void 0}let z=[];A&&Array.isArray(A)&&A.length>0?z=A:I&&I.length>0?z=I:z=j(),n?.(z),c?.(z)},H=()=>{d?.(!1),typeof s!="boolean"&&M(!1)},B=()=>{_(),n?.([]),c?.([])};return k.useEffect(()=>{const A=$=>{v&&S.current&&(S.current.contains($.target)||(d?.(!1),typeof s!="boolean"&&M(!1)))},z=$=>{$.key==="Escape"&&v&&(d?.(!1),typeof s!="boolean"&&M(!1))};return v&&(document.addEventListener("pointerdown",A),document.addEventListener("keydown",z)),()=>{document.removeEventListener("pointerdown",A),document.removeEventListener("keydown",z)}},[v,s,d]),o.jsxs("div",{className:T.advancedFiltersContainer,ref:S,children:[o.jsxs("button",{className:`${T.toggleFiltersButton} ${I.length>0?T.active:""} ${v?T.toggleFiltersButtonOpen:""} ${m?T.loadingButton:""}`,onClick:N,"aria-expanded":v,"aria-controls":"advanced-filters-panel",type:"button",disabled:m,children:[m?o.jsx("span",{className:T.loaderSpinnerSmall}):o.jsx(At,{size:14}),o.jsx("span",{className:T.buttonTextCompact,children:u}),I.length>0&&!m&&o.jsx("span",{className:T.filterCountBadge,"aria-hidden":!0,children:I.length}),m&&o.jsx("span",{className:T.loadingIndicator,"aria-hidden":!0,children:"Chargement..."})]}),v&&o.jsxs("div",{id:"advanced-filters-panel",ref:L,className:`${T.filtersPanel} ${l==="top"?`${T.filtersPanelInline} ${T.filtersPanelHorizontal}`:""}`,role:"region","aria-label":"Panneau de filtres avancés",children:[o.jsx("div",{className:T.filtersRow,children:e.map(A=>o.jsxs("div",{className:`${T.filterItem} ${T.filterItemInline}`,children:[o.jsxs("label",{className:T.filterLabel,children:[A.label,A.required&&o.jsx("span",{className:T.required,children:"*"})]}),o.jsx(qke,{config:A,value:b[A.id],onChange:z=>w(A.id,z),disabled:A.disabled})]},A.id))}),o.jsxs("div",{className:T.filtersActionsHorizontal,children:[o.jsx("div",{className:T.activeFiltersSection,children:I.length>0&&o.jsxs("div",{className:T.activeFiltersRow,children:[o.jsx("span",{className:T.activeLabelCompact,children:"Actifs :"}),o.jsx("div",{className:T.activeFiltersList,children:I.map(A=>o.jsxs("div",{className:T.activeFilterTag,children:[A.label??A.id,o.jsx("button",{className:T.removeFilterButton,onClick:()=>w(A.id,void 0),"aria-label":`Supprimer ${A.id}`,type:"button",children:"×"})]},A.id))}),o.jsxs("button",{className:T.clearAllButton,onClick:B,type:"button",children:[o.jsx(at,{size:12})," ",f]})]})}),o.jsxs("div",{className:T.actionsGroup,children:[o.jsx("button",{className:T.cancelButton,onClick:H,type:"button",disabled:m,children:y}),o.jsx("button",{className:`${T.applyButton} ${m?T.loadingButton:""}`,onClick:q,type:"button",disabled:g||m,"aria-disabled":g||m,children:m?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:T.loaderSpinnerSmall}),o.jsx("span",{children:"Chargement..."})]}):p})]})]})]})]})},Nj=e=>{const t=e.replace(/[^A-Za-zÀ-ÖØ-öø-ÿ]/g,"");return t.length>0&&t===t.toUpperCase()},Pke=({columns:e,sortConfig:t,onSort:n,label:c="Sort",loading:i=!1})=>{const[r,s]=k.useState(!1),d=e.filter(g=>g.sortable),l=k.useRef(null),h=t?.key!==null&&t?.key!==void 0,u=(g,m)=>{n({key:g,direction:m}),s(!1)},p=()=>{n({key:null,direction:"asc"}),s(!1)},y=()=>s(g=>!g),f=()=>{s(!1)};return k.useEffect(()=>{if(!r)return;const g=x=>{if(!l.current)return;const M=x.target;M&&!l.current.contains(M)&&s(!1)},m=x=>{x.key==="Escape"&&s(!1)};return document.addEventListener("pointerdown",g),document.addEventListener("keydown",m),()=>{document.removeEventListener("pointerdown",g),document.removeEventListener("keydown",m)}},[r]),k.useEffect(()=>{const g=document.querySelector("[data-table-wrapper]");if(!g)return;const m=g.style.overflow??"";return r?g.style.overflow="hidden":g.style.overflow=m,()=>{g.style.overflow=m}},[r]),o.jsx("div",{className:T.columnSorterContainer,ref:l,children:o.jsx("div",{className:T.sorterControls,children:d.length>0&&o.jsxs("div",{className:T.sortDropdownWrapper,ref:l,children:[o.jsxs("button",{className:`${T.toggleSortButton} ${r?T.toggleSortButtonOpen:""} ${h?T.active:""} ${i?T.loadingButton:""}`,onClick:y,"aria-expanded":r,"aria-haspopup":"true",type:"button",disabled:i,children:[i?o.jsx("span",{className:T.loaderSpinnerSmall}):o.jsx(a1,{size:14}),o.jsx("span",{className:`${T.buttonTextCompact} ${Nj(c)?T.uppercaseSmall:""}`,children:c}),h&&!i&&o.jsx("div",{className:T.sortIndicator,children:t?.direction==="asc"?o.jsx(Ac,{size:12}):o.jsx(Ht,{size:12})})]}),r&&o.jsxs("div",{className:`${T.sortDropdown} ${T.sortDropdownInline}`,role:"menu",children:[o.jsxs("div",{className:T.sortDropdownHeader,children:[o.jsx("span",{children:"Trier par:"}),o.jsx("button",{className:T.closeButton,onClick:f,"aria-label":"Fermer",type:"button",children:o.jsx(at,{size:16})})]}),o.jsx("div",{className:T.sortDropdownContent,children:d.map(g=>{const m=String(g.label??g.id),x=Nj(m);return o.jsxs("div",{className:T.sortDropdownItem,role:"menuitem",tabIndex:0,onKeyDown:M=>{M.key==="Enter"&&u(g.id,"asc")},children:[o.jsx("span",{className:`${T.columnSorterLabel} ${x?T.uppercaseSmall:""}`,title:m,"aria-label":m,children:m}),o.jsxs("div",{className:T.sortDirectionButtons,children:[o.jsx("button",{className:`${T.sortDirectionButton} ${t?.key===g.id&&t?.direction==="asc"?T.activeSort:""}`,onClick:()=>u(g.id,"asc"),title:"Trier par ordre croissant",type:"button",children:o.jsx(Ac,{size:12})}),o.jsx("button",{className:`${T.sortDirectionButton} ${t?.key===g.id&&t?.direction==="desc"?T.activeSort:""}`,onClick:()=>u(g.id,"desc"),title:"Trier par ordre décroissant",type:"button",children:o.jsx(Ht,{size:12})})]})]},g.id)})}),h&&o.jsx("div",{className:T.sortActions,children:o.jsxs("button",{className:T.clearSortButton,onClick:p,type:"button",children:[o.jsx(qt,{size:14}),o.jsx("span",{children:"Annuler le tri"})]})})]})]})})})},Tke=({currentPage:e,totalPages:t,pageSize:n,totalItems:c,itemLabel:i="items",onPageChange:r,onPageSizeChange:s,loading:d=!1})=>{const l=Math.max(1,Math.floor(t)),h=Math.min(Math.max(1,Math.floor(e)),l),u=()=>{h>1&&r(h-1)},p=()=>{if(h<t){const m=h+1;r(m)}},y=c>0?(h-1)*n+1:0,f=c>0?Math.min(h*n,c):0,g=()=>{const m=[];let M=Math.max(1,h-Math.floor(2.5)),v=M+5-1;v>l&&(v=l,M=Math.max(1,v-5+1));for(let I=M;I<=v;I++)m.push(I);return m};return o.jsxs("div",{className:T.paginationContainer,role:"navigation","aria-label":"Pagination",children:[o.jsx("div",{className:T.leftGroup,children:s&&o.jsx("div",{className:T.pageSizeControls,children:o.jsx("select",{value:n,onChange:m=>s(Number(m.target.value)),className:T.pageSizeSelect,"aria-label":"Taille de page",disabled:d,children:[10,20,30].map(m=>o.jsx("option",{value:m,children:m},m))})})}),o.jsx("div",{className:T.paginationInfo,"aria-live":"polite",children:d?o.jsxs("span",{className:T.paginationLoading,children:[o.jsx("span",{className:T.loaderSpinner}),o.jsx("span",{children:"Chargement..."})]}):`${y}-${f} ${i}`}),o.jsxs("div",{className:T.paginationControls,children:[o.jsx("button",{onClick:u,disabled:h===1||d,className:`${T.paginationButton} ${T.navigationButton} ${h===1?T.disabledButton:""} ${d?T.loadingButton:""}`,"aria-label":"Page précédente",children:d&&h>1?o.jsx("span",{className:T.loaderSpinnerSmall}):"«"}),g().map(m=>o.jsx("button",{onClick:()=>r(m),disabled:d,"aria-current":h===m?"page":void 0,className:`${T.paginationButton} ${h===m?T.activeButton:""} ${d?T.loadingButton:""}`,children:d&&h===m?o.jsx("span",{className:T.loaderSpinnerSmall}):m},m)),o.jsx("button",{onClick:p,disabled:d||h>=l,className:`${T.paginationButton} ${T.navigationButton} ${d?T.loadingButton:""} ${h>=l?T.disabledButton:""}`,"aria-label":"Page suivante",children:d?o.jsx("span",{className:T.loaderSpinnerSmall}):"»"})]})]})},Hke=(e,t)=>{if(!e)return"";if(t)return e;const n=String(e).trim();if(!n)return n;const c=n.toLowerCase();return c.charAt(0).toUpperCase()+c.slice(1)},Dke=e=>{if(!e)return!1;const t=e.trim().split(/\s+/);return e.length>18||t.length>2},Bke=({columns:e})=>o.jsx("thead",{className:T.tableHeader,children:o.jsx("tr",{children:e.map((t,n)=>{const c=t.align==="right"?T.alignRight:t.align==="left"?T.alignLeft:T.alignCenter,i=t.preserveHeaderCase===!0,r=Hke(String(t.label??""),i),s=Dke(r),d=s?r.split(/\s+/):[];return o.jsx("th",{className:`${T.headerCell} ${c}`,style:{width:t.width??void 0},"data-preserve":i?"true":"false",title:t.a11yConfig?.mode==="guide"?t.a11yConfig.description:t.a11yConfig?.mode==="key"?t.a11yConfig.key:void 0,children:o.jsx("div",{className:T.headerContent,children:s?o.jsx("div",{className:T.headerWords,children:d.map((l,h)=>o.jsx("span",{className:T.headerWord,children:l},h))}):o.jsx("span",{children:r})})},t.id??`col-${n}`)})})}),Rke=({value:e,row:t,column:n})=>{const c=n.align==="right"?T.alignRight:n.align==="left"?T.alignLeft:T.alignCenter,i=typeof n.render=="function"?n.render(e,t):e==null?"":String(e);return o.jsx("td",{className:`${T.tableCell} ${c}`,style:{width:n.width??void 0},children:o.jsx("div",{className:T.cellContent,children:i})})},Fke=({row:e,rowId:t,columns:n,onRowClick:c,index:i,getRowStyle:r})=>{const s=r?r(e):{},{backgroundColor:d,accentColor:l,...h}=s||{},u={backgroundColor:d,...h,"--row-accent":l??"transparent"};return o.jsx("tr",{className:`${T.tableRow} ${c?T.clickableRow:""}`,onClick:()=>c?.(e,i),style:u,children:n.map(p=>o.jsx(Rke,{value:e[p.id],row:e,column:p},`${t}-${p.id}`))})},Eke=({data:e,columns:t,onRowClick:n,startIndex:c,searchTerm:i,getRowStyle:r})=>e.length===0?o.jsx("tbody",{children:o.jsx("tr",{children:o.jsx("td",{colSpan:t.length,className:T.emptyRow,children:i?"Aucun résultat trouvé":"Aucune donnée disponible"})})}):o.jsx("tbody",{children:e.map((s,d)=>o.jsx(Fke,{row:s.data,rowId:s.id,columns:t,onRowClick:n,index:c+d-1,getRowStyle:r},s.id))}),xA=({columns:e=[],data:t=[],pagination:n={pageSize:10,currentPage:1},onRowClick:c,searchTerm:i="",className:r="",filterConfig:s=[],externalFilters:d=[],onFiltersChange:l,onApplyFilters:h,onSort:u,filtersControlled:p=!1,debounceTimeout:y=300,getRowStyle:f,background:g,onPageSizeChange:m,onPageChange:x,itemLabel:M="items",advancedFiltersLabel:v="Advanced-Filters",advancedFiltersActiveLabel:I,sortLabel:b="Sort",applyLabel:w="Apply",cancelLabel:C="Cancel",clearLabel:_="Clear",applyDisabled:L=!1,paginationLoading:S=!1,filtersLoading:N=!1,sortLoading:j=!1,totalCount:q=null})=>{const[H,B]=k.useState({key:null,direction:"asc"}),[A,z]=k.useState(n.currentPage??1),[$,D]=k.useState(n.pageSize??10),[R,V]=k.useState(!1),O=k.useRef(null),[J,F]=k.useState([]),K=p?d:J,pe=p?[]:J;k.useEffect(()=>{const le=n.currentPage??1,Ct=n.pageSize??10;le!==A&&z(le),Ct!==$&&D(Ct)},[n.currentPage,n.pageSize]);const{paginatedData:oe,sortedData:ve,totalPages:ie,startIndex:ae}=hA(t,e,i,H,A,$,pe),ne=ve.length,se=typeof q=="number"&&q>=0?q:ne;let ue=ie;typeof q=="number"&&q>=0&&(ue=Math.max(1,Math.ceil(q/$)));const ye=ne>10;k.useEffect(()=>{const le=Math.max(1,Math.floor(ue));A>le&&z(le),A<1&&z(1)},[ue]);const U=le=>{p||F(le),l?.(le),z(1),x?.(1)},Y=le=>{p||F(le),h?.(le),z(1),x?.(1),O.current&&O.current.style.setProperty("--filters-panel-height","0px")},ce=le=>{x?.(le),z(le)},Se=le=>{D(le),z(1),m?.(le),x?.(1)},ze=le=>{O.current&&O.current.style.setProperty("--filters-panel-height",`${Math.round(le)}px`)},xe=le=>{B(le),u?.(le)},He=le=>{V(le),!le&&O.current&&O.current.style.setProperty("--filters-panel-height","0px")};k.useEffect(()=>{(K?.length??0)>0&&V(!0)},[K]),k.useEffect(()=>{s.length>0&&K.length>0&&V(!0)},[s.length,K.length]);const je=(K?.length??0)>0&&I?I:v;return o.jsxs("div",{ref:O,className:`${T.container} ${r} ${R?T.filtersOpen:""}`,style:{background:g,"--row-height":"48px","--header-height":"56px"},children:[o.jsx("div",{className:T.tableControls,children:o.jsxs("div",{className:T.controlsRight,children:[o.jsx(Pke,{columns:e,onSort:xe,label:b,sortConfig:H,loading:j}),s.length>0&&o.jsx(Vke,{filters:s,externalFilters:K,onFiltersChange:U,onApply:Y,isControlled:p,debounceTimeout:y,expanded:R,onToggle:He,panelPlacement:"top",onPanelHeightChange:ze,label:je,applyLabel:w,cancelLabel:C,clearLabel:_,applyDisabled:L,loading:N})]})}),o.jsx("div",{className:T.topPagination,children:o.jsx(Tke,{currentPage:A,totalPages:ue,pageSize:$,totalItems:se,itemLabel:M,onPageChange:ce,onPageSizeChange:Se,loading:S})}),o.jsx("div",{className:`${T.tableWrapper} ${ye?T.limitedRows:""}`,"data-table-wrapper":!0,children:o.jsxs("table",{className:T.table,children:[o.jsx(Bke,{columns:e}),o.jsx(Eke,{data:oe,columns:e,onRowClick:c,startIndex:ae,getRowStyle:f,searchTerm:i})]})})]})};function Oke(e){const{pagination:t,totalCount:n,onPageChange:c,...i}=e,r=t?.pageSize??20,s=t?.currentPage??1,d=k.useMemo(()=>{if(n===null||typeof n>"u")return null;const p=Number(n);if(!Number.isFinite(p)||p<=0)return 1;const y=Number(r);return!Number.isFinite(y)||y<=0?1:Math.max(1,Math.ceil(p/y))},[n,r]),l=s>1,h=d===null?!1:s<d,u=p=>{typeof p=="number"&&(p<1||p<s&&!l||p>s&&!h||c?.(p))};return o.jsx(xA,{...i,pagination:{pageSize:r,currentPage:s},totalCount:n,onPageChange:u})}const Uke=({page:e,pageSize:t,total:n,onPageChange:c,itemLabel:i="élément",ofLabel:r="sur",className:s})=>{const d=Math.max(1,Math.ceil(n/t)),l=n===0?0:(e-1)*t+1,h=Math.min(e*t,n),u=n>1?`${i}s`:i;if(n===0)return null;const p=4;let y=Math.max(1,e-Math.floor(p/2)),f=y+p-1;f>d&&(f=d,y=Math.max(1,f-p+1));const g=[];for(let m=y;m<=f;m++)g.push(m);return o.jsxs(Wke,{className:s,children:[o.jsxs(Gke,{children:[l,"-",h," ",r," ",n," ",u]}),o.jsx(Kke,{}),d>1&&o.jsxs(Zke,{children:[o.jsx(di,{onClick:()=>c(1),disabled:e===1,title:"Première page",children:"<<"}),o.jsx(di,{onClick:()=>c(e-1),disabled:e===1,title:"Page précédente",children:"<"}),g.map(m=>o.jsx(Xke,{$active:m===e,onClick:()=>c(m),children:m},m)),o.jsx(di,{onClick:()=>c(e+1),disabled:e===d,title:"Page suivante",children:">"}),o.jsx(di,{onClick:()=>c(d),disabled:e===d,title:"Dernière page",children:">>"})]})]})},Wke=E.div`
8272
+ `),()=>{x.contains(m)&&x.removeChild(m)}},[t]),o.jsx(xle,{isPresent:t,childRef:r,sizeRef:s,children:te.cloneElement(e,{ref:l})})}const _le=({children:e,initial:t,isPresent:n,onExitComplete:c,custom:i,presenceAffectsLayout:r,mode:s,anchorX:d,root:l})=>{const h=Bt(Lle),u=k.useId();let p=!0,y=k.useMemo(()=>(p=!1,{id:u,initial:t,isPresent:n,custom:i,onExitComplete:f=>{h.set(f,!0);for(const g of h.values())if(!g)return;c&&c()},register:f=>(h.set(f,!1),()=>h.delete(f))}),[n,h,c]);return r&&p&&(y={...y}),k.useMemo(()=>{h.forEach((f,g)=>h.set(g,!1))},[n]),te.useEffect(()=>{!n&&!h.size&&c&&c()},[n]),s==="popLayout"&&(e=o.jsx(Mle,{isPresent:n,anchorX:d,root:l,children:e})),o.jsx(wL.Provider,{value:y,children:e})};function Lle(){return new Map}function eq(e=!0){const t=k.useContext(wL);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:c,register:i}=t,r=k.useId();k.useEffect(()=>{if(e)return i(r)},[e]);const s=k.useCallback(()=>e&&c&&c(r),[r,c,e]);return!n&&c?[!1,s]:[!0]}const ri=e=>e.key||"";function XC(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const Ile=({children:e,custom:t,initial:n=!0,onExitComplete:c,presenceAffectsLayout:i=!0,mode:r="sync",propagate:s=!1,anchorX:d="left",root:l})=>{const[h,u]=eq(s),p=k.useMemo(()=>XC(e),[e]),y=s&&!h?[]:p.map(ri),f=k.useRef(!0),g=k.useRef(p),m=Bt(()=>new Map),[x,M]=k.useState(p),[v,I]=k.useState(p);bw(()=>{f.current=!1,g.current=p;for(let C=0;C<v.length;C++){const _=ri(v[C]);y.includes(_)?m.delete(_):m.get(_)!==!0&&m.set(_,!1)}},[v,y.length,y.join("-")]);const b=[];if(p!==x){let C=[...p];for(let _=0;_<v.length;_++){const L=v[_],S=ri(L);y.includes(S)||(C.splice(_,0,L),b.push(L))}return r==="wait"&&b.length&&(C=b),I(XC(C)),M(p),null}process.env.NODE_ENV!=="production"&&r==="wait"&&v.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:w}=k.useContext(Lw);return o.jsx(o.Fragment,{children:v.map(C=>{const _=ri(C),L=s&&!h?!1:p===v||y.includes(_),S=()=>{if(m.has(_))m.set(_,!0);else return;let N=!0;m.forEach(j=>{j||(N=!1)}),N&&(w?.(),I(g.current),s&&u?.(),c&&c())};return o.jsx(_le,{isPresent:L,initial:!f.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:r,root:l,onExitComplete:L?void 0:S,anchorX:d,children:C},_)})})},tq=k.createContext({strict:!1}),YC={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},i1={};for(const e in YC)i1[e]={isEnabled:t=>YC[e].some(n=>!!t[n])};function ble(e){for(const t in e)i1[t]={...i1[t],...e[t]}}const wle=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function xL(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||wle.has(e)}let aq=e=>!xL(e);function Cle(e){typeof e=="function"&&(aq=t=>t.startsWith("on")?!xL(t):e(t))}try{Cle(require("@emotion/is-prop-valid").default)}catch{}function Nle(e,t,n){const c={};for(const i in e)i==="values"&&typeof e.values=="object"||(aq(i)||n===!0&&xL(i)||!t&&!xL(i)||e.draggable&&i.startsWith("onDrag"))&&(c[i]=e[i]);return c}const NL=k.createContext({});function SL(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function U1(e){return typeof e=="string"||Array.isArray(e)}const Gw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Kw=["initial",...Gw];function jL(e){return SL(e.animate)||Kw.some(t=>U1(e[t]))}function nq(e){return!!(jL(e)||e.variants)}function Sle(e,t){if(jL(e)){const{initial:n,animate:c}=e;return{initial:n===!1||U1(n)?n:void 0,animate:U1(c)?c:void 0}}return e.inherit!==!1?t:{}}function jle(e){const{initial:t,animate:n}=Sle(e,k.useContext(NL));return k.useMemo(()=>({initial:t,animate:n}),[JC(t),JC(n)])}function JC(e){return Array.isArray(e)?e.join(" "):e}const W1={};function $le(e){for(const t in e)W1[t]=e[t],Aw(t)&&(W1[t].isCSSVariable=!0)}function oq(e,{layout:t,layoutId:n}){return l1.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!W1[e]||e==="opacity")}const qle={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ale=d1.length;function zle(e,t,n){let c="",i=!0;for(let r=0;r<Ale;r++){const s=d1[r],d=e[s];if(d===void 0)continue;let l=!0;if(typeof d=="number"?l=d===(s.startsWith("scale")?1:0):l=parseFloat(d)===0,!l||n){const h=K$(d,Ow[s]);if(!l){i=!1;const u=qle[s]||s;c+=`${u}(${h}) `}n&&(t[s]=h)}}return c=c.trim(),n?c=n(t,i?"":c):i&&(c="none"),c}function Zw(e,t,n){const{style:c,vars:i,transformOrigin:r}=e;let s=!1,d=!1;for(const l in t){const h=t[l];if(l1.has(l)){s=!0;continue}else if(Aw(l)){i[l]=h;continue}else{const u=K$(h,Ow[l]);l.startsWith("origin")?(d=!0,r[l]=u):c[l]=u}}if(t.transform||(s||n?c.transform=zle(t,e.transform,n):c.transform&&(c.transform="none")),d){const{originX:l="50%",originY:h="50%",originZ:u=0}=r;c.transformOrigin=`${l} ${h} ${u}`}}const Xw=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function cq(e,t,n){for(const c in t)!Ae(t[c])&&!oq(c,n)&&(e[c]=t[c])}function Vle({transformTemplate:e},t){return k.useMemo(()=>{const n=Xw();return Zw(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Ple(e,t){const n=e.style||{},c={};return cq(c,n,e),Object.assign(c,Vle(e,t)),c}function Tle(e,t){const n={},c=Ple(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,c.userSelect=c.WebkitUserSelect=c.WebkitTouchCallout="none",c.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=c,n}const Hle={offset:"stroke-dashoffset",array:"stroke-dasharray"},Dle={offset:"strokeDashoffset",array:"strokeDasharray"};function Ble(e,t,n=1,c=0,i=!0){e.pathLength=1;const r=i?Hle:Dle;e[r.offset]=Q.transform(-c);const s=Q.transform(t),d=Q.transform(n);e[r.array]=`${s} ${d}`}function iq(e,{attrX:t,attrY:n,attrScale:c,pathLength:i,pathSpacing:r=1,pathOffset:s=0,...d},l,h,u){if(Zw(e,d,h),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:y}=e;p.transform&&(y.transform=p.transform,delete p.transform),(y.transform||p.transformOrigin)&&(y.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),y.transform&&(y.transformBox=u?.transformBox??"fill-box",delete p.transformBox),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),c!==void 0&&(p.scale=c),i!==void 0&&Ble(p,i,r,s,!1)}const rq=()=>({...Xw(),attrs:{}}),sq=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Rle(e,t,n,c){const i=k.useMemo(()=>{const r=rq();return iq(r,t,sq(c),e.transformTemplate,e.style),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};cq(r,e.style,e),i.style={...r,...i.style}}return i}const Fle=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Yw(e){return typeof e!="string"||e.includes("-")?!1:!!(Fle.indexOf(e)>-1||/[A-Z]/u.test(e))}function Ele(e,t,n,{latestValues:c},i,r=!1){const d=(Yw(e)?Rle:Tle)(t,c,i,e),l=Nle(t,typeof e=="string",r),h=e!==k.Fragment?{...l,...d,ref:n}:{},{children:u}=t,p=k.useMemo(()=>Ae(u)?u.get():u,[u]);return k.createElement(e,{...h,children:p})}function QC(e){const t=[{},{}];return e?.values.forEach((n,c)=>{t[0][c]=n.get(),t[1][c]=n.getVelocity()}),t}function Jw(e,t,n,c){if(typeof t=="function"){const[i,r]=QC(c);t=t(n!==void 0?n:e.custom,i,r)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,r]=QC(c);t=t(n!==void 0?n:e.custom,i,r)}return t}function lL(e){return Ae(e)?e.get():e}function Ole({scrapeMotionValuesFromProps:e,createRenderState:t},n,c,i){return{latestValues:Ule(n,c,i,e),renderState:t()}}function Ule(e,t,n,c){const i={},r=c(e,{});for(const y in r)i[y]=lL(r[y]);let{initial:s,animate:d}=e;const l=jL(e),h=nq(e);t&&h&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),d===void 0&&(d=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const p=u?d:s;if(p&&typeof p!="boolean"&&!SL(p)){const y=Array.isArray(p)?p:[p];for(let f=0;f<y.length;f++){const g=Jw(e,y[f]);if(g){const{transitionEnd:m,transition:x,...M}=g;for(const v in M){let I=M[v];if(Array.isArray(I)){const b=u?I.length-1:0;I=I[b]}I!==null&&(i[v]=I)}for(const v in m)i[v]=m[v]}}}return i}const dq=e=>(t,n)=>{const c=k.useContext(NL),i=k.useContext(wL),r=()=>Ole(e,t,c,i);return n?r():Bt(r)};function Qw(e,t,n){const{style:c}=e,i={};for(const r in c)(Ae(c[r])||t.style&&Ae(t.style[r])||oq(r,e)||n?.getValue(r)?.liveStyle!==void 0)&&(i[r]=c[r]);return i}const Wle=dq({scrapeMotionValuesFromProps:Qw,createRenderState:Xw});function lq(e,t,n){const c=Qw(e,t,n);for(const i in e)if(Ae(e[i])||Ae(t[i])){const r=d1.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;c[r]=e[i]}return c}const Gle=dq({scrapeMotionValuesFromProps:lq,createRenderState:rq}),Kle=Symbol.for("motionComponentSymbol");function Xc(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Zle(e,t,n){return k.useCallback(c=>{c&&e.onMount&&e.onMount(c),t&&(c?t.mount(c):t.unmount()),n&&(typeof n=="function"?n(c):Xc(n)&&(n.current=c))},[t])}const eC=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Xle="framerAppearId",hq="data-"+eC(Xle),uq=k.createContext({});function Yle(e,t,n,c,i){const{visualElement:r}=k.useContext(NL),s=k.useContext(tq),d=k.useContext(wL),l=k.useContext(CL).reducedMotion,h=k.useRef(null);c=c||s.renderer,!h.current&&c&&(h.current=c(e,{visualState:t,parent:r,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:l}));const u=h.current,p=k.useContext(uq);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&Jle(h.current,n,i,p);const y=k.useRef(!1);k.useInsertionEffect(()=>{u&&y.current&&u.update(n,d)});const f=n[hq],g=k.useRef(!!f&&!window.MotionHandoffIsComplete?.(f)&&window.MotionHasOptimisedAnimation?.(f));return bw(()=>{u&&(y.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),k.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(f)}),g.current=!1),u.enteringChildren=void 0)}),u}function Jle(e,t,n,c){const{layoutId:i,layout:r,drag:s,dragConstraints:d,layoutScroll:l,layoutRoot:h,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:pq(e.parent)),e.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!s||d&&Xc(d),visualElement:e,animationType:typeof r=="string"?r:"both",initialPromotionConfig:c,crossfade:u,layoutScroll:l,layoutRoot:h})}function pq(e){if(e)return e.options.allowProjection!==!1?e.projection:pq(e.parent)}function tI(e,{forwardMotionProps:t=!1}={},n,c){n&&ble(n);const i=Yw(e)?Gle:Wle;function r(d,l){let h;const u={...k.useContext(CL),...d,layoutId:Qle(d)},{isStatic:p}=u,y=jle(d),f=i(d,p);if(!p&&Iw){ehe(u,n);const g=the(u);h=g.MeasureLayout,y.visualElement=Yle(e,f,u,c,g.ProjectionNode)}return o.jsxs(NL.Provider,{value:y,children:[h&&y.visualElement?o.jsx(h,{visualElement:y.visualElement,...u}):null,Ele(e,d,Zle(f,y.visualElement,l),f,p,t)]})}r.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=k.forwardRef(r);return s[Kle]=e,s}function Qle({layoutId:e}){const t=k.useContext(Lw).id;return t&&e!==void 0?t+"-"+e:e}function ehe(e,t){const n=k.useContext(tq).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const c="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?r1(!1,c,"lazy-strict-mode"):st(!1,c,"lazy-strict-mode")}}function the(e){const{drag:t,layout:n}=i1;if(!t&&!n)return{};const c={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?c.MeasureLayout:void 0,ProjectionNode:c.ProjectionNode}}function ahe(e,t){if(typeof Proxy>"u")return tI;const n=new Map,c=(r,s)=>tI(r,s,e,t),i=(r,s)=>(process.env.NODE_ENV!=="production"&&jw(!1,"motion() is deprecated. Use motion.create() instead."),c(r,s));return new Proxy(i,{get:(r,s)=>s==="create"?c:(n.has(s)||n.set(s,tI(s,void 0,e,t)),n.get(s))})}function yq({top:e,left:t,right:n,bottom:c}){return{x:{min:t,max:n},y:{min:e,max:c}}}function nhe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ohe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),c=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:c.y,right:c.x}}function aI(e){return e===void 0||e===1}function hw({scale:e,scaleX:t,scaleY:n}){return!aI(e)||!aI(t)||!aI(n)}function Sc(e){return hw(e)||kq(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function kq(e){return eN(e.x)||eN(e.y)}function eN(e){return e&&e!=="0%"}function ML(e,t,n){const c=e-n,i=t*c;return n+i}function tN(e,t,n,c,i){return i!==void 0&&(e=ML(e,i,c)),ML(e,n,c)+t}function uw(e,t=0,n=1,c,i){e.min=tN(e.min,t,n,c,i),e.max=tN(e.max,t,n,c,i)}function mq(e,{x:t,y:n}){uw(e.x,t.translate,t.scale,t.originPoint),uw(e.y,n.translate,n.scale,n.originPoint)}const aN=.999999999999,nN=1.0000000000001;function che(e,t,n,c=!1){const i=n.length;if(!i)return;t.x=t.y=1;let r,s;for(let d=0;d<i;d++){r=n[d],s=r.projectionDelta;const{visualElement:l}=r.options;l&&l.props.style&&l.props.style.display==="contents"||(c&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Jc(e,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,mq(e,s)),c&&Sc(r.latestValues)&&Jc(e,r.latestValues))}t.x<nN&&t.x>aN&&(t.x=1),t.y<nN&&t.y>aN&&(t.y=1)}function Yc(e,t){e.min=e.min+t,e.max=e.max+t}function oN(e,t,n,c,i=.5){const r=ge(e.min,e.max,i);uw(e,t,n,r,c)}function Jc(e,t){oN(e.x,t.x,t.scaleX,t.scale,t.originX),oN(e.y,t.y,t.scaleY,t.scale,t.originY)}function fq(e,t){return yq(ohe(e.getBoundingClientRect(),t))}function ihe(e,t,n){const c=fq(e,n),{scroll:i}=t;return i&&(Yc(c.x,i.offset.x),Yc(c.y,i.offset.y)),c}const cN=()=>({translate:0,scale:1,origin:0,originPoint:0}),Qc=()=>({x:cN(),y:cN()}),iN=()=>({min:0,max:0}),Ie=()=>({x:iN(),y:iN()}),pw={current:null},gq={current:!1};function rhe(){if(gq.current=!0,!!Iw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>pw.current=e.matches;e.addEventListener("change",t),t()}else pw.current=!1}const she=new WeakMap;function dhe(e,t,n){for(const c in t){const i=t[c],r=n[c];if(Ae(i))e.addValue(c,i);else if(Ae(r))e.addValue(c,Dc(i,{owner:e}));else if(r!==i)if(e.hasValue(c)){const s=e.getValue(c);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(c);e.addValue(c,Dc(s!==void 0?s:i,{owner:e}))}}for(const c in n)t[c]===void 0&&e.removeValue(c);return t}const rN=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class lhe{scrapeMotionValuesFromProps(t,n,c){return{}}constructor({parent:t,props:n,presenceContext:c,reducedMotionConfig:i,blockInitialAnimation:r,visualState:s},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Fw,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=We.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,fe.render(this.render,!1,!0))};const{latestValues:l,renderState:h}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=h,this.parent=t,this.props=n,this.presenceContext=c,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=d,this.blockInitialAnimation=!!r,this.isControllingVariants=jL(n),this.isVariantNode=nq(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in p){const f=p[y];l[y]!==void 0&&Ae(f)&&f.set(l[y])}}mount(t){this.current=t,she.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,c)=>this.bindToMotionValue(c,n)),gq.current||rhe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:pw.current,process.env.NODE_ENV!=="production"&&jw(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),bt(this.notifyUpdate),bt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const c=l1.has(t);c&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&fe.preRender(this.notifyUpdate),c&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),r&&r(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in i1){const n=i1[t];if(!n)continue;const{isEnabled:c,Feature:i}=n;if(!this.features[t]&&i&&c(this.props)&&(this.features[t]=new i(this)),this.features[t]){const r=this.features[t];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ie()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let c=0;c<rN.length;c++){const i=rN[c];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,s=t[r];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=dhe(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const c=this.values.get(t);n!==c&&(c&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let c=this.values.get(t);return c===void 0&&n!==void 0&&(c=Dc(n===null?void 0:n,{owner:this}),this.addValue(t,c)),c}readValue(t,n){let c=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return c!=null&&(typeof c=="string"&&(d$(c)||h$(c))?c=parseFloat(c):!fle(c)&&Dt.test(n)&&(c=G$(t,n)),this.setBaseTarget(t,Ae(c)?c.get():c)),Ae(c)?c.get():c}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let c;if(typeof n=="string"||typeof n=="object"){const r=Jw(this.props,n,this.presenceContext?.custom);r&&(c=r[t])}if(n&&c!==void 0)return c;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Ae(i)?i:this.initialValues[t]!==void 0&&c===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Sw),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Uw.render(this.render)}}class vq extends lhe{constructor(){super(...arguments),this.KeyframeResolver=ole}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:c}){delete n[t],delete c[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ae(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function xq(e,{style:t,vars:n},c,i){const r=e.style;let s;for(s in t)r[s]=t[s];i?.applyProjectionStyles(r,c);for(s in n)r.setProperty(s,n[s])}function hhe(e){return window.getComputedStyle(e)}class uhe extends vq{constructor(){super(...arguments),this.type="html",this.renderInstance=xq}readValueFromInstance(t,n){if(l1.has(n))return this.projection?.isProjecting?ow(n):_0e(t,n);{const c=hhe(t),i=(Aw(n)?c.getPropertyValue(n):c[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return fq(t,n)}build(t,n,c){Zw(t,n,c.transformTemplate)}scrapeMotionValuesFromProps(t,n,c){return Qw(t,n,c)}}const Mq=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function phe(e,t,n,c){xq(e,t,void 0,c);for(const i in t.attrs)e.setAttribute(Mq.has(i)?i:eC(i),t.attrs[i])}class yhe extends vq{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ie}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(l1.has(n)){const c=W$(n);return c&&c.default||0}return n=Mq.has(n)?n:eC(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,c){return lq(t,n,c)}build(t,n,c){iq(t,n,this.isSVGTag,c.transformTemplate,c.style)}renderInstance(t,n,c,i){phe(t,n,c,i)}mount(t){this.isSVGTag=sq(t.tagName),super.mount(t)}}const khe=(e,t)=>Yw(e)?new yhe(t):new uhe(t,{allowProjection:e!==k.Fragment});function c1(e,t,n){const c=e.getProps();return Jw(c,t,n!==void 0?n:c.custom,e)}const yw=e=>Array.isArray(e);function mhe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Dc(n))}function fhe(e){return yw(e)?e[e.length-1]||0:e}function ghe(e,t){const n=c1(e,t);let{transitionEnd:c={},transition:i={},...r}=n||{};r={...r,...c};for(const s in r){const d=fhe(r[s]);mhe(e,s,d)}}function vhe(e){return!!(Ae(e)&&e.add)}function kw(e,t){const n=e.getValue("willChange");if(vhe(n))return n.add(t);if(!n&&It.WillChange){const c=new It.WillChange("auto");e.addValue("willChange",c),c.add(t)}}function _q(e){return e.props[hq]}const xhe=e=>e!==null;function Mhe(e,{repeat:t,repeatType:n="loop"},c){const i=e.filter(xhe),r=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[r]}const _he={type:"spring",stiffness:500,damping:25,restSpeed:10},Lhe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Ihe={type:"keyframes",duration:.8},bhe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},whe=(e,{keyframes:t})=>t.length>2?Ihe:l1.has(e)?e.startsWith("scale")?Lhe(t[1]):_he:bhe;function Che({when:e,delay:t,delayChildren:n,staggerChildren:c,staggerDirection:i,repeat:r,repeatType:s,repeatDelay:d,from:l,elapsed:h,...u}){return!!Object.keys(u).length}const tC=(e,t,n,c={},i,r)=>s=>{const d=Ew(c,e)||{},l=d.delay||c.delay||0;let{elapsed:h=0}=c;h=h-rt(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...d,delay:-h,onUpdate:y=>{t.set(y),d.onUpdate&&d.onUpdate(y)},onComplete:()=>{s(),d.onComplete&&d.onComplete()},name:e,motionValue:t,element:r?void 0:i};Che(d)||Object.assign(u,whe(e,u)),u.duration&&(u.duration=rt(u.duration)),u.repeatDelay&&(u.repeatDelay=rt(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let p=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(dw(u),u.delay===0&&(p=!0)),(It.instantAnimations||It.skipAnimations)&&(p=!0,dw(u),u.delay=0),u.allowFlatten=!d.type&&!d.ease,p&&!r&&t.get()!==void 0){const y=Mhe(u.keyframes,d);if(y!==void 0){fe.update(()=>{u.onUpdate(y),u.onComplete()});return}}return d.isSync?new Rw(u):new U0e(u)};function Nhe({protectedKeys:e,needsAnimating:t},n){const c=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,c}function Lq(e,t,{delay:n=0,transitionOverride:c,type:i}={}){let{transition:r=e.getDefaultTransition(),transitionEnd:s,...d}=t;c&&(r=c);const l=[],h=i&&e.animationState&&e.animationState.getState()[i];for(const u in d){const p=e.getValue(u,e.latestValues[u]??null),y=d[u];if(y===void 0||h&&Nhe(h,u))continue;const f={delay:n,...Ew(r||{},u)},g=p.get();if(g!==void 0&&!p.isAnimating&&!Array.isArray(y)&&y===g&&!f.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const M=_q(e);if(M){const v=window.MotionHandoffAnimation(M,u,fe);v!==null&&(f.startTime=v,m=!0)}}kw(e,u),p.start(tC(u,p,y,e.shouldReduceMotion&&E$.has(u)?{type:!1}:f,e,m));const x=p.animation;x&&l.push(x)}return s&&Promise.all(l).then(()=>{fe.update(()=>{s&&ghe(e,s)})}),l}function Iq(e,t,n,c=0,i=1){const r=Array.from(e).sort((h,u)=>h.sortNodePosition(u)).indexOf(t),s=e.size,d=(s-1)*c;return typeof n=="function"?n(r,s):i===1?r*c:d-r*c}function mw(e,t,n={}){const c=c1(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=c||{};n.transitionOverride&&(i=n.transitionOverride);const r=c?()=>Promise.all(Lq(e,c,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:h=0,staggerChildren:u,staggerDirection:p}=i;return She(e,t,l,h,u,p,n)}:()=>Promise.resolve(),{when:d}=i;if(d){const[l,h]=d==="beforeChildren"?[r,s]:[s,r];return l().then(()=>h())}else return Promise.all([r(),s(n.delay)])}function She(e,t,n=0,c=0,i=0,r=1,s){const d=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),d.push(mw(l,t,{...s,delay:n+(typeof c=="function"?0:c)+Iq(e.variantChildren,l,c,i,r)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(d)}function jhe(e,t,n={}){e.notify("AnimationStart",t);let c;if(Array.isArray(t)){const i=t.map(r=>mw(e,r,n));c=Promise.all(i)}else if(typeof t=="string")c=mw(e,t,n);else{const i=typeof t=="function"?c1(e,t,n.custom):t;c=Promise.all(Lq(e,i,n))}return c.then(()=>{e.notify("AnimationComplete",t)})}function bq(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let c=0;c<n;c++)if(t[c]!==e[c])return!1;return!0}const $he=Kw.length;function wq(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?wq(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<$he;n++){const c=Kw[n],i=e.props[c];(U1(i)||i===!1)&&(t[c]=i)}return t}const qhe=[...Gw].reverse(),Ahe=Gw.length;function zhe(e){return t=>Promise.all(t.map(({animation:n,options:c})=>jhe(e,n,c)))}function Vhe(e){let t=zhe(e),n=sN(),c=!0;const i=l=>(h,u)=>{const p=c1(e,u,l==="exit"?e.presenceContext?.custom:void 0);if(p){const{transition:y,transitionEnd:f,...g}=p;h={...h,...g,...f}}return h};function r(l){t=l(e)}function s(l){const{props:h}=e,u=wq(e.parent)||{},p=[],y=new Set;let f={},g=1/0;for(let x=0;x<Ahe;x++){const M=qhe[x],v=n[M],I=h[M]!==void 0?h[M]:u[M],b=U1(I),w=M===l?v.isActive:null;w===!1&&(g=x);let C=I===u[M]&&I!==h[M]&&b;if(C&&c&&e.manuallyAnimateOnMount&&(C=!1),v.protectedKeys={...f},!v.isActive&&w===null||!I&&!v.prevProp||SL(I)||typeof I=="boolean")continue;const _=Phe(v.prevProp,I);let L=_||M===l&&v.isActive&&!C&&b||x>g&&b,S=!1;const N=Array.isArray(I)?I:[I];let j=N.reduce(i(M),{});w===!1&&(j={});const{prevResolvedValues:q={}}=v,H={...q,...j},B=$=>{L=!0,y.has($)&&(S=!0,y.delete($)),v.needsAnimating[$]=!0;const D=e.getValue($);D&&(D.liveStyle=!1)};for(const $ in H){const D=j[$],R=q[$];if(f.hasOwnProperty($))continue;let V=!1;yw(D)&&yw(R)?V=!bq(D,R):V=D!==R,V?D!=null?B($):y.add($):D!==void 0&&y.has($)?B($):v.protectedKeys[$]=!0}v.prevProp=I,v.prevResolvedValues=j,v.isActive&&(f={...f,...j}),c&&e.blockInitialAnimation&&(L=!1);const A=C&&_;L&&(!A||S)&&p.push(...N.map($=>{const D={type:M};if(typeof $=="string"&&c&&!A&&e.manuallyAnimateOnMount&&e.parent){const{parent:R}=e,V=c1(R,$);if(R.enteringChildren&&V){const{delayChildren:O}=V.transition||{};D.delay=Iq(R.enteringChildren,e,O)}}return{animation:$,options:D}}))}if(y.size){const x={};if(typeof h.initial!="boolean"){const M=c1(e,Array.isArray(h.initial)?h.initial[0]:h.initial);M&&M.transition&&(x.transition=M.transition)}y.forEach(M=>{const v=e.getBaseTarget(M),I=e.getValue(M);I&&(I.liveStyle=!0),x[M]=v??null}),p.push({animation:x})}let m=!!p.length;return c&&(h.initial===!1||h.initial===h.animate)&&!e.manuallyAnimateOnMount&&(m=!1),c=!1,m?t(p):Promise.resolve()}function d(l,h){if(n[l].isActive===h)return Promise.resolve();e.variantChildren?.forEach(p=>p.animationState?.setActive(l,h)),n[l].isActive=h;const u=s(l);for(const p in n)n[p].protectedKeys={};return u}return{animateChanges:s,setActive:d,setAnimateFunction:r,getState:()=>n,reset:()=>{n=sN()}}}function Phe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!bq(t,e):!1}function Ot(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function sN(){return{animate:Ot(!0),whileInView:Ot(),whileHover:Ot(),whileTap:Ot(),whileDrag:Ot(),whileFocus:Ot(),exit:Ot()}}class Rt{constructor(t){this.isMounted=!1,this.node=t}update(){}}class The extends Rt{constructor(t){super(t),t.animationState||(t.animationState=Vhe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();SL(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Hhe=0;class Dhe extends Rt{constructor(){super(...arguments),this.id=Hhe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:c}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===c)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Bhe={animation:{Feature:The},exit:{Feature:Dhe}};function G1(e,t,n,c={passive:!0}){return e.addEventListener(t,n,c),()=>e.removeEventListener(t,n)}function J1(e){return{point:{x:e.pageX,y:e.pageY}}}const Rhe=e=>t=>Ww(t)&&e(t,J1(t));function H1(e,t,n,c){return G1(e,t,Rhe(n),c)}const Cq=1e-4,Fhe=1-Cq,Ehe=1+Cq,Nq=.01,Ohe=0-Nq,Uhe=0+Nq;function Re(e){return e.max-e.min}function Whe(e,t,n){return Math.abs(e-t)<=n}function dN(e,t,n,c=.5){e.origin=c,e.originPoint=ge(t.min,t.max,e.origin),e.scale=Re(n)/Re(t),e.translate=ge(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Fhe&&e.scale<=Ehe||isNaN(e.scale))&&(e.scale=1),(e.translate>=Ohe&&e.translate<=Uhe||isNaN(e.translate))&&(e.translate=0)}function D1(e,t,n,c){dN(e.x,t.x,n.x,c?c.originX:void 0),dN(e.y,t.y,n.y,c?c.originY:void 0)}function lN(e,t,n){e.min=n.min+t.min,e.max=e.min+Re(t)}function Ghe(e,t,n){lN(e.x,t.x,n.x),lN(e.y,t.y,n.y)}function hN(e,t,n){e.min=t.min-n.min,e.max=e.min+Re(t)}function B1(e,t,n){hN(e.x,t.x,n.x),hN(e.y,t.y,n.y)}function et(e){return[e("x"),e("y")]}const Sq=({current:e})=>e?e.ownerDocument.defaultView:null,uN=(e,t)=>Math.abs(e-t);function Khe(e,t){const n=uN(e.x,t.x),c=uN(e.y,t.y);return Math.sqrt(n**2+c**2)}class jq{constructor(t,n,{transformPagePoint:c,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=oI(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,g=Khe(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!f&&!g)return;const{point:m}=y,{timestamp:x}=qe;this.history.push({...m,timestamp:x});const{onStart:M,onMove:v}=this.handlers;f||(M&&M(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,y)},this.handlePointerMove=(y,f)=>{this.lastMoveEvent=y,this.lastMoveEventInfo=nI(f,this.transformPagePoint),fe.update(this.updatePoint,!0)},this.handlePointerUp=(y,f)=>{this.end();const{onEnd:g,onSessionEnd:m,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const M=oI(y.type==="pointercancel"?this.lastMoveEventInfo:nI(f,this.transformPagePoint),this.history);this.startEvent&&g&&g(y,M),m&&m(y,M)},!Ww(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=c,this.distanceThreshold=s,this.contextWindow=i||window;const d=J1(t),l=nI(d,this.transformPagePoint),{point:h}=l,{timestamp:u}=qe;this.history=[{...h,timestamp:u}];const{onSessionStart:p}=n;p&&p(t,oI(l,this.history)),this.removeListeners=Z1(H1(this.contextWindow,"pointermove",this.handlePointerMove),H1(this.contextWindow,"pointerup",this.handlePointerUp),H1(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),bt(this.updatePoint)}}function nI(e,t){return t?{point:t(e.point)}:e}function pN(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oI({point:e},t){return{point:e,delta:pN(e,$q(t)),offset:pN(e,Zhe(t)),velocity:Xhe(t,.1)}}function Zhe(e){return e[0]}function $q(e){return e[e.length-1]}function Xhe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,c=null;const i=$q(e);for(;n>=0&&(c=e[n],!(i.timestamp-c.timestamp>rt(t)));)n--;if(!c)return{x:0,y:0};const r=tt(i.timestamp-c.timestamp);if(r===0)return{x:0,y:0};const s={x:(i.x-c.x)/r,y:(i.y-c.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Yhe(e,{min:t,max:n},c){return t!==void 0&&e<t?e=c?ge(t,e,c.min):Math.max(e,t):n!==void 0&&e>n&&(e=c?ge(n,e,c.max):Math.min(e,n)),e}function yN(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Jhe(e,{top:t,left:n,bottom:c,right:i}){return{x:yN(e.x,n,i),y:yN(e.y,t,c)}}function kN(e,t){let n=t.min-e.min,c=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,c]=[c,n]),{min:n,max:c}}function Qhe(e,t){return{x:kN(e.x,t.x),y:kN(e.y,t.y)}}function eue(e,t){let n=.5;const c=Re(e),i=Re(t);return i>c?n=F1(t.min,t.max-c,e.min):c>i&&(n=F1(e.min,e.max-i,t.min)),Lt(0,1,n)}function tue(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const fw=.35;function aue(e=fw){return e===!1?e=0:e===!0&&(e=fw),{x:mN(e,"left","right"),y:mN(e,"top","bottom")}}function mN(e,t,n){return{min:fN(e,t),max:fN(e,n)}}function fN(e,t){return typeof e=="number"?e:e[t]||0}const nue=new WeakMap;class oue{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ie(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:c}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=p=>{const{dragSnapToOrigin:y}=this.getProps();y?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(J1(p).point)},s=(p,y)=>{const{drag:f,dragPropagation:g,onDragStart:m}=this.getProps();if(f&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=sle(f),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=y,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),et(M=>{let v=this.getAxisMotionValue(M).get()||0;if(mt.test(v)){const{projection:I}=this.visualElement;if(I&&I.layout){const b=I.layout.layoutBox[M];b&&(v=Re(b)*(parseFloat(v)/100))}}this.originPoint[M]=v}),m&&fe.postRender(()=>m(p,y)),kw(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},d=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y;const{dragPropagation:f,dragDirectionLock:g,onDirectionLock:m,onDrag:x}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:M}=y;if(g&&this.currentDirection===null){this.currentDirection=cue(M),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",y.point,M),this.updateAxis("y",y.point,M),this.visualElement.render(),x&&x(p,y)},l=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y,this.stop(p,y),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>et(p=>this.getAnimationState(p)==="paused"&&this.getAxisMotionValue(p).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new jq(t,{onSessionStart:r,onStart:s,onMove:d,onSessionEnd:l,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:c,contextWindow:Sq(this.visualElement)})}stop(t,n){const c=t||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!c)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:d}=this.getProps();d&&fe.postRender(()=>d(c,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:c}=this.getProps();!c&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,c){const{drag:i}=this.getProps();if(!c||!si(t,i,this.currentDirection))return;const r=this.getAxisMotionValue(t);let s=this.originPoint[t]+c[t];this.constraints&&this.constraints[t]&&(s=Yhe(s,this.constraints[t],this.elastic[t])),r.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),c=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&Xc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&c?this.constraints=Jhe(c.layoutBox,t):this.constraints=!1,this.elastic=aue(n),i!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&et(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=tue(c.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Xc(t))return!1;const c=t.current;st(c!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=ihe(c,i.root,this.visualElement.getTransformPagePoint());let s=Qhe(i.layout.layoutBox,r);if(n){const d=n(nhe(s));this.hasMutatedConstraints=!!d,d&&(s=yq(d))}return s}startAnimation(t){const{drag:n,dragMomentum:c,dragElastic:i,dragTransition:r,dragSnapToOrigin:s,onDragTransitionEnd:d}=this.getProps(),l=this.constraints||{},h=et(u=>{if(!si(u,n,this.currentDirection))return;let p=l&&l[u]||{};s&&(p={min:0,max:0});const y=i?200:1e6,f=i?40:1e7,g={type:"inertia",velocity:c?t[u]:0,bounceStiffness:y,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...r,...p};return this.startAxisValueAnimation(u,g)});return Promise.all(h).then(d)}startAxisValueAnimation(t,n){const c=this.getAxisMotionValue(t);return kw(this.visualElement,t),c.start(tC(t,c,0,n,this.visualElement,!1))}stopAnimation(){et(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){et(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,c=this.visualElement.getProps(),i=c[n];return i||this.visualElement.getValue(t,(c.initial?c.initial[t]:void 0)||0)}snapToCursor(t){et(n=>{const{drag:c}=this.getProps();if(!si(n,c,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:d}=i.layout.layoutBox[n];r.set(t[n]-ge(s,d,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:c}=this.visualElement;if(!Xc(n)||!c||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};et(s=>{const d=this.getAxisMotionValue(s);if(d&&this.constraints!==!1){const l=d.get();i[s]=eue({min:l,max:l},this.constraints[s])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",c.root&&c.root.updateScroll(),c.updateLayout(),this.resolveConstraints(),et(s=>{if(!si(s,t,null))return;const d=this.getAxisMotionValue(s),{min:l,max:h}=this.constraints[s];d.set(ge(l,h,i[s]))})}addListeners(){if(!this.visualElement.current)return;nue.set(this.visualElement,this);const t=this.visualElement.current,n=H1(t,"pointerdown",l=>{const{drag:h,dragListener:u=!0}=this.getProps();h&&u&&this.start(l)}),c=()=>{const{dragConstraints:l}=this.getProps();Xc(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",c);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),fe.read(c);const s=G1(window,"resize",()=>this.scalePositionWithinConstraints()),d=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:h})=>{this.isDragging&&h&&(et(u=>{const p=this.getAxisMotionValue(u);p&&(this.originPoint[u]+=l[u].translate,p.set(p.get()+l[u].translate))}),this.visualElement.render())});return()=>{s(),n(),r(),d&&d()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:c=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:s=fw,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:c,dragPropagation:i,dragConstraints:r,dragElastic:s,dragMomentum:d}}}function si(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function cue(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class iue extends Rt{constructor(t){super(t),this.removeGroupControls=nt,this.removeListeners=nt,this.controls=new oue(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||nt}unmount(){this.removeGroupControls(),this.removeListeners()}}const gN=e=>(t,n)=>{e&&fe.postRender(()=>e(t,n))};class rue extends Rt{constructor(){super(...arguments),this.removePointerDownListener=nt}onPointerDown(t){this.session=new jq(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Sq(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:c,onPanEnd:i}=this.node.getProps();return{onSessionStart:gN(t),onStart:gN(n),onMove:c,onEnd:(r,s)=>{delete this.session,i&&fe.postRender(()=>i(r,s))}}}mount(){this.removePointerDownListener=H1(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const hL={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function vN(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const k1={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Q.test(e))e=parseFloat(e);else return e;const n=vN(e,t.target.x),c=vN(e,t.target.y);return`${n}% ${c}%`}},sue={correct:(e,{treeScale:t,projectionDelta:n})=>{const c=e,i=Dt.parse(e);if(i.length>5)return c;const r=Dt.createTransformer(e),s=typeof i[0]!="number"?1:0,d=n.x.scale*t.x,l=n.y.scale*t.y;i[0+s]/=d,i[1+s]/=l;const h=ge(d,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=h),typeof i[3+s]=="number"&&(i[3+s]/=h),r(i)}};let cI=!1;class due extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:c,layoutId:i}=this.props,{projection:r}=t;$le(lue),r&&(n.group&&n.group.add(r),c&&c.register&&i&&c.register(r),cI&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),hL.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:c,drag:i,isPresent:r}=this.props,{projection:s}=c;return s&&(s.isPresent=r,cI=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==r?s.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?s.promote():s.relegate()||fe.postRender(()=>{const d=s.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Uw.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:c}=this.props,{projection:i}=t;cI=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),c&&c.deregister&&c.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function qq(e){const[t,n]=eq(),c=k.useContext(Lw);return o.jsx(due,{...e,layoutGroup:c,switchLayoutGroup:k.useContext(uq),isPresent:t,safeToRemove:n})}const lue={borderRadius:{...k1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:k1,borderTopRightRadius:k1,borderBottomLeftRadius:k1,borderBottomRightRadius:k1,boxShadow:sue};function hue(e,t,n){const c=Ae(e)?e:Dc(e);return c.start(tC("",c,t,n)),c.animation}const uue=(e,t)=>e.depth-t.depth;class pue{constructor(){this.children=[],this.isDirty=!1}add(t){ww(this.children,t),this.isDirty=!0}remove(t){Cw(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(uue),this.isDirty=!1,this.children.forEach(t)}}function yue(e,t){const n=We.now(),c=({timestamp:i})=>{const r=i-n;r>=t&&(bt(c),e(r-t))};return fe.setup(c,!0),()=>bt(c)}const Aq=["TopLeft","TopRight","BottomLeft","BottomRight"],kue=Aq.length,xN=e=>typeof e=="string"?parseFloat(e):e,MN=e=>typeof e=="number"||Q.test(e);function mue(e,t,n,c,i,r){i?(e.opacity=ge(0,n.opacity??1,fue(c)),e.opacityExit=ge(t.opacity??1,0,gue(c))):r&&(e.opacity=ge(t.opacity??1,n.opacity??1,c));for(let s=0;s<kue;s++){const d=`border${Aq[s]}Radius`;let l=_N(t,d),h=_N(n,d);if(l===void 0&&h===void 0)continue;l||(l=0),h||(h=0),l===0||h===0||MN(l)===MN(h)?(e[d]=Math.max(ge(xN(l),xN(h),c),0),(mt.test(h)||mt.test(l))&&(e[d]+="%")):e[d]=h}(t.rotate||n.rotate)&&(e.rotate=ge(t.rotate||0,n.rotate||0,c))}function _N(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const fue=zq(0,.5,v$),gue=zq(.5,.95,nt);function zq(e,t,n){return c=>c<e?0:c>t?1:n(F1(e,t,c))}function LN(e,t){e.min=t.min,e.max=t.max}function Xe(e,t){LN(e.x,t.x),LN(e.y,t.y)}function IN(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function bN(e,t,n,c,i){return e-=t,e=ML(e,1/n,c),i!==void 0&&(e=ML(e,1/i,c)),e}function vue(e,t=0,n=1,c=.5,i,r=e,s=e){if(mt.test(t)&&(t=parseFloat(t),t=ge(s.min,s.max,t/100)-s.min),typeof t!="number")return;let d=ge(r.min,r.max,c);e===r&&(d-=t),e.min=bN(e.min,t,n,d,i),e.max=bN(e.max,t,n,d,i)}function wN(e,t,[n,c,i],r,s){vue(e,t[n],t[c],t[i],t.scale,r,s)}const xue=["x","scaleX","originX"],Mue=["y","scaleY","originY"];function CN(e,t,n,c){wN(e.x,t,xue,n?n.x:void 0,c?c.x:void 0),wN(e.y,t,Mue,n?n.y:void 0,c?c.y:void 0)}function NN(e){return e.translate===0&&e.scale===1}function Vq(e){return NN(e.x)&&NN(e.y)}function SN(e,t){return e.min===t.min&&e.max===t.max}function _ue(e,t){return SN(e.x,t.x)&&SN(e.y,t.y)}function jN(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Pq(e,t){return jN(e.x,t.x)&&jN(e.y,t.y)}function $N(e){return Re(e.x)/Re(e.y)}function qN(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Lue{constructor(){this.members=[]}add(t){ww(this.members,t),t.scheduleRender()}remove(t){if(Cw(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let c;for(let i=n;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1){c=r;break}}return c?(this.promote(c),!0):!1}promote(t,n){const c=this.lead;if(t!==c&&(this.prevLead=c,this.lead=t,t.show(),c)){c.instance&&c.scheduleRender(),t.scheduleRender(),t.resumeFrom=c,n&&(t.resumeFrom.preserveOpacity=!0),c.snapshot&&(t.snapshot=c.snapshot,t.snapshot.latestValues=c.animationValues||c.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&c.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:c}=t;n.onExitComplete&&n.onExitComplete(),c&&c.options.onExitComplete&&c.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Iue(e,t,n){let c="";const i=e.x.translate/t.x,r=e.y.translate/t.y,s=n?.z||0;if((i||r||s)&&(c=`translate3d(${i}px, ${r}px, ${s}px) `),(t.x!==1||t.y!==1)&&(c+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:h,rotate:u,rotateX:p,rotateY:y,skewX:f,skewY:g}=n;h&&(c=`perspective(${h}px) ${c}`),u&&(c+=`rotate(${u}deg) `),p&&(c+=`rotateX(${p}deg) `),y&&(c+=`rotateY(${y}deg) `),f&&(c+=`skewX(${f}deg) `),g&&(c+=`skewY(${g}deg) `)}const d=e.x.scale*t.x,l=e.y.scale*t.y;return(d!==1||l!==1)&&(c+=`scale(${d}, ${l})`),c||"none"}const iI=["","X","Y","Z"],bue=1e3;let wue=0;function rI(e,t,n,c){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),c&&(c[e]=0))}function Tq(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=_q(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",fe,!(i||r))}const{parent:c}=e;c&&!c.hasCheckedOptimisedAppear&&Tq(c)}function Hq({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:c,resetTransform:i}){return class{constructor(s={},d=t?.()){this.id=wue++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Sue),this.nodes.forEach(Aue),this.nodes.forEach(zue),this.nodes.forEach(jue)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new pue)}addEventListener(s,d){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Sw),this.eventHandlers.get(s).add(d)}notifyListeners(s,...d){const l=this.eventHandlers.get(s);l&&l.notify(...d)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=Q$(s)&&!yle(s),this.instance=s;const{layoutId:d,layout:l,visualElement:h}=this.options;if(h&&!h.current&&h.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||d)&&(this.isLayoutDirty=!0),e){let u,p=0;const y=()=>this.root.updateBlockedByResize=!1;fe.read(()=>{p=window.innerWidth}),e(s,()=>{const f=window.innerWidth;f!==p&&(p=f,this.root.updateBlockedByResize=!0,u&&u(),u=yue(y,250),hL.hasAnimatedSinceResize&&(hL.hasAnimatedSinceResize=!1,this.nodes.forEach(VN)))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&h&&(d||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:p,hasRelativeLayoutChanged:y,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||h.getDefaultTransition()||Due,{onLayoutAnimationStart:m,onLayoutAnimationComplete:x}=h.getProps(),M=!this.targetLayout||!Pq(this.targetLayout,f),v=!p&&y;if(this.options.layoutRoot||this.resumeFrom||v||p&&(M||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const I={...Ew(g,"layout"),onPlay:m,onComplete:x};(h.shouldReduceMotion||this.options.layoutRoot)&&(I.delay=0,I.type=!1),this.startAnimation(I),this.setAnimationOrigin(u,v)}else p||VN(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),bt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Vue),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Tq(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const p=this.path[u];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:d,layout:l}=this.options;if(d===void 0&&!l)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(AN);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(zN);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(que),this.nodes.forEach(Cue),this.nodes.forEach(Nue)):this.nodes.forEach(zN),this.clearAllSnapshots();const d=We.now();qe.delta=Lt(0,1e3/60,d-qe.timestamp),qe.timestamp=d,qe.isProcessing=!0,ZL.update.process(qe),ZL.preRender.process(qe),ZL.render.process(qe),qe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Uw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach($ue),this.sharedNodes.forEach(Pue)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,fe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){fe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Re(this.snapshot.measuredBox.x)&&!Re(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Ie(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(d=!1),d&&this.instance){const l=c(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!Vq(this.projectionDelta),l=this.getTransformTemplate(),h=l?l(this.latestValues,""):void 0,u=h!==this.prevTransformTemplateValue;s&&this.instance&&(d||Sc(this.latestValues)||u)&&(i(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const d=this.measurePageBox();let l=this.removeElementScroll(d);return s&&(l=this.removeTransform(l)),Bue(l),{animationId:this.root.animationId,measuredBox:d,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return Ie();const d=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Rue))){const{scroll:h}=this.root;h&&(Yc(d.x,h.offset.x),Yc(d.y,h.offset.y))}return d}removeElementScroll(s){const d=Ie();if(Xe(d,s),this.scroll?.wasRoot)return d;for(let l=0;l<this.path.length;l++){const h=this.path[l],{scroll:u,options:p}=h;h!==this.root&&u&&p.layoutScroll&&(u.wasRoot&&Xe(d,s),Yc(d.x,u.offset.x),Yc(d.y,u.offset.y))}return d}applyTransform(s,d=!1){const l=Ie();Xe(l,s);for(let h=0;h<this.path.length;h++){const u=this.path[h];!d&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Jc(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Sc(u.latestValues)&&Jc(l,u.latestValues)}return Sc(this.latestValues)&&Jc(l,this.latestValues),l}removeTransform(s){const d=Ie();Xe(d,s);for(let l=0;l<this.path.length;l++){const h=this.path[l];if(!h.instance||!Sc(h.latestValues))continue;hw(h.latestValues)&&h.updateSnapshot();const u=Ie(),p=h.measurePageBox();Xe(u,p),CN(d,h.latestValues,h.snapshot?h.snapshot.layoutBox:void 0,u)}return Sc(this.latestValues)&&CN(d,this.latestValues),d}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==qe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==d;if(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:p}=this.options;if(!(!this.layout||!(u||p))){if(this.resolvedRelativeTargetAt=qe.timestamp,!this.targetDelta&&!this.relativeTarget){const y=this.getClosestProjectingParent();y&&y.layout&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ie(),this.relativeTargetOrigin=Ie(),B1(this.relativeTargetOrigin,this.layout.layoutBox,y.layout.layoutBox),Xe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Ie(),this.targetWithTransforms=Ie()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Ghe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Xe(this.target,this.layout.layoutBox),mq(this.target,this.targetDelta)):Xe(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const y=this.getClosestProjectingParent();y&&!!y.resumingFrom==!!this.resumingFrom&&!y.options.layoutScroll&&y.target&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ie(),this.relativeTargetOrigin=Ie(),B1(this.relativeTargetOrigin,this.target,y.target),Xe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||hw(this.parent.latestValues)||kq(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const s=this.getLead(),d=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===qe.timestamp&&(l=!1),l)return;const{layout:h,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(h||u))return;Xe(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,y=this.treeScale.y;che(this.layoutCorrected,this.treeScale,this.path,d),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=Ie());const{target:f}=s;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(IN(this.prevProjectionDelta.x,this.projectionDelta.x),IN(this.prevProjectionDelta.y,this.projectionDelta.y)),D1(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==y||!qN(this.projectionDelta.x,this.prevProjectionDelta.x)||!qN(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Qc(),this.projectionDelta=Qc(),this.projectionDeltaWithTransform=Qc()}setAnimationOrigin(s,d=!1){const l=this.snapshot,h=l?l.latestValues:{},u={...this.latestValues},p=Qc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const y=Ie(),f=l?l.source:void 0,g=this.layout?this.layout.source:void 0,m=f!==g,x=this.getStack(),M=!x||x.members.length<=1,v=!!(m&&!M&&this.options.crossfade===!0&&!this.path.some(Hue));this.animationProgress=0;let I;this.mixTargetDelta=b=>{const w=b/1e3;PN(p.x,s.x,w),PN(p.y,s.y,w),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(B1(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Tue(this.relativeTarget,this.relativeTargetOrigin,y,w),I&&_ue(this.relativeTarget,I)&&(this.isProjectionDirty=!1),I||(I=Ie()),Xe(I,this.relativeTarget)),m&&(this.animationValues=u,mue(u,h,this.latestValues,w,v,M)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(bt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=fe.update(()=>{hL.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Dc(0)),this.currentAnimation=hue(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),s.onUpdate&&s.onUpdate(d)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(bue),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:d,target:l,layout:h,latestValues:u}=s;if(!(!d||!l||!h)){if(this!==s&&this.layout&&h&&Dq(this.options.animationType,this.layout.layoutBox,h.layoutBox)){l=this.target||Ie();const p=Re(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+p;const y=Re(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+y}Xe(d,l),Jc(d,u),D1(this.projectionDeltaWithTransform,this.layoutCorrected,d,u)}}registerSharedNode(s,d){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Lue),this.sharedNodes.get(s).add(d);const h=d.options.initialPromotionConfig;d.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(d):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:d,preserveFollowOpacity:l}={}){const h=this.getStack();h&&h.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let d=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(d=!0),!d)return;const h={};l.z&&rI("z",s,h,this.animationValues);for(let u=0;u<iI.length;u++)rI(`rotate${iI[u]}`,s,h,this.animationValues),rI(`skew${iI[u]}`,s,h,this.animationValues);s.render();for(const u in h)s.setStaticValue(u,h[u]),this.animationValues&&(this.animationValues[u]=h[u]);s.scheduleRender()}applyProjectionStyles(s,d){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=lL(d?.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=lL(d?.pointerEvents)||""),this.hasProjected&&!Sc(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=h.animationValues||h.latestValues;this.applyTransformsToTarget();let p=Iue(this.projectionDeltaWithTransform,this.treeScale,u);l&&(p=l(u,p)),s.transform=p;const{x:y,y:f}=this.projectionDelta;s.transformOrigin=`${y.origin*100}% ${f.origin*100}% 0`,h.animationValues?s.opacity=h===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=h===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in W1){if(u[g]===void 0)continue;const{correct:m,applyTo:x,isCSSVariable:M}=W1[g],v=p==="none"?u[g]:m(u[g],h);if(x){const I=x.length;for(let b=0;b<I;b++)s[x[b]]=v}else M?this.options.visualElement.renderState.vars[g]=v:s[g]=v}this.options.layoutId&&(s.pointerEvents=h===this?lL(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(AN),this.root.sharedNodes.clear()}}}function Cue(e){e.updateLayout()}function Nue(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:c}=e.layout,{animationType:i}=e.options,r=t.source!==e.layout.source;i==="size"?et(u=>{const p=r?t.measuredBox[u]:t.layoutBox[u],y=Re(p);p.min=n[u].min,p.max=p.min+y}):Dq(i,t.layoutBox,n)&&et(u=>{const p=r?t.measuredBox[u]:t.layoutBox[u],y=Re(n[u]);p.max=p.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+y)});const s=Qc();D1(s,n,t.layoutBox);const d=Qc();r?D1(d,e.applyTransform(c,!0),t.measuredBox):D1(d,n,t.layoutBox);const l=!Vq(s);let h=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:p,layout:y}=u;if(p&&y){const f=Ie();B1(f,t.layoutBox,p.layoutBox);const g=Ie();B1(g,n,y.layoutBox),Pq(f,g)||(h=!0),u.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=f,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:d,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:h})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function Sue(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function jue(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function $ue(e){e.clearSnapshot()}function AN(e){e.clearMeasurements()}function zN(e){e.isLayoutDirty=!1}function que(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function VN(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Aue(e){e.resolveTargetDelta()}function zue(e){e.calcProjection()}function Vue(e){e.resetSkewAndRotation()}function Pue(e){e.removeLeadSnapshot()}function PN(e,t,n){e.translate=ge(t.translate,0,n),e.scale=ge(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function TN(e,t,n,c){e.min=ge(t.min,n.min,c),e.max=ge(t.max,n.max,c)}function Tue(e,t,n,c){TN(e.x,t.x,n.x,c),TN(e.y,t.y,n.y,c)}function Hue(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Due={duration:.45,ease:[.4,0,.1,1]},HN=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),DN=HN("applewebkit/")&&!HN("chrome/")?Math.round:nt;function BN(e){e.min=DN(e.min),e.max=DN(e.max)}function Bue(e){BN(e.x),BN(e.y)}function Dq(e,t,n){return e==="position"||e==="preserve-aspect"&&!Whe($N(t),$N(n),.2)}function Rue(e){return e!==e.root&&e.scroll?.wasRoot}const Fue=Hq({attachResizeListener:(e,t)=>G1(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),sI={current:void 0},Bq=Hq({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!sI.current){const e=new Fue({});e.mount(window),e.setOptions({layoutScroll:!0}),sI.current=e}return sI.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Eue={pan:{Feature:rue},drag:{Feature:iue,ProjectionNode:Bq,MeasureLayout:qq}};function RN(e,t,n){const{props:c}=e;e.animationState&&c.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=c[i];r&&fe.postRender(()=>r(t,J1(t)))}class Oue extends Rt{mount(){const{current:t}=this.node;t&&(this.unmount=dle(t,(n,c)=>(RN(this.node,c,"Start"),i=>RN(this.node,i,"End"))))}unmount(){}}class Uue extends Rt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Z1(G1(this.node.current,"focus",()=>this.onFocus()),G1(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function FN(e,t,n){const{props:c}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&c.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=c[i];r&&fe.postRender(()=>r(t,J1(t)))}class Wue extends Rt{mount(){const{current:t}=this.node;t&&(this.unmount=ple(t,(n,c)=>(FN(this.node,c,"Start"),(i,{success:r})=>FN(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const gw=new WeakMap,dI=new WeakMap,Gue=e=>{const t=gw.get(e.target);t&&t(e)},Kue=e=>{e.forEach(Gue)};function Zue({root:e,...t}){const n=e||document;dI.has(n)||dI.set(n,{});const c=dI.get(n),i=JSON.stringify(t);return c[i]||(c[i]=new IntersectionObserver(Kue,{root:e,...t})),c[i]}function Xue(e,t,n){const c=Zue(t);return gw.set(e,n),c.observe(e),()=>{gw.delete(e),c.unobserve(e)}}const Yue={some:0,all:1};class Jue extends Rt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:c,amount:i="some",once:r}=t,s={root:n?n.current:void 0,rootMargin:c,threshold:typeof i=="number"?i:Yue[i]},d=l=>{const{isIntersecting:h}=l;if(this.isInView===h||(this.isInView=h,r&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:u,onViewportLeave:p}=this.node.getProps(),y=h?u:p;y&&y(l)};return Xue(this.node.current,s,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Que(t,n))&&this.startObserver()}unmount(){}}function Que({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const epe={inView:{Feature:Jue},tap:{Feature:Wue},focus:{Feature:Uue},hover:{Feature:Oue}},tpe={layout:{ProjectionNode:Bq,MeasureLayout:qq}},ape={...Bhe,...epe,...Eue,...tpe},aC=ahe(ape,khe);function Rq(e){const t=Bt(()=>Dc(e)),{isStatic:n}=k.useContext(CL);if(n){const[,c]=k.useState(e);k.useEffect(()=>t.on("change",c),[])}return t}function Fq(e,t){const n=Rq(t()),c=()=>n.set(t());return c(),bw(()=>{const i=()=>fe.preRender(c,!1,!0),r=e.map(s=>s.on("change",i));return()=>{r.forEach(s=>s()),bt(c)}}),n}function npe(e){T1.current=[],e();const t=Fq(T1.current,e);return T1.current=void 0,t}function ope(e,t,n,c){if(typeof e=="function")return npe(e);const i=typeof t=="function"?t:kle(t,n,c);return Array.isArray(e)?EN(e,i):EN([e],([r])=>i(r))}function EN(e,t){const n=Bt(()=>[]);return Fq(e,()=>{n.length=0;const c=e.length;for(let i=0;i<c;i++)n[i]=e[i].get();return t(n)})}class cpe{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,n){this.componentControls.forEach(c=>{c.start(t.nativeEvent||t,n)})}cancel(){this.componentControls.forEach(t=>{t.cancel()})}stop(){this.componentControls.forEach(t=>{t.stop()})}}const ipe=()=>new cpe;function rpe(){return Bt(ipe)}const Eq=k.createContext(null);function spe(e,t,n,c){if(!c)return e;const i=e.findIndex(u=>u.value===t);if(i===-1)return e;const r=c>0?1:-1,s=e[i+r];if(!s)return e;const d=e[i],l=s.layout,h=ge(l.min,l.max,.5);return r===1&&d.layout.max+n>h||r===-1&&d.layout.min+n<h?Mde(e,i,i+r):e}function dpe({children:e,as:t="ul",axis:n="y",onReorder:c,values:i,...r},s){const d=Bt(()=>aC[t]),l=[],h=k.useRef(!1);st(!!i,"Reorder.Group must be provided a values prop","reorder-values");const u={axis:n,registerItem:(p,y)=>{const f=l.findIndex(g=>p===g.value);f!==-1?l[f].layout=y[n]:l.push({value:p,layout:y[n]}),l.sort(upe)},updateOrder:(p,y,f)=>{if(h.current)return;const g=spe(l,p,y,f);l!==g&&(h.current=!0,c(g.map(hpe).filter(m=>i.indexOf(m)!==-1)))}};return k.useEffect(()=>{h.current=!1}),o.jsx(d,{...r,ref:s,ignoreStrict:!0,children:o.jsx(Eq.Provider,{value:u,children:e})})}const lpe=k.forwardRef(dpe);function hpe(e){return e.value}function upe(e,t){return e.layout.min-t.layout.min}function ON(e,t=0){return Ae(e)?e:Rq(t)}function ppe({children:e,style:t={},value:n,as:c="li",onDrag:i,layout:r=!0,...s},d){const l=Bt(()=>aC[c]),h=k.useContext(Eq),u={x:ON(t.x),y:ON(t.y)},p=ope([u.x,u.y],([m,x])=>m||x?1:"unset");st(!!h,"Reorder.Item must be a child of Reorder.Group","reorder-item-child");const{axis:y,registerItem:f,updateOrder:g}=h;return o.jsx(l,{drag:y,...s,dragSnapToOrigin:!0,style:{...t,x:u.x,y:u.y,zIndex:p},layout:r,onDrag:(m,x)=>{const{velocity:M}=x;M[y]&&g(n,u[y].get(),M[y]),i&&i(m,x)},onLayoutMeasure:m=>f(n,m),ref:d,ignoreStrict:!0,children:e})}const ype=k.forwardRef(ppe),_L=[o.jsx(V1,{size:18}),o.jsx(zt,{size:18}),o.jsx(A1,{size:18}),o.jsx(Vt,{size:18}),o.jsx(I1,{size:18}),o.jsx(L1,{size:18})],kpe=({items:e,onReorder:t,draggable:n=!1,className:c,header:i,headerStyle:r,itemsDraggable:s=!0})=>{const[d,l]=k.useState(e??[]);return k.useEffect(()=>{e&&Array.isArray(e)?(e.forEach((h,u)=>{if(h.icon==null&&(h.icon=_L[u%_L.length]),typeof h.text=="string"&&h.text.includes("/")){const p=String(h.text).split("/"),y=p[0].trim(),g=p.slice(1).join("/").trim().match(/^(\d+)(.*)$/);if(g){const m=g[1],x=g[2]??"",M=m.padStart(3,"0");h.text=`${y} / ${M}${x}`}}}),l(e)):l([])},[e]),o.jsxs("div",{className:`trend-list ${c??""}`,draggable:n,style:{position:"relative"},children:[o.jsx("div",{className:"trend-header",style:r,children:i??"Trend"}),o.jsx("div",{className:"trend-list-body",style:{opacity:n?0:1},children:o.jsx(lpe,{axis:"y",values:d,onReorder:h=>{l(h),t?.(h)},style:{display:"flex",flexDirection:"column",gap:8},children:d.map((h,u)=>o.jsx(mpe,{value:h,index:u,itemsDraggable:s},String(h.id)))})}),n&&o.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:o.jsx(a.Move,{size:48,strokeWidth:1.5,style:{opacity:.8}})})]})};function mpe({value:e,index:t}){const n=rpe(),c=_L[t%_L.length]??null;return o.jsx(ype,{value:e,dragListener:!1,dragControls:n,style:{listStyle:"none"},onDragStart:()=>{try{document.body.classList.add("is-dragging")}catch{}},onDragEnd:()=>{try{document.body.classList.remove("is-dragging")}catch{}},children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[o.jsx("div",{className:"reorder-handle","aria-hidden":!0,onPointerDown:i=>n.start(i),style:{width:28,height:28,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",userSelect:"none"},children:o.jsx("svg",{width:"25",height:"25",viewBox:"0 0 24 24","aria-hidden":!0,children:o.jsxs("g",{fill:"currentColor",children:[o.jsx("circle",{cx:"8",cy:"6",r:"2"}),o.jsx("circle",{cx:"16",cy:"6",r:"2"}),o.jsx("circle",{cx:"8",cy:"12",r:"2"}),o.jsx("circle",{cx:"16",cy:"12",r:"2"}),o.jsx("circle",{cx:"8",cy:"18",r:"2"}),o.jsx("circle",{cx:"16",cy:"18",r:"2"})]})})}),o.jsx("div",{style:{flex:1},children:o.jsx(s$,{title:e.title,subtitle:e.subtitle,text:e.text,background:e.background,titleStyle:e.titleStyle,subtitleStyle:e.subtitleStyle,textStyle:e.textStyle,itemStyle:e.itemStyle,icon:e.icon??c})})]})})}function fpe(e,t){return t.required?t.type==="checkbox"&&!e?{isValid:!1,error:`${t.label} est requis`}:!e||typeof e=="string"&&e.trim()===""?{isValid:!1,error:`${t.label} est requis`}:null:null}function gpe(e){return!e||typeof e=="string"&&e.trim()===""}function vpe(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?null:{isValid:!1,error:"Format d'email invalide"}}function xpe(e){return/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/.test(e)?null:{isValid:!1,error:"Format d'URL invalide"}}function Mpe(e,t){const n=Number(e);return isNaN(n)?{isValid:!1,error:"Doit être un nombre valide"}:t.validation?.min!==void 0&&n<Number(t.validation.min)?{isValid:!1,error:`Doit être ≥ ${t.validation.min}`}:t.validation?.max!==void 0&&n>Number(t.validation.max)?{isValid:!1,error:`Doit être ≤ ${t.validation.max}`}:null}function _pe(e,t){return t.validation?.minDate&&new Date(e)<new Date(t.validation.minDate)?{isValid:!1,error:`Doit être après ${t.validation.minDate}`}:t.validation?.maxDate&&new Date(e)>new Date(t.validation.maxDate)?{isValid:!1,error:`Doit être avant ${t.validation.maxDate}`}:null}function Lpe(e,t){if(t.validation?.acceptedTypes){const n=t.validation.acceptedTypes.split(","),c=e.type;if(!n.some(i=>c.match(i.replace("*",".*"))))return{isValid:!1,error:`Type de fichier non supporté: ${c}`}}return t.validation?.maxFileSize&&e.size>t.validation.maxFileSize?{isValid:!1,error:`Fichier trop volumineux (max ${t.validation.maxFileSize/1048576}MB)`}:null}function Ipe(e,t){return t.validation?t.validation.minLength&&e.length<t.validation.minLength?{isValid:!1,error:`Minimum ${t.validation.minLength} caractères`}:t.validation.maxLength&&e.length>t.validation.maxLength?{isValid:!1,error:`Maximum ${t.validation.maxLength} caractères`}:t.validation.pattern&&!new RegExp(t.validation.pattern).test(e)?{isValid:!1,error:"Format invalide"}:null:null}function LL(e,t){const n=fpe(e,t);if(n)return n;if(gpe(e))return{isValid:!0};const c=e.toString();switch(t.type){case"email":{const r=vpe(c);if(r)return r;break}case"url":{const r=xpe(c);if(r)return r;break}case"number":{const r=Mpe(e,t);if(r)return r;break}case"date":case"month":case"week":case"time":case"datetime-local":{const r=_pe(e,t);if(r)return r;break}case"file":{const r=Lpe(e,t);if(r)return r;break}}const i=Ipe(c,t);return i||{isValid:!0}}function Oq(e,t){const n={};let c=!0;for(const i of t){const r=LL(e[i.name],i);r.isValid||(n[i.name]=r.error,c=!1)}return{isValid:c,errors:n}}const bpe="_formContainer_14ads_1",wpe="_headerLine_14ads_17",Cpe="_formTitle_14ads_25",Npe="_formDescription_14ads_30",Spe="_sectionTitle_14ads_37",jpe="_sectionHelp_14ads_44",$pe="_fieldHelp_14ads_50",qpe="_gridContainer_14ads_58",Ape="_fieldGridItem_14ads_70",zpe="_sectionFull_14ads_105",Vpe="_formFooter_14ads_110",Ppe="_footerLeft_14ads_118",Tpe="_footerRight_14ads_119",Hpe="_cancelLink_14ads_125",Dpe="_submitButton_14ads_136",Bpe="_fieldLabel_14ads_148",Rpe="_inputWrapper_14ads_163",Fpe="_inputInner_14ads_187",Epe="_hasPrefix_14ads_196",Ope="_inputBase_14ads_196",Upe="_iconPrefix_14ads_292",Wpe="_iconSuffix_14ads_293",Gpe="_passwordToggle_14ads_319",Kpe="_fieldError_14ads_365",Zpe="_fieldInvalid_14ads_372",me={formContainer:bpe,headerLine:wpe,formTitle:Cpe,formDescription:Npe,sectionTitle:Spe,sectionHelp:jpe,fieldHelp:$pe,gridContainer:qpe,fieldGridItem:Ape,sectionFull:zpe,formFooter:Vpe,footerLeft:Ppe,footerRight:Tpe,cancelLink:Hpe,submitButton:Dpe,fieldLabel:Bpe,inputWrapper:Rpe,inputInner:Fpe,hasPrefix:Epe,inputBase:Ope,iconPrefix:Upe,iconSuffix:Wpe,passwordToggle:Gpe,fieldError:Kpe,fieldInvalid:Zpe},Uq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const[s,d]=k.useState(!1),l=e.type==="password",h=e.attributes?.showPasswordToggle??!0,u=l?s?"text":"password":e.type,p=e.attributes?.iconComponent??(e.attributes?.icon?_t[e.attributes.icon]:null),y=e.attributes?.iconPosition??"suffix",f=g=>{n(g.target.value)};return o.jsxs("div",{className:me.inputWrapper,children:[o.jsx("label",{className:`${me.fieldLabel} ${e.required?"required":""}`,htmlFor:e.name,children:e.label}),o.jsxs("div",{className:`${me.inputInner} ${p&&y==="prefix"?me.hasPrefix:""}`,children:[p&&y==="prefix"&&o.jsx("span",{className:me.iconPrefix,children:o.jsx(p,{size:16})}),o.jsx("input",{id:e.name,name:e.name,type:u,placeholder:e.placeholder,className:`${me.inputBase} ${i?me.fieldInvalid:""}`,value:t??"",onChange:f,onBlur:c,disabled:!!e.disabled,"aria-invalid":!!i,"aria-describedby":e.help?`${e.name}-help`:void 0}),l&&h&&o.jsx("button",{type:"button","aria-label":s?"Masquer le mot de passe":"Afficher le mot de passe",className:me.passwordToggle,onClick:()=>d(g=>!g),children:s?o.jsx(S1,{size:16}):o.jsx(j1,{size:16})}),p&&y==="suffix"&&!l&&o.jsx("span",{className:me.iconSuffix,children:o.jsx(p,{size:16})})]}),r&&i&&o.jsx("span",{className:me.fieldError,children:i})]})},Xpe="_fieldGroup_yb3zi_7",Ype="_fieldLabel_yb3zi_11",Jpe="_required_yb3zi_17",Qpe="_fieldInput_yb3zi_22",eye="_fieldInvalid_yb3zi_40",tye="_fieldValid_yb3zi_44",aye="_fieldError_yb3zi_48",nye="_radioGroup_yb3zi_57",Pt={fieldGroup:Xpe,fieldLabel:Ype,required:Jpe,fieldInput:Qpe,fieldInvalid:eye,fieldValid:tye,fieldError:aye,radioGroup:nye},$L=({field:e,children:t,error:n,touched:c})=>{const i=c&&n;return o.jsxs("div",{className:Pt.fieldGroup,children:[e.type!=="checkbox"&&e.type!=="radio"&&o.jsx("label",{className:`${Pt.fieldLabel} ${e.required?Pt.required:""}`,children:e.label}),t,i&&o.jsx("span",{className:Pt.fieldError,children:n})]})},Wq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=r&&i,d=r&&!i&&t,l=["form-control",Pt.fieldInput,s?Pt.fieldInvalid:"",d?Pt.fieldValid:""].filter(Boolean).join(" ");return o.jsx($L,{field:e,error:i,touched:r,children:o.jsx("textarea",{className:l,placeholder:e.placeholder,value:t||"",onChange:h=>n(h.target.value),onBlur:c,rows:4})})},oye="_wrapper_117u4_1",cye="_wrapperInvalid_117u4_15",iye="_nativeSelect_117u4_19",rye="_display_117u4_30",sye="_topLabel_117u4_37",dye="_valueLine_117u4_45",lye="_valuePlaceholder_117u4_53",hye="_valueActive_117u4_57",uye="_caret_117u4_61",pye="_error_117u4_75",yye="_optionStyle_117u4_89",Ye={wrapper:oye,wrapperInvalid:cye,nativeSelect:iye,display:rye,topLabel:sye,valueLine:dye,valuePlaceholder:lye,valueActive:hye,caret:uye,error:pye,optionStyle:yye},nC=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=!!(r&&i),d=e.label||"",l=e.placeholder||"",h=e.options?.find(u=>String(u.value)===String(t))?.label??"";return o.jsxs("div",{className:`${Ye.wrapper} ${s?Ye.wrapperInvalid:""} ${t?Ye.wrapperHasValue:""}`,children:[o.jsxs("select",{id:e.name,name:e.name,className:Ye.nativeSelect,value:t??"",onChange:u=>n(u.target.value),onBlur:c,"aria-invalid":s,"aria-label":d,children:[o.jsx("option",{value:"",disabled:!0,hidden:!0,children:l||`Sélectionnez ${d?.toLowerCase()||""}`}),e.options?.map((u,p)=>o.jsx("option",{value:u.value,className:Ye.optionStyle,children:u.label},p))]}),o.jsxs("div",{className:Ye.display,children:[d&&o.jsx("span",{className:Ye.topLabel,children:d}),o.jsx("span",{className:`${Ye.valueLine} ${t?Ye.valueActive:Ye.valuePlaceholder}`,children:t?h:l}),o.jsx("span",{className:Ye.caret,"aria-hidden":"true"})]}),s&&o.jsx("span",{className:Ye.error,children:i})]})},Gq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsx($L,{field:e,error:i,touched:r,children:o.jsxs("div",{className:"form-check",children:[o.jsx("input",{type:"checkbox",className:"form-check-input",id:e.name,checked:!!t,onChange:s=>n(s.target.checked),onBlur:c}),o.jsx("label",{className:"form-check-label",htmlFor:e.name,children:e.label})]})}),Kq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsx($L,{field:e,error:i,touched:r,children:o.jsx("div",{className:Pt.radioGroup,children:e.options?.map(s=>o.jsxs("div",{className:"form-check",children:[o.jsx("input",{type:"radio",className:"form-check-input",id:`${e.name}-${s.value}`,name:e.name,value:s.value,checked:t===s.value,onChange:d=>n(d.target.value),onBlur:c}),o.jsx("label",{className:"form-check-label",htmlFor:`${e.name}-${s.value}`,children:s.label})]},s.value))})}),kye="_fileInputContainer_r2guc_3",mye="_customFileInput_r2guc_8",fye="_fileInputLabel_r2guc_12",gye="_dragOver_r2guc_39",vye="_uploadIcon_r2guc_44",xye="_uploadText_r2guc_50",Mye="_uploadHint_r2guc_56",_ye="_fileList_r2guc_60",Lye="_fileListTitle_r2guc_69",Iye="_fileItem_r2guc_80",bye="_fileIcon_r2guc_96",wye="_fileName_r2guc_102",Cye="_fileSize_r2guc_108",Nye="_removeButton_r2guc_114",Sye="_errorText_r2guc_129",Pe={fileInputContainer:kye,customFileInput:mye,fileInputLabel:fye,dragOver:gye,uploadIcon:vye,uploadText:xye,uploadHint:Mye,fileList:_ye,fileListTitle:Lye,fileItem:Iye,fileIcon:bye,fileName:wye,fileSize:Cye,removeButton:Nye,errorText:Sye},Zq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=k.useRef(null),[d,l]=k.useState(!1),h=x=>{n(x.target.files)},u=()=>{s.current&&s.current.click()},p=x=>{x.preventDefault(),l(!0)},y=()=>{l(!1)},f=x=>{x.preventDefault(),l(!1),x.dataTransfer.files&&x.dataTransfer.files.length>0&&n(x.dataTransfer.files)},g=x=>{if(!t)return;const M=Array.from(t);M.splice(x,1);const v=new DataTransfer;M.forEach(I=>v.items.add(I)),n(v.files)},m=x=>{if(x===0)return"0 Bytes";const M=1024,v=["Bytes","KB","MB","GB"],I=Math.floor(Math.log(x)/Math.log(M));return parseFloat((x/Math.pow(M,I)).toFixed(2))+" "+v[I]};return o.jsxs("div",{className:`${Pe.fileInputContainer} ${r&&i?Pe.hasError:""}`,children:[o.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,e.required&&o.jsx("span",{className:"text-danger",children:" *"})]}),o.jsx("input",{type:"file",id:e.name,name:e.name,multiple:e.attributes?.multiple||!1,accept:e.attributes?.accept,onChange:h,onBlur:c,ref:s,className:Pe.customFileInput}),o.jsxs("label",{htmlFor:e.name,className:`${Pe.fileInputLabel} ${d?Pe.dragOver:""}`,onDragOver:p,onDragLeave:y,onDrop:f,onClick:u,tabIndex:0,children:[o.jsx("div",{className:Pe.uploadIcon,children:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",fill:"currentColor",viewBox:"0 0 16 16",children:[o.jsx("path",{d:"M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"}),o.jsx("path",{d:"M7.646 1.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 2.707V11.5a.5.5 0 0 1-1 0V2.707L5.354 4.854a.5.5 0 1 1-.708-.708l3-3z"})]})}),o.jsx("div",{className:Pe.uploadText,children:d?"Déposez vos fichiers ici":"Cliquez ou glissez-déposez pour téléverser"}),o.jsxs("div",{className:Pe.uploadHint,children:[e.attributes?.accept||"Tous les fichiers"," ",e.attributes?.multiple?"(Multiple autorisé)":""]})]}),t&&t.length>0&&o.jsxs("div",{className:Pe.fileList,children:[o.jsx("div",{className:Pe.fileListTitle,children:"Fichiers sélectionnés:"}),o.jsx("ul",{children:Array.from(t).map((x,M)=>o.jsxs("li",{className:Pe.fileItem,children:[o.jsx("div",{className:Pe.fileIcon,children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:o.jsx("path",{d:"M4 0h5.293A1 1 0 0 1 10 .293L13.707 4a1 1 0 0 1 .293.707V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm5.5 1.5v2a1 1 0 0 0 1 1h2l-3-3z"})})}),o.jsx("div",{className:Pe.fileName,children:x.name}),o.jsx("div",{className:Pe.fileSize,children:m(x.size)}),o.jsx("button",{type:"button",className:Pe.removeButton,onClick:v=>{v.stopPropagation(),g(M)},"aria-label":`Supprimer ${x.name}`,children:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:[o.jsx("path",{d:"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"}),o.jsx("path",{fillRule:"evenodd",d:"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"})]})})]},M))})]}),r&&i&&o.jsx("div",{className:Pe.errorText,children:i})]})},jye="_container_ecah4_2",$ye="_label_ecah4_6",qye="_requiredIndicator_ecah4_13",Aye="_input_ecah4_18",zye="_inputError_ecah4_49",Vye="_errorMessage_ecah4_58",Wc={container:jye,label:$ye,requiredIndicator:qye,input:Aye,inputError:zye,errorMessage:Vye},Xq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r,labelColor:s="black",backgroundColor:d="white"})=>{const l=e.type==="month"?"month":e.type==="week"?"week":e.type==="time"?"time":e.type==="datetime-local"?"datetime-local":"date";return o.jsxs("div",{className:Wc.container,children:[o.jsxs("label",{htmlFor:e.name,className:Wc.label,style:{color:s},children:[e.label,e.required&&o.jsx("span",{className:Wc.requiredIndicator,children:"*"})]}),o.jsx("input",{type:l,id:e.name,name:e.name,value:t||"",onChange:h=>n(h.target.value),onBlur:c,className:`${Wc.input} ${r&&i?Wc.inputError:""}`,style:{color:s,backgroundColor:d},min:e.validation?.min,max:e.validation?.max,step:e.type==="time"?e.attributes?.step:void 0,disabled:e.disabled}),r&&i&&o.jsx("div",{className:Wc.errorMessage,children:i})]})},Pye="_rangeContainer_cyqk3_3",Tye={rangeContainer:Pye},Yq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsxs("div",{className:`mb-3 ${Tye.rangeContainer}`,children:[o.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,": ",t,e.required&&o.jsx("span",{className:"text-danger",children:" *"})]}),o.jsx("input",{type:"range",id:e.name,name:e.name,value:t||0,onChange:s=>n(s.target.value),onBlur:c,className:`form-range ${r&&i?"is-invalid":""}`,min:e.validation?.min||0,max:e.validation?.max||100,step:e.attributes?.step||1}),r&&i&&o.jsx("div",{className:"invalid-feedback",children:i})]}),Hye="_colorPickerContainer_1wxgj_2",Dye="_colorInput_1wxgj_19",Bye="_colorValue_1wxgj_39",lI={colorPickerContainer:Hye,colorInput:Dye,colorValue:Bye},Jq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsxs("div",{className:"mb-3",children:[o.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,e.required&&o.jsx("span",{className:"text-danger",children:" *"})]}),o.jsxs("div",{className:lI.colorPickerContainer,children:[o.jsx("input",{type:"color",id:e.name,name:e.name,value:t||"#000000",onChange:s=>n(s.target.value),onBlur:c,className:lI.colorInput}),o.jsx("span",{className:lI.colorValue,children:t})]}),r&&i&&o.jsx("div",{className:"invalid-feedback",children:i})]}),Qq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=["date","month","week","time","datetime-local"];if(e.type==="file")return o.jsx(Zq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(s.includes(e.type))return o.jsx(Xq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(e.type==="range")return o.jsx(Yq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(e.type==="color")return o.jsx(Jq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});switch(e.type){case"textarea":return o.jsx(Wq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"select":return o.jsx(nC,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"checkbox":return o.jsx(Gq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"radio":return o.jsx(Kq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});default:return o.jsx(Uq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})}};var hI,UN;function Rye(){if(UN)return hI;UN=1;function e(){this.__data__=[],this.size=0}return hI=e,hI}var uI,WN;function eA(){if(WN)return uI;WN=1;function e(t,n){return t===n||t!==t&&n!==n}return uI=e,uI}var pI,GN;function qL(){if(GN)return pI;GN=1;var e=eA();function t(n,c){for(var i=n.length;i--;)if(e(n[i][0],c))return i;return-1}return pI=t,pI}var yI,KN;function Fye(){if(KN)return yI;KN=1;var e=qL(),t=Array.prototype,n=t.splice;function c(i){var r=this.__data__,s=e(r,i);if(s<0)return!1;var d=r.length-1;return s==d?r.pop():n.call(r,s,1),--this.size,!0}return yI=c,yI}var kI,ZN;function Eye(){if(ZN)return kI;ZN=1;var e=qL();function t(n){var c=this.__data__,i=e(c,n);return i<0?void 0:c[i][1]}return kI=t,kI}var mI,XN;function Oye(){if(XN)return mI;XN=1;var e=qL();function t(n){return e(this.__data__,n)>-1}return mI=t,mI}var fI,YN;function Uye(){if(YN)return fI;YN=1;var e=qL();function t(n,c){var i=this.__data__,r=e(i,n);return r<0?(++this.size,i.push([n,c])):i[r][1]=c,this}return fI=t,fI}var gI,JN;function AL(){if(JN)return gI;JN=1;var e=Rye(),t=Fye(),n=Eye(),c=Oye(),i=Uye();function r(s){var d=-1,l=s==null?0:s.length;for(this.clear();++d<l;){var h=s[d];this.set(h[0],h[1])}}return r.prototype.clear=e,r.prototype.delete=t,r.prototype.get=n,r.prototype.has=c,r.prototype.set=i,gI=r,gI}var vI,QN;function Wye(){if(QN)return vI;QN=1;var e=AL();function t(){this.__data__=new e,this.size=0}return vI=t,vI}var xI,eS;function Gye(){if(eS)return xI;eS=1;function e(t){var n=this.__data__,c=n.delete(t);return this.size=n.size,c}return xI=e,xI}var MI,tS;function Kye(){if(tS)return MI;tS=1;function e(t){return this.__data__.get(t)}return MI=e,MI}var _I,aS;function Zye(){if(aS)return _I;aS=1;function e(t){return this.__data__.has(t)}return _I=e,_I}var LI,nS;function tA(){if(nS)return LI;nS=1;var e=typeof a.commonjsGlobal=="object"&&a.commonjsGlobal&&a.commonjsGlobal.Object===Object&&a.commonjsGlobal;return LI=e,LI}var II,oS;function wt(){if(oS)return II;oS=1;var e=tA(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return II=n,II}var bI,cS;function oC(){if(cS)return bI;cS=1;var e=wt(),t=e.Symbol;return bI=t,bI}var wI,iS;function Xye(){if(iS)return wI;iS=1;var e=oC(),t=Object.prototype,n=t.hasOwnProperty,c=t.toString,i=e?e.toStringTag:void 0;function r(s){var d=n.call(s,i),l=s[i];try{s[i]=void 0;var h=!0}catch{}var u=c.call(s);return h&&(d?s[i]=l:delete s[i]),u}return wI=r,wI}var CI,rS;function Yye(){if(rS)return CI;rS=1;var e=Object.prototype,t=e.toString;function n(c){return t.call(c)}return CI=n,CI}var NI,sS;function zL(){if(sS)return NI;sS=1;var e=oC(),t=Xye(),n=Yye(),c="[object Null]",i="[object Undefined]",r=e?e.toStringTag:void 0;function s(d){return d==null?d===void 0?i:c:r&&r in Object(d)?t(d):n(d)}return NI=s,NI}var SI,dS;function aA(){if(dS)return SI;dS=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return SI=e,SI}var jI,lS;function nA(){if(lS)return jI;lS=1;var e=zL(),t=aA(),n="[object AsyncFunction]",c="[object Function]",i="[object GeneratorFunction]",r="[object Proxy]";function s(d){if(!t(d))return!1;var l=e(d);return l==c||l==i||l==n||l==r}return jI=s,jI}var $I,hS;function Jye(){if(hS)return $I;hS=1;var e=wt(),t=e["__core-js_shared__"];return $I=t,$I}var qI,uS;function Qye(){if(uS)return qI;uS=1;var e=Jye(),t=function(){var c=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""}();function n(c){return!!t&&t in c}return qI=n,qI}var AI,pS;function oA(){if(pS)return AI;pS=1;var e=Function.prototype,t=e.toString;function n(c){if(c!=null){try{return t.call(c)}catch{}try{return c+""}catch{}}return""}return AI=n,AI}var zI,yS;function e4e(){if(yS)return zI;yS=1;var e=nA(),t=Qye(),n=aA(),c=oA(),i=/[\\^$.*+?()[\]{}|]/g,r=/^\[object .+?Constructor\]$/,s=Function.prototype,d=Object.prototype,l=s.toString,h=d.hasOwnProperty,u=RegExp("^"+l.call(h).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(y){if(!n(y)||t(y))return!1;var f=e(y)?u:r;return f.test(c(y))}return zI=p,zI}var VI,kS;function t4e(){if(kS)return VI;kS=1;function e(t,n){return t?.[n]}return VI=e,VI}var PI,mS;function h1(){if(mS)return PI;mS=1;var e=e4e(),t=t4e();function n(c,i){var r=t(c,i);return e(r)?r:void 0}return PI=n,PI}var TI,fS;function cC(){if(fS)return TI;fS=1;var e=h1(),t=wt(),n=e(t,"Map");return TI=n,TI}var HI,gS;function VL(){if(gS)return HI;gS=1;var e=h1(),t=e(Object,"create");return HI=t,HI}var DI,vS;function a4e(){if(vS)return DI;vS=1;var e=VL();function t(){this.__data__=e?e(null):{},this.size=0}return DI=t,DI}var BI,xS;function n4e(){if(xS)return BI;xS=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return BI=e,BI}var RI,MS;function o4e(){if(MS)return RI;MS=1;var e=VL(),t="__lodash_hash_undefined__",n=Object.prototype,c=n.hasOwnProperty;function i(r){var s=this.__data__;if(e){var d=s[r];return d===t?void 0:d}return c.call(s,r)?s[r]:void 0}return RI=i,RI}var FI,_S;function c4e(){if(_S)return FI;_S=1;var e=VL(),t=Object.prototype,n=t.hasOwnProperty;function c(i){var r=this.__data__;return e?r[i]!==void 0:n.call(r,i)}return FI=c,FI}var EI,LS;function i4e(){if(LS)return EI;LS=1;var e=VL(),t="__lodash_hash_undefined__";function n(c,i){var r=this.__data__;return this.size+=this.has(c)?0:1,r[c]=e&&i===void 0?t:i,this}return EI=n,EI}var OI,IS;function r4e(){if(IS)return OI;IS=1;var e=a4e(),t=n4e(),n=o4e(),c=c4e(),i=i4e();function r(s){var d=-1,l=s==null?0:s.length;for(this.clear();++d<l;){var h=s[d];this.set(h[0],h[1])}}return r.prototype.clear=e,r.prototype.delete=t,r.prototype.get=n,r.prototype.has=c,r.prototype.set=i,OI=r,OI}var UI,bS;function s4e(){if(bS)return UI;bS=1;var e=r4e(),t=AL(),n=cC();function c(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return UI=c,UI}var WI,wS;function d4e(){if(wS)return WI;wS=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return WI=e,WI}var GI,CS;function PL(){if(CS)return GI;CS=1;var e=d4e();function t(n,c){var i=n.__data__;return e(c)?i[typeof c=="string"?"string":"hash"]:i.map}return GI=t,GI}var KI,NS;function l4e(){if(NS)return KI;NS=1;var e=PL();function t(n){var c=e(this,n).delete(n);return this.size-=c?1:0,c}return KI=t,KI}var ZI,SS;function h4e(){if(SS)return ZI;SS=1;var e=PL();function t(n){return e(this,n).get(n)}return ZI=t,ZI}var XI,jS;function u4e(){if(jS)return XI;jS=1;var e=PL();function t(n){return e(this,n).has(n)}return XI=t,XI}var YI,$S;function p4e(){if($S)return YI;$S=1;var e=PL();function t(n,c){var i=e(this,n),r=i.size;return i.set(n,c),this.size+=i.size==r?0:1,this}return YI=t,YI}var JI,qS;function cA(){if(qS)return JI;qS=1;var e=s4e(),t=l4e(),n=h4e(),c=u4e(),i=p4e();function r(s){var d=-1,l=s==null?0:s.length;for(this.clear();++d<l;){var h=s[d];this.set(h[0],h[1])}}return r.prototype.clear=e,r.prototype.delete=t,r.prototype.get=n,r.prototype.has=c,r.prototype.set=i,JI=r,JI}var QI,AS;function y4e(){if(AS)return QI;AS=1;var e=AL(),t=cC(),n=cA(),c=200;function i(r,s){var d=this.__data__;if(d instanceof e){var l=d.__data__;if(!t||l.length<c-1)return l.push([r,s]),this.size=++d.size,this;d=this.__data__=new n(l)}return d.set(r,s),this.size=d.size,this}return QI=i,QI}var eb,zS;function k4e(){if(zS)return eb;zS=1;var e=AL(),t=Wye(),n=Gye(),c=Kye(),i=Zye(),r=y4e();function s(d){var l=this.__data__=new e(d);this.size=l.size}return s.prototype.clear=t,s.prototype.delete=n,s.prototype.get=c,s.prototype.has=i,s.prototype.set=r,eb=s,eb}var tb,VS;function m4e(){if(VS)return tb;VS=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return tb=t,tb}var ab,PS;function f4e(){if(PS)return ab;PS=1;function e(t){return this.__data__.has(t)}return ab=e,ab}var nb,TS;function g4e(){if(TS)return nb;TS=1;var e=cA(),t=m4e(),n=f4e();function c(i){var r=-1,s=i==null?0:i.length;for(this.__data__=new e;++r<s;)this.add(i[r])}return c.prototype.add=c.prototype.push=t,c.prototype.has=n,nb=c,nb}var ob,HS;function v4e(){if(HS)return ob;HS=1;function e(t,n){for(var c=-1,i=t==null?0:t.length;++c<i;)if(n(t[c],c,t))return!0;return!1}return ob=e,ob}var cb,DS;function x4e(){if(DS)return cb;DS=1;function e(t,n){return t.has(n)}return cb=e,cb}var ib,BS;function iA(){if(BS)return ib;BS=1;var e=g4e(),t=v4e(),n=x4e(),c=1,i=2;function r(s,d,l,h,u,p){var y=l&c,f=s.length,g=d.length;if(f!=g&&!(y&&g>f))return!1;var m=p.get(s),x=p.get(d);if(m&&x)return m==d&&x==s;var M=-1,v=!0,I=l&i?new e:void 0;for(p.set(s,d),p.set(d,s);++M<f;){var b=s[M],w=d[M];if(h)var C=y?h(w,b,M,d,s,p):h(b,w,M,s,d,p);if(C!==void 0){if(C)continue;v=!1;break}if(I){if(!t(d,function(_,L){if(!n(I,L)&&(b===_||u(b,_,l,h,p)))return I.push(L)})){v=!1;break}}else if(!(b===w||u(b,w,l,h,p))){v=!1;break}}return p.delete(s),p.delete(d),v}return ib=r,ib}var rb,RS;function M4e(){if(RS)return rb;RS=1;var e=wt(),t=e.Uint8Array;return rb=t,rb}var sb,FS;function _4e(){if(FS)return sb;FS=1;function e(t){var n=-1,c=Array(t.size);return t.forEach(function(i,r){c[++n]=[r,i]}),c}return sb=e,sb}var db,ES;function L4e(){if(ES)return db;ES=1;function e(t){var n=-1,c=Array(t.size);return t.forEach(function(i){c[++n]=i}),c}return db=e,db}var lb,OS;function I4e(){if(OS)return lb;OS=1;var e=oC(),t=M4e(),n=eA(),c=iA(),i=_4e(),r=L4e(),s=1,d=2,l="[object Boolean]",h="[object Date]",u="[object Error]",p="[object Map]",y="[object Number]",f="[object RegExp]",g="[object Set]",m="[object String]",x="[object Symbol]",M="[object ArrayBuffer]",v="[object DataView]",I=e?e.prototype:void 0,b=I?I.valueOf:void 0;function w(C,_,L,S,N,j,q){switch(L){case v:if(C.byteLength!=_.byteLength||C.byteOffset!=_.byteOffset)return!1;C=C.buffer,_=_.buffer;case M:return!(C.byteLength!=_.byteLength||!j(new t(C),new t(_)));case l:case h:case y:return n(+C,+_);case u:return C.name==_.name&&C.message==_.message;case f:case m:return C==_+"";case p:var H=i;case g:var B=S&s;if(H||(H=r),C.size!=_.size&&!B)return!1;var A=q.get(C);if(A)return A==_;S|=d,q.set(C,_);var z=c(H(C),H(_),S,N,j,q);return q.delete(C),z;case x:if(b)return b.call(C)==b.call(_)}return!1}return lb=w,lb}var hb,US;function b4e(){if(US)return hb;US=1;function e(t,n){for(var c=-1,i=n.length,r=t.length;++c<i;)t[r+c]=n[c];return t}return hb=e,hb}var ub,WS;function iC(){if(WS)return ub;WS=1;var e=Array.isArray;return ub=e,ub}var pb,GS;function w4e(){if(GS)return pb;GS=1;var e=b4e(),t=iC();function n(c,i,r){var s=i(c);return t(c)?s:e(s,r(c))}return pb=n,pb}var yb,KS;function C4e(){if(KS)return yb;KS=1;function e(t,n){for(var c=-1,i=t==null?0:t.length,r=0,s=[];++c<i;){var d=t[c];n(d,c,t)&&(s[r++]=d)}return s}return yb=e,yb}var kb,ZS;function N4e(){if(ZS)return kb;ZS=1;function e(){return[]}return kb=e,kb}var mb,XS;function S4e(){if(XS)return mb;XS=1;var e=C4e(),t=N4e(),n=Object.prototype,c=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,r=i?function(s){return s==null?[]:(s=Object(s),e(i(s),function(d){return c.call(s,d)}))}:t;return mb=r,mb}var fb,YS;function j4e(){if(YS)return fb;YS=1;function e(t,n){for(var c=-1,i=Array(t);++c<t;)i[c]=n(c);return i}return fb=e,fb}var gb,JS;function TL(){if(JS)return gb;JS=1;function e(t){return t!=null&&typeof t=="object"}return gb=e,gb}var vb,QS;function $4e(){if(QS)return vb;QS=1;var e=zL(),t=TL(),n="[object Arguments]";function c(i){return t(i)&&e(i)==n}return vb=c,vb}var xb,ej;function q4e(){if(ej)return xb;ej=1;var e=$4e(),t=TL(),n=Object.prototype,c=n.hasOwnProperty,i=n.propertyIsEnumerable,r=e(function(){return arguments}())?e:function(s){return t(s)&&c.call(s,"callee")&&!i.call(s,"callee")};return xb=r,xb}var M1={exports:{}},Mb,tj;function A4e(){if(tj)return Mb;tj=1;function e(){return!1}return Mb=e,Mb}M1.exports;var aj;function rA(){return aj||(aj=1,function(e,t){var n=wt(),c=A4e(),i=t&&!t.nodeType&&t,r=i&&!0&&e&&!e.nodeType&&e,s=r&&r.exports===i,d=s?n.Buffer:void 0,l=d?d.isBuffer:void 0,h=l||c;e.exports=h}(M1,M1.exports)),M1.exports}var _b,nj;function z4e(){if(nj)return _b;nj=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(c,i){var r=typeof c;return i=i??e,!!i&&(r=="number"||r!="symbol"&&t.test(c))&&c>-1&&c%1==0&&c<i}return _b=n,_b}var Lb,oj;function sA(){if(oj)return Lb;oj=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return Lb=t,Lb}var Ib,cj;function V4e(){if(cj)return Ib;cj=1;var e=zL(),t=sA(),n=TL(),c="[object Arguments]",i="[object Array]",r="[object Boolean]",s="[object Date]",d="[object Error]",l="[object Function]",h="[object Map]",u="[object Number]",p="[object Object]",y="[object RegExp]",f="[object Set]",g="[object String]",m="[object WeakMap]",x="[object ArrayBuffer]",M="[object DataView]",v="[object Float32Array]",I="[object Float64Array]",b="[object Int8Array]",w="[object Int16Array]",C="[object Int32Array]",_="[object Uint8Array]",L="[object Uint8ClampedArray]",S="[object Uint16Array]",N="[object Uint32Array]",j={};j[v]=j[I]=j[b]=j[w]=j[C]=j[_]=j[L]=j[S]=j[N]=!0,j[c]=j[i]=j[x]=j[r]=j[M]=j[s]=j[d]=j[l]=j[h]=j[u]=j[p]=j[y]=j[f]=j[g]=j[m]=!1;function q(H){return n(H)&&t(H.length)&&!!j[e(H)]}return Ib=q,Ib}var bb,ij;function P4e(){if(ij)return bb;ij=1;function e(t){return function(n){return t(n)}}return bb=e,bb}var _1={exports:{}};_1.exports;var rj;function T4e(){return rj||(rj=1,function(e,t){var n=tA(),c=t&&!t.nodeType&&t,i=c&&!0&&e&&!e.nodeType&&e,r=i&&i.exports===c,s=r&&n.process,d=function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();e.exports=d}(_1,_1.exports)),_1.exports}var wb,sj;function dA(){if(sj)return wb;sj=1;var e=V4e(),t=P4e(),n=T4e(),c=n&&n.isTypedArray,i=c?t(c):e;return wb=i,wb}var Cb,dj;function H4e(){if(dj)return Cb;dj=1;var e=j4e(),t=q4e(),n=iC(),c=rA(),i=z4e(),r=dA(),s=Object.prototype,d=s.hasOwnProperty;function l(h,u){var p=n(h),y=!p&&t(h),f=!p&&!y&&c(h),g=!p&&!y&&!f&&r(h),m=p||y||f||g,x=m?e(h.length,String):[],M=x.length;for(var v in h)(u||d.call(h,v))&&!(m&&(v=="length"||f&&(v=="offset"||v=="parent")||g&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||i(v,M)))&&x.push(v);return x}return Cb=l,Cb}var Nb,lj;function D4e(){if(lj)return Nb;lj=1;var e=Object.prototype;function t(n){var c=n&&n.constructor,i=typeof c=="function"&&c.prototype||e;return n===i}return Nb=t,Nb}var Sb,hj;function B4e(){if(hj)return Sb;hj=1;function e(t,n){return function(c){return t(n(c))}}return Sb=e,Sb}var jb,uj;function R4e(){if(uj)return jb;uj=1;var e=B4e(),t=e(Object.keys,Object);return jb=t,jb}var $b,pj;function F4e(){if(pj)return $b;pj=1;var e=D4e(),t=R4e(),n=Object.prototype,c=n.hasOwnProperty;function i(r){if(!e(r))return t(r);var s=[];for(var d in Object(r))c.call(r,d)&&d!="constructor"&&s.push(d);return s}return $b=i,$b}var qb,yj;function E4e(){if(yj)return qb;yj=1;var e=nA(),t=sA();function n(c){return c!=null&&t(c.length)&&!e(c)}return qb=n,qb}var Ab,kj;function O4e(){if(kj)return Ab;kj=1;var e=H4e(),t=F4e(),n=E4e();function c(i){return n(i)?e(i):t(i)}return Ab=c,Ab}var zb,mj;function U4e(){if(mj)return zb;mj=1;var e=w4e(),t=S4e(),n=O4e();function c(i){return e(i,n,t)}return zb=c,zb}var Vb,fj;function W4e(){if(fj)return Vb;fj=1;var e=U4e(),t=1,n=Object.prototype,c=n.hasOwnProperty;function i(r,s,d,l,h,u){var p=d&t,y=e(r),f=y.length,g=e(s),m=g.length;if(f!=m&&!p)return!1;for(var x=f;x--;){var M=y[x];if(!(p?M in s:c.call(s,M)))return!1}var v=u.get(r),I=u.get(s);if(v&&I)return v==s&&I==r;var b=!0;u.set(r,s),u.set(s,r);for(var w=p;++x<f;){M=y[x];var C=r[M],_=s[M];if(l)var L=p?l(_,C,M,s,r,u):l(C,_,M,r,s,u);if(!(L===void 0?C===_||h(C,_,d,l,u):L)){b=!1;break}w||(w=M=="constructor")}if(b&&!w){var S=r.constructor,N=s.constructor;S!=N&&"constructor"in r&&"constructor"in s&&!(typeof S=="function"&&S instanceof S&&typeof N=="function"&&N instanceof N)&&(b=!1)}return u.delete(r),u.delete(s),b}return Vb=i,Vb}var Pb,gj;function G4e(){if(gj)return Pb;gj=1;var e=h1(),t=wt(),n=e(t,"DataView");return Pb=n,Pb}var Tb,vj;function K4e(){if(vj)return Tb;vj=1;var e=h1(),t=wt(),n=e(t,"Promise");return Tb=n,Tb}var Hb,xj;function Z4e(){if(xj)return Hb;xj=1;var e=h1(),t=wt(),n=e(t,"Set");return Hb=n,Hb}var Db,Mj;function X4e(){if(Mj)return Db;Mj=1;var e=h1(),t=wt(),n=e(t,"WeakMap");return Db=n,Db}var Bb,_j;function Y4e(){if(_j)return Bb;_j=1;var e=G4e(),t=cC(),n=K4e(),c=Z4e(),i=X4e(),r=zL(),s=oA(),d="[object Map]",l="[object Object]",h="[object Promise]",u="[object Set]",p="[object WeakMap]",y="[object DataView]",f=s(e),g=s(t),m=s(n),x=s(c),M=s(i),v=r;return(e&&v(new e(new ArrayBuffer(1)))!=y||t&&v(new t)!=d||n&&v(n.resolve())!=h||c&&v(new c)!=u||i&&v(new i)!=p)&&(v=function(I){var b=r(I),w=b==l?I.constructor:void 0,C=w?s(w):"";if(C)switch(C){case f:return y;case g:return d;case m:return h;case x:return u;case M:return p}return b}),Bb=v,Bb}var Rb,Lj;function J4e(){if(Lj)return Rb;Lj=1;var e=k4e(),t=iA(),n=I4e(),c=W4e(),i=Y4e(),r=iC(),s=rA(),d=dA(),l=1,h="[object Arguments]",u="[object Array]",p="[object Object]",y=Object.prototype,f=y.hasOwnProperty;function g(m,x,M,v,I,b){var w=r(m),C=r(x),_=w?u:i(m),L=C?u:i(x);_=_==h?p:_,L=L==h?p:L;var S=_==p,N=L==p,j=_==L;if(j&&s(m)){if(!s(x))return!1;w=!0,S=!1}if(j&&!S)return b||(b=new e),w||d(m)?t(m,x,M,v,I,b):n(m,x,_,M,v,I,b);if(!(M&l)){var q=S&&f.call(m,"__wrapped__"),H=N&&f.call(x,"__wrapped__");if(q||H){var B=q?m.value():m,A=H?x.value():x;return b||(b=new e),I(B,A,M,v,b)}}return j?(b||(b=new e),c(m,x,M,v,I,b)):!1}return Rb=g,Rb}var Fb,Ij;function Q4e(){if(Ij)return Fb;Ij=1;var e=J4e(),t=TL();function n(c,i,r,s,d){return c===i?!0:c==null||i==null||!t(c)&&!t(i)?c!==c&&i!==i:e(c,i,r,s,n,d)}return Fb=n,Fb}var Eb,bj;function e5e(){if(bj)return Eb;bj=1;var e=Q4e();function t(n,c){return e(n,c)}return Eb=t,Eb}var t5e=e5e();const a5e=a.getDefaultExportFromCjs(t5e),n5e=({schema:e,initialData:t={},onSubmit:n,submitLabel:c,submitIcon:i,submitIconPosition:r="left",onCancel:s,cancelLabel:d="Retour",cancelIcon:l})=>{const[h,u]=k.useState(t),[p,y]=k.useState({}),[f,g]=k.useState({}),[m,x]=k.useState(!1),M=k.useRef(t);k.useEffect(()=>{a5e(M.current,t)||(u(t),M.current=t)},[t]);const v=(L,S)=>{const N={...h,[L]:S};if(u(N),f[L]){const j=e.fields.find(q=>q.name===L);if(j){const q=LL(S,j);y(H=>({...H,[L]:q.isValid?"":q.error}))}}},I=L=>{if(!f[L]){g(N=>({...N,[L]:!0}));const S=e.fields.find(N=>N.name===L);if(S){const N=LL(h[L],S);y(j=>({...j,[L]:N.isValid?"":N.error}))}}},b=async L=>{L.preventDefault(),x(!0);const S=e.fields.reduce((j,q)=>(q.type!=="section"&&(j[q.name]=!0),j),{});g(S);const N=Oq(h,e.fields.filter(j=>j.type!=="section"));if(y(N.errors),N.isValid)try{await n(h)}catch(j){console.error("Erreur lors de la soumission:",j),y(q=>({...q,__global:"Une erreur est survenue lors de la soumission"}))}x(!1)},w=l?_t[l]:null,C=i&&_t[i]||e.submitIcon&&_t[e.submitIcon]||null,_=e.columns&&e.columns>0?Math.floor(e.columns):12;return o.jsxs("div",{className:me.formContainer,children:[o.jsx("div",{className:me.headerLine,children:o.jsx("h2",{className:me.formTitle,children:e.title})}),e.description&&o.jsx("p",{className:me.formDescription,children:e.description}),p.__global&&o.jsx("div",{className:`alert alert-danger ${me.globalError}`,children:p.__global}),o.jsxs("form",{onSubmit:b,children:[o.jsx("div",{className:me.gridContainer,style:{gridTemplateColumns:`repeat(${_}, minmax(0, 1fr))`},children:e.fields.map(L=>{if(L.type==="section")return o.jsxs("div",{className:me.sectionFull,children:[o.jsx("h5",{className:me.sectionTitle,children:L.label}),L.help&&o.jsx("p",{className:me.sectionHelp,children:L.help})]},L.name);const N={gridColumn:`span ${Math.max(1,Math.min(_,L.gridCol??_))}`};return o.jsxs("div",{className:me.fieldGridItem,style:N,children:[o.jsx(Qq,{field:L,value:h[L.name],onChange:j=>v(L.name,j),onBlur:()=>I(L.name),error:p[L.name],touched:f[L.name]}),L.help&&o.jsx("small",{className:me.fieldHelp,children:L.help})]},L.name)})}),o.jsxs("div",{className:me.formFooter,children:[o.jsx("div",{className:me.footerLeft,children:s&&o.jsxs("button",{type:"button",className:me.cancelLink,onClick:s,children:[w&&o.jsx(w,{size:16,className:"me-2"})," ",d]})}),o.jsx("div",{className:me.footerRight,children:o.jsx(uL,{type:"submit",variant:"primary",size:"md",className:me.submitButton,disabled:m,children:m?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"spinner-border spinner-border-sm me-2",role:"status"}),"Validation..."]}):o.jsxs(o.Fragment,{children:[C&&(r==="left"||e.submitIconPosition==="left")&&o.jsx(C,{size:16,className:"me-2"}),c||e.submitText||"Valider",C&&(r==="right"||e.submitIconPosition==="right")&&o.jsx(C,{size:16,className:"ms-2"})]})})})]})]})]})};function o5e(e){return{title:e._formTitle||"Formulaire",description:e._formDescription,fields:e._fieldMetadata||[],submitText:e._submitText||"Valider"}}const wj=new Map,vw=({path:e,style:t,width:n=24,height:c=24,keepColors:i=!1,onClick:r})=>{const s=/^https?:\/\//.test(e),[d,l]=k.useState("");if(k.useEffect(()=>{if(s)return;e&&(async()=>{try{let u=wj.get(e);u||(u=fetch(e).then(m=>{if(!m.ok)throw new Error(`Failed to load ${e}`);return m.text()}),wj.set(e,u));let p=await u;const y=t?.width!==void 0?"100%":`${n}px`,f=t?.height!==void 0?"100%":`${c}px`;i||(p=p.replace(/fill="[^"]*"/g,'fill="currentColor"'),p=p.replace(/fill='[^']*'/g,"fill='currentColor'"));const g=i?`width="${y}" height="${f}"`:`width="${y}" height="${f}" fill="currentColor"`;p=p.replace(/<svg/,`<svg ${g}`),l(p)}catch(u){console.error(`Failed to load icon: ${e}`,u)}})()},[e,s,t?.width,t?.height,n,c]),s){const h=t?.width!==void 0?"100%":`${n}px`,u=t?.height!==void 0?"100%":`${c}px`;return o.jsx("span",{onClick:r,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",color:t?.color||"inherit",...t},children:o.jsx("img",{src:e,alt:"",style:{display:"block",width:h,height:u}})})}return d?o.jsx("span",{onClick:r,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",color:t?.color||"inherit",...t},dangerouslySetInnerHTML:{__html:d}}):null},c5e="_container_1gljv_85",i5e="_tableWrapper_1gljv_111",r5e="_tableControls_1gljv_117",s5e="_controlsRight_1gljv_128",d5e="_limitedRows_1gljv_151",l5e="_table_1gljv_111",h5e="_headerCell_1gljv_206",u5e="_headerContent_1gljv_220",p5e="_headerWords_1gljv_229",y5e="_headerWord_1gljv_229",k5e="_cellContent_1gljv_276",m5e="_alignLeft_1gljv_286",f5e="_alignCenter_1gljv_290",g5e="_alignRight_1gljv_294",v5e="_tableCell_1gljv_298",x5e="_tableRow_1gljv_308",M5e="_emptyRow_1gljv_385",_5e="_toggleFiltersButton_1gljv_393",L5e="_toggleSortButton_1gljv_394",I5e="_buttonTextCompact_1gljv_415",b5e="_uppercaseSmall_1gljv_450",w5e="_filtersPanel_1gljv_463",C5e="_filtersPanelInline_1gljv_481",N5e="_filtersPanelHorizontal_1gljv_492",S5e="_filtersRow_1gljv_492",j5e="_filtersActionsHorizontal_1gljv_525",$5e="_filterItemInline_1gljv_542",q5e="_filterLabel_1gljv_571",A5e="_filterInput_1gljv_576",z5e="_filterSelect_1gljv_577",V5e="_operatorSelect_1gljv_578",P5e="_operatorInput_1gljv_579",T5e="_activeFilterTag_1gljv_597",H5e="_actionsGroup_1gljv_609",D5e="_applyButton_1gljv_615",B5e="_cancelButton_1gljv_625",R5e="_columnSorterContainer_1gljv_649",F5e="_sorterControls_1gljv_654",E5e="_sortDropdownWrapper_1gljv_659",O5e="_sortDropdown_1gljv_659",U5e="_sortDropdownHeader_1gljv_679",W5e="_closeButton_1gljv_688",G5e="_sortDropdownContent_1gljv_703",K5e="_sortDropdownItem_1gljv_709",Z5e="_sortDirectionButtons_1gljv_734",X5e="_sortDirectionButton_1gljv_734",Y5e="_activeSort_1gljv_757",J5e="_sortActions_1gljv_764",Q5e="_paginationButton_1gljv_842",eke="_pageSizeSelect_1gljv_844",tke="_topPagination_1gljv_853",ake="_paginationContainer_1gljv_861",nke="_leftGroup_1gljv_874",oke="_pageSizeControls_1gljv_882",cke="_paginationInfo_1gljv_908",ike="_paginationControls_1gljv_916",rke="_disabledButton_1gljv_947",ske="_activeButton_1gljv_952",dke="_navigationButton_1gljv_962",lke="_operatorFilterContainer_1gljv_1010",hke="_rangeSeparator_1gljv_1016",uke="_activeFiltersSection_1gljv_1179",pke="_activeFiltersRow_1gljv_1184",yke="_activeFiltersList_1gljv_1192",kke="_clearAllButton_1gljv_1200",mke="_removeFilterButton_1gljv_1221",fke="_sortIndicator_1gljv_1272",gke="_active_1gljv_349",vke="_clearSortButton_1gljv_1371",xke="_loaderSpinner_1gljv_2743",Mke="_loaderSpinnerSmall_1gljv_2755",_ke="_paginationLoading_1gljv_2772",Lke="_loadingButton_1gljv_2780",Ike="_loadingIndicator_1gljv_2791",T={container:c5e,tableWrapper:i5e,tableControls:r5e,controlsRight:s5e,limitedRows:d5e,table:l5e,headerCell:h5e,headerContent:u5e,headerWords:p5e,headerWord:y5e,cellContent:k5e,alignLeft:m5e,alignCenter:f5e,alignRight:g5e,tableCell:v5e,tableRow:x5e,emptyRow:M5e,toggleFiltersButton:_5e,toggleSortButton:L5e,buttonTextCompact:I5e,uppercaseSmall:b5e,filtersPanel:w5e,filtersPanelInline:C5e,filtersPanelHorizontal:N5e,filtersRow:S5e,filtersActionsHorizontal:j5e,filterItemInline:$5e,filterLabel:q5e,filterInput:A5e,filterSelect:z5e,operatorSelect:V5e,operatorInput:P5e,activeFilterTag:T5e,actionsGroup:H5e,applyButton:D5e,cancelButton:B5e,columnSorterContainer:R5e,sorterControls:F5e,sortDropdownWrapper:E5e,sortDropdown:O5e,sortDropdownHeader:U5e,closeButton:W5e,sortDropdownContent:G5e,sortDropdownItem:K5e,sortDirectionButtons:Z5e,sortDirectionButton:X5e,activeSort:Y5e,sortActions:J5e,paginationButton:Q5e,pageSizeSelect:eke,topPagination:tke,paginationContainer:ake,leftGroup:nke,pageSizeControls:oke,paginationInfo:cke,paginationControls:ike,disabledButton:rke,activeButton:ske,navigationButton:dke,operatorFilterContainer:lke,rangeSeparator:hke,activeFiltersSection:uke,activeFiltersRow:pke,activeFiltersList:yke,clearAllButton:kke,removeFilterButton:mke,sortIndicator:fke,active:gke,clearSortButton:vke,loaderSpinner:xke,loaderSpinnerSmall:Mke,paginationLoading:_ke,loadingButton:Lke,loadingIndicator:Ike},bke=({config:e,value:t,onChange:n,disabled:c})=>o.jsxs("select",{value:t===""?"":String(t),onChange:i=>n(i.target.value===""?"":i.target.value==="true"),disabled:c,className:T.filterSelect,children:[o.jsx("option",{value:"",children:`Filtrer ${e.label}...`}),o.jsx("option",{value:"true",children:"Oui"}),o.jsx("option",{value:"false",children:"Non"})]}),wke=({config:e,value:t,onChange:n,disabled:c})=>o.jsx("input",{type:"date",value:t||"",onChange:i=>n(i.target.value),placeholder:`Filtrer ${e.label}...`,disabled:c,className:T.filterInput}),Cke=({config:e,value:t,onChange:n,disabled:c})=>{const[i,r]=k.useState([]);k.useEffect(()=>{(async()=>{if(e.asyncOptions)try{const l=await e.asyncOptions();r(l??[])}catch(l){console.error("Erreur chargement options MultiSelect:",l),r([])}else r(e.options??[])})()},[e]);const s=d=>{const l=Array.from(d.target.selectedOptions,h=>h.value);n(l)};return o.jsx("select",{multiple:!0,value:t.map(String),onChange:s,disabled:c,className:T.filterMultiSelect,children:i.map((d,l)=>o.jsx("option",{value:String(d.value),children:d.label},l))})},Cj=({config:e,value:t,onChange:n,disabled:c})=>{const[i,r]=k.useState(t||""),s=d=>{const l=d.target.value===""?"":Number(d.target.value);r(l),n(l)};return o.jsx("input",{type:"number",value:i,onChange:s,placeholder:e.placeholder||`Filtrer ${e.label}...`,disabled:c,className:T.filterInput})},Nke=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=k.useState([]),[s,d]=k.useState(!1);k.useEffect(()=>{(async()=>{if(e.asyncOptions){d(!0);try{const u=await e.asyncOptions();r(u)}catch(u){console.error("Error loading options:",u)}finally{d(!1)}}else r(e.options||[])})()},[e]);const l=h=>{const u=h.target.value;n(u)};return s?o.jsx("div",{children:"Chargement..."}):o.jsxs("select",{value:String(t||""),onChange:l,disabled:c,className:T.filterInput,children:[o.jsx("option",{value:"",children:"Select..."}),i.map(h=>o.jsx("option",{value:h.value,children:h.label},h.value))]})},Ske=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=k.useState("");k.useEffect(()=>{r(typeof t=="string"?t:String(t||""))},[t]);const s=d=>{const l=d.target.value;r(l),n(l)};return o.jsx("input",{type:"text",value:i,onChange:s,placeholder:e.placeholder||`Filtrer ${e.label}...`,disabled:c,className:T.filterInput})},jke=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=k.useState(t?.operator||""),[s,d]=k.useState(t?.value||"");k.useEffect(()=>{i&&s&&n({operator:i,value:s})},[i,s,n]);const l=u=>{r(u.target.value)},h=u=>{d(u.target.value)};return o.jsxs("div",{className:T.operatorFilterContainer,children:[o.jsxs("select",{value:i,onChange:l,disabled:c,className:T.operatorSelect,children:[o.jsx("option",{value:"",children:"Sélectionner un opérateur"}),e.operators.map(u=>o.jsx("option",{value:String(u.value),children:u.label},String(u.value)))]}),o.jsx("input",{type:"text",value:s,onChange:h,placeholder:"Valeur",disabled:c||!i,className:T.operatorInput})]})},$ke=({value:e,onChange:t,disabled:n})=>{const c=e||{},i=s=>{t({...c,start:s.target.value})},r=s=>{t({...c,end:s.target.value})};return o.jsxs("div",{className:T.dateRangeContainer,children:[o.jsx("input",{type:"date",value:c.start||"",onChange:i,disabled:n,className:T.filterInput}),o.jsx("span",{className:T.rangeSeparator,children:"→"}),o.jsx("input",{type:"date",value:c.end||"",onChange:r,disabled:n,className:T.filterInput})]})},qke=({config:e,value:t,onChange:n,disabled:c})=>{switch(e.type){case"text":case"search":return o.jsx(Ske,{config:e,value:t,onChange:n,disabled:c});case"number":return o.jsx(Cj,{config:e,value:t,onChange:n,disabled:c});case"range":return o.jsx(Cj,{config:e,value:t,onChange:n,disabled:c});case"select":return o.jsx(Nke,{config:e,value:t,onChange:n,disabled:c});case"operator":return o.jsx(jke,{config:e,value:t,onChange:n,disabled:c});case"multiselect":return o.jsx(Cke,{config:e,value:t,onChange:n,disabled:c});case"date":return o.jsx(wke,{config:e,value:t,onChange:n,disabled:c});case"daterange":return o.jsx($ke,{config:e,value:t??{start:"",end:""},onChange:n,disabled:c});case"boolean":return o.jsx(bke,{config:e,value:t,onChange:n,disabled:c});default:return o.jsxs("div",{children:["Type de filtre non supporté: ",e.type]})}},lA=({filters:e,externalFilters:t=[],onFiltersChange:n,onApply:c,isControlled:i=!1})=>{const[r,s]=k.useState([]),[d,l]=k.useState(()=>{const g={};return e.forEach(m=>{m.type==="daterange"?g[m.id]={start:"",end:""}:g[m.id]=m.defaultValue??""}),g});k.useEffect(()=>{if(!i)return;const g={...d??{}};e.forEach(m=>{m.id in g||(g[m.id]=m.type==="daterange"?{start:"",end:""}:m.defaultValue??"")}),(t||[]).forEach(m=>{!m||!m.id||(g[m.id]=m.value)}),l(g),s(t??[])},[i,JSON.stringify(t||[]),JSON.stringify(e.map(g=>g.id))]);const h=i?t:r,u=k.useCallback((g,m)=>{l(x=>({...x,[g]:m}))},[]),p=k.useCallback(async()=>{const g=[],m={...d};for(const[x,M]of Object.entries(m)){const v=e.find(w=>w.id===x);if(!v)continue;let I=M;try{typeof M=="function"&&(I=await M(m)),typeof v.executeOnApply=="function"&&(I=await v.executeOnApply(I,m))}catch{continue}if(v.type==="daterange"){const w=I?.start??"",C=I?.end??"",_=typeof w=="string"?w.trim()==="":!w,L=typeof C=="string"?C.trim()==="":!C;if(_&&L)continue}I==null||typeof I=="string"&&I.trim()===""||Array.isArray(I)&&I.length===0||typeof I=="object"&&!Array.isArray(I)&&Object.keys(I).length===0||g.push({id:x,type:v.type,value:I,label:v.label})}return i?n?.(g):(s(g),c?.(g)),g},[d,e,i,n,c]),y=k.useCallback(g=>{l(m=>({...m,[g]:void 0})),u(g,void 0)},[u]),f=k.useCallback(()=>{const g={};e.forEach(m=>{m.type==="daterange"?g[m.id]={start:"",end:""}:g[m.id]=m.defaultValue??""}),l(g),i?n?.([]):(s([]),c?.([]))},[e,i,n,c]);return{appliedFilters:h,tempFilters:d,updateFilter:u,applyFilters:p,clearFilter:y,clearAllFilters:f}},Ake=(e,t)=>{if(e==null)return!1;const n=t.value;if(n==null)return!1;switch(t.type){case"text":case"search":return String(e).toLowerCase().includes(String(n).toLowerCase());case"number":case"range":return Number(e)===Number(n);case"select":case"multiselect":return Array.isArray(n)?n.includes(e)||n.map(c=>String(c)).includes(String(e)):String(e)===String(n);case"boolean":return!!e==!!n;case"date":return new Date(e).getTime()===new Date(String(n)).getTime();case"daterange":try{if(!n||typeof n!="object")return!1;const c=n;if(!c.start||!c.end)return!1;const i=c.start,r=c.end;if(typeof i!="string"||typeof r!="string"||!i.trim()||!r.trim())return!1;const s=new Date(e).getTime(),d=new Date(i).getTime(),l=new Date(r).getTime();return isNaN(s)||isNaN(d)||isNaN(l)?!1:s>=d&&s<=l}catch(c){return console.error("Error processing daterange filter:",c),!1}case"operator":if(typeof n=="object"&&n!==null){const c=n;if(!("operator"in c)||!("value"in c))return!1;const{operator:i,value:r}=c,s=Number(e),d=Number(r);if(isNaN(s)||isNaN(d))return String(e).includes(String(r));switch(i){case"equals":return s===d;case"gt":return s>d;case"lt":return s<d;case"gte":return s>=d;case"lte":return s<=d;default:return String(e).includes(String(r))}}return!1;default:return String(e).toLowerCase().includes(String(n).toLowerCase())}};function hA(e,t,n="",c={key:null,direction:"asc"},i=1,r=10,s=[]){const d=Math.max(1,r),l=(n||"").trim().toLowerCase(),h=k.useMemo(()=>{let m=e;return l&&(m=m.filter(x=>t.some(M=>{const v=x.data[M.id];return v==null?!1:String(v).toLowerCase().includes(l)}))),s.length>0&&(m=m.filter(x=>s.every(M=>{try{const v=x.data[M.id];return Ake(v,M)}catch(v){return console.error("Error applying filter:",v),!1}}))),m},[e,t,l,s]),u=k.useMemo(()=>{if(!c?.key)return h;const m=c.key;return[...h].sort((x,M)=>{const v=x.data[m],I=M.data[m];if(v==null)return 1;if(I==null)return-1;if(typeof v=="number"&&typeof I=="number")return c.direction==="desc"?I-v:v-I;if(v instanceof Date&&I instanceof Date){const w=v.getTime()-I.getTime();return c.direction==="desc"?-w:w}const b=String(v).localeCompare(String(I),void 0,{numeric:!0,sensitivity:"base"});return c.direction==="desc"?-b:b})},[h,c]),p=u,y=Math.ceil(u.length/d),f=0,g=Math.min(i*d,u.length);return{paginatedData:p,sortedData:u,filteredData:h,totalPages:y,startIndex:f,endIndex:g}}const uA=({value:e})=>e,pA=({value:e})=>k.createElement("a",{href:`mailto:${e}`,className:"email-link"},e),yA=({value:e})=>k.createElement("a",{href:String(e),target:"_blank",rel:"noopener noreferrer",className:"text-link"},e),kA=({value:e})=>{if(!e)return null;const t={success:"success-badge",warning:"warning-badge",error:"error-badge",info:"info-badge",default:"default-badge"},n=typeof e=="object"?e.type:"default",c=typeof e=="object"?e.text:e,i=t[n]||t.default;return k.createElement("span",{className:`badge ${i}`},c)},mA=({value:e})=>{try{return new Date(e).toLocaleDateString()}catch{return String(e)}},fA=({value:e})=>k.createElement("span",{className:"number-value"},Number(e).toLocaleString()),gA=({value:e})=>k.createElement("span",{className:"currency-value"},new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR"}).format(Number(e))),vA=({value:e})=>k.createElement("div",{className:"image-container"},k.createElement("img",{src:e,alt:"Table content",className:"table-image",onError:t=>t.currentTarget.style.display="none"})),xw={renderers:{text:uA,email:pA,link:yA,badge:kA,date:mA,number:fA,currency:gA,image:vA},icons:{sortAsc:k.createElement(Ac,{className:"sort-icon active",size:14}),sortDesc:k.createElement(Ht,{className:"sort-icon active",size:14}),sortDefault:k.createElement(a1,{className:"sort-icon",size:14})}},zke=(e,t)=>{xw.renderers[e]&&console.warn(`Le renderer "${e}" existe déjà et sera écrasé.`),xw.renderers[e]=t},Vke=({filters:e,externalFilters:t=[],onFiltersChange:n,onApply:c,isControlled:i=!1,debounceTimeout:r=300,expanded:s,onToggle:d,panelPlacement:l="top",onPanelHeightChange:h,label:u="Advanced-Filters",applyLabel:p="Apply",cancelLabel:y="Cancel",clearLabel:f="Clear",applyDisabled:g=!1,loading:m=!1})=>{const[x,M]=k.useState(!1),v=typeof s=="boolean"?s:x,{appliedFilters:I,tempFilters:b,updateFilter:w,applyFilters:C,clearAllFilters:_}=lA({filters:e,externalFilters:t,onFiltersChange:n,onApply:c,isControlled:i}),L=k.useRef(null),S=k.useRef(null);k.useEffect(()=>{if(v&&L.current){const A=L.current.getBoundingClientRect().height;h?.(A)}else h?.(0)},[v,e,b,h]);const N=()=>{typeof s=="boolean"?d?.(!s):M(A=>{const z=!A;return d?.(z),z})},j=()=>e.map(A=>{const z=b?.[A.id];return z==null||typeof z=="string"&&z.trim()===""?null:{id:A.id,label:A.label,value:z}}).filter(Boolean),q=async()=>{let A;try{A=await C()}catch{A=void 0}let z=[];A&&Array.isArray(A)&&A.length>0?z=A:I&&I.length>0?z=I:z=j(),n?.(z),c?.(z)},H=()=>{d?.(!1),typeof s!="boolean"&&M(!1)},B=()=>{_(),n?.([]),c?.([])};return k.useEffect(()=>{const A=$=>{v&&S.current&&(S.current.contains($.target)||(d?.(!1),typeof s!="boolean"&&M(!1)))},z=$=>{$.key==="Escape"&&v&&(d?.(!1),typeof s!="boolean"&&M(!1))};return v&&(document.addEventListener("pointerdown",A),document.addEventListener("keydown",z)),()=>{document.removeEventListener("pointerdown",A),document.removeEventListener("keydown",z)}},[v,s,d]),o.jsxs("div",{className:T.advancedFiltersContainer,ref:S,children:[o.jsxs("button",{className:`${T.toggleFiltersButton} ${I.length>0?T.active:""} ${v?T.toggleFiltersButtonOpen:""} ${m?T.loadingButton:""}`,onClick:N,"aria-expanded":v,"aria-controls":"advanced-filters-panel",type:"button",disabled:m,children:[m?o.jsx("span",{className:T.loaderSpinnerSmall}):o.jsx(At,{size:14}),o.jsx("span",{className:T.buttonTextCompact,children:u}),I.length>0&&!m&&o.jsx("span",{className:T.filterCountBadge,"aria-hidden":!0,children:I.length}),m&&o.jsx("span",{className:T.loadingIndicator,"aria-hidden":!0,children:"Chargement..."})]}),v&&o.jsxs("div",{id:"advanced-filters-panel",ref:L,className:`${T.filtersPanel} ${l==="top"?`${T.filtersPanelInline} ${T.filtersPanelHorizontal}`:""}`,role:"region","aria-label":"Panneau de filtres avancés",children:[o.jsx("div",{className:T.filtersRow,children:e.map(A=>o.jsxs("div",{className:`${T.filterItem} ${T.filterItemInline}`,children:[o.jsxs("label",{className:T.filterLabel,children:[A.label,A.required&&o.jsx("span",{className:T.required,children:"*"})]}),o.jsx(qke,{config:A,value:b[A.id],onChange:z=>w(A.id,z),disabled:A.disabled})]},A.id))}),o.jsxs("div",{className:T.filtersActionsHorizontal,children:[o.jsx("div",{className:T.activeFiltersSection,children:I.length>0&&o.jsxs("div",{className:T.activeFiltersRow,children:[o.jsx("span",{className:T.activeLabelCompact,children:"Actifs :"}),o.jsx("div",{className:T.activeFiltersList,children:I.map(A=>o.jsxs("div",{className:T.activeFilterTag,children:[A.label??A.id,o.jsx("button",{className:T.removeFilterButton,onClick:()=>w(A.id,void 0),"aria-label":`Supprimer ${A.id}`,type:"button",children:"×"})]},A.id))}),o.jsxs("button",{className:T.clearAllButton,onClick:B,type:"button",children:[o.jsx(at,{size:12})," ",f]})]})}),o.jsxs("div",{className:T.actionsGroup,children:[o.jsx("button",{className:T.cancelButton,onClick:H,type:"button",disabled:m,children:y}),o.jsx("button",{className:`${T.applyButton} ${m?T.loadingButton:""}`,onClick:q,type:"button",disabled:g||m,"aria-disabled":g||m,children:m?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:T.loaderSpinnerSmall}),o.jsx("span",{children:"Chargement..."})]}):p})]})]})]})]})},Nj=e=>{const t=e.replace(/[^A-Za-zÀ-ÖØ-öø-ÿ]/g,"");return t.length>0&&t===t.toUpperCase()},Pke=({columns:e,sortConfig:t,onSort:n,label:c="Sort",loading:i=!1})=>{const[r,s]=k.useState(!1),d=e.filter(g=>g.sortable),l=k.useRef(null),h=t?.key!==null&&t?.key!==void 0,u=(g,m)=>{n({key:g,direction:m}),s(!1)},p=()=>{n({key:null,direction:"asc"}),s(!1)},y=()=>s(g=>!g),f=()=>{s(!1)};return k.useEffect(()=>{if(!r)return;const g=x=>{if(!l.current)return;const M=x.target;M&&!l.current.contains(M)&&s(!1)},m=x=>{x.key==="Escape"&&s(!1)};return document.addEventListener("pointerdown",g),document.addEventListener("keydown",m),()=>{document.removeEventListener("pointerdown",g),document.removeEventListener("keydown",m)}},[r]),k.useEffect(()=>{const g=document.querySelector("[data-table-wrapper]");if(!g)return;const m=g.style.overflow??"";return r?g.style.overflow="hidden":g.style.overflow=m,()=>{g.style.overflow=m}},[r]),o.jsx("div",{className:T.columnSorterContainer,ref:l,children:o.jsx("div",{className:T.sorterControls,children:d.length>0&&o.jsxs("div",{className:T.sortDropdownWrapper,ref:l,children:[o.jsxs("button",{className:`${T.toggleSortButton} ${r?T.toggleSortButtonOpen:""} ${h?T.active:""} ${i?T.loadingButton:""}`,onClick:y,"aria-expanded":r,"aria-haspopup":"true",type:"button",disabled:i,children:[i?o.jsx("span",{className:T.loaderSpinnerSmall}):o.jsx(a1,{size:14}),o.jsx("span",{className:`${T.buttonTextCompact} ${Nj(c)?T.uppercaseSmall:""}`,children:c}),h&&!i&&o.jsx("div",{className:T.sortIndicator,children:t?.direction==="asc"?o.jsx(Ac,{size:12}):o.jsx(Ht,{size:12})})]}),r&&o.jsxs("div",{className:`${T.sortDropdown} ${T.sortDropdownInline}`,role:"menu",children:[o.jsxs("div",{className:T.sortDropdownHeader,children:[o.jsx("span",{children:"Trier par:"}),o.jsx("button",{className:T.closeButton,onClick:f,"aria-label":"Fermer",type:"button",children:o.jsx(at,{size:16})})]}),o.jsx("div",{className:T.sortDropdownContent,children:d.map(g=>{const m=String(g.label??g.id),x=Nj(m);return o.jsxs("div",{className:T.sortDropdownItem,role:"menuitem",tabIndex:0,onKeyDown:M=>{M.key==="Enter"&&u(g.id,"asc")},children:[o.jsx("span",{className:`${T.columnSorterLabel} ${x?T.uppercaseSmall:""}`,title:m,"aria-label":m,children:m}),o.jsxs("div",{className:T.sortDirectionButtons,children:[o.jsx("button",{className:`${T.sortDirectionButton} ${t?.key===g.id&&t?.direction==="asc"?T.activeSort:""}`,onClick:()=>u(g.id,"asc"),title:"Trier par ordre croissant",type:"button",children:o.jsx(Ac,{size:12})}),o.jsx("button",{className:`${T.sortDirectionButton} ${t?.key===g.id&&t?.direction==="desc"?T.activeSort:""}`,onClick:()=>u(g.id,"desc"),title:"Trier par ordre décroissant",type:"button",children:o.jsx(Ht,{size:12})})]})]},g.id)})}),h&&o.jsx("div",{className:T.sortActions,children:o.jsxs("button",{className:T.clearSortButton,onClick:p,type:"button",children:[o.jsx(qt,{size:14}),o.jsx("span",{children:"Annuler le tri"})]})})]})]})})})},Tke=({currentPage:e,totalPages:t,pageSize:n,totalItems:c,itemLabel:i="items",onPageChange:r,onPageSizeChange:s,loading:d=!1})=>{const l=Math.max(1,Math.floor(t)),h=Math.min(Math.max(1,Math.floor(e)),l),u=()=>{h>1&&r(h-1)},p=()=>{if(h<t){const m=h+1;r(m)}},y=c>0?(h-1)*n+1:0,f=c>0?Math.min(h*n,c):0,g=()=>{const m=[];let M=Math.max(1,h-Math.floor(2.5)),v=M+5-1;v>l&&(v=l,M=Math.max(1,v-5+1));for(let I=M;I<=v;I++)m.push(I);return m};return o.jsxs("div",{className:T.paginationContainer,role:"navigation","aria-label":"Pagination",children:[o.jsx("div",{className:T.leftGroup,children:s&&o.jsx("div",{className:T.pageSizeControls,children:o.jsx("select",{value:n,onChange:m=>s(Number(m.target.value)),className:T.pageSizeSelect,"aria-label":"Taille de page",disabled:d,children:[10,20,30].map(m=>o.jsx("option",{value:m,children:m},m))})})}),o.jsx("div",{className:T.paginationInfo,"aria-live":"polite",children:d?o.jsxs("span",{className:T.paginationLoading,children:[o.jsx("span",{className:T.loaderSpinner}),o.jsx("span",{children:"Chargement..."})]}):`${y}-${f} ${i}`}),o.jsxs("div",{className:T.paginationControls,children:[o.jsx("button",{onClick:u,disabled:h===1||d,className:`${T.paginationButton} ${T.navigationButton} ${h===1?T.disabledButton:""} ${d?T.loadingButton:""}`,"aria-label":"Page précédente",children:d&&h>1?o.jsx("span",{className:T.loaderSpinnerSmall}):"«"}),g().map(m=>o.jsx("button",{onClick:()=>r(m),disabled:d,"aria-current":h===m?"page":void 0,className:`${T.paginationButton} ${h===m?T.activeButton:""} ${d?T.loadingButton:""}`,children:d&&h===m?o.jsx("span",{className:T.loaderSpinnerSmall}):m},m)),o.jsx("button",{onClick:p,disabled:d||h>=l,className:`${T.paginationButton} ${T.navigationButton} ${d?T.loadingButton:""} ${h>=l?T.disabledButton:""}`,"aria-label":"Page suivante",children:d?o.jsx("span",{className:T.loaderSpinnerSmall}):"»"})]})]})},Hke=(e,t)=>{if(!e)return"";if(t)return e;const n=String(e).trim();if(!n)return n;const c=n.toLowerCase();return c.charAt(0).toUpperCase()+c.slice(1)},Dke=e=>{if(!e)return!1;const t=e.trim().split(/\s+/);return e.length>18||t.length>2},Bke=({columns:e})=>o.jsx("thead",{className:T.tableHeader,children:o.jsx("tr",{children:e.map((t,n)=>{const c=t.align==="right"?T.alignRight:t.align==="left"?T.alignLeft:T.alignCenter,i=t.preserveHeaderCase===!0,r=Hke(String(t.label??""),i),s=Dke(r),d=s?r.split(/\s+/):[];return o.jsx("th",{className:`${T.headerCell} ${c}`,style:{width:t.width??void 0},"data-preserve":i?"true":"false",title:t.a11yConfig?.mode==="guide"?t.a11yConfig.description:t.a11yConfig?.mode==="key"?t.a11yConfig.key:void 0,children:o.jsx("div",{className:T.headerContent,children:s?o.jsx("div",{className:T.headerWords,children:d.map((l,h)=>o.jsx("span",{className:T.headerWord,children:l},h))}):o.jsx("span",{children:r})})},t.id??`col-${n}`)})})}),Rke=({value:e,row:t,column:n})=>{const c=n.align==="right"?T.alignRight:n.align==="left"?T.alignLeft:T.alignCenter,i=typeof n.render=="function"?n.render(e,t):e==null?"":String(e);return o.jsx("td",{className:`${T.tableCell} ${c}`,style:{width:n.width??void 0},children:o.jsx("div",{className:T.cellContent,children:i})})},Fke=({row:e,rowId:t,columns:n,onRowClick:c,index:i,getRowStyle:r})=>{const s=r?r(e):{},{backgroundColor:d,accentColor:l,...h}=s||{},u={backgroundColor:d,...h,"--row-accent":l??"transparent"};return o.jsx("tr",{className:`${T.tableRow} ${c?T.clickableRow:""}`,onClick:()=>c?.(e,i),style:u,children:n.map(p=>o.jsx(Rke,{value:e[p.id],row:e,column:p},`${t}-${p.id}`))})},Eke=({data:e,columns:t,onRowClick:n,startIndex:c,searchTerm:i,getRowStyle:r})=>e.length===0?o.jsx("tbody",{children:o.jsx("tr",{children:o.jsx("td",{colSpan:t.length,className:T.emptyRow,children:i?"Aucun résultat trouvé":"Aucune donnée disponible"})})}):o.jsx("tbody",{children:e.map((s,d)=>o.jsx(Fke,{row:s.data,rowId:s.id,columns:t,onRowClick:n,index:c+d-1,getRowStyle:r},s.id))}),xA=({columns:e=[],data:t=[],pagination:n={pageSize:10,currentPage:1},onRowClick:c,searchTerm:i="",className:r="",filterConfig:s=[],externalFilters:d=[],onFiltersChange:l,onApplyFilters:h,onSort:u,filtersControlled:p=!1,debounceTimeout:y=300,getRowStyle:f,background:g,onPageSizeChange:m,onPageChange:x,itemLabel:M="items",advancedFiltersLabel:v="Advanced-Filters",advancedFiltersActiveLabel:I,sortLabel:b="Sort",applyLabel:w="Apply",cancelLabel:C="Cancel",clearLabel:_="Clear",applyDisabled:L=!1,paginationLoading:S=!1,filtersLoading:N=!1,sortLoading:j=!1,totalCount:q=null})=>{const[H,B]=k.useState({key:null,direction:"asc"}),[A,z]=k.useState(n.currentPage??1),[$,D]=k.useState(n.pageSize??10),[R,V]=k.useState(!1),O=k.useRef(null),[J,F]=k.useState([]),K=p?d:J,pe=p?[]:J;k.useEffect(()=>{const le=n.currentPage??1,Ct=n.pageSize??10;le!==A&&z(le),Ct!==$&&D(Ct)},[n.currentPage,n.pageSize]);const{paginatedData:oe,sortedData:ve,totalPages:ie,startIndex:ae}=hA(t,e,i,H,A,$,pe),ne=ve.length,se=typeof q=="number"&&q>=0?q:ne;let ue=ie;typeof q=="number"&&q>=0&&(ue=Math.max(1,Math.ceil(q/$)));const ye=ne>10;k.useEffect(()=>{const le=Math.max(1,Math.floor(ue));A>le&&z(le),A<1&&z(1)},[ue]);const U=le=>{p||F(le),l?.(le),z(1),x?.(1)},Y=le=>{p||F(le),h?.(le),z(1),x?.(1),O.current&&O.current.style.setProperty("--filters-panel-height","0px")},ce=le=>{x?.(le),z(le)},Se=le=>{D(le),z(1),m?.(le),x?.(1)},ze=le=>{O.current&&O.current.style.setProperty("--filters-panel-height",`${Math.round(le)}px`)},xe=le=>{B(le),u?.(le)},He=le=>{V(le),!le&&O.current&&O.current.style.setProperty("--filters-panel-height","0px")};k.useEffect(()=>{(K?.length??0)>0&&V(!0)},[K]),k.useEffect(()=>{s.length>0&&K.length>0&&V(!0)},[s.length,K.length]);const je=(K?.length??0)>0&&I?I:v;return o.jsxs("div",{ref:O,className:`${T.container} ${r} ${R?T.filtersOpen:""}`,style:{background:g,"--row-height":"48px","--header-height":"56px"},children:[o.jsx("div",{className:T.tableControls,children:o.jsxs("div",{className:T.controlsRight,children:[o.jsx(Pke,{columns:e,onSort:xe,label:b,sortConfig:H,loading:j}),s.length>0&&o.jsx(Vke,{filters:s,externalFilters:K,onFiltersChange:U,onApply:Y,isControlled:p,debounceTimeout:y,expanded:R,onToggle:He,panelPlacement:"top",onPanelHeightChange:ze,label:je,applyLabel:w,cancelLabel:C,clearLabel:_,applyDisabled:L,loading:N})]})}),o.jsx("div",{className:T.topPagination,children:o.jsx(Tke,{currentPage:A,totalPages:ue,pageSize:$,totalItems:se,itemLabel:M,onPageChange:ce,onPageSizeChange:Se,loading:S})}),o.jsx("div",{className:`${T.tableWrapper} ${ye?T.limitedRows:""}`,"data-table-wrapper":!0,children:o.jsxs("table",{className:T.table,children:[o.jsx(Bke,{columns:e}),o.jsx(Eke,{data:oe,columns:e,onRowClick:c,startIndex:ae,getRowStyle:f,searchTerm:i})]})})]})};function Oke(e){const{pagination:t,totalCount:n,onPageChange:c,...i}=e,r=t?.pageSize??20,s=t?.currentPage??1,d=k.useMemo(()=>{if(n===null||typeof n>"u")return null;const p=Number(n);if(!Number.isFinite(p)||p<=0)return 1;const y=Number(r);return!Number.isFinite(y)||y<=0?1:Math.max(1,Math.ceil(p/y))},[n,r]),l=s>1,h=d===null?!1:s<d,u=p=>{typeof p=="number"&&(p<1||p<s&&!l||p>s&&!h||c?.(p))};return o.jsx(xA,{...i,pagination:{pageSize:r,currentPage:s},totalCount:n,onPageChange:u})}const Uke=({page:e,pageSize:t,total:n,onPageChange:c,itemLabel:i="élément",ofLabel:r="sur",className:s})=>{const d=Math.max(1,Math.ceil(n/t)),l=n===0?0:(e-1)*t+1,h=Math.min(e*t,n),u=n>1?`${i}s`:i;if(n===0)return null;const p=4;let y=Math.max(1,e-Math.floor(p/2)),f=y+p-1;f>d&&(f=d,y=Math.max(1,f-p+1));const g=[];for(let m=y;m<=f;m++)g.push(m);return o.jsxs(Wke,{className:s,children:[o.jsxs(Gke,{children:[l,"-",h," ",r," ",n," ",u]}),o.jsx(Kke,{}),d>1&&o.jsxs(Zke,{children:[o.jsx(di,{onClick:()=>c(1),disabled:e===1,title:"Première page",children:"<<"}),o.jsx(di,{onClick:()=>c(e-1),disabled:e===1,title:"Page précédente",children:"<"}),g.map(m=>o.jsx(Xke,{$active:m===e,onClick:()=>c(m),children:m},m)),o.jsx(di,{onClick:()=>c(e+1),disabled:e===d,title:"Page suivante",children:">"}),o.jsx(di,{onClick:()=>c(d),disabled:e===d,title:"Dernière page",children:">>"})]})]})},Wke=E.div`
8273
8273
  display: flex;
8274
8274
  align-items: center;
8275
8275
  justify-content: space-between;
package/dist/index.js CHANGED
@@ -39507,7 +39507,7 @@ const T$ = /* @__PURE__ */ new Map(), H$ = ({
39507
39507
  return k.text();
39508
39508
  }), T$.set(e, p));
39509
39509
  let u = await p;
39510
- const y = t?.width || `${n}px`, m = t?.height || `${o}px`;
39510
+ const y = t?.width !== void 0 ? "100%" : `${n}px`, m = t?.height !== void 0 ? "100%" : `${o}px`;
39511
39511
  i || (u = u.replace(/fill="[^"]*"/g, 'fill="currentColor"'), u = u.replace(/fill='[^']*'/g, "fill='currentColor'"));
39512
39512
  const g = i ? `width="${y}" height="${m}"` : `width="${y}" height="${m}" fill="currentColor"`;
39513
39513
  u = u.replace(/<svg/, `<svg ${g}`), l(u);
@@ -39516,7 +39516,7 @@ const T$ = /* @__PURE__ */ new Map(), H$ = ({
39516
39516
  }
39517
39517
  })();
39518
39518
  }, [e, s, t?.width, t?.height, n, o]), s) {
39519
- const h = t?.width || `${n}px`, p = t?.height || `${o}px`;
39519
+ const h = t?.width !== void 0 ? "100%" : `${n}px`, p = t?.height !== void 0 ? "100%" : `${o}px`;
39520
39520
  return /* @__PURE__ */ c(
39521
39521
  "span",
39522
39522
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsiky/components-r19",
3
- "version": "7.0.10",
3
+ "version": "7.0.11",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",