@foodpilot/foods 2.5.4 → 2.5.6

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/main.js CHANGED
@@ -68468,25 +68468,26 @@ const DEe = (e) => {
68468
68468
  onAnimationEnd: () => S(!0),
68469
68469
  activeDot: !1,
68470
68470
  dot: (O) => {
68471
- const { cx: L, cy: k, payload: P, index: j } = O, R = typeof j == "number" ? j : typeof (P == null ? void 0 : P.index) == "number" ? P.index : 0;
68472
- typeof L == "number" && typeof k == "number" && (x.current[R] = { x: L, y: k });
68473
- const I = r === R, V = r === null || I ? n[R].color : wt(n[R].color).alpha(LTe).css();
68471
+ var F;
68472
+ const { cx: L, cy: k, payload: P, index: j } = O, R = typeof j == "number" ? j : typeof (P == null ? void 0 : P.index) == "number" ? P.index : 0, I = R >= 0 && R < n.length;
68473
+ typeof L == "number" && typeof k == "number" && I && (x.current[R] = { x: L, y: k });
68474
+ const V = I && r === R, _ = I ? (F = n[R]) == null ? void 0 : F.color : g, B = r === null || V ? _ : wt(_).alpha(LTe).css();
68474
68475
  return /* @__PURE__ */ p.jsx("g", { children: /* @__PURE__ */ p.jsx(
68475
68476
  "circle",
68476
68477
  {
68477
68478
  cx: L,
68478
68479
  cy: k,
68479
68480
  r: RTe,
68480
- fill: V,
68481
- stroke: V,
68481
+ fill: B,
68482
+ stroke: B,
68482
68483
  strokeWidth: 0,
68483
68484
  style: {
68484
68485
  cursor: "pointer",
68485
68486
  transition: `all ${PTe} ease-in-out`,
68486
68487
  pointerEvents: "auto",
68487
- filter: I ? `drop-shadow(0 0 ${ITe}px ${V})` : "none"
68488
+ filter: V ? `drop-shadow(0 0 ${ITe}px ${B})` : "none"
68488
68489
  },
68489
- onMouseEnter: () => d(R),
68490
+ onMouseEnter: () => d(I ? R : 0),
68490
68491
  onMouseLeave: () => f()
68491
68492
  }
68492
68493
  ) });
package/dist/main.umd.cjs CHANGED
@@ -454,7 +454,7 @@ Take a look at the reducer(s) handling this action type: ${g.type}.
454
454
  *
455
455
  * This source code is licensed under the MIT license found in the
456
456
  * LICENSE file in the root directory of this source tree.
457
- */var v_;function ibe(){return v_||(v_=1,process.env.NODE_ENV!=="production"&&(function(){function e(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=I,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,i=t.useEffect,s=t.useMemo,a=t.useDebugValue;gC.useSyncExternalStoreWithSelector=function(c,u,d,p,h){var g=o(null);if(g.current===null){var m={hasValue:!1,value:null};g.current=m}else m=g.current;g=s(function(){function C(S){if(!y){if(y=!0,x=S,S=p(S),h!==void 0&&m.hasValue){var E=m.value;if(h(E,S))return w=E}return w=S}if(E=w,n(x,S))return E;var T=p(S);return h!==void 0&&h(E,T)?(x=S,E):(x=S,w=T)}var y=!1,x,w,M=d===void 0?null:d;return[function(){return C(u())},M===null?void 0:function(){return C(M())}]},[u,d,p,h]);var v=r(c,g[0],g[1]);return i(function(){m.hasValue=!0,m.value=v},[v]),a(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),gC}var C_;function sbe(){return C_||(C_=1,process.env.NODE_ENV==="production"?Uf.exports=obe():Uf.exports=ibe()),Uf.exports}sbe();function abe(e){e()}function lbe(){let e=null,t=null;return{clear(){e=null,t=null},notify(){abe(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!r||e===null||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}var b_={notify(){},get:()=>[]};function cbe(e,t){let n,r=b_,o=0,i=!1;function s(v){d();const C=r.subscribe(v);let y=!1;return()=>{y||(y=!0,C(),p())}}function a(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function u(){return i}function d(){o++,n||(n=e.subscribe(c),r=lbe())}function p(){o--,n&&o===0&&(n(),n=void 0,r.clear(),r=b_)}function h(){i||(i=!0,d())}function g(){i&&(i=!1,p())}const m={addNestedSub:s,notifyNestedSubs:a,handleChangeWrapper:c,isSubscribed:u,trySubscribe:h,tryUnsubscribe:g,getListeners:()=>r};return m}var ube=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",dbe=ube(),fbe=()=>typeof navigator<"u"&&navigator.product==="ReactNative",pbe=fbe(),hbe=()=>dbe||pbe?b.useLayoutEffect:b.useEffect,gbe=hbe(),mC=Symbol.for("react-redux-context"),vC=typeof globalThis<"u"?globalThis:{};function mbe(){if(!b.createContext)return{};const e=vC[mC]??(vC[mC]=new Map);let t=e.get(b.createContext);return t||(t=b.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(b.createContext,t)),t}var vbe=mbe();function Cbe(e){const{children:t,context:n,serverState:r,store:o}=e,i=b.useMemo(()=>{const c=cbe(o),u={store:o,subscription:c,getServerState:r?()=>r:void 0};if(process.env.NODE_ENV==="production")return u;{const{identityFunctionCheck:d="once",stabilityCheck:p="once"}=e;return Object.assign(u,{stabilityCheck:p,identityFunctionCheck:d})}},[o,r]),s=b.useMemo(()=>o.getState(),[o]);gbe(()=>{const{subscription:c}=i;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),s!==o.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[i,s]);const a=n||vbe;return b.createElement(a.Provider,{value:i},t)}var bbe=Cbe,ybe=(e,t)=>t,CC=ge([ybe,Ht,Mu,nr,VR,oa,ype,er],Epe),bC=e=>{var t=e.currentTarget.getBoundingClientRect(),n=t.width/e.currentTarget.offsetWidth,r=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/n),chartY:Math.round((e.clientY-t.top)/r)}},y_=gi("mouseClick"),x_=Q1();x_.startListening({actionCreator:y_,effect:(e,t)=>{var n=e.payload,r=CC(t.getState(),bC(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(k4e({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var yC=gi("mouseMove"),w_=Q1();w_.startListening({actionCreator:yC,effect:(e,t)=>{var n=e.payload,r=t.getState(),o=rv(r,r.tooltip.settings.shared),i=CC(r,bC(n));o==="axis"&&((i==null?void 0:i.activeIndex)!=null?t.dispatch(TR({activeIndex:i.activeIndex,activeDataKey:void 0,activeCoordinate:i.activeCoordinate})):t.dispatch(ER()))}});var S_={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index"},M_=$o({name:"rootProps",initialState:S_,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:S_.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className}}}),xbe=M_.reducer,{updateOptions:wbe}=M_.actions,E_=$o({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:Sbe}=E_.actions,Mbe=E_.reducer,T_=gi("keyDown"),O_=gi("focus"),xC=Q1();xC.startListening({actionCreator:T_,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:o}=n.tooltip,i=e.payload;if(!(i!=="ArrowRight"&&i!=="ArrowLeft"&&i!=="Enter")){var s=Number(sv(o,G0(n))),a=oa(n);if(i==="Enter"){var c=xf(n,"axis","hover",String(o.index));t.dispatch(iv({active:!o.active,activeIndex:o.index,activeDataKey:o.dataKey,activeCoordinate:c}));return}var u=b4e(n),d=u==="left-to-right"?1:-1,p=i==="ArrowRight"?1:-1,h=s+p*d;if(!(a==null||h>=a.length||h<0)){var g=xf(n,"axis","hover",String(h));t.dispatch(iv({active:!0,activeIndex:h.toString(),activeDataKey:void 0,activeCoordinate:g}))}}}}}),xC.startListening({actionCreator:O_,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:o}=n.tooltip;if(!o.active&&o.index==null){var i="0",s=xf(n,"axis","hover",String(i));t.dispatch(iv({activeDataKey:void 0,active:!0,activeIndex:i,activeCoordinate:s}))}}}});var xi=gi("externalEvent"),k_=Q1();k_.startListening({actionCreator:xi,effect:(e,t)=>{if(e.payload.handler!=null){var n=t.getState(),r={activeCoordinate:upe(n),activeDataKey:$R(n),activeIndex:ia(n),activeLabel:HR(n),activeTooltipIndex:ia(n),isTooltipActive:dpe(n)};e.payload.handler(r,e.payload.reactEvent)}}});var Ebe=ge([q0],e=>e.tooltipItemPayloads),Tbe=ge([Ebe,Lu,(e,t,n)=>t,(e,t,n)=>n],(e,t,n,r)=>{var o=e.find(a=>a.settings.dataKey===r);if(o!=null){var{positions:i}=o;if(i!=null){var s=t(i,n);return s}}}),P_=gi("touchMove"),L_=Q1();L_.startListening({actionCreator:P_,effect:(e,t)=>{var n=e.payload,r=t.getState(),o=rv(r,r.tooltip.settings.shared);if(o==="axis"){var i=CC(r,bC({clientX:n.touches[0].clientX,clientY:n.touches[0].clientY,currentTarget:n.currentTarget}));(i==null?void 0:i.activeIndex)!=null&&t.dispatch(TR({activeIndex:i.activeIndex,activeDataKey:void 0,activeCoordinate:i.activeCoordinate}))}else if(o==="item"){var s,a=n.touches[0],c=document.elementFromPoint(a.clientX,a.clientY);if(!c||!c.getAttribute)return;var u=c.getAttribute(jg),d=(s=c.getAttribute(Ig))!==null&&s!==void 0?s:void 0,p=Tbe(t.getState(),u,d);t.dispatch(MR({activeDataKey:d,activeIndex:u,activeCoordinate:p}))}}});var Obe=vL({brush:xme,cartesianAxis:The,chartData:Fpe,errorBars:yge,graphicalItems:Z9e,layout:Aue,legend:w3e,options:Vpe,polarAxis:K8e,polarOptions:Mbe,referenceElements:Ime,rootProps:xbe,tooltip:P4e}),kbe=function(t){return oue({reducer:Obe,preloadedState:t,middleware:n=>n({serializableCheck:!1}).concat([x_.middleware,w_.middleware,xC.middleware,k_.middleware,L_.middleware]),devTools:vs.devToolsEnabled})};function j_(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,o=lr(),i=I.useRef(null);if(o)return n;i.current==null&&(i.current=kbe(t));var s=ig;return b.createElement(bbe,{context:s,store:i.current},n)}function I_(e){var{layout:t,width:n,height:r,margin:o}=e,i=kn(),s=lr();return I.useEffect(()=>{s||(i(Lue(t)),i(jue({width:n,height:r})),i(Pue(o)))},[i,s,t,n,r,o]),null}function A_(e){var t=kn();return I.useEffect(()=>{t(wbe(e))},[t,e]),null}var Pbe=["children"];function Lbe(e,t){if(e==null)return{};var n,r,o=jbe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function jbe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function qf(){return qf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qf.apply(null,arguments)}var Ibe={width:"100%",height:"100%"},Abe=I.forwardRef((e,t)=>{var n=gj(),r=mj(),o=Sj();if(!R0(n)||!R0(r))return null;var{children:i,otherAttributes:s,title:a,desc:c}=e,u,d;return typeof s.tabIndex=="number"?u=s.tabIndex:u=o?0:void 0,typeof s.role=="string"?d=s.role:d=o?"application":void 0,b.createElement($k,qf({},s,{title:a,desc:c,role:d,tabIndex:u,width:n,height:r,style:Ibe,ref:t}),i)}),Rbe=e=>{var{children:t}=e,n=Xe(I5);if(!n)return null;var{width:r,height:o,y:i,x:s}=n;return b.createElement($k,{width:r,height:o,x:s,y:i},t)},R_=I.forwardRef((e,t)=>{var{children:n}=e,r=Lbe(e,Pbe),o=lr();return o?b.createElement(Rbe,null,n):b.createElement(Abe,qf({ref:t},r),n)});function Dbe(){var e=kn(),[t,n]=I.useState(null),r=Xe(c3e);return I.useEffect(()=>{if(t!=null){var o=t.getBoundingClientRect(),i=o.width/t.offsetWidth;Fo(i)&&i!==r&&e(Iue(i))}},[t,e,r]),n}function D_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Vbe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?D_(Object(n),!0).forEach(function(r){_be(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _be(e,t,n){return(t=Nbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nbe(e){var t=Hbe(e,"string");return typeof t=="symbol"?t:t+""}function Hbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $be=I.forwardRef((e,t)=>{var{children:n,className:r,height:o,onClick:i,onContextMenu:s,onDoubleClick:a,onMouseDown:c,onMouseEnter:u,onMouseLeave:d,onMouseMove:p,onMouseUp:h,onTouchEnd:g,onTouchMove:m,onTouchStart:v,style:C,width:y}=e,x=kn(),[w,M]=I.useState(null),[S,E]=I.useState(null);Ype();var T=Dbe(),O=I.useCallback(X=>{T(X),typeof t=="function"&&t(X),M(X),E(X)},[T,t,M,E]),P=I.useCallback(X=>{x(y_(X)),x(xi({handler:i,reactEvent:X}))},[x,i]),k=I.useCallback(X=>{x(yC(X)),x(xi({handler:u,reactEvent:X}))},[x,u]),L=I.useCallback(X=>{x(ER()),x(xi({handler:d,reactEvent:X}))},[x,d]),j=I.useCallback(X=>{x(yC(X)),x(xi({handler:p,reactEvent:X}))},[x,p]),A=I.useCallback(()=>{x(O_())},[x]),R=I.useCallback(X=>{x(T_(X.key))},[x]),_=I.useCallback(X=>{x(xi({handler:s,reactEvent:X}))},[x,s]),N=I.useCallback(X=>{x(xi({handler:a,reactEvent:X}))},[x,a]),z=I.useCallback(X=>{x(xi({handler:c,reactEvent:X}))},[x,c]),B=I.useCallback(X=>{x(xi({handler:h,reactEvent:X}))},[x,h]),$=I.useCallback(X=>{x(xi({handler:v,reactEvent:X}))},[x,v]),V=I.useCallback(X=>{x(P_(X)),x(xi({handler:m,reactEvent:X}))},[x,m]),H=I.useCallback(X=>{x(xi({handler:g,reactEvent:X}))},[x,g]);return b.createElement(KR.Provider,{value:w},b.createElement(_0e.Provider,{value:S},b.createElement("div",{className:ae("recharts-wrapper",r),style:Vbe({position:"relative",cursor:"default",width:y,height:o},C),onClick:P,onContextMenu:_,onDoubleClick:N,onFocus:A,onKeyDown:R,onMouseDown:z,onMouseEnter:k,onMouseLeave:L,onMouseMove:j,onMouseUp:B,onTouchEnd:H,onTouchMove:V,onTouchStart:$,ref:O},n)))}),Fbe=["children","className","width","height","style","compact","title","desc"];function Bbe(e,t){if(e==null)return{};var n,r,o=zbe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function zbe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var V_=I.forwardRef((e,t)=>{var{children:n,className:r,width:o,height:i,style:s,compact:a,title:c,desc:u}=e,d=Bbe(e,Fbe),p=ar(d);return a?b.createElement(R_,{otherAttributes:p,title:c,desc:u},n):b.createElement($be,{className:r,style:s,width:o,height:i,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},b.createElement(R_,{otherAttributes:p,title:c,desc:u,ref:t},b.createElement(Ame,null,n)))}),Zbe=["width","height"];function wC(){return wC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wC.apply(null,arguments)}function Wbe(e,t){if(e==null)return{};var n,r,o=Ube(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Ube(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var qbe={top:5,right:5,bottom:5,left:5},Gbe={accessibilityLayer:!0,layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:qbe,reverseStackOrder:!1,syncMethod:"index"},Gf=I.forwardRef(function(t,n){var r,o=Un(t.categoricalChartProps,Gbe),{width:i,height:s}=o,a=Wbe(o,Zbe);if(!R0(i)||!R0(s))return null;var{chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:d,tooltipPayloadSearcher:p,categoricalChartProps:h}=t,g={chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:d,tooltipPayloadSearcher:p,eventEmitter:void 0};return b.createElement(j_,{preloadedState:{options:g},reduxStoreName:(r=h.id)!==null&&r!==void 0?r:c},b.createElement(ZV,{chartData:h.data}),b.createElement(I_,{width:i,height:s,layout:o.layout,margin:o.margin}),b.createElement(A_,{accessibilityLayer:o.accessibilityLayer,barCategoryGap:o.barCategoryGap,maxBarSize:o.maxBarSize,stackOffset:o.stackOffset,barGap:o.barGap,barSize:o.barSize,syncId:o.syncId,syncMethod:o.syncMethod,className:o.className}),b.createElement(V_,wC({},a,{width:i,height:s,ref:n})))}),Kbe=["axis"],SC=I.forwardRef((e,t)=>b.createElement(Gf,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Kbe,tooltipPayloadSearcher:K0,categoricalChartProps:e,ref:t})),Ybe=["axis","item"],Kf=I.forwardRef((e,t)=>b.createElement(Gf,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Ybe,tooltipPayloadSearcher:K0,categoricalChartProps:e,ref:t}));function Xbe(e){var t=kn();return I.useEffect(()=>{t(Sbe(e))},[t,e]),null}var Jbe=["width","height","layout"];function MC(){return MC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},MC.apply(null,arguments)}function Qbe(e,t){if(e==null)return{};var n,r,o=eye(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function eye(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var tye={top:5,right:5,bottom:5,left:5},nye={accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:tye,reverseStackOrder:!1,syncMethod:"index",layout:"radial"},__=I.forwardRef(function(t,n){var r,o=Un(t.categoricalChartProps,nye),{width:i,height:s,layout:a}=o,c=Qbe(o,Jbe);if(!R0(i)||!R0(s))return null;var{chartName:u,defaultTooltipEventType:d,validateTooltipEventTypes:p,tooltipPayloadSearcher:h}=t,g={chartName:u,defaultTooltipEventType:d,validateTooltipEventTypes:p,tooltipPayloadSearcher:h,eventEmitter:void 0};return b.createElement(j_,{preloadedState:{options:g},reduxStoreName:(r=o.id)!==null&&r!==void 0?r:u},b.createElement(ZV,{chartData:o.data}),b.createElement(I_,{width:i,height:s,layout:a,margin:o.margin}),b.createElement(A_,{accessibilityLayer:o.accessibilityLayer,barCategoryGap:o.barCategoryGap,maxBarSize:o.maxBarSize,stackOffset:o.stackOffset,barGap:o.barGap,barSize:o.barSize,syncId:o.syncId,syncMethod:o.syncMethod,className:o.className}),b.createElement(Xbe,{cx:o.cx,cy:o.cy,startAngle:o.startAngle,endAngle:o.endAngle,innerRadius:o.innerRadius,outerRadius:o.outerRadius}),b.createElement(V_,MC({width:i,height:s},c,{ref:n})))}),rye=["item"],oye={layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},Yf=I.forwardRef((e,t)=>{var n=Un(e,oye);return b.createElement(__,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:rye,tooltipPayloadSearcher:K0,categoricalChartProps:n,ref:t})}),iye=["axis"],sye={layout:"centric",startAngle:90,endAngle:-270,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},EC=I.forwardRef((e,t)=>{var n=Un(e,sye);return b.createElement(__,{chartName:"RadarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:iye,tooltipPayloadSearcher:K0,categoricalChartProps:n,ref:t})}),aye=["item"],lye=I.forwardRef((e,t)=>b.createElement(Gf,{chartName:"ScatterChart",defaultTooltipEventType:"item",validateTooltipEventTypes:aye,tooltipPayloadSearcher:K0,categoricalChartProps:e,ref:t})),cye=["axis"],TC=I.forwardRef((e,t)=>b.createElement(Gf,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:cye,tooltipPayloadSearcher:K0,categoricalChartProps:e,ref:t}));const Gu=e=>{const{coordinate:t,customY:n,placement:r="top",offset:o={x:0,y:0}}=e,i=n??t.y,s=t.x;let a,c,u;switch(r){case"top":c=s+o.x,u=i+o.y,a="translate(-50%, -100%)";break;case"bottom":c=s+o.x,u=i+o.y,a="translate(-50%, 0%)";break;case"left":c=s+o.x,u=i+o.y,a="translate(-100%, -50%)";break;case"right":c=s+o.x,u=i+o.y,a="translate(0%, -50%)";break;default:c=s+o.x,u=i+o.y,a="translate(-50%, -100%)"}return{position:"absolute",left:c,top:u,transform:a,zIndex:1e3,pointerEvents:"none"}},Ku=()=>({pointerEvents:"none","& *":{pointerEvents:"none"}}),N_=e=>{const{active:t,payload:n,formatter:r,unit:o,coordinate:i,icons:s}=e,a=ce();if(!t||!n||!n.length||!i)return null;const c=n[0],u=r?r(c.value):a.numbers.valueFormatterFn(c.value),d=m=>{if(m===void 0)return"top";const v=(m%360+360)%360;return v>=315||v<45?"right":v>=45&&v<135?"top":v>=135&&v<225?"left":"bottom"},p=f.jsxs(le,{direction:"column",alignItems:"flex-start",justifyContent:"center",spacing:a.spacing(1),children:[f.jsxs(le,{direction:"row",alignItems:"center",spacing:a.spacing(1),children:[s&&c.payload&&c.payload.index!==void 0&&s[c.payload.index]?f.jsx(K,{minWidth:"24px",width:"24px",height:"24px",sx:{background:c.payload.color||"#ccc",padding:"4px",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"3px"},children:s[c.payload.index]}):f.jsx(K,{sx:{width:"12px",height:"12px",borderRadius:"3px",backgroundColor:c.payload.color}}),f.jsx(ie,{variant:"h6",children:c.name})]}),f.jsxs(le,{direction:"row",alignItems:"flex-end",spacing:.5,children:[f.jsx(ie,{variant:"number-inter",sx:{p:0,m:0,lineHeight:a.spacing(4)},children:u}),f.jsx(ie,{variant:"small-bold",color:a.custom.grey[1400],children:o})]})]}),h=d(i.angle),g=Gu({coordinate:{x:i.x,y:i.y},placement:h});return c.name&&f.jsx(K,{sx:g,children:f.jsx(di,{width:"max-content",title:p,placement:h,arrow:!0,open:!0,sx:Ku(),children:f.jsx("div",{style:{width:1,height:1,visibility:"hidden",pointerEvents:"none"}})})})},uye=300,OC="78%",kC="100%",PC="50%",LC="50%",dye=300,fye=0,pye=.4,hye=2,gye="0.2s",mye=1,vye=2,jC=e=>{var M,S,E;const t=ce(),{data:n,HoveredChartElementIndex:r,spacing:o=vye,borderWidth:i,borderColor:s,showTooltip:a,tooltipPos:c,valuesFormatterFn:u=T=>t.numbers.valueFormatterFn(T,0),language:d,valuesUnit:p,icons:h,isLoading:g,height:m,onMouseEnter:v,onMouseLeave:C,onLegendAction:y}=e,x=typeof m=="number"?m:uye,w=n.length===0||n.every(T=>T.value===0);if(g){const T=t.palette.action.hover;return f.jsx(K,{position:"relative",width:"100%",height:x,sx:{"@keyframes pulse":{"0%":{opacity:.2},"50%":{opacity:1},"100%":{opacity:.2}}},children:f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsx(Yf,{children:f.jsx(l2,{data:[{name:"loading",value:1}],cx:PC,cy:LC,innerRadius:OC,outerRadius:kC,dataKey:"value",isAnimationActive:!1,stroke:"none",style:{pointerEvents:"none"},children:f.jsx(yo,{fill:T,style:{animation:"pulse 1.5s ease-in-out infinite"}})})})})})}return f.jsxs(K,{position:"relative",width:"100%",height:x,children:[f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(Yf,{children:[f.jsx(l2,{data:n,cx:PC,cy:LC,innerRadius:OC,outerRadius:kC,paddingAngle:o,minAngle:.5,dataKey:"value",isAnimationActive:!0,animationDuration:dye,animationBegin:fye,onMouseEnter:v,onMouseLeave:C,onClick:(T,O)=>{y&&y(O)},stroke:"none",style:{outline:"none"},children:n.map((T,O)=>{const P=r===O,k=r===null||P?T.color:bt(T.color).alpha(pye).css();return f.jsx(yo,{fill:k,strokeWidth:i,stroke:s,style:{filter:P?`drop-shadow(0 0 ${hye}px ${T.color})`:"none",cursor:"pointer",transition:`all ${gye} ease-in-out`},className:P?"cell-hovered":"cell-idle"},`cell-${O}`)})}),w&&f.jsx(l2,{data:[{name:"empty",value:mye}],cx:PC,cy:LC,isAnimationActive:!1,innerRadius:OC,outerRadius:kC,stroke:"none",dataKey:"value",fill:t.palette.action.hover||"rgba(0, 0, 0, 0)"})]})}),a&&f.jsx(N_,{active:r!==null,payload:r!==null?[{name:((M=n[r])==null?void 0:M.name)??"",value:((S=n[r])==null?void 0:S.value)??0,color:((E=n[r])==null?void 0:E.color)??"",payload:n[r]||{}}]:[],formatter:u,language:d,unit:p,coordinate:c,icons:h})]})},Cye=2,bye=0,yye=2,xye="900px",wye=100,Sye=700,Mye="28px auto",Eye=6,H_="0.2s",Yu=1,$_=100,Tye=e=>{const t=ce(),{values:n,labels:r,colors:o,legend:i,children:s,valuesUnit:a,className:c,valuesFormatterFn:u=t.numbers.valueFormatterFn,createPalette:d=!0,isLoading:p=!1,displayTotal:h=!0,fullWidthLegend:g=!1,displayTotalVariant:m="number-big",spacing:v=Cye,borderWidth:C=bye,borderColor:y,hoverOffset:x=yye,icons:w,showTooltip:M=!0,width:S=xye}=e,E=I.useRef(null),T=I.useRef(null),O=vn.language,P=fo(t.breakpoints.down("md")),k=pk(t,wye,Sye),L=(i==null?void 0:i.position)??"bottom",j=d?hk(o&&o.length?o:k,n??[]):o??k,A=Ck(n,r,j),R=xk(n,h),_=yk(s,h,R,u),{HoveredChartElementIndex:N,tooltipPos:z,handleLegendHover:B,handleMouseEnter:$,handleMouseOut:V}=wk(A,E);return f.jsxs(le,{direction:L==="bottom"||P?"column":"row",gap:t.spacing(Eye),className:`doughnut-chart ${c}`,ref:T,sx:{maxWidth:S,width:"100%"},children:[f.jsx(le,{sx:{flex:1},children:f.jsxs(K,{position:"relative",margin:Mye,sx:{"& *":{outline:"none"},".cell-hovered":{animation:`cell-hovered ${H_} ease-in-out forwards`,transformOrigin:"center"},".cell-idle":{transform:`scale(${Yu})`,transformOrigin:"center",animation:`cell-idle ${H_} ease-in-out forwards`},"@keyframes cell-hovered":{"0%":{transform:`scale(${Yu})`},"100%":{transform:`scale(${Yu+x/$_})`},"@keyframes cell-idle":{"0%":{transform:`scale(${Yu+x/$_})`},"100%":{transform:`scale(${Yu})`}}},width:"100%"},className:"doughnut-chart-wrapper",id:"doughnut-chart-wrapper",ref:E,children:[f.jsx(jC,{data:A,HoveredChartElementIndex:N,spacing:v,borderWidth:C,borderColor:y,showTooltip:M,tooltipPos:z,isLoading:p,valuesFormatterFn:u,language:O,valuesUnit:a,icons:w,onMouseEnter:$,onMouseLeave:V,onLegendAction:H=>{var X,Q,ne;(X=i==null?void 0:i.actions)!=null&&X[H]&&((ne=(Q=i.actions)[H])==null||ne.call(Q))}}),f.jsx(Sk,{isLoading:p,displayValue:_,displayTotalVariant:m,valuesUnit:a,displayTotal:h,isEmpty:A.length===0})]})}),f.jsx(K,{display:"flex",width:g?"100%":"inherit",sx:{width:g?"100%":"inherit",flex:1},children:i&&f.jsx(J9,{labels:r,hoveredDatasetIndex:N,onLegendHover:B,values:n,colors:j,legend:i,icons:w,chartRef:E})})]})},Oye=()=>{const[e,t]=I.useState(null),[n,r]=I.useState(null),[o,i]=I.useState(null),[s,a]=I.useState(null),[c,u]=I.useState(!1),d=I.useRef(null),p=I.useRef(!1);I.useEffect(()=>{p.current=c},[c]);const h=I.useCallback(()=>{d.current&&(clearTimeout(d.current),d.current=null)},[]),g=I.useCallback((M,S,E)=>{h(),u(!1),t(S),r({xValue:(E==null?void 0:E.x)??M.x,yValue:(E==null?void 0:E.y)??M.y,dataX:M.x,dataY:M.y,pixelX:(E==null?void 0:E.x)??M.x,pixelY:(E==null?void 0:E.y)??M.y})},[h]),m=I.useCallback((M,S,E)=>{h(),i(S),a({xValue:(E==null?void 0:E.x)??M.x,yValue:(E==null?void 0:E.y)??M.y,dataX:M.x,dataY:M.y,pixelX:(E==null?void 0:E.x)??M.x,pixelY:(E==null?void 0:E.y)??M.y}),u(!0)},[h]),v=I.useCallback(()=>{h(),p.current||(t(null),r(null))},[h]),C=I.useCallback(()=>{h()},[h]),y=I.useCallback(()=>{h(),p.current||(d.current=setTimeout(()=>{t(null),r(null)},1e3))},[h]),x=I.useCallback(()=>{p.current||(h(),t(null),r(null))},[h]),w=I.useCallback(()=>{h(),i(null),a(null),r(null),u(!1)},[h]);return{hoveredIndex:e,hover:n,pinnedIndex:o,pinnedHover:s,isPinned:c,handlePointEnter:g,handlePointClick:m,handlePointLeave:v,handleTooltipEnter:C,handleTooltipLeave:y,handleChartMouseLeave:x,handleDismissTooltip:w}},kye=20,F_=15,Pye=e=>{const t=ce(),{hover:n,valueFormatterFn:r=t.numbers.valueFormatterFn,precision:o,xDomain:i,yDomain:s}=e;if(!n)return null;const a=w=>parseFloat(t.spacing(w)),c=12,u=.6,d=a(1),p=a(2.5),h=a(3.75),g=a(0),m=t.shape.borderRadius??4,v=t.custom.grey[2800],C=t.palette.common.white,y=w=>r(w,o),x=w=>Math.max(h,Math.round(w.length*c*u)+2*d);return f.jsxs(f.Fragment,{children:[f.jsx(Wu,{segment:[{x:i[0],y:n.dataY},{x:n.dataX,y:n.dataY}],stroke:t.palette.text.primary,label:w=>{const{viewBox:M}=w;if(!M||!n)return f.jsx("g",{});const S=y(n.dataY),E=x(S),T=M.x-g-E-F_,O=M.y-p/2,P=T+E/2,k=O+p/2+1;return f.jsxs("g",{style:{pointerEvents:"none"},children:[f.jsx("line",{x1:M.x,y1:M.y,x2:M.x-F_,y2:M.y,stroke:t.palette.text.primary,strokeWidth:1}),f.jsx("rect",{x:T,y:O,width:E,height:p,fill:v,rx:m}),f.jsx("text",{x:P,y:k,fill:C,fontSize:c,fontWeight:600,textAnchor:"middle",dominantBaseline:"middle",children:S})]})}}),f.jsx(Wu,{segment:[{x:n.dataX,y:s[0]},{x:n.dataX,y:n.dataY}],stroke:t.palette.text.primary,label:w=>{const{viewBox:M}=w;if(!M||!n)return f.jsx("g",{});const S=y(n.dataX),E=x(S),T=M.x-E/2,O=M.y+M.height+kye,P=T+E/2,k=O+p/2+1;return f.jsxs("g",{style:{pointerEvents:"none"},children:[f.jsx("line",{x1:T+E/2,y1:O+p,x2:T+E/2,y2:O-p,stroke:t.palette.text.primary,strokeWidth:1}),f.jsx("rect",{x:T,y:O,width:E,height:p,fill:v,rx:m}),f.jsx("text",{x:P,y:k,fill:C,fontSize:c,fontWeight:600,textAnchor:"middle",dominantBaseline:"middle",children:S})]})}})]})},Lye={x:0,y:-5},jye=I.forwardRef((e,t)=>{var T,O,P,k,L,j,A;const n=ce(),{point:r,coordinate:o,valueFormatterFn:i=n.numbers.valueFormatterFn,precision:s,unit:a,xUnit:c,yUnit:u,textOptions:d,showSeriesInTooltip:p=!0,tooltipOptions:h,onTooltipEnter:g,onTooltipLeave:m,handleDismissTooltip:v}=e,C=r.seriesName,y=u??a,x=c??a,w=(d==null?void 0:d.for)??"for",M=()=>f.jsx(K,{role:"button",onClick:()=>v==null?void 0:v(),sx:{cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:n.spacing(.25),height:n.spacing(2.75),width:n.spacing(2.75),transform:`translate(${n.spacing(1.25)}, -${n.spacing(1.25)}) rotate(45deg)`,borderRadius:"50%","&:hover":{color:n.palette.common.white,backgroundColor:"text.secondary",boxShadow:"0px 0px 4px rgba(0, 0, 0, 0.1)"}},children:f.jsx(Ct,{icon:"plus",size:2})}),S=f.jsxs(le,{direction:"column",spacing:n.spacing(.5),pb:n.spacing(.25),onClick:R=>R.stopPropagation(),onMouseLeave:()=>m==null?void 0:m(),sx:{pointerEvents:"auto"},children:[f.jsxs(le,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:n.spacing(1),children:[f.jsx(ie,{variant:"h4",lineHeight:n.spacing(2),children:r.label}),f.jsx(M,{})]}),f.jsxs(le,{pt:n.spacing(1),direction:"row",spacing:n.spacing(.5),alignItems:"center",flexWrap:"wrap",children:[f.jsx(ie,{variant:"number-small",lineHeight:n.spacing(2),color:"text.primary",children:i(r.y,s)}),f.jsx(ie,{variant:"body2",lineHeight:n.spacing(2),color:"text.secondary",children:y?` ${y}`:""}),f.jsx(ie,{variant:"body2",lineHeight:n.spacing(2),color:"text.primary",children:w}),f.jsx(ie,{variant:"number-small",lineHeight:n.spacing(2),color:"text.primary",children:i(r.x,s)}),f.jsx(ie,{variant:"body2",lineHeight:n.spacing(2),color:"text.secondary",children:x?` ${x}`:""})]}),r.additionalContent&&f.jsx(K,{sx:{pt:n.spacing(2)},children:r.additionalContent}),C&&p&&f.jsx(le,{direction:"row",alignItems:"flex-end",justifyContent:"flex-end",spacing:n.spacing(1),pt:n.spacing(2),children:f.jsxs(le,{direction:"row",alignItems:"center",spacing:n.spacing(1),children:[f.jsx(K,{sx:{width:n.spacing(1.5),height:n.spacing(1.5),borderRadius:"50%",backgroundColor:r.seriesColor}}),f.jsx(ie,{variant:"body2",lineHeight:n.spacing(2),color:"text.secondary",fontWeight:500,children:C})]})}),h!=null&&h.button?h.button.href?f.jsx(d6,{href:h.button.href,target:"_blank",rel:"noopener noreferrer",children:f.jsx(it,{sx:{color:n.palette.text.primary,mt:n.spacing(2)},variant:(T=h==null?void 0:h.button)==null?void 0:T.variant,size:(O=h==null?void 0:h.button)==null?void 0:O.size,startIcon:(P=h==null?void 0:h.button)==null?void 0:P.startIcon,onClick:R=>{var _,N;R.stopPropagation(),(N=(_=h==null?void 0:h.button)==null?void 0:_.onClick)==null||N.call(_)},children:h.button.text})}):f.jsx(it,{sx:{mt:n.spacing(2)},variant:(k=h==null?void 0:h.button)==null?void 0:k.variant,size:(L=h==null?void 0:h.button)==null?void 0:L.size,startIcon:(j=h==null?void 0:h.button)==null?void 0:j.startIcon,onClick:R=>{var _,N;R.stopPropagation(),(N=(_=h==null?void 0:h.button)==null?void 0:_.onClick)==null||N.call(_)},children:(A=h==null?void 0:h.button)==null?void 0:A.text}):null]}),E=Gu({coordinate:{x:o.xValue,y:o.yValue},placement:"top",offset:Lye});return f.jsx(K,{ref:t,style:{position:"absolute",...E,zIndex:n.zIndex.tooltip,pointerEvents:"auto"},onMouseEnter:g,onMouseLeave:m,children:f.jsx(di,{width:"inherit",title:S,placement:"top",arrow:!0,open:!0,sx:{...Ku()},children:f.jsx("div",{style:{width:1,height:1,visibility:"hidden",pointerEvents:"none"}})})})}),IC=8,B_=12,z_=8,Iye=.6,Aye=45,Z_=40,Rye=30,Dye=15,W_=200,Vye=10,_ye=250,Nye=(e,t)=>{const n=[],r=Object.keys(t);e.forEach((i,s)=>{const c=(s+1)%r.length+1,u=t[c].main,d=i.color||u;i.data.forEach(p=>{n.push({...p,pointIndex:n.length,seriesIndex:s,seriesName:i.name,seriesColor:d})})});const o=n.length<=Vye;return{allPoints:n,shouldShowLabels:o}},Hye=(e,t,n)=>{const r=Object.keys(t);return e.map((o,i)=>{const a=(i+1)%r.length+1,c=t[a].main;return{seriesId:i,name:o.name,color:o.color||c,points:o.data.map(u=>({...u,pointIndex:n.findIndex(d=>d.seriesIndex===i&&d.x===u.x&&d.y===u.y&&d.label===u.label)}))}})},$ye=e=>Math.round(e.length*B_*Iye),Fye=(e,t,n,r)=>{const o=r>0?r-Z_:Number.POSITIVE_INFINITY,i=e+IC+z_,s=e-IC-z_,a=$ye(n),u=i+a>o;return{x:u?s:i,y:t,anchor:u?"end":"start"}},Bye=e=>{const{groupedData:t,allPoints:n,hoveredIndex:r,pinnedIndex:o,isTooltipActive:i,isAnimationActive:s,shouldShowLabels:a,containerWidth:c,onPointEnter:u,onPointLeave:d,onPointClick:p}=e,h=ce(),g=m=>{const{x:v,y:C,cx:y,cy:x,value:w,payload:M}=m,E=(M==null?void 0:M.label)||(typeof w=="number"?String(w):(w??"").toString());if(!E)return null;const T=typeof y=="number"?y:typeof v=="number"?v:void 0,O=typeof x=="number"?x:typeof C=="number"?C:void 0;if(T===void 0||O===void 0)return null;const{x:P,y:k,anchor:L}=Fye(T,O,E,c);return f.jsx("g",{style:{pointerEvents:"none"},children:f.jsx("text",{x:P,y:k+1,fill:h.palette.text.primary,fontSize:B_,fontWeight:600,textAnchor:L,dominantBaseline:"middle",children:E})})};return f.jsx(f.Fragment,{children:t.map(m=>f.jsx(g_,{isAnimationActive:!1,fill:m.color,data:m.points.map(v=>{const C=r!==null&&v.pointIndex!==r;return{...v,label:v.label,fill:m.color,opacity:C?.4:1,r:IC}}),shape:v=>{const{cx:C,cy:y,r:x,fill:w}=v,M=v.pointIndex,S=r!==null&&M!==r,T={cursor:"pointer",...M!==void 0&&M===o&&i?{filter:"drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5))",stroke:"#fff",strokeWidth:2}:{filter:"none"}};return f.jsx(Ef,{cx:C,cy:y,r:x,fill:w,"data-scatter-point":"true",style:_ye<=n.length?T:{...T,transform:`scale(${s?0:1})`,transformOrigin:"50% 50%",opacity:S?.4:1,transition:`all ${W_}ms cubic-bezier(0.86, 0, 0.07, 1)`},onMouseEnter:()=>{if(typeof M=="number"){const O=n[M];O&&u(O,M,{x:C,y})}},onMouseLeave:()=>{d()},onClick:()=>{if(typeof M=="number"){const O=n[M];if(O){const P={stopPropagation:()=>{}};p==null||p(O,M,{x:C,y},P)}}}})},children:a&&f.jsx(Ga,{dataKey:"label",content:g})},m.seriesId))})},zye=e=>{const t=ce(),{values:n,valueFormatterFn:r=t.numbers.valueFormatterFn,precision:o,language:i,unit:s,xUnit:a,yUnit:c,textOptions:u,showSeriesInTooltip:d=!0,tooltipOptions:p}=e,{hoveredIndex:h,hover:g,pinnedIndex:m,pinnedHover:v,isPinned:C,handlePointEnter:y,handlePointClick:x,handlePointLeave:w,handleTooltipEnter:M,handleTooltipLeave:S,handleDismissTooltip:E}=Oye(),{allPoints:T,shouldShowLabels:O}=I.useMemo(()=>Nye(n,t.custom.dataviz.colorsWithExtra),[n,t.custom.dataviz.colorsWithExtra]),P=I.useMemo(()=>Hye(n,t.custom.dataviz.colorsWithExtra,T),[n,t.custom.dataviz.colorsWithExtra,T]),{xDomain:k,yDomain:L}=I.useMemo(()=>{const H=n.flatMap(Y=>Y.data);if(H.length===0)return{xDomain:[0,100],yDomain:[0,100]};const X=H.map(Y=>Y.x),Q=H.map(Y=>Y.y),ne=Math.min(...X),q=Math.max(...X),J=Math.min(...Q),te=Math.max(...Q);return{xDomain:[Math.max(0,ne),q],yDomain:[Math.max(0,J),te]}},[n]),[j,A]=I.useState(!0),R=I.useRef(null),_=I.useRef(null),[N,z]=I.useState(0),B=i??vn.language,$=typeof o=="number"?Math.min(100,Math.max(0,o)):void 0,V=I.useCallback(H=>r(H,$),[r,$]);return I.useEffect(()=>{const H=setTimeout(()=>{A(!1)},W_);return()=>clearTimeout(H)},[]),I.useEffect(()=>{const H=R.current;if(!H)return;const X=()=>z(H.clientWidth);X();const Q=new ResizeObserver(X);return Q.observe(H),()=>Q.disconnect()},[]),f.jsxs(K,{onClick:H=>{const X=H.target;if(X.classList.contains("recharts-dot"))return;const Q=_.current;Q&&Q.contains(X)||E()},onMouseLeave:()=>E(),ref:R,sx:{position:"relative",width:"100%",height:"100%"},children:[f.jsx(fr,{width:"100%",height:"100%",children:f.jsxs(lye,{margin:{top:Aye,right:Z_,left:Rye,bottom:Dye},children:[f.jsx(Zi,{strokeDasharray:"4 4",stroke:t.palette.divider}),f.jsx(yi,{type:"number",dataKey:"x",domain:k,tickLine:!1,axisLine:{stroke:t.palette.divider},tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateY(${t.spacing(2)})`}},tickFormatter:V,allowDecimals:!0}),f.jsx(qo,{type:"number",dataKey:"y",domain:L,tickLine:!1,axisLine:{stroke:t.palette.divider},tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateX(-${t.spacing(2)})`,pointerEvents:"none"}},tickFormatter:V,allowDecimals:!0,style:{pointerEvents:"none"}}),f.jsx(Pye,{hover:g,valueFormatterFn:r,precision:$,language:B,xDomain:k,yDomain:L}),f.jsx(Bye,{groupedData:P,allPoints:T,hoveredIndex:h,pinnedIndex:m,isTooltipActive:!!(C&&m!==null&&v&&T[m]),isAnimationActive:j,shouldShowLabels:O,containerWidth:N,onPointEnter:y,onPointLeave:w,onPointClick:(H,X,Q,ne)=>{ne.stopPropagation(),x(H,X,Q)}})]})}),!!(C&&m!==null&&v&&T[m])&&f.jsx(jye,{ref:_,point:T[m],coordinate:v,series:n,valueFormatterFn:r,precision:o,unit:s,xUnit:a,yUnit:c,textOptions:u,showSeriesInTooltip:d,handleDismissTooltip:E,tooltipOptions:p,onTooltipEnter:M,onTooltipLeave:S})]})},Zye=e=>{const{values:t,xLabel:n,yLabel:r,width:o="100%",height:i="800px",valueFormatterFn:s,precision:a,language:c,unit:u,xUnit:d,yUnit:p,textOptions:h,onLegendHover:g,tooltipOptions:m}=e,v=ce(),[C,y]=I.useState(new Set),x=I.useMemo(()=>t.length<=1?t:t.map((M,S)=>({...M,data:C.has(S)?[]:M.data})).filter(M=>M.data.length>0),[t,C]),w=M=>{t.length<=1||y(S=>{const E=new Set(S);return E.has(M)?E.delete(M):E.size<t.length-1&&E.add(M),E})};return f.jsxs(f.Fragment,{children:[f.jsx(le,{direction:"column",position:"relative",width:o,minHeight:v.spacing(50),height:i,justifyContent:"stretch",sx:{"& *":{outline:"none"}},children:f.jsxs(K,{sx:{border:`1px solid ${v.palette.divider}`,backgroundColor:v.palette.background.paper,borderRadius:v.spacing(1),width:"100%",height:i,padding:v.spacing(3),display:"flex",flexDirection:"column"},children:[f.jsx(K,{sx:{mb:v.spacing(2),pointerEvents:"none"},children:f.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx(ie,{variant:"h4",children:r}),f.jsx(ie,{variant:"body",children:"-"}),f.jsx(ie,{variant:"body",children:p})]})}),f.jsx(K,{sx:{position:"relative",width:"100%",flex:1},children:f.jsx(zye,{values:x,valueFormatterFn:s,precision:a,language:c,unit:u,xUnit:d,yUnit:p,textOptions:h,onLegendHover:g,tooltipOptions:m,showSeriesInTooltip:t.length>1})}),f.jsx(K,{sx:{mt:v.spacing(2),display:"flex",justifyContent:"flex-end",pointerEvents:"none"},children:f.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx(ie,{variant:"h4",children:n}),f.jsx(ie,{variant:"body",children:"-"}),f.jsx(ie,{variant:"body",children:d})]})})]})}),t&&t.length>0&&f.jsx(K,{sx:{mt:v.spacing(4),pb:v.spacing(4)},children:f.jsx(K,{sx:{display:"flex",justifyContent:"flex-start",flexWrap:"wrap",gap:`${v.spacing(2)} ${v.spacing(6)}`},children:t.map((M,S)=>{const T=(S+1)%Object.keys(v.custom.dataviz.colorsWithExtra).length+1,O=M.color||v.custom.dataviz.colorsWithExtra[T].main;return f.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:v.spacing(1),cursor:t.length>1?"pointer":"default",opacity:C.has(S)?.4:1},onClick:()=>{t.length>1&&w(S),g==null||g(S)},children:[f.jsx(K,{sx:{width:v.spacing(1.5),height:v.spacing(1.5),borderRadius:"50%",backgroundColor:O,flexShrink:0}}),f.jsx(ie,{variant:"body2",fontWeight:500,sx:{fontSize:"14px",color:v.palette.text.primary},children:M.name})]},M.name)})})})]})},Wye={x:0,y:-5},AC=e=>{const{x:t,y:n,value:r,unit:o,formatValue:i,showDelta:s,deltaProps:a,zIndex:c=1e3}=e,u=ce(),d=a!=null&&a.isPositive?u.custom.green[500]:u.custom.red[500],p=a!=null&&a.isPositive?u.custom.green[100]:u.custom.red[100],h=Gu({coordinate:{x:t,y:n},placement:"top",offset:Wye});return f.jsx(K,{sx:{...h,zIndex:c},children:f.jsx(di,{width:"unset",padding:u.spacing(.5,1),popperZIndex:c,title:f.jsxs(le,{direction:"row",alignItems:"center",spacing:1,children:[f.jsxs(ie,{variant:"h6",sx:{fontWeight:700,color:u.custom.grey[2800]},children:[i(r),o?` ${o}`:""]}),s&&a&&a.percentageChange>0&&f.jsxs(le,{direction:"row",alignItems:"center",spacing:u.spacing(1),sx:{color:d,fontWeight:600},children:[f.jsx(K,{sx:{borderRadius:u.spacing(1),display:"flex",alignItems:"center",justifyContent:"center",width:u.spacing(2),height:u.spacing(2),border:`1px solid ${d}`,backgroundColor:p},children:f.jsx(Ct,{icon:a.isIncrease?"arrowUpRight":"arrowDownRight",size:1,color:d})}),f.jsx(ie,{variant:"body2",sx:{fontWeight:600},children:Intl.NumberFormat(a.language,{style:"percent",maximumFractionDigits:a.precision}).format(a.percentageChange/100)})]})]}),placement:"top",open:!0,arrow:!0,sx:Ku(),children:f.jsx("div",{})})})},Uye=(e,t,n,r,o,i,s)=>{var x,w;const a=s?n.length-1:n.findIndex(M=>M===String(r));if(a<0)return null;const c=typeof e=="number"?e:null,u=o.total??0,d=a>0?t.reduce((M,S)=>M+(S.data[a-1]||0),0):0,p=c!==null?((x=t[c])==null?void 0:x.data[a])??0:void 0,h=c!==null?a>0?((w=t[c])==null?void 0:w.data[a-1])??0:0:void 0,g=typeof p=="number"?p:u,m=typeof h=="number"?h:d,v=g>m,C=i==="increase"?v:!v,y=m>0?Math.abs((g-m)/m*100):0;return{currentIndex:a,currentTotal:u,previousTotal:d,currentSegment:p,previousSegment:h,valueToDisplay:g,previousValue:m,isIncrease:v,isPositive:C,percentageChange:y}},qye=(e,t,n,r,o)=>{const i=typeof t=="number"?t:e.x,s=typeof n=="number"?n:e.y;return{curX:i,curY:s,prevXPos:typeof r=="number"?r:void 0,prevYPos:typeof o=="number"?o:void 0}},U_=(e,t,n)=>t(e,n),Gye=(e,t,n,r,o)=>{var p,h;const i=((p=e[t])==null?void 0:p.data[0])??0,s=((h=e[t])==null?void 0:h.data[n])??0,a=n===r.length-1&&r.length>=2&&i>0,c=a?Math.abs((s-i)/i*100):0,u=s>i;return{firstVal:i,val:s,showDelta:a,pctChange:c,isIncreaseVsFirst:u,isPositiveVsFirst:o==="increase"?u:!u}},Kye=e=>{const{hoveredIdx:t,labels:n,datasets:r,allCenters:o,allTopYs:i,coordinate:s,positiveTrend:a,currentIndex:c,unit:u,valueFormatterFn:d,precision:p,language:h}=e;if(!d)throw new Error("valueFormatterFn is required");const g=m=>U_(m,d,p);return f.jsx(f.Fragment,{children:n.map((m,v)=>{const C=o[v],y=typeof i[v]=="number"?i[v]:s.y;if(typeof C!="number"||typeof y!="number")return null;const x=Gye(r,t,v,n,a);return f.jsx(AC,{x:C,y,value:x.val,unit:u,formatValue:g,showDelta:x.showDelta,deltaProps:x.showDelta?{percentageChange:x.pctChange,isIncrease:x.isIncreaseVsFirst,isPositive:x.isPositiveVsFirst,precision:p,language:h}:void 0,zIndex:c===v?1001:1e3},`multi-tip-${v}`)})})},Yye=e=>{var L;const t=ce(),{active:n,payload:r,label:o,unit:i,valueFormatterFn:s=t.numbers.valueFormatterFn,precision:a=0,language:c,positiveTrend:u,datasets:d,labels:p,barTopY:h,coordinate:g,hoveredDatasetIndex:m,prevBarTopY:v,prevX:C,currentX:y,allCenters:x,allTopYs:w,legendHovering:M}=e;if(!n||!r||!r.length||!g||m==null)return null;const S=(L=r[0])==null?void 0:L.payload;if(!S)return null;const E=Uye(m,d,p,o??"",S,u,M??!1);if(!E)return null;const T=j=>U_(j,s,a),O=p.length>1&&Array.isArray(x)&&Array.isArray(w),P=typeof m=="number"?m:null;if(O&&P!==null)return f.jsx(Kye,{hoveredIdx:P,labels:p,datasets:d,allCenters:x,allTopYs:w,coordinate:g,positiveTrend:u,currentIndex:E.currentIndex,unit:i,valueFormatterFn:s,precision:a,language:c});const k=qye(g,y,h,C,v);return f.jsxs(f.Fragment,{children:[f.jsx(AC,{x:k.curX,y:k.curY,value:E.valueToDisplay,unit:i,formatValue:T,showDelta:E.currentIndex>0&&E.percentageChange>0,deltaProps:{percentageChange:E.percentageChange,isIncrease:E.isIncrease,isPositive:E.isPositive,precision:a,language:c},zIndex:1001}),E.currentIndex>0&&k.prevXPos!=null&&k.prevYPos!=null&&f.jsx(AC,{x:k.prevXPos,y:k.prevYPos,value:E.previousValue,unit:i,formatValue:T,zIndex:1e3})]})},Xye=(e,t)=>e.map((n,r)=>{const o={name:n,total:0};let i=0;return t.forEach((s,a)=>{const c=s.data[r]||0;o[`dataset_${a}`]=c,o[`hoverBottom_${a}`]=i,i+=c,o.total+=c}),o}),Jye=(e,t)=>{const n=Object.values(t.custom.dataviz.colorsWithExtra).map(r=>r.main);return e.map((r,o)=>r.backgroundColor||n[o%n.length])},Qye=e=>e.map(t=>(t.data||[]).reduce((n,r)=>n+(r||0),0)),q_=(e,t,n,r,o=!1)=>{const i=Math.abs(n.x-t.x),s=t.x+i*.5,a=t.y,c=n.x-i*.5,u=n.y;return{cp1:{x:s,y:a},cp2:{x:c,y:u}}},exe=e=>{const[t,n]=I.useState(null),[r,o]=I.useState(!1),i=I.useRef({}),s=I.useRef({}),a=I.useRef({}),c=I.useRef({}),u=I.useRef(null);I.useEffect(()=>{i.current={}},[e]);const d=(y,x,w)=>{if(typeof y=="string"&&typeof x=="number"&&typeof w=="number"){const M=i.current[y]||{},S=M[x];M[x]=typeof S=="number"?Math.min(S,w):w,i.current[y]=M}},p=(y,x,w)=>{if(typeof y=="string"&&typeof x=="number"&&typeof w=="number"){const M=a.current[y]||{};M[x]=w,a.current[y]=M}},h=(y,x)=>{typeof y=="string"&&typeof x=="number"&&(s.current[y]=x)},g=(y,x)=>{typeof y=="string"&&typeof x=="number"&&(c.current[y]=x/2)},m=I.useCallback(y=>{n(y),o(!1)},[]),v=I.useCallback(()=>{n(null),o(!1)},[]),C=I.useCallback(y=>{n(y),o(y!==null)},[]);return{hoveredDatasetIndex:t,isLegendHover:r,barTopsRef:i,barCentersRef:s,barBottomsRef:a,barHalfWidthRef:c,chartContainerRef:u,registerBarTopY:d,registerBarBottomY:p,registerBarCenterX:h,registerBarHalfWidth:g,handleDatasetHover:m,handleDatasetLeave:v,handleLegendHover:C}},txe="80",Xf=4,wi=0,nxe=50,rxe=50,oxe=200,ixe=2,sxe=0,axe=e=>{const{values:t,colors:n,hoveredDatasetIndex:r,maxBarSize:o,segmentGap:i,registerBarTopY:s,registerBarBottomY:a,registerBarCenterX:c,registerBarHalfWidth:u,onDatasetHover:d,onDatasetLeave:p}=e;return f.jsx(f.Fragment,{children:t.map((h,g)=>f.jsx(zi,{dataKey:`dataset_${g}`,name:h.label,stackId:"evolution",fill:r===null||r===g?n[g]:`${n[g]}${txe}`,radius:g===t.length-1?[Xf,Xf,wi,wi]:[wi,wi,wi,wi],animationBegin:nxe+g*rxe,animationDuration:oxe,maxBarSize:o,onMouseEnter:()=>d(g),onMouseLeave:p,shape:m=>{const v=m,C=v.y;s(v.payload.name,g,C),s(v.payload.name,-1,C);const y=v.x,x=v.width;y!==void 0&&x!==void 0&&(c(v.payload.name,y+x/ixe),u(v.payload.name,x));let w=v.height;typeof w=="number"&&g>0&&(w=Math.max(sxe,w-i)),C!==void 0&&w!==void 0&&a(v.payload.name,g,C+w);const M={radius:g===t.length-1?[Xf,Xf,wi,wi]:[wi,wi,wi,wi],x:y,y:C,width:x,height:w,fill:m.fill,stroke:m.stroke,strokeWidth:m.strokeWidth,strokeDasharray:m.strokeDasharray,strokeOpacity:m.strokeOpacity,fillOpacity:m.fillOpacity};return f.jsx(Xl,{...M})}},`dataset_${g}`))})},lxe=e=>{var h,g,m,v,C,y;const{hoveredDatasetIndex:t,labels:n,barCentersRef:r,barHalfWidthRef:o,barTopsRef:i,barBottomsRef:s,colors:a,areaGap:c,barWidth:u}=e;if(t===null)return null;const d=c/2,p=[];for(let x=0;x<n.length-1;x+=1){const w=n[x],M=n[x+1],S=r.current[w],E=o.current[w]??u/2,T=r.current[M],O=o.current[M]??u/2,P=(h=i.current[w])==null?void 0:h[t],k=(g=i.current[M])==null?void 0:g[t];let L=(m=s.current[w])==null?void 0:m[t];L==null&&t>0&&(L=(v=i.current[w])==null?void 0:v[t-1]);let j=(C=s.current[M])==null?void 0:C[t];if(j==null&&t>0&&(j=(y=i.current[M])==null?void 0:y[t-1]),typeof S=="number"&&typeof E=="number"&&typeof T=="number"&&typeof O=="number"&&typeof P=="number"&&typeof k=="number"&&typeof L=="number"&&typeof j=="number"){const A=S+E+d,R=T-O-d,_=x>0?{}:{},N={x:A,y:P},z={x:R,y:k},B=x<n.length-2?{}:{},{cp1:$,cp2:V}=q_(_,N,z,B,!1),H=x>0?{}:{},X={x:A,y:L},Q={x:R,y:j},ne=x<n.length-2?{}:{},{cp1:q,cp2:J}=q_(H,X,Q,ne,!0),te=[`M ${N.x} ${N.y}`,`C ${$.x} ${$.y} ${V.x} ${V.y} ${z.x} ${z.y}`,`L ${Q.x} ${Q.y}`,`C ${J.x} ${J.y} ${q.x} ${q.y} ${X.x} ${X.y}`,"Z"].join(" ");p.push(te)}}return p.length===0?null:f.jsx("g",{style:{pointerEvents:"none"},children:p.map((x,w)=>f.jsx("path",{d:x,fill:He(a[t],.2),stroke:"none"},w))})},cxe="415px",uxe="100%",dxe=4,fxe=8,G_=44,pxe=45,hxe=0,gxe=30,mxe=5,vxe="20%",Cxe=3,bxe=50,yxe=e=>{const t=ce(),{labels:n,values:r,unit:o,height:i=cxe,width:s=uxe,legend:a,valueFormatterFn:c=t.numbers.valueFormatterFn,precision:u,icons:d=[],showLegend:p=!0,improvement:h="decrease",segmentGap:g=dxe,areaGap:m=fxe}=e,v=vn.language,C=fo(t.breakpoints.down("md")),y=(a==null?void 0:a.position)??"right",x=(a==null?void 0:a.fullWidthLegend)??!1,w=I.useMemo(()=>Xye(n,r),[n,r]),M=I.useMemo(()=>Jye(r,t),[r,t]),S=I.useMemo(()=>Qye(r),[r]),{hoveredDatasetIndex:E,isLegendHover:T,barTopsRef:O,barCentersRef:P,barBottomsRef:k,barHalfWidthRef:L,chartContainerRef:j,registerBarTopY:A,registerBarBottomY:R,registerBarCenterX:_,registerBarHalfWidth:N,handleDatasetHover:z,handleDatasetLeave:B,handleLegendHover:$}=exe(w);return f.jsxs(le,{direction:p&&!C?y==="bottom"?"column":"row":"column",position:"relative",height:i,gap:t.spacing(Cxe),minHeight:t.spacing(bxe),justifyContent:"stretch",sx:{padding:t.spacing(3),width:s},children:[f.jsx(K,{display:"flex",sx:{"& *":{outline:"none"},height:"100%",position:"relative",flex:1},ref:j,children:f.jsx(fr,{width:"100%",children:f.jsxs(TC,{data:w,margin:{top:pxe,right:hxe,left:gxe,bottom:mxe},barCategoryGap:vxe,children:[f.jsx(Zi,{strokeDasharray:"4 4",stroke:t.palette.divider,vertical:!1}),f.jsx(yi,{dataKey:"name",strokeDasharray:"4 4",strokeWidth:0,tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateY(${t.spacing(2)})`}},axisLine:{stroke:t.palette.divider},tickLine:!1,interval:"equidistantPreserveStart",padding:{left:0,right:0}}),f.jsx(qo,{width:"auto",strokeDasharray:"4 4",strokeWidth:1,tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateX(-${t.spacing(2)})`}},axisLine:{stroke:t.palette.divider},tickLine:!1,tickFormatter:V=>c(Number(V),u),children:f.jsx(Wo,{value:o,position:"insideTopLeft",style:{fontFamily:"Montserrat",fontSize:"14px",transform:`translate(-${t.spacing(2.5)}, -${t.spacing(6)})`}})}),f.jsx(qo,{strokeDasharray:"4 4",strokeWidth:1,axisLine:{stroke:t.palette.divider},yAxisId:"evolution-chart-right-axis",type:"number",orientation:"right"}),f.jsx(qa,{cursor:!1,content:V=>{var F,G,D,ee;if(!V.active||!V.payload||!V.payload.length)return null;const H=V&&(typeof V.label=="string"||typeof V.label=="number")?String(V.label):void 0,X=H!=null?typeof E=="number"?(F=O.current[H])==null?void 0:F[E]:(G=O.current[H])==null?void 0:G[-1]:void 0,Q=H!=null?P.current[H]:void 0,ne=H!=null?n.findIndex(oe=>oe===H):-1,q=ne>0?n[ne-1]:void 0,J=q!=null?typeof E=="number"?(D=O.current[q])==null?void 0:D[E]:(ee=O.current[q])==null?void 0:ee[-1]:void 0,te=q!=null?P.current[q]:void 0,Y=n.map(oe=>P.current[oe]),Z=typeof E=="number"?n.map(oe=>{var se;return(se=O.current[oe])==null?void 0:se[E]}):void 0;return f.jsx(Yye,{...V,unit:o,valueFormatterFn:c,precision:u,language:v,positiveTrend:h,datasets:r,labels:n,barTopY:X,hoveredDatasetIndex:E,prevBarTopY:J,prevX:te,currentX:Q,allCenters:Y,allTopYs:Z,legendHovering:T})},wrapperStyle:{zIndex:1e3},contentStyle:{background:"transparent",border:"none",boxShadow:"none",padding:0},isAnimationActive:!1}),f.jsx(axe,{values:r,colors:M,hoveredDatasetIndex:E,maxBarSize:G_,segmentGap:g,registerBarTopY:A,registerBarBottomY:R,registerBarCenterX:_,registerBarHalfWidth:N,onDatasetHover:z,onDatasetLeave:B}),f.jsx(zD,{component:()=>f.jsx(lxe,{hoveredDatasetIndex:E,labels:n,barCentersRef:P,barHalfWidthRef:L,barTopsRef:O,barBottomsRef:k,colors:M,areaGap:m,barWidth:G_})})]})})}),p&&f.jsx(K,{display:"flex",sx:{maxWidth:x||y==="bottom"||C?"100%":"350px",flex:1},children:f.jsx(J9,{labels:r.map(V=>V.label),colors:M,icons:d,legend:a,hidePercentage:!0,hoveredDatasetIndex:E,onLegendHover:$,values:S,chartRef:j})})]})},xxe=e=>{const t=ce(),n=vn.language,{actionsTotalValue:r,improvement:o,target:i,goal:s,unit:a="",textOptions:c,precision:u,valueFormatterFn:d}=e,p=[],h=(()=>{const m=(s==null?void 0:s.value)??0,v=(i==null?void 0:i.value)??0;if(v===0||m===0)return 0;const C=m-v;return o==="increase"?v/m*100:(C/Math.abs(v)+1)*100})(),g=m=>m&&m>=0?o==="decrease"?t.custom.red[600]:t.custom.green[600]:m&&m<=0?o==="decrease"?t.custom.green[600]:t.custom.red[600]:t.custom.green[600];return c!=null&&c.setOfActionsLabel&&r!==null&&p.push({label:c.setOfActionsLabel,value:d?d(r,u):r.toLocaleString(n,{minimumFractionDigits:u||0,maximumFractionDigits:u||0}),color:g(r),unit:a}),c!=null&&c.goalProgressLabelDescription&&i&&s&&p.push({label:null,additionalComponent:f.jsx(TO,{completionPercent:h,improvement:o,color:OO(h,t),label:c.goalProgressLabelDescription})}),p},wxe=e=>{const t=ce(),{label:n,value:r,unit:o,additionalComponent:i}=e;return f.jsxs(Ri,{elevation:0,sx:{borderRadius:t.spacing(1),height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",p:t.spacing(2,2.5),gap:t.spacing(1.5),border:`1px solid ${t.palette.divider}`},children:[n!==null&&f.jsx(K,{sx:{display:"flex",alignItems:"center"},children:f.jsx(ie,{variant:"big-bold",fontWeight:"semi-bold",fontSize:t.spacing(2),color:"text.primary",children:n})}),r!==void 0&&f.jsxs(le,{direction:"row",spacing:1,alignItems:"baseline",children:[f.jsx(ie,{variant:"big-bold",fontWeight:"bold",fontSize:t.spacing(4),color:e.color,children:r}),f.jsx(ie,{variant:"small-medium",fontSize:t.spacing(2),color:t.custom.grey[1400],children:o})]}),i&&f.jsx(K,{sx:{transform:`translate(${t.spacing(-.5)}, ${t.spacing(-1.5)})`},children:i})]})},Sxe=e=>{const t=ce(),{textOptions:n,target:r,goal:o,actionsTotalValue:i,improvement:s,precision:a,unit:c,valueFormatterFn:u=g=>t.numbers.valueFormatterFn(g,a)}=e,p={...{setOfActionsLabel:"",goalProgressLabelDescription:""},...n},h=xxe({actionsTotalValue:i,improvement:s,target:r,goal:o,unit:c,precision:a,textOptions:p,valueFormatterFn:u});return h.length===0?null:f.jsx(Rl,{container:!0,spacing:2,sx:{pt:t.spacing(2),alignItems:"stretch"},children:h.map((g,m)=>f.jsx(Rl,{size:{xs:12,sm:6,md:3},children:f.jsx(wxe,{...g})},`${g.label}-${m}`))})},Mxe=e=>{const{startingValue:t,differences:n}=e,r={pivot:null,results:[]};return n.reduce((i,s)=>{const a=i.pivot??t,c=a+s;return i.results.push([a,c]),i.pivot=c,i},r).results},Exe=(e,t,n,r,o,i,s,a,c)=>{const u=(n??[]).filter(m=>m.value!==null),d=u.map(m=>m.value),p=(t==null?void 0:t.value)??(e==null?void 0:e.value)??0,h=Mxe({startingValue:p,differences:d}),g=[];if(e!=null&&e.label&&g.push({label:e.label,low:0,high:e.value??0,diff:(e.value??0)-0,type:"reference",color:(r==null?void 0:r.reference)??c.custom.dataviz.colors[2].main}),t!=null&&t.label&&g.push({label:t.label,low:0,high:t.value??0,diff:(t.value??0)-0,type:"start",color:(r==null?void 0:r.start)??c.custom.dataviz.colors[4].main}),u.forEach((m,v)=>{const C=h[v];if(!C)return;const[y,x]=C,w=x-y,M=w<=0,S=s==="decrease"?c.custom.dataviz.colors[6].main:c.custom.dataviz.extra[14].main,E=s==="decrease"?c.custom.dataviz.extra[14].main:c.custom.dataviz.colors[6].main;g.push({label:m.label,low:y,high:x,diff:w,type:"value",color:M?E:S})}),o!=null&&o.label){const m=a??p+(d.length>0?d.reduce((v,C)=>v+C,0):0);g.push({label:o.label,low:0,high:m,diff:m-0,type:"target",color:(r==null?void 0:r.target)??c.custom.dataviz.colors[4].main})}if(i!=null&&i.label){const m=i.value??a??0;g.push({label:i.label,low:0,high:m,diff:m-0,type:"goal",color:(r==null?void 0:r.goal)??c.custom.dataviz.extra[12].main})}return g},K_=80,Txe=85,Y_=0,Oxe=(e,t)=>{const n=e.length;if(n===0)return{interval:Y_,maxWidth:K_};const r=t/n;let o=Y_;const i=Math.min(r,K_);return r<Txe&&(o="preserveStartEnd"),{interval:o,maxWidth:i}},kxe=16,Pxe=6,Lxe=22,jxe="12",Ixe="Montserrat",Axe=e=>{const{x:t,y:n,payload:r,maxWidth:o}=e,i=ce(),a=r.value.split(" "),c=[];let u="";for(const d of a){const p=u?`${u} ${d}`:d;p.length*Pxe>o&&u?(c.push(u),u=d):u=p}return u&&c.push(u),f.jsx("g",{transform:`translate(${t},${n+Lxe})`,children:f.jsx("g",{children:c.map((d,p)=>f.jsx("text",{x:0,y:p*kxe,textAnchor:"middle",fill:i.palette.text.primary,fontSize:jxe,fontFamily:Ixe,children:d},p))})})},Rxe=300,Dxe=2,Vxe=10,tc=4,X_=0,_xe="Montserrat",Nxe="600",Hxe="14px",$xe=0,Fxe=e=>{const{transformedData:t,valueFormatterFn:n,forcedPrecision:r,precision:o}=e,i=ce();return f.jsxs(f.Fragment,{children:[f.jsx(zi,{dataKey:"low",stackId:"waterfall",fill:"transparent"}),f.jsxs(zi,{dataKey:"diff",stackId:"waterfall",animationDuration:Rxe,minPointSize:Dxe,children:[t.map((s,a)=>{const c=s.low===0?[tc,tc,X_,X_]:[tc,tc,tc,tc];return f.jsx(yo,{fill:s.color,radius:c},`cell-${a}`)}),f.jsx(Ga,{dataKey:"diff",position:"top",offset:Vxe,style:{fontFamily:_xe,fontWeight:Nxe,fontSize:Hxe,fill:i.custom.grey[2800]},formatter:s=>{const a=typeof s=="number"?s:Number(s)||$xe;return n?n(a,r||o):i.numbers.valueFormatterFn(a,r||o)}})]})]})},Bxe=45,zxe=0,Zxe=30,Wxe=35,Uxe=40,J_=0,qxe=0,Gxe=2,Kxe=.2,Yxe=e=>{const t=ce(),{reference:n,start:r,values:o,colors:i,target:s,goal:a,forcedPrecision:c,unit:u,improvement:d,targetValueFinal:p,valueFormatterFn:h=t.numbers.valueFormatterFn,precision:g}=e,m=I.useRef(null),v=800,C=60,[y,x]=I.useState(v);I.useEffect(()=>{const S=()=>{if(m.current){const T=m.current.getBoundingClientRect().width;T>0&&x(T-C)}};S();const E=()=>S();return window.addEventListener("resize",E),()=>window.removeEventListener("resize",E)},[]);const w=I.useMemo(()=>Exe(n,r,o,i,s,a,d,p,t),[n,r,o,i,s,a,d,p,t]),M=I.useMemo(()=>Oxe(w,y),[w,y]);return f.jsx("div",{ref:m,style:{width:"100%",height:"100%"},children:f.jsx(fr,{width:"100%",height:"100%",children:f.jsxs(TC,{data:w,margin:{top:Bxe,right:zxe,left:Zxe,bottom:Wxe},children:[f.jsx(Zi,{strokeDasharray:"4 4",stroke:t.palette.divider}),f.jsx(yi,{dataKey:"label",strokeWidth:J_,strokeDasharray:"4 4",tick:S=>f.jsx(Axe,{...S,maxWidth:M.maxWidth}),axisLine:{stroke:t.palette.divider},interval:M.interval,tickLine:!1,padding:{left:0,right:0},height:Uxe}),f.jsx(qo,{width:"auto",domain:([S,E])=>[S<0?S-Math.abs(S)*Kxe:S,E],strokeWidth:J_,tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateX(-${t.spacing(2)})`}},axisLine:{stroke:t.palette.divider},tickLine:!1,tickFormatter:S=>h(Number(S),g),children:f.jsx(Wo,{value:u,position:"insideTopLeft",style:{fontFamily:"Montserrat",fontSize:"14px",transform:`translate(-${t.spacing(2.75)}, -${t.spacing(6)})`}})}),f.jsx(Wu,{y:qxe,stroke:t.custom.grey[600],strokeWidth:Gxe}),f.jsx(Fxe,{transformedData:w,valueFormatterFn:h,forcedPrecision:c,precision:g})]})})})},Xxe=e=>{const t=ce(),{reference:n,start:r,values:o,colors:i,target:s,goal:a,forcedPrecision:c=0,unit:u,width:d="100%",height:p="100%",improvement:h="decrease",textOptions:g,showLegend:m=!0,valueFormatterFn:v=t.numbers.valueFormatterFn}=e,C=I.useMemo(()=>o!=null&&o.length?o.map(w=>w.value).filter(w=>w!==null):null,[o]),y=I.useMemo(()=>C?C.reduce((w,M)=>w+M,0):null,[C]),x=s!=null&&s.value?s:{label:(r==null?void 0:r.label)??(n==null?void 0:n.label)??"",value:(s==null?void 0:s.value)??((r==null?void 0:r.value)??(n==null?void 0:n.value)??0)+(y??0)};return f.jsxs(le,{direction:"column",position:"relative",width:d,minHeight:t.spacing(50),justifyContent:"stretch",sx:{"& *":{outline:"none"}},children:[f.jsx(K,{sx:{border:`1px solid ${t.palette.divider}`,backgroundColor:t.palette.background.paper,borderRadius:t.spacing(1),width:"100%",height:p,padding:t.spacing(3)},children:f.jsx(Yxe,{reference:n,start:r,values:o,target:s,goal:a,colors:i,forcedPrecision:c,unit:u,improvement:h,targetValueFinal:(s==null?void 0:s.value)??((r==null?void 0:r.value)??(n==null?void 0:n.value)??0)+(y??0),valueFormatterFn:v,precision:c})}),m&&f.jsx(Sxe,{textOptions:g,target:x,improvement:h,goal:a,valueFormatterFn:v,actionsTotalValue:y,unit:u,precision:c})]})},ot={DEFAULT_WIDTH:500,DEFAULT_HEIGHT:200,GAUGE_HEIGHT:28,GAUGE_PADDING:8,LEGEND_PADDING_X:28,FONT_SIZE:{DEFAULT:12},MARKER:{COMPANY_RADIUS:5,COMPANY_STROKE_WIDTH:3,AVERAGE_RADIUS:3,AVERAGE_STROKE_WIDTH:2,EDGE_RADIUS:3},COLORS:{BORDER:"#E7E6E4",GRADIENT:{START:"#F0DF46",END:"#EB9411"}},TEXT:{DEFAULT_COMPANY_LABEL:"",DEFAULT_AVERAGE_LABEL:""},LAYOUT:{COMPANY_MARKER_OFFSET:18,AVERAGE_MARKER_TOP_OFFSET:12,AVERAGE_MARKER_BOTTOM_OFFSET:4,COMPANY_LABEL_VERTICAL_RATIO:.25,AVERAGE_LABEL_VERTICAL_RATIO:.75,COMPANY_LABEL_OFFSET:8,AVERAGE_LABEL_OFFSET:12,TITLE_OFFSET:35,VALUES_LABEL_OFFSET:8}},Jxe=(e,t,n)=>e===t?()=>(n-ot.GAUGE_PADDING*2)/2:r=>(r-e)/(t-e)*(n-ot.GAUGE_PADDING*2),Qxe=(e,t=ot.FONT_SIZE.DEFAULT)=>e.length*(t*.6),Q_=(e,t,n,r,o=ot.FONT_SIZE.DEFAULT)=>{const i=ot.GAUGE_PADDING+n(e),s=Qxe(t,o)/2;return i-s<ot.GAUGE_PADDING?{x:ot.GAUGE_PADDING,anchor:"start"}:i+s>r-ot.GAUGE_PADDING?{x:r-ot.GAUGE_PADDING,anchor:"end"}:{x:i,anchor:"middle"}},ewe=(e,t)=>(e+t)/2,twe=({minValue:e,maxValue:t,companyValue:n,averageValue:r,labelCompany:o,labelAverage:i,width:s,height:a})=>{const c=Jxe(e,t,s),u=ewe(e,t),d=Q_(n,o,c,s),p=Q_(r,i,c,s),h=a/2,g=h-ot.GAUGE_HEIGHT,m=g+ot.GAUGE_HEIGHT/2,v={start:h-ot.LAYOUT.COMPANY_MARKER_OFFSET,end:g-ot.LAYOUT.COMPANY_MARKER_OFFSET},C={start:h-ot.LAYOUT.AVERAGE_MARKER_TOP_OFFSET,end:h+ot.GAUGE_HEIGHT-ot.LAYOUT.AVERAGE_MARKER_BOTTOM_OFFSET},y={company:a*ot.LAYOUT.COMPANY_LABEL_VERTICAL_RATIO-ot.LAYOUT.COMPANY_LABEL_OFFSET,average:a*ot.LAYOUT.AVERAGE_LABEL_VERTICAL_RATIO-ot.LAYOUT.AVERAGE_LABEL_OFFSET,title:g-ot.LAYOUT.TITLE_OFFSET,values:a-ot.LAYOUT.VALUES_LABEL_OFFSET},x={min:ot.GAUGE_PADDING,max:s-ot.GAUGE_PADDING,middle:ot.GAUGE_PADDING+(s-ot.GAUGE_PADDING*2)/2},w={x:ot.GAUGE_PADDING,y:m-ot.GAUGE_HEIGHT/2,width:s-ot.GAUGE_PADDING*2,height:ot.GAUGE_HEIGHT,animated:!1};return{scale:c,averageValueBoundaries:u,companyPosition:d,averagePosition:p,gaugeBackgroundProps:w,markerY:m,companyMarkerY:v,averageMarkerY:C,labelY:y,labelPositions:x}},nwe=({width:e,height:t,averageValueBoundaries:n,scale:r,animated:o=!1})=>{const i=I.useRef(null);return I.useEffect(()=>{if(i.current&&o){const s=i.current;s.style.opacity="0",setTimeout(()=>{s.style.transition="all 0.5s linear",s.style.opacity="1"},300)}},[o]),f.jsxs("g",{ref:i,style:{opacity:o?"0":"1"},children:[f.jsx("line",{x1:ot.GAUGE_PADDING,y1:1,x2:e-ot.GAUGE_PADDING,y2:1,stroke:ot.COLORS.BORDER,strokeWidth:"1",strokeDasharray:"5 5"}),f.jsx("line",{x1:ot.GAUGE_PADDING,y1:t-ot.LEGEND_PADDING_X,x2:e-ot.GAUGE_PADDING,y2:t-ot.LEGEND_PADDING_X,stroke:ot.COLORS.BORDER,strokeWidth:"1",strokeDasharray:"5 5"}),f.jsx("line",{x1:ot.GAUGE_PADDING,y1:0,x2:ot.GAUGE_PADDING,y2:t-ot.LEGEND_PADDING_X,stroke:ot.COLORS.BORDER,strokeWidth:"1",strokeDasharray:"5 5"}),f.jsx("line",{x1:e-ot.GAUGE_PADDING,y1:0,x2:e-ot.GAUGE_PADDING,y2:t-ot.LEGEND_PADDING_X,stroke:ot.COLORS.BORDER,strokeWidth:"1",strokeDasharray:"5 5"}),f.jsx("line",{x1:r(n)+ot.GAUGE_PADDING,y1:0,x2:r(n)+ot.GAUGE_PADDING,y2:t-ot.LEGEND_PADDING_X,stroke:ot.COLORS.BORDER,strokeWidth:"1",strokeDasharray:"5 5"})]})},Jf=(e,t=0)=>Number(e.toFixed(t<0||t>100?0:t)),Qf=({label:e,value:t,unit:n,precision:r=2,valueFormatter:o})=>{const i=ce(),s=o?o(t):Jf(t,r);return f.jsxs(K,{sx:{display:"flex",width:"100%",flexDirection:"column",gap:i.spacing(.75),padding:i.spacing(.75,1.5,0,.75),textAlign:"left",justifyContent:"flex-start"},children:[f.jsx(ie,{variant:"h5",color:i.custom.grey[2800],children:e}),f.jsxs(K,{sx:{display:"flex",alignItems:"baseline"},children:[f.jsx(ie,{variant:"h2",color:i.custom.grey[2800],sx:{mr:.5},children:s}),f.jsx(ie,{variant:"body-medium",color:i.custom.grey[1400],children:n})]})]})},rwe=({scale:e,companyValue:t,averageValue:n,markersYPosition:r,companyMarkerY:o,averageMarkerY:i,animated:s=!1,minValue:a,maxValue:c,precision:u=2,unit:d="",labelCompany:p="",labelAverage:h="",valueFormatter:g})=>{const m=ce(),v=I.useRef(null),C={transition:s?"transform 0.3s linear":"none"},y=m.custom.grey[2800],x=w=>w>=a&&w<=c;return I.useEffect(()=>{if(v.current&&s){const w=v.current;w.style.opacity="0",setTimeout(()=>{w.style.transition="all 0.5s linear",w.style.opacity="1"},300)}},[s]),f.jsxs("g",{ref:v,children:[[a,c].map((w,M)=>{const S=`edge-${M}`,E=ot.GAUGE_PADDING+e(w);return f.jsxs("g",{transform:`translate(${E}, 0)`,style:C,children:[f.jsx("circle",{cy:r,r:ot.MARKER.EDGE_RADIUS,fill:y}),f.jsx("line",{y1:r-ot.GAUGE_HEIGHT/2,y2:r+ot.GAUGE_HEIGHT/2,stroke:y,strokeWidth:"2"})]},S)}),x(t)&&f.jsx(di,{width:"unset",title:f.jsx(Qf,{label:p,value:t,unit:d,precision:u,valueFormatter:g}),children:f.jsxs("g",{transform:`translate(${ot.GAUGE_PADDING+e(t)}, 0)`,style:C,children:[f.jsx("line",{y1:o.start,y2:o.end,stroke:y,strokeWidth:"1"}),f.jsx("circle",{cy:r,r:ot.MARKER.COMPANY_RADIUS,stroke:y,strokeWidth:ot.MARKER.COMPANY_STROKE_WIDTH,fill:m.palette.common.white})]})}),x(n)&&f.jsx(di,{width:"unset",title:f.jsx(Qf,{label:h,value:n,unit:d,precision:u,valueFormatter:g}),children:f.jsxs("g",{transform:`translate(${ot.GAUGE_PADDING+e(n)}, 0)`,style:C,children:[f.jsx("line",{y1:i.start,y2:i.end,stroke:y,strokeWidth:"1"}),f.jsx("circle",{cy:r,r:ot.MARKER.AVERAGE_RADIUS,fill:m.palette.common.white,stroke:y,strokeWidth:ot.MARKER.AVERAGE_STROKE_WIDTH})]})})]})},owe=({minValue:e,maxValue:t,companyValue:n,averageValue:r,companyPosition:o,averagePosition:i,labelCompany:s,labelAverage:a,labelYPositions:c,labelPositions:u,animated:d,precision:p=0,unit:h="",valueFormatter:g})=>{const m=ce(),v=I.useRef(null),C={transition:d?"transform 0.3s linear":"none"},y=m.custom.grey[2800],x=e!==t,w=M=>M>=e&&M<=t;return I.useEffect(()=>{if(v.current&&d){const M=v.current;M.style.opacity="0",setTimeout(()=>{M.style.transition="all 0.5s linear",M.style.opacity="1"},300)}},[d]),f.jsxs("g",{ref:v,children:[f.jsxs("g",{children:[x&&f.jsx("text",{transform:`translate(${u.min}, ${c.values})`,fill:y,fontSize:"12",fontWeight:"bold",textAnchor:"start",dominantBaseline:"middle",style:C,cursor:"pointer",children:g?g(e):Jf(e,p)}),f.jsx("text",{transform:`translate(${u.middle}, ${c.values})`,fill:y,fontSize:"12",fontWeight:"bold",textAnchor:"middle",dominantBaseline:"middle",style:C,children:g?g((t+e)/2):Jf((t+e)/2,p)}),x&&f.jsx("text",{transform:`translate(${u.max}, ${c.values})`,fill:y,fontSize:"12",fontWeight:"bold",textAnchor:"end",dominantBaseline:"middle",style:C,children:g?g(t):Jf(t,p)})]}),f.jsxs("g",{cursor:"default",children:[w(n)&&f.jsx(di,{width:"unset",title:f.jsx(Qf,{label:s,value:n,unit:h,precision:p,valueFormatter:g}),children:f.jsx("text",{transform:`translate(${o.x}, ${c.company})`,fill:y,textAnchor:o.anchor,dominantBaseline:"middle",fontWeight:"700",fontSize:"12",style:C,children:s})}),w(r)&&f.jsx(di,{width:"unset",title:f.jsx(Qf,{label:a,value:r,unit:h,precision:p,valueFormatter:g}),children:f.jsx("text",{transform:`translate(${i.x}, ${c.average})`,fill:y,fontSize:"12",fontWeight:"500",textAnchor:i.anchor,dominantBaseline:"middle",style:C,children:a})})]})]})},iwe=({x:e,y:t,width:n,height:r,animated:o=!1,backgroundProps:i={}})=>{var d,p;const s=I.useRef(null),a="gaugeGradient";I.useEffect(()=>{s.current&&o&&(s.current.style.transform="scaleY(0)",s.current.style.transformOrigin="left",setTimeout(()=>{s.current&&(s.current.style.transition="all 0.2s linear",s.current.style.transform="scaleY(1)")},100))},[o]);const c=((d=i.gradient)==null?void 0:d.start)||ot.COLORS.GRADIENT.START,u=((p=i.gradient)==null?void 0:p.end)||ot.COLORS.GRADIENT.END;return f.jsxs(f.Fragment,{children:[f.jsx("defs",{children:f.jsxs("linearGradient",{id:a,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[f.jsx("stop",{offset:"0%",style:{stopColor:c}}),f.jsx("stop",{offset:"100%",style:{stopColor:u}})]})}),f.jsx("rect",{ref:s,x:e,y:t,width:n,height:r,fill:i.fill||`url(#${a})`,stroke:i.stroke||"none",strokeWidth:i.strokeWidth||0,rx:i.rx||0,ry:i.ry||0,style:{transformBox:"fill-box",transform:o?"scaleY(0)":"none",transformOrigin:"left"}})]})},swe=()=>{const e=I.useRef(null),[t,n]=I.useState(0);return I.useEffect(()=>{const r=()=>{e.current&&n(e.current.clientWidth)};return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),{containerRef:e,containerWidth:t}},awe=e=>{const t=ce(),{minValue:n,maxValue:r,averageValue:o,companyValue:i,labelAverage:s=ot.TEXT.DEFAULT_AVERAGE_LABEL,labelCompany:a=ot.TEXT.DEFAULT_COMPANY_LABEL,width:c,height:u=ot.DEFAULT_HEIGHT,label:d,animated:p=!1,backgroundProps:h,precision:g=0,unit:m="",valueFormatter:v=t.numbers.valueFormatterFn}=e,{containerRef:C,containerWidth:y}=swe(),x=y||c||ot.DEFAULT_WIDTH,{scale:w,averageValueBoundaries:M,companyPosition:S,averagePosition:E,gaugeBackgroundProps:T,markerY:O,companyMarkerY:P,averageMarkerY:k,labelY:L,labelPositions:j}=twe({minValue:n,maxValue:r,companyValue:i,averageValue:o,labelCompany:a,labelAverage:s,width:x,height:u});return f.jsx(K,{ref:C,width:c||"100%",height:u,position:"relative",children:f.jsxs("svg",{width:y,height:u,children:[f.jsx(nwe,{width:y,height:u,scale:w,averageValueBoundaries:M,animated:p}),f.jsx(iwe,{...T,backgroundProps:h,animated:p}),f.jsx(rwe,{width:y,scale:w,companyValue:i,averageValue:o,markersYPosition:O,companyMarkerY:P,averageMarkerY:k,minValue:n,maxValue:r,animated:p,precision:g,unit:m,labelCompany:a,labelAverage:s,valueFormatter:v}),f.jsx(owe,{minValue:n,maxValue:r,companyValue:i,averageValue:o,companyPosition:S,averagePosition:E,labelCompany:a,labelAverage:s,labelYPositions:L,labelPositions:j,animated:p,precision:g,unit:m,valueFormatter:v})]})})},lwe=()=>({dataset:[],allLabels:[],totalNumberOfIems:0}),cwe=(e,t,n,r)=>{const o={...t};return e.reduce((s,a)=>{const c=Array(s.totalNumberOfIems).fill(null),u={label:n,data:[...c,a.value],backgroundColor:a.color??r,scope:"initial"};return s.totalNumberOfIems+=1,s.allLabels.push(a.label),s.dataset.push(u),s},o)},uwe=(e,t,n)=>{var g,m,v,C;const r={...t},o=[[],[]],i=e.reduce((y,x)=>(x.values.forEach((w,M)=>{y[M].push(w)}),y),o),s=e.map(y=>y.label);r.allLabels=[...r.allLabels,...s];const a=Array(r.totalNumberOfIems).fill(null),c=((g=n==null?void 0:n.main)==null?void 0:g.color)??"#FFD6B9",u={label:((m=n==null?void 0:n.main)==null?void 0:m.label)??"",data:[...a,...i[0]],backgroundColor:c,scope:"trajectory"};r.dataset.push(u);const d=((v=n==null?void 0:n.difference)==null?void 0:v.color)??"#30C7A380",p={label:((C=n==null?void 0:n.difference)==null?void 0:C.label)??"",data:[...a,...i[1]],backgroundColor:d,scope:"trajectory"};r.dataset.push(p);const h=i[0].length;return r.totalNumberOfIems+=h,r},dwe=e=>{const{goal:t,chartState:n,label:r,color:o,forceLegend:i=!1}=e,s={...n},c=s.dataset[0].data[0],u=c===null||Array.isArray(c)||t===null,d=Array(s.allLabels.length).fill(null);d[0]=c,d[d.length-1]=t;const p=o||"rgb(54, 162, 235)",h={type:"line",label:r,data:d,backgroundColor:p,borderColor:p,isGoalNull:u,scope:"goal",forceLegend:i};return s.dataset.push(h),s},fwe=e=>{var h,g,m;const t=ce(),{goal:n=null,initialValues:r=[],trajectory:o=[],trajectoryOptions:i,forceGoalLegend:s}=e,a=lwe(),c=t.custom.dataviz.colorsWithExtra[11].main,u=cwe(r,a,(h=i==null?void 0:i.initialValues)==null?void 0:h.label,c),d=uwe(o,u,i),p=dwe({goal:n,chartState:d,label:(g=i==null?void 0:i.target)==null?void 0:g.label,color:(m=i==null?void 0:i.target)==null?void 0:m.color,forceLegend:s});return{datasets:p.dataset,initialValues:u.dataset,labels:p.allLabels}},RC=e=>{const{variant:t="tags-grey",label:n,startIcon:r,endIcon:o,onClick:i,disabled:s,sx:a}=e,c=ce(),u={"tags-grey":c.custom.grey[2800],"tags-black":c.custom.grey[100],"tags-white":c.custom.grey[2800],"tags-green":c.custom.green[600],"tags-red":c.custom.red[600]};return f.jsx(it,{startIcon:r&&f.jsx(ie,{sx:{color:u[t]},variant:"small-bold",children:f.jsx(Ct,{size:1,icon:r})}),endIcon:o&&f.jsx(ie,{sx:{color:u[t]},variant:"small-bold",children:f.jsx(Ct,{size:1,icon:o})}),variant:t,onClick:i,disabled:s,sx:{borderColor:"transparent",...a},children:f.jsx(ie,{sx:{color:u[t]},variant:"small-bold",children:n})})},pwe=e=>{const{user:t,deleteAction:n}=e;return f.jsxs(le,{sx:{display:"flex",gap:"5px",padding:"8px",border:"1px solid #E7E6E4",backgroundColor:"Red",borderRadius:"8px",width:"fit-content",justifyContent:"center",alignItems:"center"},children:[f.jsx(m0,{alt:`${t.firstname} ${t.lastname}`,variant:"small"}),f.jsx(ie,{variant:"body-bold",children:t.firstname}),f.jsx(ie,{variant:"body-bold",children:t.lastname}),n&&f.jsx(K,{onClick:n,children:f.jsx(Ct,{size:2,icon:"delete"})})]})},hwe=e=>{const{block:t,improvement:n,textOptions:r}=e,o=ce();return f.jsxs(K,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",padding:o.spacing(2,3),border:`1px solid ${o.palette.divider}`,backgroundColor:o.palette.background.paper,borderRadius:o.spacing(1),height:"100%",position:"relative"},children:[f.jsxs(le,{direction:"row",alignItems:"flex-start",justifyContent:"flex-start",spacing:o.spacing(2),minHeight:o.spacing(4),sx:{width:"100%"},children:[f.jsxs(le,{direction:"row",alignItems:"flex-start",spacing:1.5,children:[t.isLine?f.jsx(K,{sx:{width:o.spacing(2),transform:`translateY(${o.spacing(1)})`,height:o.spacing(.25),backgroundColor:t.color}}):f.jsx(K,{sx:{minWidth:o.spacing(2),transform:`translateY(${o.spacing(.25)})`,height:o.spacing(2),backgroundColor:t.color,borderRadius:o.spacing(.5)}}),f.jsx(ie,{variant:"body2",sx:{fontWeight:o.typography.fontWeightBold},children:t.label})]}),f.jsx(le,{children:t.complete&&f.jsx(RC,{startIcon:"circleCheck",variant:"tags-green",label:r.complete||"",disabled:!0})})]}),t.dataPoints&&t.dataPoints.length>0&&f.jsx(le,{spacing:2,sx:{mt:t.dataPoints[0].startValue&&t.dataPoints[0].endValue?o.spacing(1):0},children:t.dataPoints.map((i,s)=>f.jsxs(le,{direction:"row",alignItems:"center",spacing:.5,children:[!!i.startValue&&!!i.endValue&&f.jsx(k6,{currentValue:i.endValue,comparedTo:{value:i.startValue,label:i.label},improvement:n,layout:{direction:"horizontal",size:"M"},disableText:!0}),f.jsx(le,{direction:"column",alignItems:"flex-start",spacing:1,children:i.label&&f.jsx(ie,{variant:"small",children:i.label})})]},`${t.key}-${s}`))}),f.jsx(K,{children:t.dataPoints&&t.dataPoints.map((i,s)=>i.link&&f.jsx(d6,{href:i.link.url,target:"_blank",rel:"noopener noreferrer",sx:{display:"flex",alignItems:"center",textDecoration:"none",gap:o.spacing(1),cursor:"pointer"},children:f.jsxs(le,{direction:"row",alignItems:"center",spacing:o.spacing(1),color:o.palette.primary.main,mt:o.spacing(2),sx:{"&:hover":{opacity:.8}},children:[f.jsx(Ct,{icon:i.link.icon,size:1}),f.jsx(ie,{variant:"body-medium",sx:{fontWeight:o.typography.fontWeightBold},color:o.palette.primary.main,children:i.link.label})]})},`link-${t.key}-${s}`))})]})},Xu=e=>{const t=e.findIndex(i=>i!==null),n=t!==-1?e[t]:null,r=[...e].reverse().findIndex(i=>i!==null),o=r!==-1?e[e.length-1-r]:null;return{firstValue:n,lastValue:o}},gwe=e=>{const t=ce(),{datasets:n,datasetsLabels:r,improvement:o,urlEditTrajectories:i,textOptions:s}=e,[a,c]=[r[0],r[r.length-1]],u=n.filter(v=>v.scope==="initial"),d=n.filter(v=>v.scope==="trajectory"),p=n.filter(v=>v.scope==="goal"),h=[];if(u.length>0){const v=u[0];h.push({key:"initial-value",label:v.label,color:`${v.backgroundColor}`})}const g=d.map(v=>`${v.backgroundColor}`).reverse();if(d.length>0&&u.length>0){const v=d[1],C=v?v.data.map(w=>Number(w)):[],y=Number(u[0].data[0]),{lastValue:x}=Xu(C);if(y&&x){const w=[{startValue:y,endValue:x,label:`${s==null?void 0:s.between} ${a} ${s==null?void 0:s.and} ${c}`}];if(d.length>1){const S=d[0].data.map(T=>Number(T)),{lastValue:E}=Xu(S);E&&w.push({startValue:E,endValue:x,label:`${s==null?void 0:s.withoutActionPlan}`})}h.push({key:"trajectory-with-action-plan",label:d[1].label,color:g[0],dataPoints:w})}}if(d.length>1&&u.length>0){const C=d[0].data.map(w=>Number(w)),y=Number(u[0].data[0]),{lastValue:x}=Xu(C);y&&x&&h.push({key:"trajectory-without-action-plan",label:d[0].label,color:g[1],dataPoints:[{startValue:y,endValue:x,label:`${s==null?void 0:s.between} ${a} ${s==null?void 0:s.and} ${c}`}]})}const m=p[0];if(m.scope==="goal"){const v=m?m.data.map(O=>Number(O)):null,{firstValue:C,lastValue:y}=v?Xu(v):{firstValue:null,lastValue:null},x=d[1],w=x?x.data.map(O=>Number(O)):null,{lastValue:M}=w?Xu(w):{lastValue:null},S=m.isGoalNull,E={key:"goal",label:(m==null?void 0:m.label)||(s==null?void 0:s.goal),color:m?`${m.backgroundColor}`:t.custom.dataviz.colorsWithExtra[13].main,isLine:!0,dataPoints:[{startValue:C||void 0,endValue:y||void 0,label:S===!1?`${s==null?void 0:s.between} ${a} ${s==null?void 0:s.and} ${c}`:`${s==null?void 0:s.noObjective}`,link:s!=null&&s.editTrajectories?{label:`${s==null?void 0:s.editTrajectories}`,url:i,icon:"edit"}:void 0}],complete:M&&y?o==="decrease"?M<=y:M>=y:!1},T=!!m.forceLegend;(S&&T||m.isGoalNull!==!0&&y)&&h.push(E)}return h},mwe=e=>{const t=ce(),{datasets:n,datasetsLabels:r,improvement:o,urlEditTrajectories:i,textOptions:s}=e,c={...{complete:"",between:"",and:"",withoutActionPlan:"",goal:"",noObjective:"",editTrajectories:""},...s},u=gwe({datasets:n,datasetsLabels:r,improvement:o,urlEditTrajectories:i,textOptions:c});return f.jsx(Rl,{container:!0,spacing:2,sx:{p:t.spacing(3.25,0,0,0),alignItems:"stretch"},children:u.map(d=>f.jsx(Rl,{size:{xs:12,sm:6,md:3},children:f.jsx(hwe,{block:d,improvement:o,textOptions:c})},d.key))})},DC=e=>({hasWithoutActionPlan:e.withoutActionPlan!==null&&e.withoutActionPlan!==void 0,hasScore:e.initial!==null&&e.initial!==void 0,hasWithActionPlan:e.withActionPlan!==null&&e.withActionPlan!==void 0}),VC=(e,t,n,r,o=.25)=>{const{hasWithoutActionPlan:i,hasScore:s,hasWithActionPlan:a}=r,c=(i?1:0)+(s?1:0)+(a?1:0),u=n,d=3*u,p=u*o,h=e==="withoutActionPlan"?t:e==="score"?t-u:t-2*u;if(c===1&&(e==="withoutActionPlan"&&i||e==="score"&&s||e==="withActionPlan"&&a))return{x:h+p,width:d-2*p};if(c===2){if(i&&s&&!a){if(e==="withoutActionPlan")return{x:h,width:1.5*u};if(e==="score")return{x:h+1.5*u,width:1.5*u}}if(i&&!s&&a){if(e==="withoutActionPlan")return{x:h+u*.75,width:u*.75};if(e==="withActionPlan")return{x:h+u*1.5,width:u*.75}}if(!i&&s&&a){if(e==="score")return{x:h,width:1.5*u};if(e==="withActionPlan")return{x:h+1.5*u,width:1.5*u}}}return{x:t,width:n}},vwe=({registerBarTopY:e,marginFactor:t})=>n=>{const{x:r,width:o,payload:i,y:s}=n,u=VC("withoutActionPlan",typeof r=="number"?r:0,typeof o=="number"?o:0,DC(i),t);return e(i==null?void 0:i.name,s),f.jsx(Xl,{...n,x:u.x,width:u.width})},Cwe=({registerBarTopY:e,marginFactor:t})=>n=>{const{x:r,width:o,payload:i,y:s}=n,u=VC("score",typeof r=="number"?r:0,typeof o=="number"?o:0,DC(i),t);return e(i==null?void 0:i.name,s),f.jsx(Xl,{...n,x:u.x,width:u.width})},bwe=({registerBarTopY:e,marginFactor:t})=>n=>{const{x:r,width:o,payload:i,y:s}=n,u=VC("withActionPlan",typeof r=="number"?r:0,typeof o=="number"?o:0,DC(i),t);return e(i==null?void 0:i.name,s),f.jsx(Xl,{...n,x:u.x,width:u.width,rx:4,ry:4})},ywe=(e,t)=>t&&["fr","fr-FR","fr-CA"].some(r=>t.startsWith(r.split("-")[0]))?`${e} :`:`${e}:`,xwe=e=>{const t=ce(),{label:n,value:r,color:o,dataKey:i,unit:s,language:a,precision:c=0,valueFormatterFn:u=t.numbers.valueFormatterFn}=e;return f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:t.spacing(1)},children:[i==="goal"?f.jsx("div",{style:{minWidth:12,height:2,backgroundColor:o,borderRadius:2}}):f.jsx("div",{style:{minWidth:12,height:12,backgroundColor:o,borderRadius:2}}),f.jsxs(le,{direction:"row",spacing:t.spacing(.5),alignItems:"center",children:[f.jsx(ie,{variant:"small-bold",sx:{lineHeight:"16px"},children:ywe(n,a)}),f.jsx(ie,{variant:"number-small",fontWeight:700,children:u(Number(r),c)}),f.jsx(ie,{variant:"small-medium",color:t.custom.grey[1400],children:s?` ${s}`:""})]})]})},Ju=e=>typeof e=="number"?e:null,wwe=(e,t,n)=>{if(!e||!t||typeof n>"u")return null;const r=e.findIndex(p=>String(p)===String(n));if(r<0)return null;const o=Ju(t[r]);if(o!==null)return o;let i=r-1;for(;i>=0&&Ju(t[i])===null;)i--;let s=r+1;const a=t.length;for(;s<a&&Ju(t[s])===null;)s++;const c=i>=0?Ju(t[i]):null,u=s<a?Ju(t[s]):null;if(c===null||u===null||s===i)return null;const d=(r-i)/(s-i);return c+(u-c)*d},Swe=e=>{const t=ce(),{tooltipProps:n,unit:r,goalName:o,initialName:i,withoutActionPlanName:s,withActionPlanName:a,valueFormatterFn:c=t.numbers.valueFormatterFn,language:u,precision:d,barTopY:p,goalData:h,labels:g,goalColor:m}=e,{active:v,label:C,coordinate:y,payload:x=[]}=n;if(!v||x.length===0||!y)return null;const w=new Set,M=x.filter(L=>{if(L.value===null||L.value===void 0)return!1;const j=L.dataKey;if(typeof j=="string"||typeof j=="number"){if(w.has(j))return!1;w.add(j)}return!0}),S=wwe(g,h,C);if(M.length===0&&typeof S!="number")return null;const T=M.some(L=>L.dataKey==="goal")||typeof S!="number"?M:[...M,{dataKey:"goal",value:S,color:m}],O=L=>{if(typeof L.name=="string")return L.name;const j=L.dataKey;return{goal:o,initial:i,withoutActionPlan:s,withActionPlan:a}[j]||""},P=f.jsxs(le,{direction:"column",spacing:t.spacing(.5),children:[f.jsx(ie,{variant:"h4",children:C}),T.map((L,j)=>{const A=L.color,R=typeof A=="string"?A:"transparent",_=O(L);return!_||L.value===null||L.value===void 0?null:f.jsx(xwe,{label:_,value:L.value,color:R,dataKey:String(L.dataKey),unit:r,language:u,precision:d,valueFormatterFn:c},`${String(L.dataKey??j)}-${j}`)})]}),k=Gu({coordinate:{x:y.x,y:y.y},customY:p,placement:"top"});return f.jsx(K,{sx:k,children:f.jsx(di,{width:"inherit",title:P,placement:"top",arrow:!0,open:!0,sx:Ku(),children:f.jsx("div",{style:{width:1,height:1,visibility:"hidden",pointerEvents:"none"}})})})};function _C(e,t){return typeof e=="string"?e:t}const Mwe=e=>{const t=ce(),{transformedData:n,initialDataset:r,trajectoryDatasets:o,goalDataset:i,chartData:s,unit:a,valueFormatterFn:c=t.numbers.valueFormatterFn,precision:u=0,barTopsRef:d}=e,p=vn.language,h=(P,k)=>{if(typeof P=="string"&&typeof k=="number"){const L=d.current[P];d.current[P]=typeof L=="number"?Math.min(L,k):k}};I.useEffect(()=>{d.current={}},[n,d]);const g=.3,m=vwe({registerBarTopY:h,marginFactor:g}),v=Cwe({registerBarTopY:h,marginFactor:g}),C=bwe({registerBarTopY:h,marginFactor:g}),y=I.useMemo(()=>{var k;const P=(k=o[0])==null?void 0:k.backgroundColor;return typeof P=="string"?P:"transparent"},[o]),x=I.useMemo(()=>{const P=r==null?void 0:r.backgroundColor;return typeof P=="string"?P:"transparent"},[r]),w=I.useMemo(()=>{var k;const P=(k=o[1])==null?void 0:k.backgroundColor;return typeof P=="string"?P:"transparent"},[o]),M=I.useMemo(()=>r!=null&&r.label?String(r.label):"Initial",[r]),S=I.useMemo(()=>i!=null&&i.label?String(i.label):"Goal",[i]),E=I.useMemo(()=>{var P,k;return(P=o[0])!=null&&P.label?String((k=o[0])==null?void 0:k.label):"Without action plan"},[o]),T=I.useMemo(()=>{var P,k;return(P=o[1])!=null&&P.label?String((k=o[1])==null?void 0:k.label):"With action plan"},[o]),O=[4,4,0,0];return f.jsx(fr,{width:"100%",height:"100%",children:f.jsxs(TC,{data:n,margin:{left:10,right:0,top:50,bottom:10},barCategoryGap:"10%",barGap:2,children:[f.jsx(Zi,{strokeDasharray:"4 4",stroke:t.palette.divider,vertical:!1}),f.jsx(yi,{dataKey:"name",tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateY(${t.spacing(2)})`}},axisLine:{stroke:t.palette.divider},tickLine:!1,interval:"equidistantPreserveStart",padding:{left:0,right:0}}),f.jsx(qo,{width:"auto",tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateX(-${t.spacing(1)})`}},axisLine:{stroke:t.palette.divider},tickLine:!1,tickFormatter:P=>c(Number(P)),children:f.jsx(Wo,{value:a,position:"insideTopLeft",style:{fontFamily:"Montserrat",fontSize:"14px",transform:`translate(-${t.spacing(1.75)}, -${t.spacing(6)})`}})}),f.jsx(qa,{cursor:!1,content:P=>{const k=P&&(typeof P.label=="string"||typeof P.label=="number")?String(P.label):void 0,L=k?d.current[k]:void 0,j=i?_C(i.borderColor??i.backgroundColor,t.palette.primary.main):void 0;return f.jsx(Swe,{tooltipProps:P,unit:a,goalName:S,initialName:M,withoutActionPlanName:E,withActionPlanName:T,valueFormatterFn:c,language:p,precision:u,barTopY:L,goalData:i==null?void 0:i.data,labels:s.labels,goalColor:j})}}),f.jsx(zi,{animationBegin:100,animationDuration:200,dataKey:"withoutActionPlan",name:E,fill:y,radius:O,shape:m},"withoutActionPlan"),f.jsx(zi,{animationBegin:0,animationDuration:200,dataKey:"initial",name:M,fill:x,radius:O,shape:v},"initial"),f.jsx(zi,{animationBegin:150,animationDuration:200,dataKey:"withActionPlan",name:T,fill:w,radius:O,shape:C},"withActionPlan"),i?f.jsx(Uu,{animationBegin:400,animationDuration:200,type:"linear",dataKey:"goal",name:S,stroke:_C(i.borderColor??i.backgroundColor,t.palette.primary.main),strokeWidth:2,dot:{fill:_C(i.borderColor??i.backgroundColor,t.palette.primary.main),r:4},connectNulls:!0,strokeDasharray:"0"},"goal"):null]})})},Ewe="100%",Twe="100%",Owe=0,kwe=50,Pwe=1,Lwe=1,jwe=3,Iwe=1,Awe=2,Rwe=e=>{const t=ce(),{unit:n,width:r=Ewe,height:o=Twe,showLegend:i=!0,improvement:s="decrease",urlEditTrajectories:a,valueFormatterFn:c=t.numbers.valueFormatterFn,precision:u=Owe,textOptions:d,forceGoalLegend:p,...h}=e,g=fwe(h),m=I.useRef(null),v=I.useRef({}),C=I.useMemo(()=>{const S=[];return g.labels.forEach((E,T)=>{const O={name:E};let P=0,k=!1;g.datasets.forEach(L=>{if(L.scope==="goal"&&L.isGoalNull)return;const j=L.data[T]??null,A=typeof j=="number"?j:null;A!==null&&(k=!0,L.scope==="goal"?O.goal=A:L.scope==="initial"?O.initial=A:L.scope==="trajectory"&&(P++,P===Iwe?O.withoutActionPlan=A:P===Awe&&(O.withActionPlan=A)))}),k&&S.push(O)}),S},[g.datasets,g.labels]),y=I.useMemo(()=>g.datasets.filter(S=>S.scope==="goal"&&S.isGoalNull&&!p?!1:S.scope==="trajectory"?S.data.some(T=>T!==null):!0),[g.datasets,p]),x=I.useMemo(()=>y.find(S=>S.scope==="initial"),[y]),w=I.useMemo(()=>y.filter(S=>S.scope==="trajectory"),[y]),M=I.useMemo(()=>y.find(S=>S.scope==="goal"),[y]);return f.jsxs(le,{direction:"column",position:"relative",width:r,height:o,minHeight:t.spacing(kwe),justifyContent:"stretch",sx:{"& *":{outline:"none"}},children:[f.jsx(K,{sx:{border:`${Pwe}px solid ${t.palette.divider}`,backgroundColor:t.palette.background.paper,borderRadius:t.spacing(Lwe),height:"100%",width:"100%",padding:t.spacing(jwe)},ref:m,children:f.jsx(Mwe,{transformedData:C,initialDataset:x,trajectoryDatasets:w,goalDataset:M,chartData:g,unit:n,valueFormatterFn:c,precision:u,barTopsRef:v})}),i&&f.jsx(mwe,{datasets:g.datasets,datasetsLabels:g.labels,improvement:s,urlEditTrajectories:a,textOptions:d})]})},eN=e=>{var V,H,X,Q;const{x:t,width:n,chartHeight:r,index:o,data:i,unit:s,chartWidth:a,options:c,language:u,precision:d,improvementType:p="increase"}=e,h={minWidth:80,textBaseSize:4,unitBaseSize:6,iconBaseSize:40,padding:10,boxHeight:90,minTextSize:.9,minUnitSize:.7,...c},g=ce(),m=i[o];if(!m.withComparison||!m.comparisonValue)return null;const v=m.comparisonValue>=0,C=p==="decrease"?!v:v,y=100/i.length,x=a||500,w=Number(n)*2,M=y*x/100-w/1.25,S=Math.max(`${v?"+":""}${Intl.NumberFormat(u,{notation:"standard",maximumFractionDigits:d}).format(Number(m.comparisonValue))}`.length*h.textBaseSize+s.length*h.unitBaseSize+h.iconBaseSize,h.minWidth),E=M<S?"compact":"standard",T=`${v?"+":""}${Intl.NumberFormat(u,{notation:E,maximumFractionDigits:d}).format(Number(m.comparisonValue))}`,O=M/S,P=Math.min(S,M),k=M<S?M+Number(n)/4:S+Number(n)/4,L=k-4,j=k,A=k-4,R=k,_=Number(n)/4,N=h.boxHeight,z=Number(t)+Number(n)/2+y*x/100/2-P/2+15,B=r-N*2-16,$=()=>f.jsxs("g",{children:[f.jsx("line",{transform:`translate(0, ${N/2})`,x1:-_,y1:0,x2:k,y2:0,stroke:"#e0e0e0",strokeWidth:"1"}),f.jsx("line",{transform:`translate(0, ${N/2})`,x1:L,y1:-4,x2:j,y2:0,stroke:"#e0e0e0",strokeWidth:"1"}),f.jsx("line",{transform:`translate(0, ${N/2})`,x1:A,y1:4,x2:R,y2:0,stroke:"#e0e0e0",strokeWidth:"1"})]});return f.jsxs("g",{transform:`translate(${z}, ${B})`,children:[f.jsx($,{}),f.jsx("foreignObject",{x:0,y:0,width:P,height:N,children:f.jsxs(K,{sx:{width:"100%",height:"100%",backgroundColor:"#ffffff",border:"1px solid #e0e0e0",borderRadius:"8px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",padding:`${h.padding}px`,boxSizing:"border-box",gap:"2px"},children:[f.jsx(Ct,{icon:C?"circleCheck":"inProgress",size:2,backgroundColor:C?((H=c==null?void 0:c.iconColorNegative)==null?void 0:H.background)||g.custom.dataviz.colorsWithExtra[7].variant[100]:((V=c==null?void 0:c.iconColorPositive)==null?void 0:V.background)||g.custom.dataviz.colorsWithExtra[12].variant[100],color:C?((Q=c==null?void 0:c.iconColorNegative)==null?void 0:Q.foreground)||g.custom.dataviz.colorsWithExtra[7].variant[700]:((X=c==null?void 0:c.iconColorPositive)==null?void 0:X.foreground)||g.custom.dataviz.colorsWithExtra[12].variant[700]}),f.jsxs(le,{direction:"column",alignItems:"center",spacing:g.spacing(.5),children:[f.jsx(ie,{variant:"number-small",sx:{lineHeight:`${g.spacing(2)}`,fontSize:O<1?`clamp(${h.minTextSize}rem, ${O*.9}rem, 1rem)`:void 0},children:T}),f.jsx(ie,{variant:"small-medium",sx:{color:g.custom.grey[2e3],textAlign:"center",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",lineHeight:`${g.spacing(2)}`,fontSize:O<1?`clamp(${h.minUnitSize}rem, ${O*.8}rem, 0.875rem)`:void 0},children:s})]})]})})]})},tN=e=>{const{x:t,y:n,width:r,value:o,unit:i,options:s,precision:a,language:c,valuesFormatterFn:u}=e,d={valueOffsetY:30,unitOffsetY:17.5,valueFontSize:16,unitFontSize:12,valueColor:"#000",unitColor:"#666",...s},p=Number(t)+Number(r)/2,h=Number(n)-d.valueOffsetY;return f.jsxs("g",{children:[f.jsx("text",{x:p,y:h,textAnchor:"middle",fill:d.valueColor,fontSize:d.valueFontSize,fontWeight:"bold",children:u?u(Number(o)):a!==void 0?Number(o).toFixed(a):Number(o).toLocaleString(c)}),f.jsx("text",{x:p,y:h+d.unitOffsetY,textAnchor:"middle",fill:d.unitColor,fontSize:d.unitFontSize,children:i})]})},nN=e=>{const{x:t,y:n,payload:r,fontColor:o}=e,i=ce();return f.jsx("g",{transform:`translate(${t},${n})`,children:f.jsx("foreignObject",{x:-50,y:0,width:100,height:100,children:f.jsx(ie,{sx:{textAlign:"center",paddingTop:"0px",color:o||i.custom.grey[2e3]},children:r.value})})})},Dwe=300,Vwe=0,_we=[4,4,0,0],Nwe=50,Hwe=1,$we=60,Fwe=-50,Bwe=-50,zwe=40,Zwe=200,Wwe=0,Uwe="5 5",qwe="0",Gwe=e=>{const t=ce(),n=vn.language,{data:r,unit:o,valuesFormatterFn:i=t.numbers.valueFormatterFn,chartStyling:s,comparisonLabelOptions:a,valueLabelOptions:c,precision:u,chartWidth:d,chartHeight:p,displayComparisonLabel:h=!0,improvementType:g}=e,v={...{barRadius:_we,barMaxWidth:Nwe,barColor:t.custom.dataviz.colorsWithExtra[12].variant[100],barStroke:t.custom.dataviz.colorsWithExtra[12].variant[700],barStrokeWidth:Hwe,height:p||Dwe,margin:{top:$we,right:Fwe,left:Bwe,bottom:zwe}},...s},[C,y]=I.useState(d||Vwe),x=I.useRef(null);I.useEffect(()=>{const M=()=>{x.current&&y(x.current.offsetWidth)};return M(),window.addEventListener("resize",M),()=>window.removeEventListener("resize",M)},[]);const w=r.map((M,S)=>M.withComparison&&S<r.length-1?{...M,comparisonValue:r[S+1].value-M.value}:M);return f.jsx(K,{sx:{position:"relative","& *":{outline:"none"}},children:f.jsx(fr,{width:"100%",height:v.height,ref:x,children:f.jsx(Kf,{data:w,margin:v.margin,children:f.jsxs(zi,{dataKey:"value",radius:v.barRadius,maxBarSize:v.barMaxWidth,style:{outline:"none"},animationDuration:Zwe,animationBegin:Wwe,children:[f.jsx(yi,{dataKey:"label",tickLine:!1,axisLine:!0,tick:M=>f.jsx(nN,{...M})}),f.jsx(qo,{hide:!0}),h&&f.jsx(Ga,{dataKey:"comparisonValue",content:f.jsx(eN,{unit:o,data:w,chartWidth:C,options:a,precision:u,language:n,improvementType:g,chartHeight:p})}),f.jsx(Ga,{dataKey:"value",content:f.jsx(tN,{unit:o,options:c,precision:u,language:n,valuesFormatterFn:i})}),w.map((M,S)=>f.jsx(yo,{fill:v.barColor,stroke:v.barStroke,strokeWidth:v.barStrokeWidth,strokeDasharray:M.shape==="dotted"?Uwe:qwe},`cell-${S}`))]})})})})},NC=e=>{const{active:t,hoveredIndex:n,data:r,coordinate:o,formatter:i,unit:s,icons:a}=e,c=ce();if(!t||n===null||!o||!r[n])return null;const u=r[n],d=i?i(u.value,0):c.numbers.valueFormatterFn(u.value,0),p=f.jsxs(le,{sx:{pointerEvents:"none"},direction:"column",alignItems:"flex-start",justifyContent:"center",spacing:c.spacing(1),children:[f.jsxs(le,{direction:"row",alignItems:"center",spacing:c.spacing(1),children:[a&&n!==void 0&&a[n]?f.jsx(K,{minWidth:"24px",width:"24px",height:"24px",sx:{background:u.color,padding:"4px",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"3px"},children:a[n]}):f.jsx(K,{sx:{width:"12px",height:"12px",borderRadius:"3px",backgroundColor:u.color}}),f.jsx(ie,{variant:"h6",children:u.name})]}),f.jsxs(le,{direction:"row",alignItems:"flex-end",spacing:.5,children:[f.jsx(ie,{variant:"number-inter",sx:{p:0,m:0,lineHeight:c.spacing(4)},children:d}),s&&f.jsx(ie,{variant:"small-bold",color:c.custom.grey[1400],children:s})]})]}),h=Gu({coordinate:{x:o.x,y:o.y},placement:"top"});return f.jsx(K,{sx:{...h,zIndex:2e3,pointerEvents:"none"},children:f.jsx(di,{width:"max-content",title:p,disableInteractive:!0,placement:"top",arrow:!0,open:!0,popperZIndex:0,sx:Ku(),children:f.jsx("div",{style:{width:1,height:1,visibility:"hidden",pointerEvents:"none"}})})})},Kwe=300,Ywe=300,Xwe=.4,Jwe="0.2s",Xa=4,Qwe=2,HC={top:35,right:10,left:20,bottom:0},eSe=e=>{const t=ce(),{data:n,HoveredChartElementIndex:r,showTooltip:o,valuesFormatterFn:i=(S,E)=>t.numbers.valueFormatterFn(S,E),valuesUnit:s,icons:a,isLoading:c,height:u,onMouseEnter:d,onMouseLeave:p,onLegendAction:h}=e,g=typeof u=="number"?u:Kwe,m=I.useRef([]),v=I.useRef([]),C=I.useRef([]),[y,x]=I.useState(!1),w=!y;if(c){const S=Math.max(4,(n==null?void 0:n.length)??6),E=Array.from({length:S}).map((O,P)=>({name:`${P}`,value:Math.random()*100})),T=t.palette.action.hover;return f.jsx(K,{position:"relative",width:"100%",height:g,sx:{"@keyframes pulse":{"0%":{opacity:.2},"50%":{opacity:1},"100%":{opacity:.2}}},children:f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(Kf,{data:E,margin:HC,children:[f.jsx(Zi,{strokeDasharray:"4 4",stroke:t.palette.divider,vertical:!1}),f.jsx(yi,{dataKey:"name",tick:!1,axisLine:{stroke:t.palette.divider},tickLine:!1}),f.jsx(qo,{hide:!0,domain:[0,100]}),f.jsx(zi,{dataKey:"value",isAnimationActive:!1,style:{pointerEvents:"none"},radius:[Xa,Xa,0,0],children:E.map((O,P)=>f.jsx(yo,{fill:T,style:{animation:"pulse 1.5s ease-in-out infinite"}},`sk-${P}`))})]})})})}return((n==null?void 0:n.length)??0)===0||n.every(S=>Number(S.value)===0)?f.jsxs(K,{position:"relative",width:"100%",height:g,children:[f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(Kf,{data:[{name:"empty",value:1}],margin:HC,children:[f.jsx(Zi,{strokeDasharray:"4 4",stroke:t.palette.divider,vertical:!1}),f.jsx(yi,{dataKey:"name",tick:!1,axisLine:{stroke:t.palette.divider},tickLine:!1}),f.jsx(qo,{hide:!0,domain:[0,1]}),f.jsx(zi,{dataKey:"value",isAnimationActive:!1,radius:[Xa,Xa,0,0],style:{pointerEvents:"none"},children:f.jsx(yo,{fill:"rgba(0, 0, 0, 0)"})})]})}),f.jsx(po,{size:4,icon:"empty",boxProps:{sx:{borderRadius:"3px",backgroundColor:t.custom.grey[400],color:t.custom.grey[1400],position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}})]}):f.jsxs(K,{position:"relative",width:"100%",height:g,children:[f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(Kf,{data:n,margin:HC,children:[f.jsx(yi,{dataKey:"name",strokeDasharray:"4 4",strokeWidth:0,tick:!1,axisLine:{stroke:t.palette.divider},tickLine:!1,interval:"equidistantPreserveStart",padding:{left:0,right:0}}),f.jsx(qo,{width:"auto",tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateX(-${t.spacing(1)})`}},axisLine:{stroke:t.palette.divider},tickLine:!1,tickFormatter:S=>i(Number(S)),children:f.jsx(Wo,{value:s,position:"insideTopLeft",style:{fontFamily:"Montserrat",fontSize:"14px",transform:`translate(-${t.spacing(1.5)}, -${t.spacing(5)})`}})}),f.jsx(Zi,{strokeDasharray:"4 4",stroke:t.palette.divider,vertical:!1}),f.jsx(zi,{dataKey:"value",radius:[Xa,Xa,0,0],animationDuration:Ywe,isAnimationActive:w,onAnimationEnd:()=>x(!0),onClick:(S,E)=>{h&&h(E)},style:{cursor:"pointer"},shape:S=>{const E=S,{x:T,y:O,width:P,height:k,payload:L}=E,j=(L==null?void 0:L.index)??0;typeof T=="number"&&typeof P=="number"&&(m.current[j]=T+P/2),typeof O=="number"&&(v.current[j]=O),typeof k=="number"&&(C.current[j]=k);const A=(L==null?void 0:L.color)??t.palette.primary.main,R=r===j,_=r===null||R?A:bt(A).alpha(Xwe).css();return f.jsx(Xl,{x:T,y:O,width:P,height:k,radius:[Xa,Xa,0,0],fill:_,stroke:E.stroke,strokeWidth:E.strokeWidth,style:{transition:`all ${Jwe} ease-in-out`,filter:R?`drop-shadow(0 0 ${Qwe}px ${A})`:"none"},onMouseEnter:R?void 0:()=>d(j),onMouseLeave:()=>p()})}})]})}),o&&r!==null&&(()=>{const S=m.current[r],E=v.current[r],T=C.current[r],O=typeof E=="number"&&typeof T=="number"?E:g/2;return typeof S!="number"||typeof O!="number"?null:f.jsx(NC,{active:!0,hoveredIndex:r,data:n.map((P,k)=>({...P,index:k})),coordinate:{x:S,y:O},formatter:i,unit:s,icons:a})})()]})},tSe=300,nSe=300,rSe=.4,oSe="0.2s",iSe=6,rN=3,$C={top:35,right:10,left:20,bottom:0},sSe=2,aSe=e=>{const t=ce(),{data:n,HoveredChartElementIndex:r,showTooltip:o,valuesFormatterFn:i=(S,E)=>t.numbers.valueFormatterFn(S,E),valuesUnit:s,icons:a,isLoading:c,height:u,onMouseEnter:d,onMouseLeave:p,onLegendAction:h}=e,g=typeof u=="number"?u:tSe,m=n.length>0?n[0].color:t.palette.primary.main,v=I.useRef([]),[C,y]=I.useState(!1),x=!C,w=t.palette.primary.main;if(c){const S=Math.max(5,Math.min(9,(n==null?void 0:n.length)||7)),E=Array.from({length:S}).map((O,P)=>({name:`${P}`,value:Math.random()*100})),T=t.palette.action.hover;return f.jsx(K,{position:"relative",width:"100%",height:g,sx:{"@keyframes pulse":{"0%":{opacity:.2},"50%":{opacity:1},"100%":{opacity:.2}}},children:f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(SC,{data:E,margin:$C,children:[f.jsx(Zi,{strokeDasharray:"4 4",stroke:t.palette.divider,vertical:!1}),f.jsx(yi,{dataKey:"name",tick:!1,axisLine:{stroke:t.palette.divider},tickLine:!1}),f.jsx(qo,{hide:!0,domain:[0,100]}),f.jsx(qa,{cursor:!1,wrapperStyle:{display:"none"},isAnimationActive:!1}),f.jsx(Uu,{type:"monotone",dataKey:"value",stroke:T,strokeWidth:rN,dot:{r:5,stroke:T,fill:T},isAnimationActive:!1,style:{pointerEvents:"none",animation:"pulse 1.5s ease-in-out infinite"}})]})})})}return((n==null?void 0:n.length)??0)===0||n.every(S=>Number(S.value)===0)?f.jsxs(K,{position:"relative",width:"100%",height:g,children:[f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(SC,{data:[{name:"e1",value:1},{name:"e2",value:1}],margin:$C,children:[f.jsx(Zi,{strokeDasharray:"4 4",stroke:t.palette.divider,vertical:!1}),f.jsx(yi,{dataKey:"name",tick:!1,axisLine:{stroke:t.palette.divider},tickLine:!1}),f.jsx(qo,{hide:!0,domain:[0,1]}),f.jsx(qa,{cursor:!1,wrapperStyle:{display:"none"},isAnimationActive:!1}),f.jsx(Uu,{type:"monotone",dataKey:"value",strokeWidth:0,dot:!1,isAnimationActive:!1,style:{pointerEvents:"none"}})]})}),f.jsx(po,{size:4,icon:"empty",boxProps:{sx:{borderRadius:"3px",backgroundColor:t.custom.grey[400],color:t.custom.grey[1400],position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}})]}):f.jsxs(K,{position:"relative",width:"100%",height:g,children:[f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(SC,{data:n,margin:$C,children:[f.jsx(Zi,{strokeDasharray:"4 4",stroke:t.palette.divider,vertical:!1}),f.jsx(yi,{dataKey:"name",strokeDasharray:"4 4",strokeWidth:0,tick:!1,axisLine:{stroke:t.palette.divider},interval:"equidistantPreserveStart",padding:{left:0,right:0}}),f.jsx(qo,{width:"auto",tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateX(-${t.spacing(1)})`}},axisLine:{stroke:t.palette.divider},tickLine:!1,tickFormatter:S=>i(Number(S)),children:f.jsx(Wo,{value:s,position:"insideTopLeft",style:{fontFamily:"Montserrat",fontSize:"14px",transform:`translate(-${t.spacing(1.5)}, -${t.spacing(5)})`}})}),f.jsx(Uu,{type:"monotone",dataKey:"value",stroke:w,strokeWidth:rN,animationDuration:nSe,isAnimationActive:x,onAnimationEnd:()=>y(!0),dot:S=>{const{cx:E,cy:T,payload:O,index:P}=S,k=typeof(O==null?void 0:O.index)=="number"?O.index:0,L=typeof P=="number"?P:k;typeof E=="number"&&typeof T=="number"&&(v.current[L]={x:E,y:T});const j=r===L,A=(O==null?void 0:O.color)||m,R=r===null||j?A:bt(A).alpha(rSe).css();return f.jsx("g",{children:f.jsx("circle",{cx:E,cy:T,r:iSe,fill:R,stroke:R,strokeWidth:0,onMouseEnter:()=>d(L),onMouseLeave:()=>p(),style:{cursor:"pointer",transition:`all ${oSe} ease-in-out`,filter:j?`drop-shadow(0 0 ${sSe}px ${A})`:"none"}})})},activeDot:!1}),f.jsx(qa,{cursor:!1,wrapperStyle:{display:"none"},isAnimationActive:!1})]})}),o&&r!==null&&(()=>{const S=r,E=v.current[S];return E?f.jsx(NC,{active:!0,hoveredIndex:S,data:n.map((T,O)=>({...T,index:O})),coordinate:{x:E.x,y:E.y},formatter:i,unit:s,icons:a}):null})()]})},lSe=300,p2="100%",FC="50%",BC="50%",Si={top:20,right:30,left:20,bottom:20},cSe=300,uSe=0,dSe=.4,fSe=2,pSe="0.2s",oN=.08,iN=4,e4=10,hSe=e=>{var N,z,B;const t=ce(),{data:n,HoveredChartElementIndex:r,spacing:o,borderWidth:i,borderColor:s,showTooltip:a,tooltipPos:c,valuesFormatterFn:u=($,V)=>t.numbers.valueFormatterFn($,V),language:d,valuesUnit:p,icons:h,isLoading:g,height:m,onMouseEnter:v,onMouseLeave:C,onLegendAction:y}=e,x=typeof m=="number"?m:lSe,w=I.useRef(null),M=I.useMemo(()=>$=>u?u($,0):t.numbers.valueFormatterFn($,0),[u,t]),S=I.useMemo(()=>{var F;const $=(n==null?void 0:n.length)??0;if($===0||$>32)return!1;const V=(F=w.current)==null?void 0:F.getBoundingClientRect(),H=(V==null?void 0:V.width)??300,X=(V==null?void 0:V.height)??x,Q=Math.max(0,H-Si.left-Si.right),ne=Math.max(0,X-Si.top-Si.bottom),q=Math.min(Q,ne),J=p2.endsWith("%")?Number(p2.replace("%",""))/100:1,te=q/2*J;return 2*Math.PI*te/$>=18},[n==null?void 0:n.length,x]),[E,T]=I.useState(void 0),[O,P]=I.useState(!1),k=!O,L=I.useCallback(($,V)=>{if($&&typeof $.cx=="number"&&typeof $.cy=="number"&&typeof $.midAngle=="number"&&typeof $.outerRadius=="number"){const H=bk($.cx,$.cy,$.midAngle,$.outerRadius);T(H)}v($,V)},[v]),j=I.useCallback(()=>{T(void 0),C()},[C]),A=$=>{const{cx:V=0,cy:H=0,midAngle:X=0,innerRadius:Q=0,outerRadius:ne=0,percent:q=0,value:J=0,payload:te}=$;if(!isFinite(Number(q)))return null;const Y=Math.PI/180,Z=Number(q)<oN,F=-Number(X)*Y,G=Number(Q),D=Number(ne),ee=Number(V),oe=Number(H),se=G+(D-G)*.8,ue=Math.cos(F),re=Math.sin(F),he=se*ue+ee,pe=se*re+oe;let be=he,Se=pe,Ce="middle";if(Z){const ye=ee+(D+e4)*ue,Ie=oe+(D+e4)*re;be=ye+(ue>=0?8:-8)+(ue>=0?6:-6),Se=Ie,Ce=ue>=0?"start":"end"}const Ze=`${M(Number(J))}`,Ge=te==null?void 0:te.color,ve=bt(Ge??t.palette.text.primary).luminance()<.5?t.palette.common.white:t.palette.text.primary;return f.jsx("text",{x:be,y:Se,textAnchor:Ce,dominantBaseline:"middle",fontFamily:"Montserrat",fontWeight:600,fontSize:14,fill:Z?t.palette.text.primary:ve,style:{pointerEvents:"none"},children:Ze})},R=$=>{const{cx:V=0,cy:H=0,midAngle:X=0,outerRadius:Q=0,percent:ne=0}=$,q=Math.PI/180;if(!isFinite(Number(ne))||Number(ne)>=oN)return f.jsx("g",{});const J=-Number(X)*q,te=Number(V),Y=Number(H),Z=Number(Q),F=Math.cos(J),G=Math.sin(J),D=te+(Z+iN)*F,ee=Y+(Z+iN)*G,oe=te+(Z+e4)*F,se=Y+(Z+e4)*G,ue=oe+(F>=0?8:-8),re=se;return f.jsx("path",{d:`M${D},${ee} L${oe},${se} L${ue},${re}`,stroke:t.palette.text.secondary,fill:"none",style:{pointerEvents:"none"}})},_=I.useMemo(()=>{var ee;if(!c||c.angle===void 0)return;const $=(ee=w.current)==null?void 0:ee.getBoundingClientRect(),V=($==null?void 0:$.width)??300,H=($==null?void 0:$.height)??x,X=Math.max(0,V-Si.left-Si.right),Q=Math.max(0,H-Si.top-Si.bottom),ne=Math.min(X,Q),q=p2.endsWith("%")?Number(p2.replace("%",""))/100:1,J=ne/2*q,te=Math.PI/180,Y=c.angle,Z=Si.left+X/2,F=Si.top+Q/2,G=Z+J*Math.cos(-te*Y),D=F+J*Math.sin(-te*Y);return{x:G,y:D,angle:Y}},[c,x]);if(g){const $=t.palette.action.hover;return f.jsx(K,{position:"relative",width:"100%",height:x,sx:{"@keyframes pulse":{"0%":{opacity:.2},"50%":{opacity:1},"100%":{opacity:.2}}},children:f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsx(Yf,{margin:Si,children:f.jsx(l2,{data:[{name:"loading",value:1}],cx:FC,cy:BC,outerRadius:p2,dataKey:"value",isAnimationActive:!1,stroke:"none",style:{pointerEvents:"none"},children:f.jsx(yo,{fill:$,style:{animation:"pulse 1.5s ease-in-out infinite"}})})})})})}return f.jsxs(K,{position:"relative",width:"100%",height:x,ref:w,children:[f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(Yf,{margin:Si,onMouseLeave:j,children:[f.jsx(l2,{data:n,cx:FC,cy:BC,outerRadius:p2,paddingAngle:o,dataKey:"value",minAngle:.5,isAnimationActive:k,animationDuration:cSe,animationBegin:uSe,onAnimationEnd:()=>P(!0),onMouseEnter:L,onMouseLeave:j,onClick:($,V)=>{y&&y(V)},stroke:"none",style:{outline:"none"},label:S?A:void 0,labelLine:S?R:!1,children:n.map(($,V)=>{const H=r===V,X=r===null||H?$.color:bt($.color).alpha(dSe).css();return f.jsx(yo,{fill:X,strokeWidth:i,stroke:s,style:{filter:H?`drop-shadow(0 0 ${fSe}px ${$.color})`:"none",cursor:"pointer",transition:`all ${pSe} ease-in-out`},className:H?"cell-hovered":"cell-idle"},`cell-${V}`)})}),(n.length===0||n.every($=>$.value===0))&&f.jsx(l2,{data:[{name:"empty",value:1}],cx:FC,cy:BC,outerRadius:p2,dataKey:"value",isAnimationActive:!1,stroke:"none",style:{pointerEvents:"none"},children:f.jsx(yo,{fill:t.palette.action.hover})})]})}),a&&f.jsx(N_,{active:r!==null,payload:r!==null?[{name:((N=n[r])==null?void 0:N.name)??"",value:((z=n[r])==null?void 0:z.value)??0,color:((B=n[r])==null?void 0:B.color)??"",payload:n[r]||{}}]:[],formatter:u,language:d,unit:p,coordinate:(c?_:void 0)??E,icons:h}),(n.length===0||n.every($=>$.value===0))&&f.jsx(po,{size:4,icon:"empty",boxProps:{sx:{borderRadius:"3px",backgroundColor:t.custom.grey[400],color:t.custom.grey[1400],position:"absolute",border:`1px solid ${t.custom.grey[700]}`,top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}})]})},gSe=300,mSe=300,vSe=.4,CSe="0.2s",bSe=.2,sN=2,ySe=6,xSe=2,wSe=e=>{const t=ce(),{data:n,HoveredChartElementIndex:r,showTooltip:o,valuesFormatterFn:i,valuesUnit:s,icons:a,isLoading:c,height:u,onMouseEnter:d,onMouseLeave:p,onLegendAction:h}=e,g=t.palette.primary.main,m=typeof u=="number"?u:gSe,v=I.useRef(`radar-${Math.random().toString(36).slice(2)}`),C=`${v.current}-stroke`,y=`${v.current}-fill`,x=I.useRef([]),w=I.useRef(null),[M,S]=I.useState(!1),E=!M;if(c){const O=t.palette.action.hover,P=[{name:"A",value:Math.random()*100},{name:"B",value:Math.random()*100},{name:"C",value:Math.random()*100},{name:"D",value:Math.random()*100},{name:"E",value:Math.random()*100}];return f.jsx(K,{position:"relative",width:"100%",height:m,sx:{"@keyframes pulse":{"0%":{opacity:.2},"50%":{opacity:1},"100%":{opacity:.2}}},children:f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(EC,{data:P,margin:{top:20,right:50,left:50,bottom:5},outerRadius:"85%",innerRadius:"0%",children:[f.jsx(Of,{stroke:t.palette.divider,gridType:"circle"}),f.jsx(Bu,{dataKey:"value",stroke:O,fill:O,strokeWidth:sN,fillOpacity:.25,isAnimationActive:!1,activeDot:!1,style:{pointerEvents:"none",animation:"pulse 1.5s ease-in-out infinite"}}),f.jsx(qa,{cursor:!1,wrapperStyle:{display:"none"},isAnimationActive:!1})]})})})}if(((n==null?void 0:n.length)??0)===0||n.every(O=>Number(O.value)===0)){const O=[{name:"A",value:1},{name:"B",value:1},{name:"C",value:1},{name:"D",value:1},{name:"E",value:1}],P=t.palette.primary[50]||g;return f.jsxs(K,{position:"relative",width:"100%",height:m,children:[f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(EC,{data:O,margin:{top:20,right:50,left:50,bottom:5},outerRadius:"85%",innerRadius:"0%",children:[f.jsx(Of,{stroke:t.palette.divider,gridType:"circle"}),f.jsx(Bu,{dataKey:"value",stroke:P,fill:P,fillOpacity:0,isAnimationActive:!1,activeDot:!1,style:{pointerEvents:"none"}}),f.jsx(qa,{cursor:!1,wrapperStyle:{display:"none"},isAnimationActive:!1})]})}),f.jsx(po,{size:4,icon:"empty",boxProps:{sx:{borderRadius:"3px",backgroundColor:t.custom.grey[400],color:t.custom.grey[1400],position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}})]})}return f.jsxs(K,{position:"relative",width:"100%",height:m,children:[f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(EC,{data:n,margin:{top:20,right:50,left:50,bottom:5},outerRadius:"85%",innerRadius:"0%",accessibilityLayer:!0,children:[f.jsxs("defs",{children:[f.jsxs("linearGradient",{id:C,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[f.jsx("stop",{offset:"0%",stopColor:g}),f.jsx("stop",{offset:"100%",stopColor:g})]}),f.jsxs("linearGradient",{id:y,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[f.jsx("stop",{offset:"0%",stopColor:g}),f.jsx("stop",{offset:"100%",stopColor:g})]})]}),f.jsx(Of,{stroke:t.palette.divider,gridType:"circle"}),f.jsx(Pf,{angle:90,domain:[0,"dataMax"],tick:{fontSize:10,fill:t.palette.text.secondary},tickFormatter:O=>i?i(O):O.toString()}),f.jsx(Bu,{dataKey:"value",stroke:`url(#${C})`,fill:`url(#${y})`,strokeWidth:sN,fillOpacity:bSe,animationDuration:mSe,isAnimationActive:E,onAnimationEnd:()=>S(!0),activeDot:!1,dot:O=>{const{cx:P,cy:k,payload:L,index:j}=O,A=typeof j=="number"?j:typeof(L==null?void 0:L.index)=="number"?L.index:0;typeof P=="number"&&typeof k=="number"&&(x.current[A]={x:P,y:k});const R=r===A,_=r===null||R?n[A].color:bt(n[A].color).alpha(vSe).css();return f.jsx("g",{children:f.jsx("circle",{cx:P,cy:k,r:ySe,fill:_,stroke:_,strokeWidth:0,style:{cursor:"pointer",transition:`all ${CSe} ease-in-out`,pointerEvents:"auto",filter:R?`drop-shadow(0 0 ${xSe}px ${_})`:"none"},onMouseEnter:()=>d(A),onMouseLeave:()=>p()})})}}),f.jsx(qa,{cursor:!1,wrapperStyle:{display:"none"},isAnimationActive:!1})]})}),o&&r!==null&&(()=>{const O=r,P=w.current||x.current[O];return P?f.jsx(NC,{active:!0,hoveredIndex:O,data:n.map((k,L)=>({...k,index:L})),coordinate:{x:P.x,y:P.y},formatter:i,unit:s,icons:a}):null})()]})},SSe=e=>{const t=ce(),{data:n,valuesFormatterFn:r=(d,p)=>t.numbers.valueFormatterFn(d,p),valuesUnit:o,icons:i,isLoading:s,onLegendAction:a}=e,c=d=>{a&&a(d)};if(s){const d=Math.max(4,Math.min(8,(n==null?void 0:n.length)||6));return f.jsx(K,{position:"relative",width:"100%",sx:{border:`1px solid ${t.palette.divider}`,borderRadius:t.shape.borderRadius},children:f.jsx(w6,{sx:{borderRadius:t.shape.borderRadius},children:f.jsx(I1,{children:f.jsx(Vl,{children:Array.from({length:d}).map((p,h)=>f.jsxs(Ra,{sx:{backgroundColor:h%2===0?"rgba(255, 255, 255, 0.4)":`${t.palette.action.hover}`},children:[f.jsx(Vi,{sx:{padding:t.spacing(1.5),border:"none"},children:f.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:t.spacing(2)},children:[f.jsx(Dl,{variant:"rounded",width:32,height:32}),f.jsx(Dl,{variant:"rounded",width:"60%",height:18})]})}),f.jsx(Vi,{align:"right",sx:{border:"none"},children:f.jsx(Dl,{variant:"rounded",width:80,height:18,sx:{ml:"auto"}})})]},`sk-row-${h}`))})})})})}return((n==null?void 0:n.length)??0)===0||n.every(d=>Number(d.value)===0)?f.jsx(K,{position:"relative",width:"100%",children:f.jsx(w6,{sx:{borderRadius:t.shape.borderRadius,border:`1px solid ${t.palette.divider}`},children:f.jsx(I1,{children:f.jsx(Vl,{children:f.jsxs(Ra,{sx:{backgroundColor:t.palette.background.paper},children:[f.jsx(Vi,{sx:{padding:t.spacing(1.5),border:"none"},children:f.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:t.spacing(2)},children:[f.jsx(K,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:"16px",height:"16px",borderRadius:"6px",backgroundColor:t.palette.primary[50]||t.palette.action.hover}}),f.jsx(po,{size:4,icon:"empty",boxProps:{sx:{borderRadius:"3px",backgroundColor:t.custom.grey[400],color:t.custom.grey[1400]}}})]})}),f.jsx(Vi,{align:"right",sx:{color:t.palette.text.secondary,border:"none"},children:"—"})]})})})})}):f.jsx(K,{position:"relative",width:"100%",children:f.jsx(w6,{sx:{borderRadius:t.shape.borderRadius,border:`1px solid ${t.palette.divider}`},children:f.jsx(I1,{children:f.jsx(Vl,{children:n.map((d,p)=>{const h=i==null?void 0:i[p];return f.jsxs(Ra,{onClick:()=>c(p),sx:{backgroundColor:`${p%2===0?t.palette.background.paper:t.palette.action.hover}`},children:[f.jsx(Vi,{sx:{padding:t.spacing(1.5),border:"none"},children:f.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:t.spacing(2)},children:[h?f.jsx(K,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:"32px",height:"32px",padding:"4px",borderRadius:"6px",backgroundColor:d.color,color:t.palette.common.white},children:h}):f.jsx(K,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:"32px",height:"32px"},children:f.jsx(K,{sx:{width:"16px",height:"16px",borderRadius:"4px",backgroundColor:d.color,color:t.palette.common.white}})}),f.jsx(K,{sx:{flexGrow:1,color:t.palette.text.primary,fontWeight:500},children:d.name||`Category ${p+1}`})]})}),f.jsxs(Vi,{align:"right",sx:{color:t.palette.text.primary,border:"none"},children:[f.jsx(K,{component:"span",sx:{fontWeight:500},children:r?r(d.value):d.value}),o&&f.jsx(K,{component:"span",sx:{ml:.5,color:t.palette.text.secondary,fontSize:"0.875em"},children:o})]})]},`table-row-${p}`)})})})})})},MSe=e=>{const t=ce(),{data:n,valuesFormatterFn:r=(d,p)=>t.numbers.valueFormatterFn(d,p),isLoading:o,maxScore:i,separator:s="/"}=e,{sumVal:a,sumMax:c}=I.useMemo(()=>{const d=n.reduce((h,g)=>h+(Number(g.value)||0),0),p=Array.isArray(i)?i.reduce((h,g)=>h+(Number(g)||0),0):typeof i=="number"?i:void 0;return{sumVal:d,sumMax:p}},[n,i]),u=((n==null?void 0:n.length)??0)===0||n.every(d=>Number(d.value)===0);if(o){const d=t.palette.action.hover;return f.jsx(K,{position:"relative",width:"100%",height:"100%",sx:{borderRadius:t.spacing(1.5),justifyContent:"center",alignItems:"center",display:"flex","@keyframes pulse":{"0%":{opacity:.2},"50%":{opacity:1},"100%":{opacity:.2}}},children:f.jsxs(K,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"120px",backgroundColor:t.palette.grey[400],borderRadius:t.spacing(1.5),height:"100%",margin:t.spacing(2),padding:t.spacing(2)},children:[f.jsx(K,{sx:{width:"70%",height:28,borderRadius:1,backgroundColor:d,animation:"pulse 1.5s ease-in-out infinite"}}),f.jsx(K,{sx:{width:"50%",height:16,borderRadius:1,backgroundColor:d,mt:1,animation:"pulse 1.5s ease-in-out infinite"}})]})})}return u?f.jsxs(K,{position:"relative",width:"100%",height:"100%",sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:[f.jsx(K,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"120px",backgroundColor:t.palette.primary[50],borderRadius:t.spacing(1.5),height:"100%",minHeight:t.spacing(10),margin:t.spacing(2),padding:t.spacing(2)}}),f.jsx(po,{size:4,icon:"empty",boxProps:{sx:{borderRadius:"3px",backgroundColor:t.custom.grey[400],color:t.custom.grey[1400],position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}})]}):f.jsx(K,{width:"100%",height:"100%",sx:{borderRadius:t.spacing(1.5),justifyContent:"center",alignItems:"center",display:"flex"},children:f.jsxs(K,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"120px",backgroundColor:t.palette.primary[50],borderRadius:t.spacing(1.5),height:"100%",margin:t.spacing(2),padding:t.spacing(2)},children:[f.jsx(ie,{sx:{fontWeight:t.typography.fontWeightBold,fontSize:32,lineHeight:1.25,color:t.palette.text.primary},children:r?r(a):String(a)}),c!==void 0&&f.jsxs(ie,{variant:"body2",sx:{color:t.custom.grey[1400],mt:t.spacing(1),fontSize:16},children:[s," ",r?r(c):String(c)]})]})})},aN=e=>{const{chartType:t,onMouseEnter:n,tooltipPos:r,language:o,isLoading:i,height:s,maxScore:a,separator:c,...u}=e,d=(h,g)=>{n(h,g)},p=h=>{n({},h)};switch(t){case"donut":return f.jsx(jC,{...u,isLoading:i,height:s,tooltipPos:r,language:o,onMouseEnter:d});case"pie":return f.jsx(hSe,{...u,isLoading:i,height:s,tooltipPos:r,language:o,onMouseEnter:d});case"bar":return f.jsx(eSe,{...u,isLoading:i,height:s,onMouseEnter:p});case"line":return f.jsx(aSe,{...u,isLoading:i,height:s,onMouseEnter:p});case"radar":return f.jsx(wSe,{...u,isLoading:i,height:s,onMouseEnter:p});case"table":return f.jsx(SSe,{...u,isLoading:i,height:s,tooltipPos:r,onMouseEnter:d});case"raw":return f.jsx(MSe,{data:u.data,valuesFormatterFn:u.valuesFormatterFn,icons:u.icons,isLoading:i,onLegendAction:e.onLegendAction,maxScore:a,separator:c});default:return f.jsx(jC,{...u,isLoading:i,height:s,tooltipPos:r,language:o,onMouseEnter:d})}},Ja=e=>({default:{width:e.spacing(6.5),height:e.spacing(3.5),thumbWidth:e.spacing(2.5),thumbHeight:e.spacing(2.5),thumbBorderRadius:"50%",trackBorderRadius:e.spacing(4/2),trackBackgroundColor:"rgba(0,0,0,.25)",trackOpacity:1},medium:{width:e.spacing(5.5),height:e.spacing(3),thumbWidth:e.spacing(2),thumbHeight:e.spacing(2),thumbBorderRadius:"50%",trackBorderRadius:e.spacing(3.5/2),trackBackgroundColor:"rgba(0,0,0,.25)",trackOpacity:1},small:{width:e.spacing(4.5),height:e.spacing(2.5),thumbWidth:e.spacing(1.5),thumbHeight:e.spacing(1.5),thumbBorderRadius:"50%",trackBorderRadius:e.spacing(2.5/2),trackBackgroundColor:"rgba(0,0,0,.25)",trackOpacity:1}}),ESe=W(dT,{shouldForwardProp:e=>e!=="toggleSize"})(({theme:e,toggleSize:t="default"})=>{const n=t??"default";return{width:Ja(e)[n].width,height:Ja(e)[n].height,padding:0,display:"flex","&:active":{"& .MuiSwitch-thumb":{width:Ja(e)[n].thumbWidth},"& .MuiSwitch-switchBase.Mui-checked":{transform:e.spacing(1)}},"& .MuiSwitch-switchBase":{padding:e.spacing(.5),"&.Mui-checked":{transform:`translateX(${parseInt(Ja(e)[n].width)-parseInt(Ja(e)[n].thumbWidth)-parseInt(e.spacing(1))}px)`,color:"#fff","& + .MuiSwitch-track":{opacity:1,backgroundColor:e.palette.primary.main}}},"& .MuiSwitch-thumb":{boxShadow:"none",width:Ja(e)[n].thumbWidth,height:Ja(e)[n].thumbHeight,borderRadius:"50%",transition:e.transitions.create(["width"],{duration:200})},"& .MuiSwitch-track":{borderRadius:Ja(e)[n].trackBorderRadius,opacity:1,backgroundColor:"rgba(0,0,0,.25)",boxSizing:"border-box"}}}),lN=e=>{const t=ce(),{label:n,onChange:r,checked:o,toggleSize:i="default",...s}=e;return f.jsx(Al,{control:f.jsx(ESe,{value:o,sx:{m:t.spacing(1)},toggleSize:i,onChange:r,...s}),label:n})},TSe=2,OSe=0,kSe=2,PSe="900px",LSe=300,jSe=100,ISe=700,ASe="28px auto",RSe=4,DSe=2,cN="0.2s",Qu=1,uN=100,VSe=e=>{const t=ce(),{chartType:n,values:r,labels:o,colors:i,legend:s,children:a,valuesUnit:c,className:u,valuesFormatterFn:d=t.numbers.valueFormatterFn,createPalette:p=!0,isLoading:h=!1,displayTotal:g=!0,fullWidthLegend:m=!1,displayTotalVariant:v="number-big",spacing:C=TSe,borderWidth:y=OSe,borderColor:x,hoverOffset:w=kSe,icons:M,showTooltip:S=!0,width:E=PSe,height:T=LSe,maxScore:O,separator:P,aggregation:k}=e,{showAggregateToggle:L=!1,aggregateToggleLabel:j="",othersCategoryLabel:A="",othersThresholdPercent:R=1}=k??{},_=I.useRef(null),N=I.useRef(null),z=vn.language,B=fo(t.breakpoints.down("md")),$=pk(t,jSe,ISe),V=(s==null?void 0:s.position)??"bottom",H=s?{...s,mode:n==="raw"||O!==void 0?"raw":s.mode}:void 0,[X,Q]=I.useState(!1),ne=n!=="raw"&&n!=="table",{effValues:q,effLabels:J,keptIndices:te,hasOthers:Y}=I.useMemo(()=>{const Ce=Array.isArray(r)?r:[],Ze=Array.isArray(o)?o:[];if(!ne||!L||!X)return{effValues:Ce,effLabels:Ze,keptIndices:Ce.map((je,Ue)=>Ue),hasOthers:!1};const Ge=Ce.reduce((je,Ue)=>je+(Number.isFinite(Ue)?Number(Ue):0),0);if(Ge<=0)return{effValues:Ce,effLabels:Ze,keptIndices:Ce.map((je,Ue)=>Ue),hasOthers:!1};const me=Math.max(0,R)/100,ve=[],ye=[];if(Ce.forEach((je,Ue)=>{Math.abs(Number(je))/Ge<me?ve.push(Ue):ye.push(Ue)}),ve.length===0)return{effValues:Ce,effLabels:Ze,keptIndices:Ce.map((je,Ue)=>Ue),hasOthers:!1};const Ie=ve.reduce((je,Ue)=>je+(Number(Ce[Ue])||0),0),Re=[...ye.map(je=>Number(Ce[je])||0),Ie],Ee=[...ye.map(je=>Ze[je]??""),A];return{effValues:Re,effLabels:Ee,keptIndices:ye,hasOthers:!0}},[ne,L,X,r,o,R,A]),Z=i&&i.length?i:$;let F=[];if(p)F=hk(Z,q);else{const Ce=te.map(Ze=>Z[Ze%Z.length]);if(Y&&Z.length>0){const Ze=te.length%Z.length;F=[...Ce,Z[Ze]]}else F=Ce}if(p&&Y&&F.length===q.length&&Z.length>0){const Ce=te.length%Z.length;F[F.length-1]=Z[Ce]}const G=Ck(q,J,F),D=xk(r,g),ee=yk(a,g,D,d),{HoveredChartElementIndex:oe,tooltipPos:se,handleLegendHover:ue,handleMouseEnter:re,handleMouseOut:he}=wk(G,_),pe=n==="donut",be=!h&&S,Se=G.length===0&&!h;return f.jsxs(le,{direction:V==="bottom"||B?"column":"row",gap:V==="bottom"?t.spacing(DSe):t.spacing(RSe),className:`polymorphic-chart polymorphic-chart-${n} ${u}`,ref:N,sx:{maxWidth:E,width:"100%",minHeight:"100%"},children:[f.jsxs(le,{sx:n==="raw"?{minHeight:"100%"}:{flex:1},children:[f.jsxs(K,{position:"relative",margin:n==="raw"?0:ASe,sx:{"& *":{outline:"none"},".cell-hovered":{animation:`cell-hovered ${cN} ease-in-out forwards`,transformOrigin:"center"},".cell-idle":{transform:`scale(${Qu})`,transformOrigin:"center",animation:`cell-idle ${cN} ease-in-out forwards`},"@keyframes cell-hovered":{"0%":{transform:`scale(${Qu})`},"100%":{transform:`scale(${Qu+w/uN})`},"@keyframes cell-idle":{"0%":{transform:`scale(${Qu+w/uN})`},"100%":{transform:`scale(${Qu})`}}},height:n==="raw"?"100%":"inherit",width:"100%",pointerEvents:h?"none":"auto"},className:"polymorphic-chart-wrapper",id:"polymorphic-chart-wrapper",ref:_,children:[f.jsx(aN,{chartType:n,data:G,HoveredChartElementIndex:oe,spacing:C,borderWidth:y,borderColor:x,showTooltip:be,tooltipPos:se,valuesFormatterFn:d,language:z,valuesUnit:c,icons:M,isLoading:h,height:T,onMouseEnter:re,onMouseLeave:he,onLegendAction:Ce=>{var Ze,Ge,me;(Ze=s==null?void 0:s.actions)!=null&&Ze[Ce]&&((me=(Ge=s.actions)[Ce])==null||me.call(Ge))},maxScore:O,separator:P}),pe&&!h&&f.jsx(Sk,{isLoading:h,isEmpty:Se,displayValue:ee,displayTotalVariant:v,valuesUnit:c,displayTotal:g})]}),ne&&L&&!Se&&f.jsx(K,{sx:{display:"flex",justifyContent:"center",width:"100%",zIndex:2,transform:"translateY(0%)",pointerEvents:"auto"},children:h?f.jsxs(le,{direction:"row",alignItems:"center",justifyContent:"center",spacing:t.spacing(1.25),height:t.spacing(4.5),children:[f.jsx(Dl,{variant:"rounded",width:36,height:26,animation:"pulse"}),f.jsx(Dl,{width:150,height:24,animation:"pulse"})]}):f.jsx(lN,{label:j,checked:X,onChange:Ce=>Q(Ce.target.checked),toggleSize:"small"})})]}),f.jsx(K,{display:"flex",width:m?"100%":"inherit",sx:{width:m?"100%":"inherit",flex:1},children:H&&(()=>{const Ce=Array.from(J.keys()),Ze=ne&&X?Ce.filter(ye=>(J[ye]??"").trim().length>0):Ce,Ge=Ze.map(ye=>J[ye]??""),me=Ze.map(ye=>q[ye]??0),ve=Ze.map(ye=>F[ye]);return f.jsx(J9,{labels:Ge,hoveredDatasetIndex:oe,onLegendHover:ue,values:me,colors:ve,legend:H,isLoading:h,icons:M,chartRef:_,maxScore:O,separator:P,threshold:R,valuesFormatterFn:d})})()})]})},dN=e=>b.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},b.createElement("rect",{x:1,y:1,width:18,height:18,rx:3,fill:"white"}),b.createElement("rect",{x:1,y:1,width:18,height:18,rx:3,stroke:"#D1CFCE",strokeWidth:2})),fN=e=>b.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},b.createElement("rect",{width:20,height:20,rx:4,fill:"url(#paint0_linear_2034_7850)"}),b.createElement("path",{d:"M8.32244 13.9335L4.56689 10.178L5.36133 9.38351L8.32244 12.3446L14.628 6.03906L15.4224 6.83351L8.32244 13.9335Z",fill:"white"}),b.createElement("defs",null,b.createElement("linearGradient",{id:"paint0_linear_2034_7850",x1:7.58928,y1:755124e-13,x2:7.58928,y2:20,gradientUnits:"userSpaceOnUse"},b.createElement("stop",{stopColor:"#484945"}),b.createElement("stop",{offset:1,stopColor:"#2A2B27"})))),_Se=W(fs)(()=>({":hover":{background:Te[400]}})),NSe=e=>{const{values:t,...n}=e,{onChange:r,...o}=n,i=Object.entries(t);return f.jsx(D8,{children:i.map(([s,a],c)=>f.jsx(Al,{control:f.jsx(_Se,{...o,checkedIcon:f.jsx(fN,{}),icon:f.jsx(dN,{}),disableRipple:!0,onChange:(u,d)=>{const p={};p[s]={name:a.name,state:d},r(p)}}),sx:{gap:"1rem"},label:a.name,checked:a.state},`${s}-${c}`))})},HSe=(e,t,n)=>Object.entries(t).flatMap(o=>{const[i,s]=o;if(s.state===!1)return[];const a=Number(i),c=e.find(u=>u.id===a);return c?[c]:[n({id:a,name:s.name})]}),$Se=(e,t)=>{const n={};return e.reduce((o,i)=>{const s=t.some(a=>a.id===i.id);return o[i.id]={name:i.name,state:s},o},n)},FSe=W(fs)(()=>({":hover":{background:Te[400]}})),BSe=e=>{const{values:t,onChange:n,FormGroupProps:r,FormControlLabelProps:o,CheckboxProps:i}=e,s=Object.entries(t);return f.jsx(D8,{...r,children:s.map(([a,c],u)=>f.jsx(Al,{sx:{gap:"1rem"},checked:c.state,...o,label:c.name,control:f.jsx(FSe,{checkedIcon:f.jsx(fN,{}),icon:f.jsx(dN,{}),disableRipple:!0,...i,onChange:(d,p)=>{const h={...t};h[a]={...h[a],name:c.name,state:p},n(h)}})},`${a}-${u}`))})},pN=e=>{const{values:t,selectedItems:n,onChange:r,getId:o=u=>u.id,getName:i=u=>u.name,...s}=e,a=(n==null?void 0:n.map(u=>o(u)))??[],c=t.reduce((u,d)=>{const p=o(d),h=a.includes(p),g=n===void 0?!1:h;return u[p]={name:i(d),state:g,rawData:d},u},{});return f.jsx(BSe,{values:c,onChange:u=>{const d=Object.values(u).flatMap(p=>p.state===!1?[]:p.rawData);return r(d)},...s})},zSe=W(K)(({theme:e})=>({display:"flex",flexDirection:"column",border:`1px solid ${Te[500]}`,background:e.palette.background.paper,borderRadius:e.spacing(2),overflow:"hidden",boxShadow:e.custom.shadows.grey,[e.breakpoints.up("md")]:{flexDirection:"row-reverse",justifyContent:"space-between"}})),ZSe=W(K)(({theme:e})=>({padding:e.spacing(4),display:"flex",flexDirection:"column",justifyContent:"space-between",[e.breakpoints.up("md")]:{padding:e.spacing(6)}})),WSe=W(K)({display:"flex",flexDirection:"column"}),USe=W(K)(({theme:e})=>({margin:e.spacing(2,0,2,0)})),qSe=W(K)(({theme:e})=>({alignSelf:"flex-end",[e.breakpoints.up("md")]:{alignSelf:"flex-start"}})),GSe=W(K)(({theme:e})=>({width:"100%",height:e.spacing(30),[e.breakpoints.up("md")]:{maxWidth:"500px",height:"auto"}})),KSe=W("img")({width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}),YSe=e=>{const{title:t,subtitle:n,description:r,imageUrl:o,callToAction:i,sxProps:s={}}=e,a=ce();return f.jsxs(zSe,{sx:s,children:[o&&f.jsx(GSe,{children:f.jsx(KSe,{src:o,alt:"hero image"})}),f.jsxs(ZSe,{children:[f.jsxs(WSe,{children:[f.jsx(F1,{defaultVariant:"h2",text:t}),n&&f.jsx(F1,{defaultVariant:"h5",text:n,typographyProps:{color:a.custom.grey[2e3],padding:a.spacing(.5,0,.5,0)}}),r&&f.jsx(USe,{children:r})]}),i&&f.jsx(qSe,{children:f.jsx(B1,{buttonOptions:i,defaultOptions:{sx:{display:"inline-flex",padding:a.spacing(3),letterSpacing:a.spacing(.02),fontWeight:a.typography["body-bold"].fontWeight},variant:"primary",endIcon:f.jsx(Ct,{size:2,icon:"arrowRight"})}})})]})]})},XSe=W(K)(()=>({position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0)",zIndex:1e3,transition:"background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1)",visibility:"hidden","&.open":{backgroundColor:"rgba(0, 0, 0, 0.5)",visibility:"visible"}})),JSe=W(K)(({theme:e})=>({position:"fixed",top:0,right:0,bottom:0,width:"75%",backgroundColor:e.palette.background.paper,zIndex:1001,overflowY:"auto",transform:"translateX(100%)",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",opacity:0,borderRadius:`${e.spacing(1)} 0 0 ${e.spacing(1)}`,"&.open":{transform:"translateX(0)",opacity:1,visibility:"visible",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},[e.breakpoints.down("md")]:{width:"100%"}})),hN=W(K)({width:"100%",height:"400px",backgroundColor:"#f0f0f0","& img":{width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease-in-out"}}),QSe=W(zt)(({theme:e})=>({position:"fixed",top:e.spacing(2),right:e.spacing(2.5),zIndex:1002,backgroundColor:"white",visibility:"hidden",transform:"translateX(200%)",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.8)"},"&.open":{transform:"translateX(0)",opacity:1,visibility:"visible",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"}})),eMe=W(le)({padding:"2rem 4rem"}),tMe=({isOpen:e,onClose:t,article:n})=>(I.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[e]),f.jsxs(f.Fragment,{children:[f.jsx(XSe,{className:e?"open":"",onClick:t}),f.jsx(QSe,{className:e?"open":"",onClick:t,children:f.jsx(Ct,{size:2,icon:"close"})}),f.jsxs(JSe,{className:e?"open":"",children:[f.jsx(I.Suspense,{fallback:f.jsx(hN,{}),children:f.jsx(hN,{children:f.jsx("img",{src:n.imageSrc,alt:n.title,loading:"lazy",onLoad:r=>{r.target.style.opacity="1"},style:{opacity:0}})})}),f.jsxs(eMe,{spacing:3,children:[f.jsx(ie,{variant:"h2",children:n.title}),f.jsx(ie,{variant:"body1",dangerouslySetInnerHTML:{__html:n.content}})]})]})]})),nMe=[3,5,9,3],rMe=W(le,{shouldForwardProp:e=>e!=="isRightColumn"})(({isRightColumn:e,theme:t})=>({border:`1px solid ${Te[500]}`,borderRadius:t.spacing(1),overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",flexDirection:e?"row":"column",[t.breakpoints.down("md")]:{flexDirection:"column"},boxShadow:t.custom.shadows.grey})),oMe=W(K,{shouldForwardProp:e=>e!=="isRightColumn"})(({isRightColumn:e,theme:t})=>({flex:e?"0 0 35%":"1 1 auto",lineHeight:0,position:"relative",width:"100%",height:e?"100%":"380px",backgroundColor:t.palette.grey[400],overflow:"hidden","& img":{width:"100%",height:"100%",objectFit:"cover",objectPosition:"center",display:"block",[t.breakpoints.down("md")]:{height:"200px"}},[t.breakpoints.down("md")]:{height:"140px"},[t.breakpoints.down("md")]:{flex:2}})),iMe=W(le)(({theme:e})=>({flex:"1 1 0",backgroundColor:e.palette.background.paper,padding:e.spacing(3,3,2,3),justifyContent:"space-between",gap:e.spacing(1),[e.breakpoints.down("md")]:{padding:e.spacing(2,2,1.5,2)},[e.breakpoints.down("md")]:{flex:"1 1 0"}})),sMe=W(d6)({display:"block",width:"100%",height:"100%",cursor:"pointer"}),aMe=W(it)(({theme:e})=>({display:"inline-flex",alignSelf:"flex-start",fontWeight:700,gap:e.spacing(1)})),lMe=W(ie,{shouldForwardProp:e=>e!=="isFirst"})(({isFirst:e,articlesNumber:t,theme:n})=>({display:"-webkit-box",WebkitLineClamp:e?5:nMe[t-1]||3,marginTop:n.spacing(2),WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",[n.breakpoints.down("md")]:{WebkitLineClamp:e?3:2,marginTop:n.spacing(1)}})),zC=e=>{const[t,n]=I.useState(!1),{title:r,description:o,imageSrc:i,content:s,onClick:a,isFirst:c=!1,articlesNumber:u=1,isRightColumn:d=!1,readMoreText:p="Lire l'article"}=e,h=()=>{a?a():n(!0)};return f.jsxs(f.Fragment,{children:[f.jsxs(rMe,{isRightColumn:d,children:[f.jsx(oMe,{isRightColumn:d,children:f.jsx(sMe,{onClick:h,children:f.jsx("img",{src:i,alt:r})})}),f.jsxs(iMe,{children:[f.jsxs(K,{children:[f.jsx(ie,{variant:"h3",mb:"0.2rem",children:r}),f.jsx(lMe,{variant:"body",mb:"1rem",isFirst:c,articlesNumber:u,dangerouslySetInnerHTML:{__html:o}})]}),f.jsxs(aMe,{variant:"text",onClick:h,children:[f.jsx(ie,{fontWeight:700,fontSize:"0.875rem",children:p}),f.jsx(Ct,{size:2,icon:"arrowRight"})]})]})]}),!a&&f.jsx(tMe,{isOpen:t,onClose:()=>n(!1),article:{title:r,description:o,imageSrc:i,content:s||o}})]})},cMe=e=>{const{articles:t=[],sxProps:n={}}=e,[r,...o]=t;return f.jsxs(Vo,{container:!0,columns:o.length>0?2:1,sx:{...n,height:"100%","& .MuiGrid-item":{"@media (max-width: 1068px)":{width:"100%",maxWidth:"100%",flexBasis:"100%"}}},spacing:4,children:[f.jsx(Vo,{item:!0,xs:1,children:f.jsx(zC,{...r,isFirst:!0,articlesNumber:t.length})}),f.jsx(Vo,{item:!0,xs:1,children:f.jsx(_7,{gap:3,display:"flex",flexDirection:"column",justifyContent:"space-between",height:"100%",sx:{"@media (max-width: 1068px)":{gap:2,marginTop:0}},children:o.map((i,s)=>f.jsx(_7,{height:"100%",children:f.jsx(zC,{...i,isRightColumn:t.length>=3,articlesNumber:t.length})},`article-${s}`))})})]})},uMe=e=>{const{title:t,children:n,objectives:r=[],tooltipMessage:o}=e,i=ce();return f.jsxs(le,{sx:{borderRadius:"12px",border:`1px solid ${i.palette.grey[500]}`,padding:"34px",maxWidth:"360px",background:i.palette.background.paper},children:[f.jsxs(K,{display:"flex",children:[f.jsx(ie,{variant:"h3",component:"h3",mb:"1.5rem",children:t}),o&&f.jsx(Ct,{size:3,icon:"information"})]}),f.jsx(K,{fontWeight:700,display:"flex",gap:"0.5rem",mb:"1rem",children:n}),f.jsx(le,{sx:{"> div:not(:last-of-type)":{mb:"1rem"}},children:r.map((s,a)=>f.jsxs(le,{flexDirection:"row",alignItems:"center",gap:".5rem",children:[f.jsx(ie,{variant:"small-medium",children:s.objective}),f.jsx(IT,{boxProps:{sx:{padding:"0.1rem 0.5rem"}},children:s.component})]},a))})]})},dMe=e=>{const{title:t,subtitle:n,description:r}=e,o=ce();return f.jsxs(le,{sx:{borderRadius:"12px",border:`1px solid ${o.palette.grey[500]}`,padding:"34px",maxWidth:"360px",background:o.palette.background.paper},children:[f.jsxs(le,{flexDirection:"row",alignContent:"center",justifyContent:"space-between",children:[f.jsx(ie,{variant:"h3",component:"h3",mb:"1.5rem",children:t}),n&&f.jsx(fMe,{text:n})]}),f.jsx(le,{children:f.jsx(ie,{variant:"body-medium",children:f.jsx(K,{dangerouslySetInnerHTML:{__html:r}})})})]})};function fMe(e){const{text:t}=e;return f.jsx(di,{sx:{textAlign:"center"},arrow:!1,title:f.jsx(ie,{variant:"body-medium",children:t}),placement:"top",children:f.jsx(K,{children:f.jsx(Ct,{size:3,icon:"information"})})})}const pMe=e=>{const{value:t,maxLength:n,...r}=e,o=t.map((d,p)=>t.slice(0,p+1).reduce((h,g)=>{const m=h.length+g.length;if(m>n){const v=n-m,C=[...h.words,g.slice(0,v)].filter(Boolean);return{length:m,words:C,rest:t.length-C.length}}return{...h,length:m,words:[...h.words,g]}},{length:0,words:[],rest:0})),i=o[o.length-1],a=t[t.length-1].length===i.words[i.words.length-1].length?"":"…",c=i.words.join(", "),u=i.rest>0?`${c}… +${i.rest}`:c+a;return f.jsx(ie,{...r,children:u})},hMe=e=>{const{value:t,maxLength:n,separator:r=",",...o}=e;if(n===0)return f.jsx(ie,{...o,children:""});const i=t.join("").length;if(n>i)return f.jsx(ie,{...o,children:t.join(r)});let s=0;const a=t.reduce((y,x)=>{const w=s+x.length,M={low:s,high:w};return s=w,y.push(M),y},[]),c=a.findIndex(y=>y.low<n&&n<=y.high),u=c+1,d=a.length-u,h=a[c].high===n?"":"…",g=u*r.length,m=t.join(r).slice(0,n-1+g),v=d?`+${d}`:"",C=`${m}${h} ${v}`;return f.jsx(ie,{...o,children:C})},gMe=e=>{const{setOpen:t,options:n,onValidate:r,onCancel:o,canValidate:i=!0,confirmAction:s,cancelText:a,validateText:c,...u}=e,[d,p]=I.useState(!1),h=()=>t(!1),g=()=>{p(!1)},m=()=>{o&&o(),h()},v=()=>{if(!s){r&&r(),h();return}d?(p(!1),r&&r(),h()):p(!0)};return f.jsxs(C0,{onClose:m,...u,fullWidth:!0,maxWidth:"md",scroll:"body",children:[f.jsxs(m1,{sx:mN,children:[n.title,f.jsx(it,{variant:"text",endIcon:f.jsx(j6,{}),onClick:m})]}),f.jsx(K,{sx:{width:"100%"},children:n.content}),f.jsx(gN,{onCancelAction:m,onConfirmAction:v,canValidate:i,cancelText:a,validateText:c}),s&&f.jsx(mMe,{openConfirmAction:d,onCancel:g,onValidate:v,confirmAction:s,cancelText:a,validateText:c})]})},mMe=e=>{const{confirmAction:t,onCancel:n,onValidate:r,openConfirmAction:o,cancelText:i,validateText:s}=e;return f.jsxs(C0,{open:o,onClose:n,sx:{display:"flex",justifyContent:"space-between",alignItems:"center",borderBottom:`1px solid ${Te[500]}`,minHeight:"68px",padding:"28px 27px 28px 32px"},children:[f.jsxs(m1,{sx:mN,children:[t.title,f.jsx(it,{variant:"text",endIcon:f.jsx(j6,{}),onClick:n})]}),f.jsx(K,{sx:{padding:"32px",width:"100%"},children:t.content}),f.jsx(gN,{onCancelAction:n,onConfirmAction:r,cancelText:t.cancelText??i,validateText:t.validateText??s})]})},gN=e=>{const{onCancelAction:t,onConfirmAction:n,canValidate:r=!0,cancelText:o,validateText:i}=e;return f.jsxs(s6,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",borderTop:`1px solid ${Te[500]}`,minHeight:"68px",paddingInline:"1rem",padding:"28px 32px 32px 32px"},children:[f.jsx(it,{variant:"text",onClick:t,children:o}),f.jsx(it,{variant:"primary",onClick:n,disabled:!r,children:i})]})},mN={display:"flex",justifyContent:"space-between",alignItems:"center",borderBottom:`1px solid ${Te[500]}`,minHeight:"68px",padding:"28px 27px 28px 32px"},vMe=W(g0)(({theme:e})=>({fontFamily:e.typography.fontFamily,...e.typography.body})),nc=I.forwardRef(function(e,t){const n=ce(),{sx:r,error:o,...i}=e;return f.jsx(vMe,{...i,sx:{color:o?n.custom.red[600]:n.custom.grey[2800],border:o?`1px solid ${n.custom.red[600]}`:`1px solid ${n.custom.grey[1400]}`,backgroundColor:o?n.custom.red[100]:"inherit",borderRadius:"16px",paddingInline:"20px",...r}})}),CMe=e=>{const{title:t,unit:n,placeholder:r,value:o,description:i,error:s,required:a,...c}=e,u=a?"*":"",d=ce(),p=I.useRef(!1),h=p.current&&s,[g,m]=I.useState(!1),[v,C]=I.useState(!1),[y,x]=I.useState(!1);I.useEffect(()=>{const T=w(M,e.setMinMaxError);m(T);const O=w(S,e.setMinError);C(O);const P=w(E,e.setMaxError);x(P)},[o]);const w=(T,O)=>{const P=T();return O!==void 0&&O(P),P},M=()=>{if(e.min===void 0&&e.max===void 0||o===void 0||o==="")return!1;const T=Number(o);return!(e.min!==void 0&&T>e.min&&e.max!==void 0&&T<e.max)},S=()=>e.min===void 0||o===void 0||o===""?!1:!(e.min<Number(o)&&e.max===void 0),E=()=>e.max===void 0||o===void 0||o===""?!1:!(e.max>Number(o)&&e.min===void 0);return f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[f.jsx(ie,{variant:"h5",children:`${t}${u} :`}),f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[f.jsx(nc,{...c,type:"number",style:{minWidth:"150px",width:"10%",borderColor:h?d.palette.error.main:"inherit",backgroundColor:h?d.palette.error.light:"inherit"},placeholder:r,value:o,onChange:T=>{p.current=!0,c.onChange&&c.onChange(T)}}),f.jsx(ie,{variant:"body",children:n})]}),(!!e.minMaxErrorMessage&&g||!!e.minErrorMessage&&v||!!e.maxErrorMessage&&y)&&f.jsxs(ie,{variant:"body",style:{color:d.custom.red[600]},children:[!!e.minMaxErrorMessage&&g&&e.minMaxErrorMessage,!!e.minErrorMessage&&v&&e.minErrorMessage,!!e.maxErrorMessage&&y&&e.maxErrorMessage]}),f.jsx(ie,{variant:"body",children:i})]})},bMe=e=>{const{icon:t,label:n,variant:r,onDelete:o,ChipProps:i}=e,s=ce(),a=r==="brand"?s.palette.primary[100]:s.custom.grey[600];return f.jsx(Fs,{icon:t===void 0?void 0:f.jsx(Ct,{size:1,icon:t}),variant:r,label:n,onDelete:o,deleteIcon:f.jsx(M9,{buttonProps:{onClick:o,sx:{":hover":{backgroundColor:a}}},icon:"close",size:"xs"}),...i})},yMe=e=>{const{unit:t,sx:n,...r}=e;return f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[f.jsx(nc,{type:"number",sx:{minWidth:"125px",width:"10%",...n},...r}),f.jsx(ie,{variant:"body",children:t})]})};function xMe(e){const t=ce(),n={height:"40px",padding:"0px 6px 0px 20px",...t.custom.searchBox,minWidth:"350px"},r={height:"20px",padding:"0px",width:"100%","&>.MuiInputBase-root>fieldset":{border:"none"},"&>.MuiInputBase-root>input":{padding:"0"}},o={height:"48px",padding:"0px 16px 0px 24px",borderTop:"1px solid "+t.custom.grey[500],borderBottom:"1px solid "+t.custom.grey[500],background:t.custom.grey[200]},i={"&>.MuiInputBase-root>fieldset":{border:"none"},"&>.MuiInputBase-root>input":{width:"100%",height:"48px",padding:"0",border:"none"}};return f.jsxs(le,{direction:"row",useFlexGap:!0,gap:"10px",justifyContent:"space-between",alignItems:"center",sx:e.variant==="standalone"?n:o,children:[f.jsx(_i,{label:"",type:"search",placeholder:e.placeholder,value:e.value,onChange:s=>{e.onChange(s.target.value)},sx:e.variant==="standalone"?r:i}),f.jsx(zse,{})]})}const wMe=I.forwardRef(function(t,n){const{title:r,placeholder:o,value:i,description:s,sx:a,error:c,required:u,...d}=t,p=u?"*":"",h=ce(),g=I.useRef(!1),m=g.current&&c;return f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[f.jsx(ie,{variant:"h5",children:`${r}${p} :`}),f.jsx(nc,{...d,sx:{width:"70%",borderColor:m?h.custom.red[600]:"inherit",backgroundColor:m?h.custom.red[100]:"inherit",...a},placeholder:o,value:i,onChange:v=>{g.current=!0,d.onChange&&d.onChange(v)}}),f.jsx(ie,{variant:"body",children:s})]})});function SMe(e){return f.jsxs("div",{children:[f.jsx(ie,{variant:"body-bold",sx:{marginBottom:"16px"},children:e.header}),f.jsxs(le,{direction:"column",useFlexGap:!0,gap:"12px",children:[f.jsxs(le,{direction:"row",sx:{height:"20px"},useFlexGap:!0,gap:"12px",justifyContent:"flex-start",children:[f.jsx(fs,{checked:!0,sx:{width:"20px",height:"20px"}}),f.jsx(ie,{variant:"body",children:e.allText})]}),e.values.map((t,n)=>f.jsxs(le,{direction:"row",sx:{height:"20px"},useFlexGap:!0,gap:"12px",justifyContent:"flex-start",children:[f.jsx(fs,{checked:!1,sx:{width:"20px",height:"20px"}}),f.jsx(ie,{variant:"body",children:t})]},n))]})]})}function MMe(e){return f.jsxs(le,{direction:"column",useFlexGap:!0,gap:"12px",alignItems:"flex-start",children:[f.jsx(ie,{variant:"body-bold",children:e.header}),f.jsx(le,{direction:"row",useFlexGap:!0,gap:"8px",flexWrap:"wrap",children:e.values.map((t,n)=>f.jsxs(le,{direction:"row",useFlexGap:!0,gap:"4px",sx:{height:"28px",borderRadius:"4px",background:"#EFEDEC",paddingLeft:"8px"},alignItems:"center",children:[f.jsx(ie,{variant:"body",children:t}),f.jsx(zt,{sx:{width:"20px",height:"20px"},children:f.jsx(L6,{sx:{width:"16px",height:"16px"}})})]},n))}),f.jsx(it,{variant:"text",startIcon:f.jsx(Gie,{}),children:e.addText})]})}const vN=e=>{const t=ce(),{steps:n,currentStep:r=0,icons:o=[],clickable:i=!1,onClick:s}=e;return f.jsxs(K,{display:"inline-flex",position:"relative",children:[f.jsx(le,{direction:"row",gap:"12px",position:"relative",sx:{zIndex:1},children:[...Array(n??o.length).keys()].map(a=>{const c=a<=r;return f.jsx(O6,{size:"medium",border:`1px solid ${t.custom.grey[500]}`,color:c?"#FFF":t.custom.grey[2800],bgcolor:c?t.custom.grey[2800]:"#FFF",sx:{fill:c?"#FFF":t.custom.grey[2800],cursor:i?"pointer":"default","&:hover":i?{fill:"#FFF",color:"#FFF",bgcolor:t.custom.grey[c?2800:2e3]}:{}},onClick:()=>{i&&s&&s(a)},children:o&&o[a]?o[a]:a+1},a)})}),f.jsx(wr,{sx:{backgroundColor:t.custom.grey[500],position:"absolute",inset:`${36/2}px`}})]})},EMe=e=>b.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},b.createElement("path",{d:"M11.021 7.69411H0.333496V6.30524H11.021L6.021 1.30522L7.00016 0.333008L13.6668 6.99967L7.00016 13.6663L6.021 12.6941L11.021 7.69411Z",fill:"white"})),TMe=e=>b.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},b.createElement("path",{d:"M2.97919 7.69411L7.97921 12.6941L7.00004 13.6663L0.333374 6.99967L7.00004 0.333008L7.97921 1.30522L2.97919 6.30524H13.6667V7.69411H2.97919Z",fill:"#B06803"})),CN=e=>{var t;return f.jsxs(le,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{minHeight:"96px",zIndex:1e3,position:"sticky",top:"28px",border:"1px solid #E7E6E4",borderRadius:"52px",backgroundColor:"#FFFFFF",padding:"20px 28px"},children:[f.jsx(OMe,{title:e.title,subtitle:e.subtitle}),f.jsx(vN,{icons:e.icons,steps:e.steps??((t=e.icons)==null?void 0:t.length)??0,currentStep:e.currentPage,clickable:e.navigable,onClick:e.onNavigate}),f.jsx(PMe,{onPageForward:e.onPageForward,onPageBack:e.onPageBack,nextPageText:e.nextPageText,previousPageText:e.previousPageText,currentPage:e.currentPage,validateSteps:e.validateSteps,validateStepsTexts:e.validateStepsTexts,warningText:e.warningText,savingState:e.savingState,closeable:e.closeable,onClose:e.onClose})]})},OMe=e=>{const t=ce();return f.jsx(le,{direction:"row",alignItems:"center",justifyContent:"start",marginX:"20px",maxWidth:"33%",children:f.jsxs(le,{gap:"4px",children:[f.jsx(ie,{variant:"h3",children:e.title}),e.subtitle&&f.jsx(ie,{variant:"body",color:t.custom.grey[2e3],children:e.subtitle})]})})},kMe=e=>{const t=ce(),n=e.saving?ZT:$T,r=e.saving?{animation:"spin 1s linear infinite","@keyframes spin":{"0%":{transform:"rotate(360deg)"},"100%":{transform:"rotate(0deg)"}}}:{},o=f.jsx(n,{sx:{width:"24px",color:t.custom.grey[2e3],...r}}),i=f.jsx(K,{padding:"12px 16px",textAlign:"center",children:f.jsx(ie,{variant:"body",children:e.saving?e.savingMessage:e.savedMessage})});return f.jsx(z1,{icon:o,body:i,size:"260px"})},PMe=e=>{const t=ce(),n=f.jsx(it,{variant:"primary",disabled:e.validateSteps&&!e.validateSteps[e.currentPage],endIcon:f.jsx(EMe,{}),onClick:e.onPageForward,children:e.nextPageText}),r=f.jsxs(K,{padding:"12px 16px",children:[f.jsx(ie,{variant:"body-bold",children:e.warningText||""}),f.jsx("br",{}),f.jsx(ie,{variant:"body",children:e.validateStepsTexts&&e.validateStepsTexts[e.currentPage]||""})]});return f.jsxs(le,{direction:"row",alignItems:"center",justifyContent:"end",gap:"28px",children:[f.jsx(K,{sx:{">*":{display:"flex"}},children:e.savingState&&f.jsx(kMe,{...e.savingState})}),f.jsxs(le,{direction:"row",gap:"20px",children:[e.previousPageText&&f.jsx(it,{variant:"text",startIcon:f.jsx(TMe,{}),onClick:e.onPageBack,children:e.previousPageText}),e.validateSteps&&!e.validateSteps[e.currentPage]?e.nextPageText&&f.jsx(z1,{icon:n,body:r,size:"260px"}):e.nextPageText&&n]}),e.closeable&&f.jsx(it,{variant:"white-filled",onClick:e.onClose,sx:{minWidth:0,aspectRatio:1,borderRadius:"100%",padding:0,"&:hover":{background:t.custom.grey[400]},"&:active":{background:t.custom.grey[600]}},children:f.jsx(p9,{sx:{width:"20px",color:t.custom.grey[2800]}})})]})},ZC=e=>{const t=ce(),{title:n,titleSize:r,badge:o}=e,s=r||"h1";return f.jsxs(le,{direction:"row",alignItems:"center",gap:"16px",children:[typeof o=="number"?f.jsx(O6,{size:"big",children:o}):f.jsx(le,{width:"40px",alignItems:"center",color:t.custom.grey[2800],children:f.jsx(le,{sx:{transform:"scale(250%)"},children:o})}),f.jsx(ie,{variant:s,children:n})]})},LMe=e=>{const{title:t,subtitle:n,pages:r,pageIndexToDisplay:o=0,savingState:i,closeable:s=!0}=e,a=r.map(d=>d.icon),c=r[o],u=(Array.isArray(c.content)?c.content:[c.content]).map((d,p)=>f.jsx(I.Fragment,{children:d},p));return f.jsxs(f.Fragment,{children:[f.jsx(CN,{title:t,subtitle:n,icons:a,steps:r.length,currentPage:o,nextPageText:e.nextPageText,previousPageText:e.previousPageText,onPageForward:e.onPageForward,onPageBack:e.onPageBack,validateSteps:e.validateSteps,validateStepsTexts:e.validateStepsTexts,warningText:e.warningText,savingState:i,navigable:e.navigable,onNavigate:e.onNavigate,closeable:s,onClose:e.onClose}),f.jsx(le,{direction:"column",alignItems:"center",children:f.jsxs("div",{style:{maxWidth:"1024px"},children:[f.jsxs(le,{direction:"column",marginTop:"44px",marginBottom:"36px",gap:"2rem",children:[c.title&&f.jsx(ZC,{title:c.title,badge:c.icon??o+1}),c.subTitle&&f.jsx(ie,{variant:"h4",children:c.subTitle}),c.subTitle&&f.jsx(wr,{}),c.info]}),c.usesBaseLayout===!1?f.jsx(f.Fragment,{children:u}):f.jsx(jMe,{children:u})]})})]})},jMe=e=>{const{children:t}=e,n=Array.isArray(t)?t:[t];return f.jsx("div",{children:n.map((r,o)=>f.jsx(I.Fragment,{children:r},o))})},IMe=({sx:e={},...t})=>f.jsx(K,{sx:{boxShadow:"0px 2px 8px 0px #2A2B270A",border:`1px solid ${Te[500]}`,borderRadius:"16px",backgroundColor:"#FFFFFF",padding:"2rem",height:"fit-content",...e},...t}),AMe=e=>{const{title:t,hint:n,indicator:r,children:o,...i}=e,s=ce();return f.jsx(go,{width:"100%",padding:s.spacing(4),...i,children:f.jsxs(le,{gap:s.spacing(3),children:[f.jsxs(le,{direction:"row",alignItems:"start",gap:"32px",children:[f.jsx(ie,{variant:"h4",flex:1,children:t}),r&&f.jsx(P6,{value:r.value,unit:r.unit,sx:{top:"-12px",right:"-12px"}})]}),f.jsxs(le,{gap:"24px",children:[n&&f.jsx(XT,{variant:"themed",children:n}),o]})]})})},RMe=()=>{const[e,t]=I.useState({isLocked:!1}),n=d=>{t({isLocked:!0,message:d})},r=()=>{t({isLocked:!1})},[o,i]=I.useState({isLocked:!1}),s=d=>{i({isLocked:!0,message:d})},a=()=>{i({isLocked:!1})};return{forwardLock:e,lockForward:n,unlockForward:r,previousLock:o,lockPrevious:s,unlockPrevious:a,lockAll:d=>{n(d),s(d)},unlockAll:()=>{r(),a()}}},bN=I.createContext(null),yN=e=>{const{children:t,startingPage:n=0,...r}=e,[o,i]=I.useState(!1),[s,a]=I.useState(!1),[c,u]=I.useState(n),d=e.pages.length,p=e.pages[c]??null,h=RMe(),[g,m]=I.useState(!1),v={...r,...h,isSaving:o,setSaving:i,selectedPage:p,selectedPageIndex:c,setPage:u,maxPage:d,formSaved:g,setFormSaved:m,isError:s,setError:a};return f.jsx(bN.Provider,{value:v,children:t})},h2=()=>{const e=I.useContext(bN);if(e)return e;throw new Error("useFormBaseContext must be used within an FormBaseContextProvider")},xN=()=>{const{selectedPageIndex:e,setPage:t,onPageChange:n,pages:r,previousLock:o,forwardLock:i,maxPage:s,setFormSaved:a,isLoading:c}=h2(),u=ce(),d=fo(u.breakpoints.down("md")),p={selected:{color:"#FFF",background:u.custom.grey[2800],hover:{color:"#FFF",background:u.custom.grey[2800]}},locked:{color:u.custom.grey[500],background:"#FFF",hover:{color:u.custom.grey[500],background:"#FFF"}},default:{color:u.custom.grey[2800],background:"#FFF",hover:{color:"#FFF",background:u.custom.grey[2e3]}}};return c?f.jsx(Ta,{}):f.jsxs(K,{display:"inline-flex",position:"relative",children:[f.jsx(le,{direction:"row",gap:"12px",position:"relative",flexWrap:"wrap",sx:{zIndex:1,backgroundColor:d?"white":"transparent"},children:[...Array(s)].map((h,g)=>{var M,S;const m=o.isLocked&&g<e,v=i.isLocked&&g>e,C=m||v,x=g===e?p.selected:p[C?"locked":"default"],w=((M=r[g])==null?void 0:M.icon)??g+1;return f.jsx(O6,{size:"medium",border:`1px solid ${u.custom.grey[500]}`,color:x.color,bgcolor:x.background,tooltip:(S=r[g])==null?void 0:S.title,sx:{fill:x.color,cursor:C?"default":"pointer","&:hover":{fill:x.hover.color,color:x.hover.color,bgcolor:x.hover.background}},onClick:()=>{g===e||C||(a(!1),t(g),n==null||n(g,e))},children:w},`page-top-display-${g}`)})}),f.jsx(wr,{sx:{backgroundColor:u.custom.grey[500],position:"absolute",inset:`${36/2}px`}})]})},wN=()=>{const{textOptions:e,isLoading:t}=h2(),n=ce(),r=fo(n.breakpoints.down("md"));return f.jsx(le,{direction:"row",alignItems:"center",justifyContent:r?"center":"start",marginX:r?"0":"20px",maxWidth:r?"100%":"33%",width:r?"100%":"auto",children:f.jsxs(le,{gap:"4px",alignItems:r?"center":"flex-start",children:[f.jsx(ie,{variant:"h3",textAlign:r?"center":"left",sx:{fontSize:r?"1.3rem":"1.5rem"},children:t?f.jsx(Ta,{size:"18px"}):e.title}),e.subtitle&&f.jsx(ie,{variant:"body",color:n.custom.grey[2e3],textAlign:r?"center":"left",children:e.subtitle})]})})},DMe=()=>{const e=ce(),{isSaving:t,textOptions:n,isError:r}=h2(),o=t?ZT:r?Yse:$T,i=t?{animation:"spin 1s linear infinite","@keyframes spin":{"0%":{transform:"rotate(360deg)"},"100%":{transform:"rotate(0deg)"}}}:{},s=f.jsx(o,{sx:{width:"24px",color:r?e.custom.red[600]:e.custom.grey[2e3],...i}}),a=f.jsx(K,{padding:"12px 16px",textAlign:"center",children:f.jsx(ie,{variant:"body-medium",children:t?n.syncingMessage:r?n.errorDefaultMessage:n.savingDefaultMessage})});return f.jsx(z1,{icon:s,body:a,size:"260px"})},SN=()=>{const{confirmExit:e,selectedPageIndex:t,setPage:n,maxPage:r,forwardLock:o,previousLock:i,textOptions:s,onClose:a,onValidate:c,onPageChange:u,showSync:d,setFormSaved:p,openConfirmDialog:h,isLoading:g,selectedPageIndex:m}=h2(),v=ce(),C=fo(v.breakpoints.down("md")),x=t===r-1&&s.finalPage?s.finalPage:s.nextPage,w=f.jsx(it,{variant:"primary",disabled:o.isLocked||g,endIcon:f.jsx(Ct,{icon:"arrowTrajectory",size:2}),onClick:()=>{if(t===r-1){p(!0),c==null||c();return}return p(!1),u==null||u(t+1,t),n(t+1)},sx:C?{minWidth:"80px",fontSize:"0.875rem",padding:"8px 12px"}:{},children:x}),M=f.jsxs(K,{padding:"12px 16px",children:[f.jsx(ie,{variant:"body-bold",children:s.warningText?s.warningText:""}),f.jsx("br",{}),f.jsx(ie,{variant:"body",children:o.isLocked&&o.message||""})]});return C?f.jsx(le,{direction:"row",alignItems:"center",gap:"16px",children:f.jsx(le,{direction:"row",gap:"16px",alignItems:"center",justifyContent:"flex-end",width:"100%",children:a&&f.jsx(it,{variant:"white-filled",onClick:e?h:a,sx:{minWidth:0,aspectRatio:1,borderRadius:"100%",padding:0,width:"40px",height:"40px","&:hover":{background:v.custom.grey[400]},"&:active":{background:v.custom.grey[600]}},children:f.jsx(p9,{sx:{width:"20px",color:v.custom.grey[2800]}})})})}):f.jsxs(le,{direction:"row",alignItems:"center",justifyContent:"end",gap:"28px",children:[f.jsx(K,{sx:{">*":{display:"flex"}},children:d&&f.jsx(DMe,{})}),f.jsxs(le,{direction:"row",gap:"20px",children:[s.previousPage&&f.jsx(it,{sx:{minWidth:"90px"},variant:"text",disabled:m===0||i.isLocked||g,startIcon:m===0||i.isLocked||g?null:f.jsx(Ct,{icon:"arrowLeft",size:2}),onClick:()=>{if(p(!1),t===0){u==null||u(t,t);return}return u==null||u(t-1,t),n(t-1)},children:s.previousPage}),o.isLocked?x&&f.jsx(z1,{icon:w,body:M,size:"260px",leftPosition:130}):x&&w]}),a&&f.jsx(it,{variant:"white-filled",onClick:e?h:a,sx:{minWidth:0,aspectRatio:1,borderRadius:"100%",padding:0,"&:hover":{background:v.custom.grey[400]},"&:active":{background:v.custom.grey[600]}},children:f.jsx(p9,{sx:{width:"20px",color:v.custom.grey[2800]}})})]})},VMe=()=>{const e=ce();return fo(e.breakpoints.down("md"))?f.jsx(K,{sx:{zIndex:1e3,minHeight:"auto",top:"28px",border:"1px solid #E7E6E4",borderRadius:"28px",backgroundColor:"#FFFFFF",padding:"20px 24px"},children:f.jsxs(le,{direction:"column",spacing:1,alignItems:"center",children:[f.jsxs(K,{sx:{width:"100%",display:"flex",justifyContent:"center",alignItems:"flex-start"},children:[f.jsx(wN,{}),f.jsx(SN,{})]}),f.jsx(K,{sx:{display:"flex",justifyContent:"center"},children:f.jsx(xN,{})})]})}):f.jsxs(K,{sx:{zIndex:1e3,minHeight:"96px",position:"sticky",top:"28px",border:"1px solid #E7E6E4",borderRadius:"52px",backgroundColor:"#FFFFFF",padding:"20px 28px",display:"grid",gridTemplateColumns:"1fr 50% 1fr",gridTemplateRows:"1fr",alignItems:"center"},children:[f.jsx(K,{sx:{gridColumn:"1 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"left"},children:f.jsx(wN,{})}),f.jsx(K,{sx:{gridColumn:"2 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"center"},children:f.jsx(xN,{})}),f.jsx(K,{sx:{gridColumn:"3 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"right"},children:f.jsx(SN,{})})]})},_Me=()=>{const{selectedPage:e,selectedPageIndex:t,isLoading:n}=h2(),r=e.icon??t+1,o=e.title,i=e.subtitle;return n?f.jsx(NMe,{}):f.jsx(le,{direction:"column",alignItems:"center",children:f.jsxs("div",{style:{width:"100%"},children:[f.jsxs(le,{direction:"column",marginTop:"44px",marginBottom:"36px",gap:"2rem",children:[o&&f.jsx(ZC,{title:o,badge:r}),i&&f.jsxs(f.Fragment,{children:[f.jsx(ie,{variant:"h4",children:i}),f.jsx(wr,{})]})]}),e.content]})})},NMe=()=>f.jsx(K,{sx:{marginLeft:"auto",marginRight:"auto",width:"fit-content",marginTop:"5%",marginBottom:"5%"},children:f.jsx(Ta,{})}),HMe=e=>{const t=ce(),{onClose:n,open:r,confirmOptions:o}=e,i=()=>{o.onConfirm(),n()},s=()=>{o.onCancel(),n()};return f.jsxs(C0,{fullWidth:!0,maxWidth:"xs",open:r,onClose:n,sx:{".MuiPaper-rounded":{borderRadius:"12px"}},children:[f.jsxs(m1,{sx:{borderBottom:`1px solid ${t.custom.grey[500]}`},children:[f.jsxs(K,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:"68px"},children:[f.jsx(ie,{variant:"h3",children:o.titleText}),f.jsx(it,{variant:"text",endIcon:f.jsx(j6,{}),onClick:n})]}),(o==null?void 0:o.infoText)&&f.jsx(ie,{sx:{marginBlock:1.5},children:o.infoText})]}),f.jsxs(le,{flexDirection:"column",alignItems:"center",p:3,gap:"1rem",children:[f.jsx(it,{variant:"primary",onClick:i,children:o.confirmText}),f.jsx(it,{onClick:s,children:o.cancelText})]})]})},$Me=()=>{const{confirmExit:e,formSaved:t}=h2(),n=r=>{r.preventDefault()};return I.useEffect(()=>{if(e)return window.removeEventListener("beforeunload",n),t===!1&&window.addEventListener("beforeunload",n),()=>{window.removeEventListener("beforeunload",n)}},[t,e]),f.jsxs(f.Fragment,{children:[f.jsx(VMe,{}),f.jsx(_Me,{})]})},FMe=e=>{const[t,n]=I.useState(!1);return f.jsxs(yN,{...e,openConfirmDialog:()=>n(!0),children:[f.jsx($Me,{}),e.confirmExit&&f.jsx(HMe,{open:t,onClose:()=>n(!1),confirmOptions:e.confirmOptions})]})},BMe=e=>{const{value:t,onChange:n,defaultOption:r,unit:o,error:i=!1,disabled:s=!1,ExtraInputProps:a={},Tooltip:c={}}=e,u=ce(),{text:d,props:p}=c;return f.jsxs(le,{gap:u.spacing(1),children:[f.jsxs(le,{flexDirection:"row",gap:u.spacing(1.5),alignItems:"center",children:[f.jsx(zMe,{fullWidth:!0,value:t,onChange:h=>{const g=h.currentTarget.value;n(g)},error:i,disabled:s,...a}),o&&f.jsx(ie,{variant:"body-medium",maxWidth:"200px",sx:{textWrap:"nowrap",overflow:"clip",textOverflow:"ellipsis"},children:o}),r&&f.jsx(M9,{size:"s",icon:"reset",tooltip:{text:d,props:p},buttonProps:{onClick:()=>{var h;n(r.value),(h=r.extraAction)==null||h.call(r,r.value)},disabled:s}})]}),r&&f.jsx(ie,{variant:"small-medium",children:`${r.label} ${r.value}`})]})},zMe=W(g0)(({theme:e})=>({"&.MuiInputBase-root":{backgroundColor:"white",height:"40px",borderRadius:"24px",paddingRight:"12px",paddingLeft:"20px",border:`1px solid ${e.custom.grey[500]}`,":hover":{backgroundColor:e.custom.grey[300]},color:e.custom.grey[2800],...e.typography["body-medium"],"& ::placeholder":{...e.typography["body-medium"],color:e.custom.grey[1400]}},"&.Mui-disabled":{backgroundColor:e.custom.grey[500],":hover":{backgroundColor:e.custom.grey[500]}},"&.Mui-focused":{border:`2px solid ${e.custom.grey[2800]}`},"&.Mui-error":{border:`1px solid ${e.custom.red[600]}`,backgroundColor:e.custom.red[100],color:e.custom.red[600],":hover":{backgroundColor:e.custom.red[200]}}}));/**
457
+ */var v_;function ibe(){return v_||(v_=1,process.env.NODE_ENV!=="production"&&(function(){function e(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=I,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,i=t.useEffect,s=t.useMemo,a=t.useDebugValue;gC.useSyncExternalStoreWithSelector=function(c,u,d,p,h){var g=o(null);if(g.current===null){var m={hasValue:!1,value:null};g.current=m}else m=g.current;g=s(function(){function C(S){if(!y){if(y=!0,x=S,S=p(S),h!==void 0&&m.hasValue){var E=m.value;if(h(E,S))return w=E}return w=S}if(E=w,n(x,S))return E;var T=p(S);return h!==void 0&&h(E,T)?(x=S,E):(x=S,w=T)}var y=!1,x,w,M=d===void 0?null:d;return[function(){return C(u())},M===null?void 0:function(){return C(M())}]},[u,d,p,h]);var v=r(c,g[0],g[1]);return i(function(){m.hasValue=!0,m.value=v},[v]),a(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),gC}var C_;function sbe(){return C_||(C_=1,process.env.NODE_ENV==="production"?Uf.exports=obe():Uf.exports=ibe()),Uf.exports}sbe();function abe(e){e()}function lbe(){let e=null,t=null;return{clear(){e=null,t=null},notify(){abe(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!r||e===null||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}var b_={notify(){},get:()=>[]};function cbe(e,t){let n,r=b_,o=0,i=!1;function s(v){d();const C=r.subscribe(v);let y=!1;return()=>{y||(y=!0,C(),p())}}function a(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function u(){return i}function d(){o++,n||(n=e.subscribe(c),r=lbe())}function p(){o--,n&&o===0&&(n(),n=void 0,r.clear(),r=b_)}function h(){i||(i=!0,d())}function g(){i&&(i=!1,p())}const m={addNestedSub:s,notifyNestedSubs:a,handleChangeWrapper:c,isSubscribed:u,trySubscribe:h,tryUnsubscribe:g,getListeners:()=>r};return m}var ube=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",dbe=ube(),fbe=()=>typeof navigator<"u"&&navigator.product==="ReactNative",pbe=fbe(),hbe=()=>dbe||pbe?b.useLayoutEffect:b.useEffect,gbe=hbe(),mC=Symbol.for("react-redux-context"),vC=typeof globalThis<"u"?globalThis:{};function mbe(){if(!b.createContext)return{};const e=vC[mC]??(vC[mC]=new Map);let t=e.get(b.createContext);return t||(t=b.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(b.createContext,t)),t}var vbe=mbe();function Cbe(e){const{children:t,context:n,serverState:r,store:o}=e,i=b.useMemo(()=>{const c=cbe(o),u={store:o,subscription:c,getServerState:r?()=>r:void 0};if(process.env.NODE_ENV==="production")return u;{const{identityFunctionCheck:d="once",stabilityCheck:p="once"}=e;return Object.assign(u,{stabilityCheck:p,identityFunctionCheck:d})}},[o,r]),s=b.useMemo(()=>o.getState(),[o]);gbe(()=>{const{subscription:c}=i;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),s!==o.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[i,s]);const a=n||vbe;return b.createElement(a.Provider,{value:i},t)}var bbe=Cbe,ybe=(e,t)=>t,CC=ge([ybe,Ht,Mu,nr,VR,oa,ype,er],Epe),bC=e=>{var t=e.currentTarget.getBoundingClientRect(),n=t.width/e.currentTarget.offsetWidth,r=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/n),chartY:Math.round((e.clientY-t.top)/r)}},y_=gi("mouseClick"),x_=Q1();x_.startListening({actionCreator:y_,effect:(e,t)=>{var n=e.payload,r=CC(t.getState(),bC(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(k4e({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var yC=gi("mouseMove"),w_=Q1();w_.startListening({actionCreator:yC,effect:(e,t)=>{var n=e.payload,r=t.getState(),o=rv(r,r.tooltip.settings.shared),i=CC(r,bC(n));o==="axis"&&((i==null?void 0:i.activeIndex)!=null?t.dispatch(TR({activeIndex:i.activeIndex,activeDataKey:void 0,activeCoordinate:i.activeCoordinate})):t.dispatch(ER()))}});var S_={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index"},M_=$o({name:"rootProps",initialState:S_,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:S_.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className}}}),xbe=M_.reducer,{updateOptions:wbe}=M_.actions,E_=$o({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:Sbe}=E_.actions,Mbe=E_.reducer,T_=gi("keyDown"),O_=gi("focus"),xC=Q1();xC.startListening({actionCreator:T_,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:o}=n.tooltip,i=e.payload;if(!(i!=="ArrowRight"&&i!=="ArrowLeft"&&i!=="Enter")){var s=Number(sv(o,G0(n))),a=oa(n);if(i==="Enter"){var c=xf(n,"axis","hover",String(o.index));t.dispatch(iv({active:!o.active,activeIndex:o.index,activeDataKey:o.dataKey,activeCoordinate:c}));return}var u=b4e(n),d=u==="left-to-right"?1:-1,p=i==="ArrowRight"?1:-1,h=s+p*d;if(!(a==null||h>=a.length||h<0)){var g=xf(n,"axis","hover",String(h));t.dispatch(iv({active:!0,activeIndex:h.toString(),activeDataKey:void 0,activeCoordinate:g}))}}}}}),xC.startListening({actionCreator:O_,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:o}=n.tooltip;if(!o.active&&o.index==null){var i="0",s=xf(n,"axis","hover",String(i));t.dispatch(iv({activeDataKey:void 0,active:!0,activeIndex:i,activeCoordinate:s}))}}}});var xi=gi("externalEvent"),k_=Q1();k_.startListening({actionCreator:xi,effect:(e,t)=>{if(e.payload.handler!=null){var n=t.getState(),r={activeCoordinate:upe(n),activeDataKey:$R(n),activeIndex:ia(n),activeLabel:HR(n),activeTooltipIndex:ia(n),isTooltipActive:dpe(n)};e.payload.handler(r,e.payload.reactEvent)}}});var Ebe=ge([q0],e=>e.tooltipItemPayloads),Tbe=ge([Ebe,Lu,(e,t,n)=>t,(e,t,n)=>n],(e,t,n,r)=>{var o=e.find(a=>a.settings.dataKey===r);if(o!=null){var{positions:i}=o;if(i!=null){var s=t(i,n);return s}}}),P_=gi("touchMove"),L_=Q1();L_.startListening({actionCreator:P_,effect:(e,t)=>{var n=e.payload,r=t.getState(),o=rv(r,r.tooltip.settings.shared);if(o==="axis"){var i=CC(r,bC({clientX:n.touches[0].clientX,clientY:n.touches[0].clientY,currentTarget:n.currentTarget}));(i==null?void 0:i.activeIndex)!=null&&t.dispatch(TR({activeIndex:i.activeIndex,activeDataKey:void 0,activeCoordinate:i.activeCoordinate}))}else if(o==="item"){var s,a=n.touches[0],c=document.elementFromPoint(a.clientX,a.clientY);if(!c||!c.getAttribute)return;var u=c.getAttribute(jg),d=(s=c.getAttribute(Ig))!==null&&s!==void 0?s:void 0,p=Tbe(t.getState(),u,d);t.dispatch(MR({activeDataKey:d,activeIndex:u,activeCoordinate:p}))}}});var Obe=vL({brush:xme,cartesianAxis:The,chartData:Fpe,errorBars:yge,graphicalItems:Z9e,layout:Aue,legend:w3e,options:Vpe,polarAxis:K8e,polarOptions:Mbe,referenceElements:Ime,rootProps:xbe,tooltip:P4e}),kbe=function(t){return oue({reducer:Obe,preloadedState:t,middleware:n=>n({serializableCheck:!1}).concat([x_.middleware,w_.middleware,xC.middleware,k_.middleware,L_.middleware]),devTools:vs.devToolsEnabled})};function j_(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,o=lr(),i=I.useRef(null);if(o)return n;i.current==null&&(i.current=kbe(t));var s=ig;return b.createElement(bbe,{context:s,store:i.current},n)}function I_(e){var{layout:t,width:n,height:r,margin:o}=e,i=kn(),s=lr();return I.useEffect(()=>{s||(i(Lue(t)),i(jue({width:n,height:r})),i(Pue(o)))},[i,s,t,n,r,o]),null}function A_(e){var t=kn();return I.useEffect(()=>{t(wbe(e))},[t,e]),null}var Pbe=["children"];function Lbe(e,t){if(e==null)return{};var n,r,o=jbe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function jbe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function qf(){return qf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qf.apply(null,arguments)}var Ibe={width:"100%",height:"100%"},Abe=I.forwardRef((e,t)=>{var n=gj(),r=mj(),o=Sj();if(!R0(n)||!R0(r))return null;var{children:i,otherAttributes:s,title:a,desc:c}=e,u,d;return typeof s.tabIndex=="number"?u=s.tabIndex:u=o?0:void 0,typeof s.role=="string"?d=s.role:d=o?"application":void 0,b.createElement($k,qf({},s,{title:a,desc:c,role:d,tabIndex:u,width:n,height:r,style:Ibe,ref:t}),i)}),Rbe=e=>{var{children:t}=e,n=Xe(I5);if(!n)return null;var{width:r,height:o,y:i,x:s}=n;return b.createElement($k,{width:r,height:o,x:s,y:i},t)},R_=I.forwardRef((e,t)=>{var{children:n}=e,r=Lbe(e,Pbe),o=lr();return o?b.createElement(Rbe,null,n):b.createElement(Abe,qf({ref:t},r),n)});function Dbe(){var e=kn(),[t,n]=I.useState(null),r=Xe(c3e);return I.useEffect(()=>{if(t!=null){var o=t.getBoundingClientRect(),i=o.width/t.offsetWidth;Fo(i)&&i!==r&&e(Iue(i))}},[t,e,r]),n}function D_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Vbe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?D_(Object(n),!0).forEach(function(r){_be(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _be(e,t,n){return(t=Nbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nbe(e){var t=Hbe(e,"string");return typeof t=="symbol"?t:t+""}function Hbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $be=I.forwardRef((e,t)=>{var{children:n,className:r,height:o,onClick:i,onContextMenu:s,onDoubleClick:a,onMouseDown:c,onMouseEnter:u,onMouseLeave:d,onMouseMove:p,onMouseUp:h,onTouchEnd:g,onTouchMove:m,onTouchStart:v,style:C,width:y}=e,x=kn(),[w,M]=I.useState(null),[S,E]=I.useState(null);Ype();var T=Dbe(),O=I.useCallback(X=>{T(X),typeof t=="function"&&t(X),M(X),E(X)},[T,t,M,E]),P=I.useCallback(X=>{x(y_(X)),x(xi({handler:i,reactEvent:X}))},[x,i]),k=I.useCallback(X=>{x(yC(X)),x(xi({handler:u,reactEvent:X}))},[x,u]),L=I.useCallback(X=>{x(ER()),x(xi({handler:d,reactEvent:X}))},[x,d]),j=I.useCallback(X=>{x(yC(X)),x(xi({handler:p,reactEvent:X}))},[x,p]),A=I.useCallback(()=>{x(O_())},[x]),R=I.useCallback(X=>{x(T_(X.key))},[x]),_=I.useCallback(X=>{x(xi({handler:s,reactEvent:X}))},[x,s]),N=I.useCallback(X=>{x(xi({handler:a,reactEvent:X}))},[x,a]),z=I.useCallback(X=>{x(xi({handler:c,reactEvent:X}))},[x,c]),B=I.useCallback(X=>{x(xi({handler:h,reactEvent:X}))},[x,h]),$=I.useCallback(X=>{x(xi({handler:v,reactEvent:X}))},[x,v]),V=I.useCallback(X=>{x(P_(X)),x(xi({handler:m,reactEvent:X}))},[x,m]),H=I.useCallback(X=>{x(xi({handler:g,reactEvent:X}))},[x,g]);return b.createElement(KR.Provider,{value:w},b.createElement(_0e.Provider,{value:S},b.createElement("div",{className:ae("recharts-wrapper",r),style:Vbe({position:"relative",cursor:"default",width:y,height:o},C),onClick:P,onContextMenu:_,onDoubleClick:N,onFocus:A,onKeyDown:R,onMouseDown:z,onMouseEnter:k,onMouseLeave:L,onMouseMove:j,onMouseUp:B,onTouchEnd:H,onTouchMove:V,onTouchStart:$,ref:O},n)))}),Fbe=["children","className","width","height","style","compact","title","desc"];function Bbe(e,t){if(e==null)return{};var n,r,o=zbe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function zbe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var V_=I.forwardRef((e,t)=>{var{children:n,className:r,width:o,height:i,style:s,compact:a,title:c,desc:u}=e,d=Bbe(e,Fbe),p=ar(d);return a?b.createElement(R_,{otherAttributes:p,title:c,desc:u},n):b.createElement($be,{className:r,style:s,width:o,height:i,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},b.createElement(R_,{otherAttributes:p,title:c,desc:u,ref:t},b.createElement(Ame,null,n)))}),Zbe=["width","height"];function wC(){return wC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wC.apply(null,arguments)}function Wbe(e,t){if(e==null)return{};var n,r,o=Ube(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Ube(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var qbe={top:5,right:5,bottom:5,left:5},Gbe={accessibilityLayer:!0,layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:qbe,reverseStackOrder:!1,syncMethod:"index"},Gf=I.forwardRef(function(t,n){var r,o=Un(t.categoricalChartProps,Gbe),{width:i,height:s}=o,a=Wbe(o,Zbe);if(!R0(i)||!R0(s))return null;var{chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:d,tooltipPayloadSearcher:p,categoricalChartProps:h}=t,g={chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:d,tooltipPayloadSearcher:p,eventEmitter:void 0};return b.createElement(j_,{preloadedState:{options:g},reduxStoreName:(r=h.id)!==null&&r!==void 0?r:c},b.createElement(ZV,{chartData:h.data}),b.createElement(I_,{width:i,height:s,layout:o.layout,margin:o.margin}),b.createElement(A_,{accessibilityLayer:o.accessibilityLayer,barCategoryGap:o.barCategoryGap,maxBarSize:o.maxBarSize,stackOffset:o.stackOffset,barGap:o.barGap,barSize:o.barSize,syncId:o.syncId,syncMethod:o.syncMethod,className:o.className}),b.createElement(V_,wC({},a,{width:i,height:s,ref:n})))}),Kbe=["axis"],SC=I.forwardRef((e,t)=>b.createElement(Gf,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Kbe,tooltipPayloadSearcher:K0,categoricalChartProps:e,ref:t})),Ybe=["axis","item"],Kf=I.forwardRef((e,t)=>b.createElement(Gf,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Ybe,tooltipPayloadSearcher:K0,categoricalChartProps:e,ref:t}));function Xbe(e){var t=kn();return I.useEffect(()=>{t(Sbe(e))},[t,e]),null}var Jbe=["width","height","layout"];function MC(){return MC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},MC.apply(null,arguments)}function Qbe(e,t){if(e==null)return{};var n,r,o=eye(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function eye(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var tye={top:5,right:5,bottom:5,left:5},nye={accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:tye,reverseStackOrder:!1,syncMethod:"index",layout:"radial"},__=I.forwardRef(function(t,n){var r,o=Un(t.categoricalChartProps,nye),{width:i,height:s,layout:a}=o,c=Qbe(o,Jbe);if(!R0(i)||!R0(s))return null;var{chartName:u,defaultTooltipEventType:d,validateTooltipEventTypes:p,tooltipPayloadSearcher:h}=t,g={chartName:u,defaultTooltipEventType:d,validateTooltipEventTypes:p,tooltipPayloadSearcher:h,eventEmitter:void 0};return b.createElement(j_,{preloadedState:{options:g},reduxStoreName:(r=o.id)!==null&&r!==void 0?r:u},b.createElement(ZV,{chartData:o.data}),b.createElement(I_,{width:i,height:s,layout:a,margin:o.margin}),b.createElement(A_,{accessibilityLayer:o.accessibilityLayer,barCategoryGap:o.barCategoryGap,maxBarSize:o.maxBarSize,stackOffset:o.stackOffset,barGap:o.barGap,barSize:o.barSize,syncId:o.syncId,syncMethod:o.syncMethod,className:o.className}),b.createElement(Xbe,{cx:o.cx,cy:o.cy,startAngle:o.startAngle,endAngle:o.endAngle,innerRadius:o.innerRadius,outerRadius:o.outerRadius}),b.createElement(V_,MC({width:i,height:s},c,{ref:n})))}),rye=["item"],oye={layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},Yf=I.forwardRef((e,t)=>{var n=Un(e,oye);return b.createElement(__,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:rye,tooltipPayloadSearcher:K0,categoricalChartProps:n,ref:t})}),iye=["axis"],sye={layout:"centric",startAngle:90,endAngle:-270,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},EC=I.forwardRef((e,t)=>{var n=Un(e,sye);return b.createElement(__,{chartName:"RadarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:iye,tooltipPayloadSearcher:K0,categoricalChartProps:n,ref:t})}),aye=["item"],lye=I.forwardRef((e,t)=>b.createElement(Gf,{chartName:"ScatterChart",defaultTooltipEventType:"item",validateTooltipEventTypes:aye,tooltipPayloadSearcher:K0,categoricalChartProps:e,ref:t})),cye=["axis"],TC=I.forwardRef((e,t)=>b.createElement(Gf,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:cye,tooltipPayloadSearcher:K0,categoricalChartProps:e,ref:t}));const Gu=e=>{const{coordinate:t,customY:n,placement:r="top",offset:o={x:0,y:0}}=e,i=n??t.y,s=t.x;let a,c,u;switch(r){case"top":c=s+o.x,u=i+o.y,a="translate(-50%, -100%)";break;case"bottom":c=s+o.x,u=i+o.y,a="translate(-50%, 0%)";break;case"left":c=s+o.x,u=i+o.y,a="translate(-100%, -50%)";break;case"right":c=s+o.x,u=i+o.y,a="translate(0%, -50%)";break;default:c=s+o.x,u=i+o.y,a="translate(-50%, -100%)"}return{position:"absolute",left:c,top:u,transform:a,zIndex:1e3,pointerEvents:"none"}},Ku=()=>({pointerEvents:"none","& *":{pointerEvents:"none"}}),N_=e=>{const{active:t,payload:n,formatter:r,unit:o,coordinate:i,icons:s}=e,a=ce();if(!t||!n||!n.length||!i)return null;const c=n[0],u=r?r(c.value):a.numbers.valueFormatterFn(c.value),d=m=>{if(m===void 0)return"top";const v=(m%360+360)%360;return v>=315||v<45?"right":v>=45&&v<135?"top":v>=135&&v<225?"left":"bottom"},p=f.jsxs(le,{direction:"column",alignItems:"flex-start",justifyContent:"center",spacing:a.spacing(1),children:[f.jsxs(le,{direction:"row",alignItems:"center",spacing:a.spacing(1),children:[s&&c.payload&&c.payload.index!==void 0&&s[c.payload.index]?f.jsx(K,{minWidth:"24px",width:"24px",height:"24px",sx:{background:c.payload.color||"#ccc",padding:"4px",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"3px"},children:s[c.payload.index]}):f.jsx(K,{sx:{width:"12px",height:"12px",borderRadius:"3px",backgroundColor:c.payload.color}}),f.jsx(ie,{variant:"h6",children:c.name})]}),f.jsxs(le,{direction:"row",alignItems:"flex-end",spacing:.5,children:[f.jsx(ie,{variant:"number-inter",sx:{p:0,m:0,lineHeight:a.spacing(4)},children:u}),f.jsx(ie,{variant:"small-bold",color:a.custom.grey[1400],children:o})]})]}),h=d(i.angle),g=Gu({coordinate:{x:i.x,y:i.y},placement:h});return c.name&&f.jsx(K,{sx:g,children:f.jsx(di,{width:"max-content",title:p,placement:h,arrow:!0,open:!0,sx:Ku(),children:f.jsx("div",{style:{width:1,height:1,visibility:"hidden",pointerEvents:"none"}})})})},uye=300,OC="78%",kC="100%",PC="50%",LC="50%",dye=300,fye=0,pye=.4,hye=2,gye="0.2s",mye=1,vye=2,jC=e=>{var M,S,E;const t=ce(),{data:n,HoveredChartElementIndex:r,spacing:o=vye,borderWidth:i,borderColor:s,showTooltip:a,tooltipPos:c,valuesFormatterFn:u=T=>t.numbers.valueFormatterFn(T,0),language:d,valuesUnit:p,icons:h,isLoading:g,height:m,onMouseEnter:v,onMouseLeave:C,onLegendAction:y}=e,x=typeof m=="number"?m:uye,w=n.length===0||n.every(T=>T.value===0);if(g){const T=t.palette.action.hover;return f.jsx(K,{position:"relative",width:"100%",height:x,sx:{"@keyframes pulse":{"0%":{opacity:.2},"50%":{opacity:1},"100%":{opacity:.2}}},children:f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsx(Yf,{children:f.jsx(l2,{data:[{name:"loading",value:1}],cx:PC,cy:LC,innerRadius:OC,outerRadius:kC,dataKey:"value",isAnimationActive:!1,stroke:"none",style:{pointerEvents:"none"},children:f.jsx(yo,{fill:T,style:{animation:"pulse 1.5s ease-in-out infinite"}})})})})})}return f.jsxs(K,{position:"relative",width:"100%",height:x,children:[f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(Yf,{children:[f.jsx(l2,{data:n,cx:PC,cy:LC,innerRadius:OC,outerRadius:kC,paddingAngle:o,minAngle:.5,dataKey:"value",isAnimationActive:!0,animationDuration:dye,animationBegin:fye,onMouseEnter:v,onMouseLeave:C,onClick:(T,O)=>{y&&y(O)},stroke:"none",style:{outline:"none"},children:n.map((T,O)=>{const P=r===O,k=r===null||P?T.color:bt(T.color).alpha(pye).css();return f.jsx(yo,{fill:k,strokeWidth:i,stroke:s,style:{filter:P?`drop-shadow(0 0 ${hye}px ${T.color})`:"none",cursor:"pointer",transition:`all ${gye} ease-in-out`},className:P?"cell-hovered":"cell-idle"},`cell-${O}`)})}),w&&f.jsx(l2,{data:[{name:"empty",value:mye}],cx:PC,cy:LC,isAnimationActive:!1,innerRadius:OC,outerRadius:kC,stroke:"none",dataKey:"value",fill:t.palette.action.hover||"rgba(0, 0, 0, 0)"})]})}),a&&f.jsx(N_,{active:r!==null,payload:r!==null?[{name:((M=n[r])==null?void 0:M.name)??"",value:((S=n[r])==null?void 0:S.value)??0,color:((E=n[r])==null?void 0:E.color)??"",payload:n[r]||{}}]:[],formatter:u,language:d,unit:p,coordinate:c,icons:h})]})},Cye=2,bye=0,yye=2,xye="900px",wye=100,Sye=700,Mye="28px auto",Eye=6,H_="0.2s",Yu=1,$_=100,Tye=e=>{const t=ce(),{values:n,labels:r,colors:o,legend:i,children:s,valuesUnit:a,className:c,valuesFormatterFn:u=t.numbers.valueFormatterFn,createPalette:d=!0,isLoading:p=!1,displayTotal:h=!0,fullWidthLegend:g=!1,displayTotalVariant:m="number-big",spacing:v=Cye,borderWidth:C=bye,borderColor:y,hoverOffset:x=yye,icons:w,showTooltip:M=!0,width:S=xye}=e,E=I.useRef(null),T=I.useRef(null),O=vn.language,P=fo(t.breakpoints.down("md")),k=pk(t,wye,Sye),L=(i==null?void 0:i.position)??"bottom",j=d?hk(o&&o.length?o:k,n??[]):o??k,A=Ck(n,r,j),R=xk(n,h),_=yk(s,h,R,u),{HoveredChartElementIndex:N,tooltipPos:z,handleLegendHover:B,handleMouseEnter:$,handleMouseOut:V}=wk(A,E);return f.jsxs(le,{direction:L==="bottom"||P?"column":"row",gap:t.spacing(Eye),className:`doughnut-chart ${c}`,ref:T,sx:{maxWidth:S,width:"100%"},children:[f.jsx(le,{sx:{flex:1},children:f.jsxs(K,{position:"relative",margin:Mye,sx:{"& *":{outline:"none"},".cell-hovered":{animation:`cell-hovered ${H_} ease-in-out forwards`,transformOrigin:"center"},".cell-idle":{transform:`scale(${Yu})`,transformOrigin:"center",animation:`cell-idle ${H_} ease-in-out forwards`},"@keyframes cell-hovered":{"0%":{transform:`scale(${Yu})`},"100%":{transform:`scale(${Yu+x/$_})`},"@keyframes cell-idle":{"0%":{transform:`scale(${Yu+x/$_})`},"100%":{transform:`scale(${Yu})`}}},width:"100%"},className:"doughnut-chart-wrapper",id:"doughnut-chart-wrapper",ref:E,children:[f.jsx(jC,{data:A,HoveredChartElementIndex:N,spacing:v,borderWidth:C,borderColor:y,showTooltip:M,tooltipPos:z,isLoading:p,valuesFormatterFn:u,language:O,valuesUnit:a,icons:w,onMouseEnter:$,onMouseLeave:V,onLegendAction:H=>{var X,Q,ne;(X=i==null?void 0:i.actions)!=null&&X[H]&&((ne=(Q=i.actions)[H])==null||ne.call(Q))}}),f.jsx(Sk,{isLoading:p,displayValue:_,displayTotalVariant:m,valuesUnit:a,displayTotal:h,isEmpty:A.length===0})]})}),f.jsx(K,{display:"flex",width:g?"100%":"inherit",sx:{width:g?"100%":"inherit",flex:1},children:i&&f.jsx(J9,{labels:r,hoveredDatasetIndex:N,onLegendHover:B,values:n,colors:j,legend:i,icons:w,chartRef:E})})]})},Oye=()=>{const[e,t]=I.useState(null),[n,r]=I.useState(null),[o,i]=I.useState(null),[s,a]=I.useState(null),[c,u]=I.useState(!1),d=I.useRef(null),p=I.useRef(!1);I.useEffect(()=>{p.current=c},[c]);const h=I.useCallback(()=>{d.current&&(clearTimeout(d.current),d.current=null)},[]),g=I.useCallback((M,S,E)=>{h(),u(!1),t(S),r({xValue:(E==null?void 0:E.x)??M.x,yValue:(E==null?void 0:E.y)??M.y,dataX:M.x,dataY:M.y,pixelX:(E==null?void 0:E.x)??M.x,pixelY:(E==null?void 0:E.y)??M.y})},[h]),m=I.useCallback((M,S,E)=>{h(),i(S),a({xValue:(E==null?void 0:E.x)??M.x,yValue:(E==null?void 0:E.y)??M.y,dataX:M.x,dataY:M.y,pixelX:(E==null?void 0:E.x)??M.x,pixelY:(E==null?void 0:E.y)??M.y}),u(!0)},[h]),v=I.useCallback(()=>{h(),p.current||(t(null),r(null))},[h]),C=I.useCallback(()=>{h()},[h]),y=I.useCallback(()=>{h(),p.current||(d.current=setTimeout(()=>{t(null),r(null)},1e3))},[h]),x=I.useCallback(()=>{p.current||(h(),t(null),r(null))},[h]),w=I.useCallback(()=>{h(),i(null),a(null),r(null),u(!1)},[h]);return{hoveredIndex:e,hover:n,pinnedIndex:o,pinnedHover:s,isPinned:c,handlePointEnter:g,handlePointClick:m,handlePointLeave:v,handleTooltipEnter:C,handleTooltipLeave:y,handleChartMouseLeave:x,handleDismissTooltip:w}},kye=20,F_=15,Pye=e=>{const t=ce(),{hover:n,valueFormatterFn:r=t.numbers.valueFormatterFn,precision:o,xDomain:i,yDomain:s}=e;if(!n)return null;const a=w=>parseFloat(t.spacing(w)),c=12,u=.6,d=a(1),p=a(2.5),h=a(3.75),g=a(0),m=t.shape.borderRadius??4,v=t.custom.grey[2800],C=t.palette.common.white,y=w=>r(w,o),x=w=>Math.max(h,Math.round(w.length*c*u)+2*d);return f.jsxs(f.Fragment,{children:[f.jsx(Wu,{segment:[{x:i[0],y:n.dataY},{x:n.dataX,y:n.dataY}],stroke:t.palette.text.primary,label:w=>{const{viewBox:M}=w;if(!M||!n)return f.jsx("g",{});const S=y(n.dataY),E=x(S),T=M.x-g-E-F_,O=M.y-p/2,P=T+E/2,k=O+p/2+1;return f.jsxs("g",{style:{pointerEvents:"none"},children:[f.jsx("line",{x1:M.x,y1:M.y,x2:M.x-F_,y2:M.y,stroke:t.palette.text.primary,strokeWidth:1}),f.jsx("rect",{x:T,y:O,width:E,height:p,fill:v,rx:m}),f.jsx("text",{x:P,y:k,fill:C,fontSize:c,fontWeight:600,textAnchor:"middle",dominantBaseline:"middle",children:S})]})}}),f.jsx(Wu,{segment:[{x:n.dataX,y:s[0]},{x:n.dataX,y:n.dataY}],stroke:t.palette.text.primary,label:w=>{const{viewBox:M}=w;if(!M||!n)return f.jsx("g",{});const S=y(n.dataX),E=x(S),T=M.x-E/2,O=M.y+M.height+kye,P=T+E/2,k=O+p/2+1;return f.jsxs("g",{style:{pointerEvents:"none"},children:[f.jsx("line",{x1:T+E/2,y1:O+p,x2:T+E/2,y2:O-p,stroke:t.palette.text.primary,strokeWidth:1}),f.jsx("rect",{x:T,y:O,width:E,height:p,fill:v,rx:m}),f.jsx("text",{x:P,y:k,fill:C,fontSize:c,fontWeight:600,textAnchor:"middle",dominantBaseline:"middle",children:S})]})}})]})},Lye={x:0,y:-5},jye=I.forwardRef((e,t)=>{var T,O,P,k,L,j,A;const n=ce(),{point:r,coordinate:o,valueFormatterFn:i=n.numbers.valueFormatterFn,precision:s,unit:a,xUnit:c,yUnit:u,textOptions:d,showSeriesInTooltip:p=!0,tooltipOptions:h,onTooltipEnter:g,onTooltipLeave:m,handleDismissTooltip:v}=e,C=r.seriesName,y=u??a,x=c??a,w=(d==null?void 0:d.for)??"for",M=()=>f.jsx(K,{role:"button",onClick:()=>v==null?void 0:v(),sx:{cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:n.spacing(.25),height:n.spacing(2.75),width:n.spacing(2.75),transform:`translate(${n.spacing(1.25)}, -${n.spacing(1.25)}) rotate(45deg)`,borderRadius:"50%","&:hover":{color:n.palette.common.white,backgroundColor:"text.secondary",boxShadow:"0px 0px 4px rgba(0, 0, 0, 0.1)"}},children:f.jsx(Ct,{icon:"plus",size:2})}),S=f.jsxs(le,{direction:"column",spacing:n.spacing(.5),pb:n.spacing(.25),onClick:R=>R.stopPropagation(),onMouseLeave:()=>m==null?void 0:m(),sx:{pointerEvents:"auto"},children:[f.jsxs(le,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:n.spacing(1),children:[f.jsx(ie,{variant:"h4",lineHeight:n.spacing(2),children:r.label}),f.jsx(M,{})]}),f.jsxs(le,{pt:n.spacing(1),direction:"row",spacing:n.spacing(.5),alignItems:"center",flexWrap:"wrap",children:[f.jsx(ie,{variant:"number-small",lineHeight:n.spacing(2),color:"text.primary",children:i(r.y,s)}),f.jsx(ie,{variant:"body2",lineHeight:n.spacing(2),color:"text.secondary",children:y?` ${y}`:""}),f.jsx(ie,{variant:"body2",lineHeight:n.spacing(2),color:"text.primary",children:w}),f.jsx(ie,{variant:"number-small",lineHeight:n.spacing(2),color:"text.primary",children:i(r.x,s)}),f.jsx(ie,{variant:"body2",lineHeight:n.spacing(2),color:"text.secondary",children:x?` ${x}`:""})]}),r.additionalContent&&f.jsx(K,{sx:{pt:n.spacing(2)},children:r.additionalContent}),C&&p&&f.jsx(le,{direction:"row",alignItems:"flex-end",justifyContent:"flex-end",spacing:n.spacing(1),pt:n.spacing(2),children:f.jsxs(le,{direction:"row",alignItems:"center",spacing:n.spacing(1),children:[f.jsx(K,{sx:{width:n.spacing(1.5),height:n.spacing(1.5),borderRadius:"50%",backgroundColor:r.seriesColor}}),f.jsx(ie,{variant:"body2",lineHeight:n.spacing(2),color:"text.secondary",fontWeight:500,children:C})]})}),h!=null&&h.button?h.button.href?f.jsx(d6,{href:h.button.href,target:"_blank",rel:"noopener noreferrer",children:f.jsx(it,{sx:{color:n.palette.text.primary,mt:n.spacing(2)},variant:(T=h==null?void 0:h.button)==null?void 0:T.variant,size:(O=h==null?void 0:h.button)==null?void 0:O.size,startIcon:(P=h==null?void 0:h.button)==null?void 0:P.startIcon,onClick:R=>{var _,N;R.stopPropagation(),(N=(_=h==null?void 0:h.button)==null?void 0:_.onClick)==null||N.call(_)},children:h.button.text})}):f.jsx(it,{sx:{mt:n.spacing(2)},variant:(k=h==null?void 0:h.button)==null?void 0:k.variant,size:(L=h==null?void 0:h.button)==null?void 0:L.size,startIcon:(j=h==null?void 0:h.button)==null?void 0:j.startIcon,onClick:R=>{var _,N;R.stopPropagation(),(N=(_=h==null?void 0:h.button)==null?void 0:_.onClick)==null||N.call(_)},children:(A=h==null?void 0:h.button)==null?void 0:A.text}):null]}),E=Gu({coordinate:{x:o.xValue,y:o.yValue},placement:"top",offset:Lye});return f.jsx(K,{ref:t,style:{position:"absolute",...E,zIndex:n.zIndex.tooltip,pointerEvents:"auto"},onMouseEnter:g,onMouseLeave:m,children:f.jsx(di,{width:"inherit",title:S,placement:"top",arrow:!0,open:!0,sx:{...Ku()},children:f.jsx("div",{style:{width:1,height:1,visibility:"hidden",pointerEvents:"none"}})})})}),IC=8,B_=12,z_=8,Iye=.6,Aye=45,Z_=40,Rye=30,Dye=15,W_=200,Vye=10,_ye=250,Nye=(e,t)=>{const n=[],r=Object.keys(t);e.forEach((i,s)=>{const c=(s+1)%r.length+1,u=t[c].main,d=i.color||u;i.data.forEach(p=>{n.push({...p,pointIndex:n.length,seriesIndex:s,seriesName:i.name,seriesColor:d})})});const o=n.length<=Vye;return{allPoints:n,shouldShowLabels:o}},Hye=(e,t,n)=>{const r=Object.keys(t);return e.map((o,i)=>{const a=(i+1)%r.length+1,c=t[a].main;return{seriesId:i,name:o.name,color:o.color||c,points:o.data.map(u=>({...u,pointIndex:n.findIndex(d=>d.seriesIndex===i&&d.x===u.x&&d.y===u.y&&d.label===u.label)}))}})},$ye=e=>Math.round(e.length*B_*Iye),Fye=(e,t,n,r)=>{const o=r>0?r-Z_:Number.POSITIVE_INFINITY,i=e+IC+z_,s=e-IC-z_,a=$ye(n),u=i+a>o;return{x:u?s:i,y:t,anchor:u?"end":"start"}},Bye=e=>{const{groupedData:t,allPoints:n,hoveredIndex:r,pinnedIndex:o,isTooltipActive:i,isAnimationActive:s,shouldShowLabels:a,containerWidth:c,onPointEnter:u,onPointLeave:d,onPointClick:p}=e,h=ce(),g=m=>{const{x:v,y:C,cx:y,cy:x,value:w,payload:M}=m,E=(M==null?void 0:M.label)||(typeof w=="number"?String(w):(w??"").toString());if(!E)return null;const T=typeof y=="number"?y:typeof v=="number"?v:void 0,O=typeof x=="number"?x:typeof C=="number"?C:void 0;if(T===void 0||O===void 0)return null;const{x:P,y:k,anchor:L}=Fye(T,O,E,c);return f.jsx("g",{style:{pointerEvents:"none"},children:f.jsx("text",{x:P,y:k+1,fill:h.palette.text.primary,fontSize:B_,fontWeight:600,textAnchor:L,dominantBaseline:"middle",children:E})})};return f.jsx(f.Fragment,{children:t.map(m=>f.jsx(g_,{isAnimationActive:!1,fill:m.color,data:m.points.map(v=>{const C=r!==null&&v.pointIndex!==r;return{...v,label:v.label,fill:m.color,opacity:C?.4:1,r:IC}}),shape:v=>{const{cx:C,cy:y,r:x,fill:w}=v,M=v.pointIndex,S=r!==null&&M!==r,T={cursor:"pointer",...M!==void 0&&M===o&&i?{filter:"drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5))",stroke:"#fff",strokeWidth:2}:{filter:"none"}};return f.jsx(Ef,{cx:C,cy:y,r:x,fill:w,"data-scatter-point":"true",style:_ye<=n.length?T:{...T,transform:`scale(${s?0:1})`,transformOrigin:"50% 50%",opacity:S?.4:1,transition:`all ${W_}ms cubic-bezier(0.86, 0, 0.07, 1)`},onMouseEnter:()=>{if(typeof M=="number"){const O=n[M];O&&u(O,M,{x:C,y})}},onMouseLeave:()=>{d()},onClick:()=>{if(typeof M=="number"){const O=n[M];if(O){const P={stopPropagation:()=>{}};p==null||p(O,M,{x:C,y},P)}}}})},children:a&&f.jsx(Ga,{dataKey:"label",content:g})},m.seriesId))})},zye=e=>{const t=ce(),{values:n,valueFormatterFn:r=t.numbers.valueFormatterFn,precision:o,language:i,unit:s,xUnit:a,yUnit:c,textOptions:u,showSeriesInTooltip:d=!0,tooltipOptions:p}=e,{hoveredIndex:h,hover:g,pinnedIndex:m,pinnedHover:v,isPinned:C,handlePointEnter:y,handlePointClick:x,handlePointLeave:w,handleTooltipEnter:M,handleTooltipLeave:S,handleDismissTooltip:E}=Oye(),{allPoints:T,shouldShowLabels:O}=I.useMemo(()=>Nye(n,t.custom.dataviz.colorsWithExtra),[n,t.custom.dataviz.colorsWithExtra]),P=I.useMemo(()=>Hye(n,t.custom.dataviz.colorsWithExtra,T),[n,t.custom.dataviz.colorsWithExtra,T]),{xDomain:k,yDomain:L}=I.useMemo(()=>{const H=n.flatMap(Y=>Y.data);if(H.length===0)return{xDomain:[0,100],yDomain:[0,100]};const X=H.map(Y=>Y.x),Q=H.map(Y=>Y.y),ne=Math.min(...X),q=Math.max(...X),J=Math.min(...Q),te=Math.max(...Q);return{xDomain:[Math.max(0,ne),q],yDomain:[Math.max(0,J),te]}},[n]),[j,A]=I.useState(!0),R=I.useRef(null),_=I.useRef(null),[N,z]=I.useState(0),B=i??vn.language,$=typeof o=="number"?Math.min(100,Math.max(0,o)):void 0,V=I.useCallback(H=>r(H,$),[r,$]);return I.useEffect(()=>{const H=setTimeout(()=>{A(!1)},W_);return()=>clearTimeout(H)},[]),I.useEffect(()=>{const H=R.current;if(!H)return;const X=()=>z(H.clientWidth);X();const Q=new ResizeObserver(X);return Q.observe(H),()=>Q.disconnect()},[]),f.jsxs(K,{onClick:H=>{const X=H.target;if(X.classList.contains("recharts-dot"))return;const Q=_.current;Q&&Q.contains(X)||E()},onMouseLeave:()=>E(),ref:R,sx:{position:"relative",width:"100%",height:"100%"},children:[f.jsx(fr,{width:"100%",height:"100%",children:f.jsxs(lye,{margin:{top:Aye,right:Z_,left:Rye,bottom:Dye},children:[f.jsx(Zi,{strokeDasharray:"4 4",stroke:t.palette.divider}),f.jsx(yi,{type:"number",dataKey:"x",domain:k,tickLine:!1,axisLine:{stroke:t.palette.divider},tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateY(${t.spacing(2)})`}},tickFormatter:V,allowDecimals:!0}),f.jsx(qo,{type:"number",dataKey:"y",domain:L,tickLine:!1,axisLine:{stroke:t.palette.divider},tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateX(-${t.spacing(2)})`,pointerEvents:"none"}},tickFormatter:V,allowDecimals:!0,style:{pointerEvents:"none"}}),f.jsx(Pye,{hover:g,valueFormatterFn:r,precision:$,language:B,xDomain:k,yDomain:L}),f.jsx(Bye,{groupedData:P,allPoints:T,hoveredIndex:h,pinnedIndex:m,isTooltipActive:!!(C&&m!==null&&v&&T[m]),isAnimationActive:j,shouldShowLabels:O,containerWidth:N,onPointEnter:y,onPointLeave:w,onPointClick:(H,X,Q,ne)=>{ne.stopPropagation(),x(H,X,Q)}})]})}),!!(C&&m!==null&&v&&T[m])&&f.jsx(jye,{ref:_,point:T[m],coordinate:v,series:n,valueFormatterFn:r,precision:o,unit:s,xUnit:a,yUnit:c,textOptions:u,showSeriesInTooltip:d,handleDismissTooltip:E,tooltipOptions:p,onTooltipEnter:M,onTooltipLeave:S})]})},Zye=e=>{const{values:t,xLabel:n,yLabel:r,width:o="100%",height:i="800px",valueFormatterFn:s,precision:a,language:c,unit:u,xUnit:d,yUnit:p,textOptions:h,onLegendHover:g,tooltipOptions:m}=e,v=ce(),[C,y]=I.useState(new Set),x=I.useMemo(()=>t.length<=1?t:t.map((M,S)=>({...M,data:C.has(S)?[]:M.data})).filter(M=>M.data.length>0),[t,C]),w=M=>{t.length<=1||y(S=>{const E=new Set(S);return E.has(M)?E.delete(M):E.size<t.length-1&&E.add(M),E})};return f.jsxs(f.Fragment,{children:[f.jsx(le,{direction:"column",position:"relative",width:o,minHeight:v.spacing(50),height:i,justifyContent:"stretch",sx:{"& *":{outline:"none"}},children:f.jsxs(K,{sx:{border:`1px solid ${v.palette.divider}`,backgroundColor:v.palette.background.paper,borderRadius:v.spacing(1),width:"100%",height:i,padding:v.spacing(3),display:"flex",flexDirection:"column"},children:[f.jsx(K,{sx:{mb:v.spacing(2),pointerEvents:"none"},children:f.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx(ie,{variant:"h4",children:r}),f.jsx(ie,{variant:"body",children:"-"}),f.jsx(ie,{variant:"body",children:p})]})}),f.jsx(K,{sx:{position:"relative",width:"100%",flex:1},children:f.jsx(zye,{values:x,valueFormatterFn:s,precision:a,language:c,unit:u,xUnit:d,yUnit:p,textOptions:h,onLegendHover:g,tooltipOptions:m,showSeriesInTooltip:t.length>1})}),f.jsx(K,{sx:{mt:v.spacing(2),display:"flex",justifyContent:"flex-end",pointerEvents:"none"},children:f.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:".5rem"},children:[f.jsx(ie,{variant:"h4",children:n}),f.jsx(ie,{variant:"body",children:"-"}),f.jsx(ie,{variant:"body",children:d})]})})]})}),t&&t.length>0&&f.jsx(K,{sx:{mt:v.spacing(4),pb:v.spacing(4)},children:f.jsx(K,{sx:{display:"flex",justifyContent:"flex-start",flexWrap:"wrap",gap:`${v.spacing(2)} ${v.spacing(6)}`},children:t.map((M,S)=>{const T=(S+1)%Object.keys(v.custom.dataviz.colorsWithExtra).length+1,O=M.color||v.custom.dataviz.colorsWithExtra[T].main;return f.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:v.spacing(1),cursor:t.length>1?"pointer":"default",opacity:C.has(S)?.4:1},onClick:()=>{t.length>1&&w(S),g==null||g(S)},children:[f.jsx(K,{sx:{width:v.spacing(1.5),height:v.spacing(1.5),borderRadius:"50%",backgroundColor:O,flexShrink:0}}),f.jsx(ie,{variant:"body2",fontWeight:500,sx:{fontSize:"14px",color:v.palette.text.primary},children:M.name})]},M.name)})})})]})},Wye={x:0,y:-5},AC=e=>{const{x:t,y:n,value:r,unit:o,formatValue:i,showDelta:s,deltaProps:a,zIndex:c=1e3}=e,u=ce(),d=a!=null&&a.isPositive?u.custom.green[500]:u.custom.red[500],p=a!=null&&a.isPositive?u.custom.green[100]:u.custom.red[100],h=Gu({coordinate:{x:t,y:n},placement:"top",offset:Wye});return f.jsx(K,{sx:{...h,zIndex:c},children:f.jsx(di,{width:"unset",padding:u.spacing(.5,1),popperZIndex:c,title:f.jsxs(le,{direction:"row",alignItems:"center",spacing:1,children:[f.jsxs(ie,{variant:"h6",sx:{fontWeight:700,color:u.custom.grey[2800]},children:[i(r),o?` ${o}`:""]}),s&&a&&a.percentageChange>0&&f.jsxs(le,{direction:"row",alignItems:"center",spacing:u.spacing(1),sx:{color:d,fontWeight:600},children:[f.jsx(K,{sx:{borderRadius:u.spacing(1),display:"flex",alignItems:"center",justifyContent:"center",width:u.spacing(2),height:u.spacing(2),border:`1px solid ${d}`,backgroundColor:p},children:f.jsx(Ct,{icon:a.isIncrease?"arrowUpRight":"arrowDownRight",size:1,color:d})}),f.jsx(ie,{variant:"body2",sx:{fontWeight:600},children:Intl.NumberFormat(a.language,{style:"percent",maximumFractionDigits:a.precision}).format(a.percentageChange/100)})]})]}),placement:"top",open:!0,arrow:!0,sx:Ku(),children:f.jsx("div",{})})})},Uye=(e,t,n,r,o,i,s)=>{var x,w;const a=s?n.length-1:n.findIndex(M=>M===String(r));if(a<0)return null;const c=typeof e=="number"?e:null,u=o.total??0,d=a>0?t.reduce((M,S)=>M+(S.data[a-1]||0),0):0,p=c!==null?((x=t[c])==null?void 0:x.data[a])??0:void 0,h=c!==null?a>0?((w=t[c])==null?void 0:w.data[a-1])??0:0:void 0,g=typeof p=="number"?p:u,m=typeof h=="number"?h:d,v=g>m,C=i==="increase"?v:!v,y=m>0?Math.abs((g-m)/m*100):0;return{currentIndex:a,currentTotal:u,previousTotal:d,currentSegment:p,previousSegment:h,valueToDisplay:g,previousValue:m,isIncrease:v,isPositive:C,percentageChange:y}},qye=(e,t,n,r,o)=>{const i=typeof t=="number"?t:e.x,s=typeof n=="number"?n:e.y;return{curX:i,curY:s,prevXPos:typeof r=="number"?r:void 0,prevYPos:typeof o=="number"?o:void 0}},U_=(e,t,n)=>t(e,n),Gye=(e,t,n,r,o)=>{var p,h;const i=((p=e[t])==null?void 0:p.data[0])??0,s=((h=e[t])==null?void 0:h.data[n])??0,a=n===r.length-1&&r.length>=2&&i>0,c=a?Math.abs((s-i)/i*100):0,u=s>i;return{firstVal:i,val:s,showDelta:a,pctChange:c,isIncreaseVsFirst:u,isPositiveVsFirst:o==="increase"?u:!u}},Kye=e=>{const{hoveredIdx:t,labels:n,datasets:r,allCenters:o,allTopYs:i,coordinate:s,positiveTrend:a,currentIndex:c,unit:u,valueFormatterFn:d,precision:p,language:h}=e;if(!d)throw new Error("valueFormatterFn is required");const g=m=>U_(m,d,p);return f.jsx(f.Fragment,{children:n.map((m,v)=>{const C=o[v],y=typeof i[v]=="number"?i[v]:s.y;if(typeof C!="number"||typeof y!="number")return null;const x=Gye(r,t,v,n,a);return f.jsx(AC,{x:C,y,value:x.val,unit:u,formatValue:g,showDelta:x.showDelta,deltaProps:x.showDelta?{percentageChange:x.pctChange,isIncrease:x.isIncreaseVsFirst,isPositive:x.isPositiveVsFirst,precision:p,language:h}:void 0,zIndex:c===v?1001:1e3},`multi-tip-${v}`)})})},Yye=e=>{var L;const t=ce(),{active:n,payload:r,label:o,unit:i,valueFormatterFn:s=t.numbers.valueFormatterFn,precision:a=0,language:c,positiveTrend:u,datasets:d,labels:p,barTopY:h,coordinate:g,hoveredDatasetIndex:m,prevBarTopY:v,prevX:C,currentX:y,allCenters:x,allTopYs:w,legendHovering:M}=e;if(!n||!r||!r.length||!g||m==null)return null;const S=(L=r[0])==null?void 0:L.payload;if(!S)return null;const E=Uye(m,d,p,o??"",S,u,M??!1);if(!E)return null;const T=j=>U_(j,s,a),O=p.length>1&&Array.isArray(x)&&Array.isArray(w),P=typeof m=="number"?m:null;if(O&&P!==null)return f.jsx(Kye,{hoveredIdx:P,labels:p,datasets:d,allCenters:x,allTopYs:w,coordinate:g,positiveTrend:u,currentIndex:E.currentIndex,unit:i,valueFormatterFn:s,precision:a,language:c});const k=qye(g,y,h,C,v);return f.jsxs(f.Fragment,{children:[f.jsx(AC,{x:k.curX,y:k.curY,value:E.valueToDisplay,unit:i,formatValue:T,showDelta:E.currentIndex>0&&E.percentageChange>0,deltaProps:{percentageChange:E.percentageChange,isIncrease:E.isIncrease,isPositive:E.isPositive,precision:a,language:c},zIndex:1001}),E.currentIndex>0&&k.prevXPos!=null&&k.prevYPos!=null&&f.jsx(AC,{x:k.prevXPos,y:k.prevYPos,value:E.previousValue,unit:i,formatValue:T,zIndex:1e3})]})},Xye=(e,t)=>e.map((n,r)=>{const o={name:n,total:0};let i=0;return t.forEach((s,a)=>{const c=s.data[r]||0;o[`dataset_${a}`]=c,o[`hoverBottom_${a}`]=i,i+=c,o.total+=c}),o}),Jye=(e,t)=>{const n=Object.values(t.custom.dataviz.colorsWithExtra).map(r=>r.main);return e.map((r,o)=>r.backgroundColor||n[o%n.length])},Qye=e=>e.map(t=>(t.data||[]).reduce((n,r)=>n+(r||0),0)),q_=(e,t,n,r,o=!1)=>{const i=Math.abs(n.x-t.x),s=t.x+i*.5,a=t.y,c=n.x-i*.5,u=n.y;return{cp1:{x:s,y:a},cp2:{x:c,y:u}}},exe=e=>{const[t,n]=I.useState(null),[r,o]=I.useState(!1),i=I.useRef({}),s=I.useRef({}),a=I.useRef({}),c=I.useRef({}),u=I.useRef(null);I.useEffect(()=>{i.current={}},[e]);const d=(y,x,w)=>{if(typeof y=="string"&&typeof x=="number"&&typeof w=="number"){const M=i.current[y]||{},S=M[x];M[x]=typeof S=="number"?Math.min(S,w):w,i.current[y]=M}},p=(y,x,w)=>{if(typeof y=="string"&&typeof x=="number"&&typeof w=="number"){const M=a.current[y]||{};M[x]=w,a.current[y]=M}},h=(y,x)=>{typeof y=="string"&&typeof x=="number"&&(s.current[y]=x)},g=(y,x)=>{typeof y=="string"&&typeof x=="number"&&(c.current[y]=x/2)},m=I.useCallback(y=>{n(y),o(!1)},[]),v=I.useCallback(()=>{n(null),o(!1)},[]),C=I.useCallback(y=>{n(y),o(y!==null)},[]);return{hoveredDatasetIndex:t,isLegendHover:r,barTopsRef:i,barCentersRef:s,barBottomsRef:a,barHalfWidthRef:c,chartContainerRef:u,registerBarTopY:d,registerBarBottomY:p,registerBarCenterX:h,registerBarHalfWidth:g,handleDatasetHover:m,handleDatasetLeave:v,handleLegendHover:C}},txe="80",Xf=4,wi=0,nxe=50,rxe=50,oxe=200,ixe=2,sxe=0,axe=e=>{const{values:t,colors:n,hoveredDatasetIndex:r,maxBarSize:o,segmentGap:i,registerBarTopY:s,registerBarBottomY:a,registerBarCenterX:c,registerBarHalfWidth:u,onDatasetHover:d,onDatasetLeave:p}=e;return f.jsx(f.Fragment,{children:t.map((h,g)=>f.jsx(zi,{dataKey:`dataset_${g}`,name:h.label,stackId:"evolution",fill:r===null||r===g?n[g]:`${n[g]}${txe}`,radius:g===t.length-1?[Xf,Xf,wi,wi]:[wi,wi,wi,wi],animationBegin:nxe+g*rxe,animationDuration:oxe,maxBarSize:o,onMouseEnter:()=>d(g),onMouseLeave:p,shape:m=>{const v=m,C=v.y;s(v.payload.name,g,C),s(v.payload.name,-1,C);const y=v.x,x=v.width;y!==void 0&&x!==void 0&&(c(v.payload.name,y+x/ixe),u(v.payload.name,x));let w=v.height;typeof w=="number"&&g>0&&(w=Math.max(sxe,w-i)),C!==void 0&&w!==void 0&&a(v.payload.name,g,C+w);const M={radius:g===t.length-1?[Xf,Xf,wi,wi]:[wi,wi,wi,wi],x:y,y:C,width:x,height:w,fill:m.fill,stroke:m.stroke,strokeWidth:m.strokeWidth,strokeDasharray:m.strokeDasharray,strokeOpacity:m.strokeOpacity,fillOpacity:m.fillOpacity};return f.jsx(Xl,{...M})}},`dataset_${g}`))})},lxe=e=>{var h,g,m,v,C,y;const{hoveredDatasetIndex:t,labels:n,barCentersRef:r,barHalfWidthRef:o,barTopsRef:i,barBottomsRef:s,colors:a,areaGap:c,barWidth:u}=e;if(t===null)return null;const d=c/2,p=[];for(let x=0;x<n.length-1;x+=1){const w=n[x],M=n[x+1],S=r.current[w],E=o.current[w]??u/2,T=r.current[M],O=o.current[M]??u/2,P=(h=i.current[w])==null?void 0:h[t],k=(g=i.current[M])==null?void 0:g[t];let L=(m=s.current[w])==null?void 0:m[t];L==null&&t>0&&(L=(v=i.current[w])==null?void 0:v[t-1]);let j=(C=s.current[M])==null?void 0:C[t];if(j==null&&t>0&&(j=(y=i.current[M])==null?void 0:y[t-1]),typeof S=="number"&&typeof E=="number"&&typeof T=="number"&&typeof O=="number"&&typeof P=="number"&&typeof k=="number"&&typeof L=="number"&&typeof j=="number"){const A=S+E+d,R=T-O-d,_=x>0?{}:{},N={x:A,y:P},z={x:R,y:k},B=x<n.length-2?{}:{},{cp1:$,cp2:V}=q_(_,N,z,B,!1),H=x>0?{}:{},X={x:A,y:L},Q={x:R,y:j},ne=x<n.length-2?{}:{},{cp1:q,cp2:J}=q_(H,X,Q,ne,!0),te=[`M ${N.x} ${N.y}`,`C ${$.x} ${$.y} ${V.x} ${V.y} ${z.x} ${z.y}`,`L ${Q.x} ${Q.y}`,`C ${J.x} ${J.y} ${q.x} ${q.y} ${X.x} ${X.y}`,"Z"].join(" ");p.push(te)}}return p.length===0?null:f.jsx("g",{style:{pointerEvents:"none"},children:p.map((x,w)=>f.jsx("path",{d:x,fill:He(a[t],.2),stroke:"none"},w))})},cxe="415px",uxe="100%",dxe=4,fxe=8,G_=44,pxe=45,hxe=0,gxe=30,mxe=5,vxe="20%",Cxe=3,bxe=50,yxe=e=>{const t=ce(),{labels:n,values:r,unit:o,height:i=cxe,width:s=uxe,legend:a,valueFormatterFn:c=t.numbers.valueFormatterFn,precision:u,icons:d=[],showLegend:p=!0,improvement:h="decrease",segmentGap:g=dxe,areaGap:m=fxe}=e,v=vn.language,C=fo(t.breakpoints.down("md")),y=(a==null?void 0:a.position)??"right",x=(a==null?void 0:a.fullWidthLegend)??!1,w=I.useMemo(()=>Xye(n,r),[n,r]),M=I.useMemo(()=>Jye(r,t),[r,t]),S=I.useMemo(()=>Qye(r),[r]),{hoveredDatasetIndex:E,isLegendHover:T,barTopsRef:O,barCentersRef:P,barBottomsRef:k,barHalfWidthRef:L,chartContainerRef:j,registerBarTopY:A,registerBarBottomY:R,registerBarCenterX:_,registerBarHalfWidth:N,handleDatasetHover:z,handleDatasetLeave:B,handleLegendHover:$}=exe(w);return f.jsxs(le,{direction:p&&!C?y==="bottom"?"column":"row":"column",position:"relative",height:i,gap:t.spacing(Cxe),minHeight:t.spacing(bxe),justifyContent:"stretch",sx:{padding:t.spacing(3),width:s},children:[f.jsx(K,{display:"flex",sx:{"& *":{outline:"none"},height:"100%",position:"relative",flex:1},ref:j,children:f.jsx(fr,{width:"100%",children:f.jsxs(TC,{data:w,margin:{top:pxe,right:hxe,left:gxe,bottom:mxe},barCategoryGap:vxe,children:[f.jsx(Zi,{strokeDasharray:"4 4",stroke:t.palette.divider,vertical:!1}),f.jsx(yi,{dataKey:"name",strokeDasharray:"4 4",strokeWidth:0,tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateY(${t.spacing(2)})`}},axisLine:{stroke:t.palette.divider},tickLine:!1,interval:"equidistantPreserveStart",padding:{left:0,right:0}}),f.jsx(qo,{width:"auto",strokeDasharray:"4 4",strokeWidth:1,tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateX(-${t.spacing(2)})`}},axisLine:{stroke:t.palette.divider},tickLine:!1,tickFormatter:V=>c(Number(V),u),children:f.jsx(Wo,{value:o,position:"insideTopLeft",style:{fontFamily:"Montserrat",fontSize:"14px",transform:`translate(-${t.spacing(2.5)}, -${t.spacing(6)})`}})}),f.jsx(qo,{strokeDasharray:"4 4",strokeWidth:1,axisLine:{stroke:t.palette.divider},yAxisId:"evolution-chart-right-axis",type:"number",orientation:"right"}),f.jsx(qa,{cursor:!1,content:V=>{var F,G,D,ee;if(!V.active||!V.payload||!V.payload.length)return null;const H=V&&(typeof V.label=="string"||typeof V.label=="number")?String(V.label):void 0,X=H!=null?typeof E=="number"?(F=O.current[H])==null?void 0:F[E]:(G=O.current[H])==null?void 0:G[-1]:void 0,Q=H!=null?P.current[H]:void 0,ne=H!=null?n.findIndex(oe=>oe===H):-1,q=ne>0?n[ne-1]:void 0,J=q!=null?typeof E=="number"?(D=O.current[q])==null?void 0:D[E]:(ee=O.current[q])==null?void 0:ee[-1]:void 0,te=q!=null?P.current[q]:void 0,Y=n.map(oe=>P.current[oe]),Z=typeof E=="number"?n.map(oe=>{var se;return(se=O.current[oe])==null?void 0:se[E]}):void 0;return f.jsx(Yye,{...V,unit:o,valueFormatterFn:c,precision:u,language:v,positiveTrend:h,datasets:r,labels:n,barTopY:X,hoveredDatasetIndex:E,prevBarTopY:J,prevX:te,currentX:Q,allCenters:Y,allTopYs:Z,legendHovering:T})},wrapperStyle:{zIndex:1e3},contentStyle:{background:"transparent",border:"none",boxShadow:"none",padding:0},isAnimationActive:!1}),f.jsx(axe,{values:r,colors:M,hoveredDatasetIndex:E,maxBarSize:G_,segmentGap:g,registerBarTopY:A,registerBarBottomY:R,registerBarCenterX:_,registerBarHalfWidth:N,onDatasetHover:z,onDatasetLeave:B}),f.jsx(zD,{component:()=>f.jsx(lxe,{hoveredDatasetIndex:E,labels:n,barCentersRef:P,barHalfWidthRef:L,barTopsRef:O,barBottomsRef:k,colors:M,areaGap:m,barWidth:G_})})]})})}),p&&f.jsx(K,{display:"flex",sx:{maxWidth:x||y==="bottom"||C?"100%":"350px",flex:1},children:f.jsx(J9,{labels:r.map(V=>V.label),colors:M,icons:d,legend:a,hidePercentage:!0,hoveredDatasetIndex:E,onLegendHover:$,values:S,chartRef:j})})]})},xxe=e=>{const t=ce(),n=vn.language,{actionsTotalValue:r,improvement:o,target:i,goal:s,unit:a="",textOptions:c,precision:u,valueFormatterFn:d}=e,p=[],h=(()=>{const m=(s==null?void 0:s.value)??0,v=(i==null?void 0:i.value)??0;if(v===0||m===0)return 0;const C=m-v;return o==="increase"?v/m*100:(C/Math.abs(v)+1)*100})(),g=m=>m&&m>=0?o==="decrease"?t.custom.red[600]:t.custom.green[600]:m&&m<=0?o==="decrease"?t.custom.green[600]:t.custom.red[600]:t.custom.green[600];return c!=null&&c.setOfActionsLabel&&r!==null&&p.push({label:c.setOfActionsLabel,value:d?d(r,u):r.toLocaleString(n,{minimumFractionDigits:u||0,maximumFractionDigits:u||0}),color:g(r),unit:a}),c!=null&&c.goalProgressLabelDescription&&i&&s&&p.push({label:null,additionalComponent:f.jsx(TO,{completionPercent:h,improvement:o,color:OO(h,t),label:c.goalProgressLabelDescription})}),p},wxe=e=>{const t=ce(),{label:n,value:r,unit:o,additionalComponent:i}=e;return f.jsxs(Ri,{elevation:0,sx:{borderRadius:t.spacing(1),height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",p:t.spacing(2,2.5),gap:t.spacing(1.5),border:`1px solid ${t.palette.divider}`},children:[n!==null&&f.jsx(K,{sx:{display:"flex",alignItems:"center"},children:f.jsx(ie,{variant:"big-bold",fontWeight:"semi-bold",fontSize:t.spacing(2),color:"text.primary",children:n})}),r!==void 0&&f.jsxs(le,{direction:"row",spacing:1,alignItems:"baseline",children:[f.jsx(ie,{variant:"big-bold",fontWeight:"bold",fontSize:t.spacing(4),color:e.color,children:r}),f.jsx(ie,{variant:"small-medium",fontSize:t.spacing(2),color:t.custom.grey[1400],children:o})]}),i&&f.jsx(K,{sx:{transform:`translate(${t.spacing(-.5)}, ${t.spacing(-1.5)})`},children:i})]})},Sxe=e=>{const t=ce(),{textOptions:n,target:r,goal:o,actionsTotalValue:i,improvement:s,precision:a,unit:c,valueFormatterFn:u=g=>t.numbers.valueFormatterFn(g,a)}=e,p={...{setOfActionsLabel:"",goalProgressLabelDescription:""},...n},h=xxe({actionsTotalValue:i,improvement:s,target:r,goal:o,unit:c,precision:a,textOptions:p,valueFormatterFn:u});return h.length===0?null:f.jsx(Rl,{container:!0,spacing:2,sx:{pt:t.spacing(2),alignItems:"stretch"},children:h.map((g,m)=>f.jsx(Rl,{size:{xs:12,sm:6,md:3},children:f.jsx(wxe,{...g})},`${g.label}-${m}`))})},Mxe=e=>{const{startingValue:t,differences:n}=e,r={pivot:null,results:[]};return n.reduce((i,s)=>{const a=i.pivot??t,c=a+s;return i.results.push([a,c]),i.pivot=c,i},r).results},Exe=(e,t,n,r,o,i,s,a,c)=>{const u=(n??[]).filter(m=>m.value!==null),d=u.map(m=>m.value),p=(t==null?void 0:t.value)??(e==null?void 0:e.value)??0,h=Mxe({startingValue:p,differences:d}),g=[];if(e!=null&&e.label&&g.push({label:e.label,low:0,high:e.value??0,diff:(e.value??0)-0,type:"reference",color:(r==null?void 0:r.reference)??c.custom.dataviz.colors[2].main}),t!=null&&t.label&&g.push({label:t.label,low:0,high:t.value??0,diff:(t.value??0)-0,type:"start",color:(r==null?void 0:r.start)??c.custom.dataviz.colors[4].main}),u.forEach((m,v)=>{const C=h[v];if(!C)return;const[y,x]=C,w=x-y,M=w<=0,S=s==="decrease"?c.custom.dataviz.colors[6].main:c.custom.dataviz.extra[14].main,E=s==="decrease"?c.custom.dataviz.extra[14].main:c.custom.dataviz.colors[6].main;g.push({label:m.label,low:y,high:x,diff:w,type:"value",color:M?E:S})}),o!=null&&o.label){const m=a??p+(d.length>0?d.reduce((v,C)=>v+C,0):0);g.push({label:o.label,low:0,high:m,diff:m-0,type:"target",color:(r==null?void 0:r.target)??c.custom.dataviz.colors[4].main})}if(i!=null&&i.label){const m=i.value??a??0;g.push({label:i.label,low:0,high:m,diff:m-0,type:"goal",color:(r==null?void 0:r.goal)??c.custom.dataviz.extra[12].main})}return g},K_=80,Txe=85,Y_=0,Oxe=(e,t)=>{const n=e.length;if(n===0)return{interval:Y_,maxWidth:K_};const r=t/n;let o=Y_;const i=Math.min(r,K_);return r<Txe&&(o="preserveStartEnd"),{interval:o,maxWidth:i}},kxe=16,Pxe=6,Lxe=22,jxe="12",Ixe="Montserrat",Axe=e=>{const{x:t,y:n,payload:r,maxWidth:o}=e,i=ce(),a=r.value.split(" "),c=[];let u="";for(const d of a){const p=u?`${u} ${d}`:d;p.length*Pxe>o&&u?(c.push(u),u=d):u=p}return u&&c.push(u),f.jsx("g",{transform:`translate(${t},${n+Lxe})`,children:f.jsx("g",{children:c.map((d,p)=>f.jsx("text",{x:0,y:p*kxe,textAnchor:"middle",fill:i.palette.text.primary,fontSize:jxe,fontFamily:Ixe,children:d},p))})})},Rxe=300,Dxe=2,Vxe=10,tc=4,X_=0,_xe="Montserrat",Nxe="600",Hxe="14px",$xe=0,Fxe=e=>{const{transformedData:t,valueFormatterFn:n,forcedPrecision:r,precision:o}=e,i=ce();return f.jsxs(f.Fragment,{children:[f.jsx(zi,{dataKey:"low",stackId:"waterfall",fill:"transparent"}),f.jsxs(zi,{dataKey:"diff",stackId:"waterfall",animationDuration:Rxe,minPointSize:Dxe,children:[t.map((s,a)=>{const c=s.low===0?[tc,tc,X_,X_]:[tc,tc,tc,tc];return f.jsx(yo,{fill:s.color,radius:c},`cell-${a}`)}),f.jsx(Ga,{dataKey:"diff",position:"top",offset:Vxe,style:{fontFamily:_xe,fontWeight:Nxe,fontSize:Hxe,fill:i.custom.grey[2800]},formatter:s=>{const a=typeof s=="number"?s:Number(s)||$xe;return n?n(a,r||o):i.numbers.valueFormatterFn(a,r||o)}})]})]})},Bxe=45,zxe=0,Zxe=30,Wxe=35,Uxe=40,J_=0,qxe=0,Gxe=2,Kxe=.2,Yxe=e=>{const t=ce(),{reference:n,start:r,values:o,colors:i,target:s,goal:a,forcedPrecision:c,unit:u,improvement:d,targetValueFinal:p,valueFormatterFn:h=t.numbers.valueFormatterFn,precision:g}=e,m=I.useRef(null),v=800,C=60,[y,x]=I.useState(v);I.useEffect(()=>{const S=()=>{if(m.current){const T=m.current.getBoundingClientRect().width;T>0&&x(T-C)}};S();const E=()=>S();return window.addEventListener("resize",E),()=>window.removeEventListener("resize",E)},[]);const w=I.useMemo(()=>Exe(n,r,o,i,s,a,d,p,t),[n,r,o,i,s,a,d,p,t]),M=I.useMemo(()=>Oxe(w,y),[w,y]);return f.jsx("div",{ref:m,style:{width:"100%",height:"100%"},children:f.jsx(fr,{width:"100%",height:"100%",children:f.jsxs(TC,{data:w,margin:{top:Bxe,right:zxe,left:Zxe,bottom:Wxe},children:[f.jsx(Zi,{strokeDasharray:"4 4",stroke:t.palette.divider}),f.jsx(yi,{dataKey:"label",strokeWidth:J_,strokeDasharray:"4 4",tick:S=>f.jsx(Axe,{...S,maxWidth:M.maxWidth}),axisLine:{stroke:t.palette.divider},interval:M.interval,tickLine:!1,padding:{left:0,right:0},height:Uxe}),f.jsx(qo,{width:"auto",domain:([S,E])=>[S<0?S-Math.abs(S)*Kxe:S,E],strokeWidth:J_,tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateX(-${t.spacing(2)})`}},axisLine:{stroke:t.palette.divider},tickLine:!1,tickFormatter:S=>h(Number(S),g),children:f.jsx(Wo,{value:u,position:"insideTopLeft",style:{fontFamily:"Montserrat",fontSize:"14px",transform:`translate(-${t.spacing(2.75)}, -${t.spacing(6)})`}})}),f.jsx(Wu,{y:qxe,stroke:t.custom.grey[600],strokeWidth:Gxe}),f.jsx(Fxe,{transformedData:w,valueFormatterFn:h,forcedPrecision:c,precision:g})]})})})},Xxe=e=>{const t=ce(),{reference:n,start:r,values:o,colors:i,target:s,goal:a,forcedPrecision:c=0,unit:u,width:d="100%",height:p="100%",improvement:h="decrease",textOptions:g,showLegend:m=!0,valueFormatterFn:v=t.numbers.valueFormatterFn}=e,C=I.useMemo(()=>o!=null&&o.length?o.map(w=>w.value).filter(w=>w!==null):null,[o]),y=I.useMemo(()=>C?C.reduce((w,M)=>w+M,0):null,[C]),x=s!=null&&s.value?s:{label:(r==null?void 0:r.label)??(n==null?void 0:n.label)??"",value:(s==null?void 0:s.value)??((r==null?void 0:r.value)??(n==null?void 0:n.value)??0)+(y??0)};return f.jsxs(le,{direction:"column",position:"relative",width:d,minHeight:t.spacing(50),justifyContent:"stretch",sx:{"& *":{outline:"none"}},children:[f.jsx(K,{sx:{border:`1px solid ${t.palette.divider}`,backgroundColor:t.palette.background.paper,borderRadius:t.spacing(1),width:"100%",height:p,padding:t.spacing(3)},children:f.jsx(Yxe,{reference:n,start:r,values:o,target:s,goal:a,colors:i,forcedPrecision:c,unit:u,improvement:h,targetValueFinal:(s==null?void 0:s.value)??((r==null?void 0:r.value)??(n==null?void 0:n.value)??0)+(y??0),valueFormatterFn:v,precision:c})}),m&&f.jsx(Sxe,{textOptions:g,target:x,improvement:h,goal:a,valueFormatterFn:v,actionsTotalValue:y,unit:u,precision:c})]})},ot={DEFAULT_WIDTH:500,DEFAULT_HEIGHT:200,GAUGE_HEIGHT:28,GAUGE_PADDING:8,LEGEND_PADDING_X:28,FONT_SIZE:{DEFAULT:12},MARKER:{COMPANY_RADIUS:5,COMPANY_STROKE_WIDTH:3,AVERAGE_RADIUS:3,AVERAGE_STROKE_WIDTH:2,EDGE_RADIUS:3},COLORS:{BORDER:"#E7E6E4",GRADIENT:{START:"#F0DF46",END:"#EB9411"}},TEXT:{DEFAULT_COMPANY_LABEL:"",DEFAULT_AVERAGE_LABEL:""},LAYOUT:{COMPANY_MARKER_OFFSET:18,AVERAGE_MARKER_TOP_OFFSET:12,AVERAGE_MARKER_BOTTOM_OFFSET:4,COMPANY_LABEL_VERTICAL_RATIO:.25,AVERAGE_LABEL_VERTICAL_RATIO:.75,COMPANY_LABEL_OFFSET:8,AVERAGE_LABEL_OFFSET:12,TITLE_OFFSET:35,VALUES_LABEL_OFFSET:8}},Jxe=(e,t,n)=>e===t?()=>(n-ot.GAUGE_PADDING*2)/2:r=>(r-e)/(t-e)*(n-ot.GAUGE_PADDING*2),Qxe=(e,t=ot.FONT_SIZE.DEFAULT)=>e.length*(t*.6),Q_=(e,t,n,r,o=ot.FONT_SIZE.DEFAULT)=>{const i=ot.GAUGE_PADDING+n(e),s=Qxe(t,o)/2;return i-s<ot.GAUGE_PADDING?{x:ot.GAUGE_PADDING,anchor:"start"}:i+s>r-ot.GAUGE_PADDING?{x:r-ot.GAUGE_PADDING,anchor:"end"}:{x:i,anchor:"middle"}},ewe=(e,t)=>(e+t)/2,twe=({minValue:e,maxValue:t,companyValue:n,averageValue:r,labelCompany:o,labelAverage:i,width:s,height:a})=>{const c=Jxe(e,t,s),u=ewe(e,t),d=Q_(n,o,c,s),p=Q_(r,i,c,s),h=a/2,g=h-ot.GAUGE_HEIGHT,m=g+ot.GAUGE_HEIGHT/2,v={start:h-ot.LAYOUT.COMPANY_MARKER_OFFSET,end:g-ot.LAYOUT.COMPANY_MARKER_OFFSET},C={start:h-ot.LAYOUT.AVERAGE_MARKER_TOP_OFFSET,end:h+ot.GAUGE_HEIGHT-ot.LAYOUT.AVERAGE_MARKER_BOTTOM_OFFSET},y={company:a*ot.LAYOUT.COMPANY_LABEL_VERTICAL_RATIO-ot.LAYOUT.COMPANY_LABEL_OFFSET,average:a*ot.LAYOUT.AVERAGE_LABEL_VERTICAL_RATIO-ot.LAYOUT.AVERAGE_LABEL_OFFSET,title:g-ot.LAYOUT.TITLE_OFFSET,values:a-ot.LAYOUT.VALUES_LABEL_OFFSET},x={min:ot.GAUGE_PADDING,max:s-ot.GAUGE_PADDING,middle:ot.GAUGE_PADDING+(s-ot.GAUGE_PADDING*2)/2},w={x:ot.GAUGE_PADDING,y:m-ot.GAUGE_HEIGHT/2,width:s-ot.GAUGE_PADDING*2,height:ot.GAUGE_HEIGHT,animated:!1};return{scale:c,averageValueBoundaries:u,companyPosition:d,averagePosition:p,gaugeBackgroundProps:w,markerY:m,companyMarkerY:v,averageMarkerY:C,labelY:y,labelPositions:x}},nwe=({width:e,height:t,averageValueBoundaries:n,scale:r,animated:o=!1})=>{const i=I.useRef(null);return I.useEffect(()=>{if(i.current&&o){const s=i.current;s.style.opacity="0",setTimeout(()=>{s.style.transition="all 0.5s linear",s.style.opacity="1"},300)}},[o]),f.jsxs("g",{ref:i,style:{opacity:o?"0":"1"},children:[f.jsx("line",{x1:ot.GAUGE_PADDING,y1:1,x2:e-ot.GAUGE_PADDING,y2:1,stroke:ot.COLORS.BORDER,strokeWidth:"1",strokeDasharray:"5 5"}),f.jsx("line",{x1:ot.GAUGE_PADDING,y1:t-ot.LEGEND_PADDING_X,x2:e-ot.GAUGE_PADDING,y2:t-ot.LEGEND_PADDING_X,stroke:ot.COLORS.BORDER,strokeWidth:"1",strokeDasharray:"5 5"}),f.jsx("line",{x1:ot.GAUGE_PADDING,y1:0,x2:ot.GAUGE_PADDING,y2:t-ot.LEGEND_PADDING_X,stroke:ot.COLORS.BORDER,strokeWidth:"1",strokeDasharray:"5 5"}),f.jsx("line",{x1:e-ot.GAUGE_PADDING,y1:0,x2:e-ot.GAUGE_PADDING,y2:t-ot.LEGEND_PADDING_X,stroke:ot.COLORS.BORDER,strokeWidth:"1",strokeDasharray:"5 5"}),f.jsx("line",{x1:r(n)+ot.GAUGE_PADDING,y1:0,x2:r(n)+ot.GAUGE_PADDING,y2:t-ot.LEGEND_PADDING_X,stroke:ot.COLORS.BORDER,strokeWidth:"1",strokeDasharray:"5 5"})]})},Jf=(e,t=0)=>Number(e.toFixed(t<0||t>100?0:t)),Qf=({label:e,value:t,unit:n,precision:r=2,valueFormatter:o})=>{const i=ce(),s=o?o(t):Jf(t,r);return f.jsxs(K,{sx:{display:"flex",width:"100%",flexDirection:"column",gap:i.spacing(.75),padding:i.spacing(.75,1.5,0,.75),textAlign:"left",justifyContent:"flex-start"},children:[f.jsx(ie,{variant:"h5",color:i.custom.grey[2800],children:e}),f.jsxs(K,{sx:{display:"flex",alignItems:"baseline"},children:[f.jsx(ie,{variant:"h2",color:i.custom.grey[2800],sx:{mr:.5},children:s}),f.jsx(ie,{variant:"body-medium",color:i.custom.grey[1400],children:n})]})]})},rwe=({scale:e,companyValue:t,averageValue:n,markersYPosition:r,companyMarkerY:o,averageMarkerY:i,animated:s=!1,minValue:a,maxValue:c,precision:u=2,unit:d="",labelCompany:p="",labelAverage:h="",valueFormatter:g})=>{const m=ce(),v=I.useRef(null),C={transition:s?"transform 0.3s linear":"none"},y=m.custom.grey[2800],x=w=>w>=a&&w<=c;return I.useEffect(()=>{if(v.current&&s){const w=v.current;w.style.opacity="0",setTimeout(()=>{w.style.transition="all 0.5s linear",w.style.opacity="1"},300)}},[s]),f.jsxs("g",{ref:v,children:[[a,c].map((w,M)=>{const S=`edge-${M}`,E=ot.GAUGE_PADDING+e(w);return f.jsxs("g",{transform:`translate(${E}, 0)`,style:C,children:[f.jsx("circle",{cy:r,r:ot.MARKER.EDGE_RADIUS,fill:y}),f.jsx("line",{y1:r-ot.GAUGE_HEIGHT/2,y2:r+ot.GAUGE_HEIGHT/2,stroke:y,strokeWidth:"2"})]},S)}),x(t)&&f.jsx(di,{width:"unset",title:f.jsx(Qf,{label:p,value:t,unit:d,precision:u,valueFormatter:g}),children:f.jsxs("g",{transform:`translate(${ot.GAUGE_PADDING+e(t)}, 0)`,style:C,children:[f.jsx("line",{y1:o.start,y2:o.end,stroke:y,strokeWidth:"1"}),f.jsx("circle",{cy:r,r:ot.MARKER.COMPANY_RADIUS,stroke:y,strokeWidth:ot.MARKER.COMPANY_STROKE_WIDTH,fill:m.palette.common.white})]})}),x(n)&&f.jsx(di,{width:"unset",title:f.jsx(Qf,{label:h,value:n,unit:d,precision:u,valueFormatter:g}),children:f.jsxs("g",{transform:`translate(${ot.GAUGE_PADDING+e(n)}, 0)`,style:C,children:[f.jsx("line",{y1:i.start,y2:i.end,stroke:y,strokeWidth:"1"}),f.jsx("circle",{cy:r,r:ot.MARKER.AVERAGE_RADIUS,fill:m.palette.common.white,stroke:y,strokeWidth:ot.MARKER.AVERAGE_STROKE_WIDTH})]})})]})},owe=({minValue:e,maxValue:t,companyValue:n,averageValue:r,companyPosition:o,averagePosition:i,labelCompany:s,labelAverage:a,labelYPositions:c,labelPositions:u,animated:d,precision:p=0,unit:h="",valueFormatter:g})=>{const m=ce(),v=I.useRef(null),C={transition:d?"transform 0.3s linear":"none"},y=m.custom.grey[2800],x=e!==t,w=M=>M>=e&&M<=t;return I.useEffect(()=>{if(v.current&&d){const M=v.current;M.style.opacity="0",setTimeout(()=>{M.style.transition="all 0.5s linear",M.style.opacity="1"},300)}},[d]),f.jsxs("g",{ref:v,children:[f.jsxs("g",{children:[x&&f.jsx("text",{transform:`translate(${u.min}, ${c.values})`,fill:y,fontSize:"12",fontWeight:"bold",textAnchor:"start",dominantBaseline:"middle",style:C,cursor:"pointer",children:g?g(e):Jf(e,p)}),f.jsx("text",{transform:`translate(${u.middle}, ${c.values})`,fill:y,fontSize:"12",fontWeight:"bold",textAnchor:"middle",dominantBaseline:"middle",style:C,children:g?g((t+e)/2):Jf((t+e)/2,p)}),x&&f.jsx("text",{transform:`translate(${u.max}, ${c.values})`,fill:y,fontSize:"12",fontWeight:"bold",textAnchor:"end",dominantBaseline:"middle",style:C,children:g?g(t):Jf(t,p)})]}),f.jsxs("g",{cursor:"default",children:[w(n)&&f.jsx(di,{width:"unset",title:f.jsx(Qf,{label:s,value:n,unit:h,precision:p,valueFormatter:g}),children:f.jsx("text",{transform:`translate(${o.x}, ${c.company})`,fill:y,textAnchor:o.anchor,dominantBaseline:"middle",fontWeight:"700",fontSize:"12",style:C,children:s})}),w(r)&&f.jsx(di,{width:"unset",title:f.jsx(Qf,{label:a,value:r,unit:h,precision:p,valueFormatter:g}),children:f.jsx("text",{transform:`translate(${i.x}, ${c.average})`,fill:y,fontSize:"12",fontWeight:"500",textAnchor:i.anchor,dominantBaseline:"middle",style:C,children:a})})]})]})},iwe=({x:e,y:t,width:n,height:r,animated:o=!1,backgroundProps:i={}})=>{var d,p;const s=I.useRef(null),a="gaugeGradient";I.useEffect(()=>{s.current&&o&&(s.current.style.transform="scaleY(0)",s.current.style.transformOrigin="left",setTimeout(()=>{s.current&&(s.current.style.transition="all 0.2s linear",s.current.style.transform="scaleY(1)")},100))},[o]);const c=((d=i.gradient)==null?void 0:d.start)||ot.COLORS.GRADIENT.START,u=((p=i.gradient)==null?void 0:p.end)||ot.COLORS.GRADIENT.END;return f.jsxs(f.Fragment,{children:[f.jsx("defs",{children:f.jsxs("linearGradient",{id:a,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[f.jsx("stop",{offset:"0%",style:{stopColor:c}}),f.jsx("stop",{offset:"100%",style:{stopColor:u}})]})}),f.jsx("rect",{ref:s,x:e,y:t,width:n,height:r,fill:i.fill||`url(#${a})`,stroke:i.stroke||"none",strokeWidth:i.strokeWidth||0,rx:i.rx||0,ry:i.ry||0,style:{transformBox:"fill-box",transform:o?"scaleY(0)":"none",transformOrigin:"left"}})]})},swe=()=>{const e=I.useRef(null),[t,n]=I.useState(0);return I.useEffect(()=>{const r=()=>{e.current&&n(e.current.clientWidth)};return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),{containerRef:e,containerWidth:t}},awe=e=>{const t=ce(),{minValue:n,maxValue:r,averageValue:o,companyValue:i,labelAverage:s=ot.TEXT.DEFAULT_AVERAGE_LABEL,labelCompany:a=ot.TEXT.DEFAULT_COMPANY_LABEL,width:c,height:u=ot.DEFAULT_HEIGHT,label:d,animated:p=!1,backgroundProps:h,precision:g=0,unit:m="",valueFormatter:v=t.numbers.valueFormatterFn}=e,{containerRef:C,containerWidth:y}=swe(),x=y||c||ot.DEFAULT_WIDTH,{scale:w,averageValueBoundaries:M,companyPosition:S,averagePosition:E,gaugeBackgroundProps:T,markerY:O,companyMarkerY:P,averageMarkerY:k,labelY:L,labelPositions:j}=twe({minValue:n,maxValue:r,companyValue:i,averageValue:o,labelCompany:a,labelAverage:s,width:x,height:u});return f.jsx(K,{ref:C,width:c||"100%",height:u,position:"relative",children:f.jsxs("svg",{width:y,height:u,children:[f.jsx(nwe,{width:y,height:u,scale:w,averageValueBoundaries:M,animated:p}),f.jsx(iwe,{...T,backgroundProps:h,animated:p}),f.jsx(rwe,{width:y,scale:w,companyValue:i,averageValue:o,markersYPosition:O,companyMarkerY:P,averageMarkerY:k,minValue:n,maxValue:r,animated:p,precision:g,unit:m,labelCompany:a,labelAverage:s,valueFormatter:v}),f.jsx(owe,{minValue:n,maxValue:r,companyValue:i,averageValue:o,companyPosition:S,averagePosition:E,labelCompany:a,labelAverage:s,labelYPositions:L,labelPositions:j,animated:p,precision:g,unit:m,valueFormatter:v})]})})},lwe=()=>({dataset:[],allLabels:[],totalNumberOfIems:0}),cwe=(e,t,n,r)=>{const o={...t};return e.reduce((s,a)=>{const c=Array(s.totalNumberOfIems).fill(null),u={label:n,data:[...c,a.value],backgroundColor:a.color??r,scope:"initial"};return s.totalNumberOfIems+=1,s.allLabels.push(a.label),s.dataset.push(u),s},o)},uwe=(e,t,n)=>{var g,m,v,C;const r={...t},o=[[],[]],i=e.reduce((y,x)=>(x.values.forEach((w,M)=>{y[M].push(w)}),y),o),s=e.map(y=>y.label);r.allLabels=[...r.allLabels,...s];const a=Array(r.totalNumberOfIems).fill(null),c=((g=n==null?void 0:n.main)==null?void 0:g.color)??"#FFD6B9",u={label:((m=n==null?void 0:n.main)==null?void 0:m.label)??"",data:[...a,...i[0]],backgroundColor:c,scope:"trajectory"};r.dataset.push(u);const d=((v=n==null?void 0:n.difference)==null?void 0:v.color)??"#30C7A380",p={label:((C=n==null?void 0:n.difference)==null?void 0:C.label)??"",data:[...a,...i[1]],backgroundColor:d,scope:"trajectory"};r.dataset.push(p);const h=i[0].length;return r.totalNumberOfIems+=h,r},dwe=e=>{const{goal:t,chartState:n,label:r,color:o,forceLegend:i=!1}=e,s={...n},c=s.dataset[0].data[0],u=c===null||Array.isArray(c)||t===null,d=Array(s.allLabels.length).fill(null);d[0]=c,d[d.length-1]=t;const p=o||"rgb(54, 162, 235)",h={type:"line",label:r,data:d,backgroundColor:p,borderColor:p,isGoalNull:u,scope:"goal",forceLegend:i};return s.dataset.push(h),s},fwe=e=>{var h,g,m;const t=ce(),{goal:n=null,initialValues:r=[],trajectory:o=[],trajectoryOptions:i,forceGoalLegend:s}=e,a=lwe(),c=t.custom.dataviz.colorsWithExtra[11].main,u=cwe(r,a,(h=i==null?void 0:i.initialValues)==null?void 0:h.label,c),d=uwe(o,u,i),p=dwe({goal:n,chartState:d,label:(g=i==null?void 0:i.target)==null?void 0:g.label,color:(m=i==null?void 0:i.target)==null?void 0:m.color,forceLegend:s});return{datasets:p.dataset,initialValues:u.dataset,labels:p.allLabels}},RC=e=>{const{variant:t="tags-grey",label:n,startIcon:r,endIcon:o,onClick:i,disabled:s,sx:a}=e,c=ce(),u={"tags-grey":c.custom.grey[2800],"tags-black":c.custom.grey[100],"tags-white":c.custom.grey[2800],"tags-green":c.custom.green[600],"tags-red":c.custom.red[600]};return f.jsx(it,{startIcon:r&&f.jsx(ie,{sx:{color:u[t]},variant:"small-bold",children:f.jsx(Ct,{size:1,icon:r})}),endIcon:o&&f.jsx(ie,{sx:{color:u[t]},variant:"small-bold",children:f.jsx(Ct,{size:1,icon:o})}),variant:t,onClick:i,disabled:s,sx:{borderColor:"transparent",...a},children:f.jsx(ie,{sx:{color:u[t]},variant:"small-bold",children:n})})},pwe=e=>{const{user:t,deleteAction:n}=e;return f.jsxs(le,{sx:{display:"flex",gap:"5px",padding:"8px",border:"1px solid #E7E6E4",backgroundColor:"Red",borderRadius:"8px",width:"fit-content",justifyContent:"center",alignItems:"center"},children:[f.jsx(m0,{alt:`${t.firstname} ${t.lastname}`,variant:"small"}),f.jsx(ie,{variant:"body-bold",children:t.firstname}),f.jsx(ie,{variant:"body-bold",children:t.lastname}),n&&f.jsx(K,{onClick:n,children:f.jsx(Ct,{size:2,icon:"delete"})})]})},hwe=e=>{const{block:t,improvement:n,textOptions:r}=e,o=ce();return f.jsxs(K,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",padding:o.spacing(2,3),border:`1px solid ${o.palette.divider}`,backgroundColor:o.palette.background.paper,borderRadius:o.spacing(1),height:"100%",position:"relative"},children:[f.jsxs(le,{direction:"row",alignItems:"flex-start",justifyContent:"flex-start",spacing:o.spacing(2),minHeight:o.spacing(4),sx:{width:"100%"},children:[f.jsxs(le,{direction:"row",alignItems:"flex-start",spacing:1.5,children:[t.isLine?f.jsx(K,{sx:{width:o.spacing(2),transform:`translateY(${o.spacing(1)})`,height:o.spacing(.25),backgroundColor:t.color}}):f.jsx(K,{sx:{minWidth:o.spacing(2),transform:`translateY(${o.spacing(.25)})`,height:o.spacing(2),backgroundColor:t.color,borderRadius:o.spacing(.5)}}),f.jsx(ie,{variant:"body2",sx:{fontWeight:o.typography.fontWeightBold},children:t.label})]}),f.jsx(le,{children:t.complete&&f.jsx(RC,{startIcon:"circleCheck",variant:"tags-green",label:r.complete||"",disabled:!0})})]}),t.dataPoints&&t.dataPoints.length>0&&f.jsx(le,{spacing:2,sx:{mt:t.dataPoints[0].startValue&&t.dataPoints[0].endValue?o.spacing(1):0},children:t.dataPoints.map((i,s)=>f.jsxs(le,{direction:"row",alignItems:"center",spacing:.5,children:[!!i.startValue&&!!i.endValue&&f.jsx(k6,{currentValue:i.endValue,comparedTo:{value:i.startValue,label:i.label},improvement:n,layout:{direction:"horizontal",size:"M"},disableText:!0}),f.jsx(le,{direction:"column",alignItems:"flex-start",spacing:1,children:i.label&&f.jsx(ie,{variant:"small",children:i.label})})]},`${t.key}-${s}`))}),f.jsx(K,{children:t.dataPoints&&t.dataPoints.map((i,s)=>i.link&&f.jsx(d6,{href:i.link.url,target:"_blank",rel:"noopener noreferrer",sx:{display:"flex",alignItems:"center",textDecoration:"none",gap:o.spacing(1),cursor:"pointer"},children:f.jsxs(le,{direction:"row",alignItems:"center",spacing:o.spacing(1),color:o.palette.primary.main,mt:o.spacing(2),sx:{"&:hover":{opacity:.8}},children:[f.jsx(Ct,{icon:i.link.icon,size:1}),f.jsx(ie,{variant:"body-medium",sx:{fontWeight:o.typography.fontWeightBold},color:o.palette.primary.main,children:i.link.label})]})},`link-${t.key}-${s}`))})]})},Xu=e=>{const t=e.findIndex(i=>i!==null),n=t!==-1?e[t]:null,r=[...e].reverse().findIndex(i=>i!==null),o=r!==-1?e[e.length-1-r]:null;return{firstValue:n,lastValue:o}},gwe=e=>{const t=ce(),{datasets:n,datasetsLabels:r,improvement:o,urlEditTrajectories:i,textOptions:s}=e,[a,c]=[r[0],r[r.length-1]],u=n.filter(v=>v.scope==="initial"),d=n.filter(v=>v.scope==="trajectory"),p=n.filter(v=>v.scope==="goal"),h=[];if(u.length>0){const v=u[0];h.push({key:"initial-value",label:v.label,color:`${v.backgroundColor}`})}const g=d.map(v=>`${v.backgroundColor}`).reverse();if(d.length>0&&u.length>0){const v=d[1],C=v?v.data.map(w=>Number(w)):[],y=Number(u[0].data[0]),{lastValue:x}=Xu(C);if(y&&x){const w=[{startValue:y,endValue:x,label:`${s==null?void 0:s.between} ${a} ${s==null?void 0:s.and} ${c}`}];if(d.length>1){const S=d[0].data.map(T=>Number(T)),{lastValue:E}=Xu(S);E&&w.push({startValue:E,endValue:x,label:`${s==null?void 0:s.withoutActionPlan}`})}h.push({key:"trajectory-with-action-plan",label:d[1].label,color:g[0],dataPoints:w})}}if(d.length>1&&u.length>0){const C=d[0].data.map(w=>Number(w)),y=Number(u[0].data[0]),{lastValue:x}=Xu(C);y&&x&&h.push({key:"trajectory-without-action-plan",label:d[0].label,color:g[1],dataPoints:[{startValue:y,endValue:x,label:`${s==null?void 0:s.between} ${a} ${s==null?void 0:s.and} ${c}`}]})}const m=p[0];if(m.scope==="goal"){const v=m?m.data.map(O=>Number(O)):null,{firstValue:C,lastValue:y}=v?Xu(v):{firstValue:null,lastValue:null},x=d[1],w=x?x.data.map(O=>Number(O)):null,{lastValue:M}=w?Xu(w):{lastValue:null},S=m.isGoalNull,E={key:"goal",label:(m==null?void 0:m.label)||(s==null?void 0:s.goal),color:m?`${m.backgroundColor}`:t.custom.dataviz.colorsWithExtra[13].main,isLine:!0,dataPoints:[{startValue:C||void 0,endValue:y||void 0,label:S===!1?`${s==null?void 0:s.between} ${a} ${s==null?void 0:s.and} ${c}`:`${s==null?void 0:s.noObjective}`,link:s!=null&&s.editTrajectories?{label:`${s==null?void 0:s.editTrajectories}`,url:i,icon:"edit"}:void 0}],complete:M&&y?o==="decrease"?M<=y:M>=y:!1},T=!!m.forceLegend;(S&&T||m.isGoalNull!==!0&&y)&&h.push(E)}return h},mwe=e=>{const t=ce(),{datasets:n,datasetsLabels:r,improvement:o,urlEditTrajectories:i,textOptions:s}=e,c={...{complete:"",between:"",and:"",withoutActionPlan:"",goal:"",noObjective:"",editTrajectories:""},...s},u=gwe({datasets:n,datasetsLabels:r,improvement:o,urlEditTrajectories:i,textOptions:c});return f.jsx(Rl,{container:!0,spacing:2,sx:{p:t.spacing(3.25,0,0,0),alignItems:"stretch"},children:u.map(d=>f.jsx(Rl,{size:{xs:12,sm:6,md:3},children:f.jsx(hwe,{block:d,improvement:o,textOptions:c})},d.key))})},DC=e=>({hasWithoutActionPlan:e.withoutActionPlan!==null&&e.withoutActionPlan!==void 0,hasScore:e.initial!==null&&e.initial!==void 0,hasWithActionPlan:e.withActionPlan!==null&&e.withActionPlan!==void 0}),VC=(e,t,n,r,o=.25)=>{const{hasWithoutActionPlan:i,hasScore:s,hasWithActionPlan:a}=r,c=(i?1:0)+(s?1:0)+(a?1:0),u=n,d=3*u,p=u*o,h=e==="withoutActionPlan"?t:e==="score"?t-u:t-2*u;if(c===1&&(e==="withoutActionPlan"&&i||e==="score"&&s||e==="withActionPlan"&&a))return{x:h+p,width:d-2*p};if(c===2){if(i&&s&&!a){if(e==="withoutActionPlan")return{x:h,width:1.5*u};if(e==="score")return{x:h+1.5*u,width:1.5*u}}if(i&&!s&&a){if(e==="withoutActionPlan")return{x:h+u*.75,width:u*.75};if(e==="withActionPlan")return{x:h+u*1.5,width:u*.75}}if(!i&&s&&a){if(e==="score")return{x:h,width:1.5*u};if(e==="withActionPlan")return{x:h+1.5*u,width:1.5*u}}}return{x:t,width:n}},vwe=({registerBarTopY:e,marginFactor:t})=>n=>{const{x:r,width:o,payload:i,y:s}=n,u=VC("withoutActionPlan",typeof r=="number"?r:0,typeof o=="number"?o:0,DC(i),t);return e(i==null?void 0:i.name,s),f.jsx(Xl,{...n,x:u.x,width:u.width})},Cwe=({registerBarTopY:e,marginFactor:t})=>n=>{const{x:r,width:o,payload:i,y:s}=n,u=VC("score",typeof r=="number"?r:0,typeof o=="number"?o:0,DC(i),t);return e(i==null?void 0:i.name,s),f.jsx(Xl,{...n,x:u.x,width:u.width})},bwe=({registerBarTopY:e,marginFactor:t})=>n=>{const{x:r,width:o,payload:i,y:s}=n,u=VC("withActionPlan",typeof r=="number"?r:0,typeof o=="number"?o:0,DC(i),t);return e(i==null?void 0:i.name,s),f.jsx(Xl,{...n,x:u.x,width:u.width,rx:4,ry:4})},ywe=(e,t)=>t&&["fr","fr-FR","fr-CA"].some(r=>t.startsWith(r.split("-")[0]))?`${e} :`:`${e}:`,xwe=e=>{const t=ce(),{label:n,value:r,color:o,dataKey:i,unit:s,language:a,precision:c=0,valueFormatterFn:u=t.numbers.valueFormatterFn}=e;return f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:t.spacing(1)},children:[i==="goal"?f.jsx("div",{style:{minWidth:12,height:2,backgroundColor:o,borderRadius:2}}):f.jsx("div",{style:{minWidth:12,height:12,backgroundColor:o,borderRadius:2}}),f.jsxs(le,{direction:"row",spacing:t.spacing(.5),alignItems:"center",children:[f.jsx(ie,{variant:"small-bold",sx:{lineHeight:"16px"},children:ywe(n,a)}),f.jsx(ie,{variant:"number-small",fontWeight:700,children:u(Number(r),c)}),f.jsx(ie,{variant:"small-medium",color:t.custom.grey[1400],children:s?` ${s}`:""})]})]})},Ju=e=>typeof e=="number"?e:null,wwe=(e,t,n)=>{if(!e||!t||typeof n>"u")return null;const r=e.findIndex(p=>String(p)===String(n));if(r<0)return null;const o=Ju(t[r]);if(o!==null)return o;let i=r-1;for(;i>=0&&Ju(t[i])===null;)i--;let s=r+1;const a=t.length;for(;s<a&&Ju(t[s])===null;)s++;const c=i>=0?Ju(t[i]):null,u=s<a?Ju(t[s]):null;if(c===null||u===null||s===i)return null;const d=(r-i)/(s-i);return c+(u-c)*d},Swe=e=>{const t=ce(),{tooltipProps:n,unit:r,goalName:o,initialName:i,withoutActionPlanName:s,withActionPlanName:a,valueFormatterFn:c=t.numbers.valueFormatterFn,language:u,precision:d,barTopY:p,goalData:h,labels:g,goalColor:m}=e,{active:v,label:C,coordinate:y,payload:x=[]}=n;if(!v||x.length===0||!y)return null;const w=new Set,M=x.filter(L=>{if(L.value===null||L.value===void 0)return!1;const j=L.dataKey;if(typeof j=="string"||typeof j=="number"){if(w.has(j))return!1;w.add(j)}return!0}),S=wwe(g,h,C);if(M.length===0&&typeof S!="number")return null;const T=M.some(L=>L.dataKey==="goal")||typeof S!="number"?M:[...M,{dataKey:"goal",value:S,color:m}],O=L=>{if(typeof L.name=="string")return L.name;const j=L.dataKey;return{goal:o,initial:i,withoutActionPlan:s,withActionPlan:a}[j]||""},P=f.jsxs(le,{direction:"column",spacing:t.spacing(.5),children:[f.jsx(ie,{variant:"h4",children:C}),T.map((L,j)=>{const A=L.color,R=typeof A=="string"?A:"transparent",_=O(L);return!_||L.value===null||L.value===void 0?null:f.jsx(xwe,{label:_,value:L.value,color:R,dataKey:String(L.dataKey),unit:r,language:u,precision:d,valueFormatterFn:c},`${String(L.dataKey??j)}-${j}`)})]}),k=Gu({coordinate:{x:y.x,y:y.y},customY:p,placement:"top"});return f.jsx(K,{sx:k,children:f.jsx(di,{width:"inherit",title:P,placement:"top",arrow:!0,open:!0,sx:Ku(),children:f.jsx("div",{style:{width:1,height:1,visibility:"hidden",pointerEvents:"none"}})})})};function _C(e,t){return typeof e=="string"?e:t}const Mwe=e=>{const t=ce(),{transformedData:n,initialDataset:r,trajectoryDatasets:o,goalDataset:i,chartData:s,unit:a,valueFormatterFn:c=t.numbers.valueFormatterFn,precision:u=0,barTopsRef:d}=e,p=vn.language,h=(P,k)=>{if(typeof P=="string"&&typeof k=="number"){const L=d.current[P];d.current[P]=typeof L=="number"?Math.min(L,k):k}};I.useEffect(()=>{d.current={}},[n,d]);const g=.3,m=vwe({registerBarTopY:h,marginFactor:g}),v=Cwe({registerBarTopY:h,marginFactor:g}),C=bwe({registerBarTopY:h,marginFactor:g}),y=I.useMemo(()=>{var k;const P=(k=o[0])==null?void 0:k.backgroundColor;return typeof P=="string"?P:"transparent"},[o]),x=I.useMemo(()=>{const P=r==null?void 0:r.backgroundColor;return typeof P=="string"?P:"transparent"},[r]),w=I.useMemo(()=>{var k;const P=(k=o[1])==null?void 0:k.backgroundColor;return typeof P=="string"?P:"transparent"},[o]),M=I.useMemo(()=>r!=null&&r.label?String(r.label):"Initial",[r]),S=I.useMemo(()=>i!=null&&i.label?String(i.label):"Goal",[i]),E=I.useMemo(()=>{var P,k;return(P=o[0])!=null&&P.label?String((k=o[0])==null?void 0:k.label):"Without action plan"},[o]),T=I.useMemo(()=>{var P,k;return(P=o[1])!=null&&P.label?String((k=o[1])==null?void 0:k.label):"With action plan"},[o]),O=[4,4,0,0];return f.jsx(fr,{width:"100%",height:"100%",children:f.jsxs(TC,{data:n,margin:{left:10,right:0,top:50,bottom:10},barCategoryGap:"10%",barGap:2,children:[f.jsx(Zi,{strokeDasharray:"4 4",stroke:t.palette.divider,vertical:!1}),f.jsx(yi,{dataKey:"name",tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateY(${t.spacing(2)})`}},axisLine:{stroke:t.palette.divider},tickLine:!1,interval:"equidistantPreserveStart",padding:{left:0,right:0}}),f.jsx(qo,{width:"auto",tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateX(-${t.spacing(1)})`}},axisLine:{stroke:t.palette.divider},tickLine:!1,tickFormatter:P=>c(Number(P)),children:f.jsx(Wo,{value:a,position:"insideTopLeft",style:{fontFamily:"Montserrat",fontSize:"14px",transform:`translate(-${t.spacing(1.75)}, -${t.spacing(6)})`}})}),f.jsx(qa,{cursor:!1,content:P=>{const k=P&&(typeof P.label=="string"||typeof P.label=="number")?String(P.label):void 0,L=k?d.current[k]:void 0,j=i?_C(i.borderColor??i.backgroundColor,t.palette.primary.main):void 0;return f.jsx(Swe,{tooltipProps:P,unit:a,goalName:S,initialName:M,withoutActionPlanName:E,withActionPlanName:T,valueFormatterFn:c,language:p,precision:u,barTopY:L,goalData:i==null?void 0:i.data,labels:s.labels,goalColor:j})}}),f.jsx(zi,{animationBegin:100,animationDuration:200,dataKey:"withoutActionPlan",name:E,fill:y,radius:O,shape:m},"withoutActionPlan"),f.jsx(zi,{animationBegin:0,animationDuration:200,dataKey:"initial",name:M,fill:x,radius:O,shape:v},"initial"),f.jsx(zi,{animationBegin:150,animationDuration:200,dataKey:"withActionPlan",name:T,fill:w,radius:O,shape:C},"withActionPlan"),i?f.jsx(Uu,{animationBegin:400,animationDuration:200,type:"linear",dataKey:"goal",name:S,stroke:_C(i.borderColor??i.backgroundColor,t.palette.primary.main),strokeWidth:2,dot:{fill:_C(i.borderColor??i.backgroundColor,t.palette.primary.main),r:4},connectNulls:!0,strokeDasharray:"0"},"goal"):null]})})},Ewe="100%",Twe="100%",Owe=0,kwe=50,Pwe=1,Lwe=1,jwe=3,Iwe=1,Awe=2,Rwe=e=>{const t=ce(),{unit:n,width:r=Ewe,height:o=Twe,showLegend:i=!0,improvement:s="decrease",urlEditTrajectories:a,valueFormatterFn:c=t.numbers.valueFormatterFn,precision:u=Owe,textOptions:d,forceGoalLegend:p,...h}=e,g=fwe(h),m=I.useRef(null),v=I.useRef({}),C=I.useMemo(()=>{const S=[];return g.labels.forEach((E,T)=>{const O={name:E};let P=0,k=!1;g.datasets.forEach(L=>{if(L.scope==="goal"&&L.isGoalNull)return;const j=L.data[T]??null,A=typeof j=="number"?j:null;A!==null&&(k=!0,L.scope==="goal"?O.goal=A:L.scope==="initial"?O.initial=A:L.scope==="trajectory"&&(P++,P===Iwe?O.withoutActionPlan=A:P===Awe&&(O.withActionPlan=A)))}),k&&S.push(O)}),S},[g.datasets,g.labels]),y=I.useMemo(()=>g.datasets.filter(S=>S.scope==="goal"&&S.isGoalNull&&!p?!1:S.scope==="trajectory"?S.data.some(T=>T!==null):!0),[g.datasets,p]),x=I.useMemo(()=>y.find(S=>S.scope==="initial"),[y]),w=I.useMemo(()=>y.filter(S=>S.scope==="trajectory"),[y]),M=I.useMemo(()=>y.find(S=>S.scope==="goal"),[y]);return f.jsxs(le,{direction:"column",position:"relative",width:r,height:o,minHeight:t.spacing(kwe),justifyContent:"stretch",sx:{"& *":{outline:"none"}},children:[f.jsx(K,{sx:{border:`${Pwe}px solid ${t.palette.divider}`,backgroundColor:t.palette.background.paper,borderRadius:t.spacing(Lwe),height:"100%",width:"100%",padding:t.spacing(jwe)},ref:m,children:f.jsx(Mwe,{transformedData:C,initialDataset:x,trajectoryDatasets:w,goalDataset:M,chartData:g,unit:n,valueFormatterFn:c,precision:u,barTopsRef:v})}),i&&f.jsx(mwe,{datasets:g.datasets,datasetsLabels:g.labels,improvement:s,urlEditTrajectories:a,textOptions:d})]})},eN=e=>{var V,H,X,Q;const{x:t,width:n,chartHeight:r,index:o,data:i,unit:s,chartWidth:a,options:c,language:u,precision:d,improvementType:p="increase"}=e,h={minWidth:80,textBaseSize:4,unitBaseSize:6,iconBaseSize:40,padding:10,boxHeight:90,minTextSize:.9,minUnitSize:.7,...c},g=ce(),m=i[o];if(!m.withComparison||!m.comparisonValue)return null;const v=m.comparisonValue>=0,C=p==="decrease"?!v:v,y=100/i.length,x=a||500,w=Number(n)*2,M=y*x/100-w/1.25,S=Math.max(`${v?"+":""}${Intl.NumberFormat(u,{notation:"standard",maximumFractionDigits:d}).format(Number(m.comparisonValue))}`.length*h.textBaseSize+s.length*h.unitBaseSize+h.iconBaseSize,h.minWidth),E=M<S?"compact":"standard",T=`${v?"+":""}${Intl.NumberFormat(u,{notation:E,maximumFractionDigits:d}).format(Number(m.comparisonValue))}`,O=M/S,P=Math.min(S,M),k=M<S?M+Number(n)/4:S+Number(n)/4,L=k-4,j=k,A=k-4,R=k,_=Number(n)/4,N=h.boxHeight,z=Number(t)+Number(n)/2+y*x/100/2-P/2+15,B=r-N*2-16,$=()=>f.jsxs("g",{children:[f.jsx("line",{transform:`translate(0, ${N/2})`,x1:-_,y1:0,x2:k,y2:0,stroke:"#e0e0e0",strokeWidth:"1"}),f.jsx("line",{transform:`translate(0, ${N/2})`,x1:L,y1:-4,x2:j,y2:0,stroke:"#e0e0e0",strokeWidth:"1"}),f.jsx("line",{transform:`translate(0, ${N/2})`,x1:A,y1:4,x2:R,y2:0,stroke:"#e0e0e0",strokeWidth:"1"})]});return f.jsxs("g",{transform:`translate(${z}, ${B})`,children:[f.jsx($,{}),f.jsx("foreignObject",{x:0,y:0,width:P,height:N,children:f.jsxs(K,{sx:{width:"100%",height:"100%",backgroundColor:"#ffffff",border:"1px solid #e0e0e0",borderRadius:"8px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",padding:`${h.padding}px`,boxSizing:"border-box",gap:"2px"},children:[f.jsx(Ct,{icon:C?"circleCheck":"inProgress",size:2,backgroundColor:C?((H=c==null?void 0:c.iconColorNegative)==null?void 0:H.background)||g.custom.dataviz.colorsWithExtra[7].variant[100]:((V=c==null?void 0:c.iconColorPositive)==null?void 0:V.background)||g.custom.dataviz.colorsWithExtra[12].variant[100],color:C?((Q=c==null?void 0:c.iconColorNegative)==null?void 0:Q.foreground)||g.custom.dataviz.colorsWithExtra[7].variant[700]:((X=c==null?void 0:c.iconColorPositive)==null?void 0:X.foreground)||g.custom.dataviz.colorsWithExtra[12].variant[700]}),f.jsxs(le,{direction:"column",alignItems:"center",spacing:g.spacing(.5),children:[f.jsx(ie,{variant:"number-small",sx:{lineHeight:`${g.spacing(2)}`,fontSize:O<1?`clamp(${h.minTextSize}rem, ${O*.9}rem, 1rem)`:void 0},children:T}),f.jsx(ie,{variant:"small-medium",sx:{color:g.custom.grey[2e3],textAlign:"center",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",lineHeight:`${g.spacing(2)}`,fontSize:O<1?`clamp(${h.minUnitSize}rem, ${O*.8}rem, 0.875rem)`:void 0},children:s})]})]})})]})},tN=e=>{const{x:t,y:n,width:r,value:o,unit:i,options:s,precision:a,language:c,valuesFormatterFn:u}=e,d={valueOffsetY:30,unitOffsetY:17.5,valueFontSize:16,unitFontSize:12,valueColor:"#000",unitColor:"#666",...s},p=Number(t)+Number(r)/2,h=Number(n)-d.valueOffsetY;return f.jsxs("g",{children:[f.jsx("text",{x:p,y:h,textAnchor:"middle",fill:d.valueColor,fontSize:d.valueFontSize,fontWeight:"bold",children:u?u(Number(o)):a!==void 0?Number(o).toFixed(a):Number(o).toLocaleString(c)}),f.jsx("text",{x:p,y:h+d.unitOffsetY,textAnchor:"middle",fill:d.unitColor,fontSize:d.unitFontSize,children:i})]})},nN=e=>{const{x:t,y:n,payload:r,fontColor:o}=e,i=ce();return f.jsx("g",{transform:`translate(${t},${n})`,children:f.jsx("foreignObject",{x:-50,y:0,width:100,height:100,children:f.jsx(ie,{sx:{textAlign:"center",paddingTop:"0px",color:o||i.custom.grey[2e3]},children:r.value})})})},Dwe=300,Vwe=0,_we=[4,4,0,0],Nwe=50,Hwe=1,$we=60,Fwe=-50,Bwe=-50,zwe=40,Zwe=200,Wwe=0,Uwe="5 5",qwe="0",Gwe=e=>{const t=ce(),n=vn.language,{data:r,unit:o,valuesFormatterFn:i=t.numbers.valueFormatterFn,chartStyling:s,comparisonLabelOptions:a,valueLabelOptions:c,precision:u,chartWidth:d,chartHeight:p,displayComparisonLabel:h=!0,improvementType:g}=e,v={...{barRadius:_we,barMaxWidth:Nwe,barColor:t.custom.dataviz.colorsWithExtra[12].variant[100],barStroke:t.custom.dataviz.colorsWithExtra[12].variant[700],barStrokeWidth:Hwe,height:p||Dwe,margin:{top:$we,right:Fwe,left:Bwe,bottom:zwe}},...s},[C,y]=I.useState(d||Vwe),x=I.useRef(null);I.useEffect(()=>{const M=()=>{x.current&&y(x.current.offsetWidth)};return M(),window.addEventListener("resize",M),()=>window.removeEventListener("resize",M)},[]);const w=r.map((M,S)=>M.withComparison&&S<r.length-1?{...M,comparisonValue:r[S+1].value-M.value}:M);return f.jsx(K,{sx:{position:"relative","& *":{outline:"none"}},children:f.jsx(fr,{width:"100%",height:v.height,ref:x,children:f.jsx(Kf,{data:w,margin:v.margin,children:f.jsxs(zi,{dataKey:"value",radius:v.barRadius,maxBarSize:v.barMaxWidth,style:{outline:"none"},animationDuration:Zwe,animationBegin:Wwe,children:[f.jsx(yi,{dataKey:"label",tickLine:!1,axisLine:!0,tick:M=>f.jsx(nN,{...M})}),f.jsx(qo,{hide:!0}),h&&f.jsx(Ga,{dataKey:"comparisonValue",content:f.jsx(eN,{unit:o,data:w,chartWidth:C,options:a,precision:u,language:n,improvementType:g,chartHeight:p})}),f.jsx(Ga,{dataKey:"value",content:f.jsx(tN,{unit:o,options:c,precision:u,language:n,valuesFormatterFn:i})}),w.map((M,S)=>f.jsx(yo,{fill:v.barColor,stroke:v.barStroke,strokeWidth:v.barStrokeWidth,strokeDasharray:M.shape==="dotted"?Uwe:qwe},`cell-${S}`))]})})})})},NC=e=>{const{active:t,hoveredIndex:n,data:r,coordinate:o,formatter:i,unit:s,icons:a}=e,c=ce();if(!t||n===null||!o||!r[n])return null;const u=r[n],d=i?i(u.value,0):c.numbers.valueFormatterFn(u.value,0),p=f.jsxs(le,{sx:{pointerEvents:"none"},direction:"column",alignItems:"flex-start",justifyContent:"center",spacing:c.spacing(1),children:[f.jsxs(le,{direction:"row",alignItems:"center",spacing:c.spacing(1),children:[a&&n!==void 0&&a[n]?f.jsx(K,{minWidth:"24px",width:"24px",height:"24px",sx:{background:u.color,padding:"4px",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"3px"},children:a[n]}):f.jsx(K,{sx:{width:"12px",height:"12px",borderRadius:"3px",backgroundColor:u.color}}),f.jsx(ie,{variant:"h6",children:u.name})]}),f.jsxs(le,{direction:"row",alignItems:"flex-end",spacing:.5,children:[f.jsx(ie,{variant:"number-inter",sx:{p:0,m:0,lineHeight:c.spacing(4)},children:d}),s&&f.jsx(ie,{variant:"small-bold",color:c.custom.grey[1400],children:s})]})]}),h=Gu({coordinate:{x:o.x,y:o.y},placement:"top"});return f.jsx(K,{sx:{...h,zIndex:2e3,pointerEvents:"none"},children:f.jsx(di,{width:"max-content",title:p,disableInteractive:!0,placement:"top",arrow:!0,open:!0,popperZIndex:0,sx:Ku(),children:f.jsx("div",{style:{width:1,height:1,visibility:"hidden",pointerEvents:"none"}})})})},Kwe=300,Ywe=300,Xwe=.4,Jwe="0.2s",Xa=4,Qwe=2,HC={top:35,right:10,left:20,bottom:0},eSe=e=>{const t=ce(),{data:n,HoveredChartElementIndex:r,showTooltip:o,valuesFormatterFn:i=(S,E)=>t.numbers.valueFormatterFn(S,E),valuesUnit:s,icons:a,isLoading:c,height:u,onMouseEnter:d,onMouseLeave:p,onLegendAction:h}=e,g=typeof u=="number"?u:Kwe,m=I.useRef([]),v=I.useRef([]),C=I.useRef([]),[y,x]=I.useState(!1),w=!y;if(c){const S=Math.max(4,(n==null?void 0:n.length)??6),E=Array.from({length:S}).map((O,P)=>({name:`${P}`,value:Math.random()*100})),T=t.palette.action.hover;return f.jsx(K,{position:"relative",width:"100%",height:g,sx:{"@keyframes pulse":{"0%":{opacity:.2},"50%":{opacity:1},"100%":{opacity:.2}}},children:f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(Kf,{data:E,margin:HC,children:[f.jsx(Zi,{strokeDasharray:"4 4",stroke:t.palette.divider,vertical:!1}),f.jsx(yi,{dataKey:"name",tick:!1,axisLine:{stroke:t.palette.divider},tickLine:!1}),f.jsx(qo,{hide:!0,domain:[0,100]}),f.jsx(zi,{dataKey:"value",isAnimationActive:!1,style:{pointerEvents:"none"},radius:[Xa,Xa,0,0],children:E.map((O,P)=>f.jsx(yo,{fill:T,style:{animation:"pulse 1.5s ease-in-out infinite"}},`sk-${P}`))})]})})})}return((n==null?void 0:n.length)??0)===0||n.every(S=>Number(S.value)===0)?f.jsxs(K,{position:"relative",width:"100%",height:g,children:[f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(Kf,{data:[{name:"empty",value:1}],margin:HC,children:[f.jsx(Zi,{strokeDasharray:"4 4",stroke:t.palette.divider,vertical:!1}),f.jsx(yi,{dataKey:"name",tick:!1,axisLine:{stroke:t.palette.divider},tickLine:!1}),f.jsx(qo,{hide:!0,domain:[0,1]}),f.jsx(zi,{dataKey:"value",isAnimationActive:!1,radius:[Xa,Xa,0,0],style:{pointerEvents:"none"},children:f.jsx(yo,{fill:"rgba(0, 0, 0, 0)"})})]})}),f.jsx(po,{size:4,icon:"empty",boxProps:{sx:{borderRadius:"3px",backgroundColor:t.custom.grey[400],color:t.custom.grey[1400],position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}})]}):f.jsxs(K,{position:"relative",width:"100%",height:g,children:[f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(Kf,{data:n,margin:HC,children:[f.jsx(yi,{dataKey:"name",strokeDasharray:"4 4",strokeWidth:0,tick:!1,axisLine:{stroke:t.palette.divider},tickLine:!1,interval:"equidistantPreserveStart",padding:{left:0,right:0}}),f.jsx(qo,{width:"auto",tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateX(-${t.spacing(1)})`}},axisLine:{stroke:t.palette.divider},tickLine:!1,tickFormatter:S=>i(Number(S)),children:f.jsx(Wo,{value:s,position:"insideTopLeft",style:{fontFamily:"Montserrat",fontSize:"14px",transform:`translate(-${t.spacing(1.5)}, -${t.spacing(5)})`}})}),f.jsx(Zi,{strokeDasharray:"4 4",stroke:t.palette.divider,vertical:!1}),f.jsx(zi,{dataKey:"value",radius:[Xa,Xa,0,0],animationDuration:Ywe,isAnimationActive:w,onAnimationEnd:()=>x(!0),onClick:(S,E)=>{h&&h(E)},style:{cursor:"pointer"},shape:S=>{const E=S,{x:T,y:O,width:P,height:k,payload:L}=E,j=(L==null?void 0:L.index)??0;typeof T=="number"&&typeof P=="number"&&(m.current[j]=T+P/2),typeof O=="number"&&(v.current[j]=O),typeof k=="number"&&(C.current[j]=k);const A=(L==null?void 0:L.color)??t.palette.primary.main,R=r===j,_=r===null||R?A:bt(A).alpha(Xwe).css();return f.jsx(Xl,{x:T,y:O,width:P,height:k,radius:[Xa,Xa,0,0],fill:_,stroke:E.stroke,strokeWidth:E.strokeWidth,style:{transition:`all ${Jwe} ease-in-out`,filter:R?`drop-shadow(0 0 ${Qwe}px ${A})`:"none"},onMouseEnter:R?void 0:()=>d(j),onMouseLeave:()=>p()})}})]})}),o&&r!==null&&(()=>{const S=m.current[r],E=v.current[r],T=C.current[r],O=typeof E=="number"&&typeof T=="number"?E:g/2;return typeof S!="number"||typeof O!="number"?null:f.jsx(NC,{active:!0,hoveredIndex:r,data:n.map((P,k)=>({...P,index:k})),coordinate:{x:S,y:O},formatter:i,unit:s,icons:a})})()]})},tSe=300,nSe=300,rSe=.4,oSe="0.2s",iSe=6,rN=3,$C={top:35,right:10,left:20,bottom:0},sSe=2,aSe=e=>{const t=ce(),{data:n,HoveredChartElementIndex:r,showTooltip:o,valuesFormatterFn:i=(S,E)=>t.numbers.valueFormatterFn(S,E),valuesUnit:s,icons:a,isLoading:c,height:u,onMouseEnter:d,onMouseLeave:p,onLegendAction:h}=e,g=typeof u=="number"?u:tSe,m=n.length>0?n[0].color:t.palette.primary.main,v=I.useRef([]),[C,y]=I.useState(!1),x=!C,w=t.palette.primary.main;if(c){const S=Math.max(5,Math.min(9,(n==null?void 0:n.length)||7)),E=Array.from({length:S}).map((O,P)=>({name:`${P}`,value:Math.random()*100})),T=t.palette.action.hover;return f.jsx(K,{position:"relative",width:"100%",height:g,sx:{"@keyframes pulse":{"0%":{opacity:.2},"50%":{opacity:1},"100%":{opacity:.2}}},children:f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(SC,{data:E,margin:$C,children:[f.jsx(Zi,{strokeDasharray:"4 4",stroke:t.palette.divider,vertical:!1}),f.jsx(yi,{dataKey:"name",tick:!1,axisLine:{stroke:t.palette.divider},tickLine:!1}),f.jsx(qo,{hide:!0,domain:[0,100]}),f.jsx(qa,{cursor:!1,wrapperStyle:{display:"none"},isAnimationActive:!1}),f.jsx(Uu,{type:"monotone",dataKey:"value",stroke:T,strokeWidth:rN,dot:{r:5,stroke:T,fill:T},isAnimationActive:!1,style:{pointerEvents:"none",animation:"pulse 1.5s ease-in-out infinite"}})]})})})}return((n==null?void 0:n.length)??0)===0||n.every(S=>Number(S.value)===0)?f.jsxs(K,{position:"relative",width:"100%",height:g,children:[f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(SC,{data:[{name:"e1",value:1},{name:"e2",value:1}],margin:$C,children:[f.jsx(Zi,{strokeDasharray:"4 4",stroke:t.palette.divider,vertical:!1}),f.jsx(yi,{dataKey:"name",tick:!1,axisLine:{stroke:t.palette.divider},tickLine:!1}),f.jsx(qo,{hide:!0,domain:[0,1]}),f.jsx(qa,{cursor:!1,wrapperStyle:{display:"none"},isAnimationActive:!1}),f.jsx(Uu,{type:"monotone",dataKey:"value",strokeWidth:0,dot:!1,isAnimationActive:!1,style:{pointerEvents:"none"}})]})}),f.jsx(po,{size:4,icon:"empty",boxProps:{sx:{borderRadius:"3px",backgroundColor:t.custom.grey[400],color:t.custom.grey[1400],position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}})]}):f.jsxs(K,{position:"relative",width:"100%",height:g,children:[f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(SC,{data:n,margin:$C,children:[f.jsx(Zi,{strokeDasharray:"4 4",stroke:t.palette.divider,vertical:!1}),f.jsx(yi,{dataKey:"name",strokeDasharray:"4 4",strokeWidth:0,tick:!1,axisLine:{stroke:t.palette.divider},interval:"equidistantPreserveStart",padding:{left:0,right:0}}),f.jsx(qo,{width:"auto",tick:{fontFamily:"Montserrat",fontSize:14,style:{transform:`translateX(-${t.spacing(1)})`}},axisLine:{stroke:t.palette.divider},tickLine:!1,tickFormatter:S=>i(Number(S)),children:f.jsx(Wo,{value:s,position:"insideTopLeft",style:{fontFamily:"Montserrat",fontSize:"14px",transform:`translate(-${t.spacing(1.5)}, -${t.spacing(5)})`}})}),f.jsx(Uu,{type:"monotone",dataKey:"value",stroke:w,strokeWidth:rN,animationDuration:nSe,isAnimationActive:x,onAnimationEnd:()=>y(!0),dot:S=>{const{cx:E,cy:T,payload:O,index:P}=S,k=typeof(O==null?void 0:O.index)=="number"?O.index:0,L=typeof P=="number"?P:k;typeof E=="number"&&typeof T=="number"&&(v.current[L]={x:E,y:T});const j=r===L,A=(O==null?void 0:O.color)||m,R=r===null||j?A:bt(A).alpha(rSe).css();return f.jsx("g",{children:f.jsx("circle",{cx:E,cy:T,r:iSe,fill:R,stroke:R,strokeWidth:0,onMouseEnter:()=>d(L),onMouseLeave:()=>p(),style:{cursor:"pointer",transition:`all ${oSe} ease-in-out`,filter:j?`drop-shadow(0 0 ${sSe}px ${A})`:"none"}})})},activeDot:!1}),f.jsx(qa,{cursor:!1,wrapperStyle:{display:"none"},isAnimationActive:!1})]})}),o&&r!==null&&(()=>{const S=r,E=v.current[S];return E?f.jsx(NC,{active:!0,hoveredIndex:S,data:n.map((T,O)=>({...T,index:O})),coordinate:{x:E.x,y:E.y},formatter:i,unit:s,icons:a}):null})()]})},lSe=300,p2="100%",FC="50%",BC="50%",Si={top:20,right:30,left:20,bottom:20},cSe=300,uSe=0,dSe=.4,fSe=2,pSe="0.2s",oN=.08,iN=4,e4=10,hSe=e=>{var N,z,B;const t=ce(),{data:n,HoveredChartElementIndex:r,spacing:o,borderWidth:i,borderColor:s,showTooltip:a,tooltipPos:c,valuesFormatterFn:u=($,V)=>t.numbers.valueFormatterFn($,V),language:d,valuesUnit:p,icons:h,isLoading:g,height:m,onMouseEnter:v,onMouseLeave:C,onLegendAction:y}=e,x=typeof m=="number"?m:lSe,w=I.useRef(null),M=I.useMemo(()=>$=>u?u($,0):t.numbers.valueFormatterFn($,0),[u,t]),S=I.useMemo(()=>{var F;const $=(n==null?void 0:n.length)??0;if($===0||$>32)return!1;const V=(F=w.current)==null?void 0:F.getBoundingClientRect(),H=(V==null?void 0:V.width)??300,X=(V==null?void 0:V.height)??x,Q=Math.max(0,H-Si.left-Si.right),ne=Math.max(0,X-Si.top-Si.bottom),q=Math.min(Q,ne),J=p2.endsWith("%")?Number(p2.replace("%",""))/100:1,te=q/2*J;return 2*Math.PI*te/$>=18},[n==null?void 0:n.length,x]),[E,T]=I.useState(void 0),[O,P]=I.useState(!1),k=!O,L=I.useCallback(($,V)=>{if($&&typeof $.cx=="number"&&typeof $.cy=="number"&&typeof $.midAngle=="number"&&typeof $.outerRadius=="number"){const H=bk($.cx,$.cy,$.midAngle,$.outerRadius);T(H)}v($,V)},[v]),j=I.useCallback(()=>{T(void 0),C()},[C]),A=$=>{const{cx:V=0,cy:H=0,midAngle:X=0,innerRadius:Q=0,outerRadius:ne=0,percent:q=0,value:J=0,payload:te}=$;if(!isFinite(Number(q)))return null;const Y=Math.PI/180,Z=Number(q)<oN,F=-Number(X)*Y,G=Number(Q),D=Number(ne),ee=Number(V),oe=Number(H),se=G+(D-G)*.8,ue=Math.cos(F),re=Math.sin(F),he=se*ue+ee,pe=se*re+oe;let be=he,Se=pe,Ce="middle";if(Z){const ye=ee+(D+e4)*ue,Ie=oe+(D+e4)*re;be=ye+(ue>=0?8:-8)+(ue>=0?6:-6),Se=Ie,Ce=ue>=0?"start":"end"}const Ze=`${M(Number(J))}`,Ge=te==null?void 0:te.color,ve=bt(Ge??t.palette.text.primary).luminance()<.5?t.palette.common.white:t.palette.text.primary;return f.jsx("text",{x:be,y:Se,textAnchor:Ce,dominantBaseline:"middle",fontFamily:"Montserrat",fontWeight:600,fontSize:14,fill:Z?t.palette.text.primary:ve,style:{pointerEvents:"none"},children:Ze})},R=$=>{const{cx:V=0,cy:H=0,midAngle:X=0,outerRadius:Q=0,percent:ne=0}=$,q=Math.PI/180;if(!isFinite(Number(ne))||Number(ne)>=oN)return f.jsx("g",{});const J=-Number(X)*q,te=Number(V),Y=Number(H),Z=Number(Q),F=Math.cos(J),G=Math.sin(J),D=te+(Z+iN)*F,ee=Y+(Z+iN)*G,oe=te+(Z+e4)*F,se=Y+(Z+e4)*G,ue=oe+(F>=0?8:-8),re=se;return f.jsx("path",{d:`M${D},${ee} L${oe},${se} L${ue},${re}`,stroke:t.palette.text.secondary,fill:"none",style:{pointerEvents:"none"}})},_=I.useMemo(()=>{var ee;if(!c||c.angle===void 0)return;const $=(ee=w.current)==null?void 0:ee.getBoundingClientRect(),V=($==null?void 0:$.width)??300,H=($==null?void 0:$.height)??x,X=Math.max(0,V-Si.left-Si.right),Q=Math.max(0,H-Si.top-Si.bottom),ne=Math.min(X,Q),q=p2.endsWith("%")?Number(p2.replace("%",""))/100:1,J=ne/2*q,te=Math.PI/180,Y=c.angle,Z=Si.left+X/2,F=Si.top+Q/2,G=Z+J*Math.cos(-te*Y),D=F+J*Math.sin(-te*Y);return{x:G,y:D,angle:Y}},[c,x]);if(g){const $=t.palette.action.hover;return f.jsx(K,{position:"relative",width:"100%",height:x,sx:{"@keyframes pulse":{"0%":{opacity:.2},"50%":{opacity:1},"100%":{opacity:.2}}},children:f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsx(Yf,{margin:Si,children:f.jsx(l2,{data:[{name:"loading",value:1}],cx:FC,cy:BC,outerRadius:p2,dataKey:"value",isAnimationActive:!1,stroke:"none",style:{pointerEvents:"none"},children:f.jsx(yo,{fill:$,style:{animation:"pulse 1.5s ease-in-out infinite"}})})})})})}return f.jsxs(K,{position:"relative",width:"100%",height:x,ref:w,children:[f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(Yf,{margin:Si,onMouseLeave:j,children:[f.jsx(l2,{data:n,cx:FC,cy:BC,outerRadius:p2,paddingAngle:o,dataKey:"value",minAngle:.5,isAnimationActive:k,animationDuration:cSe,animationBegin:uSe,onAnimationEnd:()=>P(!0),onMouseEnter:L,onMouseLeave:j,onClick:($,V)=>{y&&y(V)},stroke:"none",style:{outline:"none"},label:S?A:void 0,labelLine:S?R:!1,children:n.map(($,V)=>{const H=r===V,X=r===null||H?$.color:bt($.color).alpha(dSe).css();return f.jsx(yo,{fill:X,strokeWidth:i,stroke:s,style:{filter:H?`drop-shadow(0 0 ${fSe}px ${$.color})`:"none",cursor:"pointer",transition:`all ${pSe} ease-in-out`},className:H?"cell-hovered":"cell-idle"},`cell-${V}`)})}),(n.length===0||n.every($=>$.value===0))&&f.jsx(l2,{data:[{name:"empty",value:1}],cx:FC,cy:BC,outerRadius:p2,dataKey:"value",isAnimationActive:!1,stroke:"none",style:{pointerEvents:"none"},children:f.jsx(yo,{fill:t.palette.action.hover})})]})}),a&&f.jsx(N_,{active:r!==null,payload:r!==null?[{name:((N=n[r])==null?void 0:N.name)??"",value:((z=n[r])==null?void 0:z.value)??0,color:((B=n[r])==null?void 0:B.color)??"",payload:n[r]||{}}]:[],formatter:u,language:d,unit:p,coordinate:(c?_:void 0)??E,icons:h}),(n.length===0||n.every($=>$.value===0))&&f.jsx(po,{size:4,icon:"empty",boxProps:{sx:{borderRadius:"3px",backgroundColor:t.custom.grey[400],color:t.custom.grey[1400],position:"absolute",border:`1px solid ${t.custom.grey[700]}`,top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}})]})},gSe=300,mSe=300,vSe=.4,CSe="0.2s",bSe=.2,sN=2,ySe=6,xSe=2,wSe=e=>{const t=ce(),{data:n,HoveredChartElementIndex:r,showTooltip:o,valuesFormatterFn:i,valuesUnit:s,icons:a,isLoading:c,height:u,onMouseEnter:d,onMouseLeave:p,onLegendAction:h}=e,g=t.palette.primary.main,m=typeof u=="number"?u:gSe,v=I.useRef(`radar-${Math.random().toString(36).slice(2)}`),C=`${v.current}-stroke`,y=`${v.current}-fill`,x=I.useRef([]),w=I.useRef(null),[M,S]=I.useState(!1),E=!M;if(c){const O=t.palette.action.hover,P=[{name:"A",value:Math.random()*100},{name:"B",value:Math.random()*100},{name:"C",value:Math.random()*100},{name:"D",value:Math.random()*100},{name:"E",value:Math.random()*100}];return f.jsx(K,{position:"relative",width:"100%",height:m,sx:{"@keyframes pulse":{"0%":{opacity:.2},"50%":{opacity:1},"100%":{opacity:.2}}},children:f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(EC,{data:P,margin:{top:20,right:50,left:50,bottom:5},outerRadius:"85%",innerRadius:"0%",children:[f.jsx(Of,{stroke:t.palette.divider,gridType:"circle"}),f.jsx(Bu,{dataKey:"value",stroke:O,fill:O,strokeWidth:sN,fillOpacity:.25,isAnimationActive:!1,activeDot:!1,style:{pointerEvents:"none",animation:"pulse 1.5s ease-in-out infinite"}}),f.jsx(qa,{cursor:!1,wrapperStyle:{display:"none"},isAnimationActive:!1})]})})})}if(((n==null?void 0:n.length)??0)===0||n.every(O=>Number(O.value)===0)){const O=[{name:"A",value:1},{name:"B",value:1},{name:"C",value:1},{name:"D",value:1},{name:"E",value:1}],P=t.palette.primary[50]||g;return f.jsxs(K,{position:"relative",width:"100%",height:m,children:[f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(EC,{data:O,margin:{top:20,right:50,left:50,bottom:5},outerRadius:"85%",innerRadius:"0%",children:[f.jsx(Of,{stroke:t.palette.divider,gridType:"circle"}),f.jsx(Bu,{dataKey:"value",stroke:P,fill:P,fillOpacity:0,isAnimationActive:!1,activeDot:!1,style:{pointerEvents:"none"}}),f.jsx(qa,{cursor:!1,wrapperStyle:{display:"none"},isAnimationActive:!1})]})}),f.jsx(po,{size:4,icon:"empty",boxProps:{sx:{borderRadius:"3px",backgroundColor:t.custom.grey[400],color:t.custom.grey[1400],position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}})]})}return f.jsxs(K,{position:"relative",width:"100%",height:m,children:[f.jsx(fr,{width:"100%",height:"100%",style:{outline:"none"},children:f.jsxs(EC,{data:n,margin:{top:20,right:50,left:50,bottom:5},outerRadius:"85%",innerRadius:"0%",accessibilityLayer:!0,children:[f.jsxs("defs",{children:[f.jsxs("linearGradient",{id:C,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[f.jsx("stop",{offset:"0%",stopColor:g}),f.jsx("stop",{offset:"100%",stopColor:g})]}),f.jsxs("linearGradient",{id:y,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[f.jsx("stop",{offset:"0%",stopColor:g}),f.jsx("stop",{offset:"100%",stopColor:g})]})]}),f.jsx(Of,{stroke:t.palette.divider,gridType:"circle"}),f.jsx(Pf,{angle:90,domain:[0,"dataMax"],tick:{fontSize:10,fill:t.palette.text.secondary},tickFormatter:O=>i?i(O):O.toString()}),f.jsx(Bu,{dataKey:"value",stroke:`url(#${C})`,fill:`url(#${y})`,strokeWidth:sN,fillOpacity:bSe,animationDuration:mSe,isAnimationActive:E,onAnimationEnd:()=>S(!0),activeDot:!1,dot:O=>{var B;const{cx:P,cy:k,payload:L,index:j}=O,A=typeof j=="number"?j:typeof(L==null?void 0:L.index)=="number"?L.index:0,R=A>=0&&A<n.length;typeof P=="number"&&typeof k=="number"&&R&&(x.current[A]={x:P,y:k});const _=R&&r===A,N=R?(B=n[A])==null?void 0:B.color:g,z=r===null||_?N:bt(N).alpha(vSe).css();return f.jsx("g",{children:f.jsx("circle",{cx:P,cy:k,r:ySe,fill:z,stroke:z,strokeWidth:0,style:{cursor:"pointer",transition:`all ${CSe} ease-in-out`,pointerEvents:"auto",filter:_?`drop-shadow(0 0 ${xSe}px ${z})`:"none"},onMouseEnter:()=>d(R?A:0),onMouseLeave:()=>p()})})}}),f.jsx(qa,{cursor:!1,wrapperStyle:{display:"none"},isAnimationActive:!1})]})}),o&&r!==null&&(()=>{const O=r,P=w.current||x.current[O];return P?f.jsx(NC,{active:!0,hoveredIndex:O,data:n.map((k,L)=>({...k,index:L})),coordinate:{x:P.x,y:P.y},formatter:i,unit:s,icons:a}):null})()]})},SSe=e=>{const t=ce(),{data:n,valuesFormatterFn:r=(d,p)=>t.numbers.valueFormatterFn(d,p),valuesUnit:o,icons:i,isLoading:s,onLegendAction:a}=e,c=d=>{a&&a(d)};if(s){const d=Math.max(4,Math.min(8,(n==null?void 0:n.length)||6));return f.jsx(K,{position:"relative",width:"100%",sx:{border:`1px solid ${t.palette.divider}`,borderRadius:t.shape.borderRadius},children:f.jsx(w6,{sx:{borderRadius:t.shape.borderRadius},children:f.jsx(I1,{children:f.jsx(Vl,{children:Array.from({length:d}).map((p,h)=>f.jsxs(Ra,{sx:{backgroundColor:h%2===0?"rgba(255, 255, 255, 0.4)":`${t.palette.action.hover}`},children:[f.jsx(Vi,{sx:{padding:t.spacing(1.5),border:"none"},children:f.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:t.spacing(2)},children:[f.jsx(Dl,{variant:"rounded",width:32,height:32}),f.jsx(Dl,{variant:"rounded",width:"60%",height:18})]})}),f.jsx(Vi,{align:"right",sx:{border:"none"},children:f.jsx(Dl,{variant:"rounded",width:80,height:18,sx:{ml:"auto"}})})]},`sk-row-${h}`))})})})})}return((n==null?void 0:n.length)??0)===0||n.every(d=>Number(d.value)===0)?f.jsx(K,{position:"relative",width:"100%",children:f.jsx(w6,{sx:{borderRadius:t.shape.borderRadius,border:`1px solid ${t.palette.divider}`},children:f.jsx(I1,{children:f.jsx(Vl,{children:f.jsxs(Ra,{sx:{backgroundColor:t.palette.background.paper},children:[f.jsx(Vi,{sx:{padding:t.spacing(1.5),border:"none"},children:f.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:t.spacing(2)},children:[f.jsx(K,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:"16px",height:"16px",borderRadius:"6px",backgroundColor:t.palette.primary[50]||t.palette.action.hover}}),f.jsx(po,{size:4,icon:"empty",boxProps:{sx:{borderRadius:"3px",backgroundColor:t.custom.grey[400],color:t.custom.grey[1400]}}})]})}),f.jsx(Vi,{align:"right",sx:{color:t.palette.text.secondary,border:"none"},children:"—"})]})})})})}):f.jsx(K,{position:"relative",width:"100%",children:f.jsx(w6,{sx:{borderRadius:t.shape.borderRadius,border:`1px solid ${t.palette.divider}`},children:f.jsx(I1,{children:f.jsx(Vl,{children:n.map((d,p)=>{const h=i==null?void 0:i[p];return f.jsxs(Ra,{onClick:()=>c(p),sx:{backgroundColor:`${p%2===0?t.palette.background.paper:t.palette.action.hover}`},children:[f.jsx(Vi,{sx:{padding:t.spacing(1.5),border:"none"},children:f.jsxs(K,{sx:{display:"flex",alignItems:"center",gap:t.spacing(2)},children:[h?f.jsx(K,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:"32px",height:"32px",padding:"4px",borderRadius:"6px",backgroundColor:d.color,color:t.palette.common.white},children:h}):f.jsx(K,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:"32px",height:"32px"},children:f.jsx(K,{sx:{width:"16px",height:"16px",borderRadius:"4px",backgroundColor:d.color,color:t.palette.common.white}})}),f.jsx(K,{sx:{flexGrow:1,color:t.palette.text.primary,fontWeight:500},children:d.name||`Category ${p+1}`})]})}),f.jsxs(Vi,{align:"right",sx:{color:t.palette.text.primary,border:"none"},children:[f.jsx(K,{component:"span",sx:{fontWeight:500},children:r?r(d.value):d.value}),o&&f.jsx(K,{component:"span",sx:{ml:.5,color:t.palette.text.secondary,fontSize:"0.875em"},children:o})]})]},`table-row-${p}`)})})})})})},MSe=e=>{const t=ce(),{data:n,valuesFormatterFn:r=(d,p)=>t.numbers.valueFormatterFn(d,p),isLoading:o,maxScore:i,separator:s="/"}=e,{sumVal:a,sumMax:c}=I.useMemo(()=>{const d=n.reduce((h,g)=>h+(Number(g.value)||0),0),p=Array.isArray(i)?i.reduce((h,g)=>h+(Number(g)||0),0):typeof i=="number"?i:void 0;return{sumVal:d,sumMax:p}},[n,i]),u=((n==null?void 0:n.length)??0)===0||n.every(d=>Number(d.value)===0);if(o){const d=t.palette.action.hover;return f.jsx(K,{position:"relative",width:"100%",height:"100%",sx:{borderRadius:t.spacing(1.5),justifyContent:"center",alignItems:"center",display:"flex","@keyframes pulse":{"0%":{opacity:.2},"50%":{opacity:1},"100%":{opacity:.2}}},children:f.jsxs(K,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"120px",backgroundColor:t.palette.grey[400],borderRadius:t.spacing(1.5),height:"100%",margin:t.spacing(2),padding:t.spacing(2)},children:[f.jsx(K,{sx:{width:"70%",height:28,borderRadius:1,backgroundColor:d,animation:"pulse 1.5s ease-in-out infinite"}}),f.jsx(K,{sx:{width:"50%",height:16,borderRadius:1,backgroundColor:d,mt:1,animation:"pulse 1.5s ease-in-out infinite"}})]})})}return u?f.jsxs(K,{position:"relative",width:"100%",height:"100%",sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:[f.jsx(K,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"120px",backgroundColor:t.palette.primary[50],borderRadius:t.spacing(1.5),height:"100%",minHeight:t.spacing(10),margin:t.spacing(2),padding:t.spacing(2)}}),f.jsx(po,{size:4,icon:"empty",boxProps:{sx:{borderRadius:"3px",backgroundColor:t.custom.grey[400],color:t.custom.grey[1400],position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}})]}):f.jsx(K,{width:"100%",height:"100%",sx:{borderRadius:t.spacing(1.5),justifyContent:"center",alignItems:"center",display:"flex"},children:f.jsxs(K,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"120px",backgroundColor:t.palette.primary[50],borderRadius:t.spacing(1.5),height:"100%",margin:t.spacing(2),padding:t.spacing(2)},children:[f.jsx(ie,{sx:{fontWeight:t.typography.fontWeightBold,fontSize:32,lineHeight:1.25,color:t.palette.text.primary},children:r?r(a):String(a)}),c!==void 0&&f.jsxs(ie,{variant:"body2",sx:{color:t.custom.grey[1400],mt:t.spacing(1),fontSize:16},children:[s," ",r?r(c):String(c)]})]})})},aN=e=>{const{chartType:t,onMouseEnter:n,tooltipPos:r,language:o,isLoading:i,height:s,maxScore:a,separator:c,...u}=e,d=(h,g)=>{n(h,g)},p=h=>{n({},h)};switch(t){case"donut":return f.jsx(jC,{...u,isLoading:i,height:s,tooltipPos:r,language:o,onMouseEnter:d});case"pie":return f.jsx(hSe,{...u,isLoading:i,height:s,tooltipPos:r,language:o,onMouseEnter:d});case"bar":return f.jsx(eSe,{...u,isLoading:i,height:s,onMouseEnter:p});case"line":return f.jsx(aSe,{...u,isLoading:i,height:s,onMouseEnter:p});case"radar":return f.jsx(wSe,{...u,isLoading:i,height:s,onMouseEnter:p});case"table":return f.jsx(SSe,{...u,isLoading:i,height:s,tooltipPos:r,onMouseEnter:d});case"raw":return f.jsx(MSe,{data:u.data,valuesFormatterFn:u.valuesFormatterFn,icons:u.icons,isLoading:i,onLegendAction:e.onLegendAction,maxScore:a,separator:c});default:return f.jsx(jC,{...u,isLoading:i,height:s,tooltipPos:r,language:o,onMouseEnter:d})}},Ja=e=>({default:{width:e.spacing(6.5),height:e.spacing(3.5),thumbWidth:e.spacing(2.5),thumbHeight:e.spacing(2.5),thumbBorderRadius:"50%",trackBorderRadius:e.spacing(4/2),trackBackgroundColor:"rgba(0,0,0,.25)",trackOpacity:1},medium:{width:e.spacing(5.5),height:e.spacing(3),thumbWidth:e.spacing(2),thumbHeight:e.spacing(2),thumbBorderRadius:"50%",trackBorderRadius:e.spacing(3.5/2),trackBackgroundColor:"rgba(0,0,0,.25)",trackOpacity:1},small:{width:e.spacing(4.5),height:e.spacing(2.5),thumbWidth:e.spacing(1.5),thumbHeight:e.spacing(1.5),thumbBorderRadius:"50%",trackBorderRadius:e.spacing(2.5/2),trackBackgroundColor:"rgba(0,0,0,.25)",trackOpacity:1}}),ESe=W(dT,{shouldForwardProp:e=>e!=="toggleSize"})(({theme:e,toggleSize:t="default"})=>{const n=t??"default";return{width:Ja(e)[n].width,height:Ja(e)[n].height,padding:0,display:"flex","&:active":{"& .MuiSwitch-thumb":{width:Ja(e)[n].thumbWidth},"& .MuiSwitch-switchBase.Mui-checked":{transform:e.spacing(1)}},"& .MuiSwitch-switchBase":{padding:e.spacing(.5),"&.Mui-checked":{transform:`translateX(${parseInt(Ja(e)[n].width)-parseInt(Ja(e)[n].thumbWidth)-parseInt(e.spacing(1))}px)`,color:"#fff","& + .MuiSwitch-track":{opacity:1,backgroundColor:e.palette.primary.main}}},"& .MuiSwitch-thumb":{boxShadow:"none",width:Ja(e)[n].thumbWidth,height:Ja(e)[n].thumbHeight,borderRadius:"50%",transition:e.transitions.create(["width"],{duration:200})},"& .MuiSwitch-track":{borderRadius:Ja(e)[n].trackBorderRadius,opacity:1,backgroundColor:"rgba(0,0,0,.25)",boxSizing:"border-box"}}}),lN=e=>{const t=ce(),{label:n,onChange:r,checked:o,toggleSize:i="default",...s}=e;return f.jsx(Al,{control:f.jsx(ESe,{value:o,sx:{m:t.spacing(1)},toggleSize:i,onChange:r,...s}),label:n})},TSe=2,OSe=0,kSe=2,PSe="900px",LSe=300,jSe=100,ISe=700,ASe="28px auto",RSe=4,DSe=2,cN="0.2s",Qu=1,uN=100,VSe=e=>{const t=ce(),{chartType:n,values:r,labels:o,colors:i,legend:s,children:a,valuesUnit:c,className:u,valuesFormatterFn:d=t.numbers.valueFormatterFn,createPalette:p=!0,isLoading:h=!1,displayTotal:g=!0,fullWidthLegend:m=!1,displayTotalVariant:v="number-big",spacing:C=TSe,borderWidth:y=OSe,borderColor:x,hoverOffset:w=kSe,icons:M,showTooltip:S=!0,width:E=PSe,height:T=LSe,maxScore:O,separator:P,aggregation:k}=e,{showAggregateToggle:L=!1,aggregateToggleLabel:j="",othersCategoryLabel:A="",othersThresholdPercent:R=1}=k??{},_=I.useRef(null),N=I.useRef(null),z=vn.language,B=fo(t.breakpoints.down("md")),$=pk(t,jSe,ISe),V=(s==null?void 0:s.position)??"bottom",H=s?{...s,mode:n==="raw"||O!==void 0?"raw":s.mode}:void 0,[X,Q]=I.useState(!1),ne=n!=="raw"&&n!=="table",{effValues:q,effLabels:J,keptIndices:te,hasOthers:Y}=I.useMemo(()=>{const Ce=Array.isArray(r)?r:[],Ze=Array.isArray(o)?o:[];if(!ne||!L||!X)return{effValues:Ce,effLabels:Ze,keptIndices:Ce.map((je,Ue)=>Ue),hasOthers:!1};const Ge=Ce.reduce((je,Ue)=>je+(Number.isFinite(Ue)?Number(Ue):0),0);if(Ge<=0)return{effValues:Ce,effLabels:Ze,keptIndices:Ce.map((je,Ue)=>Ue),hasOthers:!1};const me=Math.max(0,R)/100,ve=[],ye=[];if(Ce.forEach((je,Ue)=>{Math.abs(Number(je))/Ge<me?ve.push(Ue):ye.push(Ue)}),ve.length===0)return{effValues:Ce,effLabels:Ze,keptIndices:Ce.map((je,Ue)=>Ue),hasOthers:!1};const Ie=ve.reduce((je,Ue)=>je+(Number(Ce[Ue])||0),0),Re=[...ye.map(je=>Number(Ce[je])||0),Ie],Ee=[...ye.map(je=>Ze[je]??""),A];return{effValues:Re,effLabels:Ee,keptIndices:ye,hasOthers:!0}},[ne,L,X,r,o,R,A]),Z=i&&i.length?i:$;let F=[];if(p)F=hk(Z,q);else{const Ce=te.map(Ze=>Z[Ze%Z.length]);if(Y&&Z.length>0){const Ze=te.length%Z.length;F=[...Ce,Z[Ze]]}else F=Ce}if(p&&Y&&F.length===q.length&&Z.length>0){const Ce=te.length%Z.length;F[F.length-1]=Z[Ce]}const G=Ck(q,J,F),D=xk(r,g),ee=yk(a,g,D,d),{HoveredChartElementIndex:oe,tooltipPos:se,handleLegendHover:ue,handleMouseEnter:re,handleMouseOut:he}=wk(G,_),pe=n==="donut",be=!h&&S,Se=G.length===0&&!h;return f.jsxs(le,{direction:V==="bottom"||B?"column":"row",gap:V==="bottom"?t.spacing(DSe):t.spacing(RSe),className:`polymorphic-chart polymorphic-chart-${n} ${u}`,ref:N,sx:{maxWidth:E,width:"100%",minHeight:"100%"},children:[f.jsxs(le,{sx:n==="raw"?{minHeight:"100%"}:{flex:1},children:[f.jsxs(K,{position:"relative",margin:n==="raw"?0:ASe,sx:{"& *":{outline:"none"},".cell-hovered":{animation:`cell-hovered ${cN} ease-in-out forwards`,transformOrigin:"center"},".cell-idle":{transform:`scale(${Qu})`,transformOrigin:"center",animation:`cell-idle ${cN} ease-in-out forwards`},"@keyframes cell-hovered":{"0%":{transform:`scale(${Qu})`},"100%":{transform:`scale(${Qu+w/uN})`},"@keyframes cell-idle":{"0%":{transform:`scale(${Qu+w/uN})`},"100%":{transform:`scale(${Qu})`}}},height:n==="raw"?"100%":"inherit",width:"100%",pointerEvents:h?"none":"auto"},className:"polymorphic-chart-wrapper",id:"polymorphic-chart-wrapper",ref:_,children:[f.jsx(aN,{chartType:n,data:G,HoveredChartElementIndex:oe,spacing:C,borderWidth:y,borderColor:x,showTooltip:be,tooltipPos:se,valuesFormatterFn:d,language:z,valuesUnit:c,icons:M,isLoading:h,height:T,onMouseEnter:re,onMouseLeave:he,onLegendAction:Ce=>{var Ze,Ge,me;(Ze=s==null?void 0:s.actions)!=null&&Ze[Ce]&&((me=(Ge=s.actions)[Ce])==null||me.call(Ge))},maxScore:O,separator:P}),pe&&!h&&f.jsx(Sk,{isLoading:h,isEmpty:Se,displayValue:ee,displayTotalVariant:v,valuesUnit:c,displayTotal:g})]}),ne&&L&&!Se&&f.jsx(K,{sx:{display:"flex",justifyContent:"center",width:"100%",zIndex:2,transform:"translateY(0%)",pointerEvents:"auto"},children:h?f.jsxs(le,{direction:"row",alignItems:"center",justifyContent:"center",spacing:t.spacing(1.25),height:t.spacing(4.5),children:[f.jsx(Dl,{variant:"rounded",width:36,height:26,animation:"pulse"}),f.jsx(Dl,{width:150,height:24,animation:"pulse"})]}):f.jsx(lN,{label:j,checked:X,onChange:Ce=>Q(Ce.target.checked),toggleSize:"small"})})]}),f.jsx(K,{display:"flex",width:m?"100%":"inherit",sx:{width:m?"100%":"inherit",flex:1},children:H&&(()=>{const Ce=Array.from(J.keys()),Ze=ne&&X?Ce.filter(ye=>(J[ye]??"").trim().length>0):Ce,Ge=Ze.map(ye=>J[ye]??""),me=Ze.map(ye=>q[ye]??0),ve=Ze.map(ye=>F[ye]);return f.jsx(J9,{labels:Ge,hoveredDatasetIndex:oe,onLegendHover:ue,values:me,colors:ve,legend:H,isLoading:h,icons:M,chartRef:_,maxScore:O,separator:P,threshold:R,valuesFormatterFn:d})})()})]})},dN=e=>b.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},b.createElement("rect",{x:1,y:1,width:18,height:18,rx:3,fill:"white"}),b.createElement("rect",{x:1,y:1,width:18,height:18,rx:3,stroke:"#D1CFCE",strokeWidth:2})),fN=e=>b.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},b.createElement("rect",{width:20,height:20,rx:4,fill:"url(#paint0_linear_2034_7850)"}),b.createElement("path",{d:"M8.32244 13.9335L4.56689 10.178L5.36133 9.38351L8.32244 12.3446L14.628 6.03906L15.4224 6.83351L8.32244 13.9335Z",fill:"white"}),b.createElement("defs",null,b.createElement("linearGradient",{id:"paint0_linear_2034_7850",x1:7.58928,y1:755124e-13,x2:7.58928,y2:20,gradientUnits:"userSpaceOnUse"},b.createElement("stop",{stopColor:"#484945"}),b.createElement("stop",{offset:1,stopColor:"#2A2B27"})))),_Se=W(fs)(()=>({":hover":{background:Te[400]}})),NSe=e=>{const{values:t,...n}=e,{onChange:r,...o}=n,i=Object.entries(t);return f.jsx(D8,{children:i.map(([s,a],c)=>f.jsx(Al,{control:f.jsx(_Se,{...o,checkedIcon:f.jsx(fN,{}),icon:f.jsx(dN,{}),disableRipple:!0,onChange:(u,d)=>{const p={};p[s]={name:a.name,state:d},r(p)}}),sx:{gap:"1rem"},label:a.name,checked:a.state},`${s}-${c}`))})},HSe=(e,t,n)=>Object.entries(t).flatMap(o=>{const[i,s]=o;if(s.state===!1)return[];const a=Number(i),c=e.find(u=>u.id===a);return c?[c]:[n({id:a,name:s.name})]}),$Se=(e,t)=>{const n={};return e.reduce((o,i)=>{const s=t.some(a=>a.id===i.id);return o[i.id]={name:i.name,state:s},o},n)},FSe=W(fs)(()=>({":hover":{background:Te[400]}})),BSe=e=>{const{values:t,onChange:n,FormGroupProps:r,FormControlLabelProps:o,CheckboxProps:i}=e,s=Object.entries(t);return f.jsx(D8,{...r,children:s.map(([a,c],u)=>f.jsx(Al,{sx:{gap:"1rem"},checked:c.state,...o,label:c.name,control:f.jsx(FSe,{checkedIcon:f.jsx(fN,{}),icon:f.jsx(dN,{}),disableRipple:!0,...i,onChange:(d,p)=>{const h={...t};h[a]={...h[a],name:c.name,state:p},n(h)}})},`${a}-${u}`))})},pN=e=>{const{values:t,selectedItems:n,onChange:r,getId:o=u=>u.id,getName:i=u=>u.name,...s}=e,a=(n==null?void 0:n.map(u=>o(u)))??[],c=t.reduce((u,d)=>{const p=o(d),h=a.includes(p),g=n===void 0?!1:h;return u[p]={name:i(d),state:g,rawData:d},u},{});return f.jsx(BSe,{values:c,onChange:u=>{const d=Object.values(u).flatMap(p=>p.state===!1?[]:p.rawData);return r(d)},...s})},zSe=W(K)(({theme:e})=>({display:"flex",flexDirection:"column",border:`1px solid ${Te[500]}`,background:e.palette.background.paper,borderRadius:e.spacing(2),overflow:"hidden",boxShadow:e.custom.shadows.grey,[e.breakpoints.up("md")]:{flexDirection:"row-reverse",justifyContent:"space-between"}})),ZSe=W(K)(({theme:e})=>({padding:e.spacing(4),display:"flex",flexDirection:"column",justifyContent:"space-between",[e.breakpoints.up("md")]:{padding:e.spacing(6)}})),WSe=W(K)({display:"flex",flexDirection:"column"}),USe=W(K)(({theme:e})=>({margin:e.spacing(2,0,2,0)})),qSe=W(K)(({theme:e})=>({alignSelf:"flex-end",[e.breakpoints.up("md")]:{alignSelf:"flex-start"}})),GSe=W(K)(({theme:e})=>({width:"100%",height:e.spacing(30),[e.breakpoints.up("md")]:{maxWidth:"500px",height:"auto"}})),KSe=W("img")({width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}),YSe=e=>{const{title:t,subtitle:n,description:r,imageUrl:o,callToAction:i,sxProps:s={}}=e,a=ce();return f.jsxs(zSe,{sx:s,children:[o&&f.jsx(GSe,{children:f.jsx(KSe,{src:o,alt:"hero image"})}),f.jsxs(ZSe,{children:[f.jsxs(WSe,{children:[f.jsx(F1,{defaultVariant:"h2",text:t}),n&&f.jsx(F1,{defaultVariant:"h5",text:n,typographyProps:{color:a.custom.grey[2e3],padding:a.spacing(.5,0,.5,0)}}),r&&f.jsx(USe,{children:r})]}),i&&f.jsx(qSe,{children:f.jsx(B1,{buttonOptions:i,defaultOptions:{sx:{display:"inline-flex",padding:a.spacing(3),letterSpacing:a.spacing(.02),fontWeight:a.typography["body-bold"].fontWeight},variant:"primary",endIcon:f.jsx(Ct,{size:2,icon:"arrowRight"})}})})]})]})},XSe=W(K)(()=>({position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0)",zIndex:1e3,transition:"background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1)",visibility:"hidden","&.open":{backgroundColor:"rgba(0, 0, 0, 0.5)",visibility:"visible"}})),JSe=W(K)(({theme:e})=>({position:"fixed",top:0,right:0,bottom:0,width:"75%",backgroundColor:e.palette.background.paper,zIndex:1001,overflowY:"auto",transform:"translateX(100%)",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",opacity:0,borderRadius:`${e.spacing(1)} 0 0 ${e.spacing(1)}`,"&.open":{transform:"translateX(0)",opacity:1,visibility:"visible",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},[e.breakpoints.down("md")]:{width:"100%"}})),hN=W(K)({width:"100%",height:"400px",backgroundColor:"#f0f0f0","& img":{width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease-in-out"}}),QSe=W(zt)(({theme:e})=>({position:"fixed",top:e.spacing(2),right:e.spacing(2.5),zIndex:1002,backgroundColor:"white",visibility:"hidden",transform:"translateX(200%)",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.8)"},"&.open":{transform:"translateX(0)",opacity:1,visibility:"visible",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"}})),eMe=W(le)({padding:"2rem 4rem"}),tMe=({isOpen:e,onClose:t,article:n})=>(I.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[e]),f.jsxs(f.Fragment,{children:[f.jsx(XSe,{className:e?"open":"",onClick:t}),f.jsx(QSe,{className:e?"open":"",onClick:t,children:f.jsx(Ct,{size:2,icon:"close"})}),f.jsxs(JSe,{className:e?"open":"",children:[f.jsx(I.Suspense,{fallback:f.jsx(hN,{}),children:f.jsx(hN,{children:f.jsx("img",{src:n.imageSrc,alt:n.title,loading:"lazy",onLoad:r=>{r.target.style.opacity="1"},style:{opacity:0}})})}),f.jsxs(eMe,{spacing:3,children:[f.jsx(ie,{variant:"h2",children:n.title}),f.jsx(ie,{variant:"body1",dangerouslySetInnerHTML:{__html:n.content}})]})]})]})),nMe=[3,5,9,3],rMe=W(le,{shouldForwardProp:e=>e!=="isRightColumn"})(({isRightColumn:e,theme:t})=>({border:`1px solid ${Te[500]}`,borderRadius:t.spacing(1),overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",flexDirection:e?"row":"column",[t.breakpoints.down("md")]:{flexDirection:"column"},boxShadow:t.custom.shadows.grey})),oMe=W(K,{shouldForwardProp:e=>e!=="isRightColumn"})(({isRightColumn:e,theme:t})=>({flex:e?"0 0 35%":"1 1 auto",lineHeight:0,position:"relative",width:"100%",height:e?"100%":"380px",backgroundColor:t.palette.grey[400],overflow:"hidden","& img":{width:"100%",height:"100%",objectFit:"cover",objectPosition:"center",display:"block",[t.breakpoints.down("md")]:{height:"200px"}},[t.breakpoints.down("md")]:{height:"140px"},[t.breakpoints.down("md")]:{flex:2}})),iMe=W(le)(({theme:e})=>({flex:"1 1 0",backgroundColor:e.palette.background.paper,padding:e.spacing(3,3,2,3),justifyContent:"space-between",gap:e.spacing(1),[e.breakpoints.down("md")]:{padding:e.spacing(2,2,1.5,2)},[e.breakpoints.down("md")]:{flex:"1 1 0"}})),sMe=W(d6)({display:"block",width:"100%",height:"100%",cursor:"pointer"}),aMe=W(it)(({theme:e})=>({display:"inline-flex",alignSelf:"flex-start",fontWeight:700,gap:e.spacing(1)})),lMe=W(ie,{shouldForwardProp:e=>e!=="isFirst"})(({isFirst:e,articlesNumber:t,theme:n})=>({display:"-webkit-box",WebkitLineClamp:e?5:nMe[t-1]||3,marginTop:n.spacing(2),WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",[n.breakpoints.down("md")]:{WebkitLineClamp:e?3:2,marginTop:n.spacing(1)}})),zC=e=>{const[t,n]=I.useState(!1),{title:r,description:o,imageSrc:i,content:s,onClick:a,isFirst:c=!1,articlesNumber:u=1,isRightColumn:d=!1,readMoreText:p="Lire l'article"}=e,h=()=>{a?a():n(!0)};return f.jsxs(f.Fragment,{children:[f.jsxs(rMe,{isRightColumn:d,children:[f.jsx(oMe,{isRightColumn:d,children:f.jsx(sMe,{onClick:h,children:f.jsx("img",{src:i,alt:r})})}),f.jsxs(iMe,{children:[f.jsxs(K,{children:[f.jsx(ie,{variant:"h3",mb:"0.2rem",children:r}),f.jsx(lMe,{variant:"body",mb:"1rem",isFirst:c,articlesNumber:u,dangerouslySetInnerHTML:{__html:o}})]}),f.jsxs(aMe,{variant:"text",onClick:h,children:[f.jsx(ie,{fontWeight:700,fontSize:"0.875rem",children:p}),f.jsx(Ct,{size:2,icon:"arrowRight"})]})]})]}),!a&&f.jsx(tMe,{isOpen:t,onClose:()=>n(!1),article:{title:r,description:o,imageSrc:i,content:s||o}})]})},cMe=e=>{const{articles:t=[],sxProps:n={}}=e,[r,...o]=t;return f.jsxs(Vo,{container:!0,columns:o.length>0?2:1,sx:{...n,height:"100%","& .MuiGrid-item":{"@media (max-width: 1068px)":{width:"100%",maxWidth:"100%",flexBasis:"100%"}}},spacing:4,children:[f.jsx(Vo,{item:!0,xs:1,children:f.jsx(zC,{...r,isFirst:!0,articlesNumber:t.length})}),f.jsx(Vo,{item:!0,xs:1,children:f.jsx(_7,{gap:3,display:"flex",flexDirection:"column",justifyContent:"space-between",height:"100%",sx:{"@media (max-width: 1068px)":{gap:2,marginTop:0}},children:o.map((i,s)=>f.jsx(_7,{height:"100%",children:f.jsx(zC,{...i,isRightColumn:t.length>=3,articlesNumber:t.length})},`article-${s}`))})})]})},uMe=e=>{const{title:t,children:n,objectives:r=[],tooltipMessage:o}=e,i=ce();return f.jsxs(le,{sx:{borderRadius:"12px",border:`1px solid ${i.palette.grey[500]}`,padding:"34px",maxWidth:"360px",background:i.palette.background.paper},children:[f.jsxs(K,{display:"flex",children:[f.jsx(ie,{variant:"h3",component:"h3",mb:"1.5rem",children:t}),o&&f.jsx(Ct,{size:3,icon:"information"})]}),f.jsx(K,{fontWeight:700,display:"flex",gap:"0.5rem",mb:"1rem",children:n}),f.jsx(le,{sx:{"> div:not(:last-of-type)":{mb:"1rem"}},children:r.map((s,a)=>f.jsxs(le,{flexDirection:"row",alignItems:"center",gap:".5rem",children:[f.jsx(ie,{variant:"small-medium",children:s.objective}),f.jsx(IT,{boxProps:{sx:{padding:"0.1rem 0.5rem"}},children:s.component})]},a))})]})},dMe=e=>{const{title:t,subtitle:n,description:r}=e,o=ce();return f.jsxs(le,{sx:{borderRadius:"12px",border:`1px solid ${o.palette.grey[500]}`,padding:"34px",maxWidth:"360px",background:o.palette.background.paper},children:[f.jsxs(le,{flexDirection:"row",alignContent:"center",justifyContent:"space-between",children:[f.jsx(ie,{variant:"h3",component:"h3",mb:"1.5rem",children:t}),n&&f.jsx(fMe,{text:n})]}),f.jsx(le,{children:f.jsx(ie,{variant:"body-medium",children:f.jsx(K,{dangerouslySetInnerHTML:{__html:r}})})})]})};function fMe(e){const{text:t}=e;return f.jsx(di,{sx:{textAlign:"center"},arrow:!1,title:f.jsx(ie,{variant:"body-medium",children:t}),placement:"top",children:f.jsx(K,{children:f.jsx(Ct,{size:3,icon:"information"})})})}const pMe=e=>{const{value:t,maxLength:n,...r}=e,o=t.map((d,p)=>t.slice(0,p+1).reduce((h,g)=>{const m=h.length+g.length;if(m>n){const v=n-m,C=[...h.words,g.slice(0,v)].filter(Boolean);return{length:m,words:C,rest:t.length-C.length}}return{...h,length:m,words:[...h.words,g]}},{length:0,words:[],rest:0})),i=o[o.length-1],a=t[t.length-1].length===i.words[i.words.length-1].length?"":"…",c=i.words.join(", "),u=i.rest>0?`${c}… +${i.rest}`:c+a;return f.jsx(ie,{...r,children:u})},hMe=e=>{const{value:t,maxLength:n,separator:r=",",...o}=e;if(n===0)return f.jsx(ie,{...o,children:""});const i=t.join("").length;if(n>i)return f.jsx(ie,{...o,children:t.join(r)});let s=0;const a=t.reduce((y,x)=>{const w=s+x.length,M={low:s,high:w};return s=w,y.push(M),y},[]),c=a.findIndex(y=>y.low<n&&n<=y.high),u=c+1,d=a.length-u,h=a[c].high===n?"":"…",g=u*r.length,m=t.join(r).slice(0,n-1+g),v=d?`+${d}`:"",C=`${m}${h} ${v}`;return f.jsx(ie,{...o,children:C})},gMe=e=>{const{setOpen:t,options:n,onValidate:r,onCancel:o,canValidate:i=!0,confirmAction:s,cancelText:a,validateText:c,...u}=e,[d,p]=I.useState(!1),h=()=>t(!1),g=()=>{p(!1)},m=()=>{o&&o(),h()},v=()=>{if(!s){r&&r(),h();return}d?(p(!1),r&&r(),h()):p(!0)};return f.jsxs(C0,{onClose:m,...u,fullWidth:!0,maxWidth:"md",scroll:"body",children:[f.jsxs(m1,{sx:mN,children:[n.title,f.jsx(it,{variant:"text",endIcon:f.jsx(j6,{}),onClick:m})]}),f.jsx(K,{sx:{width:"100%"},children:n.content}),f.jsx(gN,{onCancelAction:m,onConfirmAction:v,canValidate:i,cancelText:a,validateText:c}),s&&f.jsx(mMe,{openConfirmAction:d,onCancel:g,onValidate:v,confirmAction:s,cancelText:a,validateText:c})]})},mMe=e=>{const{confirmAction:t,onCancel:n,onValidate:r,openConfirmAction:o,cancelText:i,validateText:s}=e;return f.jsxs(C0,{open:o,onClose:n,sx:{display:"flex",justifyContent:"space-between",alignItems:"center",borderBottom:`1px solid ${Te[500]}`,minHeight:"68px",padding:"28px 27px 28px 32px"},children:[f.jsxs(m1,{sx:mN,children:[t.title,f.jsx(it,{variant:"text",endIcon:f.jsx(j6,{}),onClick:n})]}),f.jsx(K,{sx:{padding:"32px",width:"100%"},children:t.content}),f.jsx(gN,{onCancelAction:n,onConfirmAction:r,cancelText:t.cancelText??i,validateText:t.validateText??s})]})},gN=e=>{const{onCancelAction:t,onConfirmAction:n,canValidate:r=!0,cancelText:o,validateText:i}=e;return f.jsxs(s6,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",borderTop:`1px solid ${Te[500]}`,minHeight:"68px",paddingInline:"1rem",padding:"28px 32px 32px 32px"},children:[f.jsx(it,{variant:"text",onClick:t,children:o}),f.jsx(it,{variant:"primary",onClick:n,disabled:!r,children:i})]})},mN={display:"flex",justifyContent:"space-between",alignItems:"center",borderBottom:`1px solid ${Te[500]}`,minHeight:"68px",padding:"28px 27px 28px 32px"},vMe=W(g0)(({theme:e})=>({fontFamily:e.typography.fontFamily,...e.typography.body})),nc=I.forwardRef(function(e,t){const n=ce(),{sx:r,error:o,...i}=e;return f.jsx(vMe,{...i,sx:{color:o?n.custom.red[600]:n.custom.grey[2800],border:o?`1px solid ${n.custom.red[600]}`:`1px solid ${n.custom.grey[1400]}`,backgroundColor:o?n.custom.red[100]:"inherit",borderRadius:"16px",paddingInline:"20px",...r}})}),CMe=e=>{const{title:t,unit:n,placeholder:r,value:o,description:i,error:s,required:a,...c}=e,u=a?"*":"",d=ce(),p=I.useRef(!1),h=p.current&&s,[g,m]=I.useState(!1),[v,C]=I.useState(!1),[y,x]=I.useState(!1);I.useEffect(()=>{const T=w(M,e.setMinMaxError);m(T);const O=w(S,e.setMinError);C(O);const P=w(E,e.setMaxError);x(P)},[o]);const w=(T,O)=>{const P=T();return O!==void 0&&O(P),P},M=()=>{if(e.min===void 0&&e.max===void 0||o===void 0||o==="")return!1;const T=Number(o);return!(e.min!==void 0&&T>e.min&&e.max!==void 0&&T<e.max)},S=()=>e.min===void 0||o===void 0||o===""?!1:!(e.min<Number(o)&&e.max===void 0),E=()=>e.max===void 0||o===void 0||o===""?!1:!(e.max>Number(o)&&e.min===void 0);return f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[f.jsx(ie,{variant:"h5",children:`${t}${u} :`}),f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[f.jsx(nc,{...c,type:"number",style:{minWidth:"150px",width:"10%",borderColor:h?d.palette.error.main:"inherit",backgroundColor:h?d.palette.error.light:"inherit"},placeholder:r,value:o,onChange:T=>{p.current=!0,c.onChange&&c.onChange(T)}}),f.jsx(ie,{variant:"body",children:n})]}),(!!e.minMaxErrorMessage&&g||!!e.minErrorMessage&&v||!!e.maxErrorMessage&&y)&&f.jsxs(ie,{variant:"body",style:{color:d.custom.red[600]},children:[!!e.minMaxErrorMessage&&g&&e.minMaxErrorMessage,!!e.minErrorMessage&&v&&e.minErrorMessage,!!e.maxErrorMessage&&y&&e.maxErrorMessage]}),f.jsx(ie,{variant:"body",children:i})]})},bMe=e=>{const{icon:t,label:n,variant:r,onDelete:o,ChipProps:i}=e,s=ce(),a=r==="brand"?s.palette.primary[100]:s.custom.grey[600];return f.jsx(Fs,{icon:t===void 0?void 0:f.jsx(Ct,{size:1,icon:t}),variant:r,label:n,onDelete:o,deleteIcon:f.jsx(M9,{buttonProps:{onClick:o,sx:{":hover":{backgroundColor:a}}},icon:"close",size:"xs"}),...i})},yMe=e=>{const{unit:t,sx:n,...r}=e;return f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[f.jsx(nc,{type:"number",sx:{minWidth:"125px",width:"10%",...n},...r}),f.jsx(ie,{variant:"body",children:t})]})};function xMe(e){const t=ce(),n={height:"40px",padding:"0px 6px 0px 20px",...t.custom.searchBox,minWidth:"350px"},r={height:"20px",padding:"0px",width:"100%","&>.MuiInputBase-root>fieldset":{border:"none"},"&>.MuiInputBase-root>input":{padding:"0"}},o={height:"48px",padding:"0px 16px 0px 24px",borderTop:"1px solid "+t.custom.grey[500],borderBottom:"1px solid "+t.custom.grey[500],background:t.custom.grey[200]},i={"&>.MuiInputBase-root>fieldset":{border:"none"},"&>.MuiInputBase-root>input":{width:"100%",height:"48px",padding:"0",border:"none"}};return f.jsxs(le,{direction:"row",useFlexGap:!0,gap:"10px",justifyContent:"space-between",alignItems:"center",sx:e.variant==="standalone"?n:o,children:[f.jsx(_i,{label:"",type:"search",placeholder:e.placeholder,value:e.value,onChange:s=>{e.onChange(s.target.value)},sx:e.variant==="standalone"?r:i}),f.jsx(zse,{})]})}const wMe=I.forwardRef(function(t,n){const{title:r,placeholder:o,value:i,description:s,sx:a,error:c,required:u,...d}=t,p=u?"*":"",h=ce(),g=I.useRef(!1),m=g.current&&c;return f.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[f.jsx(ie,{variant:"h5",children:`${r}${p} :`}),f.jsx(nc,{...d,sx:{width:"70%",borderColor:m?h.custom.red[600]:"inherit",backgroundColor:m?h.custom.red[100]:"inherit",...a},placeholder:o,value:i,onChange:v=>{g.current=!0,d.onChange&&d.onChange(v)}}),f.jsx(ie,{variant:"body",children:s})]})});function SMe(e){return f.jsxs("div",{children:[f.jsx(ie,{variant:"body-bold",sx:{marginBottom:"16px"},children:e.header}),f.jsxs(le,{direction:"column",useFlexGap:!0,gap:"12px",children:[f.jsxs(le,{direction:"row",sx:{height:"20px"},useFlexGap:!0,gap:"12px",justifyContent:"flex-start",children:[f.jsx(fs,{checked:!0,sx:{width:"20px",height:"20px"}}),f.jsx(ie,{variant:"body",children:e.allText})]}),e.values.map((t,n)=>f.jsxs(le,{direction:"row",sx:{height:"20px"},useFlexGap:!0,gap:"12px",justifyContent:"flex-start",children:[f.jsx(fs,{checked:!1,sx:{width:"20px",height:"20px"}}),f.jsx(ie,{variant:"body",children:t})]},n))]})]})}function MMe(e){return f.jsxs(le,{direction:"column",useFlexGap:!0,gap:"12px",alignItems:"flex-start",children:[f.jsx(ie,{variant:"body-bold",children:e.header}),f.jsx(le,{direction:"row",useFlexGap:!0,gap:"8px",flexWrap:"wrap",children:e.values.map((t,n)=>f.jsxs(le,{direction:"row",useFlexGap:!0,gap:"4px",sx:{height:"28px",borderRadius:"4px",background:"#EFEDEC",paddingLeft:"8px"},alignItems:"center",children:[f.jsx(ie,{variant:"body",children:t}),f.jsx(zt,{sx:{width:"20px",height:"20px"},children:f.jsx(L6,{sx:{width:"16px",height:"16px"}})})]},n))}),f.jsx(it,{variant:"text",startIcon:f.jsx(Gie,{}),children:e.addText})]})}const vN=e=>{const t=ce(),{steps:n,currentStep:r=0,icons:o=[],clickable:i=!1,onClick:s}=e;return f.jsxs(K,{display:"inline-flex",position:"relative",children:[f.jsx(le,{direction:"row",gap:"12px",position:"relative",sx:{zIndex:1},children:[...Array(n??o.length).keys()].map(a=>{const c=a<=r;return f.jsx(O6,{size:"medium",border:`1px solid ${t.custom.grey[500]}`,color:c?"#FFF":t.custom.grey[2800],bgcolor:c?t.custom.grey[2800]:"#FFF",sx:{fill:c?"#FFF":t.custom.grey[2800],cursor:i?"pointer":"default","&:hover":i?{fill:"#FFF",color:"#FFF",bgcolor:t.custom.grey[c?2800:2e3]}:{}},onClick:()=>{i&&s&&s(a)},children:o&&o[a]?o[a]:a+1},a)})}),f.jsx(wr,{sx:{backgroundColor:t.custom.grey[500],position:"absolute",inset:`${36/2}px`}})]})},EMe=e=>b.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},b.createElement("path",{d:"M11.021 7.69411H0.333496V6.30524H11.021L6.021 1.30522L7.00016 0.333008L13.6668 6.99967L7.00016 13.6663L6.021 12.6941L11.021 7.69411Z",fill:"white"})),TMe=e=>b.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},b.createElement("path",{d:"M2.97919 7.69411L7.97921 12.6941L7.00004 13.6663L0.333374 6.99967L7.00004 0.333008L7.97921 1.30522L2.97919 6.30524H13.6667V7.69411H2.97919Z",fill:"#B06803"})),CN=e=>{var t;return f.jsxs(le,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{minHeight:"96px",zIndex:1e3,position:"sticky",top:"28px",border:"1px solid #E7E6E4",borderRadius:"52px",backgroundColor:"#FFFFFF",padding:"20px 28px"},children:[f.jsx(OMe,{title:e.title,subtitle:e.subtitle}),f.jsx(vN,{icons:e.icons,steps:e.steps??((t=e.icons)==null?void 0:t.length)??0,currentStep:e.currentPage,clickable:e.navigable,onClick:e.onNavigate}),f.jsx(PMe,{onPageForward:e.onPageForward,onPageBack:e.onPageBack,nextPageText:e.nextPageText,previousPageText:e.previousPageText,currentPage:e.currentPage,validateSteps:e.validateSteps,validateStepsTexts:e.validateStepsTexts,warningText:e.warningText,savingState:e.savingState,closeable:e.closeable,onClose:e.onClose})]})},OMe=e=>{const t=ce();return f.jsx(le,{direction:"row",alignItems:"center",justifyContent:"start",marginX:"20px",maxWidth:"33%",children:f.jsxs(le,{gap:"4px",children:[f.jsx(ie,{variant:"h3",children:e.title}),e.subtitle&&f.jsx(ie,{variant:"body",color:t.custom.grey[2e3],children:e.subtitle})]})})},kMe=e=>{const t=ce(),n=e.saving?ZT:$T,r=e.saving?{animation:"spin 1s linear infinite","@keyframes spin":{"0%":{transform:"rotate(360deg)"},"100%":{transform:"rotate(0deg)"}}}:{},o=f.jsx(n,{sx:{width:"24px",color:t.custom.grey[2e3],...r}}),i=f.jsx(K,{padding:"12px 16px",textAlign:"center",children:f.jsx(ie,{variant:"body",children:e.saving?e.savingMessage:e.savedMessage})});return f.jsx(z1,{icon:o,body:i,size:"260px"})},PMe=e=>{const t=ce(),n=f.jsx(it,{variant:"primary",disabled:e.validateSteps&&!e.validateSteps[e.currentPage],endIcon:f.jsx(EMe,{}),onClick:e.onPageForward,children:e.nextPageText}),r=f.jsxs(K,{padding:"12px 16px",children:[f.jsx(ie,{variant:"body-bold",children:e.warningText||""}),f.jsx("br",{}),f.jsx(ie,{variant:"body",children:e.validateStepsTexts&&e.validateStepsTexts[e.currentPage]||""})]});return f.jsxs(le,{direction:"row",alignItems:"center",justifyContent:"end",gap:"28px",children:[f.jsx(K,{sx:{">*":{display:"flex"}},children:e.savingState&&f.jsx(kMe,{...e.savingState})}),f.jsxs(le,{direction:"row",gap:"20px",children:[e.previousPageText&&f.jsx(it,{variant:"text",startIcon:f.jsx(TMe,{}),onClick:e.onPageBack,children:e.previousPageText}),e.validateSteps&&!e.validateSteps[e.currentPage]?e.nextPageText&&f.jsx(z1,{icon:n,body:r,size:"260px"}):e.nextPageText&&n]}),e.closeable&&f.jsx(it,{variant:"white-filled",onClick:e.onClose,sx:{minWidth:0,aspectRatio:1,borderRadius:"100%",padding:0,"&:hover":{background:t.custom.grey[400]},"&:active":{background:t.custom.grey[600]}},children:f.jsx(p9,{sx:{width:"20px",color:t.custom.grey[2800]}})})]})},ZC=e=>{const t=ce(),{title:n,titleSize:r,badge:o}=e,s=r||"h1";return f.jsxs(le,{direction:"row",alignItems:"center",gap:"16px",children:[typeof o=="number"?f.jsx(O6,{size:"big",children:o}):f.jsx(le,{width:"40px",alignItems:"center",color:t.custom.grey[2800],children:f.jsx(le,{sx:{transform:"scale(250%)"},children:o})}),f.jsx(ie,{variant:s,children:n})]})},LMe=e=>{const{title:t,subtitle:n,pages:r,pageIndexToDisplay:o=0,savingState:i,closeable:s=!0}=e,a=r.map(d=>d.icon),c=r[o],u=(Array.isArray(c.content)?c.content:[c.content]).map((d,p)=>f.jsx(I.Fragment,{children:d},p));return f.jsxs(f.Fragment,{children:[f.jsx(CN,{title:t,subtitle:n,icons:a,steps:r.length,currentPage:o,nextPageText:e.nextPageText,previousPageText:e.previousPageText,onPageForward:e.onPageForward,onPageBack:e.onPageBack,validateSteps:e.validateSteps,validateStepsTexts:e.validateStepsTexts,warningText:e.warningText,savingState:i,navigable:e.navigable,onNavigate:e.onNavigate,closeable:s,onClose:e.onClose}),f.jsx(le,{direction:"column",alignItems:"center",children:f.jsxs("div",{style:{maxWidth:"1024px"},children:[f.jsxs(le,{direction:"column",marginTop:"44px",marginBottom:"36px",gap:"2rem",children:[c.title&&f.jsx(ZC,{title:c.title,badge:c.icon??o+1}),c.subTitle&&f.jsx(ie,{variant:"h4",children:c.subTitle}),c.subTitle&&f.jsx(wr,{}),c.info]}),c.usesBaseLayout===!1?f.jsx(f.Fragment,{children:u}):f.jsx(jMe,{children:u})]})})]})},jMe=e=>{const{children:t}=e,n=Array.isArray(t)?t:[t];return f.jsx("div",{children:n.map((r,o)=>f.jsx(I.Fragment,{children:r},o))})},IMe=({sx:e={},...t})=>f.jsx(K,{sx:{boxShadow:"0px 2px 8px 0px #2A2B270A",border:`1px solid ${Te[500]}`,borderRadius:"16px",backgroundColor:"#FFFFFF",padding:"2rem",height:"fit-content",...e},...t}),AMe=e=>{const{title:t,hint:n,indicator:r,children:o,...i}=e,s=ce();return f.jsx(go,{width:"100%",padding:s.spacing(4),...i,children:f.jsxs(le,{gap:s.spacing(3),children:[f.jsxs(le,{direction:"row",alignItems:"start",gap:"32px",children:[f.jsx(ie,{variant:"h4",flex:1,children:t}),r&&f.jsx(P6,{value:r.value,unit:r.unit,sx:{top:"-12px",right:"-12px"}})]}),f.jsxs(le,{gap:"24px",children:[n&&f.jsx(XT,{variant:"themed",children:n}),o]})]})})},RMe=()=>{const[e,t]=I.useState({isLocked:!1}),n=d=>{t({isLocked:!0,message:d})},r=()=>{t({isLocked:!1})},[o,i]=I.useState({isLocked:!1}),s=d=>{i({isLocked:!0,message:d})},a=()=>{i({isLocked:!1})};return{forwardLock:e,lockForward:n,unlockForward:r,previousLock:o,lockPrevious:s,unlockPrevious:a,lockAll:d=>{n(d),s(d)},unlockAll:()=>{r(),a()}}},bN=I.createContext(null),yN=e=>{const{children:t,startingPage:n=0,...r}=e,[o,i]=I.useState(!1),[s,a]=I.useState(!1),[c,u]=I.useState(n),d=e.pages.length,p=e.pages[c]??null,h=RMe(),[g,m]=I.useState(!1),v={...r,...h,isSaving:o,setSaving:i,selectedPage:p,selectedPageIndex:c,setPage:u,maxPage:d,formSaved:g,setFormSaved:m,isError:s,setError:a};return f.jsx(bN.Provider,{value:v,children:t})},h2=()=>{const e=I.useContext(bN);if(e)return e;throw new Error("useFormBaseContext must be used within an FormBaseContextProvider")},xN=()=>{const{selectedPageIndex:e,setPage:t,onPageChange:n,pages:r,previousLock:o,forwardLock:i,maxPage:s,setFormSaved:a,isLoading:c}=h2(),u=ce(),d=fo(u.breakpoints.down("md")),p={selected:{color:"#FFF",background:u.custom.grey[2800],hover:{color:"#FFF",background:u.custom.grey[2800]}},locked:{color:u.custom.grey[500],background:"#FFF",hover:{color:u.custom.grey[500],background:"#FFF"}},default:{color:u.custom.grey[2800],background:"#FFF",hover:{color:"#FFF",background:u.custom.grey[2e3]}}};return c?f.jsx(Ta,{}):f.jsxs(K,{display:"inline-flex",position:"relative",children:[f.jsx(le,{direction:"row",gap:"12px",position:"relative",flexWrap:"wrap",sx:{zIndex:1,backgroundColor:d?"white":"transparent"},children:[...Array(s)].map((h,g)=>{var M,S;const m=o.isLocked&&g<e,v=i.isLocked&&g>e,C=m||v,x=g===e?p.selected:p[C?"locked":"default"],w=((M=r[g])==null?void 0:M.icon)??g+1;return f.jsx(O6,{size:"medium",border:`1px solid ${u.custom.grey[500]}`,color:x.color,bgcolor:x.background,tooltip:(S=r[g])==null?void 0:S.title,sx:{fill:x.color,cursor:C?"default":"pointer","&:hover":{fill:x.hover.color,color:x.hover.color,bgcolor:x.hover.background}},onClick:()=>{g===e||C||(a(!1),t(g),n==null||n(g,e))},children:w},`page-top-display-${g}`)})}),f.jsx(wr,{sx:{backgroundColor:u.custom.grey[500],position:"absolute",inset:`${36/2}px`}})]})},wN=()=>{const{textOptions:e,isLoading:t}=h2(),n=ce(),r=fo(n.breakpoints.down("md"));return f.jsx(le,{direction:"row",alignItems:"center",justifyContent:r?"center":"start",marginX:r?"0":"20px",maxWidth:r?"100%":"33%",width:r?"100%":"auto",children:f.jsxs(le,{gap:"4px",alignItems:r?"center":"flex-start",children:[f.jsx(ie,{variant:"h3",textAlign:r?"center":"left",sx:{fontSize:r?"1.3rem":"1.5rem"},children:t?f.jsx(Ta,{size:"18px"}):e.title}),e.subtitle&&f.jsx(ie,{variant:"body",color:n.custom.grey[2e3],textAlign:r?"center":"left",children:e.subtitle})]})})},DMe=()=>{const e=ce(),{isSaving:t,textOptions:n,isError:r}=h2(),o=t?ZT:r?Yse:$T,i=t?{animation:"spin 1s linear infinite","@keyframes spin":{"0%":{transform:"rotate(360deg)"},"100%":{transform:"rotate(0deg)"}}}:{},s=f.jsx(o,{sx:{width:"24px",color:r?e.custom.red[600]:e.custom.grey[2e3],...i}}),a=f.jsx(K,{padding:"12px 16px",textAlign:"center",children:f.jsx(ie,{variant:"body-medium",children:t?n.syncingMessage:r?n.errorDefaultMessage:n.savingDefaultMessage})});return f.jsx(z1,{icon:s,body:a,size:"260px"})},SN=()=>{const{confirmExit:e,selectedPageIndex:t,setPage:n,maxPage:r,forwardLock:o,previousLock:i,textOptions:s,onClose:a,onValidate:c,onPageChange:u,showSync:d,setFormSaved:p,openConfirmDialog:h,isLoading:g,selectedPageIndex:m}=h2(),v=ce(),C=fo(v.breakpoints.down("md")),x=t===r-1&&s.finalPage?s.finalPage:s.nextPage,w=f.jsx(it,{variant:"primary",disabled:o.isLocked||g,endIcon:f.jsx(Ct,{icon:"arrowTrajectory",size:2}),onClick:()=>{if(t===r-1){p(!0),c==null||c();return}return p(!1),u==null||u(t+1,t),n(t+1)},sx:C?{minWidth:"80px",fontSize:"0.875rem",padding:"8px 12px"}:{},children:x}),M=f.jsxs(K,{padding:"12px 16px",children:[f.jsx(ie,{variant:"body-bold",children:s.warningText?s.warningText:""}),f.jsx("br",{}),f.jsx(ie,{variant:"body",children:o.isLocked&&o.message||""})]});return C?f.jsx(le,{direction:"row",alignItems:"center",gap:"16px",children:f.jsx(le,{direction:"row",gap:"16px",alignItems:"center",justifyContent:"flex-end",width:"100%",children:a&&f.jsx(it,{variant:"white-filled",onClick:e?h:a,sx:{minWidth:0,aspectRatio:1,borderRadius:"100%",padding:0,width:"40px",height:"40px","&:hover":{background:v.custom.grey[400]},"&:active":{background:v.custom.grey[600]}},children:f.jsx(p9,{sx:{width:"20px",color:v.custom.grey[2800]}})})})}):f.jsxs(le,{direction:"row",alignItems:"center",justifyContent:"end",gap:"28px",children:[f.jsx(K,{sx:{">*":{display:"flex"}},children:d&&f.jsx(DMe,{})}),f.jsxs(le,{direction:"row",gap:"20px",children:[s.previousPage&&f.jsx(it,{sx:{minWidth:"90px"},variant:"text",disabled:m===0||i.isLocked||g,startIcon:m===0||i.isLocked||g?null:f.jsx(Ct,{icon:"arrowLeft",size:2}),onClick:()=>{if(p(!1),t===0){u==null||u(t,t);return}return u==null||u(t-1,t),n(t-1)},children:s.previousPage}),o.isLocked?x&&f.jsx(z1,{icon:w,body:M,size:"260px",leftPosition:130}):x&&w]}),a&&f.jsx(it,{variant:"white-filled",onClick:e?h:a,sx:{minWidth:0,aspectRatio:1,borderRadius:"100%",padding:0,"&:hover":{background:v.custom.grey[400]},"&:active":{background:v.custom.grey[600]}},children:f.jsx(p9,{sx:{width:"20px",color:v.custom.grey[2800]}})})]})},VMe=()=>{const e=ce();return fo(e.breakpoints.down("md"))?f.jsx(K,{sx:{zIndex:1e3,minHeight:"auto",top:"28px",border:"1px solid #E7E6E4",borderRadius:"28px",backgroundColor:"#FFFFFF",padding:"20px 24px"},children:f.jsxs(le,{direction:"column",spacing:1,alignItems:"center",children:[f.jsxs(K,{sx:{width:"100%",display:"flex",justifyContent:"center",alignItems:"flex-start"},children:[f.jsx(wN,{}),f.jsx(SN,{})]}),f.jsx(K,{sx:{display:"flex",justifyContent:"center"},children:f.jsx(xN,{})})]})}):f.jsxs(K,{sx:{zIndex:1e3,minHeight:"96px",position:"sticky",top:"28px",border:"1px solid #E7E6E4",borderRadius:"52px",backgroundColor:"#FFFFFF",padding:"20px 28px",display:"grid",gridTemplateColumns:"1fr 50% 1fr",gridTemplateRows:"1fr",alignItems:"center"},children:[f.jsx(K,{sx:{gridColumn:"1 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"left"},children:f.jsx(wN,{})}),f.jsx(K,{sx:{gridColumn:"2 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"center"},children:f.jsx(xN,{})}),f.jsx(K,{sx:{gridColumn:"3 / 3",gridRow:" 1 / 1",display:"flex",justifyContent:"right"},children:f.jsx(SN,{})})]})},_Me=()=>{const{selectedPage:e,selectedPageIndex:t,isLoading:n}=h2(),r=e.icon??t+1,o=e.title,i=e.subtitle;return n?f.jsx(NMe,{}):f.jsx(le,{direction:"column",alignItems:"center",children:f.jsxs("div",{style:{width:"100%"},children:[f.jsxs(le,{direction:"column",marginTop:"44px",marginBottom:"36px",gap:"2rem",children:[o&&f.jsx(ZC,{title:o,badge:r}),i&&f.jsxs(f.Fragment,{children:[f.jsx(ie,{variant:"h4",children:i}),f.jsx(wr,{})]})]}),e.content]})})},NMe=()=>f.jsx(K,{sx:{marginLeft:"auto",marginRight:"auto",width:"fit-content",marginTop:"5%",marginBottom:"5%"},children:f.jsx(Ta,{})}),HMe=e=>{const t=ce(),{onClose:n,open:r,confirmOptions:o}=e,i=()=>{o.onConfirm(),n()},s=()=>{o.onCancel(),n()};return f.jsxs(C0,{fullWidth:!0,maxWidth:"xs",open:r,onClose:n,sx:{".MuiPaper-rounded":{borderRadius:"12px"}},children:[f.jsxs(m1,{sx:{borderBottom:`1px solid ${t.custom.grey[500]}`},children:[f.jsxs(K,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:"68px"},children:[f.jsx(ie,{variant:"h3",children:o.titleText}),f.jsx(it,{variant:"text",endIcon:f.jsx(j6,{}),onClick:n})]}),(o==null?void 0:o.infoText)&&f.jsx(ie,{sx:{marginBlock:1.5},children:o.infoText})]}),f.jsxs(le,{flexDirection:"column",alignItems:"center",p:3,gap:"1rem",children:[f.jsx(it,{variant:"primary",onClick:i,children:o.confirmText}),f.jsx(it,{onClick:s,children:o.cancelText})]})]})},$Me=()=>{const{confirmExit:e,formSaved:t}=h2(),n=r=>{r.preventDefault()};return I.useEffect(()=>{if(e)return window.removeEventListener("beforeunload",n),t===!1&&window.addEventListener("beforeunload",n),()=>{window.removeEventListener("beforeunload",n)}},[t,e]),f.jsxs(f.Fragment,{children:[f.jsx(VMe,{}),f.jsx(_Me,{})]})},FMe=e=>{const[t,n]=I.useState(!1);return f.jsxs(yN,{...e,openConfirmDialog:()=>n(!0),children:[f.jsx($Me,{}),e.confirmExit&&f.jsx(HMe,{open:t,onClose:()=>n(!1),confirmOptions:e.confirmOptions})]})},BMe=e=>{const{value:t,onChange:n,defaultOption:r,unit:o,error:i=!1,disabled:s=!1,ExtraInputProps:a={},Tooltip:c={}}=e,u=ce(),{text:d,props:p}=c;return f.jsxs(le,{gap:u.spacing(1),children:[f.jsxs(le,{flexDirection:"row",gap:u.spacing(1.5),alignItems:"center",children:[f.jsx(zMe,{fullWidth:!0,value:t,onChange:h=>{const g=h.currentTarget.value;n(g)},error:i,disabled:s,...a}),o&&f.jsx(ie,{variant:"body-medium",maxWidth:"200px",sx:{textWrap:"nowrap",overflow:"clip",textOverflow:"ellipsis"},children:o}),r&&f.jsx(M9,{size:"s",icon:"reset",tooltip:{text:d,props:p},buttonProps:{onClick:()=>{var h;n(r.value),(h=r.extraAction)==null||h.call(r,r.value)},disabled:s}})]}),r&&f.jsx(ie,{variant:"small-medium",children:`${r.label} ${r.value}`})]})},zMe=W(g0)(({theme:e})=>({"&.MuiInputBase-root":{backgroundColor:"white",height:"40px",borderRadius:"24px",paddingRight:"12px",paddingLeft:"20px",border:`1px solid ${e.custom.grey[500]}`,":hover":{backgroundColor:e.custom.grey[300]},color:e.custom.grey[2800],...e.typography["body-medium"],"& ::placeholder":{...e.typography["body-medium"],color:e.custom.grey[1400]}},"&.Mui-disabled":{backgroundColor:e.custom.grey[500],":hover":{backgroundColor:e.custom.grey[500]}},"&.Mui-focused":{border:`2px solid ${e.custom.grey[2800]}`},"&.Mui-error":{border:`1px solid ${e.custom.red[600]}`,backgroundColor:e.custom.red[100],color:e.custom.red[600],":hover":{backgroundColor:e.custom.red[200]}}}));/**
458
458
  * table-core
459
459
  *
460
460
  * Copyright (c) TanStack
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@foodpilot/foods",
3
3
  "private": false,
4
- "version": "2.5.4",
4
+ "version": "2.5.6",
5
5
  "type": "module",
6
6
  "main": "./dist/main.umd.cjs",
7
7
  "module": "./dist/main.js",