@tsiky/components-r19 7.0.3 → 7.0.4
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(k)&&x.removeChild(k)}},[t]),o.jsx(ule,{isPresent:t,childRef:r,sizeRef:s,children:Q.cloneElement(e,{ref:l})})}const yle=({children:e,initial:t,isPresent:n,onExitComplete:c,custom:i,presenceAffectsLayout:r,mode:s,anchorX:d,root:l})=>{const h=Bt(kle),u=m.useId();let p=!0,y=m.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}),m.useMemo(()=>{h.forEach((f,g)=>h.set(g,!1))},[n]),Q.useEffect(()=>{!n&&!h.size&&c&&c()},[n]),s==="popLayout"&&(e=o.jsx(ple,{isPresent:n,anchorX:d,root:l,children:e})),o.jsx(_L.Provider,{value:y,children:e})};function kle(){return new Map}function G$(e=!0){const t=m.useContext(_L);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:c,register:i}=t,r=m.useId();m.useEffect(()=>{if(e)return i(r)},[e]);const s=m.useCallback(()=>e&&c&&c(r),[r,c,e]);return!n&&c?[!1,s]:[!0]}const oi=e=>e.key||"";function OC(e){const t=[];return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const mle=({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]=G$(s),p=m.useMemo(()=>OC(e),[e]),y=s&&!h?[]:p.map(oi),f=m.useRef(!0),g=m.useRef(p),k=Bt(()=>new Map),[x,M]=m.useState(p),[v,I]=m.useState(p);vw(()=>{f.current=!1,g.current=p;for(let w=0;w<v.length;w++){const _=oi(v[w]);y.includes(_)?k.delete(_):k.get(_)!==!0&&k.set(_,!1)}},[v,y.length,y.join("-")]);const b=[];if(p!==x){let w=[...p];for(let _=0;_<v.length;_++){const L=v[_],S=oi(L);y.includes(S)||(w.splice(_,0,L),b.push(L))}return r==="wait"&&b.length&&(w=b),I(OC(w)),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:C}=m.useContext(fw);return o.jsx(o.Fragment,{children:v.map(w=>{const _=oi(w),L=s&&!h?!1:p===v||y.includes(_),S=()=>{if(k.has(_))k.set(_,!0);else return;let N=!0;k.forEach(j=>{j||(N=!1)}),N&&(C?.(),I(g.current),s&&u?.(),c&&c())};return o.jsx(yle,{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:w},_)})})},K$=m.createContext({strict:!1}),UC={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 UC)i1[e]={isEnabled:t=>UC[e].some(n=>!!t[n])};function fle(e){for(const t in e)i1[t]={...i1[t],...e[t]}}const gle=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 mL(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||gle.has(e)}let Z$=e=>!mL(e);function vle(e){typeof e=="function"&&(Z$=t=>t.startsWith("on")?!mL(t):e(t))}try{vle(require("@emotion/is-prop-valid").default)}catch{}function xle(e,t,n){const c={};for(const i in e)i==="values"&&typeof e.values=="object"||(Z$(i)||n===!0&&mL(i)||!t&&!mL(i)||e.draggable&&i.startsWith("onDrag"))&&(c[i]=e[i]);return c}const IL=m.createContext({});function bL(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function U1(e){return typeof e=="string"||Array.isArray(e)}const Rw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Fw=["initial",...Rw];function wL(e){return bL(e.animate)||Fw.some(t=>U1(e[t]))}function X$(e){return!!(wL(e)||e.variants)}function Mle(e,t){if(wL(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 _le(e){const{initial:t,animate:n}=Mle(e,m.useContext(IL));return m.useMemo(()=>({initial:t,animate:n}),[WC(t),WC(n)])}function WC(e){return Array.isArray(e)?e.join(" "):e}const W1={};function Lle(e){for(const t in e)W1[t]=e[t],Cw(t)&&(W1[t].isCSSVariable=!0)}function Y$(e,{layout:t,layoutId:n}){return l1.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!W1[e]||e==="opacity")}const Ile={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ble=d1.length;function wle(e,t,n){let c="",i=!0;for(let r=0;r<ble;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=R$(d,Hw[s]);if(!l){i=!1;const u=Ile[s]||s;c+=`${u}(${h}) `}n&&(t[s]=h)}}return c=c.trim(),n?c=n(t,i?"":c):i&&(c="none"),c}function Ew(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(Cw(l)){i[l]=h;continue}else{const u=R$(h,Hw[l]);l.startsWith("origin")?(d=!0,r[l]=u):c[l]=u}}if(t.transform||(s||n?c.transform=wle(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 Ow=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function J$(e,t,n){for(const c in t)!$e(t[c])&&!Y$(c,n)&&(e[c]=t[c])}function Cle({transformTemplate:e},t){return m.useMemo(()=>{const n=Ow();return Ew(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Nle(e,t){const n=e.style||{},c={};return J$(c,n,e),Object.assign(c,Cle(e,t)),c}function jle(e,t){const n={},c=Nle(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 Sle={offset:"stroke-dashoffset",array:"stroke-dasharray"},$le={offset:"strokeDashoffset",array:"strokeDasharray"};function qle(e,t,n=1,c=0,i=!0){e.pathLength=1;const r=i?Sle:$le;e[r.offset]=Y.transform(-c);const s=Y.transform(t),d=Y.transform(n);e[r.array]=`${s} ${d}`}function Q$(e,{attrX:t,attrY:n,attrScale:c,pathLength:i,pathSpacing:r=1,pathOffset:s=0,...d},l,h,u){if(Ew(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&&qle(p,i,r,s,!1)}const eq=()=>({...Ow(),attrs:{}}),tq=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ale(e,t,n,c){const i=m.useMemo(()=>{const r=eq();return Q$(r,t,tq(c),e.transformTemplate,e.style),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};J$(r,e.style,e),i.style={...r,...i.style}}return i}const zle=["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 Uw(e){return typeof e!="string"||e.includes("-")?!1:!!(zle.indexOf(e)>-1||/[A-Z]/u.test(e))}function Vle(e,t,n,{latestValues:c},i,r=!1){const d=(Uw(e)?Ale:jle)(t,c,i,e),l=xle(t,typeof e=="string",r),h=e!==m.Fragment?{...l,...d,ref:n}:{},{children:u}=t,p=m.useMemo(()=>$e(u)?u.get():u,[u]);return m.createElement(e,{...h,children:p})}function GC(e){const t=[{},{}];return e?.values.forEach((n,c)=>{t[0][c]=n.get(),t[1][c]=n.getVelocity()}),t}function Ww(e,t,n,c){if(typeof t=="function"){const[i,r]=GC(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]=GC(c);t=t(n!==void 0?n:e.custom,i,r)}return t}function iL(e){return $e(e)?e.get():e}function Ple({scrapeMotionValuesFromProps:e,createRenderState:t},n,c,i){return{latestValues:Tle(n,c,i,e),renderState:t()}}function Tle(e,t,n,c){const i={},r=c(e,{});for(const y in r)i[y]=iL(r[y]);let{initial:s,animate:d}=e;const l=wL(e),h=X$(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"&&!bL(p)){const y=Array.isArray(p)?p:[p];for(let f=0;f<y.length;f++){const g=Ww(e,y[f]);if(g){const{transitionEnd:k,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 k)i[v]=k[v]}}}return i}const aq=e=>(t,n)=>{const c=m.useContext(IL),i=m.useContext(_L),r=()=>Ple(e,t,c,i);return n?r():Bt(r)};function Gw(e,t,n){const{style:c}=e,i={};for(const r in c)($e(c[r])||t.style&&$e(t.style[r])||Y$(r,e)||n?.getValue(r)?.liveStyle!==void 0)&&(i[r]=c[r]);return i}const Hle=aq({scrapeMotionValuesFromProps:Gw,createRenderState:Ow});function nq(e,t,n){const c=Gw(e,t,n);for(const i in e)if($e(e[i])||$e(t[i])){const r=d1.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;c[r]=e[i]}return c}const Dle=aq({scrapeMotionValuesFromProps:nq,createRenderState:eq}),Ble=Symbol.for("motionComponentSymbol");function Xc(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Rle(e,t,n){return m.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 Kw=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Fle="framerAppearId",oq="data-"+Kw(Fle),cq=m.createContext({});function Ele(e,t,n,c,i){const{visualElement:r}=m.useContext(IL),s=m.useContext(K$),d=m.useContext(_L),l=m.useContext(LL).reducedMotion,h=m.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=m.useContext(cq);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&Ole(h.current,n,i,p);const y=m.useRef(!1);m.useInsertionEffect(()=>{u&&y.current&&u.update(n,d)});const f=n[oq],g=m.useRef(!!f&&!window.MotionHandoffIsComplete?.(f)&&window.MotionHasOptimisedAnimation?.(f));return vw(()=>{u&&(y.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),m.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(f)}),g.current=!1),u.enteringChildren=void 0)}),u}function Ole(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:iq(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 iq(e){if(e)return e.options.allowProjection!==!1?e.projection:iq(e.parent)}function ZL(e,{forwardMotionProps:t=!1}={},n,c){n&&fle(n);const i=Uw(e)?Dle:Hle;function r(d,l){let h;const u={...m.useContext(LL),...d,layoutId:Ule(d)},{isStatic:p}=u,y=_le(d),f=i(d,p);if(!p&&gw){Wle(u,n);const g=Gle(u);h=g.MeasureLayout,y.visualElement=Ele(e,f,u,c,g.ProjectionNode)}return o.jsxs(IL.Provider,{value:y,children:[h&&y.visualElement?o.jsx(h,{visualElement:y.visualElement,...u}):null,Vle(e,d,Rle(f,y.visualElement,l),f,p,t)]})}r.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=m.forwardRef(r);return s[Ble]=e,s}function Ule({layoutId:e}){const t=m.useContext(fw).id;return t&&e!==void 0?t+"-"+e:e}function Wle(e,t){const n=m.useContext(K$).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"):ct(!1,c,"lazy-strict-mode")}}function Gle(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 Kle(e,t){if(typeof Proxy>"u")return ZL;const n=new Map,c=(r,s)=>ZL(r,s,e,t),i=(r,s)=>(process.env.NODE_ENV!=="production"&&Iw(!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,ZL(s,void 0,e,t)),n.get(s))})}function rq({top:e,left:t,right:n,bottom:c}){return{x:{min:t,max:n},y:{min:e,max:c}}}function Zle({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Xle(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 XL(e){return e===void 0||e===1}function cw({scale:e,scaleX:t,scaleY:n}){return!XL(e)||!XL(t)||!XL(n)}function jc(e){return cw(e)||sq(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function sq(e){return KC(e.x)||KC(e.y)}function KC(e){return e&&e!=="0%"}function fL(e,t,n){const c=e-n,i=t*c;return n+i}function ZC(e,t,n,c,i){return i!==void 0&&(e=fL(e,i,c)),fL(e,n,c)+t}function iw(e,t=0,n=1,c,i){e.min=ZC(e.min,t,n,c,i),e.max=ZC(e.max,t,n,c,i)}function dq(e,{x:t,y:n}){iw(e.x,t.translate,t.scale,t.originPoint),iw(e.y,n.translate,n.scale,n.originPoint)}const XC=.999999999999,YC=1.0000000000001;function Yle(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,dq(e,s)),c&&jc(r.latestValues)&&Jc(e,r.latestValues))}t.x<YC&&t.x>XC&&(t.x=1),t.y<YC&&t.y>XC&&(t.y=1)}function Yc(e,t){e.min=e.min+t,e.max=e.max+t}function JC(e,t,n,c,i=.5){const r=ge(e.min,e.max,i);iw(e,t,n,r,c)}function Jc(e,t){JC(e.x,t.x,t.scaleX,t.scale,t.originX),JC(e.y,t.y,t.scaleY,t.scale,t.originY)}function lq(e,t){return rq(Xle(e.getBoundingClientRect(),t))}function Jle(e,t,n){const c=lq(e,n),{scroll:i}=t;return i&&(Yc(c.x,i.offset.x),Yc(c.y,i.offset.y)),c}const QC=()=>({translate:0,scale:1,origin:0,originPoint:0}),Qc=()=>({x:QC(),y:QC()}),eN=()=>({min:0,max:0}),Le=()=>({x:eN(),y:eN()}),rw={current:null},hq={current:!1};function Qle(){if(hq.current=!0,!!gw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>rw.current=e.matches;e.addEventListener("change",t),t()}else rw.current=!1}const ehe=new WeakMap;function the(e,t,n){for(const c in t){const i=t[c],r=n[c];if($e(i))e.addValue(c,i);else if($e(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 tN=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ahe{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=Pw,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=Fe.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,me.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=wL(n),this.isVariantNode=X$(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&&$e(f)&&f.set(l[y])}}mount(t){this.current=t,ehe.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)),hq.current||Qle(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:rw.current,process.env.NODE_ENV!=="production"&&Iw(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(),Lt(this.notifyUpdate),Lt(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&&me.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):Le()}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<tN.length;c++){const i=tN[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=the(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"&&(a$(c)||o$(c))?c=parseFloat(c):!dle(c)&&Dt.test(n)&&(c=B$(t,n)),this.setBaseTarget(t,$e(c)?c.get():c)),$e(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=Ww(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&&!$e(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 Lw),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Dw.render(this.render)}}class uq extends ahe{constructor(){super(...arguments),this.KeyframeResolver=X0e}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;$e(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function pq(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 nhe(e){return window.getComputedStyle(e)}class ohe extends uq{constructor(){super(...arguments),this.type="html",this.renderInstance=pq}readValueFromInstance(t,n){if(l1.has(n))return this.projection?.isProjecting?Jb(n):y0e(t,n);{const c=nhe(t),i=(Cw(n)?c.getPropertyValue(n):c[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return lq(t,n)}build(t,n,c){Ew(t,n,c.transformTemplate)}scrapeMotionValuesFromProps(t,n,c){return Gw(t,n,c)}}const yq=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 che(e,t,n,c){pq(e,t,void 0,c);for(const i in t.attrs)e.setAttribute(yq.has(i)?i:Kw(i),t.attrs[i])}class ihe extends uq{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Le}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(l1.has(n)){const c=D$(n);return c&&c.default||0}return n=yq.has(n)?n:Kw(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,c){return nq(t,n,c)}build(t,n,c){Q$(t,n,this.isSVGTag,c.transformTemplate,c.style)}renderInstance(t,n,c,i){che(t,n,c,i)}mount(t){this.isSVGTag=tq(t.tagName),super.mount(t)}}const rhe=(e,t)=>Uw(e)?new ihe(t):new ohe(t,{allowProjection:e!==m.Fragment});function c1(e,t,n){const c=e.getProps();return Ww(c,t,n!==void 0?n:c.custom,e)}const sw=e=>Array.isArray(e);function she(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Dc(n))}function dhe(e){return sw(e)?e[e.length-1]||0:e}function lhe(e,t){const n=c1(e,t);let{transitionEnd:c={},transition:i={},...r}=n||{};r={...r,...c};for(const s in r){const d=dhe(r[s]);she(e,s,d)}}function hhe(e){return!!($e(e)&&e.add)}function dw(e,t){const n=e.getValue("willChange");if(hhe(n))return n.add(t);if(!n&&_t.WillChange){const c=new _t.WillChange("auto");e.addValue("willChange",c),c.add(t)}}function kq(e){return e.props[oq]}const uhe=e=>e!==null;function phe(e,{repeat:t,repeatType:n="loop"},c){const i=e.filter(uhe),r=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[r]}const yhe={type:"spring",stiffness:500,damping:25,restSpeed:10},khe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),mhe={type:"keyframes",duration:.8},fhe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ghe=(e,{keyframes:t})=>t.length>2?mhe:l1.has(e)?e.startsWith("scale")?khe(t[1]):yhe:fhe;function vhe({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 Zw=(e,t,n,c={},i,r)=>s=>{const d=Tw(c,e)||{},l=d.delay||c.delay||0;let{elapsed:h=0}=c;h=h-ot(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};vhe(d)||Object.assign(u,ghe(e,u)),u.duration&&(u.duration=ot(u.duration)),u.repeatDelay&&(u.repeatDelay=ot(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let p=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(nw(u),u.delay===0&&(p=!0)),(_t.instantAnimations||_t.skipAnimations)&&(p=!0,nw(u),u.delay=0),u.allowFlatten=!d.type&&!d.ease,p&&!r&&t.get()!==void 0){const y=phe(u.keyframes,d);if(y!==void 0){me.update(()=>{u.onUpdate(y),u.onComplete()});return}}return d.isSync?new Vw(u):new T0e(u)};function xhe({protectedKeys:e,needsAnimating:t},n){const c=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,c}function mq(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&&xhe(h,u))continue;const f={delay:n,...Tw(r||{},u)},g=p.get();if(g!==void 0&&!p.isAnimating&&!Array.isArray(y)&&y===g&&!f.velocity)continue;let k=!1;if(window.MotionHandoffAnimation){const M=kq(e);if(M){const v=window.MotionHandoffAnimation(M,u,me);v!==null&&(f.startTime=v,k=!0)}}dw(e,u),p.start(Zw(u,p,y,e.shouldReduceMotion&&P$.has(u)?{type:!1}:f,e,k));const x=p.animation;x&&l.push(x)}return s&&Promise.all(l).then(()=>{me.update(()=>{s&&lhe(e,s)})}),l}function fq(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 lw(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(mq(e,c,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:h=0,staggerChildren:u,staggerDirection:p}=i;return Mhe(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 Mhe(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(lw(l,t,{...s,delay:n+(typeof c=="function"?0:c)+fq(e.variantChildren,l,c,i,r)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(d)}function _he(e,t,n={}){e.notify("AnimationStart",t);let c;if(Array.isArray(t)){const i=t.map(r=>lw(e,r,n));c=Promise.all(i)}else if(typeof t=="string")c=lw(e,t,n);else{const i=typeof t=="function"?c1(e,t,n.custom):t;c=Promise.all(mq(e,i,n))}return c.then(()=>{e.notify("AnimationComplete",t)})}function gq(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 Lhe=Fw.length;function vq(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?vq(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Lhe;n++){const c=Fw[n],i=e.props[c];(U1(i)||i===!1)&&(t[c]=i)}return t}const Ihe=[...Rw].reverse(),bhe=Rw.length;function whe(e){return t=>Promise.all(t.map(({animation:n,options:c})=>_he(e,n,c)))}function Che(e){let t=whe(e),n=aN(),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=vq(e.parent)||{},p=[],y=new Set;let f={},g=1/0;for(let x=0;x<bhe;x++){const M=Ihe[x],v=n[M],I=h[M]!==void 0?h[M]:u[M],b=U1(I),C=M===l?v.isActive:null;C===!1&&(g=x);let w=I===u[M]&&I!==h[M]&&b;if(w&&c&&e.manuallyAnimateOnMount&&(w=!1),v.protectedKeys={...f},!v.isActive&&C===null||!I&&!v.prevProp||bL(I)||typeof I=="boolean")continue;const _=Nhe(v.prevProp,I);let L=_||M===l&&v.isActive&&!w&&b||x>g&&b,S=!1;const N=Array.isArray(I)?I:[I];let j=N.reduce(i(M),{});C===!1&&(j={});const{prevResolvedValues:A={}}=v,B={...A,...j},D=$=>{L=!0,y.has($)&&(S=!0,y.delete($)),v.needsAnimating[$]=!0;const H=e.getValue($);H&&(H.liveStyle=!1)};for(const $ in B){const H=j[$],R=A[$];if(f.hasOwnProperty($))continue;let z=!1;sw(H)&&sw(R)?z=!gq(H,R):z=H!==R,z?H!=null?D($):y.add($):H!==void 0&&y.has($)?D($):v.protectedKeys[$]=!0}v.prevProp=I,v.prevResolvedValues=j,v.isActive&&(f={...f,...j}),c&&e.blockInitialAnimation&&(L=!1);const V=w&&_;L&&(!V||S)&&p.push(...N.map($=>{const H={type:M};if(typeof $=="string"&&c&&!V&&e.manuallyAnimateOnMount&&e.parent){const{parent:R}=e,z=c1(R,$);if(R.enteringChildren&&z){const{delayChildren:O}=z.transition||{};H.delay=fq(R.enteringChildren,e,O)}}return{animation:$,options:H}}))}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 k=!!p.length;return c&&(h.initial===!1||h.initial===h.animate)&&!e.manuallyAnimateOnMount&&(k=!1),c=!1,k?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=aN()}}}function Nhe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!gq(t,e):!1}function Ot(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function aN(){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 jhe extends Rt{constructor(t){super(t),t.animationState||(t.animationState=Che(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();bL(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 She=0;class $he extends Rt{constructor(){super(...arguments),this.id=She++}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 qhe={animation:{Feature:jhe},exit:{Feature:$he}};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 Ahe=e=>t=>Bw(t)&&e(t,J1(t));function H1(e,t,n,c){return G1(e,t,Ahe(n),c)}const xq=1e-4,zhe=1-xq,Vhe=1+xq,Mq=.01,Phe=0-Mq,The=0+Mq;function Te(e){return e.max-e.min}function Hhe(e,t,n){return Math.abs(e-t)<=n}function nN(e,t,n,c=.5){e.origin=c,e.originPoint=ge(t.min,t.max,e.origin),e.scale=Te(n)/Te(t),e.translate=ge(n.min,n.max,e.origin)-e.originPoint,(e.scale>=zhe&&e.scale<=Vhe||isNaN(e.scale))&&(e.scale=1),(e.translate>=Phe&&e.translate<=The||isNaN(e.translate))&&(e.translate=0)}function D1(e,t,n,c){nN(e.x,t.x,n.x,c?c.originX:void 0),nN(e.y,t.y,n.y,c?c.originY:void 0)}function oN(e,t,n){e.min=n.min+t.min,e.max=e.min+Te(t)}function Dhe(e,t,n){oN(e.x,t.x,n.x),oN(e.y,t.y,n.y)}function cN(e,t,n){e.min=t.min-n.min,e.max=e.min+Te(t)}function B1(e,t,n){cN(e.x,t.x,n.x),cN(e.y,t.y,n.y)}function Ye(e){return[e("x"),e("y")]}const _q=({current:e})=>e?e.ownerDocument.defaultView:null,iN=(e,t)=>Math.abs(e-t);function Bhe(e,t){const n=iN(e.x,t.x),c=iN(e.y,t.y);return Math.sqrt(n**2+c**2)}class Lq{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=JL(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,g=Bhe(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!f&&!g)return;const{point:k}=y,{timestamp:x}=Se;this.history.push({...k,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=YL(f,this.transformPagePoint),me.update(this.updatePoint,!0)},this.handlePointerUp=(y,f)=>{this.end();const{onEnd:g,onSessionEnd:k,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const M=JL(y.type==="pointercancel"?this.lastMoveEventInfo:YL(f,this.transformPagePoint),this.history);this.startEvent&&g&&g(y,M),k&&k(y,M)},!Bw(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=c,this.distanceThreshold=s,this.contextWindow=i||window;const d=J1(t),l=YL(d,this.transformPagePoint),{point:h}=l,{timestamp:u}=Se;this.history=[{...h,timestamp:u}];const{onSessionStart:p}=n;p&&p(t,JL(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(),Lt(this.updatePoint)}}function YL(e,t){return t?{point:t(e.point)}:e}function rN(e,t){return{x:e.x-t.x,y:e.y-t.y}}function JL({point:e},t){return{point:e,delta:rN(e,Iq(t)),offset:rN(e,Rhe(t)),velocity:Fhe(t,.1)}}function Rhe(e){return e[0]}function Iq(e){return e[e.length-1]}function Fhe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,c=null;const i=Iq(e);for(;n>=0&&(c=e[n],!(i.timestamp-c.timestamp>ot(t)));)n--;if(!c)return{x:0,y:0};const r=Je(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 Ehe(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 sN(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 Ohe(e,{top:t,left:n,bottom:c,right:i}){return{x:sN(e.x,n,i),y:sN(e.y,t,c)}}function dN(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 Uhe(e,t){return{x:dN(e.x,t.x),y:dN(e.y,t.y)}}function Whe(e,t){let n=.5;const c=Te(e),i=Te(t);return i>c?n=F1(t.min,t.max-c,e.min):c>i&&(n=F1(e.min,e.max-i,t.min)),Mt(0,1,n)}function Ghe(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 hw=.35;function Khe(e=hw){return e===!1?e=0:e===!0&&(e=hw),{x:lN(e,"left","right"),y:lN(e,"top","bottom")}}function lN(e,t,n){return{min:hN(e,t),max:hN(e,n)}}function hN(e,t){return typeof e=="number"?e:e[t]||0}const Zhe=new WeakMap;class Xhe{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=Le(),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:k}=this.getProps();if(f&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ele(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),Ye(M=>{let v=this.getAxisMotionValue(M).get()||0;if(pt.test(v)){const{projection:I}=this.visualElement;if(I&&I.layout){const b=I.layout.layoutBox[M];b&&(v=Te(b)*(parseFloat(v)/100))}}this.originPoint[M]=v}),k&&me.postRender(()=>k(p,y)),dw(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:k,onDrag:x}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:M}=y;if(g&&this.currentDirection===null){this.currentDirection=Yhe(M),this.currentDirection!==null&&k&&k(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=()=>Ye(p=>this.getAnimationState(p)==="paused"&&this.getAxisMotionValue(p).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Lq(t,{onSessionStart:r,onStart:s,onMove:d,onSessionEnd:l,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:c,contextWindow:_q(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&&me.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||!ci(t,i,this.currentDirection))return;const r=this.getAxisMotionValue(t);let s=this.originPoint[t]+c[t];this.constraints&&this.constraints[t]&&(s=Ehe(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=Ohe(c.layoutBox,t):this.constraints=!1,this.elastic=Khe(n),i!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&Ye(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=Ghe(c.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Xc(t))return!1;const c=t.current;ct(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=Jle(c,i.root,this.visualElement.getTransformPagePoint());let s=Uhe(i.layout.layoutBox,r);if(n){const d=n(Zle(s));this.hasMutatedConstraints=!!d,d&&(s=rq(d))}return s}startAnimation(t){const{drag:n,dragMomentum:c,dragElastic:i,dragTransition:r,dragSnapToOrigin:s,onDragTransitionEnd:d}=this.getProps(),l=this.constraints||{},h=Ye(u=>{if(!ci(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 dw(this.visualElement,t),c.start(Zw(t,c,0,n,this.visualElement,!1))}stopAnimation(){Ye(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ye(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){Ye(n=>{const{drag:c}=this.getProps();if(!ci(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};Ye(s=>{const d=this.getAxisMotionValue(s);if(d&&this.constraints!==!1){const l=d.get();i[s]=Whe({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(),Ye(s=>{if(!ci(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;Zhe.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()),me.read(c);const s=G1(window,"resize",()=>this.scalePositionWithinConstraints()),d=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:h})=>{this.isDragging&&h&&(Ye(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=hw,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:c,dragPropagation:i,dragConstraints:r,dragElastic:s,dragMomentum:d}}}function ci(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Yhe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Jhe extends Rt{constructor(t){super(t),this.removeGroupControls=et,this.removeListeners=et,this.controls=new Xhe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||et}unmount(){this.removeGroupControls(),this.removeListeners()}}const uN=e=>(t,n)=>{e&&me.postRender(()=>e(t,n))};class Qhe extends Rt{constructor(){super(...arguments),this.removePointerDownListener=et}onPointerDown(t){this.session=new Lq(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:_q(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:c,onPanEnd:i}=this.node.getProps();return{onSessionStart:uN(t),onStart:uN(n),onMove:c,onEnd:(r,s)=>{delete this.session,i&&me.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 rL={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pN(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(Y.test(e))e=parseFloat(e);else return e;const n=pN(e,t.target.x),c=pN(e,t.target.y);return`${n}% ${c}%`}},eue={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 QL=!1;class tue extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:c,layoutId:i}=this.props,{projection:r}=t;Lle(aue),r&&(n.group&&n.group.add(r),c&&c.register&&i&&c.register(r),QL&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),rL.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:c,drag:i,isPresent:r}=this.props,{projection:s}=c;return s&&(s.isPresent=r,QL=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==r?s.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?s.promote():s.relegate()||me.postRender(()=>{const d=s.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Dw.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:c}=this.props,{projection:i}=t;QL=!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 bq(e){const[t,n]=G$(),c=m.useContext(fw);return o.jsx(tue,{...e,layoutGroup:c,switchLayoutGroup:m.useContext(cq),isPresent:t,safeToRemove:n})}const aue={borderRadius:{...k1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:k1,borderTopRightRadius:k1,borderBottomLeftRadius:k1,borderBottomRightRadius:k1,boxShadow:eue};function nue(e,t,n){const c=$e(e)?e:Dc(e);return c.start(Zw("",c,t,n)),c.animation}const oue=(e,t)=>e.depth-t.depth;class cue{constructor(){this.children=[],this.isDirty=!1}add(t){xw(this.children,t),this.isDirty=!0}remove(t){Mw(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(oue),this.isDirty=!1,this.children.forEach(t)}}function iue(e,t){const n=Fe.now(),c=({timestamp:i})=>{const r=i-n;r>=t&&(Lt(c),e(r-t))};return me.setup(c,!0),()=>Lt(c)}const wq=["TopLeft","TopRight","BottomLeft","BottomRight"],rue=wq.length,yN=e=>typeof e=="string"?parseFloat(e):e,kN=e=>typeof e=="number"||Y.test(e);function sue(e,t,n,c,i,r){i?(e.opacity=ge(0,n.opacity??1,due(c)),e.opacityExit=ge(t.opacity??1,0,lue(c))):r&&(e.opacity=ge(t.opacity??1,n.opacity??1,c));for(let s=0;s<rue;s++){const d=`border${wq[s]}Radius`;let l=mN(t,d),h=mN(n,d);if(l===void 0&&h===void 0)continue;l||(l=0),h||(h=0),l===0||h===0||kN(l)===kN(h)?(e[d]=Math.max(ge(yN(l),yN(h),c),0),(pt.test(h)||pt.test(l))&&(e[d]+="%")):e[d]=h}(t.rotate||n.rotate)&&(e.rotate=ge(t.rotate||0,n.rotate||0,c))}function mN(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const due=Cq(0,.5,u$),lue=Cq(.5,.95,et);function Cq(e,t,n){return c=>c<e?0:c>t?1:n(F1(e,t,c))}function fN(e,t){e.min=t.min,e.max=t.max}function Ge(e,t){fN(e.x,t.x),fN(e.y,t.y)}function gN(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function vN(e,t,n,c,i){return e-=t,e=fL(e,1/n,c),i!==void 0&&(e=fL(e,1/i,c)),e}function hue(e,t=0,n=1,c=.5,i,r=e,s=e){if(pt.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=vN(e.min,t,n,d,i),e.max=vN(e.max,t,n,d,i)}function xN(e,t,[n,c,i],r,s){hue(e,t[n],t[c],t[i],t.scale,r,s)}const uue=["x","scaleX","originX"],pue=["y","scaleY","originY"];function MN(e,t,n,c){xN(e.x,t,uue,n?n.x:void 0,c?c.x:void 0),xN(e.y,t,pue,n?n.y:void 0,c?c.y:void 0)}function _N(e){return e.translate===0&&e.scale===1}function Nq(e){return _N(e.x)&&_N(e.y)}function LN(e,t){return e.min===t.min&&e.max===t.max}function yue(e,t){return LN(e.x,t.x)&&LN(e.y,t.y)}function IN(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function jq(e,t){return IN(e.x,t.x)&&IN(e.y,t.y)}function bN(e){return Te(e.x)/Te(e.y)}function wN(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class kue{constructor(){this.members=[]}add(t){xw(this.members,t),t.scheduleRender()}remove(t){if(Mw(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 mue(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 eI=["","X","Y","Z"],fue=1e3;let gue=0;function tI(e,t,n,c){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),c&&(c[e]=0))}function Sq(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=kq(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",me,!(i||r))}const{parent:c}=e;c&&!c.hasCheckedOptimisedAppear&&Sq(c)}function $q({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:c,resetTransform:i}){return class{constructor(s={},d=t?.()){this.id=gue++,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(Mue),this.nodes.forEach(bue),this.nodes.forEach(wue),this.nodes.forEach(_ue)},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 cue)}addEventListener(s,d){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Lw),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=W$(s)&&!ile(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;me.read(()=>{p=window.innerWidth}),e(s,()=>{const f=window.innerWidth;f!==p&&(p=f,this.root.updateBlockedByResize=!0,u&&u(),u=iue(y,250),rL.hasAnimatedSinceResize&&(rL.hasAnimatedSinceResize=!1,this.nodes.forEach(jN)))})}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()||$ue,{onLayoutAnimationStart:k,onLayoutAnimationComplete:x}=h.getProps(),M=!this.targetLayout||!jq(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={...Tw(g,"layout"),onPlay:k,onComplete:x};(h.shouldReduceMotion||this.options.layoutRoot)&&(I.delay=0,I.type=!1),this.startAnimation(I),this.setAnimationOrigin(u,v)}else p||jN(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(),Lt(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(Cue),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&&Sq(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(CN);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(NN);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Iue),this.nodes.forEach(vue),this.nodes.forEach(xue)):this.nodes.forEach(NN),this.clearAllSnapshots();const d=Fe.now();Se.delta=Mt(0,1e3/60,d-Se.timestamp),Se.timestamp=d,Se.isProcessing=!0,EL.update.process(Se),EL.preRender.process(Se),EL.render.process(Se),Se.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Dw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Lue),this.sharedNodes.forEach(Nue)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,me.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){me.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Te(this.snapshot.measuredBox.x)&&!Te(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=Le(),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&&!Nq(this.projectionDelta),l=this.getTransformTemplate(),h=l?l(this.latestValues,""):void 0,u=h!==this.prevTransformTemplateValue;s&&this.instance&&(d||jc(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)),que(l),{animationId:this.root.animationId,measuredBox:d,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return Le();const d=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Aue))){const{scroll:h}=this.root;h&&(Yc(d.x,h.offset.x),Yc(d.y,h.offset.y))}return d}removeElementScroll(s){const d=Le();if(Ge(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&&Ge(d,s),Yc(d.x,u.offset.x),Yc(d.y,u.offset.y))}return d}applyTransform(s,d=!1){const l=Le();Ge(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}),jc(u.latestValues)&&Jc(l,u.latestValues)}return jc(this.latestValues)&&Jc(l,this.latestValues),l}removeTransform(s){const d=Le();Ge(d,s);for(let l=0;l<this.path.length;l++){const h=this.path[l];if(!h.instance||!jc(h.latestValues))continue;cw(h.latestValues)&&h.updateSnapshot();const u=Le(),p=h.measurePageBox();Ge(u,p),MN(d,h.latestValues,h.snapshot?h.snapshot.layoutBox:void 0,u)}return jc(this.latestValues)&&MN(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!==Se.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=Se.timestamp,!this.targetDelta&&!this.relativeTarget){const y=this.getClosestProjectingParent();y&&y.layout&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Le(),this.relativeTargetOrigin=Le(),B1(this.relativeTargetOrigin,this.layout.layoutBox,y.layout.layoutBox),Ge(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Le(),this.targetWithTransforms=Le()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Dhe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ge(this.target,this.layout.layoutBox),dq(this.target,this.targetDelta)):Ge(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=Le(),this.relativeTargetOrigin=Le(),B1(this.relativeTargetOrigin,this.target,y.target),Ge(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||cw(this.parent.latestValues)||sq(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===Se.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;Ge(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,y=this.treeScale.y;Yle(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=Le());const{target:f}=s;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(gN(this.prevProjectionDelta.x,this.projectionDelta.x),gN(this.prevProjectionDelta.y,this.projectionDelta.y)),D1(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==y||!wN(this.projectionDelta.x,this.prevProjectionDelta.x)||!wN(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=Le(),f=l?l.source:void 0,g=this.layout?this.layout.source:void 0,k=f!==g,x=this.getStack(),M=!x||x.members.length<=1,v=!!(k&&!M&&this.options.crossfade===!0&&!this.path.some(Sue));this.animationProgress=0;let I;this.mixTargetDelta=b=>{const C=b/1e3;SN(p.x,s.x,C),SN(p.y,s.y,C),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(B1(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox),jue(this.relativeTarget,this.relativeTargetOrigin,y,C),I&&yue(this.relativeTarget,I)&&(this.isProjectionDirty=!1),I||(I=Le()),Ge(I,this.relativeTarget)),k&&(this.animationValues=u,sue(u,h,this.latestValues,C,v,M)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Lt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=me.update(()=>{rL.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Dc(0)),this.currentAnimation=nue(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(fue),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&&qq(this.options.animationType,this.layout.layoutBox,h.layoutBox)){l=this.target||Le();const p=Te(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+p;const y=Te(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+y}Ge(d,l),Jc(d,u),D1(this.projectionDeltaWithTransform,this.layoutCorrected,d,u)}}registerSharedNode(s,d){this.sharedNodes.has(s)||this.sharedNodes.set(s,new kue),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&&tI("z",s,h,this.animationValues);for(let u=0;u<eI.length;u++)tI(`rotate${eI[u]}`,s,h,this.animationValues),tI(`skew${eI[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=iL(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=iL(d?.pointerEvents)||""),this.hasProjected&&!jc(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=h.animationValues||h.latestValues;this.applyTransformsToTarget();let p=mue(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:k,applyTo:x,isCSSVariable:M}=W1[g],v=p==="none"?u[g]:k(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?iL(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(CN),this.root.sharedNodes.clear()}}}function vue(e){e.updateLayout()}function xue(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"?Ye(u=>{const p=r?t.measuredBox[u]:t.layoutBox[u],y=Te(p);p.min=n[u].min,p.max=p.min+y}):qq(i,t.layoutBox,n)&&Ye(u=>{const p=r?t.measuredBox[u]:t.layoutBox[u],y=Te(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=!Nq(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=Le();B1(f,t.layoutBox,p.layoutBox);const g=Le();B1(g,n,y.layoutBox),jq(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 Mue(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 _ue(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Lue(e){e.clearSnapshot()}function CN(e){e.clearMeasurements()}function NN(e){e.isLayoutDirty=!1}function Iue(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function jN(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function bue(e){e.resolveTargetDelta()}function wue(e){e.calcProjection()}function Cue(e){e.resetSkewAndRotation()}function Nue(e){e.removeLeadSnapshot()}function SN(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 $N(e,t,n,c){e.min=ge(t.min,n.min,c),e.max=ge(t.max,n.max,c)}function jue(e,t,n,c){$N(e.x,t.x,n.x,c),$N(e.y,t.y,n.y,c)}function Sue(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const $ue={duration:.45,ease:[.4,0,.1,1]},qN=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),AN=qN("applewebkit/")&&!qN("chrome/")?Math.round:et;function zN(e){e.min=AN(e.min),e.max=AN(e.max)}function que(e){zN(e.x),zN(e.y)}function qq(e,t,n){return e==="position"||e==="preserve-aspect"&&!Hhe(bN(t),bN(n),.2)}function Aue(e){return e!==e.root&&e.scroll?.wasRoot}const zue=$q({attachResizeListener:(e,t)=>G1(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),aI={current:void 0},Aq=$q({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!aI.current){const e=new zue({});e.mount(window),e.setOptions({layoutScroll:!0}),aI.current=e}return aI.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Vue={pan:{Feature:Qhe},drag:{Feature:Jhe,ProjectionNode:Aq,MeasureLayout:bq}};function VN(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&&me.postRender(()=>r(t,J1(t)))}class Pue extends Rt{mount(){const{current:t}=this.node;t&&(this.unmount=tle(t,(n,c)=>(VN(this.node,c,"Start"),i=>VN(this.node,i,"End"))))}unmount(){}}class Tue 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 PN(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&&me.postRender(()=>r(t,J1(t)))}class Hue extends Rt{mount(){const{current:t}=this.node;t&&(this.unmount=cle(t,(n,c)=>(PN(this.node,c,"Start"),(i,{success:r})=>PN(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const uw=new WeakMap,nI=new WeakMap,Due=e=>{const t=uw.get(e.target);t&&t(e)},Bue=e=>{e.forEach(Due)};function Rue({root:e,...t}){const n=e||document;nI.has(n)||nI.set(n,{});const c=nI.get(n),i=JSON.stringify(t);return c[i]||(c[i]=new IntersectionObserver(Bue,{root:e,...t})),c[i]}function Fue(e,t,n){const c=Rue(t);return uw.set(e,n),c.observe(e),()=>{uw.delete(e),c.unobserve(e)}}const Eue={some:0,all:1};class Oue 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:Eue[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 Fue(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(Uue(t,n))&&this.startObserver()}unmount(){}}function Uue({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Wue={inView:{Feature:Oue},tap:{Feature:Hue},focus:{Feature:Tue},hover:{Feature:Pue}},Gue={layout:{ProjectionNode:Aq,MeasureLayout:bq}},Kue={...qhe,...Wue,...Vue,...Gue},Xw=Kle(Kue,rhe);function zq(e){const t=Bt(()=>Dc(e)),{isStatic:n}=m.useContext(LL);if(n){const[,c]=m.useState(e);m.useEffect(()=>t.on("change",c),[])}return t}function Vq(e,t){const n=zq(t()),c=()=>n.set(t());return c(),vw(()=>{const i=()=>me.preRender(c,!1,!0),r=e.map(s=>s.on("change",i));return()=>{r.forEach(s=>s()),Lt(c)}}),n}function Zue(e){T1.current=[],e();const t=Vq(T1.current,e);return T1.current=void 0,t}function Xue(e,t,n,c){if(typeof e=="function")return Zue(e);const i=typeof t=="function"?t:rle(t,n,c);return Array.isArray(e)?TN(e,i):TN([e],([r])=>i(r))}function TN(e,t){const n=Bt(()=>[]);return Vq(e,()=>{n.length=0;const c=e.length;for(let i=0;i<c;i++)n[i]=e[i].get();return t(n)})}class Yue{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 Jue=()=>new Yue;function Que(){return Bt(Jue)}const Pq=m.createContext(null);function epe(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?pde(e,i,i+r):e}function tpe({children:e,as:t="ul",axis:n="y",onReorder:c,values:i,...r},s){const d=Bt(()=>Xw[t]),l=[],h=m.useRef(!1);ct(!!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(ope)},updateOrder:(p,y,f)=>{if(h.current)return;const g=epe(l,p,y,f);l!==g&&(h.current=!0,c(g.map(npe).filter(k=>i.indexOf(k)!==-1)))}};return m.useEffect(()=>{h.current=!1}),o.jsx(d,{...r,ref:s,ignoreStrict:!0,children:o.jsx(Pq.Provider,{value:u,children:e})})}const ape=m.forwardRef(tpe);function npe(e){return e.value}function ope(e,t){return e.layout.min-t.layout.min}function HN(e,t=0){return $e(e)?e:zq(t)}function cpe({children:e,style:t={},value:n,as:c="li",onDrag:i,layout:r=!0,...s},d){const l=Bt(()=>Xw[c]),h=m.useContext(Pq),u={x:HN(t.x),y:HN(t.y)},p=Xue([u.x,u.y],([k,x])=>k||x?1:"unset");ct(!!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:(k,x)=>{const{velocity:M}=x;M[y]&&g(n,u[y].get(),M[y]),i&&i(k,x)},onLayoutMeasure:k=>f(n,k),ref:d,ignoreStrict:!0,children:e})}const ipe=m.forwardRef(cpe),gL=[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})],rpe=({items:e,onReorder:t,draggable:n=!1,className:c,header:i,headerStyle:r,itemsDraggable:s=!0})=>{const[d,l]=m.useState(e??[]);return m.useEffect(()=>{e&&Array.isArray(e)?(e.forEach((h,u)=>{if(h.icon==null&&(h.icon=gL[u%gL.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 k=g[1],x=g[2]??"",M=k.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(ape,{axis:"y",values:d,onReorder:h=>{l(h),t?.(h)},style:{display:"flex",flexDirection:"column",gap:8},children:d.map((h,u)=>o.jsx(spe,{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 spe({value:e,index:t}){const n=Que(),c=gL[t%gL.length]??null;return o.jsx(ipe,{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(t$,{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 dpe(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 lpe(e){return!e||typeof e=="string"&&e.trim()===""}function hpe(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?null:{isValid:!1,error:"Format d'email invalide"}}function upe(e){return/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/.test(e)?null:{isValid:!1,error:"Format d'URL invalide"}}function ppe(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 ype(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 kpe(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 mpe(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 vL(e,t){const n=dpe(e,t);if(n)return n;if(lpe(e))return{isValid:!0};const c=e.toString();switch(t.type){case"email":{const r=hpe(c);if(r)return r;break}case"url":{const r=upe(c);if(r)return r;break}case"number":{const r=ppe(e,t);if(r)return r;break}case"date":case"month":case"week":case"time":case"datetime-local":{const r=ype(e,t);if(r)return r;break}case"file":{const r=kpe(e,t);if(r)return r;break}}const i=mpe(c,t);return i||{isValid:!0}}function Tq(e,t){const n={};let c=!0;for(const i of t){const r=vL(e[i.name],i);r.isValid||(n[i.name]=r.error,c=!1)}return{isValid:c,errors:n}}const fpe="_formContainer_14ads_1",gpe="_headerLine_14ads_17",vpe="_formTitle_14ads_25",xpe="_formDescription_14ads_30",Mpe="_sectionTitle_14ads_37",_pe="_sectionHelp_14ads_44",Lpe="_fieldHelp_14ads_50",Ipe="_gridContainer_14ads_58",bpe="_fieldGridItem_14ads_70",wpe="_sectionFull_14ads_105",Cpe="_formFooter_14ads_110",Npe="_footerLeft_14ads_118",jpe="_footerRight_14ads_119",Spe="_cancelLink_14ads_125",$pe="_submitButton_14ads_136",qpe="_fieldLabel_14ads_148",Ape="_inputWrapper_14ads_163",zpe="_inputInner_14ads_187",Vpe="_hasPrefix_14ads_196",Ppe="_inputBase_14ads_196",Tpe="_iconPrefix_14ads_292",Hpe="_iconSuffix_14ads_293",Dpe="_passwordToggle_14ads_319",Bpe="_fieldError_14ads_365",Rpe="_fieldInvalid_14ads_372",ke={formContainer:fpe,headerLine:gpe,formTitle:vpe,formDescription:xpe,sectionTitle:Mpe,sectionHelp:_pe,fieldHelp:Lpe,gridContainer:Ipe,fieldGridItem:bpe,sectionFull:wpe,formFooter:Cpe,footerLeft:Npe,footerRight:jpe,cancelLink:Spe,submitButton:$pe,fieldLabel:qpe,inputWrapper:Ape,inputInner:zpe,hasPrefix:Vpe,inputBase:Ppe,iconPrefix:Tpe,iconSuffix:Hpe,passwordToggle:Dpe,fieldError:Bpe,fieldInvalid:Rpe},Hq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const[s,d]=m.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?xt[e.attributes.icon]:null),y=e.attributes?.iconPosition??"suffix",f=g=>{n(g.target.value)};return o.jsxs("div",{className:ke.inputWrapper,children:[o.jsx("label",{className:`${ke.fieldLabel} ${e.required?"required":""}`,htmlFor:e.name,children:e.label}),o.jsxs("div",{className:`${ke.inputInner} ${p&&y==="prefix"?ke.hasPrefix:""}`,children:[p&&y==="prefix"&&o.jsx("span",{className:ke.iconPrefix,children:o.jsx(p,{size:16})}),o.jsx("input",{id:e.name,name:e.name,type:u,placeholder:e.placeholder,className:`${ke.inputBase} ${i?ke.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:ke.passwordToggle,onClick:()=>d(g=>!g),children:s?o.jsx(j1,{size:16}):o.jsx(S1,{size:16})}),p&&y==="suffix"&&!l&&o.jsx("span",{className:ke.iconSuffix,children:o.jsx(p,{size:16})})]}),r&&i&&o.jsx("span",{className:ke.fieldError,children:i})]})},Fpe="_fieldGroup_yb3zi_7",Epe="_fieldLabel_yb3zi_11",Ope="_required_yb3zi_17",Upe="_fieldInput_yb3zi_22",Wpe="_fieldInvalid_yb3zi_40",Gpe="_fieldValid_yb3zi_44",Kpe="_fieldError_yb3zi_48",Zpe="_radioGroup_yb3zi_57",Pt={fieldGroup:Fpe,fieldLabel:Epe,required:Ope,fieldInput:Upe,fieldInvalid:Wpe,fieldValid:Gpe,fieldError:Kpe,radioGroup:Zpe},CL=({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})]})},Dq=({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(CL,{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})})},Xpe="_wrapper_117u4_1",Ype="_wrapperInvalid_117u4_15",Jpe="_nativeSelect_117u4_19",Qpe="_display_117u4_30",eye="_topLabel_117u4_37",tye="_valueLine_117u4_45",aye="_valuePlaceholder_117u4_53",nye="_valueActive_117u4_57",oye="_caret_117u4_61",cye="_error_117u4_75",iye="_optionStyle_117u4_89",Ke={wrapper:Xpe,wrapperInvalid:Ype,nativeSelect:Jpe,display:Qpe,topLabel:eye,valueLine:tye,valuePlaceholder:aye,valueActive:nye,caret:oye,error:cye,optionStyle:iye},Yw=({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:`${Ke.wrapper} ${s?Ke.wrapperInvalid:""} ${t?Ke.wrapperHasValue:""}`,children:[o.jsxs("select",{id:e.name,name:e.name,className:Ke.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:Ke.optionStyle,children:u.label},p))]}),o.jsxs("div",{className:Ke.display,children:[d&&o.jsx("span",{className:Ke.topLabel,children:d}),o.jsx("span",{className:`${Ke.valueLine} ${t?Ke.valueActive:Ke.valuePlaceholder}`,children:t?h:l}),o.jsx("span",{className:Ke.caret,"aria-hidden":"true"})]}),s&&o.jsx("span",{className:Ke.error,children:i})]})},Bq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsx(CL,{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})]})}),Rq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsx(CL,{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))})}),rye="_fileInputContainer_r2guc_3",sye="_customFileInput_r2guc_8",dye="_fileInputLabel_r2guc_12",lye="_dragOver_r2guc_39",hye="_uploadIcon_r2guc_44",uye="_uploadText_r2guc_50",pye="_uploadHint_r2guc_56",yye="_fileList_r2guc_60",kye="_fileListTitle_r2guc_69",mye="_fileItem_r2guc_80",fye="_fileIcon_r2guc_96",gye="_fileName_r2guc_102",vye="_fileSize_r2guc_108",xye="_removeButton_r2guc_114",Mye="_errorText_r2guc_129",Ae={fileInputContainer:rye,customFileInput:sye,fileInputLabel:dye,dragOver:lye,uploadIcon:hye,uploadText:uye,uploadHint:pye,fileList:yye,fileListTitle:kye,fileItem:mye,fileIcon:fye,fileName:gye,fileSize:vye,removeButton:xye,errorText:Mye},Fq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=m.useRef(null),[d,l]=m.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)},k=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:`${Ae.fileInputContainer} ${r&&i?Ae.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:Ae.customFileInput}),o.jsxs("label",{htmlFor:e.name,className:`${Ae.fileInputLabel} ${d?Ae.dragOver:""}`,onDragOver:p,onDragLeave:y,onDrop:f,onClick:u,tabIndex:0,children:[o.jsx("div",{className:Ae.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:Ae.uploadText,children:d?"Déposez vos fichiers ici":"Cliquez ou glissez-déposez pour téléverser"}),o.jsxs("div",{className:Ae.uploadHint,children:[e.attributes?.accept||"Tous les fichiers"," ",e.attributes?.multiple?"(Multiple autorisé)":""]})]}),t&&t.length>0&&o.jsxs("div",{className:Ae.fileList,children:[o.jsx("div",{className:Ae.fileListTitle,children:"Fichiers sélectionnés:"}),o.jsx("ul",{children:Array.from(t).map((x,M)=>o.jsxs("li",{className:Ae.fileItem,children:[o.jsx("div",{className:Ae.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:Ae.fileName,children:x.name}),o.jsx("div",{className:Ae.fileSize,children:k(x.size)}),o.jsx("button",{type:"button",className:Ae.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:Ae.errorText,children:i})]})},_ye="_container_ecah4_2",Lye="_label_ecah4_6",Iye="_requiredIndicator_ecah4_13",bye="_input_ecah4_18",wye="_inputError_ecah4_49",Cye="_errorMessage_ecah4_58",Wc={container:_ye,label:Lye,requiredIndicator:Iye,input:bye,inputError:wye,errorMessage:Cye},Eq=({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})]})},Nye="_rangeContainer_cyqk3_3",jye={rangeContainer:Nye},Oq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsxs("div",{className:`mb-3 ${jye.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})]}),Sye="_colorPickerContainer_1wxgj_2",$ye="_colorInput_1wxgj_19",qye="_colorValue_1wxgj_39",oI={colorPickerContainer:Sye,colorInput:$ye,colorValue:qye},Uq=({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:oI.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:oI.colorInput}),o.jsx("span",{className:oI.colorValue,children:t})]}),r&&i&&o.jsx("div",{className:"invalid-feedback",children:i})]}),Wq=({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(Fq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(s.includes(e.type))return o.jsx(Eq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(e.type==="range")return o.jsx(Oq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(e.type==="color")return o.jsx(Uq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});switch(e.type){case"textarea":return o.jsx(Dq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"select":return o.jsx(Yw,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"checkbox":return o.jsx(Bq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"radio":return o.jsx(Rq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});default:return o.jsx(Hq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})}};var cI,DN;function Aye(){if(DN)return cI;DN=1;function e(){this.__data__=[],this.size=0}return cI=e,cI}var iI,BN;function Gq(){if(BN)return iI;BN=1;function e(t,n){return t===n||t!==t&&n!==n}return iI=e,iI}var rI,RN;function NL(){if(RN)return rI;RN=1;var e=Gq();function t(n,c){for(var i=n.length;i--;)if(e(n[i][0],c))return i;return-1}return rI=t,rI}var sI,FN;function zye(){if(FN)return sI;FN=1;var e=NL(),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 sI=c,sI}var dI,EN;function Vye(){if(EN)return dI;EN=1;var e=NL();function t(n){var c=this.__data__,i=e(c,n);return i<0?void 0:c[i][1]}return dI=t,dI}var lI,ON;function Pye(){if(ON)return lI;ON=1;var e=NL();function t(n){return e(this.__data__,n)>-1}return lI=t,lI}var hI,UN;function Tye(){if(UN)return hI;UN=1;var e=NL();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 hI=t,hI}var uI,WN;function jL(){if(WN)return uI;WN=1;var e=Aye(),t=zye(),n=Vye(),c=Pye(),i=Tye();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,uI=r,uI}var pI,GN;function Hye(){if(GN)return pI;GN=1;var e=jL();function t(){this.__data__=new e,this.size=0}return pI=t,pI}var yI,KN;function Dye(){if(KN)return yI;KN=1;function e(t){var n=this.__data__,c=n.delete(t);return this.size=n.size,c}return yI=e,yI}var kI,ZN;function Bye(){if(ZN)return kI;ZN=1;function e(t){return this.__data__.get(t)}return kI=e,kI}var mI,XN;function Rye(){if(XN)return mI;XN=1;function e(t){return this.__data__.has(t)}return mI=e,mI}var fI,YN;function Kq(){if(YN)return fI;YN=1;var e=typeof a.commonjsGlobal=="object"&&a.commonjsGlobal&&a.commonjsGlobal.Object===Object&&a.commonjsGlobal;return fI=e,fI}var gI,JN;function It(){if(JN)return gI;JN=1;var e=Kq(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return gI=n,gI}var vI,QN;function Jw(){if(QN)return vI;QN=1;var e=It(),t=e.Symbol;return vI=t,vI}var xI,ej;function Fye(){if(ej)return xI;ej=1;var e=Jw(),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 xI=r,xI}var MI,tj;function Eye(){if(tj)return MI;tj=1;var e=Object.prototype,t=e.toString;function n(c){return t.call(c)}return MI=n,MI}var _I,aj;function SL(){if(aj)return _I;aj=1;var e=Jw(),t=Fye(),n=Eye(),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 _I=s,_I}var LI,nj;function Zq(){if(nj)return LI;nj=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return LI=e,LI}var II,oj;function Xq(){if(oj)return II;oj=1;var e=SL(),t=Zq(),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 II=s,II}var bI,cj;function Oye(){if(cj)return bI;cj=1;var e=It(),t=e["__core-js_shared__"];return bI=t,bI}var wI,ij;function Uye(){if(ij)return wI;ij=1;var e=Oye(),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 wI=n,wI}var CI,rj;function Yq(){if(rj)return CI;rj=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 CI=n,CI}var NI,sj;function Wye(){if(sj)return NI;sj=1;var e=Xq(),t=Uye(),n=Zq(),c=Yq(),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 NI=p,NI}var jI,dj;function Gye(){if(dj)return jI;dj=1;function e(t,n){return t?.[n]}return jI=e,jI}var SI,lj;function h1(){if(lj)return SI;lj=1;var e=Wye(),t=Gye();function n(c,i){var r=t(c,i);return e(r)?r:void 0}return SI=n,SI}var $I,hj;function Qw(){if(hj)return $I;hj=1;var e=h1(),t=It(),n=e(t,"Map");return $I=n,$I}var qI,uj;function $L(){if(uj)return qI;uj=1;var e=h1(),t=e(Object,"create");return qI=t,qI}var AI,pj;function Kye(){if(pj)return AI;pj=1;var e=$L();function t(){this.__data__=e?e(null):{},this.size=0}return AI=t,AI}var zI,yj;function Zye(){if(yj)return zI;yj=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return zI=e,zI}var VI,kj;function Xye(){if(kj)return VI;kj=1;var e=$L(),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 VI=i,VI}var PI,mj;function Yye(){if(mj)return PI;mj=1;var e=$L(),t=Object.prototype,n=t.hasOwnProperty;function c(i){var r=this.__data__;return e?r[i]!==void 0:n.call(r,i)}return PI=c,PI}var TI,fj;function Jye(){if(fj)return TI;fj=1;var e=$L(),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 TI=n,TI}var HI,gj;function Qye(){if(gj)return HI;gj=1;var e=Kye(),t=Zye(),n=Xye(),c=Yye(),i=Jye();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,HI=r,HI}var DI,vj;function e4e(){if(vj)return DI;vj=1;var e=Qye(),t=jL(),n=Qw();function c(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return DI=c,DI}var BI,xj;function t4e(){if(xj)return BI;xj=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return BI=e,BI}var RI,Mj;function qL(){if(Mj)return RI;Mj=1;var e=t4e();function t(n,c){var i=n.__data__;return e(c)?i[typeof c=="string"?"string":"hash"]:i.map}return RI=t,RI}var FI,_j;function a4e(){if(_j)return FI;_j=1;var e=qL();function t(n){var c=e(this,n).delete(n);return this.size-=c?1:0,c}return FI=t,FI}var EI,Lj;function n4e(){if(Lj)return EI;Lj=1;var e=qL();function t(n){return e(this,n).get(n)}return EI=t,EI}var OI,Ij;function o4e(){if(Ij)return OI;Ij=1;var e=qL();function t(n){return e(this,n).has(n)}return OI=t,OI}var UI,bj;function c4e(){if(bj)return UI;bj=1;var e=qL();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 UI=t,UI}var WI,wj;function Jq(){if(wj)return WI;wj=1;var e=e4e(),t=a4e(),n=n4e(),c=o4e(),i=c4e();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,WI=r,WI}var GI,Cj;function i4e(){if(Cj)return GI;Cj=1;var e=jL(),t=Qw(),n=Jq(),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 GI=i,GI}var KI,Nj;function r4e(){if(Nj)return KI;Nj=1;var e=jL(),t=Hye(),n=Dye(),c=Bye(),i=Rye(),r=i4e();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,KI=s,KI}var ZI,jj;function s4e(){if(jj)return ZI;jj=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return ZI=t,ZI}var XI,Sj;function d4e(){if(Sj)return XI;Sj=1;function e(t){return this.__data__.has(t)}return XI=e,XI}var YI,$j;function l4e(){if($j)return YI;$j=1;var e=Jq(),t=s4e(),n=d4e();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,YI=c,YI}var JI,qj;function h4e(){if(qj)return JI;qj=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 JI=e,JI}var QI,Aj;function u4e(){if(Aj)return QI;Aj=1;function e(t,n){return t.has(n)}return QI=e,QI}var eb,zj;function Qq(){if(zj)return eb;zj=1;var e=l4e(),t=h4e(),n=u4e(),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 k=p.get(s),x=p.get(d);if(k&&x)return k==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],C=d[M];if(h)var w=y?h(C,b,M,d,s,p):h(b,C,M,s,d,p);if(w!==void 0){if(w)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===C||u(b,C,l,h,p))){v=!1;break}}return p.delete(s),p.delete(d),v}return eb=r,eb}var tb,Vj;function p4e(){if(Vj)return tb;Vj=1;var e=It(),t=e.Uint8Array;return tb=t,tb}var ab,Pj;function y4e(){if(Pj)return ab;Pj=1;function e(t){var n=-1,c=Array(t.size);return t.forEach(function(i,r){c[++n]=[r,i]}),c}return ab=e,ab}var nb,Tj;function k4e(){if(Tj)return nb;Tj=1;function e(t){var n=-1,c=Array(t.size);return t.forEach(function(i){c[++n]=i}),c}return nb=e,nb}var ob,Hj;function m4e(){if(Hj)return ob;Hj=1;var e=Jw(),t=p4e(),n=Gq(),c=Qq(),i=y4e(),r=k4e(),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]",k="[object String]",x="[object Symbol]",M="[object ArrayBuffer]",v="[object DataView]",I=e?e.prototype:void 0,b=I?I.valueOf:void 0;function C(w,_,L,S,N,j,A){switch(L){case v:if(w.byteLength!=_.byteLength||w.byteOffset!=_.byteOffset)return!1;w=w.buffer,_=_.buffer;case M:return!(w.byteLength!=_.byteLength||!j(new t(w),new t(_)));case l:case h:case y:return n(+w,+_);case u:return w.name==_.name&&w.message==_.message;case f:case k:return w==_+"";case p:var B=i;case g:var D=S&s;if(B||(B=r),w.size!=_.size&&!D)return!1;var V=A.get(w);if(V)return V==_;S|=d,A.set(w,_);var q=c(B(w),B(_),S,N,j,A);return A.delete(w),q;case x:if(b)return b.call(w)==b.call(_)}return!1}return ob=C,ob}var cb,Dj;function f4e(){if(Dj)return cb;Dj=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 cb=e,cb}var ib,Bj;function eC(){if(Bj)return ib;Bj=1;var e=Array.isArray;return ib=e,ib}var rb,Rj;function g4e(){if(Rj)return rb;Rj=1;var e=f4e(),t=eC();function n(c,i,r){var s=i(c);return t(c)?s:e(s,r(c))}return rb=n,rb}var sb,Fj;function v4e(){if(Fj)return sb;Fj=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 sb=e,sb}var db,Ej;function x4e(){if(Ej)return db;Ej=1;function e(){return[]}return db=e,db}var lb,Oj;function M4e(){if(Oj)return lb;Oj=1;var e=v4e(),t=x4e(),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 lb=r,lb}var hb,Uj;function _4e(){if(Uj)return hb;Uj=1;function e(t,n){for(var c=-1,i=Array(t);++c<t;)i[c]=n(c);return i}return hb=e,hb}var ub,Wj;function AL(){if(Wj)return ub;Wj=1;function e(t){return t!=null&&typeof t=="object"}return ub=e,ub}var pb,Gj;function L4e(){if(Gj)return pb;Gj=1;var e=SL(),t=AL(),n="[object Arguments]";function c(i){return t(i)&&e(i)==n}return pb=c,pb}var yb,Kj;function I4e(){if(Kj)return yb;Kj=1;var e=L4e(),t=AL(),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 yb=r,yb}var M1={exports:{}},kb,Zj;function b4e(){if(Zj)return kb;Zj=1;function e(){return!1}return kb=e,kb}M1.exports;var Xj;function eA(){return Xj||(Xj=1,function(e,t){var n=It(),c=b4e(),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 mb,Yj;function w4e(){if(Yj)return mb;Yj=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 mb=n,mb}var fb,Jj;function tA(){if(Jj)return fb;Jj=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return fb=t,fb}var gb,Qj;function C4e(){if(Qj)return gb;Qj=1;var e=SL(),t=tA(),n=AL(),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]",k="[object WeakMap]",x="[object ArrayBuffer]",M="[object DataView]",v="[object Float32Array]",I="[object Float64Array]",b="[object Int8Array]",C="[object Int16Array]",w="[object Int32Array]",_="[object Uint8Array]",L="[object Uint8ClampedArray]",S="[object Uint16Array]",N="[object Uint32Array]",j={};j[v]=j[I]=j[b]=j[C]=j[w]=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[k]=!1;function A(B){return n(B)&&t(B.length)&&!!j[e(B)]}return gb=A,gb}var vb,eS;function N4e(){if(eS)return vb;eS=1;function e(t){return function(n){return t(n)}}return vb=e,vb}var _1={exports:{}};_1.exports;var tS;function j4e(){return tS||(tS=1,function(e,t){var n=Kq(),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 xb,aS;function aA(){if(aS)return xb;aS=1;var e=C4e(),t=N4e(),n=j4e(),c=n&&n.isTypedArray,i=c?t(c):e;return xb=i,xb}var Mb,nS;function S4e(){if(nS)return Mb;nS=1;var e=_4e(),t=I4e(),n=eC(),c=eA(),i=w4e(),r=aA(),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),k=p||y||f||g,x=k?e(h.length,String):[],M=x.length;for(var v in h)(u||d.call(h,v))&&!(k&&(v=="length"||f&&(v=="offset"||v=="parent")||g&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||i(v,M)))&&x.push(v);return x}return Mb=l,Mb}var _b,oS;function $4e(){if(oS)return _b;oS=1;var e=Object.prototype;function t(n){var c=n&&n.constructor,i=typeof c=="function"&&c.prototype||e;return n===i}return _b=t,_b}var Lb,cS;function q4e(){if(cS)return Lb;cS=1;function e(t,n){return function(c){return t(n(c))}}return Lb=e,Lb}var Ib,iS;function A4e(){if(iS)return Ib;iS=1;var e=q4e(),t=e(Object.keys,Object);return Ib=t,Ib}var bb,rS;function z4e(){if(rS)return bb;rS=1;var e=$4e(),t=A4e(),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 bb=i,bb}var wb,sS;function V4e(){if(sS)return wb;sS=1;var e=Xq(),t=tA();function n(c){return c!=null&&t(c.length)&&!e(c)}return wb=n,wb}var Cb,dS;function P4e(){if(dS)return Cb;dS=1;var e=S4e(),t=z4e(),n=V4e();function c(i){return n(i)?e(i):t(i)}return Cb=c,Cb}var Nb,lS;function T4e(){if(lS)return Nb;lS=1;var e=g4e(),t=M4e(),n=P4e();function c(i){return e(i,n,t)}return Nb=c,Nb}var jb,hS;function H4e(){if(hS)return jb;hS=1;var e=T4e(),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),k=g.length;if(f!=k&&!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 C=p;++x<f;){M=y[x];var w=r[M],_=s[M];if(l)var L=p?l(_,w,M,s,r,u):l(w,_,M,r,s,u);if(!(L===void 0?w===_||h(w,_,d,l,u):L)){b=!1;break}C||(C=M=="constructor")}if(b&&!C){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 jb=i,jb}var Sb,uS;function D4e(){if(uS)return Sb;uS=1;var e=h1(),t=It(),n=e(t,"DataView");return Sb=n,Sb}var $b,pS;function B4e(){if(pS)return $b;pS=1;var e=h1(),t=It(),n=e(t,"Promise");return $b=n,$b}var qb,yS;function R4e(){if(yS)return qb;yS=1;var e=h1(),t=It(),n=e(t,"Set");return qb=n,qb}var Ab,kS;function F4e(){if(kS)return Ab;kS=1;var e=h1(),t=It(),n=e(t,"WeakMap");return Ab=n,Ab}var zb,mS;function E4e(){if(mS)return zb;mS=1;var e=D4e(),t=Qw(),n=B4e(),c=R4e(),i=F4e(),r=SL(),s=Yq(),d="[object Map]",l="[object Object]",h="[object Promise]",u="[object Set]",p="[object WeakMap]",y="[object DataView]",f=s(e),g=s(t),k=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),C=b==l?I.constructor:void 0,w=C?s(C):"";if(w)switch(w){case f:return y;case g:return d;case k:return h;case x:return u;case M:return p}return b}),zb=v,zb}var Vb,fS;function O4e(){if(fS)return Vb;fS=1;var e=r4e(),t=Qq(),n=m4e(),c=H4e(),i=E4e(),r=eC(),s=eA(),d=aA(),l=1,h="[object Arguments]",u="[object Array]",p="[object Object]",y=Object.prototype,f=y.hasOwnProperty;function g(k,x,M,v,I,b){var C=r(k),w=r(x),_=C?u:i(k),L=w?u:i(x);_=_==h?p:_,L=L==h?p:L;var S=_==p,N=L==p,j=_==L;if(j&&s(k)){if(!s(x))return!1;C=!0,S=!1}if(j&&!S)return b||(b=new e),C||d(k)?t(k,x,M,v,I,b):n(k,x,_,M,v,I,b);if(!(M&l)){var A=S&&f.call(k,"__wrapped__"),B=N&&f.call(x,"__wrapped__");if(A||B){var D=A?k.value():k,V=B?x.value():x;return b||(b=new e),I(D,V,M,v,b)}}return j?(b||(b=new e),c(k,x,M,v,I,b)):!1}return Vb=g,Vb}var Pb,gS;function U4e(){if(gS)return Pb;gS=1;var e=O4e(),t=AL();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 Pb=n,Pb}var Tb,vS;function W4e(){if(vS)return Tb;vS=1;var e=U4e();function t(n,c){return e(n,c)}return Tb=t,Tb}var G4e=W4e();const K4e=a.getDefaultExportFromCjs(G4e),Z4e=({schema:e,initialData:t={},onSubmit:n,submitLabel:c,submitIcon:i,submitIconPosition:r="left",onCancel:s,cancelLabel:d="Retour",cancelIcon:l})=>{const[h,u]=m.useState(t),[p,y]=m.useState({}),[f,g]=m.useState({}),[k,x]=m.useState(!1),M=m.useRef(t);m.useEffect(()=>{K4e(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(A=>A.name===L);if(j){const A=vL(S,j);y(B=>({...B,[L]:A.isValid?"":A.error}))}}},I=L=>{if(!f[L]){g(N=>({...N,[L]:!0}));const S=e.fields.find(N=>N.name===L);if(S){const N=vL(h[L],S);y(j=>({...j,[L]:N.isValid?"":N.error}))}}},b=async L=>{L.preventDefault(),x(!0);const S=e.fields.reduce((j,A)=>(A.type!=="section"&&(j[A.name]=!0),j),{});g(S);const N=Tq(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(A=>({...A,__global:"Une erreur est survenue lors de la soumission"}))}x(!1)},C=l?xt[l]:null,w=i&&xt[i]||e.submitIcon&&xt[e.submitIcon]||null,_=e.columns&&e.columns>0?Math.floor(e.columns):12;return o.jsxs("div",{className:ke.formContainer,children:[o.jsx("div",{className:ke.headerLine,children:o.jsx("h2",{className:ke.formTitle,children:e.title})}),e.description&&o.jsx("p",{className:ke.formDescription,children:e.description}),p.__global&&o.jsx("div",{className:`alert alert-danger ${ke.globalError}`,children:p.__global}),o.jsxs("form",{onSubmit:b,children:[o.jsx("div",{className:ke.gridContainer,style:{gridTemplateColumns:`repeat(${_}, minmax(0, 1fr))`},children:e.fields.map(L=>{if(L.type==="section")return o.jsxs("div",{className:ke.sectionFull,children:[o.jsx("h5",{className:ke.sectionTitle,children:L.label}),L.help&&o.jsx("p",{className:ke.sectionHelp,children:L.help})]},L.name);const N={gridColumn:`span ${Math.max(1,Math.min(_,L.gridCol??_))}`};return o.jsxs("div",{className:ke.fieldGridItem,style:N,children:[o.jsx(Wq,{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:ke.fieldHelp,children:L.help})]},L.name)})}),o.jsxs("div",{className:ke.formFooter,children:[o.jsx("div",{className:ke.footerLeft,children:s&&o.jsxs("button",{type:"button",className:ke.cancelLink,onClick:s,children:[C&&o.jsx(C,{size:16,className:"me-2"})," ",d]})}),o.jsx("div",{className:ke.footerRight,children:o.jsx(sL,{type:"submit",variant:"primary",size:"md",className:ke.submitButton,disabled:k,children:k?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"spinner-border spinner-border-sm me-2",role:"status"}),"Validation..."]}):o.jsxs(o.Fragment,{children:[w&&(r==="left"||e.submitIconPosition==="left")&&o.jsx(w,{size:16,className:"me-2"}),c||e.submitText||"Valider",w&&(r==="right"||e.submitIconPosition==="right")&&o.jsx(w,{size:16,className:"ms-2"})]})})})]})]})]})};function X4e(e){return{title:e._formTitle||"Formulaire",description:e._formDescription,fields:e._fieldMetadata||[],submitText:e._submitText||"Valider"}}const xS=new Map,pw=({path:e,style:t,width:n=24,height:c=24,keepColors:i=!1,onClick:r})=>{const s=/^https?:\/\//.test(e),[d,l]=m.useState("");if(m.useEffect(()=>{if(s)return;e&&(async()=>{try{let u=xS.get(e);u||(u=fetch(e).then(k=>{if(!k.ok)throw new Error(`Failed to load ${e}`);return k.text()}),xS.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},Y4e="_container_1gljv_85",J4e="_tableWrapper_1gljv_111",Q4e="_tableControls_1gljv_117",e5e="_controlsRight_1gljv_128",t5e="_limitedRows_1gljv_151",a5e="_table_1gljv_111",n5e="_headerCell_1gljv_206",o5e="_headerContent_1gljv_220",c5e="_headerWords_1gljv_229",i5e="_headerWord_1gljv_229",r5e="_cellContent_1gljv_276",s5e="_alignLeft_1gljv_286",d5e="_alignCenter_1gljv_290",l5e="_alignRight_1gljv_294",h5e="_tableCell_1gljv_298",u5e="_tableRow_1gljv_308",p5e="_emptyRow_1gljv_385",y5e="_toggleFiltersButton_1gljv_393",k5e="_toggleSortButton_1gljv_394",m5e="_buttonTextCompact_1gljv_415",f5e="_uppercaseSmall_1gljv_450",g5e="_filtersPanel_1gljv_463",v5e="_filtersPanelInline_1gljv_481",x5e="_filtersPanelHorizontal_1gljv_492",M5e="_filtersRow_1gljv_492",_5e="_filtersActionsHorizontal_1gljv_525",L5e="_filterItemInline_1gljv_542",I5e="_filterLabel_1gljv_571",b5e="_filterInput_1gljv_576",w5e="_filterSelect_1gljv_577",C5e="_operatorSelect_1gljv_578",N5e="_operatorInput_1gljv_579",j5e="_activeFilterTag_1gljv_597",S5e="_actionsGroup_1gljv_609",$5e="_applyButton_1gljv_615",q5e="_cancelButton_1gljv_625",A5e="_columnSorterContainer_1gljv_649",z5e="_sorterControls_1gljv_654",V5e="_sortDropdownWrapper_1gljv_659",P5e="_sortDropdown_1gljv_659",T5e="_sortDropdownHeader_1gljv_679",H5e="_closeButton_1gljv_688",D5e="_sortDropdownContent_1gljv_703",B5e="_sortDropdownItem_1gljv_709",R5e="_sortDirectionButtons_1gljv_734",F5e="_sortDirectionButton_1gljv_734",E5e="_activeSort_1gljv_757",O5e="_sortActions_1gljv_764",U5e="_paginationButton_1gljv_842",W5e="_pageSizeSelect_1gljv_844",G5e="_topPagination_1gljv_853",K5e="_paginationContainer_1gljv_861",Z5e="_leftGroup_1gljv_874",X5e="_pageSizeControls_1gljv_882",Y5e="_paginationInfo_1gljv_908",J5e="_paginationControls_1gljv_916",Q5e="_disabledButton_1gljv_947",eke="_activeButton_1gljv_952",tke="_navigationButton_1gljv_962",ake="_operatorFilterContainer_1gljv_1010",nke="_rangeSeparator_1gljv_1016",oke="_activeFiltersSection_1gljv_1179",cke="_activeFiltersRow_1gljv_1184",ike="_activeFiltersList_1gljv_1192",rke="_clearAllButton_1gljv_1200",ske="_removeFilterButton_1gljv_1221",dke="_sortIndicator_1gljv_1272",lke="_active_1gljv_349",hke="_clearSortButton_1gljv_1371",uke="_loaderSpinner_1gljv_2743",pke="_loaderSpinnerSmall_1gljv_2755",yke="_paginationLoading_1gljv_2772",kke="_loadingButton_1gljv_2780",mke="_loadingIndicator_1gljv_2791",P={container:Y4e,tableWrapper:J4e,tableControls:Q4e,controlsRight:e5e,limitedRows:t5e,table:a5e,headerCell:n5e,headerContent:o5e,headerWords:c5e,headerWord:i5e,cellContent:r5e,alignLeft:s5e,alignCenter:d5e,alignRight:l5e,tableCell:h5e,tableRow:u5e,emptyRow:p5e,toggleFiltersButton:y5e,toggleSortButton:k5e,buttonTextCompact:m5e,uppercaseSmall:f5e,filtersPanel:g5e,filtersPanelInline:v5e,filtersPanelHorizontal:x5e,filtersRow:M5e,filtersActionsHorizontal:_5e,filterItemInline:L5e,filterLabel:I5e,filterInput:b5e,filterSelect:w5e,operatorSelect:C5e,operatorInput:N5e,activeFilterTag:j5e,actionsGroup:S5e,applyButton:$5e,cancelButton:q5e,columnSorterContainer:A5e,sorterControls:z5e,sortDropdownWrapper:V5e,sortDropdown:P5e,sortDropdownHeader:T5e,closeButton:H5e,sortDropdownContent:D5e,sortDropdownItem:B5e,sortDirectionButtons:R5e,sortDirectionButton:F5e,activeSort:E5e,sortActions:O5e,paginationButton:U5e,pageSizeSelect:W5e,topPagination:G5e,paginationContainer:K5e,leftGroup:Z5e,pageSizeControls:X5e,paginationInfo:Y5e,paginationControls:J5e,disabledButton:Q5e,activeButton:eke,navigationButton:tke,operatorFilterContainer:ake,rangeSeparator:nke,activeFiltersSection:oke,activeFiltersRow:cke,activeFiltersList:ike,clearAllButton:rke,removeFilterButton:ske,sortIndicator:dke,active:lke,clearSortButton:hke,loaderSpinner:uke,loaderSpinnerSmall:pke,paginationLoading:yke,loadingButton:kke,loadingIndicator:mke},fke=({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:P.filterSelect,children:[o.jsx("option",{value:"",children:`Filtrer ${e.label}...`}),o.jsx("option",{value:"true",children:"Oui"}),o.jsx("option",{value:"false",children:"Non"})]}),gke=({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:P.filterInput}),vke=({config:e,value:t,onChange:n,disabled:c})=>{const[i,r]=m.useState([]);m.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:P.filterMultiSelect,children:i.map((d,l)=>o.jsx("option",{value:String(d.value),children:d.label},l))})},MS=({config:e,value:t,onChange:n,disabled:c})=>{const[i,r]=m.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:P.filterInput})},xke=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=m.useState([]),[s,d]=m.useState(!1);m.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:P.filterInput,children:[o.jsx("option",{value:"",children:"Select..."}),i.map(h=>o.jsx("option",{value:h.value,children:h.label},h.value))]})},Mke=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=m.useState("");m.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:P.filterInput})},_ke=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=m.useState(t?.operator||""),[s,d]=m.useState(t?.value||"");m.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:P.operatorFilterContainer,children:[o.jsxs("select",{value:i,onChange:l,disabled:c,className:P.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:P.operatorInput})]})},Lke=({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:P.dateRangeContainer,children:[o.jsx("input",{type:"date",value:c.start||"",onChange:i,disabled:n,className:P.filterInput}),o.jsx("span",{className:P.rangeSeparator,children:"→"}),o.jsx("input",{type:"date",value:c.end||"",onChange:r,disabled:n,className:P.filterInput})]})},Ike=({config:e,value:t,onChange:n,disabled:c})=>{switch(e.type){case"text":case"search":return o.jsx(Mke,{config:e,value:t,onChange:n,disabled:c});case"number":return o.jsx(MS,{config:e,value:t,onChange:n,disabled:c});case"range":return o.jsx(MS,{config:e,value:t,onChange:n,disabled:c});case"select":return o.jsx(xke,{config:e,value:t,onChange:n,disabled:c});case"operator":return o.jsx(_ke,{config:e,value:t,onChange:n,disabled:c});case"multiselect":return o.jsx(vke,{config:e,value:t,onChange:n,disabled:c});case"date":return o.jsx(gke,{config:e,value:t,onChange:n,disabled:c});case"daterange":return o.jsx(Lke,{config:e,value:t??{start:"",end:""},onChange:n,disabled:c});case"boolean":return o.jsx(fke,{config:e,value:t,onChange:n,disabled:c});default:return o.jsxs("div",{children:["Type de filtre non supporté: ",e.type]})}},nA=({filters:e,externalFilters:t=[],onFiltersChange:n,onApply:c,isControlled:i=!1})=>{const[r,s]=m.useState([]),[d,l]=m.useState(()=>{const g={};return e.forEach(k=>{k.type==="daterange"?g[k.id]={start:"",end:""}:g[k.id]=k.defaultValue??""}),g});m.useEffect(()=>{if(!i)return;const g={...d??{}};e.forEach(k=>{k.id in g||(g[k.id]=k.type==="daterange"?{start:"",end:""}:k.defaultValue??"")}),(t||[]).forEach(k=>{!k||!k.id||(g[k.id]=k.value)}),l(g),s(t??[])},[i,JSON.stringify(t||[]),JSON.stringify(e.map(g=>g.id))]);const h=i?t:r,u=m.useCallback((g,k)=>{l(x=>({...x,[g]:k}))},[]),p=m.useCallback(async()=>{const g=[],k={...d};for(const[x,M]of Object.entries(k)){const v=e.find(C=>C.id===x);if(!v)continue;let I=M;try{typeof M=="function"&&(I=await M(k)),typeof v.executeOnApply=="function"&&(I=await v.executeOnApply(I,k))}catch{continue}if(v.type==="daterange"){const C=I?.start??"",w=I?.end??"",_=typeof C=="string"?C.trim()==="":!C,L=typeof w=="string"?w.trim()==="":!w;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=m.useCallback(g=>{l(k=>({...k,[g]:void 0})),u(g,void 0)},[u]),f=m.useCallback(()=>{const g={};e.forEach(k=>{k.type==="daterange"?g[k.id]={start:"",end:""}:g[k.id]=k.defaultValue??""}),l(g),i?n?.([]):(s([]),c?.([]))},[e,i,n,c]);return{appliedFilters:h,tempFilters:d,updateFilter:u,applyFilters:p,clearFilter:y,clearAllFilters:f}},bke=(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 oA(e,t,n="",c={key:null,direction:"asc"},i=1,r=10,s=[]){const d=Math.max(1,r),l=(n||"").trim().toLowerCase(),h=m.useMemo(()=>{let k=e;return l&&(k=k.filter(x=>t.some(M=>{const v=x.data[M.id];return v==null?!1:String(v).toLowerCase().includes(l)}))),s.length>0&&(k=k.filter(x=>s.every(M=>{try{const v=x.data[M.id];return bke(v,M)}catch(v){return console.error("Error applying filter:",v),!1}}))),k},[e,t,l,s]),u=m.useMemo(()=>{if(!c?.key)return h;const k=c.key;return[...h].sort((x,M)=>{const v=x.data[k],I=M.data[k];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 C=v.getTime()-I.getTime();return c.direction==="desc"?-C:C}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 cA=({value:e})=>e,iA=({value:e})=>m.createElement("a",{href:`mailto:${e}`,className:"email-link"},e),rA=({value:e})=>m.createElement("a",{href:String(e),target:"_blank",rel:"noopener noreferrer",className:"text-link"},e),sA=({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 m.createElement("span",{className:`badge ${i}`},c)},dA=({value:e})=>{try{return new Date(e).toLocaleDateString()}catch{return String(e)}},lA=({value:e})=>m.createElement("span",{className:"number-value"},Number(e).toLocaleString()),hA=({value:e})=>m.createElement("span",{className:"currency-value"},new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR"}).format(Number(e))),uA=({value:e})=>m.createElement("div",{className:"image-container"},m.createElement("img",{src:e,alt:"Table content",className:"table-image",onError:t=>t.currentTarget.style.display="none"})),yw={renderers:{text:cA,email:iA,link:rA,badge:sA,date:dA,number:lA,currency:hA,image:uA},icons:{sortAsc:m.createElement(Ac,{className:"sort-icon active",size:14}),sortDesc:m.createElement(Ht,{className:"sort-icon active",size:14}),sortDefault:m.createElement(a1,{className:"sort-icon",size:14})}},wke=(e,t)=>{yw.renderers[e]&&console.warn(`Le renderer "${e}" existe déjà et sera écrasé.`),yw.renderers[e]=t},Cke=({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:k=!1})=>{const[x,M]=m.useState(!1),v=typeof s=="boolean"?s:x,{appliedFilters:I,tempFilters:b,updateFilter:C,applyFilters:w,clearAllFilters:_}=nA({filters:e,externalFilters:t,onFiltersChange:n,onApply:c,isControlled:i}),L=m.useRef(null),S=m.useRef(null);m.useEffect(()=>{if(v&&L.current){const V=L.current.getBoundingClientRect().height;h?.(V)}else h?.(0)},[v,e,b,h]);const N=()=>{typeof s=="boolean"?d?.(!s):M(V=>{const q=!V;return d?.(q),q})},j=()=>e.map(V=>{const q=b?.[V.id];return q==null||typeof q=="string"&&q.trim()===""?null:{id:V.id,label:V.label,value:q}}).filter(Boolean),A=async()=>{let V;try{V=await w()}catch{V=void 0}let q=[];V&&Array.isArray(V)&&V.length>0?q=V:I&&I.length>0?q=I:q=j(),n?.(q),c?.(q)},B=()=>{d?.(!1),typeof s!="boolean"&&M(!1)},D=()=>{_(),n?.([]),c?.([])};return m.useEffect(()=>{const V=$=>{v&&S.current&&(S.current.contains($.target)||(d?.(!1),typeof s!="boolean"&&M(!1)))},q=$=>{$.key==="Escape"&&v&&(d?.(!1),typeof s!="boolean"&&M(!1))};return v&&(document.addEventListener("pointerdown",V),document.addEventListener("keydown",q)),()=>{document.removeEventListener("pointerdown",V),document.removeEventListener("keydown",q)}},[v,s,d]),o.jsxs("div",{className:P.advancedFiltersContainer,ref:S,children:[o.jsxs("button",{className:`${P.toggleFiltersButton} ${I.length>0?P.active:""} ${v?P.toggleFiltersButtonOpen:""} ${k?P.loadingButton:""}`,onClick:N,"aria-expanded":v,"aria-controls":"advanced-filters-panel",type:"button",disabled:k,children:[k?o.jsx("span",{className:P.loaderSpinnerSmall}):o.jsx(At,{size:14}),o.jsx("span",{className:P.buttonTextCompact,children:u}),I.length>0&&!k&&o.jsx("span",{className:P.filterCountBadge,"aria-hidden":!0,children:I.length}),k&&o.jsx("span",{className:P.loadingIndicator,"aria-hidden":!0,children:"Chargement..."})]}),v&&o.jsxs("div",{id:"advanced-filters-panel",ref:L,className:`${P.filtersPanel} ${l==="top"?`${P.filtersPanelInline} ${P.filtersPanelHorizontal}`:""}`,role:"region","aria-label":"Panneau de filtres avancés",children:[o.jsx("div",{className:P.filtersRow,children:e.map(V=>o.jsxs("div",{className:`${P.filterItem} ${P.filterItemInline}`,children:[o.jsxs("label",{className:P.filterLabel,children:[V.label,V.required&&o.jsx("span",{className:P.required,children:"*"})]}),o.jsx(Ike,{config:V,value:b[V.id],onChange:q=>C(V.id,q),disabled:V.disabled})]},V.id))}),o.jsxs("div",{className:P.filtersActionsHorizontal,children:[o.jsx("div",{className:P.activeFiltersSection,children:I.length>0&&o.jsxs("div",{className:P.activeFiltersRow,children:[o.jsx("span",{className:P.activeLabelCompact,children:"Actifs :"}),o.jsx("div",{className:P.activeFiltersList,children:I.map(V=>o.jsxs("div",{className:P.activeFilterTag,children:[V.label??V.id,o.jsx("button",{className:P.removeFilterButton,onClick:()=>C(V.id,void 0),"aria-label":`Supprimer ${V.id}`,type:"button",children:"×"})]},V.id))}),o.jsxs("button",{className:P.clearAllButton,onClick:D,type:"button",children:[o.jsx(Qe,{size:12})," ",f]})]})}),o.jsxs("div",{className:P.actionsGroup,children:[o.jsx("button",{className:P.cancelButton,onClick:B,type:"button",disabled:k,children:y}),o.jsx("button",{className:`${P.applyButton} ${k?P.loadingButton:""}`,onClick:A,type:"button",disabled:g||k,"aria-disabled":g||k,children:k?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:P.loaderSpinnerSmall}),o.jsx("span",{children:"Chargement..."})]}):p})]})]})]})]})},_S=e=>{const t=e.replace(/[^A-Za-zÀ-ÖØ-öø-ÿ]/g,"");return t.length>0&&t===t.toUpperCase()},Nke=({columns:e,sortConfig:t,onSort:n,label:c="Sort",loading:i=!1})=>{const[r,s]=m.useState(!1),d=e.filter(g=>g.sortable),l=m.useRef(null),h=t?.key!==null&&t?.key!==void 0,u=(g,k)=>{n({key:g,direction:k}),s(!1)},p=()=>{n({key:null,direction:"asc"}),s(!1)},y=()=>s(g=>!g),f=()=>{s(!1)};return m.useEffect(()=>{if(!r)return;const g=x=>{if(!l.current)return;const M=x.target;M&&!l.current.contains(M)&&s(!1)},k=x=>{x.key==="Escape"&&s(!1)};return document.addEventListener("pointerdown",g),document.addEventListener("keydown",k),()=>{document.removeEventListener("pointerdown",g),document.removeEventListener("keydown",k)}},[r]),m.useEffect(()=>{const g=document.querySelector("[data-table-wrapper]");if(!g)return;const k=g.style.overflow??"";return r?g.style.overflow="hidden":g.style.overflow=k,()=>{g.style.overflow=k}},[r]),o.jsx("div",{className:P.columnSorterContainer,ref:l,children:o.jsx("div",{className:P.sorterControls,children:d.length>0&&o.jsxs("div",{className:P.sortDropdownWrapper,ref:l,children:[o.jsxs("button",{className:`${P.toggleSortButton} ${r?P.toggleSortButtonOpen:""} ${h?P.active:""} ${i?P.loadingButton:""}`,onClick:y,"aria-expanded":r,"aria-haspopup":"true",type:"button",disabled:i,children:[i?o.jsx("span",{className:P.loaderSpinnerSmall}):o.jsx(a1,{size:14}),o.jsx("span",{className:`${P.buttonTextCompact} ${_S(c)?P.uppercaseSmall:""}`,children:c}),h&&!i&&o.jsx("div",{className:P.sortIndicator,children:t?.direction==="asc"?o.jsx(Ac,{size:12}):o.jsx(Ht,{size:12})})]}),r&&o.jsxs("div",{className:`${P.sortDropdown} ${P.sortDropdownInline}`,role:"menu",children:[o.jsxs("div",{className:P.sortDropdownHeader,children:[o.jsx("span",{children:"Trier par:"}),o.jsx("button",{className:P.closeButton,onClick:f,"aria-label":"Fermer",type:"button",children:o.jsx(Qe,{size:16})})]}),o.jsx("div",{className:P.sortDropdownContent,children:d.map(g=>{const k=String(g.label??g.id),x=_S(k);return o.jsxs("div",{className:P.sortDropdownItem,role:"menuitem",tabIndex:0,onKeyDown:M=>{M.key==="Enter"&&u(g.id,"asc")},children:[o.jsx("span",{className:`${P.columnSorterLabel} ${x?P.uppercaseSmall:""}`,title:k,"aria-label":k,children:k}),o.jsxs("div",{className:P.sortDirectionButtons,children:[o.jsx("button",{className:`${P.sortDirectionButton} ${t?.key===g.id&&t?.direction==="asc"?P.activeSort:""}`,onClick:()=>u(g.id,"asc"),title:"Trier par ordre croissant",type:"button",children:o.jsx(Ac,{size:12})}),o.jsx("button",{className:`${P.sortDirectionButton} ${t?.key===g.id&&t?.direction==="desc"?P.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:P.sortActions,children:o.jsxs("button",{className:P.clearSortButton,onClick:p,type:"button",children:[o.jsx(qt,{size:14}),o.jsx("span",{children:"Annuler le tri"})]})})]})]})})})},jke=({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 k=h+1;r(k)}},y=c>0?(h-1)*n+1:0,f=c>0?Math.min(h*n,c):0,g=()=>{const k=[];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++)k.push(I);return k};return o.jsxs("div",{className:P.paginationContainer,role:"navigation","aria-label":"Pagination",children:[o.jsx("div",{className:P.leftGroup,children:s&&o.jsx("div",{className:P.pageSizeControls,children:o.jsx("select",{value:n,onChange:k=>s(Number(k.target.value)),className:P.pageSizeSelect,"aria-label":"Taille de page",disabled:d,children:[10,20,30].map(k=>o.jsx("option",{value:k,children:k},k))})})}),o.jsx("div",{className:P.paginationInfo,"aria-live":"polite",children:d?o.jsxs("span",{className:P.paginationLoading,children:[o.jsx("span",{className:P.loaderSpinner}),o.jsx("span",{children:"Chargement..."})]}):`${y}-${f} ${i}`}),o.jsxs("div",{className:P.paginationControls,children:[o.jsx("button",{onClick:u,disabled:h===1||d,className:`${P.paginationButton} ${P.navigationButton} ${h===1?P.disabledButton:""} ${d?P.loadingButton:""}`,"aria-label":"Page précédente",children:d&&h>1?o.jsx("span",{className:P.loaderSpinnerSmall}):"«"}),g().map(k=>o.jsx("button",{onClick:()=>r(k),disabled:d,"aria-current":h===k?"page":void 0,className:`${P.paginationButton} ${h===k?P.activeButton:""} ${d?P.loadingButton:""}`,children:d&&h===k?o.jsx("span",{className:P.loaderSpinnerSmall}):k},k)),o.jsx("button",{onClick:p,disabled:d||h>=l,className:`${P.paginationButton} ${P.navigationButton} ${d?P.loadingButton:""} ${h>=l?P.disabledButton:""}`,"aria-label":"Page suivante",children:d?o.jsx("span",{className:P.loaderSpinnerSmall}):"»"})]})]})},Ske=(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)},$ke=e=>{if(!e)return!1;const t=e.trim().split(/\s+/);return e.length>18||t.length>2},qke=({columns:e})=>o.jsx("thead",{className:P.tableHeader,children:o.jsx("tr",{children:e.map((t,n)=>{const c=t.align==="right"?P.alignRight:t.align==="left"?P.alignLeft:P.alignCenter,i=t.preserveHeaderCase===!0,r=Ske(String(t.label??""),i),s=$ke(r),d=s?r.split(/\s+/):[];return o.jsx("th",{className:`${P.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:P.headerContent,children:s?o.jsx("div",{className:P.headerWords,children:d.map((l,h)=>o.jsx("span",{className:P.headerWord,children:l},h))}):o.jsx("span",{children:r})})},t.id??`col-${n}`)})})}),Ake=({value:e,row:t,column:n})=>{const c=n.align==="right"?P.alignRight:n.align==="left"?P.alignLeft:P.alignCenter,i=typeof n.render=="function"?n.render(e,t):e==null?"":String(e);return o.jsx("td",{className:`${P.tableCell} ${c}`,style:{width:n.width??void 0},children:o.jsx("div",{className:P.cellContent,children:i})})},zke=({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:`${P.tableRow} ${c?P.clickableRow:""}`,onClick:()=>c?.(e,i),style:u,children:n.map(p=>o.jsx(Ake,{value:e[p.id],row:e,column:p},`${t}-${p.id}`))})},Vke=({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:P.emptyRow,children:i?"Aucun résultat trouvé":"Aucune donnée disponible"})})}):o.jsx("tbody",{children:e.map((s,d)=>o.jsx(zke,{row:s.data,rowId:s.id,columns:t,onRowClick:n,index:c+d-1,getRowStyle:r},s.id))}),pA=({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:k,onPageChange:x,itemLabel:M="items",advancedFiltersLabel:v="Advanced-Filters",advancedFiltersActiveLabel:I,sortLabel:b="Sort",applyLabel:C="Apply",cancelLabel:w="Cancel",clearLabel:_="Clear",applyDisabled:L=!1,paginationLoading:S=!1,filtersLoading:N=!1,sortLoading:j=!1,totalCount:A=null})=>{const[B,D]=m.useState({key:null,direction:"asc"}),[V,q]=m.useState(n.currentPage??1),[$,H]=m.useState(n.pageSize??10),[R,z]=m.useState(!1),O=m.useRef(null),[X,ie]=m.useState([]),ae=p?d:X,fe=p?[]:X;m.useEffect(()=>{const he=n.currentPage??1,wt=n.pageSize??10;he!==V&&q(he),wt!==$&&H(wt)},[n.currentPage,n.pageSize]);const{paginatedData:le,sortedData:be,totalPages:ne,startIndex:ee}=oA(t,e,i,B,V,$,fe),te=be.length,re=typeof A=="number"&&A>=0?A:te;let pe=ne;typeof A=="number"&&A>=0&&(pe=Math.max(1,Math.ceil(A/$)));const se=te>10;m.useEffect(()=>{const he=Math.max(1,Math.floor(pe));V>he&&q(he),V<1&&q(1)},[pe]);const G=he=>{p||ie(he),l?.(he),q(1),x?.(1)},K=he=>{p||ie(he),h?.(he),q(1),x?.(1),O.current&&O.current.style.setProperty("--filters-panel-height","0px")},oe=he=>{x?.(he),q(he)},Ne=he=>{H(he),q(1),k?.(he),x?.(1)},qe=he=>{O.current&&O.current.style.setProperty("--filters-panel-height",`${Math.round(he)}px`)},ve=he=>{D(he),u?.(he)},Ve=he=>{z(he),!he&&O.current&&O.current.style.setProperty("--filters-panel-height","0px")};m.useEffect(()=>{(ae?.length??0)>0&&z(!0)},[ae]),m.useEffect(()=>{s.length>0&&ae.length>0&&z(!0)},[s.length,ae.length]);const bt=(ae?.length??0)>0&&I?I:v;return o.jsxs("div",{ref:O,className:`${P.container} ${r} ${R?P.filtersOpen:""}`,style:{background:g,"--row-height":"48px","--header-height":"56px"},children:[o.jsx("div",{className:P.tableControls,children:o.jsxs("div",{className:P.controlsRight,children:[o.jsx(Nke,{columns:e,onSort:ve,label:b,sortConfig:B,loading:j}),s.length>0&&o.jsx(Cke,{filters:s,externalFilters:ae,onFiltersChange:G,onApply:K,isControlled:p,debounceTimeout:y,expanded:R,onToggle:Ve,panelPlacement:"top",onPanelHeightChange:qe,label:bt,applyLabel:C,cancelLabel:w,clearLabel:_,applyDisabled:L,loading:N})]})}),o.jsx("div",{className:P.topPagination,children:o.jsx(jke,{currentPage:V,totalPages:pe,pageSize:$,totalItems:re,itemLabel:M,onPageChange:oe,onPageSizeChange:Ne,loading:S})}),o.jsx("div",{className:`${P.tableWrapper} ${se?P.limitedRows:""}`,"data-table-wrapper":!0,children:o.jsxs("table",{className:P.table,children:[o.jsx(qke,{columns:e}),o.jsx(Vke,{data:le,columns:e,onRowClick:c,startIndex:ee,getRowStyle:f,searchTerm:i})]})})]})};function Pke(e){const{pagination:t,totalCount:n,onPageChange:c,...i}=e,r=t?.pageSize??20,s=t?.currentPage??1,d=m.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(pA,{...i,pagination:{pageSize:r,currentPage:s},totalCount:n,onPageChange:u})}const Tke=({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 k=y;k<=f;k++)g.push(k);return o.jsxs(Hke,{className:s,children:[o.jsxs(Dke,{children:[l,"-",h," ",r," ",n," ",u]}),o.jsx(Bke,{}),d>1&&o.jsxs(Rke,{children:[o.jsx(ii,{onClick:()=>c(1),disabled:e===1,title:"Première page",children:"<<"}),o.jsx(ii,{onClick:()=>c(e-1),disabled:e===1,title:"Page précédente",children:"<"}),g.map(k=>o.jsx(Fke,{$active:k===e,onClick:()=>c(k),children:k},k)),o.jsx(ii,{onClick:()=>c(e+1),disabled:e===d,title:"Page suivante",children:">"}),o.jsx(ii,{onClick:()=>c(d),disabled:e===d,title:"Dernière page",children:">>"})]})]})},Hke=F.div`
|
|
8272
|
+
`),()=>{x.contains(k)&&x.removeChild(k)}},[t]),o.jsx(ule,{isPresent:t,childRef:r,sizeRef:s,children:Q.cloneElement(e,{ref:l})})}const yle=({children:e,initial:t,isPresent:n,onExitComplete:c,custom:i,presenceAffectsLayout:r,mode:s,anchorX:d,root:l})=>{const h=Bt(kle),u=m.useId();let p=!0,y=m.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}),m.useMemo(()=>{h.forEach((f,g)=>h.set(g,!1))},[n]),Q.useEffect(()=>{!n&&!h.size&&c&&c()},[n]),s==="popLayout"&&(e=o.jsx(ple,{isPresent:n,anchorX:d,root:l,children:e})),o.jsx(_L.Provider,{value:y,children:e})};function kle(){return new Map}function G$(e=!0){const t=m.useContext(_L);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:c,register:i}=t,r=m.useId();m.useEffect(()=>{if(e)return i(r)},[e]);const s=m.useCallback(()=>e&&c&&c(r),[r,c,e]);return!n&&c?[!1,s]:[!0]}const oi=e=>e.key||"";function OC(e){const t=[];return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const mle=({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]=G$(s),p=m.useMemo(()=>OC(e),[e]),y=s&&!h?[]:p.map(oi),f=m.useRef(!0),g=m.useRef(p),k=Bt(()=>new Map),[x,M]=m.useState(p),[v,I]=m.useState(p);vw(()=>{f.current=!1,g.current=p;for(let w=0;w<v.length;w++){const _=oi(v[w]);y.includes(_)?k.delete(_):k.get(_)!==!0&&k.set(_,!1)}},[v,y.length,y.join("-")]);const b=[];if(p!==x){let w=[...p];for(let _=0;_<v.length;_++){const L=v[_],S=oi(L);y.includes(S)||(w.splice(_,0,L),b.push(L))}return r==="wait"&&b.length&&(w=b),I(OC(w)),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:C}=m.useContext(fw);return o.jsx(o.Fragment,{children:v.map(w=>{const _=oi(w),L=s&&!h?!1:p===v||y.includes(_),S=()=>{if(k.has(_))k.set(_,!0);else return;let N=!0;k.forEach(j=>{j||(N=!1)}),N&&(C?.(),I(g.current),s&&u?.(),c&&c())};return o.jsx(yle,{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:w},_)})})},K$=m.createContext({strict:!1}),UC={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 UC)i1[e]={isEnabled:t=>UC[e].some(n=>!!t[n])};function fle(e){for(const t in e)i1[t]={...i1[t],...e[t]}}const gle=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 mL(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||gle.has(e)}let Z$=e=>!mL(e);function vle(e){typeof e=="function"&&(Z$=t=>t.startsWith("on")?!mL(t):e(t))}try{vle(require("@emotion/is-prop-valid").default)}catch{}function xle(e,t,n){const c={};for(const i in e)i==="values"&&typeof e.values=="object"||(Z$(i)||n===!0&&mL(i)||!t&&!mL(i)||e.draggable&&i.startsWith("onDrag"))&&(c[i]=e[i]);return c}const IL=m.createContext({});function bL(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function U1(e){return typeof e=="string"||Array.isArray(e)}const Rw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Fw=["initial",...Rw];function wL(e){return bL(e.animate)||Fw.some(t=>U1(e[t]))}function X$(e){return!!(wL(e)||e.variants)}function Mle(e,t){if(wL(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 _le(e){const{initial:t,animate:n}=Mle(e,m.useContext(IL));return m.useMemo(()=>({initial:t,animate:n}),[WC(t),WC(n)])}function WC(e){return Array.isArray(e)?e.join(" "):e}const W1={};function Lle(e){for(const t in e)W1[t]=e[t],Cw(t)&&(W1[t].isCSSVariable=!0)}function Y$(e,{layout:t,layoutId:n}){return l1.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!W1[e]||e==="opacity")}const Ile={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ble=d1.length;function wle(e,t,n){let c="",i=!0;for(let r=0;r<ble;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=R$(d,Hw[s]);if(!l){i=!1;const u=Ile[s]||s;c+=`${u}(${h}) `}n&&(t[s]=h)}}return c=c.trim(),n?c=n(t,i?"":c):i&&(c="none"),c}function Ew(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(Cw(l)){i[l]=h;continue}else{const u=R$(h,Hw[l]);l.startsWith("origin")?(d=!0,r[l]=u):c[l]=u}}if(t.transform||(s||n?c.transform=wle(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 Ow=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function J$(e,t,n){for(const c in t)!$e(t[c])&&!Y$(c,n)&&(e[c]=t[c])}function Cle({transformTemplate:e},t){return m.useMemo(()=>{const n=Ow();return Ew(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Nle(e,t){const n=e.style||{},c={};return J$(c,n,e),Object.assign(c,Cle(e,t)),c}function jle(e,t){const n={},c=Nle(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 Sle={offset:"stroke-dashoffset",array:"stroke-dasharray"},$le={offset:"strokeDashoffset",array:"strokeDasharray"};function qle(e,t,n=1,c=0,i=!0){e.pathLength=1;const r=i?Sle:$le;e[r.offset]=Y.transform(-c);const s=Y.transform(t),d=Y.transform(n);e[r.array]=`${s} ${d}`}function Q$(e,{attrX:t,attrY:n,attrScale:c,pathLength:i,pathSpacing:r=1,pathOffset:s=0,...d},l,h,u){if(Ew(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&&qle(p,i,r,s,!1)}const eq=()=>({...Ow(),attrs:{}}),tq=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ale(e,t,n,c){const i=m.useMemo(()=>{const r=eq();return Q$(r,t,tq(c),e.transformTemplate,e.style),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};J$(r,e.style,e),i.style={...r,...i.style}}return i}const zle=["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 Uw(e){return typeof e!="string"||e.includes("-")?!1:!!(zle.indexOf(e)>-1||/[A-Z]/u.test(e))}function Vle(e,t,n,{latestValues:c},i,r=!1){const d=(Uw(e)?Ale:jle)(t,c,i,e),l=xle(t,typeof e=="string",r),h=e!==m.Fragment?{...l,...d,ref:n}:{},{children:u}=t,p=m.useMemo(()=>$e(u)?u.get():u,[u]);return m.createElement(e,{...h,children:p})}function GC(e){const t=[{},{}];return e?.values.forEach((n,c)=>{t[0][c]=n.get(),t[1][c]=n.getVelocity()}),t}function Ww(e,t,n,c){if(typeof t=="function"){const[i,r]=GC(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]=GC(c);t=t(n!==void 0?n:e.custom,i,r)}return t}function iL(e){return $e(e)?e.get():e}function Ple({scrapeMotionValuesFromProps:e,createRenderState:t},n,c,i){return{latestValues:Tle(n,c,i,e),renderState:t()}}function Tle(e,t,n,c){const i={},r=c(e,{});for(const y in r)i[y]=iL(r[y]);let{initial:s,animate:d}=e;const l=wL(e),h=X$(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"&&!bL(p)){const y=Array.isArray(p)?p:[p];for(let f=0;f<y.length;f++){const g=Ww(e,y[f]);if(g){const{transitionEnd:k,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 k)i[v]=k[v]}}}return i}const aq=e=>(t,n)=>{const c=m.useContext(IL),i=m.useContext(_L),r=()=>Ple(e,t,c,i);return n?r():Bt(r)};function Gw(e,t,n){const{style:c}=e,i={};for(const r in c)($e(c[r])||t.style&&$e(t.style[r])||Y$(r,e)||n?.getValue(r)?.liveStyle!==void 0)&&(i[r]=c[r]);return i}const Hle=aq({scrapeMotionValuesFromProps:Gw,createRenderState:Ow});function nq(e,t,n){const c=Gw(e,t,n);for(const i in e)if($e(e[i])||$e(t[i])){const r=d1.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;c[r]=e[i]}return c}const Dle=aq({scrapeMotionValuesFromProps:nq,createRenderState:eq}),Ble=Symbol.for("motionComponentSymbol");function Xc(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Rle(e,t,n){return m.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 Kw=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Fle="framerAppearId",oq="data-"+Kw(Fle),cq=m.createContext({});function Ele(e,t,n,c,i){const{visualElement:r}=m.useContext(IL),s=m.useContext(K$),d=m.useContext(_L),l=m.useContext(LL).reducedMotion,h=m.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=m.useContext(cq);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&Ole(h.current,n,i,p);const y=m.useRef(!1);m.useInsertionEffect(()=>{u&&y.current&&u.update(n,d)});const f=n[oq],g=m.useRef(!!f&&!window.MotionHandoffIsComplete?.(f)&&window.MotionHasOptimisedAnimation?.(f));return vw(()=>{u&&(y.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),m.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(f)}),g.current=!1),u.enteringChildren=void 0)}),u}function Ole(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:iq(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 iq(e){if(e)return e.options.allowProjection!==!1?e.projection:iq(e.parent)}function ZL(e,{forwardMotionProps:t=!1}={},n,c){n&&fle(n);const i=Uw(e)?Dle:Hle;function r(d,l){let h;const u={...m.useContext(LL),...d,layoutId:Ule(d)},{isStatic:p}=u,y=_le(d),f=i(d,p);if(!p&&gw){Wle(u,n);const g=Gle(u);h=g.MeasureLayout,y.visualElement=Ele(e,f,u,c,g.ProjectionNode)}return o.jsxs(IL.Provider,{value:y,children:[h&&y.visualElement?o.jsx(h,{visualElement:y.visualElement,...u}):null,Vle(e,d,Rle(f,y.visualElement,l),f,p,t)]})}r.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=m.forwardRef(r);return s[Ble]=e,s}function Ule({layoutId:e}){const t=m.useContext(fw).id;return t&&e!==void 0?t+"-"+e:e}function Wle(e,t){const n=m.useContext(K$).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"):ct(!1,c,"lazy-strict-mode")}}function Gle(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 Kle(e,t){if(typeof Proxy>"u")return ZL;const n=new Map,c=(r,s)=>ZL(r,s,e,t),i=(r,s)=>(process.env.NODE_ENV!=="production"&&Iw(!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,ZL(s,void 0,e,t)),n.get(s))})}function rq({top:e,left:t,right:n,bottom:c}){return{x:{min:t,max:n},y:{min:e,max:c}}}function Zle({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Xle(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 XL(e){return e===void 0||e===1}function cw({scale:e,scaleX:t,scaleY:n}){return!XL(e)||!XL(t)||!XL(n)}function jc(e){return cw(e)||sq(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function sq(e){return KC(e.x)||KC(e.y)}function KC(e){return e&&e!=="0%"}function fL(e,t,n){const c=e-n,i=t*c;return n+i}function ZC(e,t,n,c,i){return i!==void 0&&(e=fL(e,i,c)),fL(e,n,c)+t}function iw(e,t=0,n=1,c,i){e.min=ZC(e.min,t,n,c,i),e.max=ZC(e.max,t,n,c,i)}function dq(e,{x:t,y:n}){iw(e.x,t.translate,t.scale,t.originPoint),iw(e.y,n.translate,n.scale,n.originPoint)}const XC=.999999999999,YC=1.0000000000001;function Yle(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,dq(e,s)),c&&jc(r.latestValues)&&Jc(e,r.latestValues))}t.x<YC&&t.x>XC&&(t.x=1),t.y<YC&&t.y>XC&&(t.y=1)}function Yc(e,t){e.min=e.min+t,e.max=e.max+t}function JC(e,t,n,c,i=.5){const r=ge(e.min,e.max,i);iw(e,t,n,r,c)}function Jc(e,t){JC(e.x,t.x,t.scaleX,t.scale,t.originX),JC(e.y,t.y,t.scaleY,t.scale,t.originY)}function lq(e,t){return rq(Xle(e.getBoundingClientRect(),t))}function Jle(e,t,n){const c=lq(e,n),{scroll:i}=t;return i&&(Yc(c.x,i.offset.x),Yc(c.y,i.offset.y)),c}const QC=()=>({translate:0,scale:1,origin:0,originPoint:0}),Qc=()=>({x:QC(),y:QC()}),eN=()=>({min:0,max:0}),Le=()=>({x:eN(),y:eN()}),rw={current:null},hq={current:!1};function Qle(){if(hq.current=!0,!!gw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>rw.current=e.matches;e.addEventListener("change",t),t()}else rw.current=!1}const ehe=new WeakMap;function the(e,t,n){for(const c in t){const i=t[c],r=n[c];if($e(i))e.addValue(c,i);else if($e(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 tN=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ahe{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=Pw,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=Fe.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,me.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=wL(n),this.isVariantNode=X$(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&&$e(f)&&f.set(l[y])}}mount(t){this.current=t,ehe.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)),hq.current||Qle(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:rw.current,process.env.NODE_ENV!=="production"&&Iw(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(),Lt(this.notifyUpdate),Lt(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&&me.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):Le()}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<tN.length;c++){const i=tN[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=the(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"&&(a$(c)||o$(c))?c=parseFloat(c):!dle(c)&&Dt.test(n)&&(c=B$(t,n)),this.setBaseTarget(t,$e(c)?c.get():c)),$e(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=Ww(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&&!$e(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 Lw),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Dw.render(this.render)}}class uq extends ahe{constructor(){super(...arguments),this.KeyframeResolver=X0e}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;$e(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function pq(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 nhe(e){return window.getComputedStyle(e)}class ohe extends uq{constructor(){super(...arguments),this.type="html",this.renderInstance=pq}readValueFromInstance(t,n){if(l1.has(n))return this.projection?.isProjecting?Jb(n):y0e(t,n);{const c=nhe(t),i=(Cw(n)?c.getPropertyValue(n):c[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return lq(t,n)}build(t,n,c){Ew(t,n,c.transformTemplate)}scrapeMotionValuesFromProps(t,n,c){return Gw(t,n,c)}}const yq=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 che(e,t,n,c){pq(e,t,void 0,c);for(const i in t.attrs)e.setAttribute(yq.has(i)?i:Kw(i),t.attrs[i])}class ihe extends uq{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Le}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(l1.has(n)){const c=D$(n);return c&&c.default||0}return n=yq.has(n)?n:Kw(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,c){return nq(t,n,c)}build(t,n,c){Q$(t,n,this.isSVGTag,c.transformTemplate,c.style)}renderInstance(t,n,c,i){che(t,n,c,i)}mount(t){this.isSVGTag=tq(t.tagName),super.mount(t)}}const rhe=(e,t)=>Uw(e)?new ihe(t):new ohe(t,{allowProjection:e!==m.Fragment});function c1(e,t,n){const c=e.getProps();return Ww(c,t,n!==void 0?n:c.custom,e)}const sw=e=>Array.isArray(e);function she(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Dc(n))}function dhe(e){return sw(e)?e[e.length-1]||0:e}function lhe(e,t){const n=c1(e,t);let{transitionEnd:c={},transition:i={},...r}=n||{};r={...r,...c};for(const s in r){const d=dhe(r[s]);she(e,s,d)}}function hhe(e){return!!($e(e)&&e.add)}function dw(e,t){const n=e.getValue("willChange");if(hhe(n))return n.add(t);if(!n&&_t.WillChange){const c=new _t.WillChange("auto");e.addValue("willChange",c),c.add(t)}}function kq(e){return e.props[oq]}const uhe=e=>e!==null;function phe(e,{repeat:t,repeatType:n="loop"},c){const i=e.filter(uhe),r=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[r]}const yhe={type:"spring",stiffness:500,damping:25,restSpeed:10},khe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),mhe={type:"keyframes",duration:.8},fhe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ghe=(e,{keyframes:t})=>t.length>2?mhe:l1.has(e)?e.startsWith("scale")?khe(t[1]):yhe:fhe;function vhe({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 Zw=(e,t,n,c={},i,r)=>s=>{const d=Tw(c,e)||{},l=d.delay||c.delay||0;let{elapsed:h=0}=c;h=h-ot(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};vhe(d)||Object.assign(u,ghe(e,u)),u.duration&&(u.duration=ot(u.duration)),u.repeatDelay&&(u.repeatDelay=ot(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let p=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(nw(u),u.delay===0&&(p=!0)),(_t.instantAnimations||_t.skipAnimations)&&(p=!0,nw(u),u.delay=0),u.allowFlatten=!d.type&&!d.ease,p&&!r&&t.get()!==void 0){const y=phe(u.keyframes,d);if(y!==void 0){me.update(()=>{u.onUpdate(y),u.onComplete()});return}}return d.isSync?new Vw(u):new T0e(u)};function xhe({protectedKeys:e,needsAnimating:t},n){const c=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,c}function mq(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&&xhe(h,u))continue;const f={delay:n,...Tw(r||{},u)},g=p.get();if(g!==void 0&&!p.isAnimating&&!Array.isArray(y)&&y===g&&!f.velocity)continue;let k=!1;if(window.MotionHandoffAnimation){const M=kq(e);if(M){const v=window.MotionHandoffAnimation(M,u,me);v!==null&&(f.startTime=v,k=!0)}}dw(e,u),p.start(Zw(u,p,y,e.shouldReduceMotion&&P$.has(u)?{type:!1}:f,e,k));const x=p.animation;x&&l.push(x)}return s&&Promise.all(l).then(()=>{me.update(()=>{s&&lhe(e,s)})}),l}function fq(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 lw(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(mq(e,c,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:h=0,staggerChildren:u,staggerDirection:p}=i;return Mhe(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 Mhe(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(lw(l,t,{...s,delay:n+(typeof c=="function"?0:c)+fq(e.variantChildren,l,c,i,r)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(d)}function _he(e,t,n={}){e.notify("AnimationStart",t);let c;if(Array.isArray(t)){const i=t.map(r=>lw(e,r,n));c=Promise.all(i)}else if(typeof t=="string")c=lw(e,t,n);else{const i=typeof t=="function"?c1(e,t,n.custom):t;c=Promise.all(mq(e,i,n))}return c.then(()=>{e.notify("AnimationComplete",t)})}function gq(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 Lhe=Fw.length;function vq(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?vq(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Lhe;n++){const c=Fw[n],i=e.props[c];(U1(i)||i===!1)&&(t[c]=i)}return t}const Ihe=[...Rw].reverse(),bhe=Rw.length;function whe(e){return t=>Promise.all(t.map(({animation:n,options:c})=>_he(e,n,c)))}function Che(e){let t=whe(e),n=aN(),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=vq(e.parent)||{},p=[],y=new Set;let f={},g=1/0;for(let x=0;x<bhe;x++){const M=Ihe[x],v=n[M],I=h[M]!==void 0?h[M]:u[M],b=U1(I),C=M===l?v.isActive:null;C===!1&&(g=x);let w=I===u[M]&&I!==h[M]&&b;if(w&&c&&e.manuallyAnimateOnMount&&(w=!1),v.protectedKeys={...f},!v.isActive&&C===null||!I&&!v.prevProp||bL(I)||typeof I=="boolean")continue;const _=Nhe(v.prevProp,I);let L=_||M===l&&v.isActive&&!w&&b||x>g&&b,S=!1;const N=Array.isArray(I)?I:[I];let j=N.reduce(i(M),{});C===!1&&(j={});const{prevResolvedValues:A={}}=v,B={...A,...j},D=$=>{L=!0,y.has($)&&(S=!0,y.delete($)),v.needsAnimating[$]=!0;const H=e.getValue($);H&&(H.liveStyle=!1)};for(const $ in B){const H=j[$],R=A[$];if(f.hasOwnProperty($))continue;let z=!1;sw(H)&&sw(R)?z=!gq(H,R):z=H!==R,z?H!=null?D($):y.add($):H!==void 0&&y.has($)?D($):v.protectedKeys[$]=!0}v.prevProp=I,v.prevResolvedValues=j,v.isActive&&(f={...f,...j}),c&&e.blockInitialAnimation&&(L=!1);const V=w&&_;L&&(!V||S)&&p.push(...N.map($=>{const H={type:M};if(typeof $=="string"&&c&&!V&&e.manuallyAnimateOnMount&&e.parent){const{parent:R}=e,z=c1(R,$);if(R.enteringChildren&&z){const{delayChildren:U}=z.transition||{};H.delay=fq(R.enteringChildren,e,U)}}return{animation:$,options:H}}))}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 k=!!p.length;return c&&(h.initial===!1||h.initial===h.animate)&&!e.manuallyAnimateOnMount&&(k=!1),c=!1,k?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=aN()}}}function Nhe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!gq(t,e):!1}function Ot(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function aN(){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 jhe extends Rt{constructor(t){super(t),t.animationState||(t.animationState=Che(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();bL(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 She=0;class $he extends Rt{constructor(){super(...arguments),this.id=She++}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 qhe={animation:{Feature:jhe},exit:{Feature:$he}};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 Ahe=e=>t=>Bw(t)&&e(t,J1(t));function H1(e,t,n,c){return G1(e,t,Ahe(n),c)}const xq=1e-4,zhe=1-xq,Vhe=1+xq,Mq=.01,Phe=0-Mq,The=0+Mq;function Te(e){return e.max-e.min}function Hhe(e,t,n){return Math.abs(e-t)<=n}function nN(e,t,n,c=.5){e.origin=c,e.originPoint=ge(t.min,t.max,e.origin),e.scale=Te(n)/Te(t),e.translate=ge(n.min,n.max,e.origin)-e.originPoint,(e.scale>=zhe&&e.scale<=Vhe||isNaN(e.scale))&&(e.scale=1),(e.translate>=Phe&&e.translate<=The||isNaN(e.translate))&&(e.translate=0)}function D1(e,t,n,c){nN(e.x,t.x,n.x,c?c.originX:void 0),nN(e.y,t.y,n.y,c?c.originY:void 0)}function oN(e,t,n){e.min=n.min+t.min,e.max=e.min+Te(t)}function Dhe(e,t,n){oN(e.x,t.x,n.x),oN(e.y,t.y,n.y)}function cN(e,t,n){e.min=t.min-n.min,e.max=e.min+Te(t)}function B1(e,t,n){cN(e.x,t.x,n.x),cN(e.y,t.y,n.y)}function Ye(e){return[e("x"),e("y")]}const _q=({current:e})=>e?e.ownerDocument.defaultView:null,iN=(e,t)=>Math.abs(e-t);function Bhe(e,t){const n=iN(e.x,t.x),c=iN(e.y,t.y);return Math.sqrt(n**2+c**2)}class Lq{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=JL(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,g=Bhe(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!f&&!g)return;const{point:k}=y,{timestamp:x}=Se;this.history.push({...k,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=YL(f,this.transformPagePoint),me.update(this.updatePoint,!0)},this.handlePointerUp=(y,f)=>{this.end();const{onEnd:g,onSessionEnd:k,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const M=JL(y.type==="pointercancel"?this.lastMoveEventInfo:YL(f,this.transformPagePoint),this.history);this.startEvent&&g&&g(y,M),k&&k(y,M)},!Bw(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=c,this.distanceThreshold=s,this.contextWindow=i||window;const d=J1(t),l=YL(d,this.transformPagePoint),{point:h}=l,{timestamp:u}=Se;this.history=[{...h,timestamp:u}];const{onSessionStart:p}=n;p&&p(t,JL(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(),Lt(this.updatePoint)}}function YL(e,t){return t?{point:t(e.point)}:e}function rN(e,t){return{x:e.x-t.x,y:e.y-t.y}}function JL({point:e},t){return{point:e,delta:rN(e,Iq(t)),offset:rN(e,Rhe(t)),velocity:Fhe(t,.1)}}function Rhe(e){return e[0]}function Iq(e){return e[e.length-1]}function Fhe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,c=null;const i=Iq(e);for(;n>=0&&(c=e[n],!(i.timestamp-c.timestamp>ot(t)));)n--;if(!c)return{x:0,y:0};const r=Je(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 Ehe(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 sN(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 Ohe(e,{top:t,left:n,bottom:c,right:i}){return{x:sN(e.x,n,i),y:sN(e.y,t,c)}}function dN(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 Uhe(e,t){return{x:dN(e.x,t.x),y:dN(e.y,t.y)}}function Whe(e,t){let n=.5;const c=Te(e),i=Te(t);return i>c?n=F1(t.min,t.max-c,e.min):c>i&&(n=F1(e.min,e.max-i,t.min)),Mt(0,1,n)}function Ghe(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 hw=.35;function Khe(e=hw){return e===!1?e=0:e===!0&&(e=hw),{x:lN(e,"left","right"),y:lN(e,"top","bottom")}}function lN(e,t,n){return{min:hN(e,t),max:hN(e,n)}}function hN(e,t){return typeof e=="number"?e:e[t]||0}const Zhe=new WeakMap;class Xhe{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=Le(),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:k}=this.getProps();if(f&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ele(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),Ye(M=>{let v=this.getAxisMotionValue(M).get()||0;if(pt.test(v)){const{projection:I}=this.visualElement;if(I&&I.layout){const b=I.layout.layoutBox[M];b&&(v=Te(b)*(parseFloat(v)/100))}}this.originPoint[M]=v}),k&&me.postRender(()=>k(p,y)),dw(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:k,onDrag:x}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:M}=y;if(g&&this.currentDirection===null){this.currentDirection=Yhe(M),this.currentDirection!==null&&k&&k(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=()=>Ye(p=>this.getAnimationState(p)==="paused"&&this.getAxisMotionValue(p).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Lq(t,{onSessionStart:r,onStart:s,onMove:d,onSessionEnd:l,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:c,contextWindow:_q(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&&me.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||!ci(t,i,this.currentDirection))return;const r=this.getAxisMotionValue(t);let s=this.originPoint[t]+c[t];this.constraints&&this.constraints[t]&&(s=Ehe(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=Ohe(c.layoutBox,t):this.constraints=!1,this.elastic=Khe(n),i!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&Ye(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=Ghe(c.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Xc(t))return!1;const c=t.current;ct(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=Jle(c,i.root,this.visualElement.getTransformPagePoint());let s=Uhe(i.layout.layoutBox,r);if(n){const d=n(Zle(s));this.hasMutatedConstraints=!!d,d&&(s=rq(d))}return s}startAnimation(t){const{drag:n,dragMomentum:c,dragElastic:i,dragTransition:r,dragSnapToOrigin:s,onDragTransitionEnd:d}=this.getProps(),l=this.constraints||{},h=Ye(u=>{if(!ci(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 dw(this.visualElement,t),c.start(Zw(t,c,0,n,this.visualElement,!1))}stopAnimation(){Ye(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ye(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){Ye(n=>{const{drag:c}=this.getProps();if(!ci(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};Ye(s=>{const d=this.getAxisMotionValue(s);if(d&&this.constraints!==!1){const l=d.get();i[s]=Whe({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(),Ye(s=>{if(!ci(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;Zhe.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()),me.read(c);const s=G1(window,"resize",()=>this.scalePositionWithinConstraints()),d=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:h})=>{this.isDragging&&h&&(Ye(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=hw,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:c,dragPropagation:i,dragConstraints:r,dragElastic:s,dragMomentum:d}}}function ci(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Yhe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Jhe extends Rt{constructor(t){super(t),this.removeGroupControls=et,this.removeListeners=et,this.controls=new Xhe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||et}unmount(){this.removeGroupControls(),this.removeListeners()}}const uN=e=>(t,n)=>{e&&me.postRender(()=>e(t,n))};class Qhe extends Rt{constructor(){super(...arguments),this.removePointerDownListener=et}onPointerDown(t){this.session=new Lq(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:_q(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:c,onPanEnd:i}=this.node.getProps();return{onSessionStart:uN(t),onStart:uN(n),onMove:c,onEnd:(r,s)=>{delete this.session,i&&me.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 rL={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pN(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(Y.test(e))e=parseFloat(e);else return e;const n=pN(e,t.target.x),c=pN(e,t.target.y);return`${n}% ${c}%`}},eue={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 QL=!1;class tue extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:c,layoutId:i}=this.props,{projection:r}=t;Lle(aue),r&&(n.group&&n.group.add(r),c&&c.register&&i&&c.register(r),QL&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),rL.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:c,drag:i,isPresent:r}=this.props,{projection:s}=c;return s&&(s.isPresent=r,QL=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==r?s.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?s.promote():s.relegate()||me.postRender(()=>{const d=s.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Dw.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:c}=this.props,{projection:i}=t;QL=!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 bq(e){const[t,n]=G$(),c=m.useContext(fw);return o.jsx(tue,{...e,layoutGroup:c,switchLayoutGroup:m.useContext(cq),isPresent:t,safeToRemove:n})}const aue={borderRadius:{...k1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:k1,borderTopRightRadius:k1,borderBottomLeftRadius:k1,borderBottomRightRadius:k1,boxShadow:eue};function nue(e,t,n){const c=$e(e)?e:Dc(e);return c.start(Zw("",c,t,n)),c.animation}const oue=(e,t)=>e.depth-t.depth;class cue{constructor(){this.children=[],this.isDirty=!1}add(t){xw(this.children,t),this.isDirty=!0}remove(t){Mw(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(oue),this.isDirty=!1,this.children.forEach(t)}}function iue(e,t){const n=Fe.now(),c=({timestamp:i})=>{const r=i-n;r>=t&&(Lt(c),e(r-t))};return me.setup(c,!0),()=>Lt(c)}const wq=["TopLeft","TopRight","BottomLeft","BottomRight"],rue=wq.length,yN=e=>typeof e=="string"?parseFloat(e):e,kN=e=>typeof e=="number"||Y.test(e);function sue(e,t,n,c,i,r){i?(e.opacity=ge(0,n.opacity??1,due(c)),e.opacityExit=ge(t.opacity??1,0,lue(c))):r&&(e.opacity=ge(t.opacity??1,n.opacity??1,c));for(let s=0;s<rue;s++){const d=`border${wq[s]}Radius`;let l=mN(t,d),h=mN(n,d);if(l===void 0&&h===void 0)continue;l||(l=0),h||(h=0),l===0||h===0||kN(l)===kN(h)?(e[d]=Math.max(ge(yN(l),yN(h),c),0),(pt.test(h)||pt.test(l))&&(e[d]+="%")):e[d]=h}(t.rotate||n.rotate)&&(e.rotate=ge(t.rotate||0,n.rotate||0,c))}function mN(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const due=Cq(0,.5,u$),lue=Cq(.5,.95,et);function Cq(e,t,n){return c=>c<e?0:c>t?1:n(F1(e,t,c))}function fN(e,t){e.min=t.min,e.max=t.max}function Ge(e,t){fN(e.x,t.x),fN(e.y,t.y)}function gN(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function vN(e,t,n,c,i){return e-=t,e=fL(e,1/n,c),i!==void 0&&(e=fL(e,1/i,c)),e}function hue(e,t=0,n=1,c=.5,i,r=e,s=e){if(pt.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=vN(e.min,t,n,d,i),e.max=vN(e.max,t,n,d,i)}function xN(e,t,[n,c,i],r,s){hue(e,t[n],t[c],t[i],t.scale,r,s)}const uue=["x","scaleX","originX"],pue=["y","scaleY","originY"];function MN(e,t,n,c){xN(e.x,t,uue,n?n.x:void 0,c?c.x:void 0),xN(e.y,t,pue,n?n.y:void 0,c?c.y:void 0)}function _N(e){return e.translate===0&&e.scale===1}function Nq(e){return _N(e.x)&&_N(e.y)}function LN(e,t){return e.min===t.min&&e.max===t.max}function yue(e,t){return LN(e.x,t.x)&&LN(e.y,t.y)}function IN(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function jq(e,t){return IN(e.x,t.x)&&IN(e.y,t.y)}function bN(e){return Te(e.x)/Te(e.y)}function wN(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class kue{constructor(){this.members=[]}add(t){xw(this.members,t),t.scheduleRender()}remove(t){if(Mw(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 mue(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 eI=["","X","Y","Z"],fue=1e3;let gue=0;function tI(e,t,n,c){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),c&&(c[e]=0))}function Sq(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=kq(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",me,!(i||r))}const{parent:c}=e;c&&!c.hasCheckedOptimisedAppear&&Sq(c)}function $q({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:c,resetTransform:i}){return class{constructor(s={},d=t?.()){this.id=gue++,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(Mue),this.nodes.forEach(bue),this.nodes.forEach(wue),this.nodes.forEach(_ue)},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 cue)}addEventListener(s,d){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Lw),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=W$(s)&&!ile(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;me.read(()=>{p=window.innerWidth}),e(s,()=>{const f=window.innerWidth;f!==p&&(p=f,this.root.updateBlockedByResize=!0,u&&u(),u=iue(y,250),rL.hasAnimatedSinceResize&&(rL.hasAnimatedSinceResize=!1,this.nodes.forEach(jN)))})}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()||$ue,{onLayoutAnimationStart:k,onLayoutAnimationComplete:x}=h.getProps(),M=!this.targetLayout||!jq(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={...Tw(g,"layout"),onPlay:k,onComplete:x};(h.shouldReduceMotion||this.options.layoutRoot)&&(I.delay=0,I.type=!1),this.startAnimation(I),this.setAnimationOrigin(u,v)}else p||jN(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(),Lt(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(Cue),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&&Sq(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(CN);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(NN);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Iue),this.nodes.forEach(vue),this.nodes.forEach(xue)):this.nodes.forEach(NN),this.clearAllSnapshots();const d=Fe.now();Se.delta=Mt(0,1e3/60,d-Se.timestamp),Se.timestamp=d,Se.isProcessing=!0,EL.update.process(Se),EL.preRender.process(Se),EL.render.process(Se),Se.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Dw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Lue),this.sharedNodes.forEach(Nue)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,me.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){me.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Te(this.snapshot.measuredBox.x)&&!Te(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=Le(),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&&!Nq(this.projectionDelta),l=this.getTransformTemplate(),h=l?l(this.latestValues,""):void 0,u=h!==this.prevTransformTemplateValue;s&&this.instance&&(d||jc(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)),que(l),{animationId:this.root.animationId,measuredBox:d,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return Le();const d=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Aue))){const{scroll:h}=this.root;h&&(Yc(d.x,h.offset.x),Yc(d.y,h.offset.y))}return d}removeElementScroll(s){const d=Le();if(Ge(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&&Ge(d,s),Yc(d.x,u.offset.x),Yc(d.y,u.offset.y))}return d}applyTransform(s,d=!1){const l=Le();Ge(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}),jc(u.latestValues)&&Jc(l,u.latestValues)}return jc(this.latestValues)&&Jc(l,this.latestValues),l}removeTransform(s){const d=Le();Ge(d,s);for(let l=0;l<this.path.length;l++){const h=this.path[l];if(!h.instance||!jc(h.latestValues))continue;cw(h.latestValues)&&h.updateSnapshot();const u=Le(),p=h.measurePageBox();Ge(u,p),MN(d,h.latestValues,h.snapshot?h.snapshot.layoutBox:void 0,u)}return jc(this.latestValues)&&MN(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!==Se.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=Se.timestamp,!this.targetDelta&&!this.relativeTarget){const y=this.getClosestProjectingParent();y&&y.layout&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Le(),this.relativeTargetOrigin=Le(),B1(this.relativeTargetOrigin,this.layout.layoutBox,y.layout.layoutBox),Ge(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Le(),this.targetWithTransforms=Le()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Dhe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ge(this.target,this.layout.layoutBox),dq(this.target,this.targetDelta)):Ge(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=Le(),this.relativeTargetOrigin=Le(),B1(this.relativeTargetOrigin,this.target,y.target),Ge(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||cw(this.parent.latestValues)||sq(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===Se.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;Ge(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,y=this.treeScale.y;Yle(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=Le());const{target:f}=s;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(gN(this.prevProjectionDelta.x,this.projectionDelta.x),gN(this.prevProjectionDelta.y,this.projectionDelta.y)),D1(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==y||!wN(this.projectionDelta.x,this.prevProjectionDelta.x)||!wN(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=Le(),f=l?l.source:void 0,g=this.layout?this.layout.source:void 0,k=f!==g,x=this.getStack(),M=!x||x.members.length<=1,v=!!(k&&!M&&this.options.crossfade===!0&&!this.path.some(Sue));this.animationProgress=0;let I;this.mixTargetDelta=b=>{const C=b/1e3;SN(p.x,s.x,C),SN(p.y,s.y,C),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(B1(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox),jue(this.relativeTarget,this.relativeTargetOrigin,y,C),I&&yue(this.relativeTarget,I)&&(this.isProjectionDirty=!1),I||(I=Le()),Ge(I,this.relativeTarget)),k&&(this.animationValues=u,sue(u,h,this.latestValues,C,v,M)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Lt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=me.update(()=>{rL.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Dc(0)),this.currentAnimation=nue(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(fue),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&&qq(this.options.animationType,this.layout.layoutBox,h.layoutBox)){l=this.target||Le();const p=Te(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+p;const y=Te(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+y}Ge(d,l),Jc(d,u),D1(this.projectionDeltaWithTransform,this.layoutCorrected,d,u)}}registerSharedNode(s,d){this.sharedNodes.has(s)||this.sharedNodes.set(s,new kue),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&&tI("z",s,h,this.animationValues);for(let u=0;u<eI.length;u++)tI(`rotate${eI[u]}`,s,h,this.animationValues),tI(`skew${eI[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=iL(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=iL(d?.pointerEvents)||""),this.hasProjected&&!jc(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=h.animationValues||h.latestValues;this.applyTransformsToTarget();let p=mue(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:k,applyTo:x,isCSSVariable:M}=W1[g],v=p==="none"?u[g]:k(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?iL(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(CN),this.root.sharedNodes.clear()}}}function vue(e){e.updateLayout()}function xue(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"?Ye(u=>{const p=r?t.measuredBox[u]:t.layoutBox[u],y=Te(p);p.min=n[u].min,p.max=p.min+y}):qq(i,t.layoutBox,n)&&Ye(u=>{const p=r?t.measuredBox[u]:t.layoutBox[u],y=Te(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=!Nq(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=Le();B1(f,t.layoutBox,p.layoutBox);const g=Le();B1(g,n,y.layoutBox),jq(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 Mue(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 _ue(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Lue(e){e.clearSnapshot()}function CN(e){e.clearMeasurements()}function NN(e){e.isLayoutDirty=!1}function Iue(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function jN(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function bue(e){e.resolveTargetDelta()}function wue(e){e.calcProjection()}function Cue(e){e.resetSkewAndRotation()}function Nue(e){e.removeLeadSnapshot()}function SN(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 $N(e,t,n,c){e.min=ge(t.min,n.min,c),e.max=ge(t.max,n.max,c)}function jue(e,t,n,c){$N(e.x,t.x,n.x,c),$N(e.y,t.y,n.y,c)}function Sue(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const $ue={duration:.45,ease:[.4,0,.1,1]},qN=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),AN=qN("applewebkit/")&&!qN("chrome/")?Math.round:et;function zN(e){e.min=AN(e.min),e.max=AN(e.max)}function que(e){zN(e.x),zN(e.y)}function qq(e,t,n){return e==="position"||e==="preserve-aspect"&&!Hhe(bN(t),bN(n),.2)}function Aue(e){return e!==e.root&&e.scroll?.wasRoot}const zue=$q({attachResizeListener:(e,t)=>G1(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),aI={current:void 0},Aq=$q({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!aI.current){const e=new zue({});e.mount(window),e.setOptions({layoutScroll:!0}),aI.current=e}return aI.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Vue={pan:{Feature:Qhe},drag:{Feature:Jhe,ProjectionNode:Aq,MeasureLayout:bq}};function VN(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&&me.postRender(()=>r(t,J1(t)))}class Pue extends Rt{mount(){const{current:t}=this.node;t&&(this.unmount=tle(t,(n,c)=>(VN(this.node,c,"Start"),i=>VN(this.node,i,"End"))))}unmount(){}}class Tue 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 PN(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&&me.postRender(()=>r(t,J1(t)))}class Hue extends Rt{mount(){const{current:t}=this.node;t&&(this.unmount=cle(t,(n,c)=>(PN(this.node,c,"Start"),(i,{success:r})=>PN(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const uw=new WeakMap,nI=new WeakMap,Due=e=>{const t=uw.get(e.target);t&&t(e)},Bue=e=>{e.forEach(Due)};function Rue({root:e,...t}){const n=e||document;nI.has(n)||nI.set(n,{});const c=nI.get(n),i=JSON.stringify(t);return c[i]||(c[i]=new IntersectionObserver(Bue,{root:e,...t})),c[i]}function Fue(e,t,n){const c=Rue(t);return uw.set(e,n),c.observe(e),()=>{uw.delete(e),c.unobserve(e)}}const Eue={some:0,all:1};class Oue 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:Eue[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 Fue(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(Uue(t,n))&&this.startObserver()}unmount(){}}function Uue({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Wue={inView:{Feature:Oue},tap:{Feature:Hue},focus:{Feature:Tue},hover:{Feature:Pue}},Gue={layout:{ProjectionNode:Aq,MeasureLayout:bq}},Kue={...qhe,...Wue,...Vue,...Gue},Xw=Kle(Kue,rhe);function zq(e){const t=Bt(()=>Dc(e)),{isStatic:n}=m.useContext(LL);if(n){const[,c]=m.useState(e);m.useEffect(()=>t.on("change",c),[])}return t}function Vq(e,t){const n=zq(t()),c=()=>n.set(t());return c(),vw(()=>{const i=()=>me.preRender(c,!1,!0),r=e.map(s=>s.on("change",i));return()=>{r.forEach(s=>s()),Lt(c)}}),n}function Zue(e){T1.current=[],e();const t=Vq(T1.current,e);return T1.current=void 0,t}function Xue(e,t,n,c){if(typeof e=="function")return Zue(e);const i=typeof t=="function"?t:rle(t,n,c);return Array.isArray(e)?TN(e,i):TN([e],([r])=>i(r))}function TN(e,t){const n=Bt(()=>[]);return Vq(e,()=>{n.length=0;const c=e.length;for(let i=0;i<c;i++)n[i]=e[i].get();return t(n)})}class Yue{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 Jue=()=>new Yue;function Que(){return Bt(Jue)}const Pq=m.createContext(null);function epe(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?pde(e,i,i+r):e}function tpe({children:e,as:t="ul",axis:n="y",onReorder:c,values:i,...r},s){const d=Bt(()=>Xw[t]),l=[],h=m.useRef(!1);ct(!!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(ope)},updateOrder:(p,y,f)=>{if(h.current)return;const g=epe(l,p,y,f);l!==g&&(h.current=!0,c(g.map(npe).filter(k=>i.indexOf(k)!==-1)))}};return m.useEffect(()=>{h.current=!1}),o.jsx(d,{...r,ref:s,ignoreStrict:!0,children:o.jsx(Pq.Provider,{value:u,children:e})})}const ape=m.forwardRef(tpe);function npe(e){return e.value}function ope(e,t){return e.layout.min-t.layout.min}function HN(e,t=0){return $e(e)?e:zq(t)}function cpe({children:e,style:t={},value:n,as:c="li",onDrag:i,layout:r=!0,...s},d){const l=Bt(()=>Xw[c]),h=m.useContext(Pq),u={x:HN(t.x),y:HN(t.y)},p=Xue([u.x,u.y],([k,x])=>k||x?1:"unset");ct(!!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:(k,x)=>{const{velocity:M}=x;M[y]&&g(n,u[y].get(),M[y]),i&&i(k,x)},onLayoutMeasure:k=>f(n,k),ref:d,ignoreStrict:!0,children:e})}const ipe=m.forwardRef(cpe),gL=[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})],rpe=({items:e,onReorder:t,draggable:n=!1,className:c,header:i,headerStyle:r,itemsDraggable:s=!0})=>{const[d,l]=m.useState(e??[]);return m.useEffect(()=>{e&&Array.isArray(e)?(e.forEach((h,u)=>{if(h.icon==null&&(h.icon=gL[u%gL.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 k=g[1],x=g[2]??"",M=k.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(ape,{axis:"y",values:d,onReorder:h=>{l(h),t?.(h)},style:{display:"flex",flexDirection:"column",gap:8},children:d.map((h,u)=>o.jsx(spe,{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 spe({value:e,index:t}){const n=Que(),c=gL[t%gL.length]??null;return o.jsx(ipe,{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(t$,{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 dpe(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 lpe(e){return!e||typeof e=="string"&&e.trim()===""}function hpe(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?null:{isValid:!1,error:"Format d'email invalide"}}function upe(e){return/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/.test(e)?null:{isValid:!1,error:"Format d'URL invalide"}}function ppe(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 ype(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 kpe(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 mpe(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 vL(e,t){const n=dpe(e,t);if(n)return n;if(lpe(e))return{isValid:!0};const c=e.toString();switch(t.type){case"email":{const r=hpe(c);if(r)return r;break}case"url":{const r=upe(c);if(r)return r;break}case"number":{const r=ppe(e,t);if(r)return r;break}case"date":case"month":case"week":case"time":case"datetime-local":{const r=ype(e,t);if(r)return r;break}case"file":{const r=kpe(e,t);if(r)return r;break}}const i=mpe(c,t);return i||{isValid:!0}}function Tq(e,t){const n={};let c=!0;for(const i of t){const r=vL(e[i.name],i);r.isValid||(n[i.name]=r.error,c=!1)}return{isValid:c,errors:n}}const fpe="_formContainer_14ads_1",gpe="_headerLine_14ads_17",vpe="_formTitle_14ads_25",xpe="_formDescription_14ads_30",Mpe="_sectionTitle_14ads_37",_pe="_sectionHelp_14ads_44",Lpe="_fieldHelp_14ads_50",Ipe="_gridContainer_14ads_58",bpe="_fieldGridItem_14ads_70",wpe="_sectionFull_14ads_105",Cpe="_formFooter_14ads_110",Npe="_footerLeft_14ads_118",jpe="_footerRight_14ads_119",Spe="_cancelLink_14ads_125",$pe="_submitButton_14ads_136",qpe="_fieldLabel_14ads_148",Ape="_inputWrapper_14ads_163",zpe="_inputInner_14ads_187",Vpe="_hasPrefix_14ads_196",Ppe="_inputBase_14ads_196",Tpe="_iconPrefix_14ads_292",Hpe="_iconSuffix_14ads_293",Dpe="_passwordToggle_14ads_319",Bpe="_fieldError_14ads_365",Rpe="_fieldInvalid_14ads_372",ke={formContainer:fpe,headerLine:gpe,formTitle:vpe,formDescription:xpe,sectionTitle:Mpe,sectionHelp:_pe,fieldHelp:Lpe,gridContainer:Ipe,fieldGridItem:bpe,sectionFull:wpe,formFooter:Cpe,footerLeft:Npe,footerRight:jpe,cancelLink:Spe,submitButton:$pe,fieldLabel:qpe,inputWrapper:Ape,inputInner:zpe,hasPrefix:Vpe,inputBase:Ppe,iconPrefix:Tpe,iconSuffix:Hpe,passwordToggle:Dpe,fieldError:Bpe,fieldInvalid:Rpe},Hq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const[s,d]=m.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?xt[e.attributes.icon]:null),y=e.attributes?.iconPosition??"suffix",f=g=>{n(g.target.value)};return o.jsxs("div",{className:ke.inputWrapper,children:[o.jsx("label",{className:`${ke.fieldLabel} ${e.required?"required":""}`,htmlFor:e.name,children:e.label}),o.jsxs("div",{className:`${ke.inputInner} ${p&&y==="prefix"?ke.hasPrefix:""}`,children:[p&&y==="prefix"&&o.jsx("span",{className:ke.iconPrefix,children:o.jsx(p,{size:16})}),o.jsx("input",{id:e.name,name:e.name,type:u,placeholder:e.placeholder,className:`${ke.inputBase} ${i?ke.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:ke.passwordToggle,onClick:()=>d(g=>!g),children:s?o.jsx(j1,{size:16}):o.jsx(S1,{size:16})}),p&&y==="suffix"&&!l&&o.jsx("span",{className:ke.iconSuffix,children:o.jsx(p,{size:16})})]}),r&&i&&o.jsx("span",{className:ke.fieldError,children:i})]})},Fpe="_fieldGroup_yb3zi_7",Epe="_fieldLabel_yb3zi_11",Ope="_required_yb3zi_17",Upe="_fieldInput_yb3zi_22",Wpe="_fieldInvalid_yb3zi_40",Gpe="_fieldValid_yb3zi_44",Kpe="_fieldError_yb3zi_48",Zpe="_radioGroup_yb3zi_57",Pt={fieldGroup:Fpe,fieldLabel:Epe,required:Ope,fieldInput:Upe,fieldInvalid:Wpe,fieldValid:Gpe,fieldError:Kpe,radioGroup:Zpe},CL=({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})]})},Dq=({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(CL,{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})})},Xpe="_wrapper_117u4_1",Ype="_wrapperInvalid_117u4_15",Jpe="_nativeSelect_117u4_19",Qpe="_display_117u4_30",eye="_topLabel_117u4_37",tye="_valueLine_117u4_45",aye="_valuePlaceholder_117u4_53",nye="_valueActive_117u4_57",oye="_caret_117u4_61",cye="_error_117u4_75",iye="_optionStyle_117u4_89",Ke={wrapper:Xpe,wrapperInvalid:Ype,nativeSelect:Jpe,display:Qpe,topLabel:eye,valueLine:tye,valuePlaceholder:aye,valueActive:nye,caret:oye,error:cye,optionStyle:iye},Yw=({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:`${Ke.wrapper} ${s?Ke.wrapperInvalid:""} ${t?Ke.wrapperHasValue:""}`,children:[o.jsxs("select",{id:e.name,name:e.name,className:Ke.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:Ke.optionStyle,children:u.label},p))]}),o.jsxs("div",{className:Ke.display,children:[d&&o.jsx("span",{className:Ke.topLabel,children:d}),o.jsx("span",{className:`${Ke.valueLine} ${t?Ke.valueActive:Ke.valuePlaceholder}`,children:t?h:l}),o.jsx("span",{className:Ke.caret,"aria-hidden":"true"})]}),s&&o.jsx("span",{className:Ke.error,children:i})]})},Bq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsx(CL,{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})]})}),Rq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsx(CL,{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))})}),rye="_fileInputContainer_r2guc_3",sye="_customFileInput_r2guc_8",dye="_fileInputLabel_r2guc_12",lye="_dragOver_r2guc_39",hye="_uploadIcon_r2guc_44",uye="_uploadText_r2guc_50",pye="_uploadHint_r2guc_56",yye="_fileList_r2guc_60",kye="_fileListTitle_r2guc_69",mye="_fileItem_r2guc_80",fye="_fileIcon_r2guc_96",gye="_fileName_r2guc_102",vye="_fileSize_r2guc_108",xye="_removeButton_r2guc_114",Mye="_errorText_r2guc_129",Ae={fileInputContainer:rye,customFileInput:sye,fileInputLabel:dye,dragOver:lye,uploadIcon:hye,uploadText:uye,uploadHint:pye,fileList:yye,fileListTitle:kye,fileItem:mye,fileIcon:fye,fileName:gye,fileSize:vye,removeButton:xye,errorText:Mye},Fq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=m.useRef(null),[d,l]=m.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)},k=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:`${Ae.fileInputContainer} ${r&&i?Ae.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:Ae.customFileInput}),o.jsxs("label",{htmlFor:e.name,className:`${Ae.fileInputLabel} ${d?Ae.dragOver:""}`,onDragOver:p,onDragLeave:y,onDrop:f,onClick:u,tabIndex:0,children:[o.jsx("div",{className:Ae.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:Ae.uploadText,children:d?"Déposez vos fichiers ici":"Cliquez ou glissez-déposez pour téléverser"}),o.jsxs("div",{className:Ae.uploadHint,children:[e.attributes?.accept||"Tous les fichiers"," ",e.attributes?.multiple?"(Multiple autorisé)":""]})]}),t&&t.length>0&&o.jsxs("div",{className:Ae.fileList,children:[o.jsx("div",{className:Ae.fileListTitle,children:"Fichiers sélectionnés:"}),o.jsx("ul",{children:Array.from(t).map((x,M)=>o.jsxs("li",{className:Ae.fileItem,children:[o.jsx("div",{className:Ae.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:Ae.fileName,children:x.name}),o.jsx("div",{className:Ae.fileSize,children:k(x.size)}),o.jsx("button",{type:"button",className:Ae.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:Ae.errorText,children:i})]})},_ye="_container_ecah4_2",Lye="_label_ecah4_6",Iye="_requiredIndicator_ecah4_13",bye="_input_ecah4_18",wye="_inputError_ecah4_49",Cye="_errorMessage_ecah4_58",Wc={container:_ye,label:Lye,requiredIndicator:Iye,input:bye,inputError:wye,errorMessage:Cye},Eq=({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})]})},Nye="_rangeContainer_cyqk3_3",jye={rangeContainer:Nye},Oq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsxs("div",{className:`mb-3 ${jye.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})]}),Sye="_colorPickerContainer_1wxgj_2",$ye="_colorInput_1wxgj_19",qye="_colorValue_1wxgj_39",oI={colorPickerContainer:Sye,colorInput:$ye,colorValue:qye},Uq=({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:oI.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:oI.colorInput}),o.jsx("span",{className:oI.colorValue,children:t})]}),r&&i&&o.jsx("div",{className:"invalid-feedback",children:i})]}),Wq=({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(Fq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(s.includes(e.type))return o.jsx(Eq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(e.type==="range")return o.jsx(Oq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(e.type==="color")return o.jsx(Uq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});switch(e.type){case"textarea":return o.jsx(Dq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"select":return o.jsx(Yw,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"checkbox":return o.jsx(Bq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"radio":return o.jsx(Rq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});default:return o.jsx(Hq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})}};var cI,DN;function Aye(){if(DN)return cI;DN=1;function e(){this.__data__=[],this.size=0}return cI=e,cI}var iI,BN;function Gq(){if(BN)return iI;BN=1;function e(t,n){return t===n||t!==t&&n!==n}return iI=e,iI}var rI,RN;function NL(){if(RN)return rI;RN=1;var e=Gq();function t(n,c){for(var i=n.length;i--;)if(e(n[i][0],c))return i;return-1}return rI=t,rI}var sI,FN;function zye(){if(FN)return sI;FN=1;var e=NL(),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 sI=c,sI}var dI,EN;function Vye(){if(EN)return dI;EN=1;var e=NL();function t(n){var c=this.__data__,i=e(c,n);return i<0?void 0:c[i][1]}return dI=t,dI}var lI,ON;function Pye(){if(ON)return lI;ON=1;var e=NL();function t(n){return e(this.__data__,n)>-1}return lI=t,lI}var hI,UN;function Tye(){if(UN)return hI;UN=1;var e=NL();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 hI=t,hI}var uI,WN;function jL(){if(WN)return uI;WN=1;var e=Aye(),t=zye(),n=Vye(),c=Pye(),i=Tye();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,uI=r,uI}var pI,GN;function Hye(){if(GN)return pI;GN=1;var e=jL();function t(){this.__data__=new e,this.size=0}return pI=t,pI}var yI,KN;function Dye(){if(KN)return yI;KN=1;function e(t){var n=this.__data__,c=n.delete(t);return this.size=n.size,c}return yI=e,yI}var kI,ZN;function Bye(){if(ZN)return kI;ZN=1;function e(t){return this.__data__.get(t)}return kI=e,kI}var mI,XN;function Rye(){if(XN)return mI;XN=1;function e(t){return this.__data__.has(t)}return mI=e,mI}var fI,YN;function Kq(){if(YN)return fI;YN=1;var e=typeof a.commonjsGlobal=="object"&&a.commonjsGlobal&&a.commonjsGlobal.Object===Object&&a.commonjsGlobal;return fI=e,fI}var gI,JN;function It(){if(JN)return gI;JN=1;var e=Kq(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return gI=n,gI}var vI,QN;function Jw(){if(QN)return vI;QN=1;var e=It(),t=e.Symbol;return vI=t,vI}var xI,ej;function Fye(){if(ej)return xI;ej=1;var e=Jw(),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 xI=r,xI}var MI,tj;function Eye(){if(tj)return MI;tj=1;var e=Object.prototype,t=e.toString;function n(c){return t.call(c)}return MI=n,MI}var _I,aj;function SL(){if(aj)return _I;aj=1;var e=Jw(),t=Fye(),n=Eye(),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 _I=s,_I}var LI,nj;function Zq(){if(nj)return LI;nj=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return LI=e,LI}var II,oj;function Xq(){if(oj)return II;oj=1;var e=SL(),t=Zq(),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 II=s,II}var bI,cj;function Oye(){if(cj)return bI;cj=1;var e=It(),t=e["__core-js_shared__"];return bI=t,bI}var wI,ij;function Uye(){if(ij)return wI;ij=1;var e=Oye(),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 wI=n,wI}var CI,rj;function Yq(){if(rj)return CI;rj=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 CI=n,CI}var NI,sj;function Wye(){if(sj)return NI;sj=1;var e=Xq(),t=Uye(),n=Zq(),c=Yq(),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 NI=p,NI}var jI,dj;function Gye(){if(dj)return jI;dj=1;function e(t,n){return t?.[n]}return jI=e,jI}var SI,lj;function h1(){if(lj)return SI;lj=1;var e=Wye(),t=Gye();function n(c,i){var r=t(c,i);return e(r)?r:void 0}return SI=n,SI}var $I,hj;function Qw(){if(hj)return $I;hj=1;var e=h1(),t=It(),n=e(t,"Map");return $I=n,$I}var qI,uj;function $L(){if(uj)return qI;uj=1;var e=h1(),t=e(Object,"create");return qI=t,qI}var AI,pj;function Kye(){if(pj)return AI;pj=1;var e=$L();function t(){this.__data__=e?e(null):{},this.size=0}return AI=t,AI}var zI,yj;function Zye(){if(yj)return zI;yj=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return zI=e,zI}var VI,kj;function Xye(){if(kj)return VI;kj=1;var e=$L(),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 VI=i,VI}var PI,mj;function Yye(){if(mj)return PI;mj=1;var e=$L(),t=Object.prototype,n=t.hasOwnProperty;function c(i){var r=this.__data__;return e?r[i]!==void 0:n.call(r,i)}return PI=c,PI}var TI,fj;function Jye(){if(fj)return TI;fj=1;var e=$L(),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 TI=n,TI}var HI,gj;function Qye(){if(gj)return HI;gj=1;var e=Kye(),t=Zye(),n=Xye(),c=Yye(),i=Jye();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,HI=r,HI}var DI,vj;function e4e(){if(vj)return DI;vj=1;var e=Qye(),t=jL(),n=Qw();function c(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return DI=c,DI}var BI,xj;function t4e(){if(xj)return BI;xj=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return BI=e,BI}var RI,Mj;function qL(){if(Mj)return RI;Mj=1;var e=t4e();function t(n,c){var i=n.__data__;return e(c)?i[typeof c=="string"?"string":"hash"]:i.map}return RI=t,RI}var FI,_j;function a4e(){if(_j)return FI;_j=1;var e=qL();function t(n){var c=e(this,n).delete(n);return this.size-=c?1:0,c}return FI=t,FI}var EI,Lj;function n4e(){if(Lj)return EI;Lj=1;var e=qL();function t(n){return e(this,n).get(n)}return EI=t,EI}var OI,Ij;function o4e(){if(Ij)return OI;Ij=1;var e=qL();function t(n){return e(this,n).has(n)}return OI=t,OI}var UI,bj;function c4e(){if(bj)return UI;bj=1;var e=qL();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 UI=t,UI}var WI,wj;function Jq(){if(wj)return WI;wj=1;var e=e4e(),t=a4e(),n=n4e(),c=o4e(),i=c4e();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,WI=r,WI}var GI,Cj;function i4e(){if(Cj)return GI;Cj=1;var e=jL(),t=Qw(),n=Jq(),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 GI=i,GI}var KI,Nj;function r4e(){if(Nj)return KI;Nj=1;var e=jL(),t=Hye(),n=Dye(),c=Bye(),i=Rye(),r=i4e();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,KI=s,KI}var ZI,jj;function s4e(){if(jj)return ZI;jj=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return ZI=t,ZI}var XI,Sj;function d4e(){if(Sj)return XI;Sj=1;function e(t){return this.__data__.has(t)}return XI=e,XI}var YI,$j;function l4e(){if($j)return YI;$j=1;var e=Jq(),t=s4e(),n=d4e();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,YI=c,YI}var JI,qj;function h4e(){if(qj)return JI;qj=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 JI=e,JI}var QI,Aj;function u4e(){if(Aj)return QI;Aj=1;function e(t,n){return t.has(n)}return QI=e,QI}var eb,zj;function Qq(){if(zj)return eb;zj=1;var e=l4e(),t=h4e(),n=u4e(),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 k=p.get(s),x=p.get(d);if(k&&x)return k==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],C=d[M];if(h)var w=y?h(C,b,M,d,s,p):h(b,C,M,s,d,p);if(w!==void 0){if(w)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===C||u(b,C,l,h,p))){v=!1;break}}return p.delete(s),p.delete(d),v}return eb=r,eb}var tb,Vj;function p4e(){if(Vj)return tb;Vj=1;var e=It(),t=e.Uint8Array;return tb=t,tb}var ab,Pj;function y4e(){if(Pj)return ab;Pj=1;function e(t){var n=-1,c=Array(t.size);return t.forEach(function(i,r){c[++n]=[r,i]}),c}return ab=e,ab}var nb,Tj;function k4e(){if(Tj)return nb;Tj=1;function e(t){var n=-1,c=Array(t.size);return t.forEach(function(i){c[++n]=i}),c}return nb=e,nb}var ob,Hj;function m4e(){if(Hj)return ob;Hj=1;var e=Jw(),t=p4e(),n=Gq(),c=Qq(),i=y4e(),r=k4e(),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]",k="[object String]",x="[object Symbol]",M="[object ArrayBuffer]",v="[object DataView]",I=e?e.prototype:void 0,b=I?I.valueOf:void 0;function C(w,_,L,S,N,j,A){switch(L){case v:if(w.byteLength!=_.byteLength||w.byteOffset!=_.byteOffset)return!1;w=w.buffer,_=_.buffer;case M:return!(w.byteLength!=_.byteLength||!j(new t(w),new t(_)));case l:case h:case y:return n(+w,+_);case u:return w.name==_.name&&w.message==_.message;case f:case k:return w==_+"";case p:var B=i;case g:var D=S&s;if(B||(B=r),w.size!=_.size&&!D)return!1;var V=A.get(w);if(V)return V==_;S|=d,A.set(w,_);var q=c(B(w),B(_),S,N,j,A);return A.delete(w),q;case x:if(b)return b.call(w)==b.call(_)}return!1}return ob=C,ob}var cb,Dj;function f4e(){if(Dj)return cb;Dj=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 cb=e,cb}var ib,Bj;function eC(){if(Bj)return ib;Bj=1;var e=Array.isArray;return ib=e,ib}var rb,Rj;function g4e(){if(Rj)return rb;Rj=1;var e=f4e(),t=eC();function n(c,i,r){var s=i(c);return t(c)?s:e(s,r(c))}return rb=n,rb}var sb,Fj;function v4e(){if(Fj)return sb;Fj=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 sb=e,sb}var db,Ej;function x4e(){if(Ej)return db;Ej=1;function e(){return[]}return db=e,db}var lb,Oj;function M4e(){if(Oj)return lb;Oj=1;var e=v4e(),t=x4e(),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 lb=r,lb}var hb,Uj;function _4e(){if(Uj)return hb;Uj=1;function e(t,n){for(var c=-1,i=Array(t);++c<t;)i[c]=n(c);return i}return hb=e,hb}var ub,Wj;function AL(){if(Wj)return ub;Wj=1;function e(t){return t!=null&&typeof t=="object"}return ub=e,ub}var pb,Gj;function L4e(){if(Gj)return pb;Gj=1;var e=SL(),t=AL(),n="[object Arguments]";function c(i){return t(i)&&e(i)==n}return pb=c,pb}var yb,Kj;function I4e(){if(Kj)return yb;Kj=1;var e=L4e(),t=AL(),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 yb=r,yb}var M1={exports:{}},kb,Zj;function b4e(){if(Zj)return kb;Zj=1;function e(){return!1}return kb=e,kb}M1.exports;var Xj;function eA(){return Xj||(Xj=1,function(e,t){var n=It(),c=b4e(),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 mb,Yj;function w4e(){if(Yj)return mb;Yj=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 mb=n,mb}var fb,Jj;function tA(){if(Jj)return fb;Jj=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return fb=t,fb}var gb,Qj;function C4e(){if(Qj)return gb;Qj=1;var e=SL(),t=tA(),n=AL(),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]",k="[object WeakMap]",x="[object ArrayBuffer]",M="[object DataView]",v="[object Float32Array]",I="[object Float64Array]",b="[object Int8Array]",C="[object Int16Array]",w="[object Int32Array]",_="[object Uint8Array]",L="[object Uint8ClampedArray]",S="[object Uint16Array]",N="[object Uint32Array]",j={};j[v]=j[I]=j[b]=j[C]=j[w]=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[k]=!1;function A(B){return n(B)&&t(B.length)&&!!j[e(B)]}return gb=A,gb}var vb,eS;function N4e(){if(eS)return vb;eS=1;function e(t){return function(n){return t(n)}}return vb=e,vb}var _1={exports:{}};_1.exports;var tS;function j4e(){return tS||(tS=1,function(e,t){var n=Kq(),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 xb,aS;function aA(){if(aS)return xb;aS=1;var e=C4e(),t=N4e(),n=j4e(),c=n&&n.isTypedArray,i=c?t(c):e;return xb=i,xb}var Mb,nS;function S4e(){if(nS)return Mb;nS=1;var e=_4e(),t=I4e(),n=eC(),c=eA(),i=w4e(),r=aA(),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),k=p||y||f||g,x=k?e(h.length,String):[],M=x.length;for(var v in h)(u||d.call(h,v))&&!(k&&(v=="length"||f&&(v=="offset"||v=="parent")||g&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||i(v,M)))&&x.push(v);return x}return Mb=l,Mb}var _b,oS;function $4e(){if(oS)return _b;oS=1;var e=Object.prototype;function t(n){var c=n&&n.constructor,i=typeof c=="function"&&c.prototype||e;return n===i}return _b=t,_b}var Lb,cS;function q4e(){if(cS)return Lb;cS=1;function e(t,n){return function(c){return t(n(c))}}return Lb=e,Lb}var Ib,iS;function A4e(){if(iS)return Ib;iS=1;var e=q4e(),t=e(Object.keys,Object);return Ib=t,Ib}var bb,rS;function z4e(){if(rS)return bb;rS=1;var e=$4e(),t=A4e(),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 bb=i,bb}var wb,sS;function V4e(){if(sS)return wb;sS=1;var e=Xq(),t=tA();function n(c){return c!=null&&t(c.length)&&!e(c)}return wb=n,wb}var Cb,dS;function P4e(){if(dS)return Cb;dS=1;var e=S4e(),t=z4e(),n=V4e();function c(i){return n(i)?e(i):t(i)}return Cb=c,Cb}var Nb,lS;function T4e(){if(lS)return Nb;lS=1;var e=g4e(),t=M4e(),n=P4e();function c(i){return e(i,n,t)}return Nb=c,Nb}var jb,hS;function H4e(){if(hS)return jb;hS=1;var e=T4e(),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),k=g.length;if(f!=k&&!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 C=p;++x<f;){M=y[x];var w=r[M],_=s[M];if(l)var L=p?l(_,w,M,s,r,u):l(w,_,M,r,s,u);if(!(L===void 0?w===_||h(w,_,d,l,u):L)){b=!1;break}C||(C=M=="constructor")}if(b&&!C){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 jb=i,jb}var Sb,uS;function D4e(){if(uS)return Sb;uS=1;var e=h1(),t=It(),n=e(t,"DataView");return Sb=n,Sb}var $b,pS;function B4e(){if(pS)return $b;pS=1;var e=h1(),t=It(),n=e(t,"Promise");return $b=n,$b}var qb,yS;function R4e(){if(yS)return qb;yS=1;var e=h1(),t=It(),n=e(t,"Set");return qb=n,qb}var Ab,kS;function F4e(){if(kS)return Ab;kS=1;var e=h1(),t=It(),n=e(t,"WeakMap");return Ab=n,Ab}var zb,mS;function E4e(){if(mS)return zb;mS=1;var e=D4e(),t=Qw(),n=B4e(),c=R4e(),i=F4e(),r=SL(),s=Yq(),d="[object Map]",l="[object Object]",h="[object Promise]",u="[object Set]",p="[object WeakMap]",y="[object DataView]",f=s(e),g=s(t),k=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),C=b==l?I.constructor:void 0,w=C?s(C):"";if(w)switch(w){case f:return y;case g:return d;case k:return h;case x:return u;case M:return p}return b}),zb=v,zb}var Vb,fS;function O4e(){if(fS)return Vb;fS=1;var e=r4e(),t=Qq(),n=m4e(),c=H4e(),i=E4e(),r=eC(),s=eA(),d=aA(),l=1,h="[object Arguments]",u="[object Array]",p="[object Object]",y=Object.prototype,f=y.hasOwnProperty;function g(k,x,M,v,I,b){var C=r(k),w=r(x),_=C?u:i(k),L=w?u:i(x);_=_==h?p:_,L=L==h?p:L;var S=_==p,N=L==p,j=_==L;if(j&&s(k)){if(!s(x))return!1;C=!0,S=!1}if(j&&!S)return b||(b=new e),C||d(k)?t(k,x,M,v,I,b):n(k,x,_,M,v,I,b);if(!(M&l)){var A=S&&f.call(k,"__wrapped__"),B=N&&f.call(x,"__wrapped__");if(A||B){var D=A?k.value():k,V=B?x.value():x;return b||(b=new e),I(D,V,M,v,b)}}return j?(b||(b=new e),c(k,x,M,v,I,b)):!1}return Vb=g,Vb}var Pb,gS;function U4e(){if(gS)return Pb;gS=1;var e=O4e(),t=AL();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 Pb=n,Pb}var Tb,vS;function W4e(){if(vS)return Tb;vS=1;var e=U4e();function t(n,c){return e(n,c)}return Tb=t,Tb}var G4e=W4e();const K4e=a.getDefaultExportFromCjs(G4e),Z4e=({schema:e,initialData:t={},onSubmit:n,submitLabel:c,submitIcon:i,submitIconPosition:r="left",onCancel:s,cancelLabel:d="Retour",cancelIcon:l})=>{const[h,u]=m.useState(t),[p,y]=m.useState({}),[f,g]=m.useState({}),[k,x]=m.useState(!1),M=m.useRef(t);m.useEffect(()=>{K4e(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(A=>A.name===L);if(j){const A=vL(S,j);y(B=>({...B,[L]:A.isValid?"":A.error}))}}},I=L=>{if(!f[L]){g(N=>({...N,[L]:!0}));const S=e.fields.find(N=>N.name===L);if(S){const N=vL(h[L],S);y(j=>({...j,[L]:N.isValid?"":N.error}))}}},b=async L=>{L.preventDefault(),x(!0);const S=e.fields.reduce((j,A)=>(A.type!=="section"&&(j[A.name]=!0),j),{});g(S);const N=Tq(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(A=>({...A,__global:"Une erreur est survenue lors de la soumission"}))}x(!1)},C=l?xt[l]:null,w=i&&xt[i]||e.submitIcon&&xt[e.submitIcon]||null,_=e.columns&&e.columns>0?Math.floor(e.columns):12;return o.jsxs("div",{className:ke.formContainer,children:[o.jsx("div",{className:ke.headerLine,children:o.jsx("h2",{className:ke.formTitle,children:e.title})}),e.description&&o.jsx("p",{className:ke.formDescription,children:e.description}),p.__global&&o.jsx("div",{className:`alert alert-danger ${ke.globalError}`,children:p.__global}),o.jsxs("form",{onSubmit:b,children:[o.jsx("div",{className:ke.gridContainer,style:{gridTemplateColumns:`repeat(${_}, minmax(0, 1fr))`},children:e.fields.map(L=>{if(L.type==="section")return o.jsxs("div",{className:ke.sectionFull,children:[o.jsx("h5",{className:ke.sectionTitle,children:L.label}),L.help&&o.jsx("p",{className:ke.sectionHelp,children:L.help})]},L.name);const N={gridColumn:`span ${Math.max(1,Math.min(_,L.gridCol??_))}`};return o.jsxs("div",{className:ke.fieldGridItem,style:N,children:[o.jsx(Wq,{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:ke.fieldHelp,children:L.help})]},L.name)})}),o.jsxs("div",{className:ke.formFooter,children:[o.jsx("div",{className:ke.footerLeft,children:s&&o.jsxs("button",{type:"button",className:ke.cancelLink,onClick:s,children:[C&&o.jsx(C,{size:16,className:"me-2"})," ",d]})}),o.jsx("div",{className:ke.footerRight,children:o.jsx(sL,{type:"submit",variant:"primary",size:"md",className:ke.submitButton,disabled:k,children:k?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"spinner-border spinner-border-sm me-2",role:"status"}),"Validation..."]}):o.jsxs(o.Fragment,{children:[w&&(r==="left"||e.submitIconPosition==="left")&&o.jsx(w,{size:16,className:"me-2"}),c||e.submitText||"Valider",w&&(r==="right"||e.submitIconPosition==="right")&&o.jsx(w,{size:16,className:"ms-2"})]})})})]})]})]})};function X4e(e){return{title:e._formTitle||"Formulaire",description:e._formDescription,fields:e._fieldMetadata||[],submitText:e._submitText||"Valider"}}const xS=new Map,pw=({path:e,style:t,width:n=24,height:c=24,keepColors:i=!1,onClick:r})=>{const s=/^https?:\/\//.test(e),[d,l]=m.useState("");if(m.useEffect(()=>{if(s)return;e&&(async()=>{try{let u=xS.get(e);u||(u=fetch(e).then(k=>{if(!k.ok)throw new Error(`Failed to load ${e}`);return k.text()}),xS.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},Y4e="_container_1gljv_85",J4e="_tableWrapper_1gljv_111",Q4e="_tableControls_1gljv_117",e5e="_controlsRight_1gljv_128",t5e="_limitedRows_1gljv_151",a5e="_table_1gljv_111",n5e="_headerCell_1gljv_206",o5e="_headerContent_1gljv_220",c5e="_headerWords_1gljv_229",i5e="_headerWord_1gljv_229",r5e="_cellContent_1gljv_276",s5e="_alignLeft_1gljv_286",d5e="_alignCenter_1gljv_290",l5e="_alignRight_1gljv_294",h5e="_tableCell_1gljv_298",u5e="_tableRow_1gljv_308",p5e="_emptyRow_1gljv_385",y5e="_toggleFiltersButton_1gljv_393",k5e="_toggleSortButton_1gljv_394",m5e="_buttonTextCompact_1gljv_415",f5e="_uppercaseSmall_1gljv_450",g5e="_filtersPanel_1gljv_463",v5e="_filtersPanelInline_1gljv_481",x5e="_filtersPanelHorizontal_1gljv_492",M5e="_filtersRow_1gljv_492",_5e="_filtersActionsHorizontal_1gljv_525",L5e="_filterItemInline_1gljv_542",I5e="_filterLabel_1gljv_571",b5e="_filterInput_1gljv_576",w5e="_filterSelect_1gljv_577",C5e="_operatorSelect_1gljv_578",N5e="_operatorInput_1gljv_579",j5e="_activeFilterTag_1gljv_597",S5e="_actionsGroup_1gljv_609",$5e="_applyButton_1gljv_615",q5e="_cancelButton_1gljv_625",A5e="_columnSorterContainer_1gljv_649",z5e="_sorterControls_1gljv_654",V5e="_sortDropdownWrapper_1gljv_659",P5e="_sortDropdown_1gljv_659",T5e="_sortDropdownHeader_1gljv_679",H5e="_closeButton_1gljv_688",D5e="_sortDropdownContent_1gljv_703",B5e="_sortDropdownItem_1gljv_709",R5e="_sortDirectionButtons_1gljv_734",F5e="_sortDirectionButton_1gljv_734",E5e="_activeSort_1gljv_757",O5e="_sortActions_1gljv_764",U5e="_paginationButton_1gljv_842",W5e="_pageSizeSelect_1gljv_844",G5e="_topPagination_1gljv_853",K5e="_paginationContainer_1gljv_861",Z5e="_leftGroup_1gljv_874",X5e="_pageSizeControls_1gljv_882",Y5e="_paginationInfo_1gljv_908",J5e="_paginationControls_1gljv_916",Q5e="_disabledButton_1gljv_947",eke="_activeButton_1gljv_952",tke="_navigationButton_1gljv_962",ake="_operatorFilterContainer_1gljv_1010",nke="_rangeSeparator_1gljv_1016",oke="_activeFiltersSection_1gljv_1179",cke="_activeFiltersRow_1gljv_1184",ike="_activeFiltersList_1gljv_1192",rke="_clearAllButton_1gljv_1200",ske="_removeFilterButton_1gljv_1221",dke="_sortIndicator_1gljv_1272",lke="_active_1gljv_349",hke="_clearSortButton_1gljv_1371",uke="_loaderSpinner_1gljv_2743",pke="_loaderSpinnerSmall_1gljv_2755",yke="_paginationLoading_1gljv_2772",kke="_loadingButton_1gljv_2780",mke="_loadingIndicator_1gljv_2791",P={container:Y4e,tableWrapper:J4e,tableControls:Q4e,controlsRight:e5e,limitedRows:t5e,table:a5e,headerCell:n5e,headerContent:o5e,headerWords:c5e,headerWord:i5e,cellContent:r5e,alignLeft:s5e,alignCenter:d5e,alignRight:l5e,tableCell:h5e,tableRow:u5e,emptyRow:p5e,toggleFiltersButton:y5e,toggleSortButton:k5e,buttonTextCompact:m5e,uppercaseSmall:f5e,filtersPanel:g5e,filtersPanelInline:v5e,filtersPanelHorizontal:x5e,filtersRow:M5e,filtersActionsHorizontal:_5e,filterItemInline:L5e,filterLabel:I5e,filterInput:b5e,filterSelect:w5e,operatorSelect:C5e,operatorInput:N5e,activeFilterTag:j5e,actionsGroup:S5e,applyButton:$5e,cancelButton:q5e,columnSorterContainer:A5e,sorterControls:z5e,sortDropdownWrapper:V5e,sortDropdown:P5e,sortDropdownHeader:T5e,closeButton:H5e,sortDropdownContent:D5e,sortDropdownItem:B5e,sortDirectionButtons:R5e,sortDirectionButton:F5e,activeSort:E5e,sortActions:O5e,paginationButton:U5e,pageSizeSelect:W5e,topPagination:G5e,paginationContainer:K5e,leftGroup:Z5e,pageSizeControls:X5e,paginationInfo:Y5e,paginationControls:J5e,disabledButton:Q5e,activeButton:eke,navigationButton:tke,operatorFilterContainer:ake,rangeSeparator:nke,activeFiltersSection:oke,activeFiltersRow:cke,activeFiltersList:ike,clearAllButton:rke,removeFilterButton:ske,sortIndicator:dke,active:lke,clearSortButton:hke,loaderSpinner:uke,loaderSpinnerSmall:pke,paginationLoading:yke,loadingButton:kke,loadingIndicator:mke},fke=({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:P.filterSelect,children:[o.jsx("option",{value:"",children:`Filtrer ${e.label}...`}),o.jsx("option",{value:"true",children:"Oui"}),o.jsx("option",{value:"false",children:"Non"})]}),gke=({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:P.filterInput}),vke=({config:e,value:t,onChange:n,disabled:c})=>{const[i,r]=m.useState([]);m.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:P.filterMultiSelect,children:i.map((d,l)=>o.jsx("option",{value:String(d.value),children:d.label},l))})},MS=({config:e,value:t,onChange:n,disabled:c})=>{const[i,r]=m.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:P.filterInput})},xke=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=m.useState([]),[s,d]=m.useState(!1);m.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:P.filterInput,children:[o.jsx("option",{value:"",children:"Select..."}),i.map(h=>o.jsx("option",{value:h.value,children:h.label},h.value))]})},Mke=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=m.useState("");m.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:P.filterInput})},_ke=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=m.useState(t?.operator||""),[s,d]=m.useState(t?.value||"");m.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:P.operatorFilterContainer,children:[o.jsxs("select",{value:i,onChange:l,disabled:c,className:P.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:P.operatorInput})]})},Lke=({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:P.dateRangeContainer,children:[o.jsx("input",{type:"date",value:c.start||"",onChange:i,disabled:n,className:P.filterInput}),o.jsx("span",{className:P.rangeSeparator,children:"→"}),o.jsx("input",{type:"date",value:c.end||"",onChange:r,disabled:n,className:P.filterInput})]})},Ike=({config:e,value:t,onChange:n,disabled:c})=>{switch(e.type){case"text":case"search":return o.jsx(Mke,{config:e,value:t,onChange:n,disabled:c});case"number":return o.jsx(MS,{config:e,value:t,onChange:n,disabled:c});case"range":return o.jsx(MS,{config:e,value:t,onChange:n,disabled:c});case"select":return o.jsx(xke,{config:e,value:t,onChange:n,disabled:c});case"operator":return o.jsx(_ke,{config:e,value:t,onChange:n,disabled:c});case"multiselect":return o.jsx(vke,{config:e,value:t,onChange:n,disabled:c});case"date":return o.jsx(gke,{config:e,value:t,onChange:n,disabled:c});case"daterange":return o.jsx(Lke,{config:e,value:t??{start:"",end:""},onChange:n,disabled:c});case"boolean":return o.jsx(fke,{config:e,value:t,onChange:n,disabled:c});default:return o.jsxs("div",{children:["Type de filtre non supporté: ",e.type]})}},nA=({filters:e,externalFilters:t=[],onFiltersChange:n,onApply:c,isControlled:i=!1})=>{const[r,s]=m.useState([]),[d,l]=m.useState(()=>{const g={};return e.forEach(k=>{k.type==="daterange"?g[k.id]={start:"",end:""}:g[k.id]=k.defaultValue??""}),g});m.useEffect(()=>{if(!i)return;const g={...d??{}};e.forEach(k=>{k.id in g||(g[k.id]=k.type==="daterange"?{start:"",end:""}:k.defaultValue??"")}),(t||[]).forEach(k=>{!k||!k.id||(g[k.id]=k.value)}),l(g),s(t??[])},[i,JSON.stringify(t||[]),JSON.stringify(e.map(g=>g.id))]);const h=i?t:r,u=m.useCallback((g,k)=>{l(x=>({...x,[g]:k}))},[]),p=m.useCallback(async()=>{const g=[],k={...d};for(const[x,M]of Object.entries(k)){const v=e.find(C=>C.id===x);if(!v)continue;let I=M;try{typeof M=="function"&&(I=await M(k)),typeof v.executeOnApply=="function"&&(I=await v.executeOnApply(I,k))}catch{continue}if(v.type==="daterange"){const C=I?.start??"",w=I?.end??"",_=typeof C=="string"?C.trim()==="":!C,L=typeof w=="string"?w.trim()==="":!w;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=m.useCallback(g=>{l(k=>({...k,[g]:void 0})),u(g,void 0)},[u]),f=m.useCallback(()=>{const g={};e.forEach(k=>{k.type==="daterange"?g[k.id]={start:"",end:""}:g[k.id]=k.defaultValue??""}),l(g),i?n?.([]):(s([]),c?.([]))},[e,i,n,c]);return{appliedFilters:h,tempFilters:d,updateFilter:u,applyFilters:p,clearFilter:y,clearAllFilters:f}},bke=(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 oA(e,t,n="",c={key:null,direction:"asc"},i=1,r=10,s=[]){const d=Math.max(1,r),l=(n||"").trim().toLowerCase(),h=m.useMemo(()=>{let k=e;return l&&(k=k.filter(x=>t.some(M=>{const v=x.data[M.id];return v==null?!1:String(v).toLowerCase().includes(l)}))),s.length>0&&(k=k.filter(x=>s.every(M=>{try{const v=x.data[M.id];return bke(v,M)}catch(v){return console.error("Error applying filter:",v),!1}}))),k},[e,t,l,s]),u=m.useMemo(()=>{if(!c?.key)return h;const k=c.key;return[...h].sort((x,M)=>{const v=x.data[k],I=M.data[k];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 C=v.getTime()-I.getTime();return c.direction==="desc"?-C:C}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 cA=({value:e})=>e,iA=({value:e})=>m.createElement("a",{href:`mailto:${e}`,className:"email-link"},e),rA=({value:e})=>m.createElement("a",{href:String(e),target:"_blank",rel:"noopener noreferrer",className:"text-link"},e),sA=({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 m.createElement("span",{className:`badge ${i}`},c)},dA=({value:e})=>{try{return new Date(e).toLocaleDateString()}catch{return String(e)}},lA=({value:e})=>m.createElement("span",{className:"number-value"},Number(e).toLocaleString()),hA=({value:e})=>m.createElement("span",{className:"currency-value"},new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR"}).format(Number(e))),uA=({value:e})=>m.createElement("div",{className:"image-container"},m.createElement("img",{src:e,alt:"Table content",className:"table-image",onError:t=>t.currentTarget.style.display="none"})),yw={renderers:{text:cA,email:iA,link:rA,badge:sA,date:dA,number:lA,currency:hA,image:uA},icons:{sortAsc:m.createElement(Ac,{className:"sort-icon active",size:14}),sortDesc:m.createElement(Ht,{className:"sort-icon active",size:14}),sortDefault:m.createElement(a1,{className:"sort-icon",size:14})}},wke=(e,t)=>{yw.renderers[e]&&console.warn(`Le renderer "${e}" existe déjà et sera écrasé.`),yw.renderers[e]=t},Cke=({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:k=!1})=>{const[x,M]=m.useState(!1),v=typeof s=="boolean"?s:x,{appliedFilters:I,tempFilters:b,updateFilter:C,applyFilters:w,clearAllFilters:_}=nA({filters:e,externalFilters:t,onFiltersChange:n,onApply:c,isControlled:i}),L=m.useRef(null),S=m.useRef(null);m.useEffect(()=>{if(v&&L.current){const V=L.current.getBoundingClientRect().height;h?.(V)}else h?.(0)},[v,e,b,h]);const N=()=>{typeof s=="boolean"?d?.(!s):M(V=>{const q=!V;return d?.(q),q})},j=()=>e.map(V=>{const q=b?.[V.id];return q==null||typeof q=="string"&&q.trim()===""?null:{id:V.id,label:V.label,value:q}}).filter(Boolean),A=async()=>{let V;try{V=await w()}catch{V=void 0}let q=[];V&&Array.isArray(V)&&V.length>0?q=V:I&&I.length>0?q=I:q=j(),n?.(q),c?.(q)},B=()=>{d?.(!1),typeof s!="boolean"&&M(!1)},D=()=>{_(),n?.([]),c?.([])};return m.useEffect(()=>{const V=$=>{v&&S.current&&(S.current.contains($.target)||(d?.(!1),typeof s!="boolean"&&M(!1)))},q=$=>{$.key==="Escape"&&v&&(d?.(!1),typeof s!="boolean"&&M(!1))};return v&&(document.addEventListener("pointerdown",V),document.addEventListener("keydown",q)),()=>{document.removeEventListener("pointerdown",V),document.removeEventListener("keydown",q)}},[v,s,d]),o.jsxs("div",{className:P.advancedFiltersContainer,ref:S,children:[o.jsxs("button",{className:`${P.toggleFiltersButton} ${I.length>0?P.active:""} ${v?P.toggleFiltersButtonOpen:""} ${k?P.loadingButton:""}`,onClick:N,"aria-expanded":v,"aria-controls":"advanced-filters-panel",type:"button",disabled:k,children:[k?o.jsx("span",{className:P.loaderSpinnerSmall}):o.jsx(At,{size:14}),o.jsx("span",{className:P.buttonTextCompact,children:u}),I.length>0&&!k&&o.jsx("span",{className:P.filterCountBadge,"aria-hidden":!0,children:I.length}),k&&o.jsx("span",{className:P.loadingIndicator,"aria-hidden":!0,children:"Chargement..."})]}),v&&o.jsxs("div",{id:"advanced-filters-panel",ref:L,className:`${P.filtersPanel} ${l==="top"?`${P.filtersPanelInline} ${P.filtersPanelHorizontal}`:""}`,role:"region","aria-label":"Panneau de filtres avancés",children:[o.jsx("div",{className:P.filtersRow,children:e.map(V=>o.jsxs("div",{className:`${P.filterItem} ${P.filterItemInline}`,children:[o.jsxs("label",{className:P.filterLabel,children:[V.label,V.required&&o.jsx("span",{className:P.required,children:"*"})]}),o.jsx(Ike,{config:V,value:b[V.id],onChange:q=>C(V.id,q),disabled:V.disabled})]},V.id))}),o.jsxs("div",{className:P.filtersActionsHorizontal,children:[o.jsx("div",{className:P.activeFiltersSection,children:I.length>0&&o.jsxs("div",{className:P.activeFiltersRow,children:[o.jsx("span",{className:P.activeLabelCompact,children:"Actifs :"}),o.jsx("div",{className:P.activeFiltersList,children:I.map(V=>o.jsxs("div",{className:P.activeFilterTag,children:[V.label??V.id,o.jsx("button",{className:P.removeFilterButton,onClick:()=>C(V.id,void 0),"aria-label":`Supprimer ${V.id}`,type:"button",children:"×"})]},V.id))}),o.jsxs("button",{className:P.clearAllButton,onClick:D,type:"button",children:[o.jsx(Qe,{size:12})," ",f]})]})}),o.jsxs("div",{className:P.actionsGroup,children:[o.jsx("button",{className:P.cancelButton,onClick:B,type:"button",disabled:k,children:y}),o.jsx("button",{className:`${P.applyButton} ${k?P.loadingButton:""}`,onClick:A,type:"button",disabled:g||k,"aria-disabled":g||k,children:k?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:P.loaderSpinnerSmall}),o.jsx("span",{children:"Chargement..."})]}):p})]})]})]})]})},_S=e=>{const t=e.replace(/[^A-Za-zÀ-ÖØ-öø-ÿ]/g,"");return t.length>0&&t===t.toUpperCase()},Nke=({columns:e,sortConfig:t,onSort:n,label:c="Sort",loading:i=!1})=>{const[r,s]=m.useState(!1),d=e.filter(g=>g.sortable),l=m.useRef(null),h=t?.key!==null&&t?.key!==void 0,u=(g,k)=>{n({key:g,direction:k}),s(!1)},p=()=>{n({key:null,direction:"asc"}),s(!1)},y=()=>s(g=>!g),f=()=>{s(!1)};return m.useEffect(()=>{if(!r)return;const g=x=>{if(!l.current)return;const M=x.target;M&&!l.current.contains(M)&&s(!1)},k=x=>{x.key==="Escape"&&s(!1)};return document.addEventListener("pointerdown",g),document.addEventListener("keydown",k),()=>{document.removeEventListener("pointerdown",g),document.removeEventListener("keydown",k)}},[r]),m.useEffect(()=>{const g=document.querySelector("[data-table-wrapper]");if(!g)return;const k=g.style.overflow??"";return r?g.style.overflow="hidden":g.style.overflow=k,()=>{g.style.overflow=k}},[r]),o.jsx("div",{className:P.columnSorterContainer,ref:l,children:o.jsx("div",{className:P.sorterControls,children:d.length>0&&o.jsxs("div",{className:P.sortDropdownWrapper,ref:l,children:[o.jsxs("button",{className:`${P.toggleSortButton} ${r?P.toggleSortButtonOpen:""} ${h?P.active:""} ${i?P.loadingButton:""}`,onClick:y,"aria-expanded":r,"aria-haspopup":"true",type:"button",disabled:i,children:[i?o.jsx("span",{className:P.loaderSpinnerSmall}):o.jsx(a1,{size:14}),o.jsx("span",{className:`${P.buttonTextCompact} ${_S(c)?P.uppercaseSmall:""}`,children:c}),h&&!i&&o.jsx("div",{className:P.sortIndicator,children:t?.direction==="asc"?o.jsx(Ac,{size:12}):o.jsx(Ht,{size:12})})]}),r&&o.jsxs("div",{className:`${P.sortDropdown} ${P.sortDropdownInline}`,role:"menu",children:[o.jsxs("div",{className:P.sortDropdownHeader,children:[o.jsx("span",{children:"Trier par:"}),o.jsx("button",{className:P.closeButton,onClick:f,"aria-label":"Fermer",type:"button",children:o.jsx(Qe,{size:16})})]}),o.jsx("div",{className:P.sortDropdownContent,children:d.map(g=>{const k=String(g.label??g.id),x=_S(k);return o.jsxs("div",{className:P.sortDropdownItem,role:"menuitem",tabIndex:0,onKeyDown:M=>{M.key==="Enter"&&u(g.id,"asc")},children:[o.jsx("span",{className:`${P.columnSorterLabel} ${x?P.uppercaseSmall:""}`,title:k,"aria-label":k,children:k}),o.jsxs("div",{className:P.sortDirectionButtons,children:[o.jsx("button",{className:`${P.sortDirectionButton} ${t?.key===g.id&&t?.direction==="asc"?P.activeSort:""}`,onClick:()=>u(g.id,"asc"),title:"Trier par ordre croissant",type:"button",children:o.jsx(Ac,{size:12})}),o.jsx("button",{className:`${P.sortDirectionButton} ${t?.key===g.id&&t?.direction==="desc"?P.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:P.sortActions,children:o.jsxs("button",{className:P.clearSortButton,onClick:p,type:"button",children:[o.jsx(qt,{size:14}),o.jsx("span",{children:"Annuler le tri"})]})})]})]})})})},jke=({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 k=h+1;r(k)}},y=c>0?(h-1)*n+1:0,f=c>0?Math.min(h*n,c):0,g=()=>{const k=[];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++)k.push(I);return k};return o.jsxs("div",{className:P.paginationContainer,role:"navigation","aria-label":"Pagination",children:[o.jsx("div",{className:P.leftGroup,children:s&&o.jsx("div",{className:P.pageSizeControls,children:o.jsx("select",{value:n,onChange:k=>s(Number(k.target.value)),className:P.pageSizeSelect,"aria-label":"Taille de page",disabled:d,children:[10,20,30].map(k=>o.jsx("option",{value:k,children:k},k))})})}),o.jsx("div",{className:P.paginationInfo,"aria-live":"polite",children:d?o.jsxs("span",{className:P.paginationLoading,children:[o.jsx("span",{className:P.loaderSpinner}),o.jsx("span",{children:"Chargement..."})]}):`${y}-${f} ${i}`}),o.jsxs("div",{className:P.paginationControls,children:[o.jsx("button",{onClick:u,disabled:h===1||d,className:`${P.paginationButton} ${P.navigationButton} ${h===1?P.disabledButton:""} ${d?P.loadingButton:""}`,"aria-label":"Page précédente",children:d&&h>1?o.jsx("span",{className:P.loaderSpinnerSmall}):"«"}),g().map(k=>o.jsx("button",{onClick:()=>r(k),disabled:d,"aria-current":h===k?"page":void 0,className:`${P.paginationButton} ${h===k?P.activeButton:""} ${d?P.loadingButton:""}`,children:d&&h===k?o.jsx("span",{className:P.loaderSpinnerSmall}):k},k)),o.jsx("button",{onClick:p,disabled:d||h>=l,className:`${P.paginationButton} ${P.navigationButton} ${d?P.loadingButton:""} ${h>=l?P.disabledButton:""}`,"aria-label":"Page suivante",children:d?o.jsx("span",{className:P.loaderSpinnerSmall}):"»"})]})]})},Ske=(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)},$ke=e=>{if(!e)return!1;const t=e.trim().split(/\s+/);return e.length>18||t.length>2},qke=({columns:e})=>o.jsx("thead",{className:P.tableHeader,children:o.jsx("tr",{children:e.map((t,n)=>{const c=t.align==="right"?P.alignRight:t.align==="left"?P.alignLeft:P.alignCenter,i=t.preserveHeaderCase===!0,r=Ske(String(t.label??""),i),s=$ke(r),d=s?r.split(/\s+/):[];return o.jsx("th",{className:`${P.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:P.headerContent,children:s?o.jsx("div",{className:P.headerWords,children:d.map((l,h)=>o.jsx("span",{className:P.headerWord,children:l},h))}):o.jsx("span",{children:r})})},t.id??`col-${n}`)})})}),Ake=({value:e,row:t,column:n})=>{const c=n.align==="right"?P.alignRight:n.align==="left"?P.alignLeft:P.alignCenter,i=typeof n.render=="function"?n.render(e,t):e==null?"":String(e);return o.jsx("td",{className:`${P.tableCell} ${c}`,style:{width:n.width??void 0},children:o.jsx("div",{className:P.cellContent,children:i})})},zke=({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:`${P.tableRow} ${c?P.clickableRow:""}`,onClick:()=>c?.(e,i),style:u,children:n.map(p=>o.jsx(Ake,{value:e[p.id],row:e,column:p},`${t}-${p.id}`))})},Vke=({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:P.emptyRow,children:i?"Aucun résultat trouvé":"Aucune donnée disponible"})})}):o.jsx("tbody",{children:e.map((s,d)=>o.jsx(zke,{row:s.data,rowId:s.id,columns:t,onRowClick:n,index:c+d-1,getRowStyle:r},s.id))}),pA=({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:k,onPageChange:x,itemLabel:M="items",advancedFiltersLabel:v="Advanced-Filters",advancedFiltersActiveLabel:I,sortLabel:b="Sort",applyLabel:C="Apply",cancelLabel:w="Cancel",clearLabel:_="Clear",applyDisabled:L=!1,paginationLoading:S=!1,filtersLoading:N=!1,sortLoading:j=!1,totalCount:A=null})=>{const[B,D]=m.useState({key:null,direction:"asc"}),[V,q]=m.useState(n.currentPage??1),[$,H]=m.useState(n.pageSize??10),[R,z]=m.useState(!1),U=m.useRef(null),[X,ie]=m.useState([]),ae=p?d:X,fe=p?[]:X;m.useEffect(()=>{const le=n.currentPage??1,wt=n.pageSize??10;le!==V&&q(le),wt!==$&&H(wt)},[n.currentPage,n.pageSize]);const{paginatedData:de,sortedData:be,totalPages:oe,startIndex:ee}=oA(t,e,i,B,V,$,fe),te=be.length,re=typeof A=="number"&&A>=0?A:te;let he=oe;typeof A=="number"&&A>=0&&(he=Math.max(1,Math.ceil(A/$)));const pe=te>10;m.useEffect(()=>{const le=Math.max(1,Math.floor(he));V>le&&q(le),V<1&&q(1)},[he]);const O=le=>{p||ie(le),l?.(le),q(1),x?.(1)},K=le=>{p||ie(le),h?.(le),q(1),x?.(1),U.current&&U.current.style.setProperty("--filters-panel-height","0px")},ne=le=>{x?.(le),q(le)},Ne=le=>{H(le),q(1),k?.(le),x?.(1)},qe=le=>{U.current&&U.current.style.setProperty("--filters-panel-height",`${Math.round(le)}px`)},ve=le=>{D(le),u?.(le)},Ve=le=>{z(le),!le&&U.current&&U.current.style.setProperty("--filters-panel-height","0px")};m.useEffect(()=>{(ae?.length??0)>0&&z(!0)},[ae]),m.useEffect(()=>{s.length>0&&ae.length>0&&z(!0)},[s.length,ae.length]);const bt=(ae?.length??0)>0&&I?I:v;return o.jsxs("div",{ref:U,className:`${P.container} ${r} ${R?P.filtersOpen:""}`,style:{background:g,"--row-height":"48px","--header-height":"56px"},children:[o.jsx("div",{className:P.tableControls,children:o.jsxs("div",{className:P.controlsRight,children:[o.jsx(Nke,{columns:e,onSort:ve,label:b,sortConfig:B,loading:j}),s.length>0&&o.jsx(Cke,{filters:s,externalFilters:ae,onFiltersChange:O,onApply:K,isControlled:p,debounceTimeout:y,expanded:R,onToggle:Ve,panelPlacement:"top",onPanelHeightChange:qe,label:bt,applyLabel:C,cancelLabel:w,clearLabel:_,applyDisabled:L,loading:N})]})}),o.jsx("div",{className:P.topPagination,children:o.jsx(jke,{currentPage:V,totalPages:he,pageSize:$,totalItems:re,itemLabel:M,onPageChange:ne,onPageSizeChange:Ne,loading:S})}),o.jsx("div",{className:`${P.tableWrapper} ${pe?P.limitedRows:""}`,"data-table-wrapper":!0,children:o.jsxs("table",{className:P.table,children:[o.jsx(qke,{columns:e}),o.jsx(Vke,{data:de,columns:e,onRowClick:c,startIndex:ee,getRowStyle:f,searchTerm:i})]})})]})};function Pke(e){const{pagination:t,totalCount:n,onPageChange:c,...i}=e,r=t?.pageSize??20,s=t?.currentPage??1,d=m.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(pA,{...i,pagination:{pageSize:r,currentPage:s},totalCount:n,onPageChange:u})}const Tke=({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 k=y;k<=f;k++)g.push(k);return o.jsxs(Hke,{className:s,children:[o.jsxs(Dke,{children:[l,"-",h," ",r," ",n," ",u]}),o.jsx(Bke,{}),d>1&&o.jsxs(Rke,{children:[o.jsx(ii,{onClick:()=>c(1),disabled:e===1,title:"Première page",children:"<<"}),o.jsx(ii,{onClick:()=>c(e-1),disabled:e===1,title:"Page précédente",children:"<"}),g.map(k=>o.jsx(Fke,{$active:k===e,onClick:()=>c(k),children:k},k)),o.jsx(ii,{onClick:()=>c(e+1),disabled:e===d,title:"Page suivante",children:">"}),o.jsx(ii,{onClick:()=>c(d),disabled:e===d,title:"Dernière page",children:">>"})]})]})},Hke=F.div`
|
|
8273
8273
|
display: flex;
|
|
8274
8274
|
align-items: center;
|
|
8275
8275
|
justify-content: space-between;
|
|
@@ -8331,18 +8331,18 @@
|
|
|
8331
8331
|
&:hover:not(:disabled) {
|
|
8332
8332
|
background-color: ${e=>e.$active?"var(--color-primary)":"var(--color-background, #f3f4f6)"};
|
|
8333
8333
|
}
|
|
8334
|
-
`,Eke="_mpRoot_31595_1",Oke="_mpHeader_31595_22",Uke="_mpTitle_31595_31",Wke="_mpList_31595_35",Gke="_mpVertical_31595_41",Kke="_mpHorizontal_31595_46",Zke="_mpItem_31595_55",Xke="_mpClickable_31595_95",Yke="_mpLeft_31595_117",Jke="_mpIcon_31595_125",Qke="_mpMeta_31595_140",e3e="_mpLabel_31595_145",t3e="_mpDate_31595_154",a3e="_mpRight_31595_160",n3e="_mpValue_31595_168",o3e="_mpHint_31595_176",c3e="_mpBadge_31595_180",i3e="_mpBadgeTop_31595_199",r3e="_mpBadgeSub_31595_206",s3e="_mpBadgeSmall_31595_213",d3e="_mpPill_31595_229",l3e="_mpRounded_31595_232",h3e="_mpCompact_31595_236",u3e="_compactItemWrapper_31595_252",p3e="_mpSummaryRoot_31595_265",y3e="_mpSummaryInner_31595_269",k3e="_mpSummaryFlex_31595_284",m3e="_mpSummaryCardWrapperHorizontal_31595_292",f3e="_mpSummaryCardWrapper_31595_292",g3e="_mpSummaryCardHorizontal_31595_303",v3e="_mpSummaryCard_31595_292",x3e="_mpSummaryValue_31595_321",M3e="_mpSummaryLabel_31595_327",_3e="_mpSummaryBadge_31595_338",L3e="_mpSummaryBadgeSub_31595_357",I3e="_mpEmpty_31595_365",b3e="_mpSummaryVertical_31595_372",w3e="_mpIconSquare_31595_380",J={mpRoot:Eke,mpHeader:Oke,mpTitle:Uke,mpList:Wke,mpVertical:Gke,mpHorizontal:Kke,mpItem:Zke,mpClickable:Xke,mpLeft:Yke,mpIcon:Jke,mpMeta:Qke,mpLabel:e3e,mpDate:t3e,mpRight:a3e,mpValue:n3e,mpHint:o3e,mpBadge:c3e,mpBadgeTop:i3e,mpBadgeSub:r3e,mpBadgeSmall:s3e,mpPill:d3e,mpRounded:l3e,mpCompact:h3e,compactItemWrapper:u3e,mpSummaryRoot:p3e,mpSummaryInner:y3e,mpSummaryFlex:k3e,mpSummaryCardWrapperHorizontal:m3e,mpSummaryCardWrapper:f3e,mpSummaryCardHorizontal:g3e,mpSummaryCard:v3e,mpSummaryValue:x3e,mpSummaryLabel:M3e,mpSummaryBadge:_3e,mpSummaryBadgeSub:L3e,mpEmpty:I3e,mpSummaryVertical:b3e,mpIconSquare:w3e},Tt=(e,t=1)=>{if(!e||typeof e!="string")return`rgba(124, 58, 237, ${t})`;const n=e.trim();if(n.toLowerCase()==="transparent")return"rgba(0,0,0,0)";if(/^rgba?\(/i.test(n))return/^rgba\(/i.test(n)?n.replace(/rgba\(([^)]+),\s*([0-9.]+)\s*\)$/,(d,l)=>`rgba(${l.split(",").map(u=>u.trim()).slice(0,3).join(", ")}, ${t})`):n;let c=n.replace("#","").toLowerCase();if(c.length===3&&(c=c.split("").map(d=>d+d).join("")),!/^[0-9a-f]{6}$/i.test(c))return`rgba(124, 58, 237, ${t})`;const i=parseInt(c.slice(0,2),16),r=parseInt(c.slice(2,4),16),s=parseInt(c.slice(4,6),16);return`rgba(${i}, ${r}, ${s}, ${t})`},C3e=({item:e,shape:t,onItemClick:n,color:c,renderItem:i})=>{const r=m.useCallback(()=>{n?.(e)},[n,e]),s=[J.mpItem,t==="pill"?J.mpPill:J.mpRounded,n?J.mpClickable:""].filter(Boolean).join(" ");if(i)return o.jsx("div",{className:s,role:n?"button":"group",tabIndex:n?0:-1,onClick:r,onKeyDown:y=>{n&&(y.key==="Enter"||y.key===" ")&&(n(e),y.preventDefault())},"aria-label":n?`Voir les détails de ${e.label}`:void 0,children:i(e)});const d=n?"button":"div",l=n?{onClick:r,className:s,type:"button","aria-label":`Voir les détails de ${e.label}`}:{className:s,role:"group"},h=e.iconComponent,u=e.iconSquareBg,p=e.iconColor;return o.jsxs(d,{...l,children:[o.jsxs("div",{className:J.mpLeft,children:[h?o.jsx("div",{className:J.mpIconSquare,style:{background:u??Tt(p??c??"#7c3aed",1),border:`1px solid ${Tt(p??c??"#7c3aed",.18)}`,color:p??"#ffffff"},children:m.createElement(h,{size:20,color:p??"#fff",strokeWidth:1.8})}):e.icon?o.jsx("div",{className:J.mpIcon,children:e.icon}):null,o.jsxs("div",{className:J.mpMeta,children:[o.jsx("div",{className:J.mpLabel,children:e.label}),e.subLabel&&o.jsx("div",{className:J.mpDate,children:e.subLabel}),e.date&&o.jsx("div",{className:J.mpDate,children:e.date})]})]}),o.jsxs("div",{className:J.mpRight,children:[o.jsx("div",{className:J.mpValue,style:{color:e.valueColor??c??void 0},children:e.value}),e.badge?o.jsxs("div",{className:[J.mpBadge,e.badge.small?J.mpBadgeSmall:""].join(" "),style:{backgroundColor:e.badge.bg??Tt(e.badge.color||c||"#7c3aed",.12),borderColor:e.badge.bg?"transparent":Tt(e.badge.color||c||"#7c3aed",.18),color:e.badge.color??e.badge.textColor??"#0f172a",fontWeight:600},children:[o.jsx("div",{className:J.mpBadgeTop,children:e.badge.text}),e.badge.subText&&o.jsx("div",{className:J.mpBadgeSub,children:e.badge.subText})]}):e.hint?o.jsx("div",{className:J.mpHint,children:e.hint}):null]})]})},N3e=m.memo(C3e),LS=({title:e,right:t})=>!e&&!t?null:o.jsxs("div",{className:J.mpHeader,children:[o.jsx("div",{className:J.mpTitle,children:e}),o.jsx("div",{children:t})]}),IS=(e,t=1)=>{try{return Tt(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},j3e=({item:e})=>o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:14,borderRadius:12,minHeight:88,boxSizing:"border-box",background:e.bgColor??"transparent",border:`1px solid ${e.borderColor??"transparent"}`,boxShadow:"0 4px 10px rgba(15,23,42,0.03)"},children:[o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[o.jsx("div",{style:{fontSize:13,fontWeight:700,color:"#475569"},children:e.label}),o.jsx("div",{style:{fontSize:26,fontWeight:900,color:"#0f172a",lineHeight:1},children:e.value})]}),o.jsx("div",{title:String(e.label),style:{display:"flex",alignItems:"center",justifyContent:"center",width:48,height:48,borderRadius:10,background:e.iconSquareBg??IS("#7c3aed",.12),border:`1px solid ${IS(e.iconColor??"#7c3aed",.12)}`,boxShadow:"none"},children:e.iconComponent?m.createElement(e.iconComponent,{size:18,color:e.iconColor??"#7c3aed",strokeWidth:1.6}):null})]}),S3e=({item:e,bg:t,onClick:n,width:c,height:i,extraStyle:r})=>o.jsxs("div",{className:J.mpSummaryCard,style:{background:t,width:c??void 0,height:i??void 0,...r??{}},role:n?"button":"group",tabIndex:n?0:-1,onClick:()=>n?.(e),children:[o.jsx("div",{className:J.mpSummaryLabel,children:e.label}),o.jsx("div",{className:J.mpSummaryValue,style:{color:e.valueColor??"#2a24deff"},children:e.value}),e.badge&&o.jsxs("div",{className:J.mpSummaryBadge,children:[e.badge.text,e.badge.subText&&o.jsx("div",{className:J.mpSummaryBadgeSub,children:e.badge.subText})]})]}),bS=(e,t=1)=>{try{return Tt(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},wS=e=>o.jsxs("div",{style:{display:"grid",gridTemplateRows:"auto 1fr",width:"100%",gap:8,alignItems:"center",boxSizing:"border-box",minWidth:0},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between-left",alignItems:"baseline",gap:10,width:"100%"},children:[o.jsx("div",{style:{fontWeight:700,fontSize:"clamp(14px, 1.2vw, 16px)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:e.label}),e.subLabel?o.jsx("div",{style:{fontSize:"clamp(13px, 1.1vw, 15px)",fontWeight:600,whiteSpace:"nowrap"},children:e.subLabel}):null]}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:15,width:"100%"},children:[o.jsx("div",{style:{fontWeight:900,fontSize:"clamp(16px, 1.6vw, 20px)",color:e.valueColor,lineHeight:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.value}),e.badge?o.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"8px 12px",borderRadius:10,backgroundColor:e.badge.bg?e.badge.bg:bS("#7c3aed",.08),border:`1px solid ${e.badge.bg?e.badge.bg:bS("#7c3aed",.12)}`,color:e.badge.textColor||"#0f172a",fontWeight:700,fontSize:"clamp(12px, 1.2vw, 14px)",width:"120px",height:"52px",textAlign:"center",boxSizing:"border-box",overflow:"hidden",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",lineHeight:1.2,flexShrink:0},children:[o.jsx("div",{style:{fontSize:14,fontWeight:800,lineHeight:1.2,letterSpacing:"0.02em",width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.badge.text}),e.badge.subText?o.jsx("div",{style:{fontSize:13,marginTop:4,fontWeight:700,letterSpacing:"0.01em",width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.badge.subText}):null]}):null]})]}),CS=(e,t)=>{try{if(typeof e=="function"){const n=e(t);if(n!==void 0)return n}}catch{}try{return m.createElement(e,{item:t})}catch(n){return console.warn("chooseDefaultRender: impossible de rendre CompactRenderer",n),null}},$3e=e=>{switch(e){case"image":return t=>m.createElement(j3e,{item:t});case"pertinence":return t=>m.createElement(S3e,{item:t});case"alternateHorizontal":return t=>CS(wS,t);case"compact":return t=>CS(wS,t);case"summary":return;case"default":default:return}},yA=({item:e,orientation:t,bg:n,border:c,valueColor:i,onClick:r,width:s,height:d,extraStyle:l})=>{const u=t==="horizontal"?J.mpSummaryCardHorizontal:J.mpSummaryCard;return o.jsxs("div",{className:u,style:{background:n,border:`1px solid ${c}`,width:s??void 0,height:d??void 0,...l??{}},role:r?"button":"group",tabIndex:r?0:-1,onClick:()=>r?.(e),children:[e.badge&&o.jsxs("div",{className:J.mpSummaryBadge,children:[e.badge.text,e.badge.subText&&o.jsx("div",{className:J.mpSummaryBadgeSub,children:e.badge.subText})]}),o.jsx("div",{className:J.mpSummaryValue,style:{color:i},children:e.value}),o.jsx("div",{className:J.mpSummaryLabel,children:e.label})]})},q3e=["transparent","transparent","transparent","transparent"],A3e=["transparent","transparent","transparent","transparent"],z3e=["#059669","#2563eb","#b45309","#7c3aed"],V3e=(e,t=1)=>{try{return Tt(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},kA=e=>{const{items:t=[],layout:n="vertical",orientation:c="auto",shape:i="rounded",color:r="#7c3aed",compact:s=!1,title:d,onItemClick:l,className:h="",loading:u=!1,emptyMessage:p="Aucun élément",renderItem:y,summary:f=!1,summaryBgColors:g=q3e,summaryBorderColors:k=A3e,summaryValueColors:x=z3e,preset:M,background:v}=e,{itemsContainerStyle:I,itemsContainerClassName:b,summaryGridColumns:C,compactItemWidth:w,compactItemHeight:_,compactItemStyle:L,summaryCardWidth:S,summaryCardHeight:N,summaryCardStyle:j}=e,A=n==="vertical",B={"--mp-accent":r,"--mp-accent-soft":V3e(r,.08),"--mp-bg-primary":v},D=[J.mpRoot,A?J.mpVertical:J.mpHorizontal,s?J.mpCompact:"",f?J.mpSummaryRoot:"",c!=="auto"?c==="vertical"?J.mpOrientationVertical:J.mpOrientationHorizontal:"",h].filter(Boolean).join(" "),V=m.useMemo(()=>y||($3e(M)??void 0),[y,M]);if(f){const q=c==="horizontal"?J.mpSummaryFlex:J.mpSummaryVertical,H={...(C?{display:"grid",gridTemplateColumns:`repeat(${C}, 1fr)`,gap:18,alignItems:"stretch",width:"100%"}:void 0)??{},...I??{}};return o.jsxs("div",{className:D,style:B,"aria-busy":u,children:[d&&o.jsx(LS,{title:d}),o.jsx("div",{className:J.mpSummaryInner,children:o.jsx("div",{className:`${q} ${b??""}`,style:H,children:t.length===0?o.jsx("div",{className:J.mpEmpty,children:p}):t.map((R,z)=>{const O=R.bgColor??g[z%g.length],X=R.borderColor??k[z%k.length],ie=R.valueColor??x[z%x.length];return V?o.jsx("div",{className:c==="horizontal"?J.mpSummaryCardWrapperHorizontal:J.mpSummaryCardWrapper,style:{width:S??void 0,height:N??void 0,...j??{}},children:V(R,z)},R.id):o.jsx(yA,{item:R,orientation:c==="horizontal"?"horizontal":"vertical",bg:O,border:X,valueColor:ie,onClick:l,width:S??void 0,height:N??void 0,extraStyle:j},R.id)})})})]})}return o.jsxs("div",{className:D,style:B,"aria-busy":u,children:[d&&o.jsx(LS,{title:d}),o.jsx("div",{className:J.mpList,style:I,children:u?o.jsx("div",{className:J.mpEmpty,children:"Chargement…"}):t.length===0?o.jsx("div",{className:J.mpEmpty,children:p}):t.map(q=>{const $=s?{width:w??void 0,height:_??void 0,boxSizing:"border-box",...L??{}}:void 0;return o.jsx("div",{className:s?J.compactItemWrapper:void 0,style:$,children:o.jsx(N3e,{item:q,shape:i,onItemClick:l,color:r,renderItem:V?H=>V(H,t.indexOf(H)):void 0})},q.id)})})]})};m.memo(kA);const P3e=({a11yConfig:e,width:t,height:n,colors:c={text:"#0b1220",background:"#fff",contentBackground:"#efeff0"},titles:i={},placeholder:r="Loading Chart",style:s,className:d="",children:l,padding:h="1rem",variant:u="default",showBorder:p=!1,titleKey:y,leftTitleKey:f})=>{const g=t?typeof t=="number"?`${t}px`:t:void 0,k=n?typeof n=="number"?`${n}px`:n:void 0,x=r&&typeof r=="object"&&!m.isValidElement(r)&&("text"in r||"subtext"in r||"icon"in r||"background"in r||"iconSize"in r),M=x?r:void 0,v=M?.icon?xt[M.icon]:void 0,I=28,b=M?.iconSize??I,C=["chart-container",`variant-${u}`,p?"with-border":"",d].filter(Boolean).join(" "),w=c.contentBackground??void 0,_=typeof h=="number"?`${h}px`:h;return o.jsxs("div",{className:C,style:{width:g,height:k,color:c.text,background:c.background,display:"flex",flexDirection:"column",boxSizing:"border-box",padding:_,...s},children:[o.jsxs("div",{className:"chart-header",children:[o.jsxs("div",{title:Z(e,f||y),className:"chart-title-left",style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.left,i.leftSubtitle&&o.jsx("div",{className:"chart-subtitle-left",children:i.leftSubtitle})]}),o.jsx("div",{className:"chart-title-right",children:i.right})]}),o.jsx("div",{className:"chart-content",style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:w},children:l||(x&&M?o.jsxs("div",{className:"placeholder",role:"status","aria-live":"polite",children:[v&&o.jsx("div",{className:"placeholder-icon",style:{width:b,height:b},children:o.jsx(v,{color:M.iconColor??"currentColor",size:typeof b=="number"?b:parseInt(String(b),10)||I})}),M.text&&o.jsx("div",{className:"placeholder-text",children:M.text}),M.subtext&&o.jsx("div",{className:"placeholder-subtext",children:M.subtext})]}):o.jsx("div",{className:"placeholder-node",role:"status","aria-live":"polite",children:r}))})]})},tC=({id:e,size:t="100%",background:n,icon:c,text:i,subtext:r,onClose:s,onClick:d,style:l,className:h="",colorTextPrimary:u,colorTextSub:p,model:y,fontSize:f,fontWeight:g,a11yConfig:k,titleKey:x})=>{const M=c||y?.icon,v=typeof M=="string",I=v?xt[M]:null,b=v?null:M;return o.jsxs("div",{id:e,className:`alert ${h}`,style:{width:typeof t=="number"?`${t}px`:t,background:n||y?.background,pointerEvents:"auto",cursor:d?"pointer":"default",...l},role:"alert",onClick:d,title:Z(k,x),children:[I&&o.jsx(I,{className:"alert-icon",size:20,color:u||y?.colorTextPrimary}),b!=null&&o.jsx("span",{className:"alert-icon",style:{display:"flex",alignItems:"center",color:u||y?.colorTextPrimary,flexShrink:0},children:b}),o.jsxs("div",{className:"alert-content",children:[o.jsx("span",{className:"alert-text",style:{color:u||y?.colorTextPrimary,fontSize:f,fontWeight:g},children:i}),r&&o.jsx("span",{className:"alert-subtext",style:{color:p||y?.colorTextSub},children:r})]}),s&&o.jsx("button",{className:"alert-close",onClick:s,"aria-label":"Fermer",children:"✕"})]})},mA=m.createContext(null),T3e=(e="alert")=>`${e}_${Math.random().toString(36).slice(2,9)}`,H3e=({children:e,defaultDuration:t=4e3,maxAlerts:n,containerClassName:c,containerStyle:i})=>{const[r,s]=m.useState([]),d=m.useRef(new Map),l=m.useRef(null),h=m.useRef(null),u=m.useRef(n);m.useEffect(()=>()=>{d.current.forEach(_=>window.clearTimeout(_)),d.current.clear()},[]);const p=(_,L)=>{const S=L===void 0||L===0?t:L;if(S===-1)return;const N=window.setTimeout(()=>{g(_)},S);d.current.set(_,N)},y=_=>{const L=d.current.get(_);L&&(window.clearTimeout(L),d.current.delete(_))},f=_=>{const L=T3e(),S={..._,id:L,createdAt:Date.now()};return s(N=>{const j=[S,...N],A=u.current;return typeof A=="number"&&A>=0&&j.length>A?(j.slice(A).forEach(D=>y(D.id)),j.slice(0,A)):j}),p(L,_.duration),L},g=_=>{y(_),s(L=>L.filter(S=>S.id!==_))},k=(_,L)=>{s(S=>S.map(N=>N.id===_?{...N,...L}:N))},x=()=>{d.current.forEach(_=>window.clearTimeout(_)),d.current.clear(),s([])},M=_=>{h.current=_},v=()=>r.slice(),I=m.useMemo(()=>({showAlert:f,dismissAlert:g,updateAlert:k,clearAlerts:x,setContainerRef:M,getAlertsSnapshot:v}),[r]),b=h.current,C=o.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,display:"flex",flexDirection:"column",alignItems:"center",pointerEvents:"none",zIndex:10001,padding:"8px 4px"},children:o.jsx(mle,{mode:"popLayout",children:r.map(_=>o.jsx(Xw.div,{initial:{opacity:0,y:-10,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.98},transition:{type:"spring",damping:25,stiffness:300},style:{width:"100%",pointerEvents:"auto",boxShadow:"0 6px 20px rgba(0, 0, 0, 0.12)",borderRadius:"8px",marginBottom:"6px",backgroundColor:_.background||_.model?.background||"var(--color-background, #fff)",border:"1px solid rgba(0, 0, 0, 0.08)",overflow:"hidden"},children:o.jsx(tC,{id:_.id,text:_.text,subtext:_.subtext,icon:_.icon,background:"transparent",colorTextPrimary:_.colorTextPrimary,colorTextSub:_.colorTextSub,model:_.model,onClose:()=>g(_.id),size:"100%",style:{boxShadow:"none"}})},_.id))})}),w=o.jsx("div",{ref:_=>{h.current||(l.current=_)},className:c,style:{width:"100%",position:"relative",...i},"aria-live":"polite",children:C});return o.jsxs(mA.Provider,{value:I,children:[b?mw.createPortal(C,b):w,e]})},D3e=()=>{const e=m.useContext(mA);if(!e)throw new Error("useAlerts must be used inside an AlertsProvider");return e},B3e={default:{background:"#f3f4f6",icon:"Info",colorTextPrimary:"#111827",colorTextSub:"#4b5563"},info:{background:"#dbeafe",icon:"Info",colorTextPrimary:"#1e40af",colorTextSub:"#3b82f6"},success:{background:"#dcfce7",icon:"CheckCircle2",colorTextPrimary:"#166534",colorTextSub:"#22c55e"},warning:{background:"#fef3c7",icon:"AlertTriangle",colorTextPrimary:"#92400e",colorTextSub:"#f59e0b"},error:{background:"#fee2e2",icon:"XCircle",colorTextPrimary:"#991b1b",colorTextSub:"#ef4444"}},R3e="_container_18zbo_1",F3e="_icon_18zbo_9",E3e="_selectWrapper_18zbo_23",Hb={container:R3e,icon:F3e,selectWrapper:E3e},O3e=({options:e,defaultValue:t,onChange:n,label:c})=>{const[i,r]=m.useState(t||e[0]?.value||""),s=d=>{r(d),n?.(d)};return o.jsxs("div",{className:Hb.container,children:[o.jsxs("div",{className:Hb.icon,children:[o.jsx(w1,{size:18}),o.jsx("p",{children:c})]}),o.jsx("div",{className:Hb.selectWrapper,children:o.jsx(Yw,{field:{name:"periode",label:"",options:e},value:i,onChange:s,onBlur:()=>{}})})]})},U3e=250,W3e=m.forwardRef(({title:e,subtitle:t,size:n="420px",beforeOpen:c,afterOpen:i,beforeClose:r,afterClose:s,style:d,className:l="",children:h,closeOnOverlayClick:u=!0,showCloseButton:p=!0},y)=>{const[f,g]=m.useState(!1),[k,x]=m.useState(!1),M=m.useRef(null),v=m.useRef(null),I=m.useRef(null),b=m.useRef(null);m.useEffect(()=>{const _=M.current;if(!_)return;const L=_.parentElement;return L?(window.getComputedStyle(L).position==="static"&&(L.setAttribute("data-scp-prev-position",L.style.position??""),L.style.position="relative",L.setAttribute("data-scp-position-changed","true")),()=>{if(L.getAttribute("data-scp-position-changed")==="true"){const N=L.getAttribute("data-scp-prev-position")??"";L.style.position=N,L.removeAttribute("data-scp-position-changed"),L.removeAttribute("data-scp-prev-position")}}):void 0},[]),m.useImperativeHandle(y,()=>({open:()=>{f||(c?.(),x(!1),g(!0))},close:()=>{f&&(r?.(),x(!1),g(!1))},toggle:()=>{f?(r?.(),x(!1),g(!1)):(c?.(),x(!1),g(!0))}}),[f,c,r]),m.useEffect(()=>{const _=v.current;b.current&&(window.clearTimeout(b.current),b.current=null);const L=S=>{if(S.target===_&&!(S.propertyName!=="transform"&&S.propertyName!=="opacity"))if(f){x(!0),i?.();try{_?.focus()}catch{}}else{s?.();try{I.current?.focus()}catch{}}};return _&&(_.addEventListener("transitionend",L),b.current=window.setTimeout(()=>{if(f){x(!0),i?.();try{_?.focus()}catch{}}else{s?.();try{I.current?.focus()}catch{}}},U3e+60)),f&&(I.current=document.activeElement),()=>{_&&_.removeEventListener("transitionend",L),b.current&&(window.clearTimeout(b.current),b.current=null)}},[f,i,s]),m.useEffect(()=>{const _=L=>{L.key==="Escape"&&f&&(r?.(),x(!1),g(!1))};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[f,r]);const C=()=>{u&&(r?.(),x(!1),g(!1))},w=typeof n=="number"?`${n}px`:n;return o.jsxs("div",{ref:M,className:`scp-inline-root ${f?"open":""}`,"aria-hidden":!f,children:[o.jsx("div",{className:`scp-overlay ${f?"visible":""}`,onMouseDown:C,role:"presentation"}),o.jsxs("aside",{className:`scp-panel ${f?"in":"out"} ${k?"interactive":""} ${l}`,style:{width:w,...d},ref:v,tabIndex:-1,role:"dialog","aria-label":e,children:[o.jsxs("div",{className:"scp-header",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"scp-title",children:e}),t&&o.jsx("div",{className:"scp-subtitle",children:t})]}),p&&o.jsx("button",{className:"scp-close","aria-label":"Close",onClick:()=>{r?.(),x(!1),g(!1)},children:o.jsx(Qe,{size:18})})]}),o.jsx("div",{className:"scp-body",children:h})]})]})});function G3e(e){const t=m.useRef("");m.useEffect(()=>{if(e){t.current=document.body.style.overflow,document.body.style.overflow="hidden";return}document.body.style.overflow=t.current||""},[e])}const K3e="_container_1pfsp_1",Z3e="_title_1pfsp_8",NS={container:K3e,title:Z3e},X3e=({title:e,fontSize:t,barColor:n,className:c="",style:i={}})=>{const r={...i,"--title-font-size":t,"--bar-color":n};return o.jsx("div",{className:`${NS.container} ${c}`,style:r,children:o.jsx("h2",{className:NS.title,children:e})})},Y3e="_modalOverlay_1878x_1",J3e="_modalContainer_1878x_16",Q3e="_modalTitle_1878x_29",eme="_modalInput_1878x_38",tme="_modalTextarea_1878x_39",ame="_modalActions_1878x_70",nme="_cancelBtn_1878x_77",ome="_saveBtn_1878x_99",cme="_inputError_1878x_141",ime="_inlineAlert_1878x_146",at={modalOverlay:Y3e,modalContainer:J3e,modalTitle:Q3e,modalInput:eme,modalTextarea:tme,modalActions:ame,cancelBtn:nme,saveBtn:ome,inputError:cme,inlineAlert:ime},Bc=({isOpen:e,onClose:t,onSave:n,title:c="Ajouter un élément",fields:i,initialValues:r={},errorMessage:s="",disableSave:d,onFieldChange:l,confirmText:h="Valider",cancelText:u="Annuler"})=>{const[p,y]=m.useState({}),f=m.useRef(null),[g,k]=m.useState(!1),[x,M]=m.useState(!1),v=m.useRef(null);if(m.useEffect(()=>{if(!e)return;const _={};for(const L of i)_[L.name]=Object.prototype.hasOwnProperty.call(r,L.name)?r[L.name]:"";return y(_),requestAnimationFrame(()=>{f.current?.focus();const L=f.current;if(L&&typeof L.selectionStart=="number"){const S=String(L.value??"").length;L.setSelectionRange(S,S)}}),()=>{v.current&&(window.clearTimeout(v.current),v.current=null)}},[e]),m.useEffect(()=>{s&&e?(M(!0),v.current&&(window.clearTimeout(v.current),v.current=null),v.current=window.setTimeout(()=>{M(!1),v.current=null},3e3)):(M(!1),v.current&&(window.clearTimeout(v.current),v.current=null))},[s,e]),!e)return null;const I=(_,L)=>{y(S=>({...S,[_]:L})),l&&l(_,L)},b=async()=>{if(!Object.values(p).some(_=>_===""||_===void 0))try{k(!0);const _=await n(p);if(typeof _=="string"&&_==="duplicate-same"){k(!1);return}y({}),k(!1),t()}catch(_){console.error("AddItemModal onSave error:",_),k(!1),t()}},C=_=>{_.target===_.currentTarget&&t()},w=_=>_.stopPropagation();return o.jsx("div",{className:at.modalOverlay,onMouseDown:C,role:"dialog","aria-modal":"true",children:o.jsxs("div",{className:at.modalContainer,onMouseDown:w,onClick:w,children:[o.jsx("h2",{className:at.modalTitle,children:c}),i.map((_,L)=>{const S=p[_.name]??"",N=L===0&&!!s,j={name:_.name,placeholder:_.placeholder||_.label,value:String(S),onChange:A=>I(_.name,A.target.value),className:_.type==="textarea"?`${at.modalTextarea} ${N?at.inputError:""}`:`${at.modalInput} ${N?at.inputError:""}`,tabIndex:0,disabled:g};return L===0&&(j.ref=A=>{f.current=A}),o.jsxs("div",{style:{marginBottom:8},children:[_.type==="textarea"?o.jsx("textarea",{rows:_.rows||4,...j}):o.jsx("input",{type:_.type||"text",...j}),L===0&&x&&s&&o.jsx("div",{style:{marginTop:8},children:o.jsx(tC,{text:s,background:"#fff5f5",colorTextPrimary:"#ef4444",onClose:()=>M(!1),className:at.inlineAlert})})]},_.name)}),o.jsxs("div",{className:at.modalActions,children:[o.jsx("button",{className:at.cancelBtn,onClick:t,type:"button",disabled:g,children:u}),o.jsx("button",{className:at.saveBtn,onClick:b,type:"button",disabled:g||!!d,children:g?"En cours...":h})]})]})})},rme=({title:e,keyCount:t,onAddKey:n,a11yConfig:c})=>{const[i,r]=m.useState(!1),s=d=>{const l=d.key;n&&l&&n(l)};return o.jsxs("div",{className:"header-container",children:[o.jsxs("div",{className:"header-info",children:[o.jsx("h1",{title:Z(c,e),children:e}),o.jsxs("p",{children:[t," clés"]})]}),o.jsxs("button",{onClick:()=>r(!0),className:"add-key-button",children:[o.jsx(Vc,{className:"add-key-icon"}),"Clé"]}),o.jsx(Bc,{isOpen:i,title:"Ajouter une clé",onClose:()=>r(!1),onSave:s,fields:[{name:"key",label:"Nouvelle clé",placeholder:"Entrer une nouvelle clé"}]})]})},sme=({modules:e,onEdit:t,onDelete:n,onAddModule:c,onSelectModule:i,addModalFields:r,addModalTitle:s})=>{const[d,l]=m.useState(!1),[h,u]=m.useState(null),[p,y]=m.useState(null),[f,g]=m.useState(!1),k=()=>l(!0),x=()=>l(!1),M=_=>{if(c){const L=_.code?.trim()||_.id?.trim(),S=_.title?.trim(),N=L||S||String(Date.now()),j=S||L||`Module ${N}`;c({id:N,title:j,subtitle:"",translations:{}})}x()},v=(_,L)=>{_.stopPropagation(),u(L)},I=()=>u(null),b=_=>{if(!h){I();return}const L={...h,title:_.title||h.title,subtitle:""};t&&t(L),I()},C=(_,L)=>{_.stopPropagation(),n&&n(L)},w=_=>{y(_.id),i&&i(_)};return f?o.jsx("div",{className:"module-sidebar collapsed",children:o.jsx(n1,{size:20,className:"menu-toggle",onClick:()=>g(!1)})}):o.jsxs("div",{className:"module-sidebar",children:[o.jsxs("div",{className:"sidebar-header",children:[o.jsxs("span",{className:"header-text",children:["Modules (",e.length,")"]}),o.jsxs("div",{className:"header-actions",children:[o.jsx(zc,{size:18,className:"header-folder",onClick:k}),o.jsx(n1,{size:18,className:"header-menu",onClick:()=>g(!0)})]})]}),o.jsx("hr",{className:"divider"}),o.jsx("div",{className:"module-list",children:e.map(_=>{const L=Object.keys(_.translations||{}).length,S=L>0||_.id===p;return o.jsxs("div",{className:`module-item ${_.id===p?"selected":""}`,onClick:()=>w(_),role:"button",tabIndex:0,onKeyDown:N=>{N.key==="Enter"&&w(_)},children:[o.jsxs("div",{className:"module-left",children:[o.jsx($1,{size:16,className:"item-folder"}),o.jsxs("div",{className:"module-info",children:[o.jsxs("div",{className:"module-title",children:[_.title,S&&o.jsxs("span",{className:"count",children:[" ",L," "]})]}),_.subtitle?o.jsx("div",{className:"module-subtitle",children:_.subtitle}):null]})]}),o.jsxs("div",{className:"module-actions",children:[t&&o.jsx(o1,{onClick:N=>v(N,_),color:"#777",size:16}),n&&o.jsx(ut,{onClick:N=>C(N,_.id),color:"#777",size:16})]})]},_.id)})}),o.jsx(Bc,{isOpen:d,onClose:x,onSave:M,title:s||"Ajouter un module",fields:r&&r.length?r.map(_=>({name:_.name,label:_.label,type:_.type,placeholder:_.placeholder,rows:_.rows})):[{name:"title",label:"Titre",placeholder:"Titre du module"}]}),h&&o.jsx(Bc,{isOpen:!!h,onClose:I,onSave:b,title:"Éditer le module",initialValues:{title:h.title},fields:[{name:"title",label:"Titre",placeholder:"Titre du module"}]})]})},fA=({placeholder:e="Rechercher une clé ou traduction...",value:t="",onChange:n,iconPosition:c="left",iconColor:i="#9ca3af",a11yConfig:r,className:s})=>o.jsxs("div",{className:`search-container icon-${c}`,title:Z(r,e),children:[o.jsx("div",{className:"search-icon-wrapper",children:o.jsx(z1,{className:"search-icon",color:i})}),o.jsx("input",{type:"text",placeholder:e,value:t,onChange:d=>n?.(d.target.value),className:`search-input ${s}`})]}),dme=({keyName:e,translations:t,availableLanguages:n,onDeleteKey:c,onEditKey:i,onEditTranslation:r,onDeleteTranslation:s,onAddTranslation:d,draggable:l=!1,checkDuplicateLocal:h})=>{const[u,p]=m.useState(!1),[y,f]=m.useState(""),[g,k]=m.useState(null),[x,M]=m.useState(""),[v,I]=m.useState(""),[b,C]=m.useState(!1),[w,_]=m.useState(!1),[L,S]=m.useState(null),[N,j]=m.useState(!1),A=t.map(z=>z.language),B=n.filter(z=>!A.includes(z.code)),D=()=>{y&&v.trim()&&(d?.(e,y,v.trim()),f(""),I(""),p(!1))},V=(z,O)=>{k(z),M(O)},q=z=>{r?.(e,z,x),k(null),M("")},$=()=>{k(null),M("")},H=async z=>{const O=z.name?.trim();if(O){if(S(null),j(!1),O===e||!i)return C(!1),"ok";try{const X=await i(e,O);if(typeof X=="string"&&X==="ok")C(!1),S(null);else{if(typeof X=="string"&&X==="duplicate-same")return S("Une clé existe déjà dans ce module."),j(!0),"duplicate-same";if(typeof X=="string"&&X==="duplicate-other")return C(!1),S(null),"duplicate-other";C(!1)}}catch(X){console.error("Erreur handleRenameSave:",X),S("Erreur lors du renommage.")}}},R=(z,O)=>{if(z!=="name")return;const X=O.trim();S(null),j(!1),X&&typeof h=="function"&&(h(X,e)?(S("Une clé existe déjà dans ce module."),j(!0)):(S(null),j(!1)))};return o.jsxs("div",{className:`translation-key ${w?"collapsed":"expanded"} ${l?"draggable":""}`,children:[o.jsxs("div",{className:"card-header",children:[o.jsxs("div",{className:"header-left",children:[o.jsx("button",{className:"collapse-button",onClick:()=>_(!w),title:w?"Déplier":"Replier",children:w?o.jsx(N1,{className:"collapse-icon"}):o.jsx(Ht,{className:"collapse-icon"})}),o.jsx("h3",{className:"card-title",title:e,children:e})]}),o.jsxs("div",{className:"header-actions",children:[o.jsx("button",{className:"action-button",onClick:z=>{z.stopPropagation(),C(!0)},title:"Renommer la clé",children:o.jsx(ft,{className:"action-icon"})}),o.jsx("button",{onClick:z=>{z.stopPropagation(),c?.(e)},className:"action-button delete",title:"Supprimer la clé",children:o.jsx(ut,{className:"action-icon"})})]})]}),o.jsx("div",{className:`translations-container ${w?"":"expanded"}`,children:!l&&o.jsxs(o.Fragment,{children:[t.map(z=>o.jsxs("div",{className:"translation-row",children:[o.jsx("div",{className:"language-code",children:z.language}),o.jsx("div",{className:"translation-content",children:g===z.language?o.jsxs(o.Fragment,{children:[o.jsx("input",{type:"text",value:x,onChange:O=>M(O.target.value),className:"edit-input",autoFocus:!0,onKeyDown:O=>{O.key==="Enter"&&q(z.language),O.key==="Escape"&&$()}}),o.jsx("button",{onClick:()=>q(z.language),className:"save-button",disabled:!x.trim(),children:"Enregistrer"}),o.jsx("button",{onClick:$,className:"cancel-button",children:o.jsx(Qe,{className:"action-icon"})})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"translation-text",title:z.value,children:z.value}),o.jsx("button",{onClick:()=>V(z.language,z.value),className:"edit-button",title:"Éditer la traduction",children:o.jsx(ft,{className:"action-icon"})}),o.jsx("button",{onClick:()=>s?.(e,z.language),className:"delete-translation-button",title:"Supprimer la traduction",children:o.jsx(Qe,{className:"action-icon"})})]})})]},z.language)),u?o.jsxs("div",{className:"add-language-row",children:[o.jsx("div",{className:"language-code",children:"+"}),o.jsxs("div",{className:"add-language-content",children:[o.jsx("div",{className:"language-select-container",children:o.jsxs("select",{value:y,onChange:z=>f(z.target.value),className:"language-select",children:[o.jsx("option",{value:"",children:"Sélectionnez la langue"}),B.map(z=>o.jsxs("option",{value:z.code,children:[z.name," (",z.code,")"]},z.code))]})}),y&&o.jsx("input",{type:"text",value:v,onChange:z=>I(z.target.value),placeholder:"Entrez la traduction...",className:"translation-input",onKeyDown:z=>{z.key==="Enter"&&D(),z.key==="Escape"&&(p(!1),f(""),I(""))}}),o.jsx("button",{onClick:D,disabled:!y||!v.trim(),className:"save-button",children:"Ajouter"}),o.jsx("button",{onClick:()=>{p(!1),f(""),I("")},className:"cancel-button",children:o.jsx(Qe,{className:"action-icon"})})]})]}):o.jsxs("button",{onClick:()=>p(!0),className:"show-add-button",disabled:B.length===0,children:[o.jsx("span",{className:"plus-icon",children:"+"}),"Ajouter une langue"]})]})}),l&&o.jsxs("div",{className:"drag-overlay",children:[o.jsx(a.Move,{size:24,strokeWidth:1.5}),o.jsx("span",{children:"Glisser pour réorganiser"})]}),o.jsx(Bc,{isOpen:b,onClose:()=>{C(!1),S(null),j(!1)},onSave:H,onFieldChange:R,title:"Renommer la clé",initialValues:{name:e},fields:[{name:"name",label:"Nom de la clé",placeholder:"Nom de la clé"}],errorMessage:L||"",disableSave:N})]})},lme="_wrapper_1wvht_1",hme="_leftGroup_1wvht_12",ume="_filterButton_1wvht_21",pme="_open_1wvht_42",yme="_filterIcon_1wvht_42",kme="_infoText_1wvht_58",mme="_pickerContainer_1wvht_66",fme="_srOnly_1wvht_79",gme="_pickerLabel_1wvht_91",vme="_datetime_1wvht_98",xme="_rightGroup_1wvht_107",Mme="_searchInputWrap_1wvht_116",_me="_searchInput_1wvht_116",Lme="_searchIcon_1wvht_152",De={wrapper:lme,leftGroup:hme,filterButton:ume,open:pme,filterIcon:yme,infoText:kme,pickerContainer:mme,srOnly:fme,pickerLabel:gme,datetime:vme,rightGroup:xme,searchInputWrap:Mme,searchInput:_me,searchIcon:Lme};function Ime({onDateChange:e,onSearch:t,initialDate:n}){const[c,i]=m.useState(!1),[r,s]=m.useState(n??""),d=m.useRef(null);m.useEffect(()=>{function p(y){const f=y.target;d.current&&f&&!d.current.contains(f)&&i(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]),m.useEffect(()=>{n&&s(n)},[n]);const l=()=>i(p=>!p),h=p=>{const y=p.target.value;s(y),e?.(y)},u=p=>{t?.(p.target.value)};return o.jsxs("div",{className:De.wrapper,ref:d,children:[o.jsxs("div",{className:De.leftGroup,children:[o.jsxs("button",{type:"button",className:`${De.filterButton} ${c?De.open:""}`,onClick:l,"aria-expanded":c,"aria-haspopup":"dialog","aria-controls":"entry-datetime",children:[o.jsx("span",{children:"Entry time"}),o.jsx("svg",{className:De.filterIcon,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":!0,children:o.jsx("path",{fill:"currentColor",d:"M10 18h4v-2h-4v2zm-7-8v2h18V10H3zm3-6v2h12V4H6z"})})]}),o.jsx("div",{className:De.infoText,children:"Confidence interval: step ± 15' / exit ± 30'"}),c&&o.jsxs("div",{className:De.pickerContainer,role:"dialog","aria-label":"Choisir la date et l’heure",children:[o.jsx("label",{className:De.pickerLabel,htmlFor:"entry-datetime",children:o.jsx("span",{className:De.srOnly,children:"Choisir la date et l’heure"})}),o.jsx("input",{id:"entry-datetime",className:De.datetime,type:"datetime-local",value:r,onChange:h,"aria-label":"Date et heure d’entrée"})]})]}),o.jsx("div",{className:De.rightGroup,children:o.jsxs("div",{className:De.searchInputWrap,children:[o.jsx("input",{className:De.searchInput,placeholder:"Search...",onChange:u,"aria-label":"Search"}),o.jsx("svg",{className:De.searchIcon,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":!0,children:o.jsx("path",{fill:"currentColor",d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16a6.471 6.471 0 004.23-1.57l.27.28v.79L20 20.49 21.49 19l-5.99-5zM10 15.5A5.5 5.5 0 1115.5 10 5.5 5.5 0 0110 15.5z"})})]})})]})}const bme=({className:e="",style:t={},title:n,titleClassName:c="",titleStyle:i,data:r,lineClasses:s={},renderCell:d,bg:l,titleBg:h,titleColor:u,itemBg:p,emptyContent:y,colGap:f="1rem"})=>{const g=Array.isArray(r)?r:[],k=g.length===0,x=g.every(b=>typeof b=="string"),M=g.some(b=>Array.isArray(b)),v=(b,C,w)=>d?d(b,C,w):o.jsx("span",{className:"slb-cell-text",children:b}),I=f?{"--col-gap":f}:void 0;return k?o.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:l??void 0},children:[n&&o.jsx("div",{className:`slb-title ${c}`,style:{...i,background:h??void 0,color:u??void 0},children:n}),o.jsx("div",{className:"slb-empty",children:y??null})]}):x&&!M?o.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:l??void 0},children:[n&&o.jsx("div",{className:`slb-title ${c}`,style:{background:h??void 0,color:u??void 0},children:n}),o.jsx("ul",{className:"slb-list",children:g.map((b,C)=>o.jsx("li",{className:`slb-item ${s[C]||""}`,style:{background:p??void 0},children:v(b,C,0)},C))})]}):o.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:l??void 0},children:[n&&o.jsx("div",{className:`slb-title ${c}`,style:{background:h??void 0,color:u??void 0},children:n}),o.jsx("div",{className:"slb-grid",style:I,children:g.map((b,C)=>{const w=s[C]||"";if(Array.isArray(b)){const[_,L]=b;return o.jsxs("div",{className:`slb-row ${w}`,style:{background:p??void 0},children:[o.jsx("div",{className:"slb-grid-left",children:v(_,C,0)}),o.jsx("div",{className:"slb-grid-right",children:v(L,C,1)})]},C)}return o.jsxs("div",{className:`slb-row ${w}`,style:{background:p??void 0},children:[o.jsx("div",{className:"slb-grid-left",children:v(b,C,0)}),o.jsx("div",{className:"slb-grid-right slb-empty-cell","aria-hidden":"true"})]},C)})})]})},wme=({className:e="",style:t={},title:n,titleColor:c,data:i=[],badgeColor:r="#0ea5e9",badgeColors:s={},badgePadding:d="8px 16px",badgeWidth:l,itemBg:h,lineClasses:u={},colGap:p="1rem"})=>{const y=i.some(g=>Array.isArray(g)),f=p?{"--col-gap":p}:void 0;return o.jsxs("div",{className:`clb-root ${e}`,style:{...t},children:[n&&o.jsx("div",{className:"clb-title",style:c?{color:c}:void 0,children:n}),o.jsx("div",{className:"clb-grid",style:f,children:i.map((g,k)=>{const x=u[k]||"";if(Array.isArray(g)){const[M,v]=g,I=s[k]||r;return o.jsxs("div",{className:`clb-row ${x}`,style:{background:h??void 0},children:[o.jsx("div",{className:"clb-badge-col",children:o.jsx("div",{className:"counter-badge",style:{background:I,padding:d,width:l,minWidth:l},children:M})}),o.jsx("div",{className:"clb-text",children:v})]},k)}return y?o.jsxs("div",{className:`clb-row ${x}`,style:{background:h??void 0},children:[o.jsx("div",{className:"clb-badge-col clb-empty-badge"}),o.jsx("div",{className:"clb-text",children:g})]},k):o.jsx("div",{className:`clb-fullrow ${x}`,style:{background:h??void 0},children:o.jsx("span",{children:g})},k)})})]})},Cme=({className:e="",style:t={},title:n,items:c=[],titleBg:i,titleColor:r,itemBg:s,lineClasses:d={},renderTrendIcon:l,colGap:h="1rem"})=>{const u=h?{"--col-gap":h}:void 0;return o.jsxs("div",{className:`tlb-root ${e}`,style:{...t,background:s??void 0},children:[n&&o.jsx("div",{className:"tlb-title",style:{background:i??void 0,color:r??void 0},children:n}),o.jsx("div",{className:"tlb-grid",style:u,children:c.map((p,y)=>{const f=d[y]||"";return o.jsxs("div",{className:`tlb-row ${f}`,style:{background:s??void 0},children:[o.jsx("div",{className:"tlb-label",children:p.label}),o.jsxs("div",{className:"tlb-value-group",children:[o.jsx("div",{className:"tlb-icon-col",children:l?l(p):p.icon??null}),o.jsxs("div",{className:"tlb-value-wrap",children:[o.jsx("div",{className:"tlb-value",children:p.value}),typeof p.delta<"u"&&o.jsx("div",{className:`tlb-delta ${p.delta>0?"positive":p.delta<0?"negative":"neutral"}`,children:p.deltaLabel??String(p.delta)})]})]})]},y)})})]})},Nme=({className:e="",style:t={},children:n,gap:c="1rem"})=>o.jsx("div",{className:`frc-root ${e}`,style:{...t,"--frc-gap":c},children:m.Children.map(n,i=>o.jsx("div",{className:"frc-item",children:i}))}),jme=({className:e="",style:t={},children:n,gap:c="1rem",background:i="#D9EEF5"})=>o.jsx("div",{className:`lcc-root ${e}`,style:{background:i,...t,"--lcc-gap":c},children:m.Children.map(n,r=>o.jsx("div",{className:"lcc-cell",children:r}))}),Sme="_overlay_3x4or_2",$me="_fadeIn_3x4or_1",qme="_popup_3x4or_17",Ame="_slideUp_3x4or_1",zme="_header_3x4or_28",Vme="_body_3x4or_40",Pme="_footer_3x4or_51",Tme="_cancelButton_3x4or_59",Hme="_confirmButton_3x4or_77",Dme="_warning_3x4or_97",Bme="_danger_3x4or_106",Rme="_info_3x4or_115",jt={overlay:Sme,fadeIn:$me,popup:qme,slideUp:Ame,header:zme,body:Vme,footer:Pme,cancelButton:Tme,confirmButton:Hme,warning:Dme,danger:Bme,info:Rme},Fme=({isOpen:e,title:t,message:n,onConfirm:c,onCancel:i,confirmText:r="Confirmer",cancelText:s="Annuler",type:d="warning"})=>{if(!e)return null;const l=u=>{u.target===u.currentTarget&&i()},h=u=>{u.key==="Escape"&&i(),u.key==="Enter"&&u.ctrlKey&&c()};return o.jsx("div",{className:jt.overlay,onClick:l,onKeyDown:h,role:"dialog","aria-labelledby":"confirmation-title","aria-describedby":"confirmation-message",children:o.jsxs("div",{className:`${jt.popup} ${jt[d]}`,children:[o.jsx("div",{className:jt.header,children:o.jsx("h3",{id:"confirmation-title",children:t})}),o.jsx("div",{className:jt.body,children:o.jsx("p",{id:"confirmation-message",children:n})}),o.jsxs("div",{className:jt.footer,children:[o.jsx("button",{className:jt.cancelButton,onClick:i,type:"button",children:s}),o.jsx("button",{className:jt.confirmButton,onClick:c,type:"button",autoFocus:!0,children:r})]})]})})},Eme=()=>{const[e,t]=m.useState({isOpen:!1,title:"",message:"",onConfirm:null}),n=m.useCallback((r,s,d)=>{t({isOpen:!0,title:r,message:s,onConfirm:d})},[]),c=m.useCallback(()=>{t(r=>({...r,isOpen:!1,onConfirm:null}))},[]),i=m.useCallback(()=>{e.onConfirm?.(),c()},[e.onConfirm,c]);return{isOpen:e.isOpen,title:e.title,message:e.message,showConfirmation:n,hideConfirmation:c,handleConfirm:i}},Ome="_container_1l44m_1",Ume="_selectButton_1l44m_7",Wme="_disabled_1l44m_22",Gme="_error_1l44m_39",Kme="_outline_1l44m_52",Zme="_filled_1l44m_58",Xme="_sm_1l44m_67",Yme="_md_1l44m_73",Jme="_lg_1l44m_79",Qme="_buttonContent_1l44m_85",e6e="_label_1l44m_93",t6e="_placeholder_1l44m_103",a6e="_iconsContainer_1l44m_108",n6e="_loadingSpinner_1l44m_115",o6e="_spin_1l44m_1",c6e="_arrowIcon_1l44m_133",i6e="_arrowIconOpen_1l44m_141",r6e="_dropdown_1l44m_146",s6e="_dropdownIn_1l44m_1",d6e="_searchContainer_1l44m_171",l6e="_searchInputWrapper_1l44m_177",h6e="_searchIcon_1l44m_183",u6e="_searchInput_1l44m_177",p6e="_optionsList_1l44m_208",y6e="_noResults_1l44m_231",k6e="_option_1l44m_208",m6e="_optionHighlighted_1l44m_261",f6e="_optionSelected_1l44m_266",g6e="_optionDisabled_1l44m_277",v6e="_optionLabel_1l44m_283",x6e="_checkIcon_1l44m_291",M6e="_widthFull_1l44m_299",_6e="_width64_1l44m_302",L6e="_width80_1l44m_305",I6e="_width96_1l44m_308",de={container:Ome,selectButton:Ume,disabled:Wme,error:Gme,default:"_default_1l44m_48",outline:Kme,filled:Zme,sm:Xme,md:Yme,lg:Jme,buttonContent:Qme,label:e6e,placeholder:t6e,iconsContainer:a6e,loadingSpinner:n6e,spin:o6e,arrowIcon:c6e,arrowIconOpen:i6e,dropdown:r6e,dropdownIn:s6e,searchContainer:d6e,searchInputWrapper:l6e,searchIcon:h6e,searchInput:u6e,optionsList:p6e,noResults:y6e,option:k6e,optionHighlighted:m6e,optionSelected:f6e,optionDisabled:g6e,optionLabel:v6e,checkIcon:x6e,widthFull:M6e,width64:_6e,width80:L6e,width96:I6e},b6e=({options:e,value:t,onChange:n,placeholder:c="Sélectionner une option...",disabled:i=!1,loading:r=!1,error:s=!1,className:d="",size:l="md",variant:h="default",width:u="w-full"})=>{const[p,y]=m.useState(!1),[f,g]=m.useState(""),[k,x]=m.useState(0),[M,v]=m.useState({top:0,left:0,width:0}),I=m.useRef(null),b=m.useRef(null),C=m.useRef(null),w=m.useMemo(()=>f?e.filter(q=>q.label.toLowerCase().includes(f.toLowerCase())):e,[e,f]),_=e.find(q=>q.value===t),L=m.useCallback(()=>{if(I.current){const q=I.current.getBoundingClientRect();v({top:q.top,left:q.left,width:q.width})}},[]);m.useEffect(()=>(p&&(L(),window.addEventListener("scroll",L,!0),window.addEventListener("resize",L)),()=>{window.removeEventListener("scroll",L,!0),window.removeEventListener("resize",L)}),[p,L]),m.useEffect(()=>{const q=$=>{I.current&&!I.current.contains($.target)&&b.current&&!b.current.contains($.target)&&(y(!1),g(""))};return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[]),m.useEffect(()=>{x(0)},[w]);const S=q=>{q.disabled||(n?.(q.value,q),y(!1),g(""))},N=q=>{g(q.target.value),p||y(!0)},j=q=>{if(!p){(q.key==="ArrowDown"||q.key==="Enter")&&y(!0);return}switch(q.key){case"ArrowDown":q.preventDefault(),x($=>$<w.length-1?$+1:$);break;case"ArrowUp":q.preventDefault(),x($=>$>0?$-1:$);break;case"Enter":q.preventDefault(),w[k]&&S(w[k]);break;case"Escape":y(!1),g("");break}},A=()=>[de.selectButton,de[l],de[h],i?de.disabled:"",s?de.error:"",d].filter(Boolean).join(" "),B=()=>{switch(u){case"w-64":return de.width64;case"w-80":return de.width80;case"w-96":return de.width96;default:return de.widthFull}},D=(q,$)=>[de.option,$===k?de.optionHighlighted:"",q.value===t?de.optionSelected:"",q.disabled?de.optionDisabled:""].filter(Boolean).join(" "),V={position:"fixed",top:M.top+(I.current?.offsetHeight||0)+4,left:M.left,width:M.width,zIndex:9999};return o.jsxs("div",{className:`${de.container} ${B()}`,children:[o.jsx("button",{ref:I,className:A(),onClick:()=>!i&&y(!p),onKeyDown:j,tabIndex:i?-1:0,type:"button","aria-haspopup":"listbox","aria-expanded":p,disabled:i,children:o.jsxs("div",{className:de.buttonContent,children:[o.jsx("span",{className:`${de.label} ${_?"":de.placeholder}`,children:_?_.label:c}),o.jsxs("div",{className:de.iconsContainer,children:[r&&o.jsx("div",{className:de.loadingSpinner}),o.jsx("svg",{className:`${de.arrowIcon} ${p?de.arrowIconOpen:""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]})}),p&&mw.createPortal(o.jsxs("div",{className:`${de.dropdown} ${B()}`,style:V,ref:b,children:[o.jsx("div",{className:de.searchContainer,children:o.jsxs("div",{className:de.searchInputWrapper,children:[o.jsx("svg",{className:de.searchIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),o.jsx("input",{ref:C,type:"text",value:f,onChange:N,placeholder:"Rechercher...",className:de.searchInput,autoFocus:!0})]})}),o.jsx("div",{className:de.optionsList,children:w.length===0?o.jsx("div",{className:de.noResults,children:"Aucun résultat trouvé"}):o.jsx("ul",{role:"listbox",children:w.map((q,$)=>o.jsx("li",{className:D(q,$),onClick:()=>S(q),onMouseEnter:()=>x($),role:"option","aria-selected":q.value===t,"aria-disabled":q.disabled,children:o.jsxs("div",{className:de.buttonContent,children:[o.jsx("span",{className:de.optionLabel,title:q.label,children:q.label}),q.value===t&&o.jsx("svg",{className:de.checkIcon,fill:"currentColor",viewBox:"0 0 20 20",children:o.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})]})},q.value))})})]}),document.body)]})},w6e="_container_uq7pt_1",C6e="_item_uq7pt_7",N6e="_mainValue_uq7pt_13",j6e="_label_uq7pt_17",S6e="_subValue_uq7pt_22",$6e="_subValueWrapper_uq7pt_27",q6e="_subSeparator_uq7pt_32",Ze={container:w6e,item:C6e,mainValue:N6e,label:j6e,subValue:S6e,subValueWrapper:$6e,subSeparator:q6e},A6e=({dms:e,stats:t=[],itemWidth:n="120px",valueFontSize:c="28px",valueFontWeight:i=700,subFontSize:r="16px",subFontWeight:s=600,backgroundColor:d="#ffffff",labelColor:l="#6b7280",valueColor:h="#000000"})=>{const u=(p,y,f)=>{const[g,k]=p.split("/").map(x=>x.trim());return o.jsxs("span",{className:Ze.subValueWrapper,children:[o.jsx("span",{className:Ze.subLeft,style:{color:y},children:g}),o.jsx("span",{className:Ze.subSeparator,children:" / "}),o.jsx("span",{className:Ze.subRight,style:{color:f},children:k})]})};return o.jsxs("div",{className:Ze.container,style:{backgroundColor:d},children:[e&&o.jsxs("div",{className:Ze.item,style:{flex:`1 1 ${n}`},children:[o.jsx("div",{className:Ze.mainValue,style:{fontSize:c,fontWeight:i,color:h},children:e}),o.jsx("div",{className:Ze.label,style:{color:l},children:"DMS"})]}),t.map((p,y)=>o.jsxs("div",{className:Ze.item,style:{flex:`1 1 ${n}`},children:[o.jsx("div",{className:Ze.mainValue,style:{fontSize:c,fontWeight:i,color:h},children:p.value}),o.jsx("div",{className:Ze.label,style:{color:l},children:p.label}),o.jsx("div",{className:Ze.subValue,style:{fontSize:r,fontWeight:s},children:p.subValue&&u(p.subValue,p.subLeftColor,p.subRightColor)})]},y))]})},z6e="_encours_16ist_1",V6e="_header_16ist_19",P6e="_iconWrap_16ist_27",T6e="_title_16ist_36",H6e="_items_16ist_47",D6e="_spaceEvenly_16ist_56",B6e="_item_16ist_47",R6e="_valueContainer_16ist_86",F6e="_value_16ist_86",E6e="_label_16ist_108",rt={encours:z6e,header:V6e,iconWrap:P6e,title:T6e,items:H6e,spaceEvenly:D6e,item:B6e,valueContainer:R6e,value:F6e,label:E6e},qc=e=>typeof e=="number"?`${e}px`:typeof e=="string"?e:void 0;function O6e(e,t){const n={},c={};return e.valueColor&&(n.color=e.valueColor),e.valueFontSize!==void 0?n.fontSize=qc(e.valueFontSize):t.defaultValueFontSize!==void 0&&(n.fontSize=qc(t.defaultValueFontSize)),e.valueFontWeight!==void 0?n.fontWeight=e.valueFontWeight:t.defaultValueFontWeight!==void 0&&(n.fontWeight=t.defaultValueFontWeight),e.labelColor&&(c.color=e.labelColor),e.labelFontSize!==void 0?c.fontSize=qc(e.labelFontSize):t.defaultLabelFontSize!==void 0&&(c.fontSize=qc(t.defaultLabelFontSize)),e.labelFontWeight!==void 0?c.fontWeight=e.labelFontWeight:t.defaultLabelFontWeight!==void 0&&(c.fontWeight=t.defaultLabelFontWeight),{valueStyle:n,labelStyle:c}}function U6e(){return o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.4"}),o.jsx("path",{d:"M8 12h8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function W6e(e){const{title:t,titleColor:n,titleFontSize:c,titleFontWeight:i,icon:r,iconSize:s=18,iconColor:d,defaultValueFontSize:l,defaultValueFontWeight:h,defaultLabelFontSize:u,defaultLabelFontWeight:p,data:y,style:f,bg:g="#ffffff",width:k,gap:x,className:M,ariaLabel:v}=e,I=r?xt[r]:void 0,b={background:g,width:qc(k),...f},C={};n&&(C.color=n),c!==void 0&&(C.fontSize=qc(c)),i!==void 0&&(C.fontWeight=i);const w={};return d&&(w.color=d),o.jsxs("section",{className:`${rt.encours} ${M??""}`,style:b,"aria-label":v??t,children:[o.jsxs("div",{className:rt.header,children:[o.jsx("div",{className:rt.iconWrap,"aria-hidden":!0,style:w,children:I?o.jsx(I,{size:typeof s=="number"?s:void 0}):o.jsx(U6e,{})}),o.jsx("div",{className:rt.title,style:C,children:t})]}),o.jsx("div",{className:`${rt.items} ${x===void 0?rt.spaceEvenly:""}`,role:"list",style:x!==void 0?{gap:`${x}px`}:{},children:y.map((_,L)=>{const{valueStyle:S,labelStyle:N}=O6e(_,{defaultValueFontSize:l,defaultValueFontWeight:h,defaultLabelFontSize:u,defaultLabelFontWeight:p});return o.jsx("div",{className:rt.item,role:"listitem",style:{..._.background?{background:_.background}:{},..._.width?{width:qc(_.width)}:{}},children:o.jsxs("div",{className:rt.valueContainer,children:[o.jsx("div",{className:rt.value,style:S,children:_.value}),_.label&&o.jsx("div",{className:rt.label,style:N,children:_.label})]})},`${String(_.label??_.value)}-${L}`)})})]})}const G6e=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},Q.createElement("path",{d:"M480-360 280-559h400z"})),K6e=m.memo(G6e),Z6e=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},Q.createElement("path",{d:"m280-400 200-201 200 201z"})),X6e=m.memo(Z6e),Y6e=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16",...e},Q.createElement("path",{fill:"#0087BD",d:"M3 14a.96.96 0 0 1-.7-.3.96.96 0 0 1-.3-.7V3q0-.4.3-.7T3 2h10q.4 0 .7.3t.3.7v10q0 .4-.3.7t-.7.3zm3.983-3.55q.1 0 .192-.033a.36.36 0 0 0 .158-.117l4.117-4.133q.15-.15.15-.35a.54.54 0 0 0-.15-.367.52.52 0 0 0-.358-.133.5.5 0 0 0-.359.15l-3.75 3.75L5.35 7.583a.48.48 0 0 0-.7 0q-.15.15-.15.367 0 .216.15.35l1.983 2a.48.48 0 0 0 .35.15"})),J6e=m.memo(Y6e),Q6e=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16",...e},Q.createElement("path",{fill:"#1E2122",d:"M3 14a.96.96 0 0 1-.7-.3.96.96 0 0 1-.3-.7V3q0-.4.3-.7T3 2h10q.4 0 .7.3t.3.7v10q0 .4-.3.7t-.7.3zm0-1h10V3H3z"})),efe=m.memo(Q6e),tfe=({items:e,onSave:t,loading:n,disabled:c,saveLabel:i,savingLabel:r,buttonTitle:s,size:d=16,colors:l={bg:"#DADADA",activeBg:"var(--color-primary)",circle:"#FFFFFF",icon:"#1C1B1F",icon2:"#FFFFFF"},style:h,a11yConfig:u})=>{const[p,y]=m.useState(!1),[f,g]=m.useState(e),[k,x]=m.useState(!1);if(m.useEffect(()=>{x(!0)},[]),m.useEffect(()=>{g(e)},[e]),!k)return null;const M=(b,C)=>{C<4||g(w=>w.map(_=>_.component_key===b?{..._,visible:!_.visible}:_))},v=()=>{t(f),y(!1)},I=Z(u,s);return o.jsxs("div",{style:{position:"relative",display:"inline-block",...h},children:[o.jsxs("div",{onClick:()=>{c||y(!p)},style:{display:"flex",alignItems:"center",cursor:c?"not-allowed":"pointer",borderRadius:4,transition:"background 0.2s"},title:I,children:[o.jsx(JS,{width:d,height:d,fill:l?.icon||"currentColor",style:{transition:"color 0.2s"}}),p?o.jsx(X6e,{width:d,height:d,fill:l?.icon||"currentColor"}):o.jsx(K6e,{width:d,height:d,fill:l?.icon||"currentColor"})]}),p&&o.jsxs("div",{style:{position:"absolute",top:"120%",right:0,minWidth:260,background:"#fff",borderRadius:"0.25rem",boxShadow:"0px 3px 7px 0px rgba(17, 20, 21, 0.05),0px 14px 14px 0px rgba(17, 20, 21, 0.04),0px 30px 18px 0px rgba(17, 20, 21, 0.03), 0px 54px 22px 0px rgba(17, 20, 21, 0.01),0px 85px 24px 0px rgba(17, 20, 21, 0)",zIndex:235465456,padding:"0 0 0.5rem 0"},children:[o.jsx("ul",{style:{listStyle:"none",padding:0,margin:0},children:f.map((b,C)=>o.jsxs(m.Fragment,{children:[o.jsxs("li",{onClick:()=>M(b.component_key,C),style:{display:"flex",alignItems:"center",padding:"0.5rem",cursor:C<4?"not-allowed":"pointer",transition:"background 0.2s"},onMouseEnter:w=>{C>=4&&(w.currentTarget.style.background="#F9FAFB")},onMouseLeave:w=>{C>=4&&(w.currentTarget.style.background="transparent")},children:[o.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",marginRight:8,flexShrink:0},children:b.visible?o.jsx(J6e,{width:20,height:20,fill:l?.activeBg||"var(--color-primary, #008FBB)"}):o.jsx(efe,{width:20,height:20,fill:"#D1D5DB"})}),o.jsx("span",{style:{fontSize:"14px",color:"#111827",fontWeight:400,userSelect:"none"},children:b.label})]}),C===3&&o.jsx("div",{style:{height:1,background:"#E5E7EB",margin:"4px 0"}})]},b.component_key))}),o.jsx("div",{style:{padding:"12px 16px 0 16px",display:"flex",justifyContent:"flex-end"},children:o.jsx("button",{type:"button",onClick:v,disabled:n,style:{padding:"6px 16px",borderRadius:4,border:"none",background:"var(--color-primary, #008FBB)",color:"#fff",fontSize:"14px",fontWeight:500,cursor:n?"not-allowed":"pointer",transition:"opacity 0.2s",opacity:n?.7:1},children:n?r:i})})]})]})},afe="_container_zhny9_1",nfe="_card_zhny9_15",ofe="_footer_zhny9_33",cfe="_noPaddingMobile_zhny9_51",ri={container:afe,card:nfe,footer:ofe,noPaddingMobile:cfe},ife="_board_95t8m_1",rfe="_clickable_95t8m_21",sfe="_sideBar_95t8m_26",dfe="_boardContent_95t8m_32",lfe="_orange_95t8m_40",hfe="_red_95t8m_44",ufe="_green_95t8m_48",pfe="_grey_95t8m_52",yfe="_lightGrey_95t8m_56",kfe="_big_95t8m_61",mfe="_medium_95t8m_66",ffe="_headerRow_95t8m_70",gfe="_iconWrapper_95t8m_75",vfe="_headerTitle_95t8m_80",xfe="_valueArea_95t8m_89",Mfe="_titleWhite_95t8m_99",_fe="_titleBlack_95t8m_103",Lfe="_valueWhite_95t8m_108",Ife="_valueBlack_95t8m_112",bfe="_valueBlue_95t8m_116",wfe="_bars_95t8m_121",Cfe="_bar_95t8m_121",Nfe="_barDark_95t8m_135",jfe="_barDim_95t8m_139",Sfe="_predictionSection_95t8m_143",$fe="_predictionHeader_95t8m_155",qfe="_predictionBody_95t8m_162",Afe="_hasPrediction_95t8m_170",ze={board:ife,clickable:rfe,sideBar:sfe,boardContent:dfe,orange:lfe,red:hfe,green:ufe,grey:pfe,lightGrey:yfe,big:kfe,medium:mfe,headerRow:ffe,iconWrapper:gfe,headerTitle:vfe,valueArea:xfe,titleWhite:Mfe,titleBlack:_fe,valueWhite:Lfe,valueBlack:Ife,valueBlue:bfe,bars:wfe,bar:Cfe,barDark:Nfe,barDim:jfe,predictionSection:Sfe,predictionHeader:$fe,predictionBody:qfe,hasPrediction:Afe},zfe=({endingDark:e=!1,lightCount:t=5,className:n=""})=>{const c=Math.max(0,Math.min(5,Math.floor(t)));return o.jsx("div",{className:`${ze.bars} ${n} bars-data-board`,children:Array.from({length:5}).map((i,r)=>o.jsx("span",{className:`${ze.bar} ${r<c?"":e?ze.barDark:ze.barDim}`},r))})},vt=({a11yConfig:e,iconName:t,label:n,value:c,backgroundColor:i="green",bars:r,lightBars:s=5,size:d="big",valueScale:l,width:h,height:u,className:p="",style:y,titleColor:f="white",valueColor:g="white",titleFontSize:k,titleFontWeight:x,valueFontSize:M,valueFontWeight:v,barColor:I,justifyContent:b="space-between",alignItems:C="flex-start",cardGap:w="",onClick:_,iconColor:L,titleKey:S,predictionValue:N,predictionLabel:j})=>{const A=r!=="none",B=r==="endingDark",{padding:D,...V}=y||{},q=h===void 0&&u===void 0&&i===void 0&&Object.keys(V).length===0?void 0:{...h!==void 0?{width:h}:{},...u!==void 0?{height:u}:{},...i!==void 0?{backgroundColor:i}:{},...V},$=`${ze.board} ${ze[d]} ${N!==void 0?ze.hasPrediction:""} ${p}`;return o.jsxs("div",{className:$,onClick:_,style:l!==void 0?{...q,"--ds-value-scale":l}:q,children:[I&&o.jsx("div",{className:ze.sideBar,style:{backgroundColor:I}}),o.jsxs("div",{className:ze.boardContent,style:{padding:D,gap:w},children:[o.jsxs("div",{className:ze.headerRow,style:{justifyContent:b,alignItems:C},children:[t&&o.jsx("div",{className:ze.iconWrapper,style:{color:L},children:t}),o.jsx("div",{className:`${ze.headerTitle} header-title-data-board`,children:o.jsx("span",{title:Z(e,S),"aria-label":e?.description,style:{color:f,...k?{fontSize:k}:{},...x?{fontWeight:x}:{}},children:n})}),A?o.jsx(zfe,{endingDark:B,lightCount:s}):null]}),o.jsx("div",{className:ze.valueArea,style:{color:g,...M?{fontSize:M}:{},...v?{fontWeight:v}:{}},children:c})]}),N!==void 0&&o.jsxs("div",{className:ze.predictionSection,children:[o.jsx("div",{className:ze.predictionHeader,children:j??"PRED."}),o.jsx("div",{className:ze.predictionBody,children:N})]})]})},Vfe="_wrapper_1ydle_10",Pfe="_hosp_1ydle_19",Tfe="_headerRow_1ydle_54",Hfe="_iconWrapper_1ydle_61",Dfe="_headerTitle_1ydle_67",Bfe="_hospValue_1ydle_76",Rfe="_side_1ydle_88",Ffe="_mini_1ydle_100",Efe="_miniLabel_1ydle_131",Ofe="_miniValue_1ydle_140",Ufe="_miniBars_1ydle_150",Wfe="_bars_1ydle_155",Gfe="_bar_1ydle_155",Kfe="_barDark_1ydle_169",Zfe="_barDim_1ydle_173",Pe={wrapper:Vfe,hosp:Pfe,headerRow:Tfe,iconWrapper:Hfe,headerTitle:Dfe,hospValue:Bfe,side:Rfe,mini:Ffe,miniLabel:Efe,miniValue:Ofe,miniBars:Ufe,bars:Wfe,bar:Gfe,barDark:Kfe,barDim:Zfe},Xfe=({endingDark:e=!1,lightCount:t=5,className:n=""})=>{const c=Math.max(0,Math.min(5,Math.floor(t)));return o.jsx("div",{className:`${Pe.bars} ${n} bars-data-board`,children:Array.from({length:5}).map((i,r)=>o.jsx("span",{className:`${Pe.bar} ${r<c?"":e?Pe.barDark:Pe.barDim}`},r))})},gA=({left:e,right:t,className:n="",style:c,miniTilesCount:i=3})=>{const r=e.bars??"endingDark",s=r!=="none",d=r==="endingDark",l={...c,"--mini-tiles-count":i};return o.jsxs("div",{className:`${Pe.wrapper} ${n} data-four-boards`,style:l,children:[o.jsxs("div",{className:`${Pe.hosp} ${e.className||""}`,onClick:e.onClick,style:{...e.width?{width:e.width}:{},...e.height?{height:e.height}:{},...e.backgroundColor?{backgroundColor:e.backgroundColor}:{},...e.style||{}},title:Z(e.a11yConfig,e.titleKey),children:[o.jsxs("div",{className:Pe.headerRow,children:[o.jsxs("div",{className:`${Pe.iconWrapper} icon-wrapper-data-four-boards`,children:[e.iconName&&o.jsx("span",{style:{color:e.iconColor},children:e.iconName}),o.jsx("span",{className:Pe.headerTitle,style:{color:e.titleColor||"white",...e.titleFontSize?{fontSize:e.titleFontSize}:{},...e.titleFontWeight?{fontWeight:e.titleFontWeight}:{}},title:Z(e.a11yConfig,e.titleKey),children:e.label})]}),s?o.jsx(Xfe,{endingDark:d,lightCount:e.lightBars??5}):null]}),o.jsx("div",{className:Pe.hospValue,style:{color:e.valueColor||"white",...e.valueScale!==void 0?{"--ds-value-scale":e.valueScale}:{},...e.valueFontSize?{fontSize:e.valueFontSize}:{},...e.valueFontWeight?{fontWeight:e.valueFontWeight}:{}},children:e.value})]}),o.jsx("div",{className:Pe.side,children:t.map((h,u)=>o.jsxs("div",{className:`${Pe.mini} ${h.className||""} icon-wrapper-data-four-boards`,onClick:h.onClick,style:{...h.width?{width:h.width}:{},...h.height?{height:h.height}:{},...h.backgroundColor?{backgroundColor:h.backgroundColor}:{},...h.style||{}},title:Z(h.a11yConfig,h.titleKey),children:[o.jsxs("span",{className:Pe.miniLabel,style:{color:h.titleColor||"white",textAlign:"right",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",...h.titleFontSize?{fontSize:h.titleFontSize}:{},...h.titleFontWeight?{fontWeight:h.titleFontWeight}:{}},title:Z(h.a11yConfig,h.titleKey),children:[h.iconName&&o.jsx("span",{style:{color:h.iconColor},children:h.iconName}),h.label]}),o.jsx("span",{className:`${Pe.miniValue} mini-value-data-four-boards`,style:{color:h.valueColor||"white",textAlign:"right",...h.valueScale!==void 0?{"--ds-value-scale":h.valueScale}:{},...h.valueFontSize?{fontSize:h.valueFontSize}:{},...h.valueFontWeight?{fontWeight:h.valueFontWeight}:{}},children:h.value}),o.jsx("div",{className:Pe.miniBars})]},h.id??`${h.label}-${u}`))})]})},Yfe=({items:e,footerLabel:t,width:n,height:c,size:i=320,style:r,className:s="",backgroundColor:d,titleFontSize:l,titleFontWeight:h,valueFontSize:u,valueFontWeight:p,noPaddingLeftRight:y=!1,onItemClick:f})=>{const g={width:n??i,height:c,backgroundColor:d??"var(--ds-navy)",...r},k=e[0],x=e[1],M=e.slice(2,5);return o.jsxs("div",{style:g,className:`${ri.container} ${y?ri.noPaddingMobile:""} ${s}`,children:[o.jsxs("div",{className:ri.card,children:[k?o.jsx(vt,{a11yConfig:k.a11yConfig,label:k.label,value:k.value,backgroundColor:k.backgroundColor,bars:k.bars,lightBars:k.lightBars,size:k.size??"big",valueScale:k.valueScale,width:k.width,height:k.height,titleColor:"white",valueColor:"white",titleFontSize:k.titleFontSize??l,titleFontWeight:k.titleFontWeight??h,valueFontSize:k.valueFontSize??u,valueFontWeight:k.valueFontWeight??p,titleKey:k.titleKey,onClick:v=>f?.(0,v)}):null,x&&M.length>0?o.jsx(gA,{left:{a11yConfig:x.a11yConfig,id:x.id,label:x.label,value:x.value,backgroundColor:x.backgroundColor,bars:x.bars,lightBars:x.lightBars,valueScale:x.valueScale,width:x.width,height:x.height,titleFontSize:x.titleFontSize??l,titleFontWeight:x.titleFontWeight??h,valueFontSize:x.valueFontSize??u,valueFontWeight:x.valueFontWeight??p,titleKey:x.titleKey,onClick:v=>f?.(1,v)},right:M.map((v,I)=>({a11yConfig:v.a11yConfig,id:v.id,label:v.label,value:v.value,backgroundColor:v.backgroundColor,bars:v.bars,lightBars:v.lightBars,valueScale:v.valueScale,width:v.width,height:v.height,titleFontSize:v.titleFontSize??l,titleFontWeight:v.titleFontWeight??h,valueFontSize:v.valueFontSize??u,valueFontWeight:v.valueFontWeight??p,titleKey:v.titleKey,onClick:b=>f?.(2+I,b)}))}):x&&M.length===0?o.jsx(vt,{a11yConfig:x.a11yConfig,label:x.label,value:x.value,backgroundColor:x.backgroundColor,bars:x.bars,lightBars:x.lightBars,size:x.size??"big",valueScale:x.valueScale,width:x.width,height:x.height,titleColor:"white",valueColor:"white",titleFontSize:x.titleFontSize??l,titleFontWeight:x.titleFontWeight??h,valueFontSize:x.valueFontSize??u,valueFontWeight:x.valueFontWeight??p,onClick:v=>f?.(1,v)}):null]}),t&&o.jsx("div",{className:ri.footer,children:t})]})},Jfe=({x:e,y:t,width:n,payload:c,fontSize:i,fontWeight:r,stroke:s})=>o.jsx("g",{transform:`translate(${e},${t})`,children:o.jsx("foreignObject",{x:-n,y:-35,width:n,height:70,style:{overflow:"visible"},children:o.jsx("div",{style:{fontSize:i,fontWeight:r,color:s,lineHeight:"1.2",display:"flex",justifyContent:"flex-end",textAlign:"right",alignItems:"center",height:"100%",width:"100%",paddingRight:"8px",boxSizing:"border-box"},children:o.jsx("span",{style:{overflowWrap:"break-word",whiteSpace:"normal",display:"block",maxWidth:"100%"},children:c.value})})})}),Qfe=({data:e,height:t=360,barColor:n="#0284C7",tooltipEnabled:c=!0,backgroundColor:i="transparent",legendTextColor:r="var(--color-text)",barHeight:s=40,yAxisWidth:d=120,fontSize:l="12px",fontWeight:h="400",domain:u,xAxisLabel:p,margin:y={top:20,right:60,bottom:40,left:0},valueFormatter:f,tickFormatter:g,labelDataKey:k="percentage"})=>{const x=(y.top??20)+(y.bottom??40)+e.length*(s+20),M=Math.max(x,t),v=m.useMemo(()=>{if(!e||e.length===0)return d;const _=(parseFloat(l)||12)*.7,S=Math.max(...e.map(N=>(N.label||"").length))*_+16;return Math.min(Math.max(S,40),d)},[e,l,d]),I=w=>g?g(w):w?.toString()||"",b=w=>f&&k==="value"?f(w):w==null||w===""?"":k==="percentage"?`${w}%`:w.toString(),C=(w,_,L)=>{if(typeof w!="number")return w;const S=f?f(w):w.toString(),N=L?.payload?.percentage;return typeof N=="number"&&Number.isFinite(N)&&k==="percentage"?`${S} (${N.toFixed(1)}%)`:S};return o.jsx("div",{style:{backgroundColor:i,width:"100%"},children:o.jsx(a.ResponsiveContainer,{width:"100%",height:M,children:o.jsxs(a.BarChart,{data:e,layout:"vertical",margin:y,children:[o.jsx(a.CartesianGrid,{opacity:.4,stroke:"#E5E7EB",vertical:!1,horizontal:!0}),o.jsx(a.XAxis,{type:"number",domain:u||[0,"auto"],axisLine:!1,tickLine:!1,fontSize:l,fontWeight:h,stroke:r,tickFormatter:I,label:p?{value:p,position:"insideBottom",offset:-10,style:{textAnchor:"middle",fill:r,fontSize:12,fontWeight:"500"}}:void 0}),o.jsx(a.YAxis,{type:"category",dataKey:"label",stroke:r,axisLine:!1,tickLine:!1,width:v,interval:0,fontSize:l,fontWeight:h,tick:o.jsx(Jfe,{fontSize:l,fontWeight:h,stroke:r})}),c&&o.jsx(a.Tooltip,{formatter:C,labelStyle:{color:"var(--color-text)"}}),o.jsx(a.Bar,{dataKey:"value",fill:n,radius:0,barSize:s,children:o.jsx(a.LabelList,{dataKey:k,position:"right",offset:10,formatter:b,fill:r,fontSize:l,fontWeight:h})})]})})})},e8e="_menu_10i6j_1",t8e="_menuRow_10i6j_18",a8e="_separator_10i6j_33",n8e="_rowLabel_10i6j_39",o8e="_rowLeadingIcon_10i6j_47",c8e="_rowIcon_10i6j_54",Gc={menu:e8e,menuRow:t8e,separator:a8e,rowLabel:n8e,rowLeadingIcon:o8e,rowIcon:c8e},i8e=m.forwardRef(function({isVisible:t,onClose:n,items:c,style:i,position:r,bg:s},d){const l=m.useRef(null),h=d||l;if(m.useEffect(()=>{if(!t)return;const y=f=>{h.current&&!h.current.contains(f.target)&&n?.()};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[t,n]),!t)return null;const p={...{top:r?.top,left:r?.left,right:r?.right,bottom:r?.bottom},...s&&{backgroundColor:s},...i};return o.jsx("div",{ref:h,role:"menu",className:Gc.menu,style:p,children:c.map(y=>{if(y.type==="separator")return o.jsx("hr",{className:Gc.separator},y.id);const f=y,g=f.color?{color:f.color}:{},k=f.closeOnClick!==!1;return o.jsxs("button",{role:"menuitem",className:Gc.menuRow,style:g,onClick:()=>{f.onClick?.(),k&&n?.()},children:[o.jsxs("span",{className:Gc.rowLabel,children:[f.leadingIcon&&o.jsx("span",{className:Gc.rowLeadingIcon,children:f.leadingIcon}),o.jsx("span",{children:f.label})]}),f.icon&&o.jsx("span",{className:Gc.rowIcon,children:f.icon})]},f.id)})})}),vA=({user:e,logoutHref:t,logoutTarget:n="_self",onLogout:c,profileHref:i,profileLinkTarget:r="_self",backgroundColor:s="transparent",textColor:d="inherit",roleColor:l="#888",avatarSize:h="32px",padding:u="10px",gap:p="12px",emailFontSize:y="14px",emailFontWeight:f=600,roleFontSize:g="12px",roleFontWeight:k,avatarColor:x="#5b8fb9",backgroundColorAvatar:M="#f1f4f5",dropdownMenuItems:v,dropdownMenuStyle:I,dropdownMenuOffset:b,statusDotColor:C,a11yConfig:w,style:_,className:L=""})=>{const{user:S}=yt(),N=e||S,{currentTheme:j,switchTheme:A}=ML(),B=m.useRef(null),D=m.useRef(null),[V,q]=m.useState(!1),[$,H]=m.useState({}),R=m.useMemo(()=>{const ee=[],te=({variant:pe})=>pe==="sun"?o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("circle",{cx:"12",cy:"12",r:"4"})}):o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})});i&&(ee.push({id:"profile",type:"action",label:"Mon profil",onClick:()=>{typeof window>"u"||(r==="_blank"?window.open(i,"_blank","noopener,noreferrer"):window.location.assign(i))}}),ee.push({id:"sep-profile",type:"separator"}));const re=j==="dark";return ee.push({id:"theme",type:"action",label:re?"Mode clair":"Mode sombre",icon:o.jsx(te,{variant:re?"sun":"moon"}),onClick:()=>{A(re?"light":"dark")}}),(t||c)&&(ee.push({id:"sep-theme",type:"separator"}),ee.push({id:"logout",type:"action",label:"Se déconnecter",danger:!0,onClick:()=>{if(t){if(typeof window>"u")return;n==="_blank"?window.open(t,"_blank","noopener,noreferrer"):window.location.assign(t);return}c?.()}})),ee},[j,t,n,c,i,r,A]),z=v??R,O=()=>{if(!B.current){q(ee=>!ee);return}if(!V){const ee=B.current.getBoundingClientRect(),te=window.innerWidth,re=window.innerHeight,pe=200,se=200,G=4,K=b?.x??0,oe=b?.y??0,qe=te-ee.right>=pe+G;H(qe?{top:ee.bottom-se+oe,left:ee.right+G+K}:{bottom:re-ee.top+oe,left:ee.left+K})}q(ee=>!ee)};if(m.useEffect(()=>{if(!V||!B.current)return;const ee=()=>{const te=B.current.getBoundingClientRect(),re=window.innerWidth,pe=window.innerHeight,se=200,G=200,K=4,oe=b?.x??0,Ne=b?.y??0,ve=re-te.right>=se+K;H(ve?{top:te.bottom-G+Ne,left:te.right+K+oe}:{bottom:pe-te.top+Ne,left:te.left+oe})};return window.addEventListener("resize",ee),window.addEventListener("orientationchange",ee),()=>{window.removeEventListener("resize",ee),window.removeEventListener("orientationchange",ee)}},[V,b]),m.useEffect(()=>{if(!V||!B.current||!D.current)return;const ee=()=>{const re=B.current.getBoundingClientRect(),pe=D.current.getBoundingClientRect(),se=b?.x??0,G=b?.y??0;H(K=>K.left!==void 0&&K.top!==void 0&&K.left>=re.right-1?{top:re.bottom-pe.height+G,left:K.left+se}:K)},te=requestAnimationFrame(()=>{setTimeout(ee,0)});return()=>cancelAnimationFrame(te)},[V,b]),!N)return null;const X=N,ie=parseInt(h,10)||40,ae=`${ie*.375}px`,fe=`${ie*1.375}px`,le=`${ie*.2}px`,be=`${ie*.6}px`,ne=()=>{const ee=parseInt(h,10)||40,te=Math.max(8,ee*.34375),re=Math.max(2,ee*.05);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{position:"relative",flexShrink:0,userSelect:"none"},children:[X.image?o.jsx("img",{src:X.image,alt:`${X.prenom} ${X.nom}`,style:{width:h,height:h,borderRadius:"50%",objectFit:"cover",userSelect:"none"}}):o.jsxs("div",{style:{width:h,height:h,position:"relative",borderRadius:"50%",backgroundColor:M,overflow:"hidden",userSelect:"none"},children:[o.jsx("div",{style:{width:ae,height:ae,borderRadius:"50%",backgroundColor:x,position:"absolute",top:le,left:"50%",transform:"translateX(-50%)",zIndex:2,userSelect:"none"}}),o.jsx("div",{style:{width:fe,height:fe,borderRadius:"50%",backgroundColor:x,position:"absolute",top:be,left:"50%",transform:"translateX(-50%)",zIndex:1,userSelect:"none"}})]}),C&&o.jsx("div",{style:{position:"absolute",bottom:re,right:re,width:`${te}px`,height:`${te}px`,borderRadius:"50%",backgroundColor:C,border:"2px solid white",zIndex:10}})]}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",minWidth:0,flex:1},children:[o.jsx("span",{style:{fontWeight:f,fontSize:y,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:X.email,children:X.email}),o.jsx("span",{style:{color:l,fontSize:g,fontWeight:k,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:X.role,children:X.role})]})]})};return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:B,className:`user-info ${L}`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:u,backgroundColor:s,gap:p,color:d,width:"100%",boxSizing:"border-box",cursor:"pointer",userSelect:"none",..._},onClick:O,title:Z(w,X.role),role:"button",tabIndex:0,children:o.jsx("div",{style:{display:"flex",alignItems:"center",gap:p,flex:1,minWidth:0},children:o.jsx(ne,{})})}),o.jsx(i8e,{ref:D,isVisible:V,onClose:()=>q(!1),items:z,style:I,position:$})]})},r8e="_navItem_16uqf_1",s8e="_label_16uqf_14",d8e="_icon_16uqf_26",m1={navItem:r8e,label:s8e,icon:d8e},aC=({label:e,labelKey:t,onClick:n,href:c,isActive:i,icon:r,style:s,className:d="",highlightColor:l="#00aec7",color:h="#333",activeColor:u="#00aec7",highlightBackgroundColor:p="rgba(0, 0, 0, 0.05)",fontSize:y="15px",fontWeight:f="500",sidebarCollapsed:g=!1,padding:k="10px 16px",borderWidth:x="4px",iconGap:M="12px",disabled:v=!1,disabledColor:I,a11yConfig:b})=>{const C=()=>{v||n?.()},w=o.jsxs(o.Fragment,{children:[r&&o.jsx("span",{className:m1.icon,style:{marginRight:g?0:M},children:r}),!g&&o.jsx("span",{className:m1.label,children:e})]}),_=()=>{if(!i)return"transparent";const S=N=>{const j=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(N);return j?{r:parseInt(j[1],16),g:parseInt(j[2],16),b:parseInt(j[3],16)}:null};if(l.startsWith("#")){const N=S(l);if(N)return`rgba(${N.r}, ${N.g}, ${N.b}, 0.08)`}else if(l.startsWith("rgb")){const N=l.match(/\d+/g);if(N&&N.length>=3)return`rgba(${N[0]}, ${N[1]}, ${N[2]}, 0.08)`}return p},L={onClick:C,className:`${m1.navItem} ${i?m1.active:""} ${d} ${v?m1.disabled:""}`,style:{padding:k,color:i?u:v?I||"#999":h,borderLeft:i?`${x} solid ${l}`:`${x} solid transparent`,backgroundColor:_(),fontSize:y,fontWeight:f,cursor:v?"not-allowed":"pointer",textDecoration:"none",...s},"aria-disabled":v};return c&&!n&&!v?o.jsx("a",{href:c,...L,title:Z(b,t),children:w}):o.jsx("div",{...L,role:n?"button":void 0,tabIndex:n&&!v?0:void 0,title:Z(b,t),children:w})},l8e="_navbar_y5tex_1",h8e="_topSection_y5tex_9",u8e="_logoContainer_y5tex_14",p8e="_collapseToggle_y5tex_20",y8e="_collapsedRail_y5tex_37",k8e="_collapsedToggle_y5tex_44",m8e="_sectionsContainer_y5tex_67",f8e="_sectionTitle_y5tex_73",g8e="_sectionItems_y5tex_78",v8e="_bottomSection_y5tex_83",x8e="_versionContainer_y5tex_102",Xe={navbar:l8e,topSection:h8e,logoContainer:u8e,collapseToggle:p8e,collapsedRail:y8e,collapsedToggle:k8e,sectionsContainer:m8e,sectionTitle:f8e,sectionItems:g8e,bottomSection:v8e,versionContainer:x8e},M8e=({logoProps:e,logoSpacing:t,navItems:n,padding:c="24px 16px",sectionSpacing:i="32px",itemSpacing:r="4px",backgroundColor:s="#fff",highlightColor:d="#00aec7",highlightBackgroundColor:l="rgba(0, 0, 0, 0.05)",version:h,navSectionStyle:u,navLinkStyle:p,navItemPadding:y="10px 16px",navItemBorderWidth:f="4px",navItemIconGap:g="12px",navItemFontSize:k="15px",navItemFontWeight:x="500",navItemColor:M,sectionTitlePadding:v="16px",sectionTitleFontSize:I="11px",sectionTitleColor:b="#999",sectionTitleWeight:C="500",versionFontSize:w="12px",versionFontWeight:_="400",versionColor:L="#999",userInfoProps:S,style:N,className:j="",width:A="280px",showLogo:B=!0,versionA11yConfig:D,displayNone:V=!1,showCollapseToggle:q=!1,collapsed:$=!1,onCollapseToggle:H,collapseToggleLabel:R="Toggle sidebar",collapseToggleIconPath:z="/icon/dock_to_left.svg"})=>{const O=yt(),X=O.activeNav,ie=O.setActiveNav,ae=O.user,fe=S.user||ae;return q&&$?o.jsx("div",{className:`${Xe.collapsedRail} ${j}`,style:{display:V?"none":"flex"},children:o.jsx("button",{type:"button",className:Xe.collapsedToggle,onClick:H,"aria-label":R,children:o.jsx(pw,{path:z,width:18,height:18})})}):o.jsxs("div",{className:`${Xe.navbar} ${j}`,style:{width:A,backgroundColor:s,padding:c,display:V?"none":"flex",...N},children:[o.jsxs("div",{className:Xe.topSection,style:{gap:t},children:[B&&o.jsxs("div",{className:Xe.logoContainer,children:[o.jsx(xL,{...e}),q&&o.jsx("button",{type:"button",className:Xe.collapseToggle,onClick:H,"aria-label":R,children:o.jsx(pw,{path:z,width:20,height:20})})]}),o.jsx("div",{className:Xe.sectionsContainer,style:{gap:i},children:n.map((le,be)=>o.jsxs("div",{className:Xe.section,children:[le.title&&o.jsx("div",{className:Xe.sectionTitle,title:Z(le.a11yConfig,le.titleKey),style:{fontSize:I,color:b,padding:v,fontWeight:C,border:"4px solid transparent",...u},children:le.title}),o.jsx("div",{className:Xe.sectionItems,style:{gap:r},children:le.items.map(ne=>o.jsx(aC,{...ne,isActive:ne.isActive===null?ne.isActive:X===ne.id,onClick:()=>{ne.onClick&&ne.onClick(),ne.isActive==null&&ie(ne.id)},highlightColor:d,activeColor:d,highlightBackgroundColor:l,padding:y,borderWidth:f,iconGap:g,fontSize:k,fontWeight:x,color:M,style:p},ne.id))})]},be))})]}),o.jsxs("div",{className:Xe.bottomSection,style:{gap:t},children:[o.jsx(vA,{...S,user:fe}),h&&o.jsx("div",{className:Xe.versionContainer,title:Z(D,h),style:{fontSize:w,fontWeight:_,color:L},children:h})]})]})},_8e="_container_4qege_1",L8e="_titleContainer_4qege_10",I8e="_title_4qege_10",b8e="_inlineToggleContainer_4qege_24",w8e="_rightContentContainer_4qege_30",f1={container:_8e,titleContainer:L8e,title:I8e,inlineToggleContainer:b8e,rightContentContainer:w8e},C8e=({className:e="",style:t,fontSize:n="20px",fontWeight:c="bold",color:i="#000",padding:r="0",margin:s,backgroundColor:d,width:l,height:h,border:u,borderRadius:p,navItems:y,allNavItems:f,formatTitle:g=M=>M,rightContent:k,inlineToggle:x})=>{const{activeNav:M}=yt(),v=y.find(b=>b.id===M)||f?.find(b=>b.id===M),I=v?g(v.label):M||"";return I?o.jsxs("div",{className:`${f1.container} ${e}`,style:{padding:r,margin:s,backgroundColor:d,width:l,height:h,border:u,borderRadius:p,...t},children:[o.jsxs("div",{className:f1.titleContainer,children:[o.jsx("div",{className:f1.title,style:{fontSize:n,fontWeight:c,color:i},children:I}),x&&o.jsx("div",{className:f1.inlineToggleContainer,children:x})]}),k&&o.jsx("div",{className:f1.rightContentContainer,children:k})]}):null},N8e="_navItem_1hg26_1",j8e="_navItemIcon_1hg26_21",S8e="_navItemLabel_1hg26_29",$8e="_navItemCount_1hg26_36",q8e="_navItemIndicator_1hg26_49",g1={navItem:N8e,navItemIcon:j8e,navItemLabel:S8e,navItemCount:$8e,navItemIndicator:q8e},xA=({a11yConfig:e,label:t,isActive:n,onClick:c,href:i,labelKey:r,icon:s,count:d,activeColor:l="#00aec7",inactiveColor:h="#666",activeBackgroundColor:u="transparent",countBackgroundColor:p,countColor:y="#fff",countBorderRadius:f="10px",countPadding:g="2px 6px",countFontSize:k="12px",countFontWeight:x="500",indicatorColor:M="#00aec7",indicatorHeight:v="3px",padding:I="8px 4px",fontSize:b="14px",fontWeight:C="500",gap:w="8px",style:_,className:L="",disabled:S=!1,onNavigate:N})=>{const j=()=>{S||(c?.(),i&&(N?N(i):window.location.href=i))};return o.jsxs("div",{className:`${g1.navItem} ${L}`,onClick:j,title:Z(e,r),style:{gap:w,padding:I,color:n?l:h,backgroundColor:n?u:"transparent",fontSize:b,fontWeight:C,..._},children:[s&&o.jsx("span",{className:g1.navItemIcon,children:s}),o.jsx("span",{className:g1.navItemLabel,children:t}),d!==void 0&&o.jsx("span",{className:g1.navItemCount,style:{backgroundColor:p,color:y,borderRadius:f,padding:g,fontSize:k,fontWeight:x},children:d}),n&&!S&&o.jsx("div",{className:g1.navItemIndicator,style:{height:v,backgroundColor:M}})]})},A8e="_container_13hsa_1",z8e="_groupHeader_13hsa_8",V8e="_groupHeaderLeft_13hsa_18",P8e="_groupIcon_13hsa_23",T8e="_dropdown_13hsa_29",H8e="_item_13hsa_42",D8e="_itemIcon_13hsa_65",B8e="_chevron_13hsa_72",R8e="_chevronOpen_13hsa_79",mt={container:A8e,groupHeader:z8e,groupHeaderLeft:V8e,groupIcon:P8e,dropdown:T8e,item:H8e,itemIcon:D8e,chevron:B8e,chevronOpen:R8e},F8e=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},Q.createElement("path",{d:"M480-344 240-584l43-43 197 197 197-197 43 43z"})),R1=m.memo(F8e),MA=({groups:e,activeItemId:t,onItemClick:n,style:c,className:i,bgColor:r="transparent",color:s="var(--color-text)",headerBgColor:d="var(--color-indicator)",headerColor:l="var(--color-text)",headerBorderBottomColor:h="var(--color-border)",dropdownBgColor:u="var(--color-background)",itemBgColor:p="transparent",itemHoverBgColor:y="rgba(0,0,0,0.05)",itemColor:f="var(--color-text)",itemActiveColor:g="var(--color-primary)",itemActiveBorderColor:k="var(--color-primary)",itemDividerColor:x="var(--color-border)",iconColor:M="#555555",activeIconColor:v="var(--color-primary)",headerIconColor:I="var(--color-text)",chevronColor:b="var(--color-text)",iconSize:C=22,headerPadding:w="14px 20px",itemPadding:_="14px 20px",iconGap:L=14,borderRadius:S=0})=>{const[N,j]=m.useState(""),A=m.useRef(null);m.useEffect(()=>{const D=V=>{A.current&&!A.current.contains(V.target)&&j("")};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[]);const B={backgroundColor:r,color:s,borderRadius:S,...c};return o.jsx("nav",{ref:A,className:[mt.container,i].filter(Boolean).join(" "),style:B,children:e.map(D=>{const V=N===D.id,q={backgroundColor:d,color:l,padding:w,borderBottom:`1px solid ${h}`,gap:L},$={backgroundColor:u};return o.jsxs("div",{children:[o.jsxs("div",{className:mt.groupHeader,style:q,onClick:()=>j(V?"":D.id),role:"button","aria-expanded":V,children:[o.jsxs("div",{className:mt.groupHeaderLeft,style:{gap:L},children:[D.icon&&o.jsx("span",{className:mt.groupIcon,style:{color:I,width:C,height:C},children:D.icon}),o.jsx("span",{children:D.label})]}),o.jsx("span",{className:[mt.chevron,V?mt.chevronOpen:""].join(" "),style:{color:b},children:o.jsx(R1,{width:18,height:18})})]}),V&&o.jsx("div",{className:mt.dropdown,style:$,children:D.items.map(H=>{const R=H.id===t,z={padding:_,gap:L,color:R?g:f,backgroundColor:p,"--item-border-width":R?"4px":"1px","--item-border-color":R?k:x};return o.jsxs("div",{className:mt.item,style:z,onClick:()=>{n?.(D.id,H.id),j("")},role:"menuitem",onMouseEnter:O=>{R||(O.currentTarget.style.backgroundColor=y)},children:[H.icon&&o.jsx("span",{className:mt.itemIcon,style:{color:R?v:M,width:C,height:C},children:H.icon}),o.jsx("span",{children:H.label})]},H.id)})})]},D.id)})})},E8e="_subheaderContent_1glo8_1",O8e="_navContainer_1glo8_11",U8e="_rightContent_1glo8_45",Db={subheaderContent:E8e,navContainer:O8e,rightContent:U8e},W8e=({subNavItems:e,backgroundColor:t="transparent",padding:n="0",margin:c,width:i,height:r="auto",border:s,borderBottom:d="none",itemGap:l="24px",actionsGap:h="16px",itemPadding:u="12px 0",itemFontSize:p="14px",itemFontWeight:y="500",activeItemColor:f="#00aec7",inactiveItemColor:g="#5c6975",indicatorHeight:k="3px",showDraggable:x=!1,showLegend:M=!1,showData:v=!1,className:I="",style:b,countBackgroundColor:C,countColor:w,countBorderRadius:_,countPadding:L,countFontSize:S,countFontWeight:N,navContainerClassName:j,navContainerStyle:A,rightContentClassName:B,rightContentStyle:D,rightActions:V,activeSwitcherColor:q,inactiveSwitcherColor:$,isMobile:H=!1,onNavigate:R})=>{const{activeSubNav:z,setActiveSubNav:O,navCounts:X,activeNav:ie}=yt();if(H){const ae=e.find(le=>le.id===z)||e[0],fe=[{id:"current-group",label:ae?.label||ie?.toUpperCase()||"MENU",icon:ae?.icon,items:e.map(le=>({id:le.id,label:le.label,icon:le.icon}))}];return o.jsx("div",{className:I,style:b,children:o.jsx(MA,{groups:fe,activeItemId:z,onItemClick:(le,be)=>{const ne=e.find(ee=>ee.id===be);ne&&(ne.onClick&&ne.onClick(),ne.href&&(R?R(ne.href):ne.onNavigate?ne.onNavigate(ne.href):window.location.href=ne.href),O(be))},headerBgColor:t})})}return o.jsxs("div",{className:`${Db.subheaderContent} ${I}`,style:{backgroundColor:t,padding:n,margin:c,width:i,height:r,border:s,borderBottom:d,...b},children:[o.jsx("div",{className:`${Db.navContainer} ${j||""}`,style:{gap:l,...A},children:e.map(ae=>{const fe=ae.count!==void 0?ae.count:X[ae.id],le=z===ae.id||ae.isActive;return o.jsx(xA,{...ae,onNavigate:R||ae.onNavigate,count:fe,isActive:le,onClick:()=>{ae.onClick&&ae.onClick(),O(ae.id)},activeColor:f,inactiveColor:g,countBackgroundColor:C,countColor:w,countBorderRadius:_,countPadding:L,countFontSize:S,countFontWeight:N,indicatorColor:f,indicatorHeight:k,padding:u,fontSize:p,fontWeight:y,gap:"8px",style:ae.style},ae.id)})}),o.jsxs("div",{className:`${Db.rightContent} ${B||""}`,style:{gap:h,...D},children:[x&&o.jsx(dL,{size:20,colors:{bg:q,activeBg:$,icon:"#1C1B1F",icon2:"#FFFFFF"}}),M&&o.jsx(lL,{size:20,colors:{bg:q,activeBg:$,icon:"#1C1B1F",icon2:"#FFFFFF"}}),v&&o.jsx(hL,{size:20,colors:{bg:q,activeBg:$,icon:"#1C1B1F",icon2:"#FFFFFF"}}),V]})]})},G8e=({onSwitch:e,size:t="20px",lightIconColor:n="#666",darkIconColor:c="#fff",backgroundColor:i="transparent",padding:r="8px",borderRadius:s="50%",style:d,className:l=""})=>{const[h,u]=m.useState(!1),{currentTheme:p,switchTheme:y}=ML(),f=p!="dark",g=()=>{y(f?"dark":"light"),e?.()};return m.useEffect(()=>{u(!0)},[]),!h||!p?o.jsx(o.Fragment,{}):o.jsx("div",{className:`theme-switcher ${l}`,onClick:g,style:{cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:i,padding:r,borderRadius:s,transition:"all 0.3s ease",...d},children:f?o.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}):o.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:c,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"5"}),o.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),o.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),o.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),o.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),o.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),o.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),o.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),o.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]})})},K8e=({initialSortBy:e=null,initialSortOrder:t="asc",onSortChange:n})=>{const[c,i]=m.useState({sortBy:e,sortOrder:t,filters:{}}),r=m.useCallback(s=>{let d="asc";c.sortBy===s&&(d=c.sortOrder==="asc"?"desc":"asc");const l={...c,sortBy:s,sortOrder:d};i(l),n(s,d)},[c,n]);return{tableState:c,handleSort:r}},Z8e=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#FFF",viewBox:"0 -960 960 960",...e},Q.createElement("path",{d:"M440-800v487L216-537l-56 57 320 320 320-320-56-57-224 224v-487z"})),X8e=m.memo(Z8e),Y8e=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#FFF",viewBox:"0 -960 960 960",...e},Q.createElement("path",{d:"M440-160v-487L216-423l-56-57 320-320 320 320-56 57-224-224v487z"})),J8e=m.memo(Y8e),Q8e=({columns:e,sortBy:t,sortOrder:n,onSort:c,removeLabelSpan:i=!1})=>o.jsx("thead",{children:o.jsx("tr",{children:e.map((r,s)=>{const d=t===r.key,l=!!r.sortable;return o.jsx("th",{className:`${r.className||""}${l?" sortable":""}`,style:{width:r.width,textAlign:r.align||"left"},onClick:()=>l&&c(String(r.key)),title:Z(r.a11yConfig,r.titleKey),children:o.jsxs("div",{className:`th-content ${r.align?`align-${r.align}`:""}`,children:[i?r.label:o.jsx("span",{children:r.label}),l&&o.jsx("span",{className:"sort-icon-container",style:{display:"inline-flex",alignItems:"center"},children:d&&n==="asc"?o.jsx(J8e,{width:16,height:16,style:{fill:"currentColor",transition:"all 0.2s ease"}}):o.jsx(X8e,{width:16,height:16,style:{fill:"currentColor",opacity:d?1:.5,transition:"all 0.2s ease"}})})]})},String(r.key)||s)})})}),ege=({data:e,columns:t,rowKey:n,onRowClick:c,isLoading:i,text:r,rowStyle:s,rowClassName:d,renderSeparator:l})=>!e.length&&!i?o.jsx("tbody",{children:o.jsx("tr",{children:o.jsx("td",{colSpan:t.length,style:{textAlign:"center",padding:"32px"},children:o.jsx("span",{style:{color:"var(--table-text-muted)"},children:r?.noData||"Aucune donnée disponible"})})})}):o.jsx("tbody",{children:e.map((h,u)=>{const p=h[n],y=typeof p=="string"||typeof p=="number"?p:u,f=l?l(h):null;return o.jsx("tr",{onClick:()=>c&&c(h),style:{cursor:c?"pointer":"default",...s?s(h):{}},className:d?d(h,u):"",children:f?o.jsx("td",{colSpan:t.length,children:f}):t.map((g,k)=>o.jsx("td",{style:{width:g.width,textAlign:g.align||"left"},className:g.className,children:g.render?g.render(h):h[g.key]},`${String(g.key)}-${k}`))},y)})}),tge=({state:e,onPaginationChange:t,onLoadMore:n,infiniteScroll:c,hasMore:i,text:r,isLoading:s,pageSizeOptions:d})=>{const{page:l,pageSize:h,total:u}=e,p=h===-1?u:h,y=Math.ceil(u/p)||1,f=Math.min(Math.max(1,l),y),g=u===0?0:(f-1)*p+1,k=Math.min(f*p,u),x=b=>{t({page:b})},M=m.useMemo(()=>{if(y<=6)return Array.from({length:y},(A,B)=>B+1);const w=Math.max(f-1,1),_=Math.min(f+1,y),L=w>2,S=_<y-2,N=1,j=y;if(!L&&S)return[...Array.from({length:5},(D,V)=>V+1),"...",y];if(L&&!S){const B=Array.from({length:5},(D,V)=>y-5+V+1);return[N,"...",...B]}if(L&&S){const A=Array.from({length:_-w+1},(B,D)=>w+D);return[N,"...",...A,"...",j]}return[]},[f,y]),v=!!(d&&d.length>0),I=!c&&h!==-1&&y>1&&o.jsxs("div",{className:"pagination-controls",children:[o.jsx("button",{className:"pagination-btn",onClick:()=>x(1),disabled:f===1,title:r?.first||"Premier",children:"<<"}),o.jsx("button",{className:"pagination-btn",onClick:()=>x(f-1),disabled:f===1,title:r?.previous||"Précédent",children:"<"}),(M||[]).map((b,C)=>b==="..."?o.jsx("span",{style:{padding:"0 4px",color:"var(--table-text-muted)"},children:"..."},C):o.jsx("button",{className:`pagination-btn ${b===f?"active":""}`,onClick:()=>x(b),children:b},C)),o.jsx("button",{className:"pagination-btn",onClick:()=>x(f+1),disabled:f===y,title:r?.next||"Suivant",children:">"}),o.jsx("button",{className:"pagination-btn",onClick:()=>x(y),disabled:f===y,title:r?.last||"Dernier",children:">>"})]});return o.jsxs("div",{className:"table-pagination",children:[o.jsx("div",{className:"pagination-summary",children:u>0?o.jsx("span",{children:r?.itemsRange?r.itemsRange(g,k,u):o.jsxs(o.Fragment,{children:[o.jsxs("b",{children:[g,"–",k]})," ",r?.of||"sur"," ",o.jsx("b",{children:u.toLocaleString()})," ",r?.items||"éléments"]})}):o.jsx("span",{children:r?.noResults||"0 résultats"})}),v?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"pagination-center",children:I}),o.jsxs("div",{className:"pagination-pagesize",children:[o.jsx("label",{htmlFor:"table-pagination-pagesize",children:r?.perPage||"Par page"}),o.jsx("select",{id:"table-pagination-pagesize",value:h,onChange:b=>t({pageSize:Number(b.target.value),page:1}),children:(d||[]).map(b=>o.jsx("option",{value:b,children:b},b))})]})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"pagination-spacer"}),I]}),!c&&n&&i&&o.jsx("div",{className:"pagination-load-more",children:o.jsx("button",{className:"btn-load-more",onClick:n,disabled:s,style:{padding:"8px 16px",backgroundColor:"white",border:"1px solid #ddd",borderRadius:"6px",cursor:s?"wait":"pointer",color:"#555",fontWeight:600},children:s?r?.loading||"Chargement...":r?.loadMore||"Charger plus"})})]})},_A=({data:e,columns:t,isLoading:n,pagination:c,onPaginationChange:i,onSortChange:r,rowKey:s,loaderSize:d=40,stickyHeader:l=!0,height:h,minHeight:u="200px",text:p,onLoadMore:y,infiniteScroll:f,hasMore:g,tableState:k,className:x,style:M,rowStyle:v,onRowClick:I,rowClassName:b,titleKey:C,removeLabelSpan:w=!1,a11yConfig:_,renderSeparator:L,pageSizeOptions:S})=>{const N=m.useMemo(()=>({...p}),[p]),j=m.useRef(null);m.useEffect(()=>{if(!f||!y||!g||n)return;const $=new IntersectionObserver(H=>{H[0].isIntersecting&&y()},{threshold:.1});return j.current&&$.observe(j.current),()=>$.disconnect()},[f,y,g,n]);const{tableState:A,handleSort:B}=K8e({initialSortBy:null,onSortChange:r}),D=(k?.sortBy!==void 0?k.sortBy:A.sortBy)??void 0,V=k?.sortOrder!==void 0?k.sortOrder:A.sortOrder,q=$=>{const H=D,R=V;let z="asc";H===$&&(z=R==="asc"?"desc":"asc"),k?.sortBy!==void 0?r($,z):B($)};return o.jsxs("div",{className:`table-container ${x||""}`,style:M,title:Z(_,C),children:[o.jsxs("div",{className:"table-frame",style:{height:h??void 0,minHeight:u??void 0},children:[n&&o.jsx("div",{className:"table-loader-overlay",children:o.jsx("div",{className:"spinner",style:{width:d,height:d,borderTopColor:"var(--table-primary)"}})}),o.jsxs("div",{className:`table-wrapper ${l?"sticky-header":""}`,children:[o.jsxs("table",{className:"data-table",children:[o.jsx(Q8e,{columns:t,sortBy:D,sortOrder:V,onSort:q,removeLabelSpan:w}),o.jsx(ege,{data:e,columns:t.map($=>({...$,render:$.render?H=>$.render(H,{}):void 0})),rowKey:s,onRowClick:I,isLoading:n,text:N,rowStyle:typeof v=="function"?v:v?()=>v:void 0,rowClassName:b,renderSeparator:L})]}),f&&o.jsx("div",{ref:j,style:{height:20,margin:10}})]})]}),o.jsx(tge,{state:c,onPaginationChange:i,text:N,onLoadMore:y,infiniteScroll:f,hasMore:g,isLoading:n,pageSizeOptions:S})]})},age="_datePickerContainer_1gx2l_3",nge="_label_1gx2l_16",oge="_displayNode_1gx2l_23",cge="_datePickerButton_1gx2l_30",ige="_datePickerButtonDisabled_1gx2l_50",rge="_datePickerButtonOpen_1gx2l_59",sge="_datePickerLabel_1gx2l_68",dge="_placeholder_1gx2l_79",lge="_trailingIcons_1gx2l_83",hge="_chevron_1gx2l_89",uge="_clearButton_1gx2l_97",pge="_errorMessage_1gx2l_114",yge="_dropdown_1gx2l_119",kge="_calendarHeader_1gx2l_143",mge="_navButton_1gx2l_152",fge="_headerSelectors_1gx2l_171",gge="_monthSelector_1gx2l_179",vge="_yearSelector_1gx2l_180",xge="_selectorButton_1gx2l_184",Mge="_selectorChevron_1gx2l_201",_ge="_selectorChevronOpen_1gx2l_206",Lge="_monthDropdown_1gx2l_210",Ige="_yearDropdown_1gx2l_211",bge="_monthItem_1gx2l_231",wge="_yearItem_1gx2l_232",Cge="_monthItemSelected_1gx2l_254",Nge="_yearItemSelected_1gx2l_255",jge="_weekdays_1gx2l_259",Sge="_weekday_1gx2l_259",$ge="_calendarGrid_1gx2l_275",qge="_dateCell_1gx2l_284",Age="_dateCellSelected_1gx2l_307",zge="_dateCellOtherMonth_1gx2l_311",Vge="_dateCellOtherMonthSelected_1gx2l_315",Pge="_calendarFooter_1gx2l_319",Tge="_cancelButton_1gx2l_327",Hge="_applyButton_1gx2l_328",Dge="_timePickerContainer_1gx2l_372",Bge="_timeGroup_1gx2l_381",Rge="_timeLabel_1gx2l_388",Fge="_timeInputWrapper_1gx2l_394",Ege="_timeInput_1gx2l_394",Oge="_timeSeparator_1gx2l_422",U={datePickerContainer:age,label:nge,displayNode:oge,datePickerButton:cge,datePickerButtonDisabled:ige,datePickerButtonOpen:rge,datePickerLabel:sge,placeholder:dge,trailingIcons:lge,chevron:hge,clearButton:uge,errorMessage:pge,dropdown:yge,calendarHeader:kge,navButton:mge,headerSelectors:fge,monthSelector:gge,yearSelector:vge,selectorButton:xge,selectorChevron:Mge,selectorChevronOpen:_ge,monthDropdown:Lge,yearDropdown:Ige,monthItem:bge,yearItem:wge,monthItemSelected:Cge,yearItemSelected:Nge,weekdays:jge,weekday:Sge,calendarGrid:$ge,dateCell:qge,dateCellSelected:Age,dateCellOtherMonth:zge,dateCellOtherMonthSelected:Vge,calendarFooter:Pge,cancelButton:Tge,applyButton:Hge,timePickerContainer:Dge,timeGroup:Bge,timeLabel:Rge,timeInputWrapper:Fge,timeInput:Ege,timeSeparator:Oge},Uge=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},Q.createElement("path",{d:"m336-280 144-144 144 144 56-56-144-144 144-144-56-56-144 144-144-144-56 56 144 144-144 144zM480-80q-83 0-156-31.5T197-197t-85.5-127T80-480t31.5-156T197-763t127-85.5T480-880t156 31.5T763-763t85.5 127T880-480t-31.5 156T763-197t-127 85.5T480-80m0-80q134 0 227-93t93-227-93-227-227-93-227 93-93 227 93 227 227 93m0-320"})),Wge=m.memo(Uge),jS=["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],Gge=["Lun","Mar","Mer","Jeu","Ven","Sam","Dim"],kw=({value:e,onChange:t,label:n,placeholder:c="Sélectionner une date...",className:i="",fullWidth:r=!0,disabled:s=!1,error:d,buttonHeight:l="2.75rem",buttonPadding:h="0.75rem 1rem 0.75rem 1rem",dropdownMaxHeight:u="auto",fontSize:p="0.875rem",iconSize:y="1.5rem",labelMarginBottom:f="0.5rem",errorMarginTop:g="0.25rem",dropdownMarginTop:k="0.25rem",itemPadding:x="0.5rem 0.75rem",fontWeight:M="400",buttonBgColor:v,buttonBorderColor:I,buttonTextColor:b,dropdownBgColor:C="#ffffff",itemHoverColor:w,selectedItemBgColor:_,iconColor:L,errorColor:S,labelColor:N,placeholderColor:j,borderRadius:A="var(--radius-content)",borderWidth:B="0.0625rem",boxShadow:D="0 0.25rem 0.75rem rgba(0, 0, 0, 0.1)",transitionDuration:V="0.2s",transitionTiming:q="ease",dateCellSize:$="2.5rem",headerTextColor:H="#6c757d",weekdayTextColor:R="#6c757d",currentMonthDateColor:z="#212529",otherMonthDateColor:O="#adb5bd",selectedDateBgColor:X="#00A6D9",selectedDateTextColor:ie="#ffffff",cancelButtonBgColor:ae="#e9ecef",cancelButtonTextColor:fe="#212529",applyButtonBgColor:le="#00A6D9",applyButtonTextColor:be="#ffffff",width:ne,displayNode:ee=void 0,displayMode:te="auto",displayNodeAriaLabel:re,dropdownPosition:pe="auto",dropdownAlignment:se="right",dropdownWidth:G,withBorder:K=!1,icon:oe,precision:Ne="day",horizontalTimePicker:qe=!1,hoursLabel:ve="Heures",minutesLabel:Ve="Minutes",lowerLimit:kt=null,upperLimit:bt=null,outOfLimitsMessage:he="La date/heure choisie est hors des limites autorisées",months:wt,weekdays:zL,cancelText:_e="Annuler",applyText:Ft="Appliquer",prevMonthAriaLabel:wA="Mois précédent",nextMonthAriaLabel:CA="Mois suivant",calendarAriaLabel:NA="Sélecteur de date",openedAriaLabel:jA="Ouvrir le sélecteur de date",selectedDateAriaLabel:SA="Date sélectionnée: ",rotateIcon:$A=!0,clearable:qA=!1,clearAriaLabel:AA="Effacer la date"})=>{const Ct=T=>{if(T instanceof Date)return isNaN(T.getTime())?null:T;if(typeof T=="string"&&T){const W=new Date(T);return isNaN(W.getTime())?null:W}return null},[Oe,Et]=m.useState(!1),[u1,zA]=m.useState({top:0,left:0,width:0}),[nC,VA]=m.useState("bottom"),[oC,PA]=m.useState(null),[ue,p1]=m.useState(Ct(e)||new Date),[y1,VL]=m.useState(Ct(e)),[Q1,PL]=m.useState(Ct(e)?.getHours()??0),[ei,TL]=m.useState(Ct(e)?.getMinutes()??0),[HL,Rc]=m.useState(!1),[DL,Fc]=m.useState(!1),BL=m.useRef(null),Ec=m.useRef(null),cC=m.useRef(null),RL=m.useRef(null),FL=m.useRef(null),iC=m.useRef(Ct(e)?.getTime());m.useEffect(()=>{const T=Ct(e),W=T?.getTime();W!==iC.current&&(iC.current=W,VL(T),T&&(p1(T),PL(T.getHours()),TL(T.getMinutes())))},[e]);const rC=m.useCallback(()=>{if(Ec.current){const T=Ec.current.getBoundingClientRect();zA({top:T.top,left:T.left,width:T.width})}},[]),sC=8,ti=m.useCallback(()=>{if(!Ec.current)return;const T=Ec.current.getBoundingClientRect(),W=(parseFloat(k.replace("rem",""))||0)*16,xe=T.top-W-sC,Nt=window.innerHeight-T.bottom-W-sC;let Ue;if(pe!=="auto")Ue=pe;else{const He=cC.current?.scrollHeight??0;Ue=He<=Nt?"bottom":He<=xe||xe>Nt?"top":"bottom"}VA(He=>He===Ue?He:Ue),PA(Math.max(Ue==="bottom"?Nt:xe,0))},[pe,k]),Oc=m.useCallback(()=>{rC(),ti()},[rC,ti]);m.useEffect(()=>(Oe&&(Oc(),window.addEventListener("scroll",Oc,!0),window.addEventListener("resize",Oc)),()=>{window.removeEventListener("scroll",Oc,!0),window.removeEventListener("resize",Oc)}),[Oe,Oc]),m.useLayoutEffect(()=>{Oe&&ti()},[Oe,ti]),m.useEffect(()=>{const T=W=>{if(BL.current&&!BL.current.contains(W.target)){const xe=document.getElementById("datepicker-dropdown");if(xe&&xe.contains(W.target))return;Et(!1),Rc(!1),Fc(!1)}RL.current&&!RL.current.contains(W.target)&&Rc(!1),FL.current&&!FL.current.contains(W.target)&&Fc(!1)};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[]);const dC=T=>new Date(T.getFullYear(),T.getMonth()+1,0).getDate(),TA=T=>{const W=new Date(T.getFullYear(),T.getMonth(),1).getDay();return W===0?6:W-1},HA=()=>{const T=[],W=TA(ue),xe=dC(ue),Nt=new Date(ue.getFullYear(),ue.getMonth()-1,1),Ue=dC(Nt);for(let we=W-1;we>=0;we--)T.push(new Date(ue.getFullYear(),ue.getMonth()-1,Ue-we));for(let we=1;we<=xe;we++)T.push(new Date(ue.getFullYear(),ue.getMonth(),we));const He=42-T.length;for(let we=1;we<=He;we++)T.push(new Date(ue.getFullYear(),ue.getMonth()+1,we));return T},DA=(T,W)=>!T||!W?!1:T.getDate()===W.getDate()&&T.getMonth()===W.getMonth()&&T.getFullYear()===W.getFullYear(),BA=T=>T.getMonth()===ue.getMonth()&&T.getFullYear()===ue.getFullYear(),lC=T=>!(kt&&T<kt||bt&&T>bt),hC=y1?(()=>{const T=new Date(y1);return T.setHours(Q1),T.setMinutes(ei),T})():null,Uc=hC?!lC(hC):!1,RA=()=>{p1(new Date(ue.getFullYear(),ue.getMonth()-1,1))},FA=()=>{p1(new Date(ue.getFullYear(),ue.getMonth()+1,1))},EA=T=>{if(!s){const W=new Date(T);W.setHours(Q1),W.setMinutes(ei),VL(W)}},OA=()=>{if(!s){if(y1){const T=new Date(y1);if(T.setHours(Q1),T.setMinutes(ei),!lC(T))return;t(T)}else t(null);Et(!1)}},UA=()=>{const T=Ct(e);VL(T),T&&(PL(T.getHours()),TL(T.getMinutes())),Et(!1)},WA=T=>{p1(new Date(ue.getFullYear(),T,1)),Rc(!1)},GA=T=>{p1(new Date(T,ue.getMonth(),1)),Fc(!1)},KA=()=>{const T=ue.getFullYear(),W=[];for(let xe=T-10;xe<=T+10;xe++)W.push(xe);return W},ZA=T=>{if(!s)switch(T.key){case"Enter":case" ":T.preventDefault(),Et(!Oe);break;case"Escape":Et(!1),Rc(!1),Fc(!1);break;case"Tab":Oe&&(Et(!1),Rc(!1),Fc(!1));break}},XA={width:ne||(r?"100%":"auto"),fontSize:p,fontWeight:M},YA={height:l,padding:h,backgroundColor:v||"#ffffff",border:K?void 0:"none",borderColor:d?S||"#dc3545":I||"#dee2e6",color:b||"#212529",borderRadius:A,borderWidth:B,fontWeight:M,transition:`all ${V} ${q}`},JA=qe?{flexDirection:"column",borderTop:"none",borderLeft:"1px solid #eee"}:{},QA=qe?{flex:1,minWidth:0}:void 0,ez=qe?{display:"flex",flexDirection:"row",alignItems:"stretch"}:void 0,tz={backgroundColor:C||"#ffffff",maxHeight:u==="auto"?oC!=null?`${oC}px`:void 0:u,overflowY:"auto",borderRadius:A,borderWidth:B,boxShadow:D,transition:`opacity ${V} ${q}, transform ${V} ${q}`,position:"fixed",top:nC==="bottom"?u1.top+(Ec.current?.offsetHeight||0)+parseFloat(k.replace("rem",""))*16:"auto",bottom:nC==="top"?window.innerHeight-u1.top+parseFloat(k.replace("rem",""))*16:"auto",left:se==="left"?u1.left:"auto",right:se==="right"?window.innerWidth-(u1.left+u1.width):"auto",width:G||"30vw",minWidth:G?void 0:0,zIndex:10001},uC={width:y,height:y,color:L||"#6c757d","--icon-rotation":$A&&Oe?"rotate(180deg)":"rotate(0deg)"},az={color:N||"#212529",marginBottom:f,fontWeight:M},nz={color:j||"#6c757d"},oz={color:S||"#dc3545",marginTop:g},cz=HA(),tt=Ct(e),pC=T=>`${T.getDate().toString().padStart(2,"0")}/${(T.getMonth()+1).toString().padStart(2,"0")}/${T.getFullYear()}`,yC=tt?Ne==="minutes"?`${pC(tt)} ${tt.getHours().toString().padStart(2,"0")}:${tt.getMinutes().toString().padStart(2,"0")}`:pC(tt):"",kC=!!ee&&(te==="icon"||te==="auto"&&!tt),iz=qA&&!kC&&!!tt&&!s,rz={width:"0.875rem",height:"0.875rem",color:L||"#6c757d"},sz=re||(tt?`${SA}${yC}`:jA);return o.jsxs("div",{className:`${U.datePickerContainer} ${i}`,ref:BL,style:XA,"data-fullwidth":r,"data-disabled":s,"data-error":!!d,children:[n&&o.jsx("label",{className:U.label,style:az,children:n}),o.jsxs("button",{ref:Ec,type:"button",onClick:()=>!s&&Et(!Oe),onKeyDown:ZA,className:`
|
|
8335
|
-
${
|
|
8336
|
-
${Oe?
|
|
8337
|
-
${s?
|
|
8338
|
-
`,style:YA,disabled:s,"aria-expanded":Oe,"aria-haspopup":"dialog","aria-label":sz,"aria-labelledby":n?`${n}-label`:void 0,children:[kC?o.jsx("span",{className:
|
|
8334
|
+
`,Eke="_mpRoot_31595_1",Oke="_mpHeader_31595_22",Uke="_mpTitle_31595_31",Wke="_mpList_31595_35",Gke="_mpVertical_31595_41",Kke="_mpHorizontal_31595_46",Zke="_mpItem_31595_55",Xke="_mpClickable_31595_95",Yke="_mpLeft_31595_117",Jke="_mpIcon_31595_125",Qke="_mpMeta_31595_140",e3e="_mpLabel_31595_145",t3e="_mpDate_31595_154",a3e="_mpRight_31595_160",n3e="_mpValue_31595_168",o3e="_mpHint_31595_176",c3e="_mpBadge_31595_180",i3e="_mpBadgeTop_31595_199",r3e="_mpBadgeSub_31595_206",s3e="_mpBadgeSmall_31595_213",d3e="_mpPill_31595_229",l3e="_mpRounded_31595_232",h3e="_mpCompact_31595_236",u3e="_compactItemWrapper_31595_252",p3e="_mpSummaryRoot_31595_265",y3e="_mpSummaryInner_31595_269",k3e="_mpSummaryFlex_31595_284",m3e="_mpSummaryCardWrapperHorizontal_31595_292",f3e="_mpSummaryCardWrapper_31595_292",g3e="_mpSummaryCardHorizontal_31595_303",v3e="_mpSummaryCard_31595_292",x3e="_mpSummaryValue_31595_321",M3e="_mpSummaryLabel_31595_327",_3e="_mpSummaryBadge_31595_338",L3e="_mpSummaryBadgeSub_31595_357",I3e="_mpEmpty_31595_365",b3e="_mpSummaryVertical_31595_372",w3e="_mpIconSquare_31595_380",J={mpRoot:Eke,mpHeader:Oke,mpTitle:Uke,mpList:Wke,mpVertical:Gke,mpHorizontal:Kke,mpItem:Zke,mpClickable:Xke,mpLeft:Yke,mpIcon:Jke,mpMeta:Qke,mpLabel:e3e,mpDate:t3e,mpRight:a3e,mpValue:n3e,mpHint:o3e,mpBadge:c3e,mpBadgeTop:i3e,mpBadgeSub:r3e,mpBadgeSmall:s3e,mpPill:d3e,mpRounded:l3e,mpCompact:h3e,compactItemWrapper:u3e,mpSummaryRoot:p3e,mpSummaryInner:y3e,mpSummaryFlex:k3e,mpSummaryCardWrapperHorizontal:m3e,mpSummaryCardWrapper:f3e,mpSummaryCardHorizontal:g3e,mpSummaryCard:v3e,mpSummaryValue:x3e,mpSummaryLabel:M3e,mpSummaryBadge:_3e,mpSummaryBadgeSub:L3e,mpEmpty:I3e,mpSummaryVertical:b3e,mpIconSquare:w3e},Tt=(e,t=1)=>{if(!e||typeof e!="string")return`rgba(124, 58, 237, ${t})`;const n=e.trim();if(n.toLowerCase()==="transparent")return"rgba(0,0,0,0)";if(/^rgba?\(/i.test(n))return/^rgba\(/i.test(n)?n.replace(/rgba\(([^)]+),\s*([0-9.]+)\s*\)$/,(d,l)=>`rgba(${l.split(",").map(u=>u.trim()).slice(0,3).join(", ")}, ${t})`):n;let c=n.replace("#","").toLowerCase();if(c.length===3&&(c=c.split("").map(d=>d+d).join("")),!/^[0-9a-f]{6}$/i.test(c))return`rgba(124, 58, 237, ${t})`;const i=parseInt(c.slice(0,2),16),r=parseInt(c.slice(2,4),16),s=parseInt(c.slice(4,6),16);return`rgba(${i}, ${r}, ${s}, ${t})`},C3e=({item:e,shape:t,onItemClick:n,color:c,renderItem:i})=>{const r=m.useCallback(()=>{n?.(e)},[n,e]),s=[J.mpItem,t==="pill"?J.mpPill:J.mpRounded,n?J.mpClickable:""].filter(Boolean).join(" ");if(i)return o.jsx("div",{className:s,role:n?"button":"group",tabIndex:n?0:-1,onClick:r,onKeyDown:y=>{n&&(y.key==="Enter"||y.key===" ")&&(n(e),y.preventDefault())},"aria-label":n?`Voir les détails de ${e.label}`:void 0,children:i(e)});const d=n?"button":"div",l=n?{onClick:r,className:s,type:"button","aria-label":`Voir les détails de ${e.label}`}:{className:s,role:"group"},h=e.iconComponent,u=e.iconSquareBg,p=e.iconColor;return o.jsxs(d,{...l,children:[o.jsxs("div",{className:J.mpLeft,children:[h?o.jsx("div",{className:J.mpIconSquare,style:{background:u??Tt(p??c??"#7c3aed",1),border:`1px solid ${Tt(p??c??"#7c3aed",.18)}`,color:p??"#ffffff"},children:m.createElement(h,{size:20,color:p??"#fff",strokeWidth:1.8})}):e.icon?o.jsx("div",{className:J.mpIcon,children:e.icon}):null,o.jsxs("div",{className:J.mpMeta,children:[o.jsx("div",{className:J.mpLabel,children:e.label}),e.subLabel&&o.jsx("div",{className:J.mpDate,children:e.subLabel}),e.date&&o.jsx("div",{className:J.mpDate,children:e.date})]})]}),o.jsxs("div",{className:J.mpRight,children:[o.jsx("div",{className:J.mpValue,style:{color:e.valueColor??c??void 0},children:e.value}),e.badge?o.jsxs("div",{className:[J.mpBadge,e.badge.small?J.mpBadgeSmall:""].join(" "),style:{backgroundColor:e.badge.bg??Tt(e.badge.color||c||"#7c3aed",.12),borderColor:e.badge.bg?"transparent":Tt(e.badge.color||c||"#7c3aed",.18),color:e.badge.color??e.badge.textColor??"#0f172a",fontWeight:600},children:[o.jsx("div",{className:J.mpBadgeTop,children:e.badge.text}),e.badge.subText&&o.jsx("div",{className:J.mpBadgeSub,children:e.badge.subText})]}):e.hint?o.jsx("div",{className:J.mpHint,children:e.hint}):null]})]})},N3e=m.memo(C3e),LS=({title:e,right:t})=>!e&&!t?null:o.jsxs("div",{className:J.mpHeader,children:[o.jsx("div",{className:J.mpTitle,children:e}),o.jsx("div",{children:t})]}),IS=(e,t=1)=>{try{return Tt(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},j3e=({item:e})=>o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:14,borderRadius:12,minHeight:88,boxSizing:"border-box",background:e.bgColor??"transparent",border:`1px solid ${e.borderColor??"transparent"}`,boxShadow:"0 4px 10px rgba(15,23,42,0.03)"},children:[o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[o.jsx("div",{style:{fontSize:13,fontWeight:700,color:"#475569"},children:e.label}),o.jsx("div",{style:{fontSize:26,fontWeight:900,color:"#0f172a",lineHeight:1},children:e.value})]}),o.jsx("div",{title:String(e.label),style:{display:"flex",alignItems:"center",justifyContent:"center",width:48,height:48,borderRadius:10,background:e.iconSquareBg??IS("#7c3aed",.12),border:`1px solid ${IS(e.iconColor??"#7c3aed",.12)}`,boxShadow:"none"},children:e.iconComponent?m.createElement(e.iconComponent,{size:18,color:e.iconColor??"#7c3aed",strokeWidth:1.6}):null})]}),S3e=({item:e,bg:t,onClick:n,width:c,height:i,extraStyle:r})=>o.jsxs("div",{className:J.mpSummaryCard,style:{background:t,width:c??void 0,height:i??void 0,...r??{}},role:n?"button":"group",tabIndex:n?0:-1,onClick:()=>n?.(e),children:[o.jsx("div",{className:J.mpSummaryLabel,children:e.label}),o.jsx("div",{className:J.mpSummaryValue,style:{color:e.valueColor??"#2a24deff"},children:e.value}),e.badge&&o.jsxs("div",{className:J.mpSummaryBadge,children:[e.badge.text,e.badge.subText&&o.jsx("div",{className:J.mpSummaryBadgeSub,children:e.badge.subText})]})]}),bS=(e,t=1)=>{try{return Tt(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},wS=e=>o.jsxs("div",{style:{display:"grid",gridTemplateRows:"auto 1fr",width:"100%",gap:8,alignItems:"center",boxSizing:"border-box",minWidth:0},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between-left",alignItems:"baseline",gap:10,width:"100%"},children:[o.jsx("div",{style:{fontWeight:700,fontSize:"clamp(14px, 1.2vw, 16px)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:e.label}),e.subLabel?o.jsx("div",{style:{fontSize:"clamp(13px, 1.1vw, 15px)",fontWeight:600,whiteSpace:"nowrap"},children:e.subLabel}):null]}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:15,width:"100%"},children:[o.jsx("div",{style:{fontWeight:900,fontSize:"clamp(16px, 1.6vw, 20px)",color:e.valueColor,lineHeight:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.value}),e.badge?o.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"8px 12px",borderRadius:10,backgroundColor:e.badge.bg?e.badge.bg:bS("#7c3aed",.08),border:`1px solid ${e.badge.bg?e.badge.bg:bS("#7c3aed",.12)}`,color:e.badge.textColor||"#0f172a",fontWeight:700,fontSize:"clamp(12px, 1.2vw, 14px)",width:"120px",height:"52px",textAlign:"center",boxSizing:"border-box",overflow:"hidden",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",lineHeight:1.2,flexShrink:0},children:[o.jsx("div",{style:{fontSize:14,fontWeight:800,lineHeight:1.2,letterSpacing:"0.02em",width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.badge.text}),e.badge.subText?o.jsx("div",{style:{fontSize:13,marginTop:4,fontWeight:700,letterSpacing:"0.01em",width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.badge.subText}):null]}):null]})]}),CS=(e,t)=>{try{if(typeof e=="function"){const n=e(t);if(n!==void 0)return n}}catch{}try{return m.createElement(e,{item:t})}catch(n){return console.warn("chooseDefaultRender: impossible de rendre CompactRenderer",n),null}},$3e=e=>{switch(e){case"image":return t=>m.createElement(j3e,{item:t});case"pertinence":return t=>m.createElement(S3e,{item:t});case"alternateHorizontal":return t=>CS(wS,t);case"compact":return t=>CS(wS,t);case"summary":return;case"default":default:return}},yA=({item:e,orientation:t,bg:n,border:c,valueColor:i,onClick:r,width:s,height:d,extraStyle:l})=>{const u=t==="horizontal"?J.mpSummaryCardHorizontal:J.mpSummaryCard;return o.jsxs("div",{className:u,style:{background:n,border:`1px solid ${c}`,width:s??void 0,height:d??void 0,...l??{}},role:r?"button":"group",tabIndex:r?0:-1,onClick:()=>r?.(e),children:[e.badge&&o.jsxs("div",{className:J.mpSummaryBadge,children:[e.badge.text,e.badge.subText&&o.jsx("div",{className:J.mpSummaryBadgeSub,children:e.badge.subText})]}),o.jsx("div",{className:J.mpSummaryValue,style:{color:i},children:e.value}),o.jsx("div",{className:J.mpSummaryLabel,children:e.label})]})},q3e=["transparent","transparent","transparent","transparent"],A3e=["transparent","transparent","transparent","transparent"],z3e=["#059669","#2563eb","#b45309","#7c3aed"],V3e=(e,t=1)=>{try{return Tt(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},kA=e=>{const{items:t=[],layout:n="vertical",orientation:c="auto",shape:i="rounded",color:r="#7c3aed",compact:s=!1,title:d,onItemClick:l,className:h="",loading:u=!1,emptyMessage:p="Aucun élément",renderItem:y,summary:f=!1,summaryBgColors:g=q3e,summaryBorderColors:k=A3e,summaryValueColors:x=z3e,preset:M,background:v}=e,{itemsContainerStyle:I,itemsContainerClassName:b,summaryGridColumns:C,compactItemWidth:w,compactItemHeight:_,compactItemStyle:L,summaryCardWidth:S,summaryCardHeight:N,summaryCardStyle:j}=e,A=n==="vertical",B={"--mp-accent":r,"--mp-accent-soft":V3e(r,.08),"--mp-bg-primary":v},D=[J.mpRoot,A?J.mpVertical:J.mpHorizontal,s?J.mpCompact:"",f?J.mpSummaryRoot:"",c!=="auto"?c==="vertical"?J.mpOrientationVertical:J.mpOrientationHorizontal:"",h].filter(Boolean).join(" "),V=m.useMemo(()=>y||($3e(M)??void 0),[y,M]);if(f){const q=c==="horizontal"?J.mpSummaryFlex:J.mpSummaryVertical,H={...(C?{display:"grid",gridTemplateColumns:`repeat(${C}, 1fr)`,gap:18,alignItems:"stretch",width:"100%"}:void 0)??{},...I??{}};return o.jsxs("div",{className:D,style:B,"aria-busy":u,children:[d&&o.jsx(LS,{title:d}),o.jsx("div",{className:J.mpSummaryInner,children:o.jsx("div",{className:`${q} ${b??""}`,style:H,children:t.length===0?o.jsx("div",{className:J.mpEmpty,children:p}):t.map((R,z)=>{const U=R.bgColor??g[z%g.length],X=R.borderColor??k[z%k.length],ie=R.valueColor??x[z%x.length];return V?o.jsx("div",{className:c==="horizontal"?J.mpSummaryCardWrapperHorizontal:J.mpSummaryCardWrapper,style:{width:S??void 0,height:N??void 0,...j??{}},children:V(R,z)},R.id):o.jsx(yA,{item:R,orientation:c==="horizontal"?"horizontal":"vertical",bg:U,border:X,valueColor:ie,onClick:l,width:S??void 0,height:N??void 0,extraStyle:j},R.id)})})})]})}return o.jsxs("div",{className:D,style:B,"aria-busy":u,children:[d&&o.jsx(LS,{title:d}),o.jsx("div",{className:J.mpList,style:I,children:u?o.jsx("div",{className:J.mpEmpty,children:"Chargement…"}):t.length===0?o.jsx("div",{className:J.mpEmpty,children:p}):t.map(q=>{const $=s?{width:w??void 0,height:_??void 0,boxSizing:"border-box",...L??{}}:void 0;return o.jsx("div",{className:s?J.compactItemWrapper:void 0,style:$,children:o.jsx(N3e,{item:q,shape:i,onItemClick:l,color:r,renderItem:V?H=>V(H,t.indexOf(H)):void 0})},q.id)})})]})};m.memo(kA);const P3e=({a11yConfig:e,width:t,height:n,colors:c={text:"#0b1220",background:"#fff",contentBackground:"#efeff0"},titles:i={},placeholder:r="Loading Chart",style:s,className:d="",children:l,padding:h="1rem",variant:u="default",showBorder:p=!1,titleKey:y,leftTitleKey:f})=>{const g=t?typeof t=="number"?`${t}px`:t:void 0,k=n?typeof n=="number"?`${n}px`:n:void 0,x=r&&typeof r=="object"&&!m.isValidElement(r)&&("text"in r||"subtext"in r||"icon"in r||"background"in r||"iconSize"in r),M=x?r:void 0,v=M?.icon?xt[M.icon]:void 0,I=28,b=M?.iconSize??I,C=["chart-container",`variant-${u}`,p?"with-border":"",d].filter(Boolean).join(" "),w=c.contentBackground??void 0,_=typeof h=="number"?`${h}px`:h;return o.jsxs("div",{className:C,style:{width:g,height:k,color:c.text,background:c.background,display:"flex",flexDirection:"column",boxSizing:"border-box",padding:_,...s},children:[o.jsxs("div",{className:"chart-header",children:[o.jsxs("div",{title:Z(e,f||y),className:"chart-title-left",style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.left,i.leftSubtitle&&o.jsx("div",{className:"chart-subtitle-left",children:i.leftSubtitle})]}),o.jsx("div",{className:"chart-title-right",children:i.right})]}),o.jsx("div",{className:"chart-content",style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:w},children:l||(x&&M?o.jsxs("div",{className:"placeholder",role:"status","aria-live":"polite",children:[v&&o.jsx("div",{className:"placeholder-icon",style:{width:b,height:b},children:o.jsx(v,{color:M.iconColor??"currentColor",size:typeof b=="number"?b:parseInt(String(b),10)||I})}),M.text&&o.jsx("div",{className:"placeholder-text",children:M.text}),M.subtext&&o.jsx("div",{className:"placeholder-subtext",children:M.subtext})]}):o.jsx("div",{className:"placeholder-node",role:"status","aria-live":"polite",children:r}))})]})},tC=({id:e,size:t="100%",background:n,icon:c,text:i,subtext:r,onClose:s,onClick:d,style:l,className:h="",colorTextPrimary:u,colorTextSub:p,model:y,fontSize:f,fontWeight:g,a11yConfig:k,titleKey:x})=>{const M=c||y?.icon,v=typeof M=="string",I=v?xt[M]:null,b=v?null:M;return o.jsxs("div",{id:e,className:`alert ${h}`,style:{width:typeof t=="number"?`${t}px`:t,background:n||y?.background,pointerEvents:"auto",cursor:d?"pointer":"default",...l},role:"alert",onClick:d,title:Z(k,x),children:[I&&o.jsx(I,{className:"alert-icon",size:20,color:u||y?.colorTextPrimary}),b!=null&&o.jsx("span",{className:"alert-icon",style:{display:"flex",alignItems:"center",color:u||y?.colorTextPrimary,flexShrink:0},children:b}),o.jsxs("div",{className:"alert-content",children:[o.jsx("span",{className:"alert-text",style:{color:u||y?.colorTextPrimary,fontSize:f,fontWeight:g},children:i}),r&&o.jsx("span",{className:"alert-subtext",style:{color:p||y?.colorTextSub},children:r})]}),s&&o.jsx("button",{className:"alert-close",onClick:s,"aria-label":"Fermer",children:"✕"})]})},mA=m.createContext(null),T3e=(e="alert")=>`${e}_${Math.random().toString(36).slice(2,9)}`,H3e=({children:e,defaultDuration:t=4e3,maxAlerts:n,containerClassName:c,containerStyle:i})=>{const[r,s]=m.useState([]),d=m.useRef(new Map),l=m.useRef(null),h=m.useRef(null),u=m.useRef(n);m.useEffect(()=>()=>{d.current.forEach(_=>window.clearTimeout(_)),d.current.clear()},[]);const p=(_,L)=>{const S=L===void 0||L===0?t:L;if(S===-1)return;const N=window.setTimeout(()=>{g(_)},S);d.current.set(_,N)},y=_=>{const L=d.current.get(_);L&&(window.clearTimeout(L),d.current.delete(_))},f=_=>{const L=T3e(),S={..._,id:L,createdAt:Date.now()};return s(N=>{const j=[S,...N],A=u.current;return typeof A=="number"&&A>=0&&j.length>A?(j.slice(A).forEach(D=>y(D.id)),j.slice(0,A)):j}),p(L,_.duration),L},g=_=>{y(_),s(L=>L.filter(S=>S.id!==_))},k=(_,L)=>{s(S=>S.map(N=>N.id===_?{...N,...L}:N))},x=()=>{d.current.forEach(_=>window.clearTimeout(_)),d.current.clear(),s([])},M=_=>{h.current=_},v=()=>r.slice(),I=m.useMemo(()=>({showAlert:f,dismissAlert:g,updateAlert:k,clearAlerts:x,setContainerRef:M,getAlertsSnapshot:v}),[r]),b=h.current,C=o.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,display:"flex",flexDirection:"column",alignItems:"center",pointerEvents:"none",zIndex:10001,padding:"8px 4px"},children:o.jsx(mle,{mode:"popLayout",children:r.map(_=>o.jsx(Xw.div,{initial:{opacity:0,y:-10,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.98},transition:{type:"spring",damping:25,stiffness:300},style:{width:"100%",pointerEvents:"auto",boxShadow:"0 6px 20px rgba(0, 0, 0, 0.12)",borderRadius:"8px",marginBottom:"6px",backgroundColor:_.background||_.model?.background||"var(--color-background, #fff)",border:"1px solid rgba(0, 0, 0, 0.08)",overflow:"hidden"},children:o.jsx(tC,{id:_.id,text:_.text,subtext:_.subtext,icon:_.icon,background:"transparent",colorTextPrimary:_.colorTextPrimary,colorTextSub:_.colorTextSub,model:_.model,onClose:()=>g(_.id),size:"100%",style:{boxShadow:"none"}})},_.id))})}),w=o.jsx("div",{ref:_=>{h.current||(l.current=_)},className:c,style:{width:"100%",position:"relative",...i},"aria-live":"polite",children:C});return o.jsxs(mA.Provider,{value:I,children:[b?mw.createPortal(C,b):w,e]})},D3e=()=>{const e=m.useContext(mA);if(!e)throw new Error("useAlerts must be used inside an AlertsProvider");return e},B3e={default:{background:"#f3f4f6",icon:"Info",colorTextPrimary:"#111827",colorTextSub:"#4b5563"},info:{background:"#dbeafe",icon:"Info",colorTextPrimary:"#1e40af",colorTextSub:"#3b82f6"},success:{background:"#dcfce7",icon:"CheckCircle2",colorTextPrimary:"#166534",colorTextSub:"#22c55e"},warning:{background:"#fef3c7",icon:"AlertTriangle",colorTextPrimary:"#92400e",colorTextSub:"#f59e0b"},error:{background:"#fee2e2",icon:"XCircle",colorTextPrimary:"#991b1b",colorTextSub:"#ef4444"}},R3e="_container_18zbo_1",F3e="_icon_18zbo_9",E3e="_selectWrapper_18zbo_23",Hb={container:R3e,icon:F3e,selectWrapper:E3e},O3e=({options:e,defaultValue:t,onChange:n,label:c})=>{const[i,r]=m.useState(t||e[0]?.value||""),s=d=>{r(d),n?.(d)};return o.jsxs("div",{className:Hb.container,children:[o.jsxs("div",{className:Hb.icon,children:[o.jsx(w1,{size:18}),o.jsx("p",{children:c})]}),o.jsx("div",{className:Hb.selectWrapper,children:o.jsx(Yw,{field:{name:"periode",label:"",options:e},value:i,onChange:s,onBlur:()=>{}})})]})},U3e=250,W3e=m.forwardRef(({title:e,subtitle:t,size:n="420px",beforeOpen:c,afterOpen:i,beforeClose:r,afterClose:s,style:d,className:l="",children:h,closeOnOverlayClick:u=!0,showCloseButton:p=!0},y)=>{const[f,g]=m.useState(!1),[k,x]=m.useState(!1),M=m.useRef(null),v=m.useRef(null),I=m.useRef(null),b=m.useRef(null);m.useEffect(()=>{const _=M.current;if(!_)return;const L=_.parentElement;return L?(window.getComputedStyle(L).position==="static"&&(L.setAttribute("data-scp-prev-position",L.style.position??""),L.style.position="relative",L.setAttribute("data-scp-position-changed","true")),()=>{if(L.getAttribute("data-scp-position-changed")==="true"){const N=L.getAttribute("data-scp-prev-position")??"";L.style.position=N,L.removeAttribute("data-scp-position-changed"),L.removeAttribute("data-scp-prev-position")}}):void 0},[]),m.useImperativeHandle(y,()=>({open:()=>{f||(c?.(),x(!1),g(!0))},close:()=>{f&&(r?.(),x(!1),g(!1))},toggle:()=>{f?(r?.(),x(!1),g(!1)):(c?.(),x(!1),g(!0))}}),[f,c,r]),m.useEffect(()=>{const _=v.current;b.current&&(window.clearTimeout(b.current),b.current=null);const L=S=>{if(S.target===_&&!(S.propertyName!=="transform"&&S.propertyName!=="opacity"))if(f){x(!0),i?.();try{_?.focus()}catch{}}else{s?.();try{I.current?.focus()}catch{}}};return _&&(_.addEventListener("transitionend",L),b.current=window.setTimeout(()=>{if(f){x(!0),i?.();try{_?.focus()}catch{}}else{s?.();try{I.current?.focus()}catch{}}},U3e+60)),f&&(I.current=document.activeElement),()=>{_&&_.removeEventListener("transitionend",L),b.current&&(window.clearTimeout(b.current),b.current=null)}},[f,i,s]),m.useEffect(()=>{const _=L=>{L.key==="Escape"&&f&&(r?.(),x(!1),g(!1))};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[f,r]);const C=()=>{u&&(r?.(),x(!1),g(!1))},w=typeof n=="number"?`${n}px`:n;return o.jsxs("div",{ref:M,className:`scp-inline-root ${f?"open":""}`,"aria-hidden":!f,children:[o.jsx("div",{className:`scp-overlay ${f?"visible":""}`,onMouseDown:C,role:"presentation"}),o.jsxs("aside",{className:`scp-panel ${f?"in":"out"} ${k?"interactive":""} ${l}`,style:{width:w,...d},ref:v,tabIndex:-1,role:"dialog","aria-label":e,children:[o.jsxs("div",{className:"scp-header",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"scp-title",children:e}),t&&o.jsx("div",{className:"scp-subtitle",children:t})]}),p&&o.jsx("button",{className:"scp-close","aria-label":"Close",onClick:()=>{r?.(),x(!1),g(!1)},children:o.jsx(Qe,{size:18})})]}),o.jsx("div",{className:"scp-body",children:h})]})]})});function G3e(e){const t=m.useRef("");m.useEffect(()=>{if(e){t.current=document.body.style.overflow,document.body.style.overflow="hidden";return}document.body.style.overflow=t.current||""},[e])}const K3e="_container_1pfsp_1",Z3e="_title_1pfsp_8",NS={container:K3e,title:Z3e},X3e=({title:e,fontSize:t,barColor:n,className:c="",style:i={}})=>{const r={...i,"--title-font-size":t,"--bar-color":n};return o.jsx("div",{className:`${NS.container} ${c}`,style:r,children:o.jsx("h2",{className:NS.title,children:e})})},Y3e="_modalOverlay_1878x_1",J3e="_modalContainer_1878x_16",Q3e="_modalTitle_1878x_29",eme="_modalInput_1878x_38",tme="_modalTextarea_1878x_39",ame="_modalActions_1878x_70",nme="_cancelBtn_1878x_77",ome="_saveBtn_1878x_99",cme="_inputError_1878x_141",ime="_inlineAlert_1878x_146",at={modalOverlay:Y3e,modalContainer:J3e,modalTitle:Q3e,modalInput:eme,modalTextarea:tme,modalActions:ame,cancelBtn:nme,saveBtn:ome,inputError:cme,inlineAlert:ime},Bc=({isOpen:e,onClose:t,onSave:n,title:c="Ajouter un élément",fields:i,initialValues:r={},errorMessage:s="",disableSave:d,onFieldChange:l,confirmText:h="Valider",cancelText:u="Annuler"})=>{const[p,y]=m.useState({}),f=m.useRef(null),[g,k]=m.useState(!1),[x,M]=m.useState(!1),v=m.useRef(null);if(m.useEffect(()=>{if(!e)return;const _={};for(const L of i)_[L.name]=Object.prototype.hasOwnProperty.call(r,L.name)?r[L.name]:"";return y(_),requestAnimationFrame(()=>{f.current?.focus();const L=f.current;if(L&&typeof L.selectionStart=="number"){const S=String(L.value??"").length;L.setSelectionRange(S,S)}}),()=>{v.current&&(window.clearTimeout(v.current),v.current=null)}},[e]),m.useEffect(()=>{s&&e?(M(!0),v.current&&(window.clearTimeout(v.current),v.current=null),v.current=window.setTimeout(()=>{M(!1),v.current=null},3e3)):(M(!1),v.current&&(window.clearTimeout(v.current),v.current=null))},[s,e]),!e)return null;const I=(_,L)=>{y(S=>({...S,[_]:L})),l&&l(_,L)},b=async()=>{if(!Object.values(p).some(_=>_===""||_===void 0))try{k(!0);const _=await n(p);if(typeof _=="string"&&_==="duplicate-same"){k(!1);return}y({}),k(!1),t()}catch(_){console.error("AddItemModal onSave error:",_),k(!1),t()}},C=_=>{_.target===_.currentTarget&&t()},w=_=>_.stopPropagation();return o.jsx("div",{className:at.modalOverlay,onMouseDown:C,role:"dialog","aria-modal":"true",children:o.jsxs("div",{className:at.modalContainer,onMouseDown:w,onClick:w,children:[o.jsx("h2",{className:at.modalTitle,children:c}),i.map((_,L)=>{const S=p[_.name]??"",N=L===0&&!!s,j={name:_.name,placeholder:_.placeholder||_.label,value:String(S),onChange:A=>I(_.name,A.target.value),className:_.type==="textarea"?`${at.modalTextarea} ${N?at.inputError:""}`:`${at.modalInput} ${N?at.inputError:""}`,tabIndex:0,disabled:g};return L===0&&(j.ref=A=>{f.current=A}),o.jsxs("div",{style:{marginBottom:8},children:[_.type==="textarea"?o.jsx("textarea",{rows:_.rows||4,...j}):o.jsx("input",{type:_.type||"text",...j}),L===0&&x&&s&&o.jsx("div",{style:{marginTop:8},children:o.jsx(tC,{text:s,background:"#fff5f5",colorTextPrimary:"#ef4444",onClose:()=>M(!1),className:at.inlineAlert})})]},_.name)}),o.jsxs("div",{className:at.modalActions,children:[o.jsx("button",{className:at.cancelBtn,onClick:t,type:"button",disabled:g,children:u}),o.jsx("button",{className:at.saveBtn,onClick:b,type:"button",disabled:g||!!d,children:g?"En cours...":h})]})]})})},rme=({title:e,keyCount:t,onAddKey:n,a11yConfig:c})=>{const[i,r]=m.useState(!1),s=d=>{const l=d.key;n&&l&&n(l)};return o.jsxs("div",{className:"header-container",children:[o.jsxs("div",{className:"header-info",children:[o.jsx("h1",{title:Z(c,e),children:e}),o.jsxs("p",{children:[t," clés"]})]}),o.jsxs("button",{onClick:()=>r(!0),className:"add-key-button",children:[o.jsx(Vc,{className:"add-key-icon"}),"Clé"]}),o.jsx(Bc,{isOpen:i,title:"Ajouter une clé",onClose:()=>r(!1),onSave:s,fields:[{name:"key",label:"Nouvelle clé",placeholder:"Entrer une nouvelle clé"}]})]})},sme=({modules:e,onEdit:t,onDelete:n,onAddModule:c,onSelectModule:i,addModalFields:r,addModalTitle:s})=>{const[d,l]=m.useState(!1),[h,u]=m.useState(null),[p,y]=m.useState(null),[f,g]=m.useState(!1),k=()=>l(!0),x=()=>l(!1),M=_=>{if(c){const L=_.code?.trim()||_.id?.trim(),S=_.title?.trim(),N=L||S||String(Date.now()),j=S||L||`Module ${N}`;c({id:N,title:j,subtitle:"",translations:{}})}x()},v=(_,L)=>{_.stopPropagation(),u(L)},I=()=>u(null),b=_=>{if(!h){I();return}const L={...h,title:_.title||h.title,subtitle:""};t&&t(L),I()},C=(_,L)=>{_.stopPropagation(),n&&n(L)},w=_=>{y(_.id),i&&i(_)};return f?o.jsx("div",{className:"module-sidebar collapsed",children:o.jsx(n1,{size:20,className:"menu-toggle",onClick:()=>g(!1)})}):o.jsxs("div",{className:"module-sidebar",children:[o.jsxs("div",{className:"sidebar-header",children:[o.jsxs("span",{className:"header-text",children:["Modules (",e.length,")"]}),o.jsxs("div",{className:"header-actions",children:[o.jsx(zc,{size:18,className:"header-folder",onClick:k}),o.jsx(n1,{size:18,className:"header-menu",onClick:()=>g(!0)})]})]}),o.jsx("hr",{className:"divider"}),o.jsx("div",{className:"module-list",children:e.map(_=>{const L=Object.keys(_.translations||{}).length,S=L>0||_.id===p;return o.jsxs("div",{className:`module-item ${_.id===p?"selected":""}`,onClick:()=>w(_),role:"button",tabIndex:0,onKeyDown:N=>{N.key==="Enter"&&w(_)},children:[o.jsxs("div",{className:"module-left",children:[o.jsx($1,{size:16,className:"item-folder"}),o.jsxs("div",{className:"module-info",children:[o.jsxs("div",{className:"module-title",children:[_.title,S&&o.jsxs("span",{className:"count",children:[" ",L," "]})]}),_.subtitle?o.jsx("div",{className:"module-subtitle",children:_.subtitle}):null]})]}),o.jsxs("div",{className:"module-actions",children:[t&&o.jsx(o1,{onClick:N=>v(N,_),color:"#777",size:16}),n&&o.jsx(ut,{onClick:N=>C(N,_.id),color:"#777",size:16})]})]},_.id)})}),o.jsx(Bc,{isOpen:d,onClose:x,onSave:M,title:s||"Ajouter un module",fields:r&&r.length?r.map(_=>({name:_.name,label:_.label,type:_.type,placeholder:_.placeholder,rows:_.rows})):[{name:"title",label:"Titre",placeholder:"Titre du module"}]}),h&&o.jsx(Bc,{isOpen:!!h,onClose:I,onSave:b,title:"Éditer le module",initialValues:{title:h.title},fields:[{name:"title",label:"Titre",placeholder:"Titre du module"}]})]})},fA=({placeholder:e="Rechercher une clé ou traduction...",value:t="",onChange:n,iconPosition:c="left",iconColor:i="#9ca3af",a11yConfig:r,className:s})=>o.jsxs("div",{className:`search-container icon-${c}`,title:Z(r,e),children:[o.jsx("div",{className:"search-icon-wrapper",children:o.jsx(z1,{className:"search-icon",color:i})}),o.jsx("input",{type:"text",placeholder:e,value:t,onChange:d=>n?.(d.target.value),className:`search-input ${s}`})]}),dme=({keyName:e,translations:t,availableLanguages:n,onDeleteKey:c,onEditKey:i,onEditTranslation:r,onDeleteTranslation:s,onAddTranslation:d,draggable:l=!1,checkDuplicateLocal:h})=>{const[u,p]=m.useState(!1),[y,f]=m.useState(""),[g,k]=m.useState(null),[x,M]=m.useState(""),[v,I]=m.useState(""),[b,C]=m.useState(!1),[w,_]=m.useState(!1),[L,S]=m.useState(null),[N,j]=m.useState(!1),A=t.map(z=>z.language),B=n.filter(z=>!A.includes(z.code)),D=()=>{y&&v.trim()&&(d?.(e,y,v.trim()),f(""),I(""),p(!1))},V=(z,U)=>{k(z),M(U)},q=z=>{r?.(e,z,x),k(null),M("")},$=()=>{k(null),M("")},H=async z=>{const U=z.name?.trim();if(U){if(S(null),j(!1),U===e||!i)return C(!1),"ok";try{const X=await i(e,U);if(typeof X=="string"&&X==="ok")C(!1),S(null);else{if(typeof X=="string"&&X==="duplicate-same")return S("Une clé existe déjà dans ce module."),j(!0),"duplicate-same";if(typeof X=="string"&&X==="duplicate-other")return C(!1),S(null),"duplicate-other";C(!1)}}catch(X){console.error("Erreur handleRenameSave:",X),S("Erreur lors du renommage.")}}},R=(z,U)=>{if(z!=="name")return;const X=U.trim();S(null),j(!1),X&&typeof h=="function"&&(h(X,e)?(S("Une clé existe déjà dans ce module."),j(!0)):(S(null),j(!1)))};return o.jsxs("div",{className:`translation-key ${w?"collapsed":"expanded"} ${l?"draggable":""}`,children:[o.jsxs("div",{className:"card-header",children:[o.jsxs("div",{className:"header-left",children:[o.jsx("button",{className:"collapse-button",onClick:()=>_(!w),title:w?"Déplier":"Replier",children:w?o.jsx(N1,{className:"collapse-icon"}):o.jsx(Ht,{className:"collapse-icon"})}),o.jsx("h3",{className:"card-title",title:e,children:e})]}),o.jsxs("div",{className:"header-actions",children:[o.jsx("button",{className:"action-button",onClick:z=>{z.stopPropagation(),C(!0)},title:"Renommer la clé",children:o.jsx(ft,{className:"action-icon"})}),o.jsx("button",{onClick:z=>{z.stopPropagation(),c?.(e)},className:"action-button delete",title:"Supprimer la clé",children:o.jsx(ut,{className:"action-icon"})})]})]}),o.jsx("div",{className:`translations-container ${w?"":"expanded"}`,children:!l&&o.jsxs(o.Fragment,{children:[t.map(z=>o.jsxs("div",{className:"translation-row",children:[o.jsx("div",{className:"language-code",children:z.language}),o.jsx("div",{className:"translation-content",children:g===z.language?o.jsxs(o.Fragment,{children:[o.jsx("input",{type:"text",value:x,onChange:U=>M(U.target.value),className:"edit-input",autoFocus:!0,onKeyDown:U=>{U.key==="Enter"&&q(z.language),U.key==="Escape"&&$()}}),o.jsx("button",{onClick:()=>q(z.language),className:"save-button",disabled:!x.trim(),children:"Enregistrer"}),o.jsx("button",{onClick:$,className:"cancel-button",children:o.jsx(Qe,{className:"action-icon"})})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"translation-text",title:z.value,children:z.value}),o.jsx("button",{onClick:()=>V(z.language,z.value),className:"edit-button",title:"Éditer la traduction",children:o.jsx(ft,{className:"action-icon"})}),o.jsx("button",{onClick:()=>s?.(e,z.language),className:"delete-translation-button",title:"Supprimer la traduction",children:o.jsx(Qe,{className:"action-icon"})})]})})]},z.language)),u?o.jsxs("div",{className:"add-language-row",children:[o.jsx("div",{className:"language-code",children:"+"}),o.jsxs("div",{className:"add-language-content",children:[o.jsx("div",{className:"language-select-container",children:o.jsxs("select",{value:y,onChange:z=>f(z.target.value),className:"language-select",children:[o.jsx("option",{value:"",children:"Sélectionnez la langue"}),B.map(z=>o.jsxs("option",{value:z.code,children:[z.name," (",z.code,")"]},z.code))]})}),y&&o.jsx("input",{type:"text",value:v,onChange:z=>I(z.target.value),placeholder:"Entrez la traduction...",className:"translation-input",onKeyDown:z=>{z.key==="Enter"&&D(),z.key==="Escape"&&(p(!1),f(""),I(""))}}),o.jsx("button",{onClick:D,disabled:!y||!v.trim(),className:"save-button",children:"Ajouter"}),o.jsx("button",{onClick:()=>{p(!1),f(""),I("")},className:"cancel-button",children:o.jsx(Qe,{className:"action-icon"})})]})]}):o.jsxs("button",{onClick:()=>p(!0),className:"show-add-button",disabled:B.length===0,children:[o.jsx("span",{className:"plus-icon",children:"+"}),"Ajouter une langue"]})]})}),l&&o.jsxs("div",{className:"drag-overlay",children:[o.jsx(a.Move,{size:24,strokeWidth:1.5}),o.jsx("span",{children:"Glisser pour réorganiser"})]}),o.jsx(Bc,{isOpen:b,onClose:()=>{C(!1),S(null),j(!1)},onSave:H,onFieldChange:R,title:"Renommer la clé",initialValues:{name:e},fields:[{name:"name",label:"Nom de la clé",placeholder:"Nom de la clé"}],errorMessage:L||"",disableSave:N})]})},lme="_wrapper_1wvht_1",hme="_leftGroup_1wvht_12",ume="_filterButton_1wvht_21",pme="_open_1wvht_42",yme="_filterIcon_1wvht_42",kme="_infoText_1wvht_58",mme="_pickerContainer_1wvht_66",fme="_srOnly_1wvht_79",gme="_pickerLabel_1wvht_91",vme="_datetime_1wvht_98",xme="_rightGroup_1wvht_107",Mme="_searchInputWrap_1wvht_116",_me="_searchInput_1wvht_116",Lme="_searchIcon_1wvht_152",De={wrapper:lme,leftGroup:hme,filterButton:ume,open:pme,filterIcon:yme,infoText:kme,pickerContainer:mme,srOnly:fme,pickerLabel:gme,datetime:vme,rightGroup:xme,searchInputWrap:Mme,searchInput:_me,searchIcon:Lme};function Ime({onDateChange:e,onSearch:t,initialDate:n}){const[c,i]=m.useState(!1),[r,s]=m.useState(n??""),d=m.useRef(null);m.useEffect(()=>{function p(y){const f=y.target;d.current&&f&&!d.current.contains(f)&&i(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]),m.useEffect(()=>{n&&s(n)},[n]);const l=()=>i(p=>!p),h=p=>{const y=p.target.value;s(y),e?.(y)},u=p=>{t?.(p.target.value)};return o.jsxs("div",{className:De.wrapper,ref:d,children:[o.jsxs("div",{className:De.leftGroup,children:[o.jsxs("button",{type:"button",className:`${De.filterButton} ${c?De.open:""}`,onClick:l,"aria-expanded":c,"aria-haspopup":"dialog","aria-controls":"entry-datetime",children:[o.jsx("span",{children:"Entry time"}),o.jsx("svg",{className:De.filterIcon,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":!0,children:o.jsx("path",{fill:"currentColor",d:"M10 18h4v-2h-4v2zm-7-8v2h18V10H3zm3-6v2h12V4H6z"})})]}),o.jsx("div",{className:De.infoText,children:"Confidence interval: step ± 15' / exit ± 30'"}),c&&o.jsxs("div",{className:De.pickerContainer,role:"dialog","aria-label":"Choisir la date et l’heure",children:[o.jsx("label",{className:De.pickerLabel,htmlFor:"entry-datetime",children:o.jsx("span",{className:De.srOnly,children:"Choisir la date et l’heure"})}),o.jsx("input",{id:"entry-datetime",className:De.datetime,type:"datetime-local",value:r,onChange:h,"aria-label":"Date et heure d’entrée"})]})]}),o.jsx("div",{className:De.rightGroup,children:o.jsxs("div",{className:De.searchInputWrap,children:[o.jsx("input",{className:De.searchInput,placeholder:"Search...",onChange:u,"aria-label":"Search"}),o.jsx("svg",{className:De.searchIcon,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":!0,children:o.jsx("path",{fill:"currentColor",d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16a6.471 6.471 0 004.23-1.57l.27.28v.79L20 20.49 21.49 19l-5.99-5zM10 15.5A5.5 5.5 0 1115.5 10 5.5 5.5 0 0110 15.5z"})})]})})]})}const bme=({className:e="",style:t={},title:n,titleClassName:c="",titleStyle:i,data:r,lineClasses:s={},renderCell:d,bg:l,titleBg:h,titleColor:u,itemBg:p,emptyContent:y,colGap:f="1rem"})=>{const g=Array.isArray(r)?r:[],k=g.length===0,x=g.every(b=>typeof b=="string"),M=g.some(b=>Array.isArray(b)),v=(b,C,w)=>d?d(b,C,w):o.jsx("span",{className:"slb-cell-text",children:b}),I=f?{"--col-gap":f}:void 0;return k?o.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:l??void 0},children:[n&&o.jsx("div",{className:`slb-title ${c}`,style:{...i,background:h??void 0,color:u??void 0},children:n}),o.jsx("div",{className:"slb-empty",children:y??null})]}):x&&!M?o.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:l??void 0},children:[n&&o.jsx("div",{className:`slb-title ${c}`,style:{background:h??void 0,color:u??void 0},children:n}),o.jsx("ul",{className:"slb-list",children:g.map((b,C)=>o.jsx("li",{className:`slb-item ${s[C]||""}`,style:{background:p??void 0},children:v(b,C,0)},C))})]}):o.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:l??void 0},children:[n&&o.jsx("div",{className:`slb-title ${c}`,style:{background:h??void 0,color:u??void 0},children:n}),o.jsx("div",{className:"slb-grid",style:I,children:g.map((b,C)=>{const w=s[C]||"";if(Array.isArray(b)){const[_,L]=b;return o.jsxs("div",{className:`slb-row ${w}`,style:{background:p??void 0},children:[o.jsx("div",{className:"slb-grid-left",children:v(_,C,0)}),o.jsx("div",{className:"slb-grid-right",children:v(L,C,1)})]},C)}return o.jsxs("div",{className:`slb-row ${w}`,style:{background:p??void 0},children:[o.jsx("div",{className:"slb-grid-left",children:v(b,C,0)}),o.jsx("div",{className:"slb-grid-right slb-empty-cell","aria-hidden":"true"})]},C)})})]})},wme=({className:e="",style:t={},title:n,titleColor:c,data:i=[],badgeColor:r="#0ea5e9",badgeColors:s={},badgePadding:d="8px 16px",badgeWidth:l,itemBg:h,lineClasses:u={},colGap:p="1rem"})=>{const y=i.some(g=>Array.isArray(g)),f=p?{"--col-gap":p}:void 0;return o.jsxs("div",{className:`clb-root ${e}`,style:{...t},children:[n&&o.jsx("div",{className:"clb-title",style:c?{color:c}:void 0,children:n}),o.jsx("div",{className:"clb-grid",style:f,children:i.map((g,k)=>{const x=u[k]||"";if(Array.isArray(g)){const[M,v]=g,I=s[k]||r;return o.jsxs("div",{className:`clb-row ${x}`,style:{background:h??void 0},children:[o.jsx("div",{className:"clb-badge-col",children:o.jsx("div",{className:"counter-badge",style:{background:I,padding:d,width:l,minWidth:l},children:M})}),o.jsx("div",{className:"clb-text",children:v})]},k)}return y?o.jsxs("div",{className:`clb-row ${x}`,style:{background:h??void 0},children:[o.jsx("div",{className:"clb-badge-col clb-empty-badge"}),o.jsx("div",{className:"clb-text",children:g})]},k):o.jsx("div",{className:`clb-fullrow ${x}`,style:{background:h??void 0},children:o.jsx("span",{children:g})},k)})})]})},Cme=({className:e="",style:t={},title:n,items:c=[],titleBg:i,titleColor:r,itemBg:s,lineClasses:d={},renderTrendIcon:l,colGap:h="1rem"})=>{const u=h?{"--col-gap":h}:void 0;return o.jsxs("div",{className:`tlb-root ${e}`,style:{...t,background:s??void 0},children:[n&&o.jsx("div",{className:"tlb-title",style:{background:i??void 0,color:r??void 0},children:n}),o.jsx("div",{className:"tlb-grid",style:u,children:c.map((p,y)=>{const f=d[y]||"";return o.jsxs("div",{className:`tlb-row ${f}`,style:{background:s??void 0},children:[o.jsx("div",{className:"tlb-label",children:p.label}),o.jsxs("div",{className:"tlb-value-group",children:[o.jsx("div",{className:"tlb-icon-col",children:l?l(p):p.icon??null}),o.jsxs("div",{className:"tlb-value-wrap",children:[o.jsx("div",{className:"tlb-value",children:p.value}),typeof p.delta<"u"&&o.jsx("div",{className:`tlb-delta ${p.delta>0?"positive":p.delta<0?"negative":"neutral"}`,children:p.deltaLabel??String(p.delta)})]})]})]},y)})})]})},Nme=({className:e="",style:t={},children:n,gap:c="1rem"})=>o.jsx("div",{className:`frc-root ${e}`,style:{...t,"--frc-gap":c},children:m.Children.map(n,i=>o.jsx("div",{className:"frc-item",children:i}))}),jme=({className:e="",style:t={},children:n,gap:c="1rem",background:i="#D9EEF5"})=>o.jsx("div",{className:`lcc-root ${e}`,style:{background:i,...t,"--lcc-gap":c},children:m.Children.map(n,r=>o.jsx("div",{className:"lcc-cell",children:r}))}),Sme="_overlay_3x4or_2",$me="_fadeIn_3x4or_1",qme="_popup_3x4or_17",Ame="_slideUp_3x4or_1",zme="_header_3x4or_28",Vme="_body_3x4or_40",Pme="_footer_3x4or_51",Tme="_cancelButton_3x4or_59",Hme="_confirmButton_3x4or_77",Dme="_warning_3x4or_97",Bme="_danger_3x4or_106",Rme="_info_3x4or_115",jt={overlay:Sme,fadeIn:$me,popup:qme,slideUp:Ame,header:zme,body:Vme,footer:Pme,cancelButton:Tme,confirmButton:Hme,warning:Dme,danger:Bme,info:Rme},Fme=({isOpen:e,title:t,message:n,onConfirm:c,onCancel:i,confirmText:r="Confirmer",cancelText:s="Annuler",type:d="warning"})=>{if(!e)return null;const l=u=>{u.target===u.currentTarget&&i()},h=u=>{u.key==="Escape"&&i(),u.key==="Enter"&&u.ctrlKey&&c()};return o.jsx("div",{className:jt.overlay,onClick:l,onKeyDown:h,role:"dialog","aria-labelledby":"confirmation-title","aria-describedby":"confirmation-message",children:o.jsxs("div",{className:`${jt.popup} ${jt[d]}`,children:[o.jsx("div",{className:jt.header,children:o.jsx("h3",{id:"confirmation-title",children:t})}),o.jsx("div",{className:jt.body,children:o.jsx("p",{id:"confirmation-message",children:n})}),o.jsxs("div",{className:jt.footer,children:[o.jsx("button",{className:jt.cancelButton,onClick:i,type:"button",children:s}),o.jsx("button",{className:jt.confirmButton,onClick:c,type:"button",autoFocus:!0,children:r})]})]})})},Eme=()=>{const[e,t]=m.useState({isOpen:!1,title:"",message:"",onConfirm:null}),n=m.useCallback((r,s,d)=>{t({isOpen:!0,title:r,message:s,onConfirm:d})},[]),c=m.useCallback(()=>{t(r=>({...r,isOpen:!1,onConfirm:null}))},[]),i=m.useCallback(()=>{e.onConfirm?.(),c()},[e.onConfirm,c]);return{isOpen:e.isOpen,title:e.title,message:e.message,showConfirmation:n,hideConfirmation:c,handleConfirm:i}},Ome="_container_1l44m_1",Ume="_selectButton_1l44m_7",Wme="_disabled_1l44m_22",Gme="_error_1l44m_39",Kme="_outline_1l44m_52",Zme="_filled_1l44m_58",Xme="_sm_1l44m_67",Yme="_md_1l44m_73",Jme="_lg_1l44m_79",Qme="_buttonContent_1l44m_85",e6e="_label_1l44m_93",t6e="_placeholder_1l44m_103",a6e="_iconsContainer_1l44m_108",n6e="_loadingSpinner_1l44m_115",o6e="_spin_1l44m_1",c6e="_arrowIcon_1l44m_133",i6e="_arrowIconOpen_1l44m_141",r6e="_dropdown_1l44m_146",s6e="_dropdownIn_1l44m_1",d6e="_searchContainer_1l44m_171",l6e="_searchInputWrapper_1l44m_177",h6e="_searchIcon_1l44m_183",u6e="_searchInput_1l44m_177",p6e="_optionsList_1l44m_208",y6e="_noResults_1l44m_231",k6e="_option_1l44m_208",m6e="_optionHighlighted_1l44m_261",f6e="_optionSelected_1l44m_266",g6e="_optionDisabled_1l44m_277",v6e="_optionLabel_1l44m_283",x6e="_checkIcon_1l44m_291",M6e="_widthFull_1l44m_299",_6e="_width64_1l44m_302",L6e="_width80_1l44m_305",I6e="_width96_1l44m_308",se={container:Ome,selectButton:Ume,disabled:Wme,error:Gme,default:"_default_1l44m_48",outline:Kme,filled:Zme,sm:Xme,md:Yme,lg:Jme,buttonContent:Qme,label:e6e,placeholder:t6e,iconsContainer:a6e,loadingSpinner:n6e,spin:o6e,arrowIcon:c6e,arrowIconOpen:i6e,dropdown:r6e,dropdownIn:s6e,searchContainer:d6e,searchInputWrapper:l6e,searchIcon:h6e,searchInput:u6e,optionsList:p6e,noResults:y6e,option:k6e,optionHighlighted:m6e,optionSelected:f6e,optionDisabled:g6e,optionLabel:v6e,checkIcon:x6e,widthFull:M6e,width64:_6e,width80:L6e,width96:I6e},b6e=({options:e,value:t,onChange:n,placeholder:c="Sélectionner une option...",disabled:i=!1,loading:r=!1,error:s=!1,className:d="",size:l="md",variant:h="default",width:u="w-full"})=>{const[p,y]=m.useState(!1),[f,g]=m.useState(""),[k,x]=m.useState(0),[M,v]=m.useState({top:0,left:0,width:0}),I=m.useRef(null),b=m.useRef(null),C=m.useRef(null),w=m.useMemo(()=>f?e.filter(q=>q.label.toLowerCase().includes(f.toLowerCase())):e,[e,f]),_=e.find(q=>q.value===t),L=m.useCallback(()=>{if(I.current){const q=I.current.getBoundingClientRect();v({top:q.top,left:q.left,width:q.width})}},[]);m.useEffect(()=>(p&&(L(),window.addEventListener("scroll",L,!0),window.addEventListener("resize",L)),()=>{window.removeEventListener("scroll",L,!0),window.removeEventListener("resize",L)}),[p,L]),m.useEffect(()=>{const q=$=>{I.current&&!I.current.contains($.target)&&b.current&&!b.current.contains($.target)&&(y(!1),g(""))};return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[]),m.useEffect(()=>{x(0)},[w]);const S=q=>{q.disabled||(n?.(q.value,q),y(!1),g(""))},N=q=>{g(q.target.value),p||y(!0)},j=q=>{if(!p){(q.key==="ArrowDown"||q.key==="Enter")&&y(!0);return}switch(q.key){case"ArrowDown":q.preventDefault(),x($=>$<w.length-1?$+1:$);break;case"ArrowUp":q.preventDefault(),x($=>$>0?$-1:$);break;case"Enter":q.preventDefault(),w[k]&&S(w[k]);break;case"Escape":y(!1),g("");break}},A=()=>[se.selectButton,se[l],se[h],i?se.disabled:"",s?se.error:"",d].filter(Boolean).join(" "),B=()=>{switch(u){case"w-64":return se.width64;case"w-80":return se.width80;case"w-96":return se.width96;default:return se.widthFull}},D=(q,$)=>[se.option,$===k?se.optionHighlighted:"",q.value===t?se.optionSelected:"",q.disabled?se.optionDisabled:""].filter(Boolean).join(" "),V={position:"fixed",top:M.top+(I.current?.offsetHeight||0)+4,left:M.left,width:M.width,zIndex:9999};return o.jsxs("div",{className:`${se.container} ${B()}`,children:[o.jsx("button",{ref:I,className:A(),onClick:()=>!i&&y(!p),onKeyDown:j,tabIndex:i?-1:0,type:"button","aria-haspopup":"listbox","aria-expanded":p,disabled:i,children:o.jsxs("div",{className:se.buttonContent,children:[o.jsx("span",{className:`${se.label} ${_?"":se.placeholder}`,children:_?_.label:c}),o.jsxs("div",{className:se.iconsContainer,children:[r&&o.jsx("div",{className:se.loadingSpinner}),o.jsx("svg",{className:`${se.arrowIcon} ${p?se.arrowIconOpen:""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]})}),p&&mw.createPortal(o.jsxs("div",{className:`${se.dropdown} ${B()}`,style:V,ref:b,children:[o.jsx("div",{className:se.searchContainer,children:o.jsxs("div",{className:se.searchInputWrapper,children:[o.jsx("svg",{className:se.searchIcon,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),o.jsx("input",{ref:C,type:"text",value:f,onChange:N,placeholder:"Rechercher...",className:se.searchInput,autoFocus:!0})]})}),o.jsx("div",{className:se.optionsList,children:w.length===0?o.jsx("div",{className:se.noResults,children:"Aucun résultat trouvé"}):o.jsx("ul",{role:"listbox",children:w.map((q,$)=>o.jsx("li",{className:D(q,$),onClick:()=>S(q),onMouseEnter:()=>x($),role:"option","aria-selected":q.value===t,"aria-disabled":q.disabled,children:o.jsxs("div",{className:se.buttonContent,children:[o.jsx("span",{className:se.optionLabel,title:q.label,children:q.label}),q.value===t&&o.jsx("svg",{className:se.checkIcon,fill:"currentColor",viewBox:"0 0 20 20",children:o.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})]})},q.value))})})]}),document.body)]})},w6e="_container_uq7pt_1",C6e="_item_uq7pt_7",N6e="_mainValue_uq7pt_13",j6e="_label_uq7pt_17",S6e="_subValue_uq7pt_22",$6e="_subValueWrapper_uq7pt_27",q6e="_subSeparator_uq7pt_32",Ze={container:w6e,item:C6e,mainValue:N6e,label:j6e,subValue:S6e,subValueWrapper:$6e,subSeparator:q6e},A6e=({dms:e,stats:t=[],itemWidth:n="120px",valueFontSize:c="28px",valueFontWeight:i=700,subFontSize:r="16px",subFontWeight:s=600,backgroundColor:d="#ffffff",labelColor:l="#6b7280",valueColor:h="#000000"})=>{const u=(p,y,f)=>{const[g,k]=p.split("/").map(x=>x.trim());return o.jsxs("span",{className:Ze.subValueWrapper,children:[o.jsx("span",{className:Ze.subLeft,style:{color:y},children:g}),o.jsx("span",{className:Ze.subSeparator,children:" / "}),o.jsx("span",{className:Ze.subRight,style:{color:f},children:k})]})};return o.jsxs("div",{className:Ze.container,style:{backgroundColor:d},children:[e&&o.jsxs("div",{className:Ze.item,style:{flex:`1 1 ${n}`},children:[o.jsx("div",{className:Ze.mainValue,style:{fontSize:c,fontWeight:i,color:h},children:e}),o.jsx("div",{className:Ze.label,style:{color:l},children:"DMS"})]}),t.map((p,y)=>o.jsxs("div",{className:Ze.item,style:{flex:`1 1 ${n}`},children:[o.jsx("div",{className:Ze.mainValue,style:{fontSize:c,fontWeight:i,color:h},children:p.value}),o.jsx("div",{className:Ze.label,style:{color:l},children:p.label}),o.jsx("div",{className:Ze.subValue,style:{fontSize:r,fontWeight:s},children:p.subValue&&u(p.subValue,p.subLeftColor,p.subRightColor)})]},y))]})},z6e="_encours_16ist_1",V6e="_header_16ist_19",P6e="_iconWrap_16ist_27",T6e="_title_16ist_36",H6e="_items_16ist_47",D6e="_spaceEvenly_16ist_56",B6e="_item_16ist_47",R6e="_valueContainer_16ist_86",F6e="_value_16ist_86",E6e="_label_16ist_108",rt={encours:z6e,header:V6e,iconWrap:P6e,title:T6e,items:H6e,spaceEvenly:D6e,item:B6e,valueContainer:R6e,value:F6e,label:E6e},qc=e=>typeof e=="number"?`${e}px`:typeof e=="string"?e:void 0;function O6e(e,t){const n={},c={};return e.valueColor&&(n.color=e.valueColor),e.valueFontSize!==void 0?n.fontSize=qc(e.valueFontSize):t.defaultValueFontSize!==void 0&&(n.fontSize=qc(t.defaultValueFontSize)),e.valueFontWeight!==void 0?n.fontWeight=e.valueFontWeight:t.defaultValueFontWeight!==void 0&&(n.fontWeight=t.defaultValueFontWeight),e.labelColor&&(c.color=e.labelColor),e.labelFontSize!==void 0?c.fontSize=qc(e.labelFontSize):t.defaultLabelFontSize!==void 0&&(c.fontSize=qc(t.defaultLabelFontSize)),e.labelFontWeight!==void 0?c.fontWeight=e.labelFontWeight:t.defaultLabelFontWeight!==void 0&&(c.fontWeight=t.defaultLabelFontWeight),{valueStyle:n,labelStyle:c}}function U6e(){return o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.4"}),o.jsx("path",{d:"M8 12h8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function W6e(e){const{title:t,titleColor:n,titleFontSize:c,titleFontWeight:i,icon:r,iconSize:s=18,iconColor:d,defaultValueFontSize:l,defaultValueFontWeight:h,defaultLabelFontSize:u,defaultLabelFontWeight:p,data:y,style:f,bg:g="#ffffff",width:k,gap:x,className:M,ariaLabel:v}=e,I=r?xt[r]:void 0,b={background:g,width:qc(k),...f},C={};n&&(C.color=n),c!==void 0&&(C.fontSize=qc(c)),i!==void 0&&(C.fontWeight=i);const w={};return d&&(w.color=d),o.jsxs("section",{className:`${rt.encours} ${M??""}`,style:b,"aria-label":v??t,children:[o.jsxs("div",{className:rt.header,children:[o.jsx("div",{className:rt.iconWrap,"aria-hidden":!0,style:w,children:I?o.jsx(I,{size:typeof s=="number"?s:void 0}):o.jsx(U6e,{})}),o.jsx("div",{className:rt.title,style:C,children:t})]}),o.jsx("div",{className:`${rt.items} ${x===void 0?rt.spaceEvenly:""}`,role:"list",style:x!==void 0?{gap:`${x}px`}:{},children:y.map((_,L)=>{const{valueStyle:S,labelStyle:N}=O6e(_,{defaultValueFontSize:l,defaultValueFontWeight:h,defaultLabelFontSize:u,defaultLabelFontWeight:p});return o.jsx("div",{className:rt.item,role:"listitem",style:{..._.background?{background:_.background}:{},..._.width?{width:qc(_.width)}:{}},children:o.jsxs("div",{className:rt.valueContainer,children:[o.jsx("div",{className:rt.value,style:S,children:_.value}),_.label&&o.jsx("div",{className:rt.label,style:N,children:_.label})]})},`${String(_.label??_.value)}-${L}`)})})]})}const G6e=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},Q.createElement("path",{d:"M480-360 280-559h400z"})),K6e=m.memo(G6e),Z6e=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},Q.createElement("path",{d:"m280-400 200-201 200 201z"})),X6e=m.memo(Z6e),Y6e=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16",...e},Q.createElement("path",{fill:"#0087BD",d:"M3 14a.96.96 0 0 1-.7-.3.96.96 0 0 1-.3-.7V3q0-.4.3-.7T3 2h10q.4 0 .7.3t.3.7v10q0 .4-.3.7t-.7.3zm3.983-3.55q.1 0 .192-.033a.36.36 0 0 0 .158-.117l4.117-4.133q.15-.15.15-.35a.54.54 0 0 0-.15-.367.52.52 0 0 0-.358-.133.5.5 0 0 0-.359.15l-3.75 3.75L5.35 7.583a.48.48 0 0 0-.7 0q-.15.15-.15.367 0 .216.15.35l1.983 2a.48.48 0 0 0 .35.15"})),J6e=m.memo(Y6e),Q6e=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16",...e},Q.createElement("path",{fill:"#1E2122",d:"M3 14a.96.96 0 0 1-.7-.3.96.96 0 0 1-.3-.7V3q0-.4.3-.7T3 2h10q.4 0 .7.3t.3.7v10q0 .4-.3.7t-.7.3zm0-1h10V3H3z"})),efe=m.memo(Q6e),tfe=({items:e,onSave:t,loading:n,disabled:c,saveLabel:i,savingLabel:r,buttonTitle:s,size:d=16,colors:l={bg:"#DADADA",activeBg:"var(--color-primary)",circle:"#FFFFFF",icon:"#1C1B1F",icon2:"#FFFFFF"},style:h,a11yConfig:u})=>{const[p,y]=m.useState(!1),[f,g]=m.useState(e),[k,x]=m.useState(!1);if(m.useEffect(()=>{x(!0)},[]),m.useEffect(()=>{g(e)},[e]),!k)return null;const M=(b,C)=>{C<4||g(w=>w.map(_=>_.component_key===b?{..._,visible:!_.visible}:_))},v=()=>{t(f),y(!1)},I=Z(u,s);return o.jsxs("div",{style:{position:"relative",display:"inline-block",...h},children:[o.jsxs("div",{onClick:()=>{c||y(!p)},style:{display:"flex",alignItems:"center",cursor:c?"not-allowed":"pointer",borderRadius:4,transition:"background 0.2s"},title:I,children:[o.jsx(JS,{width:d,height:d,fill:l?.icon||"currentColor",style:{transition:"color 0.2s"}}),p?o.jsx(X6e,{width:d,height:d,fill:l?.icon||"currentColor"}):o.jsx(K6e,{width:d,height:d,fill:l?.icon||"currentColor"})]}),p&&o.jsxs("div",{style:{position:"absolute",top:"120%",right:0,minWidth:260,background:"#fff",borderRadius:"0.25rem",boxShadow:"0px 3px 7px 0px rgba(17, 20, 21, 0.05),0px 14px 14px 0px rgba(17, 20, 21, 0.04),0px 30px 18px 0px rgba(17, 20, 21, 0.03), 0px 54px 22px 0px rgba(17, 20, 21, 0.01),0px 85px 24px 0px rgba(17, 20, 21, 0)",zIndex:235465456,padding:"0 0 0.5rem 0"},children:[o.jsx("ul",{style:{listStyle:"none",padding:0,margin:0},children:f.map((b,C)=>o.jsxs(m.Fragment,{children:[o.jsxs("li",{onClick:()=>M(b.component_key,C),style:{display:"flex",alignItems:"center",padding:"0.5rem",cursor:C<4?"not-allowed":"pointer",transition:"background 0.2s"},onMouseEnter:w=>{C>=4&&(w.currentTarget.style.background="#F9FAFB")},onMouseLeave:w=>{C>=4&&(w.currentTarget.style.background="transparent")},children:[o.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",marginRight:8,flexShrink:0},children:b.visible?o.jsx(J6e,{width:20,height:20,fill:l?.activeBg||"var(--color-primary, #008FBB)"}):o.jsx(efe,{width:20,height:20,fill:"#D1D5DB"})}),o.jsx("span",{style:{fontSize:"14px",color:"#111827",fontWeight:400,userSelect:"none"},children:b.label})]}),C===3&&o.jsx("div",{style:{height:1,background:"#E5E7EB",margin:"4px 0"}})]},b.component_key))}),o.jsx("div",{style:{padding:"12px 16px 0 16px",display:"flex",justifyContent:"flex-end"},children:o.jsx("button",{type:"button",onClick:v,disabled:n,style:{padding:"6px 16px",borderRadius:4,border:"none",background:"var(--color-primary, #008FBB)",color:"#fff",fontSize:"14px",fontWeight:500,cursor:n?"not-allowed":"pointer",transition:"opacity 0.2s",opacity:n?.7:1},children:n?r:i})})]})]})},afe="_container_zhny9_1",nfe="_card_zhny9_15",ofe="_footer_zhny9_33",cfe="_noPaddingMobile_zhny9_51",ri={container:afe,card:nfe,footer:ofe,noPaddingMobile:cfe},ife="_board_95t8m_1",rfe="_clickable_95t8m_21",sfe="_sideBar_95t8m_26",dfe="_boardContent_95t8m_32",lfe="_orange_95t8m_40",hfe="_red_95t8m_44",ufe="_green_95t8m_48",pfe="_grey_95t8m_52",yfe="_lightGrey_95t8m_56",kfe="_big_95t8m_61",mfe="_medium_95t8m_66",ffe="_headerRow_95t8m_70",gfe="_iconWrapper_95t8m_75",vfe="_headerTitle_95t8m_80",xfe="_valueArea_95t8m_89",Mfe="_titleWhite_95t8m_99",_fe="_titleBlack_95t8m_103",Lfe="_valueWhite_95t8m_108",Ife="_valueBlack_95t8m_112",bfe="_valueBlue_95t8m_116",wfe="_bars_95t8m_121",Cfe="_bar_95t8m_121",Nfe="_barDark_95t8m_135",jfe="_barDim_95t8m_139",Sfe="_predictionSection_95t8m_143",$fe="_predictionHeader_95t8m_155",qfe="_predictionBody_95t8m_162",Afe="_hasPrediction_95t8m_170",ze={board:ife,clickable:rfe,sideBar:sfe,boardContent:dfe,orange:lfe,red:hfe,green:ufe,grey:pfe,lightGrey:yfe,big:kfe,medium:mfe,headerRow:ffe,iconWrapper:gfe,headerTitle:vfe,valueArea:xfe,titleWhite:Mfe,titleBlack:_fe,valueWhite:Lfe,valueBlack:Ife,valueBlue:bfe,bars:wfe,bar:Cfe,barDark:Nfe,barDim:jfe,predictionSection:Sfe,predictionHeader:$fe,predictionBody:qfe,hasPrediction:Afe},zfe=({endingDark:e=!1,lightCount:t=5,className:n=""})=>{const c=Math.max(0,Math.min(5,Math.floor(t)));return o.jsx("div",{className:`${ze.bars} ${n} bars-data-board`,children:Array.from({length:5}).map((i,r)=>o.jsx("span",{className:`${ze.bar} ${r<c?"":e?ze.barDark:ze.barDim}`},r))})},vt=({a11yConfig:e,iconName:t,label:n,value:c,backgroundColor:i="green",bars:r,lightBars:s=5,size:d="big",valueScale:l,width:h,height:u,className:p="",style:y,titleColor:f="white",valueColor:g="white",titleFontSize:k,titleFontWeight:x,valueFontSize:M,valueFontWeight:v,barColor:I,justifyContent:b="space-between",alignItems:C="flex-start",cardGap:w="",onClick:_,iconColor:L,titleKey:S,predictionValue:N,predictionLabel:j})=>{const A=r!=="none",B=r==="endingDark",{padding:D,...V}=y||{},q=h===void 0&&u===void 0&&i===void 0&&Object.keys(V).length===0?void 0:{...h!==void 0?{width:h}:{},...u!==void 0?{height:u}:{},...i!==void 0?{backgroundColor:i}:{},...V},$=`${ze.board} ${ze[d]} ${N!==void 0?ze.hasPrediction:""} ${p}`;return o.jsxs("div",{className:$,onClick:_,style:l!==void 0?{...q,"--ds-value-scale":l}:q,children:[I&&o.jsx("div",{className:ze.sideBar,style:{backgroundColor:I}}),o.jsxs("div",{className:ze.boardContent,style:{padding:D,gap:w},children:[o.jsxs("div",{className:ze.headerRow,style:{justifyContent:b,alignItems:C},children:[t&&o.jsx("div",{className:ze.iconWrapper,style:{color:L},children:t}),o.jsx("div",{className:`${ze.headerTitle} header-title-data-board`,children:o.jsx("span",{title:Z(e,S),"aria-label":e?.description,style:{color:f,...k?{fontSize:k}:{},...x?{fontWeight:x}:{}},children:n})}),A?o.jsx(zfe,{endingDark:B,lightCount:s}):null]}),o.jsx("div",{className:ze.valueArea,style:{color:g,...M?{fontSize:M}:{},...v?{fontWeight:v}:{}},children:c})]}),N!==void 0&&o.jsxs("div",{className:ze.predictionSection,children:[o.jsx("div",{className:ze.predictionHeader,children:j??"PRED."}),o.jsx("div",{className:ze.predictionBody,children:N})]})]})},Vfe="_wrapper_1ydle_10",Pfe="_hosp_1ydle_19",Tfe="_headerRow_1ydle_54",Hfe="_iconWrapper_1ydle_61",Dfe="_headerTitle_1ydle_67",Bfe="_hospValue_1ydle_76",Rfe="_side_1ydle_88",Ffe="_mini_1ydle_100",Efe="_miniLabel_1ydle_131",Ofe="_miniValue_1ydle_140",Ufe="_miniBars_1ydle_150",Wfe="_bars_1ydle_155",Gfe="_bar_1ydle_155",Kfe="_barDark_1ydle_169",Zfe="_barDim_1ydle_173",Pe={wrapper:Vfe,hosp:Pfe,headerRow:Tfe,iconWrapper:Hfe,headerTitle:Dfe,hospValue:Bfe,side:Rfe,mini:Ffe,miniLabel:Efe,miniValue:Ofe,miniBars:Ufe,bars:Wfe,bar:Gfe,barDark:Kfe,barDim:Zfe},Xfe=({endingDark:e=!1,lightCount:t=5,className:n=""})=>{const c=Math.max(0,Math.min(5,Math.floor(t)));return o.jsx("div",{className:`${Pe.bars} ${n} bars-data-board`,children:Array.from({length:5}).map((i,r)=>o.jsx("span",{className:`${Pe.bar} ${r<c?"":e?Pe.barDark:Pe.barDim}`},r))})},gA=({left:e,right:t,className:n="",style:c,miniTilesCount:i=3})=>{const r=e.bars??"endingDark",s=r!=="none",d=r==="endingDark",l={...c,"--mini-tiles-count":i};return o.jsxs("div",{className:`${Pe.wrapper} ${n} data-four-boards`,style:l,children:[o.jsxs("div",{className:`${Pe.hosp} ${e.className||""}`,onClick:e.onClick,style:{...e.width?{width:e.width}:{},...e.height?{height:e.height}:{},...e.backgroundColor?{backgroundColor:e.backgroundColor}:{},...e.style||{}},title:Z(e.a11yConfig,e.titleKey),children:[o.jsxs("div",{className:Pe.headerRow,children:[o.jsxs("div",{className:`${Pe.iconWrapper} icon-wrapper-data-four-boards`,children:[e.iconName&&o.jsx("span",{style:{color:e.iconColor},children:e.iconName}),o.jsx("span",{className:Pe.headerTitle,style:{color:e.titleColor||"white",...e.titleFontSize?{fontSize:e.titleFontSize}:{},...e.titleFontWeight?{fontWeight:e.titleFontWeight}:{}},title:Z(e.a11yConfig,e.titleKey),children:e.label})]}),s?o.jsx(Xfe,{endingDark:d,lightCount:e.lightBars??5}):null]}),o.jsx("div",{className:Pe.hospValue,style:{color:e.valueColor||"white",...e.valueScale!==void 0?{"--ds-value-scale":e.valueScale}:{},...e.valueFontSize?{fontSize:e.valueFontSize}:{},...e.valueFontWeight?{fontWeight:e.valueFontWeight}:{}},children:e.value})]}),o.jsx("div",{className:Pe.side,children:t.map((h,u)=>o.jsxs("div",{className:`${Pe.mini} ${h.className||""} icon-wrapper-data-four-boards`,onClick:h.onClick,style:{...h.width?{width:h.width}:{},...h.height?{height:h.height}:{},...h.backgroundColor?{backgroundColor:h.backgroundColor}:{},...h.style||{}},title:Z(h.a11yConfig,h.titleKey),children:[o.jsxs("span",{className:Pe.miniLabel,style:{color:h.titleColor||"white",textAlign:"right",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",...h.titleFontSize?{fontSize:h.titleFontSize}:{},...h.titleFontWeight?{fontWeight:h.titleFontWeight}:{}},title:Z(h.a11yConfig,h.titleKey),children:[h.iconName&&o.jsx("span",{style:{color:h.iconColor},children:h.iconName}),h.label]}),o.jsx("span",{className:`${Pe.miniValue} mini-value-data-four-boards`,style:{color:h.valueColor||"white",textAlign:"right",...h.valueScale!==void 0?{"--ds-value-scale":h.valueScale}:{},...h.valueFontSize?{fontSize:h.valueFontSize}:{},...h.valueFontWeight?{fontWeight:h.valueFontWeight}:{}},children:h.value}),o.jsx("div",{className:Pe.miniBars})]},h.id??`${h.label}-${u}`))})]})},Yfe=({items:e,footerLabel:t,width:n,height:c,size:i=320,style:r,className:s="",backgroundColor:d,titleFontSize:l,titleFontWeight:h,valueFontSize:u,valueFontWeight:p,noPaddingLeftRight:y=!1,onItemClick:f})=>{const g={width:n??i,height:c,backgroundColor:d??"var(--ds-navy)",...r},k=e[0],x=e[1],M=e.slice(2,5);return o.jsxs("div",{style:g,className:`${ri.container} ${y?ri.noPaddingMobile:""} ${s}`,children:[o.jsxs("div",{className:ri.card,children:[k?o.jsx(vt,{a11yConfig:k.a11yConfig,label:k.label,value:k.value,backgroundColor:k.backgroundColor,bars:k.bars,lightBars:k.lightBars,size:k.size??"big",valueScale:k.valueScale,width:k.width,height:k.height,titleColor:"white",valueColor:"white",titleFontSize:k.titleFontSize??l,titleFontWeight:k.titleFontWeight??h,valueFontSize:k.valueFontSize??u,valueFontWeight:k.valueFontWeight??p,titleKey:k.titleKey,onClick:v=>f?.(0,v)}):null,x&&M.length>0?o.jsx(gA,{left:{a11yConfig:x.a11yConfig,id:x.id,label:x.label,value:x.value,backgroundColor:x.backgroundColor,bars:x.bars,lightBars:x.lightBars,valueScale:x.valueScale,width:x.width,height:x.height,titleFontSize:x.titleFontSize??l,titleFontWeight:x.titleFontWeight??h,valueFontSize:x.valueFontSize??u,valueFontWeight:x.valueFontWeight??p,titleKey:x.titleKey,onClick:v=>f?.(1,v)},right:M.map((v,I)=>({a11yConfig:v.a11yConfig,id:v.id,label:v.label,value:v.value,backgroundColor:v.backgroundColor,bars:v.bars,lightBars:v.lightBars,valueScale:v.valueScale,width:v.width,height:v.height,titleFontSize:v.titleFontSize??l,titleFontWeight:v.titleFontWeight??h,valueFontSize:v.valueFontSize??u,valueFontWeight:v.valueFontWeight??p,titleKey:v.titleKey,onClick:b=>f?.(2+I,b)}))}):x&&M.length===0?o.jsx(vt,{a11yConfig:x.a11yConfig,label:x.label,value:x.value,backgroundColor:x.backgroundColor,bars:x.bars,lightBars:x.lightBars,size:x.size??"big",valueScale:x.valueScale,width:x.width,height:x.height,titleColor:"white",valueColor:"white",titleFontSize:x.titleFontSize??l,titleFontWeight:x.titleFontWeight??h,valueFontSize:x.valueFontSize??u,valueFontWeight:x.valueFontWeight??p,onClick:v=>f?.(1,v)}):null]}),t&&o.jsx("div",{className:ri.footer,children:t})]})},Jfe=({x:e,y:t,width:n,payload:c,fontSize:i,fontWeight:r,stroke:s})=>o.jsx("g",{transform:`translate(${e},${t})`,children:o.jsx("foreignObject",{x:-n,y:-35,width:n,height:70,style:{overflow:"visible"},children:o.jsx("div",{style:{fontSize:i,fontWeight:r,color:s,lineHeight:"1.2",display:"flex",justifyContent:"flex-end",textAlign:"right",alignItems:"center",height:"100%",width:"100%",paddingRight:"8px",boxSizing:"border-box"},children:o.jsx("span",{style:{overflowWrap:"break-word",whiteSpace:"normal",display:"block",maxWidth:"100%"},children:c.value})})})}),Qfe=({data:e,height:t=360,barColor:n="#0284C7",tooltipEnabled:c=!0,backgroundColor:i="transparent",legendTextColor:r="var(--color-text)",barHeight:s=40,yAxisWidth:d=120,fontSize:l="12px",fontWeight:h="400",domain:u,xAxisLabel:p,margin:y={top:20,right:60,bottom:40,left:0},valueFormatter:f,tickFormatter:g,labelDataKey:k="percentage"})=>{const x=(y.top??20)+(y.bottom??40)+e.length*(s+20),M=Math.max(x,t),v=m.useMemo(()=>{if(!e||e.length===0)return d;const _=(parseFloat(l)||12)*.7,S=Math.max(...e.map(N=>(N.label||"").length))*_+16;return Math.min(Math.max(S,40),d)},[e,l,d]),I=w=>g?g(w):w?.toString()||"",b=w=>f&&k==="value"?f(w):w==null||w===""?"":k==="percentage"?`${w}%`:w.toString(),C=(w,_,L)=>{if(typeof w!="number")return w;const S=f?f(w):w.toString(),N=L?.payload?.percentage;return typeof N=="number"&&Number.isFinite(N)&&k==="percentage"?`${S} (${N.toFixed(1)}%)`:S};return o.jsx("div",{style:{backgroundColor:i,width:"100%"},children:o.jsx(a.ResponsiveContainer,{width:"100%",height:M,children:o.jsxs(a.BarChart,{data:e,layout:"vertical",margin:y,children:[o.jsx(a.CartesianGrid,{opacity:.4,stroke:"#E5E7EB",vertical:!1,horizontal:!0}),o.jsx(a.XAxis,{type:"number",domain:u||[0,"auto"],axisLine:!1,tickLine:!1,fontSize:l,fontWeight:h,stroke:r,tickFormatter:I,label:p?{value:p,position:"insideBottom",offset:-10,style:{textAnchor:"middle",fill:r,fontSize:12,fontWeight:"500"}}:void 0}),o.jsx(a.YAxis,{type:"category",dataKey:"label",stroke:r,axisLine:!1,tickLine:!1,width:v,interval:0,fontSize:l,fontWeight:h,tick:o.jsx(Jfe,{fontSize:l,fontWeight:h,stroke:r})}),c&&o.jsx(a.Tooltip,{formatter:C,labelStyle:{color:"var(--color-text)"}}),o.jsx(a.Bar,{dataKey:"value",fill:n,radius:0,barSize:s,children:o.jsx(a.LabelList,{dataKey:k,position:"right",offset:10,formatter:b,fill:r,fontSize:l,fontWeight:h})})]})})})},e8e="_menu_10i6j_1",t8e="_menuRow_10i6j_18",a8e="_separator_10i6j_33",n8e="_rowLabel_10i6j_39",o8e="_rowLeadingIcon_10i6j_47",c8e="_rowIcon_10i6j_54",Gc={menu:e8e,menuRow:t8e,separator:a8e,rowLabel:n8e,rowLeadingIcon:o8e,rowIcon:c8e},i8e=m.forwardRef(function({isVisible:t,onClose:n,items:c,style:i,position:r,bg:s},d){const l=m.useRef(null),h=d||l;if(m.useEffect(()=>{if(!t)return;const y=f=>{h.current&&!h.current.contains(f.target)&&n?.()};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[t,n]),!t)return null;const p={...{top:r?.top,left:r?.left,right:r?.right,bottom:r?.bottom},...s&&{backgroundColor:s},...i};return o.jsx("div",{ref:h,role:"menu",className:Gc.menu,style:p,children:c.map(y=>{if(y.type==="separator")return o.jsx("hr",{className:Gc.separator},y.id);const f=y,g=f.color?{color:f.color}:{},k=f.closeOnClick!==!1;return o.jsxs("button",{role:"menuitem",className:Gc.menuRow,style:g,onClick:()=>{f.onClick?.(),k&&n?.()},children:[o.jsxs("span",{className:Gc.rowLabel,children:[f.leadingIcon&&o.jsx("span",{className:Gc.rowLeadingIcon,children:f.leadingIcon}),o.jsx("span",{children:f.label})]}),f.icon&&o.jsx("span",{className:Gc.rowIcon,children:f.icon})]},f.id)})})}),vA=({user:e,logoutHref:t,logoutTarget:n="_self",onLogout:c,profileHref:i,profileLinkTarget:r="_self",backgroundColor:s="transparent",textColor:d="inherit",roleColor:l="#888",avatarSize:h="32px",padding:u="10px",gap:p="12px",emailFontSize:y="14px",emailFontWeight:f=600,roleFontSize:g="12px",roleFontWeight:k,avatarColor:x="#5b8fb9",backgroundColorAvatar:M="#f1f4f5",dropdownMenuItems:v,dropdownMenuStyle:I,dropdownMenuOffset:b,statusDotColor:C,a11yConfig:w,style:_,className:L=""})=>{const{user:S}=yt(),N=e||S,{currentTheme:j,switchTheme:A}=ML(),B=m.useRef(null),D=m.useRef(null),[V,q]=m.useState(!1),[$,H]=m.useState({}),R=m.useMemo(()=>{const ee=[],te=({variant:he})=>he==="sun"?o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("circle",{cx:"12",cy:"12",r:"4"})}):o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})});i&&(ee.push({id:"profile",type:"action",label:"Mon profil",onClick:()=>{typeof window>"u"||(r==="_blank"?window.open(i,"_blank","noopener,noreferrer"):window.location.assign(i))}}),ee.push({id:"sep-profile",type:"separator"}));const re=j==="dark";return ee.push({id:"theme",type:"action",label:re?"Mode clair":"Mode sombre",icon:o.jsx(te,{variant:re?"sun":"moon"}),onClick:()=>{A(re?"light":"dark")}}),(t||c)&&(ee.push({id:"sep-theme",type:"separator"}),ee.push({id:"logout",type:"action",label:"Se déconnecter",danger:!0,onClick:()=>{if(t){if(typeof window>"u")return;n==="_blank"?window.open(t,"_blank","noopener,noreferrer"):window.location.assign(t);return}c?.()}})),ee},[j,t,n,c,i,r,A]),z=v??R,U=()=>{if(!B.current){q(ee=>!ee);return}if(!V){const ee=B.current.getBoundingClientRect(),te=window.innerWidth,re=window.innerHeight,he=200,pe=200,O=4,K=b?.x??0,ne=b?.y??0,qe=te-ee.right>=he+O;H(qe?{top:ee.bottom-pe+ne,left:ee.right+O+K}:{bottom:re-ee.top+ne,left:ee.left+K})}q(ee=>!ee)};if(m.useEffect(()=>{if(!V||!B.current)return;const ee=()=>{const te=B.current.getBoundingClientRect(),re=window.innerWidth,he=window.innerHeight,pe=200,O=200,K=4,ne=b?.x??0,Ne=b?.y??0,ve=re-te.right>=pe+K;H(ve?{top:te.bottom-O+Ne,left:te.right+K+ne}:{bottom:he-te.top+Ne,left:te.left+ne})};return window.addEventListener("resize",ee),window.addEventListener("orientationchange",ee),()=>{window.removeEventListener("resize",ee),window.removeEventListener("orientationchange",ee)}},[V,b]),m.useEffect(()=>{if(!V||!B.current||!D.current)return;const ee=()=>{const re=B.current.getBoundingClientRect(),he=D.current.getBoundingClientRect(),pe=b?.x??0,O=b?.y??0;H(K=>K.left!==void 0&&K.top!==void 0&&K.left>=re.right-1?{top:re.bottom-he.height+O,left:K.left+pe}:K)},te=requestAnimationFrame(()=>{setTimeout(ee,0)});return()=>cancelAnimationFrame(te)},[V,b]),!N)return null;const X=N,ie=parseInt(h,10)||40,ae=`${ie*.375}px`,fe=`${ie*1.375}px`,de=`${ie*.2}px`,be=`${ie*.6}px`,oe=()=>{const ee=parseInt(h,10)||40,te=Math.max(8,ee*.34375),re=Math.max(2,ee*.05);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{position:"relative",flexShrink:0,userSelect:"none"},children:[X.image?o.jsx("img",{src:X.image,alt:`${X.prenom} ${X.nom}`,style:{width:h,height:h,borderRadius:"50%",objectFit:"cover",userSelect:"none"}}):o.jsxs("div",{style:{width:h,height:h,position:"relative",borderRadius:"50%",backgroundColor:M,overflow:"hidden",userSelect:"none"},children:[o.jsx("div",{style:{width:ae,height:ae,borderRadius:"50%",backgroundColor:x,position:"absolute",top:de,left:"50%",transform:"translateX(-50%)",zIndex:2,userSelect:"none"}}),o.jsx("div",{style:{width:fe,height:fe,borderRadius:"50%",backgroundColor:x,position:"absolute",top:be,left:"50%",transform:"translateX(-50%)",zIndex:1,userSelect:"none"}})]}),C&&o.jsx("div",{style:{position:"absolute",bottom:re,right:re,width:`${te}px`,height:`${te}px`,borderRadius:"50%",backgroundColor:C,border:"2px solid white",zIndex:10}})]}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",minWidth:0,flex:1},children:[o.jsx("span",{style:{fontWeight:f,fontSize:y,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:X.email,children:X.email}),o.jsx("span",{style:{color:l,fontSize:g,fontWeight:k,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:X.role,children:X.role})]})]})};return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:B,className:`user-info ${L}`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:u,backgroundColor:s,gap:p,color:d,width:"100%",boxSizing:"border-box",cursor:"pointer",userSelect:"none",..._},onClick:U,title:Z(w,X.role),role:"button",tabIndex:0,children:o.jsx("div",{style:{display:"flex",alignItems:"center",gap:p,flex:1,minWidth:0},children:o.jsx(oe,{})})}),o.jsx(i8e,{ref:D,isVisible:V,onClose:()=>q(!1),items:z,style:I,position:$})]})},r8e="_navItem_16uqf_1",s8e="_label_16uqf_14",d8e="_icon_16uqf_26",m1={navItem:r8e,label:s8e,icon:d8e},aC=({label:e,labelKey:t,onClick:n,href:c,isActive:i,icon:r,style:s,className:d="",highlightColor:l="#00aec7",color:h="#333",activeColor:u="#00aec7",highlightBackgroundColor:p="rgba(0, 0, 0, 0.05)",fontSize:y="15px",fontWeight:f="500",sidebarCollapsed:g=!1,padding:k="10px 16px",borderWidth:x="4px",iconGap:M="12px",disabled:v=!1,disabledColor:I,a11yConfig:b})=>{const C=()=>{v||n?.()},w=o.jsxs(o.Fragment,{children:[r&&o.jsx("span",{className:m1.icon,style:{marginRight:g?0:M},children:r}),!g&&o.jsx("span",{className:m1.label,children:e})]}),_=()=>{if(!i)return"transparent";const S=N=>{const j=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(N);return j?{r:parseInt(j[1],16),g:parseInt(j[2],16),b:parseInt(j[3],16)}:null};if(l.startsWith("#")){const N=S(l);if(N)return`rgba(${N.r}, ${N.g}, ${N.b}, 0.08)`}else if(l.startsWith("rgb")){const N=l.match(/\d+/g);if(N&&N.length>=3)return`rgba(${N[0]}, ${N[1]}, ${N[2]}, 0.08)`}return p},L={onClick:C,className:`${m1.navItem} ${i?m1.active:""} ${d} ${v?m1.disabled:""}`,style:{padding:k,color:i?u:v?I||"#999":h,borderLeft:i?`${x} solid ${l}`:`${x} solid transparent`,backgroundColor:_(),fontSize:y,fontWeight:f,cursor:v?"not-allowed":"pointer",textDecoration:"none",...s},"aria-disabled":v};return c&&!n&&!v?o.jsx("a",{href:c,...L,title:Z(b,t),children:w}):o.jsx("div",{...L,role:n?"button":void 0,tabIndex:n&&!v?0:void 0,title:Z(b,t),children:w})},l8e="_navbar_y5tex_1",h8e="_topSection_y5tex_9",u8e="_logoContainer_y5tex_14",p8e="_collapseToggle_y5tex_20",y8e="_collapsedRail_y5tex_37",k8e="_collapsedToggle_y5tex_44",m8e="_sectionsContainer_y5tex_67",f8e="_sectionTitle_y5tex_73",g8e="_sectionItems_y5tex_78",v8e="_bottomSection_y5tex_83",x8e="_versionContainer_y5tex_102",Xe={navbar:l8e,topSection:h8e,logoContainer:u8e,collapseToggle:p8e,collapsedRail:y8e,collapsedToggle:k8e,sectionsContainer:m8e,sectionTitle:f8e,sectionItems:g8e,bottomSection:v8e,versionContainer:x8e},M8e=({logoProps:e,logoSpacing:t,navItems:n,padding:c="24px 16px",sectionSpacing:i="32px",itemSpacing:r="4px",backgroundColor:s="#fff",highlightColor:d="#00aec7",highlightBackgroundColor:l="rgba(0, 0, 0, 0.05)",version:h,navSectionStyle:u,navLinkStyle:p,navItemPadding:y="10px 16px",navItemBorderWidth:f="4px",navItemIconGap:g="12px",navItemFontSize:k="15px",navItemFontWeight:x="500",navItemColor:M,sectionTitlePadding:v="16px",sectionTitleFontSize:I="11px",sectionTitleColor:b="#999",sectionTitleWeight:C="500",versionFontSize:w="12px",versionFontWeight:_="400",versionColor:L="#999",userInfoProps:S,style:N,className:j="",width:A="280px",showLogo:B=!0,versionA11yConfig:D,displayNone:V=!1,showCollapseToggle:q=!1,collapsed:$=!1,onCollapseToggle:H,collapseToggleLabel:R="Toggle sidebar",collapseToggleIconPath:z="/icon/dock_to_left.svg"})=>{const U=yt(),X=U.activeNav,ie=U.setActiveNav,ae=U.user,fe=S.user||ae;return q&&$?o.jsx("div",{className:`${Xe.collapsedRail} ${j}`,style:{display:V?"none":"flex"},children:o.jsx("button",{type:"button",className:Xe.collapsedToggle,onClick:H,"aria-label":R,children:o.jsx(pw,{path:z,width:18,height:18})})}):o.jsxs("div",{className:`${Xe.navbar} ${j}`,style:{width:A,backgroundColor:s,padding:c,display:V?"none":"flex",...N},children:[o.jsxs("div",{className:Xe.topSection,style:{gap:t},children:[B&&o.jsxs("div",{className:Xe.logoContainer,children:[o.jsx(xL,{...e}),q&&o.jsx("button",{type:"button",className:Xe.collapseToggle,onClick:H,"aria-label":R,children:o.jsx(pw,{path:z,width:20,height:20})})]}),o.jsx("div",{className:Xe.sectionsContainer,style:{gap:i},children:n.map((de,be)=>o.jsxs("div",{className:Xe.section,children:[de.title&&o.jsx("div",{className:Xe.sectionTitle,title:Z(de.a11yConfig,de.titleKey),style:{fontSize:I,color:b,padding:v,fontWeight:C,border:"4px solid transparent",...u},children:de.title}),o.jsx("div",{className:Xe.sectionItems,style:{gap:r},children:de.items.map(oe=>o.jsx(aC,{...oe,isActive:oe.isActive===null?oe.isActive:X===oe.id,onClick:()=>{oe.onClick&&oe.onClick(),oe.isActive==null&&ie(oe.id)},highlightColor:d,activeColor:d,highlightBackgroundColor:l,padding:y,borderWidth:f,iconGap:g,fontSize:k,fontWeight:x,color:M,style:p},oe.id))})]},be))})]}),o.jsxs("div",{className:Xe.bottomSection,style:{gap:t},children:[o.jsx(vA,{...S,user:fe}),h&&o.jsx("div",{className:Xe.versionContainer,title:Z(D,h),style:{fontSize:w,fontWeight:_,color:L},children:h})]})]})},_8e="_container_4qege_1",L8e="_titleContainer_4qege_10",I8e="_title_4qege_10",b8e="_inlineToggleContainer_4qege_24",w8e="_rightContentContainer_4qege_30",f1={container:_8e,titleContainer:L8e,title:I8e,inlineToggleContainer:b8e,rightContentContainer:w8e},C8e=({className:e="",style:t,fontSize:n="20px",fontWeight:c="bold",color:i="#000",padding:r="0",margin:s,backgroundColor:d,width:l,height:h,border:u,borderRadius:p,navItems:y,allNavItems:f,formatTitle:g=M=>M,rightContent:k,inlineToggle:x})=>{const{activeNav:M}=yt(),v=y.find(b=>b.id===M)||f?.find(b=>b.id===M),I=v?g(v.label):M||"";return I?o.jsxs("div",{className:`${f1.container} ${e}`,style:{padding:r,margin:s,backgroundColor:d,width:l,height:h,border:u,borderRadius:p,...t},children:[o.jsxs("div",{className:f1.titleContainer,children:[o.jsx("div",{className:f1.title,style:{fontSize:n,fontWeight:c,color:i},children:I}),x&&o.jsx("div",{className:f1.inlineToggleContainer,children:x})]}),k&&o.jsx("div",{className:f1.rightContentContainer,children:k})]}):null},N8e="_navItem_1hg26_1",j8e="_navItemIcon_1hg26_21",S8e="_navItemLabel_1hg26_29",$8e="_navItemCount_1hg26_36",q8e="_navItemIndicator_1hg26_49",g1={navItem:N8e,navItemIcon:j8e,navItemLabel:S8e,navItemCount:$8e,navItemIndicator:q8e},xA=({a11yConfig:e,label:t,isActive:n,onClick:c,href:i,labelKey:r,icon:s,count:d,activeColor:l="#00aec7",inactiveColor:h="#666",activeBackgroundColor:u="transparent",countBackgroundColor:p,countColor:y="#fff",countBorderRadius:f="10px",countPadding:g="2px 6px",countFontSize:k="12px",countFontWeight:x="500",indicatorColor:M="#00aec7",indicatorHeight:v="3px",padding:I="8px 4px",fontSize:b="14px",fontWeight:C="500",gap:w="8px",style:_,className:L="",disabled:S=!1,onNavigate:N})=>{const j=()=>{S||(c?.(),i&&(N?N(i):window.location.href=i))};return o.jsxs("div",{className:`${g1.navItem} ${L}`,onClick:j,title:Z(e,r),style:{gap:w,padding:I,color:n?l:h,backgroundColor:n?u:"transparent",fontSize:b,fontWeight:C,..._},children:[s&&o.jsx("span",{className:g1.navItemIcon,children:s}),o.jsx("span",{className:g1.navItemLabel,children:t}),d!==void 0&&o.jsx("span",{className:g1.navItemCount,style:{backgroundColor:p,color:y,borderRadius:f,padding:g,fontSize:k,fontWeight:x},children:d}),n&&!S&&o.jsx("div",{className:g1.navItemIndicator,style:{height:v,backgroundColor:M}})]})},A8e="_container_13hsa_1",z8e="_groupHeader_13hsa_8",V8e="_groupHeaderLeft_13hsa_18",P8e="_groupIcon_13hsa_23",T8e="_dropdown_13hsa_29",H8e="_item_13hsa_42",D8e="_itemIcon_13hsa_65",B8e="_chevron_13hsa_72",R8e="_chevronOpen_13hsa_79",mt={container:A8e,groupHeader:z8e,groupHeaderLeft:V8e,groupIcon:P8e,dropdown:T8e,item:H8e,itemIcon:D8e,chevron:B8e,chevronOpen:R8e},F8e=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},Q.createElement("path",{d:"M480-344 240-584l43-43 197 197 197-197 43 43z"})),R1=m.memo(F8e),MA=({groups:e,activeItemId:t,onItemClick:n,style:c,className:i,bgColor:r="transparent",color:s="var(--color-text)",headerBgColor:d="var(--color-indicator)",headerColor:l="var(--color-text)",headerBorderBottomColor:h="var(--color-border)",dropdownBgColor:u="var(--color-background)",itemBgColor:p="transparent",itemHoverBgColor:y="rgba(0,0,0,0.05)",itemColor:f="var(--color-text)",itemActiveColor:g="var(--color-primary)",itemActiveBorderColor:k="var(--color-primary)",itemDividerColor:x="var(--color-border)",iconColor:M="#555555",activeIconColor:v="var(--color-primary)",headerIconColor:I="var(--color-text)",chevronColor:b="var(--color-text)",iconSize:C=22,headerPadding:w="14px 20px",itemPadding:_="14px 20px",iconGap:L=14,borderRadius:S=0})=>{const[N,j]=m.useState(""),A=m.useRef(null);m.useEffect(()=>{const D=V=>{A.current&&!A.current.contains(V.target)&&j("")};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[]);const B={backgroundColor:r,color:s,borderRadius:S,...c};return o.jsx("nav",{ref:A,className:[mt.container,i].filter(Boolean).join(" "),style:B,children:e.map(D=>{const V=N===D.id,q={backgroundColor:d,color:l,padding:w,borderBottom:`1px solid ${h}`,gap:L},$={backgroundColor:u};return o.jsxs("div",{children:[o.jsxs("div",{className:mt.groupHeader,style:q,onClick:()=>j(V?"":D.id),role:"button","aria-expanded":V,children:[o.jsxs("div",{className:mt.groupHeaderLeft,style:{gap:L},children:[D.icon&&o.jsx("span",{className:mt.groupIcon,style:{color:I,width:C,height:C},children:D.icon}),o.jsx("span",{children:D.label})]}),o.jsx("span",{className:[mt.chevron,V?mt.chevronOpen:""].join(" "),style:{color:b},children:o.jsx(R1,{width:18,height:18})})]}),V&&o.jsx("div",{className:mt.dropdown,style:$,children:D.items.map(H=>{const R=H.id===t,z={padding:_,gap:L,color:R?g:f,backgroundColor:p,"--item-border-width":R?"4px":"1px","--item-border-color":R?k:x};return o.jsxs("div",{className:mt.item,style:z,onClick:()=>{n?.(D.id,H.id),j("")},role:"menuitem",onMouseEnter:U=>{R||(U.currentTarget.style.backgroundColor=y)},children:[H.icon&&o.jsx("span",{className:mt.itemIcon,style:{color:R?v:M,width:C,height:C},children:H.icon}),o.jsx("span",{children:H.label})]},H.id)})})]},D.id)})})},E8e="_subheaderContent_1glo8_1",O8e="_navContainer_1glo8_11",U8e="_rightContent_1glo8_45",Db={subheaderContent:E8e,navContainer:O8e,rightContent:U8e},W8e=({subNavItems:e,backgroundColor:t="transparent",padding:n="0",margin:c,width:i,height:r="auto",border:s,borderBottom:d="none",itemGap:l="24px",actionsGap:h="16px",itemPadding:u="12px 0",itemFontSize:p="14px",itemFontWeight:y="500",activeItemColor:f="#00aec7",inactiveItemColor:g="#5c6975",indicatorHeight:k="3px",showDraggable:x=!1,showLegend:M=!1,showData:v=!1,className:I="",style:b,countBackgroundColor:C,countColor:w,countBorderRadius:_,countPadding:L,countFontSize:S,countFontWeight:N,navContainerClassName:j,navContainerStyle:A,rightContentClassName:B,rightContentStyle:D,rightActions:V,activeSwitcherColor:q,inactiveSwitcherColor:$,isMobile:H=!1,onNavigate:R})=>{const{activeSubNav:z,setActiveSubNav:U,navCounts:X,activeNav:ie}=yt();if(H){const ae=e.find(de=>de.id===z)||e[0],fe=[{id:"current-group",label:ae?.label||ie?.toUpperCase()||"MENU",icon:ae?.icon,items:e.map(de=>({id:de.id,label:de.label,icon:de.icon}))}];return o.jsx("div",{className:I,style:b,children:o.jsx(MA,{groups:fe,activeItemId:z,onItemClick:(de,be)=>{const oe=e.find(ee=>ee.id===be);oe&&(oe.onClick&&oe.onClick(),oe.href&&(R?R(oe.href):oe.onNavigate?oe.onNavigate(oe.href):window.location.href=oe.href),U(be))},headerBgColor:t})})}return o.jsxs("div",{className:`${Db.subheaderContent} ${I}`,style:{backgroundColor:t,padding:n,margin:c,width:i,height:r,border:s,borderBottom:d,...b},children:[o.jsx("div",{className:`${Db.navContainer} ${j||""}`,style:{gap:l,...A},children:e.map(ae=>{const fe=ae.count!==void 0?ae.count:X[ae.id],de=z===ae.id||ae.isActive;return o.jsx(xA,{...ae,onNavigate:R||ae.onNavigate,count:fe,isActive:de,onClick:()=>{ae.onClick&&ae.onClick(),U(ae.id)},activeColor:f,inactiveColor:g,countBackgroundColor:C,countColor:w,countBorderRadius:_,countPadding:L,countFontSize:S,countFontWeight:N,indicatorColor:f,indicatorHeight:k,padding:u,fontSize:p,fontWeight:y,gap:"8px",style:ae.style},ae.id)})}),o.jsxs("div",{className:`${Db.rightContent} ${B||""}`,style:{gap:h,...D},children:[x&&o.jsx(dL,{size:20,colors:{bg:q,activeBg:$,icon:"#1C1B1F",icon2:"#FFFFFF"}}),M&&o.jsx(lL,{size:20,colors:{bg:q,activeBg:$,icon:"#1C1B1F",icon2:"#FFFFFF"}}),v&&o.jsx(hL,{size:20,colors:{bg:q,activeBg:$,icon:"#1C1B1F",icon2:"#FFFFFF"}}),V]})]})},G8e=({onSwitch:e,size:t="20px",lightIconColor:n="#666",darkIconColor:c="#fff",backgroundColor:i="transparent",padding:r="8px",borderRadius:s="50%",style:d,className:l=""})=>{const[h,u]=m.useState(!1),{currentTheme:p,switchTheme:y}=ML(),f=p!="dark",g=()=>{y(f?"dark":"light"),e?.()};return m.useEffect(()=>{u(!0)},[]),!h||!p?o.jsx(o.Fragment,{}):o.jsx("div",{className:`theme-switcher ${l}`,onClick:g,style:{cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:i,padding:r,borderRadius:s,transition:"all 0.3s ease",...d},children:f?o.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}):o.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:c,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"5"}),o.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),o.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),o.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),o.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),o.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),o.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),o.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),o.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]})})},K8e=({initialSortBy:e=null,initialSortOrder:t="asc",onSortChange:n})=>{const[c,i]=m.useState({sortBy:e,sortOrder:t,filters:{}}),r=m.useCallback(s=>{let d="asc";c.sortBy===s&&(d=c.sortOrder==="asc"?"desc":"asc");const l={...c,sortBy:s,sortOrder:d};i(l),n(s,d)},[c,n]);return{tableState:c,handleSort:r}},Z8e=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#FFF",viewBox:"0 -960 960 960",...e},Q.createElement("path",{d:"M440-800v487L216-537l-56 57 320 320 320-320-56-57-224 224v-487z"})),X8e=m.memo(Z8e),Y8e=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#FFF",viewBox:"0 -960 960 960",...e},Q.createElement("path",{d:"M440-160v-487L216-423l-56-57 320-320 320 320-56 57-224-224v487z"})),J8e=m.memo(Y8e),Q8e=({columns:e,sortBy:t,sortOrder:n,onSort:c,removeLabelSpan:i=!1})=>o.jsx("thead",{children:o.jsx("tr",{children:e.map((r,s)=>{const d=t===r.key,l=!!r.sortable;return o.jsx("th",{className:`${r.className||""}${l?" sortable":""}`,style:{width:r.width,textAlign:r.align||"left"},onClick:()=>l&&c(String(r.key)),title:Z(r.a11yConfig,r.titleKey),children:o.jsxs("div",{className:`th-content ${r.align?`align-${r.align}`:""}`,children:[i?r.label:o.jsx("span",{children:r.label}),l&&o.jsx("span",{className:"sort-icon-container",style:{display:"inline-flex",alignItems:"center"},children:d&&n==="asc"?o.jsx(J8e,{width:16,height:16,style:{fill:"currentColor",transition:"all 0.2s ease"}}):o.jsx(X8e,{width:16,height:16,style:{fill:"currentColor",opacity:d?1:.5,transition:"all 0.2s ease"}})})]})},String(r.key)||s)})})}),ege=({data:e,columns:t,rowKey:n,onRowClick:c,isLoading:i,text:r,rowStyle:s,rowClassName:d,renderSeparator:l})=>!e.length&&!i?o.jsx("tbody",{children:o.jsx("tr",{children:o.jsx("td",{colSpan:t.length,style:{textAlign:"center",padding:"32px"},children:o.jsx("span",{style:{color:"var(--table-text-muted)"},children:r?.noData||"Aucune donnée disponible"})})})}):o.jsx("tbody",{children:e.map((h,u)=>{const p=h[n],y=typeof p=="string"||typeof p=="number"?p:u,f=l?l(h):null;return o.jsx("tr",{onClick:()=>c&&c(h),style:{cursor:c?"pointer":"default",...s?s(h):{}},className:d?d(h,u):"",children:f?o.jsx("td",{colSpan:t.length,children:f}):t.map((g,k)=>o.jsx("td",{style:{width:g.width,textAlign:g.align||"left"},className:g.className,children:g.render?g.render(h):h[g.key]},`${String(g.key)}-${k}`))},y)})}),tge=({state:e,onPaginationChange:t,onLoadMore:n,infiniteScroll:c,hasMore:i,text:r,isLoading:s,pageSizeOptions:d})=>{const{page:l,pageSize:h,total:u}=e,p=h===-1?u:h,y=Math.ceil(u/p)||1,f=Math.min(Math.max(1,l),y),g=u===0?0:(f-1)*p+1,k=Math.min(f*p,u),x=b=>{t({page:b})},M=m.useMemo(()=>{if(y<=6)return Array.from({length:y},(A,B)=>B+1);const w=Math.max(f-1,1),_=Math.min(f+1,y),L=w>2,S=_<y-2,N=1,j=y;if(!L&&S)return[...Array.from({length:5},(D,V)=>V+1),"...",y];if(L&&!S){const B=Array.from({length:5},(D,V)=>y-5+V+1);return[N,"...",...B]}if(L&&S){const A=Array.from({length:_-w+1},(B,D)=>w+D);return[N,"...",...A,"...",j]}return[]},[f,y]),v=!!(d&&d.length>0),I=!c&&h!==-1&&y>1&&o.jsxs("div",{className:"pagination-controls",children:[o.jsx("button",{className:"pagination-btn",onClick:()=>x(1),disabled:f===1,title:r?.first||"Premier",children:"<<"}),o.jsx("button",{className:"pagination-btn",onClick:()=>x(f-1),disabled:f===1,title:r?.previous||"Précédent",children:"<"}),(M||[]).map((b,C)=>b==="..."?o.jsx("span",{style:{padding:"0 4px",color:"var(--table-text-muted)"},children:"..."},C):o.jsx("button",{className:`pagination-btn ${b===f?"active":""}`,onClick:()=>x(b),children:b},C)),o.jsx("button",{className:"pagination-btn",onClick:()=>x(f+1),disabled:f===y,title:r?.next||"Suivant",children:">"}),o.jsx("button",{className:"pagination-btn",onClick:()=>x(y),disabled:f===y,title:r?.last||"Dernier",children:">>"})]});return o.jsxs("div",{className:"table-pagination",children:[o.jsx("div",{className:"pagination-summary",children:u>0?o.jsx("span",{children:r?.itemsRange?r.itemsRange(g,k,u):o.jsxs(o.Fragment,{children:[o.jsxs("b",{children:[g,"–",k]})," ",r?.of||"sur"," ",o.jsx("b",{children:u.toLocaleString()})," ",r?.items||"éléments"]})}):o.jsx("span",{children:r?.noResults||"0 résultats"})}),v?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"pagination-center",children:I}),o.jsxs("div",{className:"pagination-pagesize",children:[o.jsx("label",{htmlFor:"table-pagination-pagesize",children:r?.perPage||"Par page"}),o.jsx("select",{id:"table-pagination-pagesize",value:h,onChange:b=>t({pageSize:Number(b.target.value),page:1}),children:(d||[]).map(b=>o.jsx("option",{value:b,children:b},b))})]})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"pagination-spacer"}),I]}),!c&&n&&i&&o.jsx("div",{className:"pagination-load-more",children:o.jsx("button",{className:"btn-load-more",onClick:n,disabled:s,style:{padding:"8px 16px",backgroundColor:"white",border:"1px solid #ddd",borderRadius:"6px",cursor:s?"wait":"pointer",color:"#555",fontWeight:600},children:s?r?.loading||"Chargement...":r?.loadMore||"Charger plus"})})]})},_A=({data:e,columns:t,isLoading:n,pagination:c,onPaginationChange:i,onSortChange:r,rowKey:s,loaderSize:d=40,stickyHeader:l=!0,height:h,minHeight:u="200px",text:p,onLoadMore:y,infiniteScroll:f,hasMore:g,tableState:k,className:x,style:M,rowStyle:v,onRowClick:I,rowClassName:b,titleKey:C,removeLabelSpan:w=!1,a11yConfig:_,renderSeparator:L,pageSizeOptions:S})=>{const N=m.useMemo(()=>({...p}),[p]),j=m.useRef(null);m.useEffect(()=>{if(!f||!y||!g||n)return;const $=new IntersectionObserver(H=>{H[0].isIntersecting&&y()},{threshold:.1});return j.current&&$.observe(j.current),()=>$.disconnect()},[f,y,g,n]);const{tableState:A,handleSort:B}=K8e({initialSortBy:null,onSortChange:r}),D=(k?.sortBy!==void 0?k.sortBy:A.sortBy)??void 0,V=k?.sortOrder!==void 0?k.sortOrder:A.sortOrder,q=$=>{const H=D,R=V;let z="asc";H===$&&(z=R==="asc"?"desc":"asc"),k?.sortBy!==void 0?r($,z):B($)};return o.jsxs("div",{className:`table-container ${x||""}`,style:M,title:Z(_,C),children:[o.jsxs("div",{className:"table-frame",style:{height:h??void 0,minHeight:u??void 0},children:[n&&o.jsx("div",{className:"table-loader-overlay",children:o.jsx("div",{className:"spinner",style:{width:d,height:d,borderTopColor:"var(--table-primary)"}})}),o.jsxs("div",{className:`table-wrapper ${l?"sticky-header":""}`,children:[o.jsxs("table",{className:"data-table",children:[o.jsx(Q8e,{columns:t,sortBy:D,sortOrder:V,onSort:q,removeLabelSpan:w}),o.jsx(ege,{data:e,columns:t.map($=>({...$,render:$.render?H=>$.render(H,{}):void 0})),rowKey:s,onRowClick:I,isLoading:n,text:N,rowStyle:typeof v=="function"?v:v?()=>v:void 0,rowClassName:b,renderSeparator:L})]}),f&&o.jsx("div",{ref:j,style:{height:20,margin:10}})]})]}),o.jsx(tge,{state:c,onPaginationChange:i,text:N,onLoadMore:y,infiniteScroll:f,hasMore:g,isLoading:n,pageSizeOptions:S})]})},age="_datePickerContainer_1gx2l_3",nge="_label_1gx2l_16",oge="_displayNode_1gx2l_23",cge="_datePickerButton_1gx2l_30",ige="_datePickerButtonDisabled_1gx2l_50",rge="_datePickerButtonOpen_1gx2l_59",sge="_datePickerLabel_1gx2l_68",dge="_placeholder_1gx2l_79",lge="_trailingIcons_1gx2l_83",hge="_chevron_1gx2l_89",uge="_clearButton_1gx2l_97",pge="_errorMessage_1gx2l_114",yge="_dropdown_1gx2l_119",kge="_calendarHeader_1gx2l_143",mge="_navButton_1gx2l_152",fge="_headerSelectors_1gx2l_171",gge="_monthSelector_1gx2l_179",vge="_yearSelector_1gx2l_180",xge="_selectorButton_1gx2l_184",Mge="_selectorChevron_1gx2l_201",_ge="_selectorChevronOpen_1gx2l_206",Lge="_monthDropdown_1gx2l_210",Ige="_yearDropdown_1gx2l_211",bge="_monthItem_1gx2l_231",wge="_yearItem_1gx2l_232",Cge="_monthItemSelected_1gx2l_254",Nge="_yearItemSelected_1gx2l_255",jge="_weekdays_1gx2l_259",Sge="_weekday_1gx2l_259",$ge="_calendarGrid_1gx2l_275",qge="_dateCell_1gx2l_284",Age="_dateCellSelected_1gx2l_307",zge="_dateCellOtherMonth_1gx2l_311",Vge="_dateCellOtherMonthSelected_1gx2l_315",Pge="_calendarFooter_1gx2l_319",Tge="_cancelButton_1gx2l_327",Hge="_applyButton_1gx2l_328",Dge="_timePickerContainer_1gx2l_372",Bge="_timeGroup_1gx2l_381",Rge="_timeLabel_1gx2l_388",Fge="_timeInputWrapper_1gx2l_394",Ege="_timeInput_1gx2l_394",Oge="_timeSeparator_1gx2l_422",W={datePickerContainer:age,label:nge,displayNode:oge,datePickerButton:cge,datePickerButtonDisabled:ige,datePickerButtonOpen:rge,datePickerLabel:sge,placeholder:dge,trailingIcons:lge,chevron:hge,clearButton:uge,errorMessage:pge,dropdown:yge,calendarHeader:kge,navButton:mge,headerSelectors:fge,monthSelector:gge,yearSelector:vge,selectorButton:xge,selectorChevron:Mge,selectorChevronOpen:_ge,monthDropdown:Lge,yearDropdown:Ige,monthItem:bge,yearItem:wge,monthItemSelected:Cge,yearItemSelected:Nge,weekdays:jge,weekday:Sge,calendarGrid:$ge,dateCell:qge,dateCellSelected:Age,dateCellOtherMonth:zge,dateCellOtherMonthSelected:Vge,calendarFooter:Pge,cancelButton:Tge,applyButton:Hge,timePickerContainer:Dge,timeGroup:Bge,timeLabel:Rge,timeInputWrapper:Fge,timeInput:Ege,timeSeparator:Oge},Uge=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},Q.createElement("path",{d:"m336-280 144-144 144 144 56-56-144-144 144-144-56-56-144 144-144-144-56 56 144 144-144 144zM480-80q-83 0-156-31.5T197-197t-85.5-127T80-480t31.5-156T197-763t127-85.5T480-880t156 31.5T763-763t85.5 127T880-480t-31.5 156T763-197t-127 85.5T480-80m0-80q134 0 227-93t93-227-93-227-227-93-227 93-93 227 93 227 227 93m0-320"})),Wge=m.memo(Uge),jS=["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],Gge=["Lun","Mar","Mer","Jeu","Ven","Sam","Dim"],kw=({value:e,onChange:t,label:n,placeholder:c="Sélectionner une date...",className:i="",fullWidth:r=!0,disabled:s=!1,error:d,buttonHeight:l="2.75rem",buttonPadding:h="0.75rem 1rem 0.75rem 1rem",dropdownMaxHeight:u="auto",fontSize:p="0.875rem",iconSize:y="1.5rem",labelMarginBottom:f="0.5rem",errorMarginTop:g="0.25rem",dropdownMarginTop:k="0.25rem",itemPadding:x="0.5rem 0.75rem",fontWeight:M="400",buttonBgColor:v,buttonBorderColor:I,buttonTextColor:b,dropdownBgColor:C="#ffffff",itemHoverColor:w,selectedItemBgColor:_,iconColor:L,errorColor:S,labelColor:N,placeholderColor:j,borderRadius:A="var(--radius-content)",borderWidth:B="0.0625rem",boxShadow:D="0 0.25rem 0.75rem rgba(0, 0, 0, 0.1)",transitionDuration:V="0.2s",transitionTiming:q="ease",dateCellSize:$="2.5rem",headerTextColor:H="#6c757d",weekdayTextColor:R="#6c757d",currentMonthDateColor:z="#212529",otherMonthDateColor:U="#adb5bd",selectedDateBgColor:X="#00A6D9",selectedDateTextColor:ie="#ffffff",cancelButtonBgColor:ae="#e9ecef",cancelButtonTextColor:fe="#212529",applyButtonBgColor:de="#00A6D9",applyButtonTextColor:be="#ffffff",width:oe,displayNode:ee=void 0,displayMode:te="auto",displayNodeAriaLabel:re,dropdownPosition:he="auto",dropdownAlignment:pe="right",dropdownWidth:O,withBorder:K=!1,icon:ne,precision:Ne="day",horizontalTimePicker:qe=!1,hoursLabel:ve="Heures",minutesLabel:Ve="Minutes",lowerLimit:kt=null,upperLimit:bt=null,outOfLimitsMessage:le="La date/heure choisie est hors des limites autorisées",months:wt,weekdays:zL,cancelText:_e="Annuler",applyText:Ft="Appliquer",prevMonthAriaLabel:wA="Mois précédent",nextMonthAriaLabel:CA="Mois suivant",calendarAriaLabel:NA="Sélecteur de date",openedAriaLabel:jA="Ouvrir le sélecteur de date",selectedDateAriaLabel:SA="Date sélectionnée: ",rotateIcon:$A=!0,clearable:qA=!1,clearAriaLabel:AA="Effacer la date"})=>{const Ct=T=>{if(T instanceof Date)return isNaN(T.getTime())?null:T;if(typeof T=="string"&&T){const G=new Date(T);return isNaN(G.getTime())?null:G}return null},[Oe,Et]=m.useState(!1),[u1,zA]=m.useState({top:0,left:0,width:0}),[nC,VA]=m.useState("bottom"),[oC,PA]=m.useState(null),[ue,p1]=m.useState(Ct(e)||new Date),[y1,VL]=m.useState(Ct(e)),[Q1,PL]=m.useState(Ct(e)?.getHours()??0),[ei,TL]=m.useState(Ct(e)?.getMinutes()??0),[HL,Rc]=m.useState(!1),[DL,Fc]=m.useState(!1),BL=m.useRef(null),Ec=m.useRef(null),cC=m.useRef(null),RL=m.useRef(null),FL=m.useRef(null),iC=m.useRef(Ct(e)?.getTime());m.useEffect(()=>{const T=Ct(e),G=T?.getTime();G!==iC.current&&(iC.current=G,VL(T),T&&(p1(T),PL(T.getHours()),TL(T.getMinutes())))},[e]);const rC=m.useCallback(()=>{if(Ec.current){const T=Ec.current.getBoundingClientRect();zA({top:T.top,left:T.left,width:T.width})}},[]),sC=8,ti=m.useCallback(()=>{if(!Ec.current)return;const T=Ec.current.getBoundingClientRect(),G=(parseFloat(k.replace("rem",""))||0)*16,xe=T.top-G-sC,Nt=window.innerHeight-T.bottom-G-sC;let Ue;if(he!=="auto")Ue=he;else{const He=cC.current?.scrollHeight??0;Ue=He<=Nt?"bottom":He<=xe||xe>Nt?"top":"bottom"}VA(He=>He===Ue?He:Ue),PA(Math.max(Ue==="bottom"?Nt:xe,0))},[he,k]),Oc=m.useCallback(()=>{rC(),ti()},[rC,ti]);m.useEffect(()=>(Oe&&(Oc(),window.addEventListener("scroll",Oc,!0),window.addEventListener("resize",Oc)),()=>{window.removeEventListener("scroll",Oc,!0),window.removeEventListener("resize",Oc)}),[Oe,Oc]),m.useLayoutEffect(()=>{Oe&&ti()},[Oe,ti]),m.useEffect(()=>{const T=G=>{if(BL.current&&!BL.current.contains(G.target)){const xe=document.getElementById("datepicker-dropdown");if(xe&&xe.contains(G.target))return;Et(!1),Rc(!1),Fc(!1)}RL.current&&!RL.current.contains(G.target)&&Rc(!1),FL.current&&!FL.current.contains(G.target)&&Fc(!1)};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[]);const dC=T=>new Date(T.getFullYear(),T.getMonth()+1,0).getDate(),TA=T=>{const G=new Date(T.getFullYear(),T.getMonth(),1).getDay();return G===0?6:G-1},HA=()=>{const T=[],G=TA(ue),xe=dC(ue),Nt=new Date(ue.getFullYear(),ue.getMonth()-1,1),Ue=dC(Nt);for(let we=G-1;we>=0;we--)T.push(new Date(ue.getFullYear(),ue.getMonth()-1,Ue-we));for(let we=1;we<=xe;we++)T.push(new Date(ue.getFullYear(),ue.getMonth(),we));const He=42-T.length;for(let we=1;we<=He;we++)T.push(new Date(ue.getFullYear(),ue.getMonth()+1,we));return T},DA=(T,G)=>!T||!G?!1:T.getDate()===G.getDate()&&T.getMonth()===G.getMonth()&&T.getFullYear()===G.getFullYear(),BA=T=>T.getMonth()===ue.getMonth()&&T.getFullYear()===ue.getFullYear(),lC=T=>!(kt&&T<kt||bt&&T>bt),hC=y1?(()=>{const T=new Date(y1);return T.setHours(Q1),T.setMinutes(ei),T})():null,Uc=hC?!lC(hC):!1,RA=()=>{p1(new Date(ue.getFullYear(),ue.getMonth()-1,1))},FA=()=>{p1(new Date(ue.getFullYear(),ue.getMonth()+1,1))},EA=T=>{if(!s){const G=new Date(T);G.setHours(Q1),G.setMinutes(ei),VL(G)}},OA=()=>{if(!s){if(y1){const T=new Date(y1);if(T.setHours(Q1),T.setMinutes(ei),!lC(T))return;t(T)}else t(null);Et(!1)}},UA=()=>{const T=Ct(e);VL(T),T&&(PL(T.getHours()),TL(T.getMinutes())),Et(!1)},WA=T=>{p1(new Date(ue.getFullYear(),T,1)),Rc(!1)},GA=T=>{p1(new Date(T,ue.getMonth(),1)),Fc(!1)},KA=()=>{const T=ue.getFullYear(),G=[];for(let xe=T-10;xe<=T+10;xe++)G.push(xe);return G},ZA=T=>{if(!s)switch(T.key){case"Enter":case" ":T.preventDefault(),Et(!Oe);break;case"Escape":Et(!1),Rc(!1),Fc(!1);break;case"Tab":Oe&&(Et(!1),Rc(!1),Fc(!1));break}},XA={width:oe||(r?"100%":"auto"),fontSize:p,fontWeight:M},YA={height:l,padding:h,backgroundColor:v||"#ffffff",border:K?void 0:"none",borderColor:d?S||"#dc3545":I||"#dee2e6",color:b||"#212529",borderRadius:A,borderWidth:B,fontWeight:M,transition:`all ${V} ${q}`},JA=qe?{flexDirection:"column",borderTop:"none",borderLeft:"1px solid #eee"}:{},QA=qe?{flex:1,minWidth:0}:void 0,ez=qe?{display:"flex",flexDirection:"row",alignItems:"stretch"}:void 0,tz={backgroundColor:C||"#ffffff",maxHeight:u==="auto"?oC!=null?`${oC}px`:void 0:u,overflowY:"auto",borderRadius:A,borderWidth:B,boxShadow:D,transition:`opacity ${V} ${q}, transform ${V} ${q}`,position:"fixed",top:nC==="bottom"?u1.top+(Ec.current?.offsetHeight||0)+parseFloat(k.replace("rem",""))*16:"auto",bottom:nC==="top"?window.innerHeight-u1.top+parseFloat(k.replace("rem",""))*16:"auto",left:pe==="left"?u1.left:"auto",right:pe==="right"?window.innerWidth-(u1.left+u1.width):"auto",width:O||"30vw",minWidth:O?void 0:0,zIndex:10001},uC={width:y,height:y,color:L||"#6c757d","--icon-rotation":$A&&Oe?"rotate(180deg)":"rotate(0deg)"},az={color:N||"#212529",marginBottom:f,fontWeight:M},nz={color:j||"#6c757d"},oz={color:S||"#dc3545",marginTop:g},cz=HA(),tt=Ct(e),pC=T=>`${T.getDate().toString().padStart(2,"0")}/${(T.getMonth()+1).toString().padStart(2,"0")}/${T.getFullYear()}`,yC=tt?Ne==="minutes"?`${pC(tt)} ${tt.getHours().toString().padStart(2,"0")}:${tt.getMinutes().toString().padStart(2,"0")}`:pC(tt):"",kC=!!ee&&(te==="icon"||te==="auto"&&!tt),iz=qA&&!kC&&!!tt&&!s,rz={width:"0.875rem",height:"0.875rem",color:L||"#6c757d"},sz=re||(tt?`${SA}${yC}`:jA);return o.jsxs("div",{className:`${W.datePickerContainer} ${i}`,ref:BL,style:XA,"data-fullwidth":r,"data-disabled":s,"data-error":!!d,children:[n&&o.jsx("label",{className:W.label,style:az,children:n}),o.jsxs("button",{ref:Ec,type:"button",onClick:()=>!s&&Et(!Oe),onKeyDown:ZA,className:`
|
|
8335
|
+
${W.datePickerButton}
|
|
8336
|
+
${Oe?W.datePickerButtonOpen:""}
|
|
8337
|
+
${s?W.datePickerButtonDisabled:""}
|
|
8338
|
+
`,style:YA,disabled:s,"aria-expanded":Oe,"aria-haspopup":"dialog","aria-label":sz,"aria-labelledby":n?`${n}-label`:void 0,children:[kC?o.jsx("span",{className:W.displayNode,"aria-hidden":!0,children:ee}):o.jsx("span",{className:`${W.datePickerLabel} ${tt?"":W.placeholder}`,style:tt?void 0:nz,children:tt?yC:c}),o.jsxs("span",{className:W.trailingIcons,children:[iz&&o.jsx("span",{role:"button",tabIndex:0,className:W.clearButton,"aria-label":AA,onClick:T=>{T.stopPropagation(),t(null)},onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),T.stopPropagation(),t(null))},children:o.jsx(Wge,{fill:"var(--color-text)",style:rz})}),ne?o.jsx("span",{className:W.chevron,style:uC,children:ne}):o.jsx(R1,{fill:"var(--color-text)",className:`${W.chevron} ${Oe?W.chevronOpen:""}`,style:uC})]})]}),d&&o.jsx("div",{className:W.errorMessage,style:oz,children:d}),Oe&&!s&&mw.createPortal(o.jsxs("div",{id:"datepicker-dropdown",ref:cC,className:W.dropdown,style:tz,role:"dialog","aria-label":NA,children:[o.jsxs("div",{style:ez,children:[o.jsxs("div",{style:QA,children:[o.jsxs("div",{className:W.calendarHeader,children:[o.jsx("button",{type:"button",className:W.navButton,onClick:RA,"aria-label":wA,children:"‹"}),o.jsxs("div",{className:W.headerSelectors,children:[o.jsxs("div",{className:W.monthSelector,ref:RL,children:[o.jsxs("button",{type:"button",className:W.selectorButton,onClick:()=>Rc(!HL),style:{color:H,"--hover-color":w},children:[(wt||jS)[ue.getMonth()],o.jsx(R1,{fill:"var(--color-text)",className:`${W.selectorChevron} ${HL?W.selectorChevronOpen:""}`,style:{width:"0.75rem",height:"0.75rem",marginLeft:"0.25rem"}})]}),HL&&o.jsx("div",{className:W.monthDropdown,children:(wt||jS).map((T,G)=>o.jsx("button",{type:"button",className:`${W.monthItem} ${ue.getMonth()===G?W.monthItemSelected:""}`,onClick:()=>WA(G),style:{padding:x,backgroundColor:ue.getMonth()===G?_||"#e7f1ff":C},onMouseEnter:xe=>{w&&ue.getMonth()!==G&&(xe.currentTarget.style.backgroundColor=w)},onMouseLeave:xe=>{w&&(xe.currentTarget.style.backgroundColor=ue.getMonth()===G?_||"#e7f1ff":C)},children:T},G))})]}),o.jsxs("div",{className:W.yearSelector,ref:FL,children:[o.jsxs("button",{type:"button",className:W.selectorButton,onClick:()=>Fc(!DL),style:{color:H,"--hover-color":w},children:[ue.getFullYear(),o.jsx(R1,{fill:"var(--color-text)",className:`${W.selectorChevron} ${DL?W.selectorChevronOpen:""}`,style:{width:"0.75rem",height:"0.75rem",marginLeft:"0.25rem"}})]}),DL&&o.jsx("div",{className:W.yearDropdown,children:KA().map(T=>o.jsx("button",{type:"button",className:`${W.yearItem} ${ue.getFullYear()===T?W.yearItemSelected:""}`,onClick:()=>GA(T),style:{padding:x,backgroundColor:ue.getFullYear()===T?_||"#e7f1ff":C},onMouseEnter:G=>{w&&ue.getFullYear()!==T&&(G.currentTarget.style.backgroundColor=w)},onMouseLeave:G=>{w&&(G.currentTarget.style.backgroundColor=ue.getFullYear()===T?_||"#e7f1ff":C)},children:T},T))})]})]}),o.jsx("button",{type:"button",className:W.navButton,onClick:FA,"aria-label":CA,children:"›"})]}),o.jsx("div",{className:W.weekdays,children:(zL||Gge).map(T=>o.jsx("div",{className:W.weekday,style:{color:R},children:T},T))}),o.jsx("div",{className:W.calendarGrid,children:cz.map((T,G)=>{if(!T)return null;const xe=DA(T,y1),Nt=BA(T),Ue=we=>new Date(we.getFullYear(),we.getMonth(),we.getDate()).getTime(),He=!!(kt&&Ue(T)<Ue(kt)||bt&&Ue(T)>Ue(bt));return o.jsx("button",{type:"button",className:`${W.dateCell} ${xe?W.dateCellSelected:""} ${xe?W.dateCellOtherMonthSelected:""} ${Nt?"":W.dateCellOtherMonth} ${He?W.dateCellDisabled:""}`,onClick:()=>!He&&EA(T),disabled:He,style:{width:$,height:$,color:xe?ie:Nt?z:U,backgroundColor:xe?X:"transparent",opacity:He?.4:1,cursor:He?"not-allowed":"pointer"},onMouseEnter:we=>{!xe&&!He&&w&&(we.currentTarget.style.backgroundColor=w)},onMouseLeave:we=>{xe||(we.currentTarget.style.backgroundColor="transparent")},children:T.getDate()},G)})})]}),Ne==="minutes"&&o.jsxs("div",{className:W.timePickerContainer,style:JA,children:[o.jsxs("div",{className:W.timeGroup,children:[o.jsx("span",{className:W.timeLabel,children:ve}),o.jsx("div",{className:W.timeInputWrapper,children:o.jsx("input",{type:"number",min:"0",max:"23",value:Q1,onChange:T=>{const G=parseInt(T.target.value);!isNaN(G)&&G>=0&&G<=23&&PL(G)},className:W.timeInput,style:Uc?{borderColor:"#dc2626",color:"#dc2626"}:void 0})})]}),!qe&&o.jsx("span",{className:W.timeSeparator,children:":"}),o.jsxs("div",{className:W.timeGroup,children:[o.jsx("span",{className:W.timeLabel,children:Ve}),o.jsx("div",{className:W.timeInputWrapper,children:o.jsx("input",{type:"number",min:"0",max:"59",value:ei,onChange:T=>{const G=parseInt(T.target.value);!isNaN(G)&&G>=0&&G<=59&&TL(G)},className:W.timeInput,style:Uc?{borderColor:"#dc2626",color:"#dc2626"}:void 0})})]})]})]}),Uc&&o.jsx("div",{role:"alert",style:{color:"#dc2626",fontSize:"0.75rem",padding:"0 4px 4px",textAlign:"center"},children:le}),o.jsxs("div",{className:W.calendarFooter,children:[o.jsx("button",{type:"button",className:W.cancelButton,onClick:UA,style:{backgroundColor:ae,color:fe,borderRadius:A,padding:x},children:_e}),o.jsx("button",{type:"button",className:W.applyButton,onClick:OA,disabled:Uc,style:{backgroundColor:de,color:be,borderRadius:A,padding:x,opacity:Uc?.5:1,cursor:Uc?"not-allowed":"pointer"},children:Ft})]})]}),document.body)]})},Kge="_selectContainer_1ptm9_1",Zge="_label_1ptm9_15",Xge="_selectButton_1ptm9_23",Yge="_selectButtonDisabled_1ptm9_43",Jge="_selectButtonOpen_1ptm9_48",Qge="_selectButtonContent_1ptm9_58",e7e="_selectIcon_1ptm9_66",t7e="_selectLabel_1ptm9_72",a7e="_placeholder_1ptm9_79",n7e="_chevron_1ptm9_84",o7e="_errorMessage_1ptm9_93",c7e="_dropdown_1ptm9_99",i7e="_dropdownContent_1ptm9_123",r7e="_item_1ptm9_129",s7e="_itemSelected_1ptm9_151",d7e="_itemContent_1ptm9_155",l7e="_itemIcon_1ptm9_162",h7e="_itemLabel_1ptm9_168",Ce={selectContainer:Kge,label:Zge,selectButton:Xge,selectButtonDisabled:Yge,selectButtonOpen:Jge,selectButtonContent:Qge,selectIcon:e7e,selectLabel:t7e,placeholder:a7e,chevron:n7e,errorMessage:o7e,dropdown:c7e,dropdownContent:i7e,item:r7e,itemSelected:s7e,itemContent:d7e,itemIcon:l7e,itemLabel:h7e},LA=({items:e,value:t,onChange:n,label:c,placeholder:i="Sélectionner...",className:r="",fullWidth:s=!0,disabled:d=!1,error:l,buttonHeight:h="var(--select-button-height, 2.75rem)",buttonPadding:u="var(--select-button-padding, 0.75rem)",dropdownMaxHeight:p="var(--select-dropdown-max-height, 15rem)",fontSize:y="var(--select-font-size, 0.875rem)",fontWeight:f,iconSize:g="var(--select-icon-size, 1.5rem)",labelMarginBottom:k="var(--select-label-margin-bottom, 0.5rem)",errorMarginTop:x="var(--select-error-margin-top, 0.25rem)",dropdownMarginTop:M="var(--select-dropdown-margin-top, 0.25rem)",itemPadding:v="var(--select-item-padding, 0.5rem 0.75rem)",gap:I="var(--select-gap, 0.5rem)",buttonBgColor:b,buttonBorderColor:C,buttonTextColor:w,dropdownBgColor:_,itemHoverColor:L,selectedItemBgColor:S,iconColor:N,errorColor:j,labelColor:A,placeholderColor:B,border:D,borderRadius:V="var(--select-border-radius, 0.5rem)",borderWidth:q="var(--select-border-width, 0.0625rem)",boxShadow:$="var(--select-box-shadow, 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1))",transitionDuration:H="var(--select-transition-duration, 0.2s)",transitionTiming:R="var(--select-transition-timing, ease)",scrollbarWidth:z="var(--select-scrollbar-width, 0.375rem)",scrollbarTrackColor:U="var(--select-scrollbar-track-color, #f1f1f1)",scrollbarThumbColor:X="var(--select-scrollbar-thumb-color, #c1c1c1)",width:ie,minWidth:ae,dropdownPosition:fe="bottom",dropdownAlignment:de="right",dropdownWidth:be,a11yConfig:oe,titleKey:ee})=>{const[te,re]=m.useState(!1),he=m.useRef(null),pe=e.find(_e=>_e.value===t);m.useEffect(()=>{const _e=Ft=>{he.current&&!he.current.contains(Ft.target)&&re(!1)};return document.addEventListener("mousedown",_e),()=>document.removeEventListener("mousedown",_e)},[]);const O=_e=>{d||(n(_e),re(!1))},K=_e=>{if(!d)switch(_e.key){case"Enter":case" ":_e.preventDefault(),re(!te);break;case"Escape":re(!1);break;case"Tab":te&&re(!1);break}},ne={width:ie||(s?"100%":"auto"),minWidth:ae,fontSize:y},Ne={height:h,padding:u,backgroundColor:b||"var(--select-button-bg-color, #ffffff)",border:D,borderColor:l?j||"var(--select-error-color, #dc3545)":C||"var(--select-button-border-color, #dee2e6)",color:w||"var(--select-button-text-color, #212529)",borderRadius:V,borderWidth:q,transition:`all ${H} ${R}`,fontWeight:f},qe={backgroundColor:_||"var(--select-dropdown-bg-color, #ffffff)",maxHeight:p,borderRadius:V,borderWidth:q,boxShadow:$,transition:`opacity ${H} ${R}, transform ${H} ${R}`,position:"absolute",top:fe==="bottom"?"100%":"auto",bottom:fe==="top"?"100%":"auto",left:de==="left"?0:"auto",right:de==="right"?0:"auto",width:be||(s?"100%":"auto"),marginTop:fe==="bottom"?M:0,marginBottom:fe==="top"?M:0,zIndex:1001},ve={width:g,height:g,color:N||"var(--select-icon-color, #6c757d)","--icon-rotation":te?"rotate(180deg)":"rotate(0deg)"},Ve={color:A||"var(--select-label-color, #212529)",marginBottom:k},kt={color:B||"var(--select-placeholder-color, #6c757d)"},bt={color:j||"var(--select-error-color, #dc3545)",marginTop:x},le={padding:v,transition:`background-color ${H} ${R}`,fontWeight:f},wt={gap:I},zL={"--scrollbar-width":z,"--scrollbar-track-color":U,"--scrollbar-thumb-color":X};return o.jsxs("div",{className:`${Ce.selectContainer} ${r}`,ref:he,style:ne,"data-fullwidth":s,"data-disabled":d,"data-error":!!l,title:Z(oe,ee),children:[c&&o.jsx("label",{className:Ce.label,style:Ve,children:c}),o.jsxs("button",{type:"button",onClick:()=>!d&&re(!te),onKeyDown:K,className:`
|
|
8339
8339
|
${Ce.selectButton}
|
|
8340
8340
|
${te?Ce.selectButtonOpen:""}
|
|
8341
8341
|
${d?Ce.selectButtonDisabled:""}
|
|
8342
|
-
`,style:Ne,disabled:d,"aria-expanded":te,"aria-haspopup":"listbox","aria-labelledby":c?`${c}-label`:void 0,children:[o.jsxs("div",{className:Ce.selectButtonContent,style:wt,children:[
|
|
8342
|
+
`,style:Ne,disabled:d,"aria-expanded":te,"aria-haspopup":"listbox","aria-labelledby":c?`${c}-label`:void 0,children:[o.jsxs("div",{className:Ce.selectButtonContent,style:wt,children:[pe?.icon&&o.jsx("span",{className:Ce.selectIcon,style:ve,children:pe.icon}),o.jsx("span",{className:`${Ce.selectLabel} ${pe?"":Ce.placeholder}`,style:pe?void 0:kt,children:pe?pe.label:i})]}),o.jsx(R1,{fill:"var(--color-text)",className:`${Ce.chevron} ${te?Ce.chevronOpen:""}`,style:ve})]}),l&&o.jsx("div",{className:Ce.errorMessage,style:bt,children:l}),te&&!d&&o.jsx("div",{className:Ce.dropdown,style:qe,role:"listbox","aria-label":c||"Options de sélection",children:o.jsx("div",{className:Ce.dropdownContent,style:zL,children:e.map(_e=>o.jsx("button",{type:"button",onClick:()=>O(_e.value),className:`
|
|
8343
8343
|
${Ce.item}
|
|
8344
8344
|
${t===_e.value?Ce.itemSelected:""}
|
|
8345
|
-
`,style:{...he,backgroundColor:t===_e.value?S||"#F0F4F6":"transparent"},onMouseEnter:Ft=>{L&&(Ft.currentTarget.style.backgroundColor=L)},onMouseLeave:Ft=>{L&&(Ft.currentTarget.style.backgroundColor=t===_e.value?S||"#F0F4F6":"transparent")},role:"option","aria-selected":t===_e.value,children:o.jsxs("div",{className:Ce.itemContent,style:wt,children:[_e.icon&&o.jsx("span",{className:Ce.itemIcon,style:ve,children:_e.icon}),o.jsx("span",{className:Ce.itemLabel,children:_e.label})]})},_e.value))})})]})},u7e="_filterBar_1hlqe_3",p7e="_label_1hlqe_11",SS={filterBar:u7e,label:p7e},y7e=({label:e="Filtres",startDate:t,endDate:n,granularity:c,onStartDateChange:i,onEndDateChange:r,onGranularityChange:s,granularityItems:d,startDatePlaceholder:l="Date début",endDatePlaceholder:h="Date fin",granularityPlaceholder:u="Sélectionner...",className:p="",disabled:y=!1,gap:f="0.75rem",labelFontSize:g="0.875rem",labelFontWeight:k="400",labelColor:x="#212529",labelMarginRight:M="1rem",startDateWidth:v,endDateWidth:I,selectWidth:b,datePickerProps:C={},selectProps:w={},rightContent:_,extraContent:L})=>{const S={fontSize:g,fontWeight:k,color:x,marginRight:M},N={gap:f};return o.jsxs("div",{className:`${SS.filterBar} ${p}`,style:N,children:[e&&o.jsx("span",{className:SS.label,style:S,children:e}),o.jsx(kw,{value:t,onChange:i,placeholder:l,fullWidth:!1,disabled:y,label:void 0,width:v,...C}),o.jsx(kw,{value:n,onChange:r,placeholder:h,fullWidth:!1,disabled:y,label:void 0,width:I,...C}),o.jsx(LA,{items:d,value:c,onChange:s,placeholder:u,fullWidth:!1,disabled:y,label:void 0,width:b,...w}),L,_&&o.jsx("div",{style:{marginLeft:"auto"},children:_})]})},k7e="_container_1x6mq_16",m7e="_disabled_1x6mq_26",f7e="_predStyle_1x6mq_32",g7e="_realStyle_1x6mq_36",v7e="_predGap_1x6mq_40",x7e="_realGap_1x6mq_44",M7e="_big_1x6mq_49",_7e="_medium_1x6mq_53",L7e="_iconWrapper_1x6mq_58",I7e="_predRelative_1x6mq_68",b7e="_realRelative_1x6mq_72",w7e="_iconImg_1x6mq_76",C7e="_content_1x6mq_84",N7e="_header_1x6mq_93",j7e="_predJustify_1x6mq_99",S7e="_realJustify_1x6mq_103",$7e="_predHeaderLineHeight_1x6mq_116",q7e="_realHeaderLineHeight_1x6mq_120",A7e="_title_1x6mq_129",z7e="_titleBlack_1x6mq_144",V7e="_titleWhite_1x6mq_148",P7e="_subtitle_1x6mq_153",T7e="_valueRowHorizontal_1x6mq_163",H7e="_valueRowVertical_1x6mq_171",D7e="_singleValue_1x6mq_180",B7e="_primaryRow_1x6mq_184",R7e="_maxBadge_1x6mq_191",F7e="_valuePrimary_1x6mq_203",E7e="_valuePrimaryBlack_1x6mq_210",O7e="_valuePrimaryWhite_1x6mq_214",U7e="_valueSlash_1x6mq_219",W7e="_valueSecondary_1x6mq_226",G7e="_valueSecondaryBlue_1x6mq_232",K7e="_valueSecondaryWhite_1x6mq_236",Z7e="_valueSecondaryBlack_1x6mq_240",X7e="_valueStacked_1x6mq_245",Y7e="_stackedTop_1x6mq_254",J7e="_stackedBottom_1x6mq_255",ye={container:k7e,disabled:m7e,predStyle:f7e,realStyle:g7e,predGap:v7e,realGap:x7e,big:M7e,medium:_7e,iconWrapper:L7e,predRelative:I7e,realRelative:b7e,iconImg:w7e,content:C7e,header:N7e,predJustify:j7e,realJustify:S7e,predHeaderLineHeight:$7e,realHeaderLineHeight:q7e,title:A7e,titleBlack:z7e,titleWhite:V7e,subtitle:P7e,valueRowHorizontal:T7e,valueRowVertical:H7e,singleValue:D7e,primaryRow:B7e,maxBadge:R7e,valuePrimary:F7e,valuePrimaryBlack:E7e,valuePrimaryWhite:O7e,valueSlash:U7e,valueSecondary:W7e,valueSecondaryBlue:G7e,valueSecondaryWhite:K7e,valueSecondaryBlack:Z7e,valueStacked:X7e,stackedTop:Y7e,stackedBottom:J7e},Q7e=({a11yConfig:e,iconName:t,title:n,subtitle:c,showSubtitle:i,realised:r="-",prediction:s="-",size:d="big",titleColor:l="black",valueColor:h="blue",realValueColor:u,className:p="",style:y="",variant:f="horizontal",showMax:g=!1,titleFontSize:k,titleFontWeight:x,subtitleFontSize:M,subtitleFontWeight:v,primaryFontSize:I,primaryFontWeight:b,secondaryFontSize:C,secondaryFontWeight:w,backgroundColor:_="#f2f9fc",gap:L="",disabled:S=!1,positionRelative:N="",justifyContent:j="",headerLineHeight:A="",headerMinHeight:B="",contentSpace:D="",titleKey:V,subtitleKey:q,subtitleA11yKey:$,maxBadgeKey:H,maxBadgeA11yKey:R,predictionKey:z,predictionA11yKey:O,realisedKey:X,realisedA11yKey:ie})=>{const ae=i!==void 0?i:!!c,fe=`${ye.container} ${ye[d]} ${ye[y]} ${S?ye.disabled:""}`,le=h==="white"?ye.valuePrimaryWhite:ye.valuePrimaryBlack,be=h==="blue"?ye.valueSecondaryBlue:h==="white"?ye.valueSecondaryWhite:ye.valueSecondaryBlack,ne=se=>se===void 0?void 0:typeof se=="number"?`${se}px`:se,ee=se=>se===void 0?void 0:se,te=f==="vertical",re=s!=null&&s!==""&&s!=="-"&&s!=="—",pe=te?ye.valueRowVertical:ye.valueRowHorizontal;return o.jsxs("div",{className:`${fe} ${p}`,style:{backgroundColor:_},children:[t&&o.jsx("div",{className:`${ye.iconWrapper} ${ye[N]}`,children:t}),o.jsxs("div",{className:`${ye.content} ${ye[L]} ${re?"":ye.singleValue} content-indicator-v2`,style:{justifyContent:D},children:[o.jsx("div",{className:`${ye.header} ${ye[j]} ${ye[A]} header-indicator-v2`,style:{minHeight:B},children:o.jsx("h6",{className:`${ye.title}`,style:{fontSize:ne(k),fontWeight:ee(x),color:l},title:Z(e,V),children:n})}),ae&&c?o.jsx("div",{className:"subtitle-container",children:o.jsx("span",{className:ye.subtitle,style:{fontSize:ne(M),fontWeight:ee(v)},title:Z(e,q,$),children:c})}):null,o.jsxs("div",{className:`${pe} count-indicator-v2`,children:[o.jsxs("div",{className:ye.primaryRow,children:[g&&o.jsx("span",{className:`${ye.maxBadge} max-badge-indicator-v2`,title:Z(e,H,R),children:"MAX"}),o.jsx("span",{className:`${ye.valuePrimary} ${le}`,style:{fontSize:ne(I||(!re&&te?"1.75rem":void 0)),fontWeight:ee(b),color:u||void 0},title:Z(e,X,ie),children:r})]}),re&&o.jsxs(o.Fragment,{children:[!te&&o.jsx("span",{className:ye.valueSlash,style:{fontSize:ne(C),fontWeight:ee(w)},children:"/"}),o.jsx("span",{className:`${ye.valueSecondary} ${be}`,style:{fontSize:ne(C),fontWeight:ee(w)},title:Z(e,z,O),children:s})]})]})]})]})},eve="_banner_f10in_2",tve="_iep_f10in_14",ave="_groupSmall_f10in_24",nve="_genre_f10in_34",ove="_gravite_f10in_42",cve="_orientationContainer_f10in_48",ive="_service_f10in_61",rve="_roomBedContainer_f10in_71",sve="_room_f10in_71",dve="_bed_f10in_87",lve="_bedUf_f10in_92",hve="_statusContainer_f10in_97",uve="_status_f10in_97",pve="_centeredWarn_f10in_124",Be={banner:eve,iep:tve,groupSmall:ave,genre:nve,gravite:ove,orientationContainer:cve,service:ive,roomBedContainer:rve,room:sve,bed:dve,bedUf:lve,statusContainer:hve,status:uve,centeredWarn:pve},yve=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16",...e},Q.createElement("mask",{id:"a",width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},Q.createElement("path",{fill:"#D9D9D9",d:"M0 0h16v16H0z"})),Q.createElement("g",{mask:"url(#a)"},Q.createElement("path",{fill:"#C60000",d:"M.666 14 7.999 1.333 15.333 14zm2.3-1.333h10.067L7.999 4zm5.508-.859a.65.65 0 0 0 .192-.475.65.65 0 0 0-.192-.475.65.65 0 0 0-.475-.191.65.65 0 0 0-.475.191.65.65 0 0 0-.191.475q0 .285.191.475A.65.65 0 0 0 8 12a.65.65 0 0 0 .475-.192M7.333 10h1.333V6.667H7.333z"}))),$S=m.memo(yve),kve=({patient:e,genre:t,gravite:n,bed:c,bed_uf:i,room:r,orientation:s,status:d,backgroundColor:l="#ffffff",primaryFontColor:h="#111827",secondaryFontColor:u="#6b7280",statusFontColor:p="#0284c7",statusBackgroundColor:y="#e0f2fe",genreBackgroundColor:f="#9ca3af",genreFontSize:g,style:k,warn:x=!1,warnMessage:M,warnColor:v="#F94134"})=>o.jsxs("div",{className:Be.banner,style:{backgroundColor:l,...k},children:[o.jsxs("div",{className:Be.iep,children:[o.jsx("div",{style:{color:u},children:e.iep??"--"}),o.jsxs("div",{style:{color:h},children:[((e.nom||"").trim().split(/\s+/)[0]||"").substring(0,3).toUpperCase(),"."," ",((e.prenom||"").trim().split(/\s+/)[0]||"").substring(0,3).toLowerCase().replace(/^./,I=>I.toUpperCase()),".(",e.age,")"]})]}),o.jsxs("div",{className:Be.groupSmall,children:[o.jsx("span",{className:`${Be.genre} genre-info-banner`,style:{color:"#ffffff",background:f,fontSize:g},children:t??"--"}),o.jsx("span",{className:`${Be.gravite} gravite-info-banner`,children:n??"--"})]}),o.jsx("div",{className:Be.orientationContainer,children:o.jsx("div",{className:Be.service,style:{color:h},children:s??"--"})}),o.jsxs("div",{className:Be.roomBedContainer,children:[i&&o.jsx("span",{className:Be.bedUf,children:i}),o.jsx("span",{className:Be.room,children:r??"--"}),o.jsx("span",{className:Be.bed,children:c??"--"})]}),o.jsxs("div",{className:Be.statusContainer,children:[d?o.jsx("div",{className:`${Be.status} status-info-banner`,style:{color:p,backgroundColor:y},children:d}):x&&o.jsxs("div",{className:Be.centeredWarn,style:{textTransform:"uppercase"},children:[o.jsx($S,{color:v,width:20,height:20,style:{marginRight:"6px"}}),o.jsx("span",{style:{color:v,fontSize:"12px",fontWeight:600},children:M})]}),d&&x&&o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",color:v,fontSize:"10px",fontWeight:400,marginTop:"4px",textTransform:"uppercase"},children:[o.jsx($S,{color:v,width:12,height:12,style:{marginRight:"4px"}}),o.jsx("span",{children:M})]})]})]}),mve=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},Q.createElement("path",{d:"M200-200v-240h60v180h180v60zm500-320v-180H520v-60h240v240z"})),fve=m.memo(mve),gve=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},Q.createElement("path",{d:"m249-207-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231z"})),IA=m.memo(gve),vve=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},Q.createElement("path",{d:"M440-440v240h-60v-180H200v-60zm140-320v180h180v60H520v-240z"})),xve=m.memo(vve),Mve="_overlay_1uxex_1",_ve="_container_1uxex_11",Lve="_fullscreen_1uxex_24",Ive="_header_1uxex_30",bve="_headerActions_1uxex_42",wve="_iconButton_1uxex_47",Cve="_body_1uxex_58",Nve="_sidebar_1uxex_65",jve="_content_1uxex_91",Sve="_contentHeader_1uxex_98",$ve="_childrenWrapper_1uxex_114",qve="_footer_1uxex_138",Ave="_baseButton_1uxex_146",zve="_noOverlay_1uxex_160",Vve="_contained_1uxex_168",je={overlay:Mve,container:_ve,fullscreen:Lve,header:Ive,headerActions:bve,iconButton:wve,body:Cve,sidebar:Nve,content:jve,contentHeader:Sve,childrenWrapper:$ve,footer:qve,baseButton:Ave,noOverlay:zve,contained:Vve},Pve=({headerText:e,headerTextColor:t="var(--color-text)",backgroundColor:n="var(--color-background)",headerFontSize:c="1rem",headerFontWeight:i="600",isOpen:r,onClose:s,leftButton:d,rightButton:l,children:h,contentTitle:u,contentBackgroundColor:p="var(--color-content-background)",sideContent:y,hideMaximize:f=!1,hideHeader:g=!1,hideSidebar:k=!1,onDelete:x,deleteLabel:M="Supprimer",width:v="75%",maxWidth:I="none",height:b="85%",maxHeight:C="85%",borderRadius:w="0.5rem",childrenPadding:_="1rem",overflow:L="auto",contentHeaderAction:S,contentFooterAction:N,footerOverride:j,hideFooter:A=!1,hideOverlay:B=!1,position:D,a11yConfig:V})=>{const[q,$]=m.useState(!1),H=m.useRef(null);if(m.useEffect(()=>{if(!r||!B)return;const z=O=>{(O.type==="scroll"||O.type==="wheel"||O.type==="touchmove"||H.current&&!H.current.contains(O.target))&&s()};return document.addEventListener("mousedown",z),document.addEventListener("scroll",z,!0),document.addEventListener("wheel",z,{passive:!0,capture:!0}),document.addEventListener("touchmove",z,{passive:!0,capture:!0}),()=>{document.removeEventListener("mousedown",z),document.removeEventListener("scroll",z,!0),document.removeEventListener("wheel",z,!0),document.removeEventListener("touchmove",z,!0)}},[r,B,s]),!r)return null;const R=(z,O=!1)=>o.jsx(sL,{onClick:z.disabled?void 0:z.onClick,className:je.baseButton,disabled:z.disabled,style:{background:z.backgroundColor??(O?"#008FBB":"#ffffff"),color:z.textColor??(O?"#ffffff":"#374151"),border:z.borderColor||O?"none":void 0,cursor:z.disabled?z.cursor??"not-allowed":z.cursor??"pointer",filter:z.disabled?z.filter??"grayscale(0.5)":z.filter??"none",opacity:z.disabled?.65:1},title:Z(z.a11yConfig,z.text),children:z.text});return o.jsx("div",{className:B?je.noOverlay:je.overlay,onClick:s,children:o.jsxs("div",{ref:H,className:`${je.container} ${q?je.fullscreen:""} ${B?je.contained:""}`,onClick:z=>z.stopPropagation(),style:{width:q?"100%":v,maxWidth:q?"none":I,height:q?"100%":b,maxHeight:q?"100%":C,borderRadius:q?"0":w,overflow:L,...D||{}},children:[!g&&o.jsxs("header",{className:je.header,style:{backgroundColor:n},children:[o.jsx("h2",{style:{fontSize:c,fontWeight:i,color:t},title:Z(V,e),children:e}),o.jsxs("div",{className:je.headerActions,children:[!f&&o.jsx("button",{onClick:()=>$(!q),className:je.iconButton,title:q?"Réduire":"Agrandir",children:q?o.jsx(xve,{width:22,height:22,fill:t}):o.jsx(fve,{width:22,height:22,fill:t})}),o.jsx("button",{onClick:s,className:je.iconButton,title:"Fermer",children:o.jsx(IA,{width:22,height:22,fill:t})})]})]}),o.jsxs("div",{className:je.body,style:{overflow:L},children:[y&&!k&&o.jsx("aside",{className:je.sidebar,children:y}),o.jsxs("main",{className:je.content,style:{backgroundColor:p,overflow:L},children:[u&&o.jsxs("header",{className:je.contentHeader,style:{backgroundColor:n},children:[o.jsx("span",{style:{color:t},children:u}),S]}),o.jsx("div",{className:je.childrenWrapper,style:{padding:_,overflow:L},children:h})]})]}),!A&&o.jsx("footer",{className:je.footer,style:{backgroundColor:n},children:j!==void 0?j:o.jsxs(o.Fragment,{children:[x&&o.jsx(sL,{onClick:x,className:je.baseButton,style:{background:"#fee2e2",color:"#ef4444",marginRight:"auto",border:"none"},children:M}),N,R(d),R(l,!0)]})})]})})},Tve="_container_1vb1c_1",Hve="_searchWrapper_1vb1c_10",Dve="_navItems_1vb1c_17",Bb={container:Tve,searchWrapper:Hve,navItems:Dve},Bve=({items:e,activeId:t,activeColor:n="#00aec7",backgroundColor:c="#fff",textColor:i="#000",onItemClick:r,searchValue:s="",onSearchChange:d,searchPlaceholder:l="Rechercher",width:h="100%",className:u=""})=>o.jsxs("div",{className:`${Bb.container} ${u}`,style:{width:h,backgroundColor:c,color:i},children:[o.jsx("div",{className:Bb.searchWrapper,children:o.jsx(fA,{value:s,onChange:d,placeholder:l,iconPosition:"right",iconColor:"var(--color-text)"})}),o.jsx("div",{className:Bb.navItems,children:e.map(p=>o.jsx(aC,{id:p.id,label:p.label,icon:p.icon,isActive:t===p.id,onClick:()=>r?.(p.id),activeColor:n,color:i,fontWeight:"600",fontSize:"0.75rem",padding:"0.75rem 1rem",iconGap:"0.5rem"},p.id))})]}),Rve=({modules:e,selectedModuleId:t,onSelectModule:n,onAddModule:c,onItemAdd:i,onEditModule:r,onDeleteModule:s,onReorder:d,title:l="Modules",titleKey:h,addModuleTitle:u="Ajouter un module",addModuleLabel:p="Titre",addModulePlaceholder:y="Nom du module",renameModuleTitle:f="Renommer le module",renameModuleLabel:g="Titre",renameModulePlaceholder:k="Nom du module",confirmText:x="Valider",cancelText:M="Annuler",headerLabel:v,headerLabelKey:I,showAddIcon:b=!0,showCount:C=!0,showToggle:w=!1,showActions:_=!0,onToggle:L,a11yConfig:S})=>{const[N,j]=m.useState(!1),[A,B]=m.useState(null),[D,V]=m.useState(null),[q,$]=m.useState(null),[H,R]=m.useState(null),z=()=>{R(G=>G===null?"asc":G==="asc"?"desc":null),L&&L()},O=m.useMemo(()=>H?[...e].sort((G,K)=>{const oe=G.title.toLowerCase(),Ne=K.title.toLowerCase();return H==="asc"?oe.localeCompare(Ne):Ne.localeCompare(oe)}):e,[e,H]),X=()=>j(!0),ie=()=>j(!1),ae=G=>{const K=G.title?.trim();K&&c&&c(K),ie()},fe=(G,K)=>{G.stopPropagation(),B(K)},le=()=>B(null),be=G=>{const K=G.title?.trim();A&&K&&r&&r(A,K),le()},ne=(G,K)=>{G.stopPropagation(),s&&s(K)},ee=(G,K)=>{G.stopPropagation(),i&&i(K)},te=(G,K)=>{V(K),G.dataTransfer.effectAllowed="move"},re=(G,K)=>{D!==null&&(G.preventDefault(),G.dataTransfer.dropEffect="move",K!==q&&$(K))},pe=(G,K)=>{if(G.preventDefault(),D===null||D===K||!d)return;const oe=[...O],[Ne]=oe.splice(D,1);oe.splice(K,0,Ne),R(null),d(oe),V(null),$(null)},se=()=>{V(null),$(null)};return o.jsxs("div",{className:"module-sidebar-v2",children:[o.jsx("div",{className:"sidebar-header",children:v?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"header-label-container",onClick:z,children:[o.jsx("div",{className:"header-label",title:Z(S,I),children:v}),H==="asc"?o.jsx(t1,{size:12,className:"header-toggle-icon",strokeWidth:3}):o.jsx(e1,{size:12,className:"header-toggle-icon",strokeWidth:3})]}),b&&o.jsx(zc,{size:18,className:"add-view-icon",onClick:X})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"header-title",title:Z(S,h),children:[w&&(H==="asc"?o.jsx(t1,{size:12,className:"header-toggle-icon default-toggle",strokeWidth:3,onClick:z}):o.jsx(e1,{size:12,className:"header-toggle-icon default-toggle",strokeWidth:3,onClick:z})),l," ",C&&`(${O.length})`]}),b&&o.jsx(zc,{size:18,className:"add-view-icon",onClick:X})]})}),o.jsx("div",{className:"module-list",children:O.map((G,K)=>o.jsxs("div",{className:`module-item ${G.id===t?"selected":""} ${q===K&&D!==K?"drag-over":""} ${D===K?"dragging":""}`,onClick:()=>n&&n(G),draggable:!!d,onDragStart:d?oe=>te(oe,K):void 0,onDragOver:d?oe=>re(oe,K):void 0,onDrop:d?oe=>pe(oe,K):void 0,onDragEnd:d?se:void 0,children:[G.icon||o.jsx(q1,{size:18,className:"drag-handle"}),o.jsxs("div",{className:"module-content",title:Z(G.a11yConfig,G.titleKey),children:[o.jsx("div",{className:"module-title",children:G.title}),G.subtitle&&o.jsx("div",{className:"module-subtitle",children:G.subtitle})]}),typeof G.count<"u"&&o.jsx("span",{className:"module-count",children:G.count}),_&&o.jsxs("div",{className:"module-actions",children:[i&&o.jsx(Vc,{size:14,className:"action-icon add",onClick:oe=>ee(oe,G)}),r&&o.jsx(gt,{size:12,className:"action-icon edit",onClick:oe=>fe(oe,G)}),s&&o.jsx(ut,{size:12,className:"action-icon delete",onClick:oe=>ne(oe,G)})]})]},G.id))}),o.jsx(Bc,{isOpen:N,onClose:ie,onSave:ae,title:u,fields:[{name:"title",label:p,placeholder:y}],confirmText:x,cancelText:M}),A&&o.jsx(Bc,{isOpen:!!A,onClose:le,onSave:be,title:f,initialValues:{title:A.title},fields:[{name:"title",label:g,placeholder:k}],confirmText:x,cancelText:M})]})},Fve=({keyName:e,translations:t,availableLanguages:n,onChange:c,onRename:i,onDelete:r,a11yConfig:s})=>{const[d,l]=m.useState(!1),[h,u]=m.useState(e),[p,y]=m.useState(null),[f,g]=m.useState(""),[k,x]=m.useState(!1),[M,v]=m.useState(""),[I,b]=m.useState(""),C=m.useMemo(()=>{const q={};return Array.isArray(t)&&t.forEach($=>{$&&$.language&&(q[$.language.toUpperCase()]=$.value)}),q},[t]),w=m.useMemo(()=>n,[n]),_=()=>{l(!1),h!==e&&h.trim()!==""?i&&i(h.trim()):u(e)},L=q=>{q.key==="Enter"?_():q.key==="Escape"&&(u(e),l(!1))},S=q=>{const $=q.toUpperCase();y($),g(C[$]||"")},N=()=>{p&&(c(p,f),y(null),g(""))},j=q=>{q.key==="Enter"?N():q.key==="Escape"&&(y(null),g(""))},A=()=>{x(!0),w.length>0&&v(w[0].toUpperCase()),b("")},B=()=>{M&&I.trim()&&(c(M,I.trim()),x(!1),v(""),b(""))},D=()=>{x(!1),v(""),b("")},V=q=>{q.key==="Enter"?B():q.key==="Escape"&&D()};return o.jsxs("div",{className:"translation-key-v2",children:[o.jsxs("div",{className:"header",children:[d?o.jsx("input",{className:"key-name-input",value:h,onChange:q=>u(q.target.value),onBlur:_,onKeyDown:L,autoFocus:!0}):o.jsx("h3",{className:"header-title",title:Z(s,e),children:e}),o.jsxs("div",{className:"header-actions",children:[o.jsx(gt,{size:16,className:"action-icon edit",onClick:()=>l(!0)}),o.jsx(ut,{size:16,className:"action-icon delete",onClick:r})]})]}),o.jsxs("div",{className:"translations-list",children:[n.map(q=>{const $=q.toUpperCase(),H=C[$]||"",R=p===$;return o.jsxs("div",{className:"lang-row",children:[o.jsx("div",{className:"lang-label",children:$}),R?o.jsx("input",{className:"translation-input editing",value:f,onChange:z=>g(z.target.value),onBlur:N,onKeyDown:j,placeholder:"Entrez la traduction...",autoFocus:!0}):o.jsx("div",{className:`translation-value ${H?"":"empty"}`,onClick:()=>S(q),title:"Cliquer pour éditer",children:H||"Cliquer pour ajouter..."})]},q)}),k?o.jsxs("div",{className:"lang-row add-row",children:[o.jsx("select",{className:"lang-select",value:M,onChange:q=>v(q.target.value),children:w.map(q=>o.jsx("option",{value:q.toUpperCase(),children:q.toUpperCase()},q))}),o.jsx("input",{className:"translation-input editing",value:I,onChange:q=>b(q.target.value),onKeyDown:V,placeholder:"Mot",autoFocus:!0}),o.jsxs("div",{className:"add-actions",children:[o.jsx(C1,{size:18,className:"action-icon confirm",onClick:B}),o.jsx(Qe,{size:18,className:"action-icon cancel",onClick:D})]})]}):w.length>0&&o.jsxs("button",{className:"add-translation-btn",onClick:A,children:[o.jsx(Vc,{size:16}),o.jsx("span",{children:"Ajouter"})]})]})]})},Eve="_overlay_1jz4r_1",Ove="_modal_1jz4r_15",Uve="_body_1jz4r_27",Wve="_footer_1jz4r_46",Gve="_confirmButton_1jz4r_55",Kve="_danger_1jz4r_75",Zve="_cancelButton_1jz4r_83",St={overlay:Eve,modal:Ove,body:Uve,footer:Wve,confirmButton:Gve,danger:Kve,cancelButton:Zve},Xve=({isOpen:e,message:t,onConfirm:n,onCancel:c,confirmText:i="Confirmer",cancelText:r="Annuler",isDanger:s=!1,hideFooter:d=!1,secondaryConfirmText:l,onSecondaryConfirm:h})=>e?o.jsx("div",{className:St.overlay,onClick:c,children:o.jsxs("div",{className:St.modal,onClick:u=>u.stopPropagation(),children:[o.jsx("div",{className:St.body,children:typeof t=="string"?o.jsx("p",{children:t}):t}),!d&&o.jsxs("div",{className:St.footer,children:[i&&o.jsx("button",{className:`${St.confirmButton} ${s?St.danger:""}`,onClick:n,children:i}),l&&h&&o.jsx("button",{className:St.confirmButton,onClick:h,children:l}),r&&o.jsx("button",{className:St.cancelButton,onClick:c,children:r})]})]})}):null,Yve="_card_1ildr_1",Jve="_topIcon_1ildr_17",Qve="_title_1ildr_24",e9e="_text_1ildr_31",t9e="_bottomIcon_1ildr_37",v1={card:Yve,topIcon:Jve,title:Qve,text:e9e,bottomIcon:t9e},a9e=({topIcon:e,title:t,text:n,bottomIcon:c,onClick:i,className:r="",headerTextColor:s="#000",textColor:d="#4b5563",backgroundColor:l="#fff",a11yConfig:h})=>o.jsxs("div",{className:`${v1.card} ${r}`,onClick:i,role:i?"button":void 0,tabIndex:i?0:void 0,style:{backgroundColor:l},title:Z(h,t),children:[e&&o.jsx("div",{className:v1.topIcon,children:e}),o.jsx("h3",{className:v1.title,style:{color:s},children:t}),o.jsx("p",{className:v1.text,style:{color:d},children:n}),c&&o.jsx("div",{className:v1.bottomIcon,children:c})]}),n9e="_container_1bmmf_1",o9e="_disabled_1bmmf_9",c9e="_selectBox_1bmmf_14",i9e="_selectBoxOpen_1bmmf_36",r9e="_tagsContainer_1bmmf_41",s9e="_tagsContainerWrap_1bmmf_51",d9e="_tag_1bmmf_41",l9e="_tagLabel_1bmmf_72",h9e="_removeBtnContainer_1bmmf_78",u9e="_removeBtn_1bmmf_78",p9e="_searchInput_1bmmf_103",y9e="_placeholder_1bmmf_123",k9e="_actions_1bmmf_130",m9e="_clearBtn_1bmmf_137",f9e="_chevron_1bmmf_159",g9e="_chevronOpen_1bmmf_165",v9e="_dropdown_1bmmf_169",x9e="_option_1bmmf_183",M9e="_optionHeader_1bmmf_196",_9e="_noOptions_1bmmf_212",L9e="_overflowBlock_1bmmf_219",I9e="_overflowEllipsis_1bmmf_226",b9e="_overflowBadge_1bmmf_233",w9e="_overflowBadgeWrap_1bmmf_256",C9e="_overflowDropdown_1bmmf_262",N9e="_overflowDropdownItem_1bmmf_278",j9e="_overflowDropdownItemLabel_1bmmf_289",S9e="_overflowDropdownItemRemove_1bmmf_296",ce={container:n9e,disabled:o9e,selectBox:c9e,selectBoxOpen:i9e,tagsContainer:r9e,tagsContainerWrap:s9e,tag:d9e,tagLabel:l9e,removeBtnContainer:h9e,removeBtn:u9e,searchInput:p9e,placeholder:y9e,actions:k9e,clearBtn:m9e,chevron:f9e,chevronOpen:g9e,dropdown:v9e,option:x9e,optionHeader:M9e,noOptions:_9e,overflowBlock:L9e,overflowEllipsis:I9e,overflowBadge:b9e,overflowBadgeWrap:w9e,overflowDropdown:C9e,overflowDropdownItem:N9e,overflowDropdownItemLabel:j9e,overflowDropdownItemRemove:S9e},$9e=({options:e,noOptionsMessage:t="",value:n,onChange:c,placeholder:i="Sélectionner...",isSearchable:r=!0,className:s="",disabled:d=!1,allowWrap:l=!1})=>{const[h,u]=m.useState(!1),[p,y]=m.useState(""),f=m.useRef(null),g=m.useRef(null),k=m.useRef(null),x=m.useRef(null),[M,v]=m.useState(null),[I,b]=m.useState(!1),C=m.useRef([]),w=m.useRef(null),_=m.useMemo(()=>{const $=new Map(e.map(H=>[H.value,H]));return n.map(H=>$.get(H)).filter(H=>H!==void 0)},[e,n]),L=m.useMemo(()=>e.filter($=>!n.includes($.value)),[e,n]),S=m.useMemo(()=>{let $=L;return p&&($=$.filter(H=>H.label.toLowerCase().includes(p.toLowerCase()))),$.filter((H,R)=>{if(!H.isHeader)return!0;for(let z=R+1;z<$.length&&!$[z].isHeader;z++)return!0;return!1})},[L,p]);m.useEffect(()=>{const $=H=>{const R=H.target;f.current&&!f.current.contains(R)&&(u(!1),y(""),v(null),b(!1))};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[]),m.useEffect(()=>{if(l)return;if(_.length===0){v(null),C.current=[];return}_.length>C.current.length&&v(null);const $=()=>{const O=k.current,X=x.current;if(!O||!X)return;const ie=X.getBoundingClientRect().width,ae=X.querySelector(`.${ce.actions}`),fe=ae?ae.getBoundingClientRect().width:80,le=56,be=r?80:0,ne=16,ee=Array.from(O.querySelectorAll(`.${ce.tag}`));ee.length===_.length&&(C.current=ee.map(ve=>{const Ve=ve.getBoundingClientRect(),kt=ve.scrollWidth;return Math.max(Ve.width,kt,ve.offsetWidth||0)}));const te=C.current,re=te.length>0?te.reduce((ve,Ve)=>ve+Ve,0)/te.length:120,pe=_.length<=te.length?te.slice(0,_.length):[...te,...Array(_.length-te.length).fill(re)],se=4,G=Math.max(0,ie-fe-be-ne);let K=0,oe=0;for(let ve=0;ve<_.length;ve++){const Ve=pe[ve]??120;if(K+Ve+se>G)break;K+=Ve+se,oe++}if(oe>=_.length){v(null);return}const Ne=Math.max(0,ie-le-fe-be-ne);K=0;let qe=0;for(let ve=0;ve<_.length;ve++){const Ve=pe[ve]??120;if(K+Ve+se>Ne)break;K+=Ve+se,qe++}qe<_.length&&qe>0?v(qe):v(null)},H=requestAnimationFrame(()=>{$()}),R=setTimeout($,100),z=new ResizeObserver(()=>{$()});return x.current&&z.observe(x.current),()=>{cancelAnimationFrame(H),clearTimeout(R),z.disconnect()}},[_,r,h,l]);const N=()=>{if(d)return;const $=!h;$&&b(!1),u($),$&&r&&setTimeout(()=>g.current?.focus(),0)},j=$=>{if(n.includes($.value))return;b(!1);const H=[..._,$];c(H),y(""),v(null),u(!1)},A=$=>{$.preventDefault(),$.stopPropagation(),b(H=>!H)},B=M!=null&&M<_.length?_.slice(M):[],D=($,H)=>{H.stopPropagation();const R=_.filter(z=>z.value!==$);c(R)},V=$=>{$.stopPropagation(),c([])},q=$=>{$.stopPropagation(),h||u(!0)};return o.jsxs("div",{className:`${ce.container} ${s} ${d?ce.disabled:""}`,ref:f,children:[o.jsxs("div",{ref:x,className:`${ce.selectBox} ${h?ce.selectBoxOpen:""}`,onClick:N,role:"combobox","aria-expanded":h,"aria-haspopup":"listbox",children:[o.jsxs("div",{className:`${ce.tagsContainer} ${l?ce.tagsContainerWrap:""}`,ref:k,children:[M!==null&&M>0?_.slice(0,M).map(($,H)=>o.jsxs("div",{className:ce.tag,children:[o.jsx("div",{className:ce.tagLabel,children:o.jsx("span",{children:$.label})}),o.jsx("div",{className:ce.removeBtnContainer,children:o.jsx("button",{type:"button",className:ce.removeBtn,onClick:R=>D($.value,R),"aria-label":`Supprimer ${$.label}`,children:o.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:o.jsx("path",{d:"M8.5 1.5L1.5 8.5M1.5 1.5L8.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})})]},`tag-${$.value}-${H}`)):_.map(($,H)=>o.jsxs("div",{className:ce.tag,children:[o.jsx("div",{className:ce.tagLabel,children:o.jsx("span",{children:$.label})}),o.jsx("div",{className:ce.removeBtnContainer,children:o.jsx("button",{type:"button",className:ce.removeBtn,onClick:R=>D($.value,R),"aria-label":`Supprimer ${$.label}`,children:o.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:o.jsx("path",{d:"M8.5 1.5L1.5 8.5M1.5 1.5L8.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})})]},`tag-${$.value}-${H}`)),r?o.jsx("input",{ref:g,type:"text",className:ce.searchInput,placeholder:_.length===0?i:"",value:p,onChange:$=>{y($.target.value),h||u(!0)},onClick:q,disabled:d}):_.length===0&&o.jsx("span",{className:ce.placeholder,children:i})]}),!l&&M!==null&&M<_.length&&o.jsxs("div",{className:ce.overflowBlock,children:[o.jsx("span",{className:ce.overflowEllipsis,children:"..."}),o.jsxs("div",{className:ce.overflowBadgeWrap,children:[o.jsx("button",{ref:w,type:"button",className:ce.overflowBadge,onClick:A,"aria-label":`Afficher ${B.length} éléments cachés`,children:B.length}),I&&B.length>0&&o.jsx("div",{className:ce.overflowDropdown,role:"list","aria-label":"Éléments cachés",children:B.map(($,H)=>o.jsxs("div",{className:ce.overflowDropdownItem,children:[o.jsx("span",{className:ce.overflowDropdownItemLabel,children:$.label}),o.jsx("button",{type:"button",className:ce.overflowDropdownItemRemove,onClick:R=>{R.stopPropagation(),D($.value,R)},"aria-label":`Supprimer ${$.label}`,children:o.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:o.jsx("path",{d:"M8.5 1.5L1.5 8.5M1.5 1.5L8.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]},`hidden-${$.value}-${H}`))})]})]}),o.jsxs("div",{className:ce.actions,children:[_.length>0&&o.jsx("button",{type:"button",className:ce.clearBtn,onClick:V,"aria-label":"Effacer tout",children:o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:o.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),o.jsx("svg",{className:`${ce.chevron} ${h?ce.chevronOpen:""}`,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M6 9l6 6 6-6"})})]})]}),h&&!d&&o.jsx("div",{className:ce.dropdown,role:"listbox",children:S.length>0?S.map(($,H)=>o.jsx("div",{className:`${ce.option} ${$.isHeader?ce.optionHeader:""}`,onClick:()=>!$.isHeader&&j($),role:"option","aria-selected":!1,children:$.label},`opt-${$.value}-${H}`)):o.jsx("div",{className:ce.noOptions,children:t})})]})},q9e="_container_h7jek_1",qS={container:q9e},A9e=({a11yConfigs:e=[],titleKeys:t=[],labels:n=[],data:c=[],selectedUfs:i=[],icons:r=[],lastCardTextColor:s="black",boardColors:d={},order:l})=>{const h=m.useMemo(()=>{const g=i.length===0?c:c.filter(x=>x&&i.includes(String(x.uf).replace(/^0+/,""))),k=new Set;return g.filter(x=>{if(!x||!x.uf)return!1;const M=String(x.uf).replace(/^0+/,"");return k.has(M)?!1:(k.add(M),!0)})},[c,i]),u=m.useMemo(()=>h.reduce((g,k)=>({disponibles:g.disponibles+(k.totalAvailable??k.disponibles??0),homme:g.homme+(k.availableMen??k.disponibleHomme??0),femme:g.femme+(k.availableWomen??k.disponibleFemme??0),indifferencie:g.indifferencie+(k.availableIndifferentSex??k.indifferences??0),sorties:g.sorties+(k.outToday??k.sortie24??0),occupiedBed:g.occupiedBed+(k.occupiedBed??0),patientsPresents:g.patientsPresents+(k.patientsPresents??0),occupationRate:g.occupationRate+(k.occupationRate??0),occupesRaw:g.occupesRaw+(k.occupesRaw??0),ouvertsRaw:g.ouvertsRaw+(k.ouvertsRaw??0)}),{disponibles:0,homme:0,femme:0,indifferencie:0,sorties:0,occupiedBed:0,patientsPresents:0,occupationRate:0,occupesRaw:0,ouvertsRaw:0}),[h]),p=g=>d.disponibles?d.disponibles:g>3?"#35994E":g>=1?"#EF6C00":"#C62828",y={bars:"none",justifyContent:"flexStart",alignItems:"center",valueFontWeight:"400",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}},f=(g,k)=>{const x=l!==void 0&&k===l.length-1;switch(g){case"disponibles":return{...y,value:u.disponibles.toLocaleString("fr-FR"),backgroundColor:p(u.disponibles),valueFontSize:"2.5rem",titleColor:"white",valueColor:"white"};case"occupiedBed":return{...y,value:u.occupiedBed.toLocaleString("fr-FR"),backgroundColor:d.occupes??d.homme??"#7DD493",valueFontSize:x?"3rem":"2.375rem",titleColor:"black",valueColor:"black"};case"patientsPresents":return{...y,value:u.patientsPresents.toLocaleString("fr-FR"),backgroundColor:d.patientsPresents??d.femme??"#7DD493",valueFontSize:x?"3rem":"2.375rem",titleColor:"black",valueColor:"black"};case"occupationRate":{const M=u.ouvertsRaw>0?parseFloat((u.occupesRaw/u.ouvertsRaw*100).toFixed(2)):u.occupationRate;return{...y,value:`${M.toLocaleString("fr-FR")}%`,backgroundColor:d.occupationRate??d.indifferencie??"#7DD493",valueFontSize:x?"3rem":"2.375rem",titleColor:"black",valueColor:"black"}}case"outToday":return{...y,value:u.sorties.toLocaleString("fr-FR"),backgroundColor:d.sorties??"#F2F9FC",valueFontSize:"3rem",titleColor:s,valueColor:s}}};return l&&l.length>0?o.jsx("div",{className:qS.container,children:l.map((g,k)=>o.jsx(vt,{a11yConfig:e[k],titleKey:t[k],label:n[k],iconName:r[k],...f(g,k)},g))}):o.jsxs("div",{className:qS.container,children:[o.jsx(vt,{a11yConfig:e[0],titleKey:t[0],label:n[0],value:u.disponibles.toLocaleString("fr-FR"),iconName:r[0],backgroundColor:p(u.disponibles),valueFontSize:"2.5rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"white",valueColor:"white",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),o.jsx(vt,{a11yConfig:e[1],titleKey:t[1],label:n[1],value:u.homme.toLocaleString("fr-FR"),iconName:r[1],backgroundColor:d.homme??"#7DD493",valueFontSize:"2.375rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"black",valueColor:"black",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),o.jsx(vt,{a11yConfig:e[2],titleKey:t[2],label:n[2],value:u.femme.toLocaleString("fr-FR"),iconName:r[2],backgroundColor:d.femme??"#7DD493",valueFontSize:"2.375rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"black",valueColor:"black",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),o.jsx(vt,{a11yConfig:e[3],titleKey:t[3],label:n[3],value:u.indifferencie.toLocaleString("fr-FR"),iconName:r[3],backgroundColor:d.indifferencie??"#7DD493",valueFontSize:"2.375rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"black",valueColor:"black",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),o.jsx(vt,{a11yConfig:e[4],titleKey:t[4],label:n[4],value:u.sorties.toLocaleString("fr-FR"),iconName:r[4],backgroundColor:d.sorties??"#F2F9FC",valueFontSize:"3rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:s,valueColor:s,titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}})]})},z9e="_container_1pt6c_1",V9e="_chartContainer_1pt6c_14",P9e="_legend_1pt6c_22",T9e="_legendItem_1pt6c_29",H9e="_leftSection_1pt6c_41",D9e="_colorIndicator_1pt6c_47",B9e="_label_1pt6c_54",R9e="_rightSection_1pt6c_60",F9e="_ratio_1pt6c_66",E9e="_value1_1pt6c_73",O9e="_separator_1pt6c_78",U9e="_value2_1pt6c_82",W9e="_statusIndicator_1pt6c_87",G9e="_inactive_1pt6c_102",Re={container:z9e,chartContainer:V9e,legend:P9e,legendItem:T9e,leftSection:H9e,colorIndicator:D9e,label:B9e,rightSection:R9e,ratio:F9e,value1:E9e,separator:O9e,value2:U9e,statusIndicator:W9e,inactive:G9e},AS=Math.PI/180,K9e=({data:e,height:t=400,bg:n,backgroundColor:c,color:i,fontSize:r,fontWeight:s,padding:d,margin:l,borderRadius:h,className:u="",style:p={},labelColor:y,ratioColor:f,separatorColor:g,borderColor:k,hideDonut:x=!0,hideColorIndicator:M=!1})=>{const[v,I]=m.useState(new Set(e.map(N=>N.nom))),b=N=>{const j=new Set(v);j.has(N)?j.size>1&&j.delete(N):j.add(N),I(j)},C={...p,"--bg-color":n||c||"transparent","--text-color":i||"inherit","--font-size":r||"14px","--font-weight":s||"400","--padding":d||"0","--margin":l||"0","--border-radius":h||"0","--label-color":y||"inherit","--ratio-color":f||"inherit","--separator-color":g||"#03a9f4","--border-color":k||"#e0e0e0"},w=m.useMemo(()=>e.map(N=>({...N,displayValue:v.has(N.nom)?N.value:0})),[e,v]),_=m.useMemo(()=>e.every(N=>N.value===0),[e]),L=m.useMemo(()=>_?1:w.reduce((N,j)=>N+j.displayValue,0)||1,[_,w]),S=m.useCallback(({cx:N,cy:j,midAngle:A,innerRadius:B,outerRadius:D,value:V})=>{if(V===0||_)return null;const q=B+(D-B)*.5,$=N+q*Math.cos(-A*AS),H=j+q*Math.sin(-A*AS),R=Math.round(V/L*100);return o.jsx(a.Text,{x:$,y:H,fill:"white",textAnchor:"middle",dominantBaseline:"central",fontSize:12,fontWeight:"bold",children:`${R}%`})},[L,_]);return o.jsxs("div",{className:`${Re.container} ${u}`,style:C,children:[!x&&o.jsx("div",{className:Re.chartContainer,style:{height:t/2+100},children:o.jsx(a.ResponsiveContainer,{width:"100%",height:"100%",children:o.jsx(a.PieChart,{children:o.jsx(a.Pie,{data:_?[{displayValue:1,color:"#A3C2CB"}]:w,cx:"50%",cy:"50%",innerRadius:45,outerRadius:75,paddingAngle:0,dataKey:"displayValue",stroke:"white",strokeWidth:_?0:2,startAngle:90,endAngle:450,labelLine:!1,label:S,isAnimationActive:!1,children:_?o.jsx(a.Cell,{fill:"#A3C2CB"}):w.map((N,j)=>o.jsx(a.Cell,{fill:N.color},`cell-${j}`))})})})}),o.jsx("div",{className:Re.legend,children:e.map((N,j)=>{const A=v.has(N.nom);return o.jsxs("div",{className:`${Re.legendItem} ${!x&&!A?Re.inactive:""}`,onClick:()=>b(N.nom),style:{cursor:"pointer",transition:"opacity 0.2s"},children:[o.jsxs("div",{className:Re.leftSection,children:[!M&&o.jsx("div",{className:Re.colorIndicator,style:{backgroundColor:N.color,opacity:x||A?1:.3}}),o.jsx("span",{className:Re.label,style:{opacity:x||A?1:.5},children:N.nom})]}),o.jsxs("div",{className:Re.rightSection,style:{opacity:x||A?1:.5},children:[o.jsxs("div",{className:Re.ratio,children:[o.jsx("span",{className:Re.value1,children:N.value1}),o.jsx("span",{className:Re.separator,children:"/"}),o.jsx("span",{className:Re.value2,children:N.value2})]}),N.statusColor&&o.jsx("div",{className:Re.statusIndicator,style:{backgroundColor:N.statusColor}})]})]},`legend-${j}`)})})]})},Z9e="_container_1pc4v_1",X9e="_leftGroup_1pc4v_10",Y9e="_iconBtn_1pc4v_16",si={container:Z9e,leftGroup:X9e,iconBtn:Y9e},J9e=e=>Q.createElement("svg",{width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",...e},Q.createElement("path",{d:"M3 12h18M3 6h18M3 18h18"})),Q9e=m.memo(J9e),exe=e=>Q.createElement("svg",{width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",...e},Q.createElement("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8m-4-6-4-4-4 4m4-4v13"})),bA=m.memo(exe),txe=({menuIcon:e,logoProps:t,actionIcon:n,style:c,className:i,bgColor:r="var(--header-bg)",color:s="var(--color-text)",borderBottomColor:d="var(--color-border)",borderBottomWidth:l=1,height:h="8vh",onMenuClick:u,onActionClick:p})=>{const y={backgroundColor:r,color:s,borderBottom:`${l}px solid ${d}`,height:h,...c};return o.jsxs("header",{className:[si.container,i].filter(Boolean).join(" "),style:y,children:[o.jsxs("div",{className:si.leftGroup,children:[o.jsx("button",{className:si.iconBtn,onClick:u,"aria-label":"Menu",style:{color:"inherit"},children:e??o.jsx(Q9e,{width:22,height:22})}),o.jsx(xL,{...t,size:"medium"})]}),o.jsx("button",{className:si.iconBtn,onClick:p,"aria-label":"Action",style:{color:"inherit"},children:n??o.jsx(bA,{width:22,height:22})})]})},axe="_container_24g3e_1",nxe="_iconBtn_24g3e_10",oxe="_title_24g3e_22",di={container:axe,iconBtn:nxe,title:oxe},cxe=({title:e="Menu",closeIcon:t,actionIcon:n,style:c,className:i,titleStyle:r,bgColor:s="var(--header-bg)",color:d="var(--color-text)",borderBottomColor:l="transparent",borderBottomWidth:h=0,height:u="8vh",onClose:p,onAction:y})=>{const f={backgroundColor:s,color:d,borderBottom:`${h}px solid ${l}`,height:u,...c};return o.jsxs("div",{className:[di.container,i].filter(Boolean).join(" "),style:f,children:[o.jsx("button",{className:di.iconBtn,onClick:p,"aria-label":"Fermer",style:{color:"inherit"},children:t??o.jsx(IA,{width:22,height:22})}),o.jsx("span",{className:di.title,style:{fontWeight:"var(--font-weight-h)",fontSize:"var(--h5)",...r},children:e.toUpperCase()}),o.jsx("button",{className:di.iconBtn,onClick:y,"aria-label":"Partager",style:{color:"inherit"},children:n??o.jsx(bA,{width:22,height:22})})]})},ixe=({title:e,countLabel:t="UF",actionIcon:n=o.jsx(ut,{size:16}),onAction:c,items:i=[],onItemClick:r,activeColor:s="#0083bb",id:d,children:l})=>{const h=m.useMemo(()=>i.filter(u=>u.active).length,[i]);return o.jsxs(rxe,{id:d,children:[o.jsxs(sxe,{children:[o.jsxs(dxe,{children:[o.jsx(lxe,{children:e}),o.jsxs(hxe,{children:["(",h," ",t,")"]})]}),c&&o.jsx(uxe,{onClick:c,title:"Action",children:n})]}),o.jsx(pxe,{children:o.jsx(yxe,{children:i.map(u=>o.jsx(mxe,{item:u,activeColor:s,onItemClick:r},u.id))})}),l&&o.jsx(fxe,{children:l})]})},rxe=F.div`
|
|
8345
|
+
`,style:{...le,backgroundColor:t===_e.value?S||"#F0F4F6":"transparent"},onMouseEnter:Ft=>{L&&(Ft.currentTarget.style.backgroundColor=L)},onMouseLeave:Ft=>{L&&(Ft.currentTarget.style.backgroundColor=t===_e.value?S||"#F0F4F6":"transparent")},role:"option","aria-selected":t===_e.value,children:o.jsxs("div",{className:Ce.itemContent,style:wt,children:[_e.icon&&o.jsx("span",{className:Ce.itemIcon,style:ve,children:_e.icon}),o.jsx("span",{className:Ce.itemLabel,children:_e.label})]})},_e.value))})})]})},u7e="_filterBar_1hlqe_3",p7e="_label_1hlqe_11",SS={filterBar:u7e,label:p7e},y7e=({label:e="Filtres",startDate:t,endDate:n,granularity:c,onStartDateChange:i,onEndDateChange:r,onGranularityChange:s,granularityItems:d,startDatePlaceholder:l="Date début",endDatePlaceholder:h="Date fin",granularityPlaceholder:u="Sélectionner...",className:p="",disabled:y=!1,gap:f="0.75rem",labelFontSize:g="0.875rem",labelFontWeight:k="400",labelColor:x="#212529",labelMarginRight:M="1rem",startDateWidth:v,endDateWidth:I,selectWidth:b,datePickerProps:C={},selectProps:w={},rightContent:_,extraContent:L})=>{const S={fontSize:g,fontWeight:k,color:x,marginRight:M},N={gap:f};return o.jsxs("div",{className:`${SS.filterBar} ${p}`,style:N,children:[e&&o.jsx("span",{className:SS.label,style:S,children:e}),o.jsx(kw,{value:t,onChange:i,placeholder:l,fullWidth:!1,disabled:y,label:void 0,width:v,...C}),o.jsx(kw,{value:n,onChange:r,placeholder:h,fullWidth:!1,disabled:y,label:void 0,width:I,...C}),o.jsx(LA,{items:d,value:c,onChange:s,placeholder:u,fullWidth:!1,disabled:y,label:void 0,width:b,...w}),L,_&&o.jsx("div",{style:{marginLeft:"auto"},children:_})]})},k7e="_container_1x6mq_16",m7e="_disabled_1x6mq_26",f7e="_predStyle_1x6mq_32",g7e="_realStyle_1x6mq_36",v7e="_predGap_1x6mq_40",x7e="_realGap_1x6mq_44",M7e="_big_1x6mq_49",_7e="_medium_1x6mq_53",L7e="_iconWrapper_1x6mq_58",I7e="_predRelative_1x6mq_68",b7e="_realRelative_1x6mq_72",w7e="_iconImg_1x6mq_76",C7e="_content_1x6mq_84",N7e="_header_1x6mq_93",j7e="_predJustify_1x6mq_99",S7e="_realJustify_1x6mq_103",$7e="_predHeaderLineHeight_1x6mq_116",q7e="_realHeaderLineHeight_1x6mq_120",A7e="_title_1x6mq_129",z7e="_titleBlack_1x6mq_144",V7e="_titleWhite_1x6mq_148",P7e="_subtitle_1x6mq_153",T7e="_valueRowHorizontal_1x6mq_163",H7e="_valueRowVertical_1x6mq_171",D7e="_singleValue_1x6mq_180",B7e="_primaryRow_1x6mq_184",R7e="_maxBadge_1x6mq_191",F7e="_valuePrimary_1x6mq_203",E7e="_valuePrimaryBlack_1x6mq_210",O7e="_valuePrimaryWhite_1x6mq_214",U7e="_valueSlash_1x6mq_219",W7e="_valueSecondary_1x6mq_226",G7e="_valueSecondaryBlue_1x6mq_232",K7e="_valueSecondaryWhite_1x6mq_236",Z7e="_valueSecondaryBlack_1x6mq_240",X7e="_valueStacked_1x6mq_245",Y7e="_stackedTop_1x6mq_254",J7e="_stackedBottom_1x6mq_255",ye={container:k7e,disabled:m7e,predStyle:f7e,realStyle:g7e,predGap:v7e,realGap:x7e,big:M7e,medium:_7e,iconWrapper:L7e,predRelative:I7e,realRelative:b7e,iconImg:w7e,content:C7e,header:N7e,predJustify:j7e,realJustify:S7e,predHeaderLineHeight:$7e,realHeaderLineHeight:q7e,title:A7e,titleBlack:z7e,titleWhite:V7e,subtitle:P7e,valueRowHorizontal:T7e,valueRowVertical:H7e,singleValue:D7e,primaryRow:B7e,maxBadge:R7e,valuePrimary:F7e,valuePrimaryBlack:E7e,valuePrimaryWhite:O7e,valueSlash:U7e,valueSecondary:W7e,valueSecondaryBlue:G7e,valueSecondaryWhite:K7e,valueSecondaryBlack:Z7e,valueStacked:X7e,stackedTop:Y7e,stackedBottom:J7e},Q7e=({a11yConfig:e,iconName:t,title:n,subtitle:c,showSubtitle:i,realised:r="-",prediction:s="-",size:d="big",titleColor:l="black",valueColor:h="blue",realValueColor:u,predictionValueColor:p,className:y="",style:f="",variant:g="horizontal",showMax:k=!1,titleFontSize:x,titleFontWeight:M,subtitleFontSize:v,subtitleFontWeight:I,primaryFontSize:b,primaryFontWeight:C,secondaryFontSize:w,secondaryFontWeight:_,backgroundColor:L="#f2f9fc",gap:S="",disabled:N=!1,positionRelative:j="",justifyContent:A="",headerLineHeight:B="",headerMinHeight:D="",contentSpace:V="",titleKey:q,subtitleKey:$,subtitleA11yKey:H,maxBadgeKey:R,maxBadgeA11yKey:z,predictionKey:U,predictionA11yKey:X,realisedKey:ie,realisedA11yKey:ae})=>{const fe=i!==void 0?i:!!c,de=`${ye.container} ${ye[d]} ${ye[f]} ${N?ye.disabled:""}`,be=h==="white"?ye.valuePrimaryWhite:ye.valuePrimaryBlack,oe=h==="blue"?ye.valueSecondaryBlue:h==="white"?ye.valueSecondaryWhite:ye.valueSecondaryBlack,ee=O=>O===void 0?void 0:typeof O=="number"?`${O}px`:O,te=O=>O===void 0?void 0:O,re=g==="vertical",he=s!=null&&s!==""&&s!=="-"&&s!=="—",pe=re?ye.valueRowVertical:ye.valueRowHorizontal;return o.jsxs("div",{className:`${de} ${y}`,style:{backgroundColor:L},children:[t&&o.jsx("div",{className:`${ye.iconWrapper} ${ye[j]}`,children:t}),o.jsxs("div",{className:`${ye.content} ${ye[S]} ${he?"":ye.singleValue} content-indicator-v2`,style:{justifyContent:V},children:[o.jsx("div",{className:`${ye.header} ${ye[A]} ${ye[B]} header-indicator-v2`,style:{minHeight:D},children:o.jsx("h6",{className:`${ye.title}`,style:{fontSize:ee(x),fontWeight:te(M),color:l},title:Z(e,q),children:n})}),fe&&c?o.jsx("div",{className:"subtitle-container",children:o.jsx("span",{className:ye.subtitle,style:{fontSize:ee(v),fontWeight:te(I)},title:Z(e,$,H),children:c})}):null,o.jsxs("div",{className:`${pe} count-indicator-v2`,children:[o.jsxs("div",{className:ye.primaryRow,children:[k&&o.jsx("span",{className:`${ye.maxBadge} max-badge-indicator-v2`,title:Z(e,R,z),children:"MAX"}),o.jsx("span",{className:`${ye.valuePrimary} ${be}`,style:{fontSize:ee(b||(!he&&re?"1.75rem":void 0)),fontWeight:te(C),color:u||void 0},title:Z(e,ie,ae),children:r})]}),he&&o.jsxs(o.Fragment,{children:[!re&&o.jsx("span",{className:ye.valueSlash,style:{fontSize:ee(w),fontWeight:te(_)},children:"/"}),o.jsx("span",{className:`${ye.valueSecondary} ${oe}`,style:{fontSize:ee(w),fontWeight:te(_),color:p||void 0},title:Z(e,U,X),children:s})]})]})]})]})},eve="_banner_f10in_2",tve="_iep_f10in_14",ave="_groupSmall_f10in_24",nve="_genre_f10in_34",ove="_gravite_f10in_42",cve="_orientationContainer_f10in_48",ive="_service_f10in_61",rve="_roomBedContainer_f10in_71",sve="_room_f10in_71",dve="_bed_f10in_87",lve="_bedUf_f10in_92",hve="_statusContainer_f10in_97",uve="_status_f10in_97",pve="_centeredWarn_f10in_124",Be={banner:eve,iep:tve,groupSmall:ave,genre:nve,gravite:ove,orientationContainer:cve,service:ive,roomBedContainer:rve,room:sve,bed:dve,bedUf:lve,statusContainer:hve,status:uve,centeredWarn:pve},yve=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16",...e},Q.createElement("mask",{id:"a",width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},Q.createElement("path",{fill:"#D9D9D9",d:"M0 0h16v16H0z"})),Q.createElement("g",{mask:"url(#a)"},Q.createElement("path",{fill:"#C60000",d:"M.666 14 7.999 1.333 15.333 14zm2.3-1.333h10.067L7.999 4zm5.508-.859a.65.65 0 0 0 .192-.475.65.65 0 0 0-.192-.475.65.65 0 0 0-.475-.191.65.65 0 0 0-.475.191.65.65 0 0 0-.191.475q0 .285.191.475A.65.65 0 0 0 8 12a.65.65 0 0 0 .475-.192M7.333 10h1.333V6.667H7.333z"}))),$S=m.memo(yve),kve=({patient:e,genre:t,gravite:n,bed:c,bed_uf:i,room:r,orientation:s,status:d,backgroundColor:l="#ffffff",primaryFontColor:h="#111827",secondaryFontColor:u="#6b7280",statusFontColor:p="#0284c7",statusBackgroundColor:y="#e0f2fe",genreBackgroundColor:f="#9ca3af",genreFontSize:g,style:k,warn:x=!1,warnMessage:M,warnColor:v="#F94134"})=>o.jsxs("div",{className:Be.banner,style:{backgroundColor:l,...k},children:[o.jsxs("div",{className:Be.iep,children:[o.jsx("div",{style:{color:u},children:e.iep??"--"}),o.jsxs("div",{style:{color:h},children:[((e.nom||"").trim().split(/\s+/)[0]||"").substring(0,3).toUpperCase(),"."," ",((e.prenom||"").trim().split(/\s+/)[0]||"").substring(0,3).toLowerCase().replace(/^./,I=>I.toUpperCase()),".(",e.age,")"]})]}),o.jsxs("div",{className:Be.groupSmall,children:[o.jsx("span",{className:`${Be.genre} genre-info-banner`,style:{color:"#ffffff",background:f,fontSize:g},children:t??"--"}),o.jsx("span",{className:`${Be.gravite} gravite-info-banner`,children:n??"--"})]}),o.jsx("div",{className:Be.orientationContainer,children:o.jsx("div",{className:Be.service,style:{color:h},children:s??"--"})}),o.jsxs("div",{className:Be.roomBedContainer,children:[i&&o.jsx("span",{className:Be.bedUf,children:i}),o.jsx("span",{className:Be.room,children:r??"--"}),o.jsx("span",{className:Be.bed,children:c??"--"})]}),o.jsxs("div",{className:Be.statusContainer,children:[d?o.jsx("div",{className:`${Be.status} status-info-banner`,style:{color:p,backgroundColor:y},children:d}):x&&o.jsxs("div",{className:Be.centeredWarn,style:{textTransform:"uppercase"},children:[o.jsx($S,{color:v,width:20,height:20,style:{marginRight:"6px"}}),o.jsx("span",{style:{color:v,fontSize:"12px",fontWeight:600},children:M})]}),d&&x&&o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",color:v,fontSize:"10px",fontWeight:400,marginTop:"4px",textTransform:"uppercase"},children:[o.jsx($S,{color:v,width:12,height:12,style:{marginRight:"4px"}}),o.jsx("span",{children:M})]})]})]}),mve=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},Q.createElement("path",{d:"M200-200v-240h60v180h180v60zm500-320v-180H520v-60h240v240z"})),fve=m.memo(mve),gve=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},Q.createElement("path",{d:"m249-207-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231z"})),IA=m.memo(gve),vve=e=>Q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},Q.createElement("path",{d:"M440-440v240h-60v-180H200v-60zm140-320v180h180v60H520v-240z"})),xve=m.memo(vve),Mve="_overlay_1uxex_1",_ve="_container_1uxex_11",Lve="_fullscreen_1uxex_24",Ive="_header_1uxex_30",bve="_headerActions_1uxex_42",wve="_iconButton_1uxex_47",Cve="_body_1uxex_58",Nve="_sidebar_1uxex_65",jve="_content_1uxex_91",Sve="_contentHeader_1uxex_98",$ve="_childrenWrapper_1uxex_114",qve="_footer_1uxex_138",Ave="_baseButton_1uxex_146",zve="_noOverlay_1uxex_160",Vve="_contained_1uxex_168",je={overlay:Mve,container:_ve,fullscreen:Lve,header:Ive,headerActions:bve,iconButton:wve,body:Cve,sidebar:Nve,content:jve,contentHeader:Sve,childrenWrapper:$ve,footer:qve,baseButton:Ave,noOverlay:zve,contained:Vve},Pve=({headerText:e,headerTextColor:t="var(--color-text)",backgroundColor:n="var(--color-background)",headerFontSize:c="1rem",headerFontWeight:i="600",isOpen:r,onClose:s,leftButton:d,rightButton:l,children:h,contentTitle:u,contentBackgroundColor:p="var(--color-content-background)",sideContent:y,hideMaximize:f=!1,hideHeader:g=!1,hideSidebar:k=!1,onDelete:x,deleteLabel:M="Supprimer",width:v="75%",maxWidth:I="none",height:b="85%",maxHeight:C="85%",borderRadius:w="0.5rem",childrenPadding:_="1rem",overflow:L="auto",contentHeaderAction:S,contentFooterAction:N,footerOverride:j,hideFooter:A=!1,hideOverlay:B=!1,position:D,a11yConfig:V})=>{const[q,$]=m.useState(!1),H=m.useRef(null);if(m.useEffect(()=>{if(!r||!B)return;const z=U=>{(U.type==="scroll"||U.type==="wheel"||U.type==="touchmove"||H.current&&!H.current.contains(U.target))&&s()};return document.addEventListener("mousedown",z),document.addEventListener("scroll",z,!0),document.addEventListener("wheel",z,{passive:!0,capture:!0}),document.addEventListener("touchmove",z,{passive:!0,capture:!0}),()=>{document.removeEventListener("mousedown",z),document.removeEventListener("scroll",z,!0),document.removeEventListener("wheel",z,!0),document.removeEventListener("touchmove",z,!0)}},[r,B,s]),!r)return null;const R=(z,U=!1)=>o.jsx(sL,{onClick:z.disabled?void 0:z.onClick,className:je.baseButton,disabled:z.disabled,style:{background:z.backgroundColor??(U?"#008FBB":"#ffffff"),color:z.textColor??(U?"#ffffff":"#374151"),border:z.borderColor||U?"none":void 0,cursor:z.disabled?z.cursor??"not-allowed":z.cursor??"pointer",filter:z.disabled?z.filter??"grayscale(0.5)":z.filter??"none",opacity:z.disabled?.65:1},title:Z(z.a11yConfig,z.text),children:z.text});return o.jsx("div",{className:B?je.noOverlay:je.overlay,onClick:s,children:o.jsxs("div",{ref:H,className:`${je.container} ${q?je.fullscreen:""} ${B?je.contained:""}`,onClick:z=>z.stopPropagation(),style:{width:q?"100%":v,maxWidth:q?"none":I,height:q?"100%":b,maxHeight:q?"100%":C,borderRadius:q?"0":w,overflow:L,...D||{}},children:[!g&&o.jsxs("header",{className:je.header,style:{backgroundColor:n},children:[o.jsx("h2",{style:{fontSize:c,fontWeight:i,color:t},title:Z(V,e),children:e}),o.jsxs("div",{className:je.headerActions,children:[!f&&o.jsx("button",{onClick:()=>$(!q),className:je.iconButton,title:q?"Réduire":"Agrandir",children:q?o.jsx(xve,{width:22,height:22,fill:t}):o.jsx(fve,{width:22,height:22,fill:t})}),o.jsx("button",{onClick:s,className:je.iconButton,title:"Fermer",children:o.jsx(IA,{width:22,height:22,fill:t})})]})]}),o.jsxs("div",{className:je.body,style:{overflow:L},children:[y&&!k&&o.jsx("aside",{className:je.sidebar,children:y}),o.jsxs("main",{className:je.content,style:{backgroundColor:p,overflow:L},children:[u&&o.jsxs("header",{className:je.contentHeader,style:{backgroundColor:n},children:[o.jsx("span",{style:{color:t},children:u}),S]}),o.jsx("div",{className:je.childrenWrapper,style:{padding:_,overflow:L},children:h})]})]}),!A&&o.jsx("footer",{className:je.footer,style:{backgroundColor:n},children:j!==void 0?j:o.jsxs(o.Fragment,{children:[x&&o.jsx(sL,{onClick:x,className:je.baseButton,style:{background:"#fee2e2",color:"#ef4444",marginRight:"auto",border:"none"},children:M}),N,R(d),R(l,!0)]})})]})})},Tve="_container_1vb1c_1",Hve="_searchWrapper_1vb1c_10",Dve="_navItems_1vb1c_17",Bb={container:Tve,searchWrapper:Hve,navItems:Dve},Bve=({items:e,activeId:t,activeColor:n="#00aec7",backgroundColor:c="#fff",textColor:i="#000",onItemClick:r,searchValue:s="",onSearchChange:d,searchPlaceholder:l="Rechercher",width:h="100%",className:u=""})=>o.jsxs("div",{className:`${Bb.container} ${u}`,style:{width:h,backgroundColor:c,color:i},children:[o.jsx("div",{className:Bb.searchWrapper,children:o.jsx(fA,{value:s,onChange:d,placeholder:l,iconPosition:"right",iconColor:"var(--color-text)"})}),o.jsx("div",{className:Bb.navItems,children:e.map(p=>o.jsx(aC,{id:p.id,label:p.label,icon:p.icon,isActive:t===p.id,onClick:()=>r?.(p.id),activeColor:n,color:i,fontWeight:"600",fontSize:"0.75rem",padding:"0.75rem 1rem",iconGap:"0.5rem"},p.id))})]}),Rve=({modules:e,selectedModuleId:t,onSelectModule:n,onAddModule:c,onItemAdd:i,onEditModule:r,onDeleteModule:s,onReorder:d,title:l="Modules",titleKey:h,addModuleTitle:u="Ajouter un module",addModuleLabel:p="Titre",addModulePlaceholder:y="Nom du module",renameModuleTitle:f="Renommer le module",renameModuleLabel:g="Titre",renameModulePlaceholder:k="Nom du module",confirmText:x="Valider",cancelText:M="Annuler",headerLabel:v,headerLabelKey:I,showAddIcon:b=!0,showCount:C=!0,showToggle:w=!1,showActions:_=!0,onToggle:L,a11yConfig:S})=>{const[N,j]=m.useState(!1),[A,B]=m.useState(null),[D,V]=m.useState(null),[q,$]=m.useState(null),[H,R]=m.useState(null),z=()=>{R(O=>O===null?"asc":O==="asc"?"desc":null),L&&L()},U=m.useMemo(()=>H?[...e].sort((O,K)=>{const ne=O.title.toLowerCase(),Ne=K.title.toLowerCase();return H==="asc"?ne.localeCompare(Ne):Ne.localeCompare(ne)}):e,[e,H]),X=()=>j(!0),ie=()=>j(!1),ae=O=>{const K=O.title?.trim();K&&c&&c(K),ie()},fe=(O,K)=>{O.stopPropagation(),B(K)},de=()=>B(null),be=O=>{const K=O.title?.trim();A&&K&&r&&r(A,K),de()},oe=(O,K)=>{O.stopPropagation(),s&&s(K)},ee=(O,K)=>{O.stopPropagation(),i&&i(K)},te=(O,K)=>{V(K),O.dataTransfer.effectAllowed="move"},re=(O,K)=>{D!==null&&(O.preventDefault(),O.dataTransfer.dropEffect="move",K!==q&&$(K))},he=(O,K)=>{if(O.preventDefault(),D===null||D===K||!d)return;const ne=[...U],[Ne]=ne.splice(D,1);ne.splice(K,0,Ne),R(null),d(ne),V(null),$(null)},pe=()=>{V(null),$(null)};return o.jsxs("div",{className:"module-sidebar-v2",children:[o.jsx("div",{className:"sidebar-header",children:v?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"header-label-container",onClick:z,children:[o.jsx("div",{className:"header-label",title:Z(S,I),children:v}),H==="asc"?o.jsx(t1,{size:12,className:"header-toggle-icon",strokeWidth:3}):o.jsx(e1,{size:12,className:"header-toggle-icon",strokeWidth:3})]}),b&&o.jsx(zc,{size:18,className:"add-view-icon",onClick:X})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"header-title",title:Z(S,h),children:[w&&(H==="asc"?o.jsx(t1,{size:12,className:"header-toggle-icon default-toggle",strokeWidth:3,onClick:z}):o.jsx(e1,{size:12,className:"header-toggle-icon default-toggle",strokeWidth:3,onClick:z})),l," ",C&&`(${U.length})`]}),b&&o.jsx(zc,{size:18,className:"add-view-icon",onClick:X})]})}),o.jsx("div",{className:"module-list",children:U.map((O,K)=>o.jsxs("div",{className:`module-item ${O.id===t?"selected":""} ${q===K&&D!==K?"drag-over":""} ${D===K?"dragging":""}`,onClick:()=>n&&n(O),draggable:!!d,onDragStart:d?ne=>te(ne,K):void 0,onDragOver:d?ne=>re(ne,K):void 0,onDrop:d?ne=>he(ne,K):void 0,onDragEnd:d?pe:void 0,children:[O.icon||o.jsx(q1,{size:18,className:"drag-handle"}),o.jsxs("div",{className:"module-content",title:Z(O.a11yConfig,O.titleKey),children:[o.jsx("div",{className:"module-title",children:O.title}),O.subtitle&&o.jsx("div",{className:"module-subtitle",children:O.subtitle})]}),typeof O.count<"u"&&o.jsx("span",{className:"module-count",children:O.count}),_&&o.jsxs("div",{className:"module-actions",children:[i&&o.jsx(Vc,{size:14,className:"action-icon add",onClick:ne=>ee(ne,O)}),r&&o.jsx(gt,{size:12,className:"action-icon edit",onClick:ne=>fe(ne,O)}),s&&o.jsx(ut,{size:12,className:"action-icon delete",onClick:ne=>oe(ne,O)})]})]},O.id))}),o.jsx(Bc,{isOpen:N,onClose:ie,onSave:ae,title:u,fields:[{name:"title",label:p,placeholder:y}],confirmText:x,cancelText:M}),A&&o.jsx(Bc,{isOpen:!!A,onClose:de,onSave:be,title:f,initialValues:{title:A.title},fields:[{name:"title",label:g,placeholder:k}],confirmText:x,cancelText:M})]})},Fve=({keyName:e,translations:t,availableLanguages:n,onChange:c,onRename:i,onDelete:r,a11yConfig:s})=>{const[d,l]=m.useState(!1),[h,u]=m.useState(e),[p,y]=m.useState(null),[f,g]=m.useState(""),[k,x]=m.useState(!1),[M,v]=m.useState(""),[I,b]=m.useState(""),C=m.useMemo(()=>{const q={};return Array.isArray(t)&&t.forEach($=>{$&&$.language&&(q[$.language.toUpperCase()]=$.value)}),q},[t]),w=m.useMemo(()=>n,[n]),_=()=>{l(!1),h!==e&&h.trim()!==""?i&&i(h.trim()):u(e)},L=q=>{q.key==="Enter"?_():q.key==="Escape"&&(u(e),l(!1))},S=q=>{const $=q.toUpperCase();y($),g(C[$]||"")},N=()=>{p&&(c(p,f),y(null),g(""))},j=q=>{q.key==="Enter"?N():q.key==="Escape"&&(y(null),g(""))},A=()=>{x(!0),w.length>0&&v(w[0].toUpperCase()),b("")},B=()=>{M&&I.trim()&&(c(M,I.trim()),x(!1),v(""),b(""))},D=()=>{x(!1),v(""),b("")},V=q=>{q.key==="Enter"?B():q.key==="Escape"&&D()};return o.jsxs("div",{className:"translation-key-v2",children:[o.jsxs("div",{className:"header",children:[d?o.jsx("input",{className:"key-name-input",value:h,onChange:q=>u(q.target.value),onBlur:_,onKeyDown:L,autoFocus:!0}):o.jsx("h3",{className:"header-title",title:Z(s,e),children:e}),o.jsxs("div",{className:"header-actions",children:[o.jsx(gt,{size:16,className:"action-icon edit",onClick:()=>l(!0)}),o.jsx(ut,{size:16,className:"action-icon delete",onClick:r})]})]}),o.jsxs("div",{className:"translations-list",children:[n.map(q=>{const $=q.toUpperCase(),H=C[$]||"",R=p===$;return o.jsxs("div",{className:"lang-row",children:[o.jsx("div",{className:"lang-label",children:$}),R?o.jsx("input",{className:"translation-input editing",value:f,onChange:z=>g(z.target.value),onBlur:N,onKeyDown:j,placeholder:"Entrez la traduction...",autoFocus:!0}):o.jsx("div",{className:`translation-value ${H?"":"empty"}`,onClick:()=>S(q),title:"Cliquer pour éditer",children:H||"Cliquer pour ajouter..."})]},q)}),k?o.jsxs("div",{className:"lang-row add-row",children:[o.jsx("select",{className:"lang-select",value:M,onChange:q=>v(q.target.value),children:w.map(q=>o.jsx("option",{value:q.toUpperCase(),children:q.toUpperCase()},q))}),o.jsx("input",{className:"translation-input editing",value:I,onChange:q=>b(q.target.value),onKeyDown:V,placeholder:"Mot",autoFocus:!0}),o.jsxs("div",{className:"add-actions",children:[o.jsx(C1,{size:18,className:"action-icon confirm",onClick:B}),o.jsx(Qe,{size:18,className:"action-icon cancel",onClick:D})]})]}):w.length>0&&o.jsxs("button",{className:"add-translation-btn",onClick:A,children:[o.jsx(Vc,{size:16}),o.jsx("span",{children:"Ajouter"})]})]})]})},Eve="_overlay_1jz4r_1",Ove="_modal_1jz4r_15",Uve="_body_1jz4r_27",Wve="_footer_1jz4r_46",Gve="_confirmButton_1jz4r_55",Kve="_danger_1jz4r_75",Zve="_cancelButton_1jz4r_83",St={overlay:Eve,modal:Ove,body:Uve,footer:Wve,confirmButton:Gve,danger:Kve,cancelButton:Zve},Xve=({isOpen:e,message:t,onConfirm:n,onCancel:c,confirmText:i="Confirmer",cancelText:r="Annuler",isDanger:s=!1,hideFooter:d=!1,secondaryConfirmText:l,onSecondaryConfirm:h})=>e?o.jsx("div",{className:St.overlay,onClick:c,children:o.jsxs("div",{className:St.modal,onClick:u=>u.stopPropagation(),children:[o.jsx("div",{className:St.body,children:typeof t=="string"?o.jsx("p",{children:t}):t}),!d&&o.jsxs("div",{className:St.footer,children:[i&&o.jsx("button",{className:`${St.confirmButton} ${s?St.danger:""}`,onClick:n,children:i}),l&&h&&o.jsx("button",{className:St.confirmButton,onClick:h,children:l}),r&&o.jsx("button",{className:St.cancelButton,onClick:c,children:r})]})]})}):null,Yve="_card_1ildr_1",Jve="_topIcon_1ildr_17",Qve="_title_1ildr_24",e9e="_text_1ildr_31",t9e="_bottomIcon_1ildr_37",v1={card:Yve,topIcon:Jve,title:Qve,text:e9e,bottomIcon:t9e},a9e=({topIcon:e,title:t,text:n,bottomIcon:c,onClick:i,className:r="",headerTextColor:s="#000",textColor:d="#4b5563",backgroundColor:l="#fff",a11yConfig:h})=>o.jsxs("div",{className:`${v1.card} ${r}`,onClick:i,role:i?"button":void 0,tabIndex:i?0:void 0,style:{backgroundColor:l},title:Z(h,t),children:[e&&o.jsx("div",{className:v1.topIcon,children:e}),o.jsx("h3",{className:v1.title,style:{color:s},children:t}),o.jsx("p",{className:v1.text,style:{color:d},children:n}),c&&o.jsx("div",{className:v1.bottomIcon,children:c})]}),n9e="_container_1bmmf_1",o9e="_disabled_1bmmf_9",c9e="_selectBox_1bmmf_14",i9e="_selectBoxOpen_1bmmf_36",r9e="_tagsContainer_1bmmf_41",s9e="_tagsContainerWrap_1bmmf_51",d9e="_tag_1bmmf_41",l9e="_tagLabel_1bmmf_72",h9e="_removeBtnContainer_1bmmf_78",u9e="_removeBtn_1bmmf_78",p9e="_searchInput_1bmmf_103",y9e="_placeholder_1bmmf_123",k9e="_actions_1bmmf_130",m9e="_clearBtn_1bmmf_137",f9e="_chevron_1bmmf_159",g9e="_chevronOpen_1bmmf_165",v9e="_dropdown_1bmmf_169",x9e="_option_1bmmf_183",M9e="_optionHeader_1bmmf_196",_9e="_noOptions_1bmmf_212",L9e="_overflowBlock_1bmmf_219",I9e="_overflowEllipsis_1bmmf_226",b9e="_overflowBadge_1bmmf_233",w9e="_overflowBadgeWrap_1bmmf_256",C9e="_overflowDropdown_1bmmf_262",N9e="_overflowDropdownItem_1bmmf_278",j9e="_overflowDropdownItemLabel_1bmmf_289",S9e="_overflowDropdownItemRemove_1bmmf_296",ce={container:n9e,disabled:o9e,selectBox:c9e,selectBoxOpen:i9e,tagsContainer:r9e,tagsContainerWrap:s9e,tag:d9e,tagLabel:l9e,removeBtnContainer:h9e,removeBtn:u9e,searchInput:p9e,placeholder:y9e,actions:k9e,clearBtn:m9e,chevron:f9e,chevronOpen:g9e,dropdown:v9e,option:x9e,optionHeader:M9e,noOptions:_9e,overflowBlock:L9e,overflowEllipsis:I9e,overflowBadge:b9e,overflowBadgeWrap:w9e,overflowDropdown:C9e,overflowDropdownItem:N9e,overflowDropdownItemLabel:j9e,overflowDropdownItemRemove:S9e},$9e=({options:e,noOptionsMessage:t="",value:n,onChange:c,placeholder:i="Sélectionner...",isSearchable:r=!0,className:s="",disabled:d=!1,allowWrap:l=!1})=>{const[h,u]=m.useState(!1),[p,y]=m.useState(""),f=m.useRef(null),g=m.useRef(null),k=m.useRef(null),x=m.useRef(null),[M,v]=m.useState(null),[I,b]=m.useState(!1),C=m.useRef([]),w=m.useRef(null),_=m.useMemo(()=>{const $=new Map(e.map(H=>[H.value,H]));return n.map(H=>$.get(H)).filter(H=>H!==void 0)},[e,n]),L=m.useMemo(()=>e.filter($=>!n.includes($.value)),[e,n]),S=m.useMemo(()=>{let $=L;return p&&($=$.filter(H=>H.label.toLowerCase().includes(p.toLowerCase()))),$.filter((H,R)=>{if(!H.isHeader)return!0;for(let z=R+1;z<$.length&&!$[z].isHeader;z++)return!0;return!1})},[L,p]);m.useEffect(()=>{const $=H=>{const R=H.target;f.current&&!f.current.contains(R)&&(u(!1),y(""),v(null),b(!1))};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[]),m.useEffect(()=>{if(l)return;if(_.length===0){v(null),C.current=[];return}_.length>C.current.length&&v(null);const $=()=>{const U=k.current,X=x.current;if(!U||!X)return;const ie=X.getBoundingClientRect().width,ae=X.querySelector(`.${ce.actions}`),fe=ae?ae.getBoundingClientRect().width:80,de=56,be=r?80:0,oe=16,ee=Array.from(U.querySelectorAll(`.${ce.tag}`));ee.length===_.length&&(C.current=ee.map(ve=>{const Ve=ve.getBoundingClientRect(),kt=ve.scrollWidth;return Math.max(Ve.width,kt,ve.offsetWidth||0)}));const te=C.current,re=te.length>0?te.reduce((ve,Ve)=>ve+Ve,0)/te.length:120,he=_.length<=te.length?te.slice(0,_.length):[...te,...Array(_.length-te.length).fill(re)],pe=4,O=Math.max(0,ie-fe-be-oe);let K=0,ne=0;for(let ve=0;ve<_.length;ve++){const Ve=he[ve]??120;if(K+Ve+pe>O)break;K+=Ve+pe,ne++}if(ne>=_.length){v(null);return}const Ne=Math.max(0,ie-de-fe-be-oe);K=0;let qe=0;for(let ve=0;ve<_.length;ve++){const Ve=he[ve]??120;if(K+Ve+pe>Ne)break;K+=Ve+pe,qe++}qe<_.length&&qe>0?v(qe):v(null)},H=requestAnimationFrame(()=>{$()}),R=setTimeout($,100),z=new ResizeObserver(()=>{$()});return x.current&&z.observe(x.current),()=>{cancelAnimationFrame(H),clearTimeout(R),z.disconnect()}},[_,r,h,l]);const N=()=>{if(d)return;const $=!h;$&&b(!1),u($),$&&r&&setTimeout(()=>g.current?.focus(),0)},j=$=>{if(n.includes($.value))return;b(!1);const H=[..._,$];c(H),y(""),v(null),u(!1)},A=$=>{$.preventDefault(),$.stopPropagation(),b(H=>!H)},B=M!=null&&M<_.length?_.slice(M):[],D=($,H)=>{H.stopPropagation();const R=_.filter(z=>z.value!==$);c(R)},V=$=>{$.stopPropagation(),c([])},q=$=>{$.stopPropagation(),h||u(!0)};return o.jsxs("div",{className:`${ce.container} ${s} ${d?ce.disabled:""}`,ref:f,children:[o.jsxs("div",{ref:x,className:`${ce.selectBox} ${h?ce.selectBoxOpen:""}`,onClick:N,role:"combobox","aria-expanded":h,"aria-haspopup":"listbox",children:[o.jsxs("div",{className:`${ce.tagsContainer} ${l?ce.tagsContainerWrap:""}`,ref:k,children:[M!==null&&M>0?_.slice(0,M).map(($,H)=>o.jsxs("div",{className:ce.tag,children:[o.jsx("div",{className:ce.tagLabel,children:o.jsx("span",{children:$.label})}),o.jsx("div",{className:ce.removeBtnContainer,children:o.jsx("button",{type:"button",className:ce.removeBtn,onClick:R=>D($.value,R),"aria-label":`Supprimer ${$.label}`,children:o.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:o.jsx("path",{d:"M8.5 1.5L1.5 8.5M1.5 1.5L8.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})})]},`tag-${$.value}-${H}`)):_.map(($,H)=>o.jsxs("div",{className:ce.tag,children:[o.jsx("div",{className:ce.tagLabel,children:o.jsx("span",{children:$.label})}),o.jsx("div",{className:ce.removeBtnContainer,children:o.jsx("button",{type:"button",className:ce.removeBtn,onClick:R=>D($.value,R),"aria-label":`Supprimer ${$.label}`,children:o.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:o.jsx("path",{d:"M8.5 1.5L1.5 8.5M1.5 1.5L8.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})})]},`tag-${$.value}-${H}`)),r?o.jsx("input",{ref:g,type:"text",className:ce.searchInput,placeholder:_.length===0?i:"",value:p,onChange:$=>{y($.target.value),h||u(!0)},onClick:q,disabled:d}):_.length===0&&o.jsx("span",{className:ce.placeholder,children:i})]}),!l&&M!==null&&M<_.length&&o.jsxs("div",{className:ce.overflowBlock,children:[o.jsx("span",{className:ce.overflowEllipsis,children:"..."}),o.jsxs("div",{className:ce.overflowBadgeWrap,children:[o.jsx("button",{ref:w,type:"button",className:ce.overflowBadge,onClick:A,"aria-label":`Afficher ${B.length} éléments cachés`,children:B.length}),I&&B.length>0&&o.jsx("div",{className:ce.overflowDropdown,role:"list","aria-label":"Éléments cachés",children:B.map(($,H)=>o.jsxs("div",{className:ce.overflowDropdownItem,children:[o.jsx("span",{className:ce.overflowDropdownItemLabel,children:$.label}),o.jsx("button",{type:"button",className:ce.overflowDropdownItemRemove,onClick:R=>{R.stopPropagation(),D($.value,R)},"aria-label":`Supprimer ${$.label}`,children:o.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:o.jsx("path",{d:"M8.5 1.5L1.5 8.5M1.5 1.5L8.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]},`hidden-${$.value}-${H}`))})]})]}),o.jsxs("div",{className:ce.actions,children:[_.length>0&&o.jsx("button",{type:"button",className:ce.clearBtn,onClick:V,"aria-label":"Effacer tout",children:o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:o.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),o.jsx("svg",{className:`${ce.chevron} ${h?ce.chevronOpen:""}`,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M6 9l6 6 6-6"})})]})]}),h&&!d&&o.jsx("div",{className:ce.dropdown,role:"listbox",children:S.length>0?S.map(($,H)=>o.jsx("div",{className:`${ce.option} ${$.isHeader?ce.optionHeader:""}`,onClick:()=>!$.isHeader&&j($),role:"option","aria-selected":!1,children:$.label},`opt-${$.value}-${H}`)):o.jsx("div",{className:ce.noOptions,children:t})})]})},q9e="_container_h7jek_1",qS={container:q9e},A9e=({a11yConfigs:e=[],titleKeys:t=[],labels:n=[],data:c=[],selectedUfs:i=[],icons:r=[],lastCardTextColor:s="black",boardColors:d={},order:l})=>{const h=m.useMemo(()=>{const g=i.length===0?c:c.filter(x=>x&&i.includes(String(x.uf).replace(/^0+/,""))),k=new Set;return g.filter(x=>{if(!x||!x.uf)return!1;const M=String(x.uf).replace(/^0+/,"");return k.has(M)?!1:(k.add(M),!0)})},[c,i]),u=m.useMemo(()=>h.reduce((g,k)=>({disponibles:g.disponibles+(k.totalAvailable??k.disponibles??0),homme:g.homme+(k.availableMen??k.disponibleHomme??0),femme:g.femme+(k.availableWomen??k.disponibleFemme??0),indifferencie:g.indifferencie+(k.availableIndifferentSex??k.indifferences??0),sorties:g.sorties+(k.outToday??k.sortie24??0),occupiedBed:g.occupiedBed+(k.occupiedBed??0),patientsPresents:g.patientsPresents+(k.patientsPresents??0),occupationRate:g.occupationRate+(k.occupationRate??0),occupesRaw:g.occupesRaw+(k.occupesRaw??0),ouvertsRaw:g.ouvertsRaw+(k.ouvertsRaw??0)}),{disponibles:0,homme:0,femme:0,indifferencie:0,sorties:0,occupiedBed:0,patientsPresents:0,occupationRate:0,occupesRaw:0,ouvertsRaw:0}),[h]),p=g=>d.disponibles?d.disponibles:g>3?"#35994E":g>=1?"#EF6C00":"#C62828",y={bars:"none",justifyContent:"flexStart",alignItems:"center",valueFontWeight:"400",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}},f=(g,k)=>{const x=l!==void 0&&k===l.length-1;switch(g){case"disponibles":return{...y,value:u.disponibles.toLocaleString("fr-FR"),backgroundColor:p(u.disponibles),valueFontSize:"2.5rem",titleColor:"white",valueColor:"white"};case"occupiedBed":return{...y,value:u.occupiedBed.toLocaleString("fr-FR"),backgroundColor:d.occupes??d.homme??"#7DD493",valueFontSize:x?"3rem":"2.375rem",titleColor:"black",valueColor:"black"};case"patientsPresents":return{...y,value:u.patientsPresents.toLocaleString("fr-FR"),backgroundColor:d.patientsPresents??d.femme??"#7DD493",valueFontSize:x?"3rem":"2.375rem",titleColor:"black",valueColor:"black"};case"occupationRate":{const M=u.ouvertsRaw>0?parseFloat((u.occupesRaw/u.ouvertsRaw*100).toFixed(2)):u.occupationRate;return{...y,value:`${M.toLocaleString("fr-FR")}%`,backgroundColor:d.occupationRate??d.indifferencie??"#7DD493",valueFontSize:x?"3rem":"2.375rem",titleColor:"black",valueColor:"black"}}case"outToday":return{...y,value:u.sorties.toLocaleString("fr-FR"),backgroundColor:d.sorties??"#F2F9FC",valueFontSize:"3rem",titleColor:s,valueColor:s}}};return l&&l.length>0?o.jsx("div",{className:qS.container,children:l.map((g,k)=>o.jsx(vt,{a11yConfig:e[k],titleKey:t[k],label:n[k],iconName:r[k],...f(g,k)},g))}):o.jsxs("div",{className:qS.container,children:[o.jsx(vt,{a11yConfig:e[0],titleKey:t[0],label:n[0],value:u.disponibles.toLocaleString("fr-FR"),iconName:r[0],backgroundColor:p(u.disponibles),valueFontSize:"2.5rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"white",valueColor:"white",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),o.jsx(vt,{a11yConfig:e[1],titleKey:t[1],label:n[1],value:u.homme.toLocaleString("fr-FR"),iconName:r[1],backgroundColor:d.homme??"#7DD493",valueFontSize:"2.375rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"black",valueColor:"black",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),o.jsx(vt,{a11yConfig:e[2],titleKey:t[2],label:n[2],value:u.femme.toLocaleString("fr-FR"),iconName:r[2],backgroundColor:d.femme??"#7DD493",valueFontSize:"2.375rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"black",valueColor:"black",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),o.jsx(vt,{a11yConfig:e[3],titleKey:t[3],label:n[3],value:u.indifferencie.toLocaleString("fr-FR"),iconName:r[3],backgroundColor:d.indifferencie??"#7DD493",valueFontSize:"2.375rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"black",valueColor:"black",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),o.jsx(vt,{a11yConfig:e[4],titleKey:t[4],label:n[4],value:u.sorties.toLocaleString("fr-FR"),iconName:r[4],backgroundColor:d.sorties??"#F2F9FC",valueFontSize:"3rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:s,valueColor:s,titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}})]})},z9e="_container_1pt6c_1",V9e="_chartContainer_1pt6c_14",P9e="_legend_1pt6c_22",T9e="_legendItem_1pt6c_29",H9e="_leftSection_1pt6c_41",D9e="_colorIndicator_1pt6c_47",B9e="_label_1pt6c_54",R9e="_rightSection_1pt6c_60",F9e="_ratio_1pt6c_66",E9e="_value1_1pt6c_73",O9e="_separator_1pt6c_78",U9e="_value2_1pt6c_82",W9e="_statusIndicator_1pt6c_87",G9e="_inactive_1pt6c_102",Re={container:z9e,chartContainer:V9e,legend:P9e,legendItem:T9e,leftSection:H9e,colorIndicator:D9e,label:B9e,rightSection:R9e,ratio:F9e,value1:E9e,separator:O9e,value2:U9e,statusIndicator:W9e,inactive:G9e},AS=Math.PI/180,K9e=({data:e,height:t=400,bg:n,backgroundColor:c,color:i,fontSize:r,fontWeight:s,padding:d,margin:l,borderRadius:h,className:u="",style:p={},labelColor:y,ratioColor:f,separatorColor:g,borderColor:k,hideDonut:x=!0,hideColorIndicator:M=!1})=>{const[v,I]=m.useState(new Set(e.map(N=>N.nom))),b=N=>{const j=new Set(v);j.has(N)?j.size>1&&j.delete(N):j.add(N),I(j)},C={...p,"--bg-color":n||c||"transparent","--text-color":i||"inherit","--font-size":r||"14px","--font-weight":s||"400","--padding":d||"0","--margin":l||"0","--border-radius":h||"0","--label-color":y||"inherit","--ratio-color":f||"inherit","--separator-color":g||"#03a9f4","--border-color":k||"#e0e0e0"},w=m.useMemo(()=>e.map(N=>({...N,displayValue:v.has(N.nom)?N.value:0})),[e,v]),_=m.useMemo(()=>e.every(N=>N.value===0),[e]),L=m.useMemo(()=>_?1:w.reduce((N,j)=>N+j.displayValue,0)||1,[_,w]),S=m.useCallback(({cx:N,cy:j,midAngle:A,innerRadius:B,outerRadius:D,value:V})=>{if(V===0||_)return null;const q=B+(D-B)*.5,$=N+q*Math.cos(-A*AS),H=j+q*Math.sin(-A*AS),R=Math.round(V/L*100);return o.jsx(a.Text,{x:$,y:H,fill:"white",textAnchor:"middle",dominantBaseline:"central",fontSize:12,fontWeight:"bold",children:`${R}%`})},[L,_]);return o.jsxs("div",{className:`${Re.container} ${u}`,style:C,children:[!x&&o.jsx("div",{className:Re.chartContainer,style:{height:t/2+100},children:o.jsx(a.ResponsiveContainer,{width:"100%",height:"100%",children:o.jsx(a.PieChart,{children:o.jsx(a.Pie,{data:_?[{displayValue:1,color:"#A3C2CB"}]:w,cx:"50%",cy:"50%",innerRadius:45,outerRadius:75,paddingAngle:0,dataKey:"displayValue",stroke:"white",strokeWidth:_?0:2,startAngle:90,endAngle:450,labelLine:!1,label:S,isAnimationActive:!1,children:_?o.jsx(a.Cell,{fill:"#A3C2CB"}):w.map((N,j)=>o.jsx(a.Cell,{fill:N.color},`cell-${j}`))})})})}),o.jsx("div",{className:Re.legend,children:e.map((N,j)=>{const A=v.has(N.nom);return o.jsxs("div",{className:`${Re.legendItem} ${!x&&!A?Re.inactive:""}`,onClick:()=>b(N.nom),style:{cursor:"pointer",transition:"opacity 0.2s"},children:[o.jsxs("div",{className:Re.leftSection,children:[!M&&o.jsx("div",{className:Re.colorIndicator,style:{backgroundColor:N.color,opacity:x||A?1:.3}}),o.jsx("span",{className:Re.label,style:{opacity:x||A?1:.5},children:N.nom})]}),o.jsxs("div",{className:Re.rightSection,style:{opacity:x||A?1:.5},children:[o.jsxs("div",{className:Re.ratio,children:[o.jsx("span",{className:Re.value1,children:N.value1}),o.jsx("span",{className:Re.separator,children:"/"}),o.jsx("span",{className:Re.value2,children:N.value2})]}),N.statusColor&&o.jsx("div",{className:Re.statusIndicator,style:{backgroundColor:N.statusColor}})]})]},`legend-${j}`)})})]})},Z9e="_container_1pc4v_1",X9e="_leftGroup_1pc4v_10",Y9e="_iconBtn_1pc4v_16",si={container:Z9e,leftGroup:X9e,iconBtn:Y9e},J9e=e=>Q.createElement("svg",{width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",...e},Q.createElement("path",{d:"M3 12h18M3 6h18M3 18h18"})),Q9e=m.memo(J9e),exe=e=>Q.createElement("svg",{width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",...e},Q.createElement("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8m-4-6-4-4-4 4m4-4v13"})),bA=m.memo(exe),txe=({menuIcon:e,logoProps:t,actionIcon:n,style:c,className:i,bgColor:r="var(--header-bg)",color:s="var(--color-text)",borderBottomColor:d="var(--color-border)",borderBottomWidth:l=1,height:h="8vh",onMenuClick:u,onActionClick:p})=>{const y={backgroundColor:r,color:s,borderBottom:`${l}px solid ${d}`,height:h,...c};return o.jsxs("header",{className:[si.container,i].filter(Boolean).join(" "),style:y,children:[o.jsxs("div",{className:si.leftGroup,children:[o.jsx("button",{className:si.iconBtn,onClick:u,"aria-label":"Menu",style:{color:"inherit"},children:e??o.jsx(Q9e,{width:22,height:22})}),o.jsx(xL,{...t,size:"medium"})]}),o.jsx("button",{className:si.iconBtn,onClick:p,"aria-label":"Action",style:{color:"inherit"},children:n??o.jsx(bA,{width:22,height:22})})]})},axe="_container_24g3e_1",nxe="_iconBtn_24g3e_10",oxe="_title_24g3e_22",di={container:axe,iconBtn:nxe,title:oxe},cxe=({title:e="Menu",closeIcon:t,actionIcon:n,style:c,className:i,titleStyle:r,bgColor:s="var(--header-bg)",color:d="var(--color-text)",borderBottomColor:l="transparent",borderBottomWidth:h=0,height:u="8vh",onClose:p,onAction:y})=>{const f={backgroundColor:s,color:d,borderBottom:`${h}px solid ${l}`,height:u,...c};return o.jsxs("div",{className:[di.container,i].filter(Boolean).join(" "),style:f,children:[o.jsx("button",{className:di.iconBtn,onClick:p,"aria-label":"Fermer",style:{color:"inherit"},children:t??o.jsx(IA,{width:22,height:22})}),o.jsx("span",{className:di.title,style:{fontWeight:"var(--font-weight-h)",fontSize:"var(--h5)",...r},children:e.toUpperCase()}),o.jsx("button",{className:di.iconBtn,onClick:y,"aria-label":"Partager",style:{color:"inherit"},children:n??o.jsx(bA,{width:22,height:22})})]})},ixe=({title:e,countLabel:t="UF",actionIcon:n=o.jsx(ut,{size:16}),onAction:c,items:i=[],onItemClick:r,activeColor:s="#0083bb",id:d,children:l})=>{const h=m.useMemo(()=>i.filter(u=>u.active).length,[i]);return o.jsxs(rxe,{id:d,children:[o.jsxs(sxe,{children:[o.jsxs(dxe,{children:[o.jsx(lxe,{children:e}),o.jsxs(hxe,{children:["(",h," ",t,")"]})]}),c&&o.jsx(uxe,{onClick:c,title:"Action",children:n})]}),o.jsx(pxe,{children:o.jsx(yxe,{children:i.map(u=>o.jsx(mxe,{item:u,activeColor:s,onItemClick:r},u.id))})}),l&&o.jsx(fxe,{children:l})]})},rxe=F.div`
|
|
8346
8346
|
background: white;
|
|
8347
8347
|
border: 1px solid #ddd;
|
|
8348
8348
|
border-radius: 4px;
|
|
@@ -8779,9 +8779,9 @@
|
|
|
8779
8779
|
&:hover {
|
|
8780
8780
|
opacity: 1;
|
|
8781
8781
|
}
|
|
8782
|
-
`,Kxe="_patientCard_liq5j_1",Zxe="_notAllowedCursor_liq5j_16",Xxe="_innerPadding_liq5j_26",Yxe="_noFooterMargin_liq5j_33",Jxe="_topArea_liq5j_37",Qxe="_small_liq5j_46",eMe="_header_liq5j_59",tMe="_headerLeft_liq5j_66",aMe="_headerRight_liq5j_72",nMe="_uf_liq5j_77",oMe="_rmBadge_liq5j_85",cMe="_roomBed_liq5j_100",iMe="_content_liq5j_107",rMe="_body_liq5j_119",sMe="_upperBodyContent_liq5j_137",dMe="_patientInfo_liq5j_147",lMe="_iep_liq5j_152",hMe="_name_liq5j_157",uMe="_birthName_liq5j_164",pMe="_firstNames_liq5j_169",yMe="_dobAge_liq5j_174",kMe="_duration_liq5j_179",mMe="_comment_liq5j_185",fMe="_timeline_liq5j_192",gMe="_destination_liq5j_196",vMe="_todayReservation_liq5j_204",xMe="_arrow_liq5j_225",MMe="_progressBar_liq5j_230",_Me="_progressFill_liq5j_240",LMe="_progressDate_liq5j_250",IMe="_footer_liq5j_261",bMe="_actionsLeft_liq5j_270",wMe="_actionsRight_liq5j_271",CMe="_iconWrap_liq5j_277",NMe="_centerLabelHuge_liq5j_296",jMe="_labelYellow_liq5j_303",SMe="_expectedBottom_liq5j_322",$Me="_expectedPrefix_liq5j_330",qMe="_expectedDate_liq5j_336",AMe="_notesView_liq5j_357",zMe="_notesHeader_liq5j_365",VMe="_notesTitle_liq5j_371",PMe="_notesList_liq5j_377",TMe="_noteItem_liq5j_383",HMe="_reservationView_liq5j_388",DMe="_reservationNote_liq5j_400",BMe="_bottomArea_liq5j_405",RMe="_bottomLeftSymbol_liq5j_413",E={patientCard:Kxe,notAllowedCursor:Zxe,innerPadding:Xxe,noFooterMargin:Yxe,topArea:Jxe,small:Qxe,header:eMe,headerLeft:tMe,headerRight:aMe,uf:nMe,rmBadge:oMe,roomBed:cMe,content:iMe,body:rMe,upperBodyContent:sMe,patientInfo:dMe,iep:lMe,name:hMe,birthName:uMe,firstNames:pMe,dobAge:yMe,duration:kMe,comment:mMe,timeline:fMe,destination:gMe,todayReservation:vMe,arrow:xMe,progressBar:MMe,progressFill:_Me,progressDate:LMe,footer:IMe,actionsLeft:bMe,actionsRight:wMe,iconWrap:CMe,centerLabelHuge:NMe,labelYellow:jMe,expectedBottom:SMe,expectedPrefix:$Me,expectedDate:qMe,notesView:AMe,notesHeader:zMe,notesTitle:VMe,notesList:PMe,noteItem:TMe,reservationView:HMe,reservationNote:DMe,bottomArea:BMe,bottomLeftSymbol:RMe},FMe=({size:e="large",className:t="",customStyle:n,topAreaStyle:c,headerLeft:i,headerRight:r,centerHugeLabel:s,iep:d,nameLine:l,birthName:h,birthNamePrefix:u,firstNamesLine:p,dobAgeLine:y,stayDuration:f,comment:g,expectedDate:k,expectedDatePrefix:x,showTimeline:M=!1,destination:v,progress:I=0,progressTrackColor:b,progressFillColor:C,progressLabel:w,showFooter:_=!1,leftIcons:L=[],rightIcons:S=[],activeView:N="default",notesHeaderTitle:j,notesHeaderIcon:A,notesList:B=[],reservationNote:D,isYellowLabel:V=!1,bottomLeftSymbol:q,cursorNotAllowed:$=!1,rmBadge:H,isReservationToday:R=!1})=>{const z=e==="small",
|
|
8782
|
+
`,Kxe="_patientCard_liq5j_1",Zxe="_notAllowedCursor_liq5j_16",Xxe="_innerPadding_liq5j_26",Yxe="_noFooterMargin_liq5j_33",Jxe="_topArea_liq5j_37",Qxe="_small_liq5j_46",eMe="_header_liq5j_59",tMe="_headerLeft_liq5j_66",aMe="_headerRight_liq5j_72",nMe="_uf_liq5j_77",oMe="_rmBadge_liq5j_85",cMe="_roomBed_liq5j_100",iMe="_content_liq5j_107",rMe="_body_liq5j_119",sMe="_upperBodyContent_liq5j_137",dMe="_patientInfo_liq5j_147",lMe="_iep_liq5j_152",hMe="_name_liq5j_157",uMe="_birthName_liq5j_164",pMe="_firstNames_liq5j_169",yMe="_dobAge_liq5j_174",kMe="_duration_liq5j_179",mMe="_comment_liq5j_185",fMe="_timeline_liq5j_192",gMe="_destination_liq5j_196",vMe="_todayReservation_liq5j_204",xMe="_arrow_liq5j_225",MMe="_progressBar_liq5j_230",_Me="_progressFill_liq5j_240",LMe="_progressDate_liq5j_250",IMe="_footer_liq5j_261",bMe="_actionsLeft_liq5j_270",wMe="_actionsRight_liq5j_271",CMe="_iconWrap_liq5j_277",NMe="_centerLabelHuge_liq5j_296",jMe="_labelYellow_liq5j_303",SMe="_expectedBottom_liq5j_322",$Me="_expectedPrefix_liq5j_330",qMe="_expectedDate_liq5j_336",AMe="_notesView_liq5j_357",zMe="_notesHeader_liq5j_365",VMe="_notesTitle_liq5j_371",PMe="_notesList_liq5j_377",TMe="_noteItem_liq5j_383",HMe="_reservationView_liq5j_388",DMe="_reservationNote_liq5j_400",BMe="_bottomArea_liq5j_405",RMe="_bottomLeftSymbol_liq5j_413",E={patientCard:Kxe,notAllowedCursor:Zxe,innerPadding:Xxe,noFooterMargin:Yxe,topArea:Jxe,small:Qxe,header:eMe,headerLeft:tMe,headerRight:aMe,uf:nMe,rmBadge:oMe,roomBed:cMe,content:iMe,body:rMe,upperBodyContent:sMe,patientInfo:dMe,iep:lMe,name:hMe,birthName:uMe,firstNames:pMe,dobAge:yMe,duration:kMe,comment:mMe,timeline:fMe,destination:gMe,todayReservation:vMe,arrow:xMe,progressBar:MMe,progressFill:_Me,progressDate:LMe,footer:IMe,actionsLeft:bMe,actionsRight:wMe,iconWrap:CMe,centerLabelHuge:NMe,labelYellow:jMe,expectedBottom:SMe,expectedPrefix:$Me,expectedDate:qMe,notesView:AMe,notesHeader:zMe,notesTitle:VMe,notesList:PMe,noteItem:TMe,reservationView:HMe,reservationNote:DMe,bottomArea:BMe,bottomLeftSymbol:RMe},FMe=({size:e="large",className:t="",customStyle:n,topAreaStyle:c,headerLeft:i,headerRight:r,centerHugeLabel:s,iep:d,nameLine:l,birthName:h,birthNamePrefix:u,firstNamesLine:p,dobAgeLine:y,stayDuration:f,comment:g,expectedDate:k,expectedDatePrefix:x,showTimeline:M=!1,destination:v,progress:I=0,progressTrackColor:b,progressFillColor:C,progressLabel:w,showFooter:_=!1,leftIcons:L=[],rightIcons:S=[],activeView:N="default",notesHeaderTitle:j,notesHeaderIcon:A,notesList:B=[],reservationNote:D,isYellowLabel:V=!1,bottomLeftSymbol:q,cursorNotAllowed:$=!1,rmBadge:H,isReservationToday:R=!1})=>{const z=e==="small",U=`
|
|
8783
8783
|
${E.patientCard}
|
|
8784
8784
|
${z?E.small:""}
|
|
8785
8785
|
${$?E.notAllowedCursor:""}
|
|
8786
8786
|
${t}
|
|
8787
|
-
`.trim();return o.jsx("div",{className:
|
|
8787
|
+
`.trim();return o.jsx("div",{className:U,style:n,children:o.jsxs("div",{className:E.innerPadding,children:[o.jsxs("div",{className:`${E.topArea} ${_?"":E.noFooterMargin}`,style:c,children:[o.jsx("div",{className:E.header,children:H?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:E.headerLeft,children:o.jsxs("div",{className:E.uf,children:[i,r&&` - ${r}`]})}),o.jsx("div",{className:E.headerRight,children:o.jsx("div",{className:E.rmBadge,children:H})})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:E.headerLeft,children:i&&o.jsx("div",{className:E.uf,children:i})}),o.jsx("div",{className:E.headerRight,children:r&&o.jsx("span",{className:E.roomBed,children:r})})]})}),o.jsxs("div",{className:E.content,children:[o.jsxs("div",{className:E.body,children:[N==="default"&&o.jsxs(o.Fragment,{children:[s&&o.jsx("div",{className:`${E.centerLabelHuge} ${V?E.labelYellow:""}`,children:s}),o.jsxs("div",{className:E.upperBodyContent,children:[o.jsxs("div",{className:E.patientInfo,children:[d&&o.jsx("div",{className:E.iep,children:d}),l&&o.jsx("div",{className:E.name,children:l}),h&&o.jsxs("div",{className:E.birthName,children:["(",u?`${u} ${h}`:h,")"]}),p&&o.jsx("div",{className:E.firstNames,children:p}),y&&o.jsx("div",{className:E.dobAge,children:y})]}),f&&o.jsx("div",{className:E.duration,children:f}),g&&o.jsx("div",{className:E.comment,children:g})]}),k&&o.jsxs("div",{className:E.expectedBottom,children:[x&&o.jsx("div",{className:E.expectedPrefix,children:x}),o.jsx("div",{className:E.expectedDate,children:k})]})]}),N==="notes"&&o.jsxs("div",{className:E.notesView,children:[o.jsxs("div",{className:E.notesHeader,children:[A,o.jsx("span",{className:E.notesTitle,children:j})]}),o.jsx("div",{className:E.notesList,children:B.map((X,ie)=>o.jsx("div",{className:E.noteItem,children:X},ie))})]}),N==="reservation"&&o.jsxs("div",{className:E.reservationView,children:[s&&o.jsx("div",{className:`${E.centerLabelHuge} ${V?E.labelYellow:""}`,children:s}),o.jsx("div",{className:E.upperBodyContent,children:o.jsxs("div",{className:E.patientInfo,children:[d&&o.jsx("div",{className:E.iep,children:d}),l&&o.jsx("div",{className:E.name,children:l}),h&&o.jsxs("div",{className:E.birthName,children:["(",u?`${u} ${h}`:h,")"]}),p&&o.jsx("div",{className:E.firstNames,children:p}),y&&o.jsx("div",{className:E.dobAge,children:y})]})}),D&&o.jsx("div",{className:E.reservationNote,children:D})]})]}),(q||M||v)&&o.jsxs("div",{className:E.bottomArea,children:[q&&o.jsx("div",{className:E.bottomLeftSymbol,children:q}),v&&o.jsxs("div",{className:`${E.destination} ${R?E.todayReservation:""}`,children:[o.jsx("span",{className:E.arrow,children:"→"}),v.prefix&&o.jsx("span",{children:v.prefix}),o.jsx("strong",{children:v.name}),v.suffix&&o.jsx("span",{children:v.suffix})]}),M&&o.jsx("div",{className:E.timeline,children:b&&b!=="transparent"&&o.jsxs("div",{className:E.progressBar,style:{backgroundColor:b},children:[o.jsx("div",{className:E.progressFill,style:{width:`${I}%`,backgroundColor:C}}),w&&o.jsx("span",{className:E.progressDate,children:w})]})})]})]})]}),_&&o.jsxs("div",{className:E.footer,children:[o.jsx("div",{className:E.actionsLeft,children:L.map((X,ie)=>o.jsx("div",{className:E.iconWrap,children:X},`left-${ie}`))}),o.jsx("div",{className:E.actionsRight,children:S.map((X,ie)=>o.jsx("div",{className:E.iconWrap,children:X},`right-${ie}`))})]})]})})},EMe=({title:e,titleBold:t,titleKey:n,items:c,className:i="",width:r,style:s,labelStyle:d,valueStyle:l,headerStyle:h,a11yConfig:u,onItemClick:p,onDeleteItem:y})=>{const f={width:r||"100%",...s};return o.jsxs("div",{className:`data-list-v2-container ${i}`,style:f,children:[(e||t)&&o.jsx("div",{className:"data-list-v2-header",style:h,children:o.jsxs("h2",{className:"header-title",title:Z(u,n),children:[e&&o.jsx("span",{className:"title-regular",children:e}),t&&o.jsx("span",{className:"title-bold",children:t})]})}),o.jsx("div",{className:"data-list-v2-content",children:c.map(g=>o.jsxs("div",{className:`data-list-v2-item ${p?"interactive":""} ${g.showValueLine?"with-value-line":""}`,onClick:()=>p?.(g),children:[o.jsx("div",{className:"item-label-col",style:d,children:o.jsx("div",{className:"item-label",title:Z(g.a11yConfig,g.labelKey),children:g.label})}),o.jsxs("div",{className:"item-value-col",style:l,children:[o.jsx("div",{className:"item-value",title:Z(g.a11yConfig,g.valueKey),children:g.value}),y&&o.jsx("div",{className:"item-delete-action",onClick:k=>{k.stopPropagation(),y(g)},children:o.jsx(ut,{size:16})})]})]},g.id))})]})},OMe=({id:e,data:t,children:n,className:c,onDragStart:i,onDragEnd:r})=>{const s=l=>{l.dataTransfer.setData("text/plain",e),t&&l.dataTransfer.setData("application/json",JSON.stringify(t)),l.dataTransfer.effectAllowed="move",i&&i(l,t)},d=l=>{r&&r(l)};return o.jsx("div",{draggable:!0,onDragStart:s,onDragEnd:d,style:{cursor:"grab"},className:c,children:n})},UMe=({id:e,onDrop:t,children:n,className:c="",activeClassName:i="is-drag-over"})=>{const[r,s]=m.useState(!1),d=m.useRef(0),l=f=>{f.preventDefault(),d.current+=1,d.current>0&&s(!0)},h=f=>{f.preventDefault(),f.dataTransfer.dropEffect="move"},u=f=>{f.preventDefault(),d.current-=1,d.current===0&&s(!1)},p=f=>{f.preventDefault(),s(!1),d.current=0;const g=f.dataTransfer.getData("text/plain");let k;try{const x=f.dataTransfer.getData("application/json");x&&(k=JSON.parse(x))}catch(x){console.error("Failed to parse drag data",x)}g&&t(g,k)},y=`${c} ${r?i:""}`.trim();return o.jsx("div",{onDragEnter:l,onDragOver:h,onDragLeave:u,onDrop:p,className:y,"data-droppable-id":e,children:n})};exports.LineChart=a.LineChart;exports.PeriodRange=a.PeriodRange;exports.SimpleBarChart=a.SimpleBarChart;exports.ActionCard=a9e;exports.AddItemModal=Bc;exports.Alert=tC;exports.AlertsProvider=H3e;exports.BadgeList=DS;exports.BadgeRenderer=sA;exports.Button=sL;exports.ChartContainer=P3e;exports.CheckboxInput=Bq;exports.CircularProgress=Rb;exports.ColorInput=Uq;exports.ComponentVisibilityManager=Ob;exports.ComponentVisibilityToggle=tfe;exports.ConfirmationModal=Xve;exports.ConfirmationPopup=Fme;exports.CounterListBox=wme;exports.CurrencyRenderer=hA;exports.DashboardSummary=A6e;exports.DataBoard=vt;exports.DataFourBoards=gA;exports.DataListV2=EMe;exports.DateInput=Eq;exports.DatePicker=kw;exports.DateRenderer=dA;exports.DayStatCard=D2e;exports.DayStatCardV2=Yfe;exports.DonutChartRatio=K9e;exports.Draggable=OMe;exports.DraggableProvider=E2e;exports.DraggableSwitcherButton=dL;exports.Droppable=UMe;exports.DynamicForm=Z4e;exports.DynamicIcon=pw;exports.DynamicInput=Wq;exports.EmailRenderer=iA;exports.Encours=W6e;exports.EntryControl=Ime;exports.FileInput=Fq;exports.FilterBar=y7e;exports.FiltreEtiquette=$9e;exports.FlexRowContainer=Nme;exports.Grid=FS;exports.Header=Z2e;exports.HorizontalBarChart=Qfe;exports.IconText=QS;exports.ImageRenderer=uA;exports.IndicatorItemV2=Q7e;exports.InfoBanner=kve;exports.InputWrapper=CL;exports.LegendFilterProvider=U2e;exports.LegendFilterSwitcherButton=lL;exports.LinkRenderer=rA;exports.ListContentContainer=jme;exports.Logo=xL;exports.MetricsPanel=kA;exports.MobileMenuHeader=cxe;exports.MobileNavMenu=MA;exports.MobileTopBar=txe;exports.ModuleHeader=rme;exports.ModuleSideBar=sme;exports.ModuleSideBarV2=Rve;exports.MovementCard=X2e;exports.NavBar=ES;exports.NavBarV2=M8e;exports.NavItem=Fb;exports.NavItemV2=aC;exports.NavProvider=B2e;exports.NumberRenderer=lA;exports.PaginationBar=Tke;exports.PatientCard=FMe;exports.PatientDetailsPanel=Vxe;exports.PatientInfoCard=Txe;exports.PeriodSelect=O3e;exports.PopUp=Pve;exports.RadioInput=Rq;exports.RangeInput=Oq;exports.ScrollableHorizontale=e$;exports.SearchBar=fA;exports.Select=LA;exports.SelectFilter=b6e;exports.SelectInput=Yw;exports.SettingNavBar=Bve;exports.ShowDataProvider=W2e;exports.ShowDataSwitcherButton=hL;exports.SideComponent=W3e;exports.SimpleListBox=bme;exports.Slider=gxe;exports.StatusTile=ide;exports.SubHeaderContent=W8e;exports.SubHeaderNavItem=xA;exports.SubHeaderTitle=C8e;exports.SubNavBar=ude;exports.SummaryAvailable=A9e;exports.SummaryCard=yA;exports.Switcher=K1;exports.TableLayout=_A;exports.TableauDynamique=pA;exports.TableauDynamiqueSafePagination=Pke;exports.TableauxComponent=_A;exports.TextInput=Hq;exports.TextRenderer=cA;exports.TextareaInput=Dq;exports.ThemeProvider=R2e;exports.ThemeSwitcher=G8e;exports.ThemeSwitcherButton=Eb;exports.TimePicker=Ixe;exports.Title=X3e;exports.TranslationKey=dme;exports.TranslationKeyV2=Fve;exports.TrendItem=t$;exports.TrendList=rpe;exports.TrendListBox=Cme;exports.UnitGrid=ixe;exports.UserInfo=vA;exports.alertModels=B3e;exports.getA11yTooltip=Z;exports.getFormSchema=X4e;exports.hexToRgba=Tt;exports.registerRenderer=wke;exports.tableConfig=yw;exports.useAlerts=D3e;exports.useBodyScrollLock=G3e;exports.useConfirmationPopup=Eme;exports.useDraggableSwitcher=GS;exports.useFilters=nA;exports.useLegendFilterSwitcher=ZS;exports.useNavigation=yt;exports.useShowDataSwitcher=YS;exports.useTableData=oA;exports.useThemeContext=US;exports.useThemeSwitcher=ML;exports.validateField=vL;exports.validateForm=Tq;
|