@tsiky/components-r19 1.6.59 → 1.6.61

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/chart.cjs.js CHANGED
@@ -960,7 +960,7 @@ object-assign
960
960
  (c) Sindre Sorhus
961
961
  @license MIT
962
962
  */var Yi,vr;function ph(){if(vr)return Yi;vr=1;var s=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function i(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function a(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var n={},o=0;o<10;o++)n["_"+String.fromCharCode(o)]=o;var l=Object.getOwnPropertyNames(n).map(function(h){return n[h]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(h){c[h]=h}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Yi=a()?Object.assign:function(r,n){for(var o,l=i(r),c,h=1;h<arguments.length;h++){o=Object(arguments[h]);for(var d in o)e.call(o,d)&&(l[d]=o[d]);if(s){c=s(o);for(var u=0;u<c.length;u++)t.call(o,c[u])&&(l[c[u]]=o[c[u]])}}return l},Yi}var _i,br;function Ea(){if(br)return _i;br=1;var s="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return _i=s,_i}var Ni,yr;function js(){return yr||(yr=1,Ni=Function.call.bind(Object.prototype.hasOwnProperty)),Ni}var Hi,wr;function xh(){if(wr)return Hi;wr=1;var s=function(){};if(process.env.NODE_ENV!=="production"){var e=Ea(),t={},i=js();s=function(r){var n="Warning: "+r;typeof console<"u"&&console.error(n);try{throw new Error(n)}catch{}}}function a(r,n,o,l,c){if(process.env.NODE_ENV!=="production"){for(var h in r)if(i(r,h)){var d;try{if(typeof r[h]!="function"){var u=Error((l||"React class")+": "+o+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}d=r[h](n,h,l,o,null,e)}catch(p){d=p}if(d&&!(d instanceof Error)&&s((l||"React class")+": type specification of "+o+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in t)){t[d.message]=!0;var g=c?c():"";s("Failed "+o+" type: "+d.message+(g??""))}}}}return a.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},Hi=a,Hi}var Wi,kr;function mh(){if(kr)return Wi;kr=1;var s=Bs(),e=ph(),t=Ea(),i=js(),a=xh(),r=function(){};process.env.NODE_ENV!=="production"&&(r=function(o){var l="Warning: "+o;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function n(){return null}return Wi=function(o,l){var c=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function d(O){var D=O&&(c&&O[c]||O[h]);if(typeof D=="function")return D}var u="<<anonymous>>",g={array:m("array"),bigint:m("bigint"),bool:m("boolean"),func:m("function"),number:m("number"),object:m("object"),string:m("string"),symbol:m("symbol"),any:v(),arrayOf:w,element:y(),elementType:b(),instanceOf:A,node:L(),objectOf:S,oneOf:k,oneOfType:P,shape:E,exact:R};function p(O,D){return O===D?O!==0||1/O===1/D:O!==O&&D!==D}function f(O,D){this.message=O,this.data=D&&typeof D=="object"?D:{},this.stack=""}f.prototype=Error.prototype;function x(O){if(process.env.NODE_ENV!=="production")var D={},W=0;function V(ee,q,Z,Q,ae,te,le){if(Q=Q||u,te=te||Z,le!==t){if(l){var $=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw $.name="Invariant Violation",$}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var de=Q+":"+Z;!D[de]&&W<3&&(r("You are manually calling a React.PropTypes validation function for the `"+te+"` prop on `"+Q+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),D[de]=!0,W++)}}return q[Z]==null?ee?q[Z]===null?new f("The "+ae+" `"+te+"` is marked as required "+("in `"+Q+"`, but its value is `null`.")):new f("The "+ae+" `"+te+"` is marked as required in "+("`"+Q+"`, but its value is `undefined`.")):null:O(q,Z,Q,ae,te)}var H=V.bind(null,!1);return H.isRequired=V.bind(null,!0),H}function m(O){function D(W,V,H,ee,q,Z){var Q=W[V],ae=Y(Q);if(ae!==O){var te=_(Q);return new f("Invalid "+ee+" `"+q+"` of type "+("`"+te+"` supplied to `"+H+"`, expected ")+("`"+O+"`."),{expectedType:O})}return null}return x(D)}function v(){return x(n)}function w(O){function D(W,V,H,ee,q){if(typeof O!="function")return new f("Property `"+q+"` of component `"+H+"` has invalid PropType notation inside arrayOf.");var Z=W[V];if(!Array.isArray(Z)){var Q=Y(Z);return new f("Invalid "+ee+" `"+q+"` of type "+("`"+Q+"` supplied to `"+H+"`, expected an array."))}for(var ae=0;ae<Z.length;ae++){var te=O(Z,ae,H,ee,q+"["+ae+"]",t);if(te instanceof Error)return te}return null}return x(D)}function y(){function O(D,W,V,H,ee){var q=D[W];if(!o(q)){var Z=Y(q);return new f("Invalid "+H+" `"+ee+"` of type "+("`"+Z+"` supplied to `"+V+"`, expected a single ReactElement."))}return null}return x(O)}function b(){function O(D,W,V,H,ee){var q=D[W];if(!s.isValidElementType(q)){var Z=Y(q);return new f("Invalid "+H+" `"+ee+"` of type "+("`"+Z+"` supplied to `"+V+"`, expected a single ReactElement type."))}return null}return x(O)}function A(O){function D(W,V,H,ee,q){if(!(W[V]instanceof O)){var Z=O.name||u,Q=U(W[V]);return new f("Invalid "+ee+" `"+q+"` of type "+("`"+Q+"` supplied to `"+H+"`, expected ")+("instance of `"+Z+"`."))}return null}return x(D)}function k(O){if(!Array.isArray(O))return process.env.NODE_ENV!=="production"&&(arguments.length>1?r("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):r("Invalid argument supplied to oneOf, expected an array.")),n;function D(W,V,H,ee,q){for(var Z=W[V],Q=0;Q<O.length;Q++)if(p(Z,O[Q]))return null;var ae=JSON.stringify(O,function(le,$){var de=_($);return de==="symbol"?String($):$});return new f("Invalid "+ee+" `"+q+"` of value `"+String(Z)+"` "+("supplied to `"+H+"`, expected one of "+ae+"."))}return x(D)}function S(O){function D(W,V,H,ee,q){if(typeof O!="function")return new f("Property `"+q+"` of component `"+H+"` has invalid PropType notation inside objectOf.");var Z=W[V],Q=Y(Z);if(Q!=="object")return new f("Invalid "+ee+" `"+q+"` of type "+("`"+Q+"` supplied to `"+H+"`, expected an object."));for(var ae in Z)if(i(Z,ae)){var te=O(Z,ae,H,ee,q+"."+ae,t);if(te instanceof Error)return te}return null}return x(D)}function P(O){if(!Array.isArray(O))return process.env.NODE_ENV!=="production"&&r("Invalid argument supplied to oneOfType, expected an instance of array."),n;for(var D=0;D<O.length;D++){var W=O[D];if(typeof W!="function")return r("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+B(W)+" at index "+D+"."),n}function V(H,ee,q,Z,Q){for(var ae=[],te=0;te<O.length;te++){var le=O[te],$=le(H,ee,q,Z,Q,t);if($==null)return null;$.data&&i($.data,"expectedType")&&ae.push($.data.expectedType)}var de=ae.length>0?", expected one of type ["+ae.join(", ")+"]":"";return new f("Invalid "+Z+" `"+Q+"` supplied to "+("`"+q+"`"+de+"."))}return x(V)}function L(){function O(D,W,V,H,ee){return z(D[W])?null:new f("Invalid "+H+" `"+ee+"` supplied to "+("`"+V+"`, expected a ReactNode."))}return x(O)}function I(O,D,W,V,H){return new f((O||"React class")+": "+D+" type `"+W+"."+V+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+H+"`.")}function E(O){function D(W,V,H,ee,q){var Z=W[V],Q=Y(Z);if(Q!=="object")return new f("Invalid "+ee+" `"+q+"` of type `"+Q+"` "+("supplied to `"+H+"`, expected `object`."));for(var ae in O){var te=O[ae];if(typeof te!="function")return I(H,ee,q,ae,_(te));var le=te(Z,ae,H,ee,q+"."+ae,t);if(le)return le}return null}return x(D)}function R(O){function D(W,V,H,ee,q){var Z=W[V],Q=Y(Z);if(Q!=="object")return new f("Invalid "+ee+" `"+q+"` of type `"+Q+"` "+("supplied to `"+H+"`, expected `object`."));var ae=e({},W[V],O);for(var te in ae){var le=O[te];if(i(O,te)&&typeof le!="function")return I(H,ee,q,te,_(le));if(!le)return new f("Invalid "+ee+" `"+q+"` key `"+te+"` supplied to `"+H+"`.\nBad object: "+JSON.stringify(W[V],null," ")+`
963
- Valid keys: `+JSON.stringify(Object.keys(O),null," "));var $=le(Z,te,H,ee,q+"."+te,t);if($)return $}return null}return x(D)}function z(O){switch(typeof O){case"number":case"string":case"undefined":return!0;case"boolean":return!O;case"object":if(Array.isArray(O))return O.every(z);if(O===null||o(O))return!0;var D=d(O);if(D){var W=D.call(O),V;if(D!==O.entries){for(;!(V=W.next()).done;)if(!z(V.value))return!1}else for(;!(V=W.next()).done;){var H=V.value;if(H&&!z(H[1]))return!1}}else return!1;return!0;default:return!1}}function X(O,D){return O==="symbol"?!0:D?D["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&D instanceof Symbol:!1}function Y(O){var D=typeof O;return Array.isArray(O)?"array":O instanceof RegExp?"object":X(D,O)?"symbol":D}function _(O){if(typeof O>"u"||O===null)return""+O;var D=Y(O);if(D==="object"){if(O instanceof Date)return"date";if(O instanceof RegExp)return"regexp"}return D}function B(O){var D=_(O);switch(D){case"array":case"object":return"an "+D;case"boolean":case"date":case"regexp":return"a "+D;default:return D}}function U(O){return!O.constructor||!O.constructor.name?u:O.constructor.name}return g.checkPropTypes=a,g.resetWarningCache=a.resetWarningCache,g.PropTypes=g,g},Wi}var Bi,Ar;function vh(){if(Ar)return Bi;Ar=1;var s=Ea();function e(){}function t(){}return t.resetWarningCache=e,Bi=function(){function i(n,o,l,c,h,d){if(d!==s){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}i.isRequired=i;function a(){return i}var r={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:a,element:i,elementType:i,instanceOf:a,node:i,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:t,resetWarningCache:e};return r.PropTypes=r,r},Bi}var Sr;function bh(){if(Sr)return Gt.exports;if(Sr=1,process.env.NODE_ENV!=="production"){var s=Bs(),e=!0;Gt.exports=mh()(s.isElement,e)}else Gt.exports=vh()();return Gt.exports}var Cr;function yh(){return Cr||(Cr=1,function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=w;var e=o(ne),t=r(uh),i=r(bh()),a=["type","width","height","series","options","chartRef"];function r(y){return y&&y.__esModule?y:{default:y}}function n(y){var b,A;return typeof WeakMap!="function"?null:(b=new WeakMap,A=new WeakMap,(n=function(k){return k?A:b})(y))}function o(y,b){if(!b&&y&&y.__esModule)return y;if(y===null||d(y)!="object"&&typeof y!="function")return{default:y};if(b=n(b),b&&b.has(y))return b.get(y);var A,k,S={__proto__:null},P=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(A in y)A!=="default"&&{}.hasOwnProperty.call(y,A)&&((k=P?Object.getOwnPropertyDescriptor(y,A):null)&&(k.get||k.set)?Object.defineProperty(S,A,k):S[A]=y[A]);return S.default=y,b&&b.set(y,S),S}function l(){return(l=Object.assign?Object.assign.bind():function(y){for(var b=1;b<arguments.length;b++){var A,k=arguments[b];for(A in k)!{}.hasOwnProperty.call(k,A)||(y[A]=k[A])}return y}).apply(null,arguments)}function c(y,b){if(y==null)return{};var A,k=h(y,b);if(Object.getOwnPropertySymbols)for(var S=Object.getOwnPropertySymbols(y),P=0;P<S.length;P++)A=S[P],b.includes(A)||{}.propertyIsEnumerable.call(y,A)&&(k[A]=y[A]);return k}function h(y,b){if(y==null)return{};var A,k={};for(A in y)if({}.hasOwnProperty.call(y,A)){if(b.includes(A))continue;k[A]=y[A]}return k}function d(y){return(d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b})(y)}function u(y,b){var A,k=Object.keys(y);return Object.getOwnPropertySymbols&&(A=Object.getOwnPropertySymbols(y),b&&(A=A.filter(function(S){return Object.getOwnPropertyDescriptor(y,S).enumerable})),k.push.apply(k,A)),k}function g(y){for(var b=1;b<arguments.length;b++){var A=arguments[b]!=null?arguments[b]:{};b%2?u(Object(A),!0).forEach(function(k){p(y,k,A[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(A)):u(Object(A)).forEach(function(k){Object.defineProperty(y,k,Object.getOwnPropertyDescriptor(A,k))})}return y}function p(y,b,A){return(b=f(b))in y?Object.defineProperty(y,b,{value:A,enumerable:!0,configurable:!0,writable:!0}):y[b]=A,y}function f(y){return y=x(y,"string"),d(y)=="symbol"?y:y+""}function x(y,b){if(d(y)!="object"||!y)return y;var A=y[Symbol.toPrimitive];if(A===void 0)return(b==="string"?String:Number)(y);if(A=A.call(y,b),d(A)!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}function m(y,b){var A=g({},y);return b.forEach(function(k){delete A[k]}),A}function v(y,b){var A=2<arguments.length&&arguments[2]!==void 0?arguments[2]:new WeakSet;if(y!==b){if(d(y)!=="object"||y===null||d(b)!=="object"||b===null)return!1;if(!A.has(y)&&!A.has(b)){A.add(y),A.add(b);var k=Object.keys(y),S=Object.keys(b);if(k.length!==S.length)return!1;for(var P=0,L=k;P<L.length;P++){var I=L[P];if(!S.includes(I)||!v(y[I],b[I],A))return!1}}}return!0}function w(I){function b(B){return B&&d(B)==="object"&&!Array.isArray(B)}var _=I.type,A=_===void 0?"line":_,_=I.width,k=_===void 0?"100%":_,_=I.height,S=_===void 0?"auto":_,P=I.series,L=I.options,_=I.chartRef,I=c(I,a),E=(0,e.useRef)(null),R=_||(0,e.useRef)(null),z=(0,e.useRef)(),X=((0,e.useEffect)(function(){z.current=L;var B=E.current;return R.current=new t.default(B,X()),R.current.render(),function(){R.current&&typeof R.current.destroy=="function"&&R.current.destroy()}},[]),(0,e.useEffect)(function(){var B=!v(R.current.w.config.series,P),U=!v(z.current,L)||S!==R.current.opts.chart.height||k!==R.current.opts.chart.width;(B||U)&&(!B||U?R.current.updateOptions(X()):R.current.updateSeries(P)),z.current=L},[L,P,S,k]),function(){return Y(L,{chart:{type:A,height:S,width:k},series:P})}),Y=function(B,U){var O=g({},B);return b(B)&&b(U)&&Object.keys(U).forEach(function(D){b(U[D])&&D in B?O[D]=Y(B[D],U[D]):Object.assign(O,p({},D,U[D]))}),O},_=m(I,Object.keys(w.propTypes));return e.default.createElement("div",l({ref:E},_))}w.propTypes={type:i.default.string.isRequired,series:i.default.array.isRequired,options:i.default.object.isRequired,width:i.default.oneOfType([i.default.string,i.default.number]),height:i.default.oneOfType([i.default.string,i.default.number]),chartRef:i.default.shape({current:i.default.any})}}(bi)),bi}var wh=yh();const Oa=C.getDefaultExportFromCjs(wh),kh=["#e24b33","#e2b23a","#6feff0","#2f5be8"],Ah=({categories:s,series:e,height:t=350,title:i="Admissions",draggable:a=!1})=>{const r=Math.max(...s.map((c,h)=>e.reduce((d,u)=>d+(u.data[h]??0),0))),n=Math.max(100,Math.ceil(r/50)*50),o={chart:{foreColor:"var(--color-text)",type:"area",stacked:!0,stackType:"normal",toolbar:{show:!1},zoom:{enabled:!1},animations:{enabled:!0},fontFamily:"Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial"},title:{text:i,align:"center",style:{fontSize:"36px",fontWeight:700,color:"#555"}},colors:kh,dataLabels:{enabled:!1},stroke:{curve:"smooth",width:1.5},fill:{type:"solid",opacity:.95},markers:{size:0},legend:{show:!0,position:"top",horizontalAlign:"center",itemMargin:{horizontal:8,vertical:0}},xaxis:{categories:s,labels:{rotate:-45,rotateAlways:!0,style:{fontSize:"12px"}},tickPlacement:"on"},yaxis:{min:0,max:n,tickAmount:7,labels:{formatter:c=>String(Math.round(Number(c)))}},grid:{borderColor:"#e9e9e9",strokeDashArray:0},tooltip:{shared:!0,intersect:!1,y:{formatter:c=>String(c)}},responsive:[{breakpoint:768,options:{chart:{height:Math.max(240,Math.round(t*.7))},legend:{position:"top"},xaxis:{labels:{rotate:-45}}}}]},l=e.map(c=>({name:c.name,type:"area",data:c.data}));return F.jsxs("div",{style:{position:"relative",height:t,width:"100%",overflow:"hidden"},children:[F.jsx("div",{style:{opacity:a?0:1,transition:"opacity 0.2s ease-in-out"},children:F.jsx(Oa,{options:o,series:l,type:"area",height:t,width:"100%"})}),a&&F.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.6)",borderRadius:12,backdropFilter:"blur(3px)",pointerEvents:"none",transition:"opacity 0.2s ease-in-out"},children:F.jsx(C.Move,{size:38,strokeWidth:1.5,style:{opacity:.85}})})]})},Pr={color:"#4f9db5",sort:"desc",height:520,showGrid:!0,showLegend:!1},Sh=({data:s,config:e=Pr,draggable:t=!1})=>{const i={...Pr,...e},a=s.labels??[],r=s.values??[],n=Math.min(a.length,r.length),o=[];for(let u=0;u<n;u++)o.push({label:a[u],value:r[u]});i.sort==="desc"?o.sort((u,g)=>g.value-u.value):i.sort==="asc"&&o.sort((u,g)=>u.value-g.value);const l=o.map(u=>u.label),h=[{name:"Valeur",data:o.map(u=>u.value)}],d={chart:{foreColor:"var(--color-text)",type:"bar",toolbar:{show:!1},height:i.height},plotOptions:{bar:{horizontal:!0,barHeight:"60%",distributed:!1,borderRadius:6,borderRadiusApplication:"end"}},dataLabels:{enabled:!1,formatter:u=>String(u),style:{fontSize:"12px"},offsetX:0},yaxis:{labels:{style:{fontSize:"12px"}}},grid:{show:!!i.showGrid,borderColor:"#e6e6e6"},tooltip:{shared:!1,y:{formatter:u=>String(u)}},legend:{show:!!i.showLegend},colors:[i.color],xaxis:{min:0,tickAmount:5,categories:l,labels:{formatter:u=>String(u)}},responsive:[]};return F.jsxs("div",{style:{position:"relative",height:i.height,width:"100%",overflow:"hidden"},children:[F.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.15s ease-in-out"},children:F.jsx(Oa,{options:d,series:h,type:"bar",height:i.height,width:"100%"})}),t&&F.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.5)",borderRadius:12,backdropFilter:"blur(3px)",pointerEvents:"none",transition:"opacity 0.15s ease-in-out"},children:F.jsx(C.Move,{size:36,strokeWidth:1.5,style:{opacity:.85}})})]})},Lr={colorUpper:"#2db85bff",colorLower:"#b3761bff",showOutliers:!0,tooltipFormatter:s=>String(s),height:420,responsive:!0,fontSize:"12px",fontWeight:"400",columnWidth:"70%"},Ch=({data:s,config:e=Lr})=>{const t={...Lr,...e},a=[{name:"Distribution",data:(Array.isArray(s?.series)?s.series:[]).map(n=>({x:n.x,y:n.y}))}],r={chart:{foreColor:"var(--color-text)",type:"boxPlot",toolbar:{show:!1},height:t.height},yaxis:{tickAmount:10,labels:{formatter:function(n){return n.toFixed(0)}}},plotOptions:{boxPlot:{columnWidth:t.columnWidth,colors:{upper:t.colorUpper,lower:t.colorLower}}},xaxis:{labels:{rotate:-45,rotateAlways:!0,style:{fontSize:t.fontSize,fontWeight:t.fontWeight}}},stroke:{show:!0,width:1,colors:[t.colorStroke??"var(--color-secondary)"]},markers:{size:0},tooltip:{shared:!1,theme:"dark",custom:function({seriesIndex:n,dataPointIndex:o,w:l}){const c=l.globals.initialSeries[n].data[o].y;return!c||c.length!==5?"":['<div style="padding:10px 14px;font-family:sans-serif;font-size:13px;line-height:1.9;">',`<div>max : <b>${c[4]}</b></div>`,`<div>q1 : <b>${c[3]}</b></div>`,`<div>median : <b>${c[2]}</b></div>`,`<div>q3 : <b>${c[1]}</b></div>`,`<div>min : <b>${c[0]}</b></div>`,"</div>"].join("")}},grid:{borderColor:"#e6e6e6"},dataLabels:{enabled:!1},legend:{show:!1,fontSize:t.fontSize,fontWeight:t.fontWeight},responsive:t.responsive?[]:void 0};return F.jsx(Oa,{options:r,series:a,type:"boxPlot",height:t.height})},Ph=({active:s,payload:e,label:t,realColor:i="#D9D9D9",predictionColor:a="#22D3EE",lowerAnomalyColor:r="#C497FF80",upperAnomalyColor:n="#A27DD5",texts:o={max:"Max",min:"Min",predictions:"Prédictions",anomaly:"Anomalie",real:"Réel"}})=>{if(!s||!e||!e.length)return null;const l=e[0].payload;return l?F.jsxs("div",{style:{backgroundColor:"#0B1220",color:"#FFFFFF",padding:"10px 12px",borderRadius:8,fontSize:12,lineHeight:1.4,minWidth:150,boxShadow:"0 4px 12px rgba(0,0,0,0.4)"},children:[F.jsx("div",{style:{fontWeight:600,marginBottom:6},children:t}),l.max!=null&&F.jsxs("div",{children:[o.max," : ",l.max]}),l.min!=null&&F.jsxs("div",{children:[o.min," : ",l.min]}),l.pred!=null&&F.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:6},children:[F.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:6}}),F.jsxs("span",{children:[o.predictions," : ",l.pred]})]}),l.anomaly&&F.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[F.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:l.anomaly==="Haute"?n:r,marginRight:6}}),F.jsx("span",{children:o.anomaly})]}),l.reel!=null&&!l.isPrediction&&F.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[F.jsx("span",{style:{width:10,height:10,backgroundColor:i,marginRight:6}}),F.jsxs("span",{children:[o.real," : ",l.reel]})]})]}):null},Lh=({onGoingColor:s,realColor:e,upperAnomalyColor:t,lowerAnomalyColor:i,predictionColor:a,textColor:r="#9CA3AF",fontSize:n="12px",fontWeight:o="400",legendTexts:l={onGoing:"En cours",real:"Réel",predictions:"Prédictions Correctes",upperAnomaly:"Anomalie Haute",lowerAnomaly:"Anomalie Basse"}})=>F.jsxs("div",{style:{display:"flex",justifyContent:"center",flexWrap:"wrap",gap:"20px",marginBottom:"15px",color:r,fontSize:n,fontWeight:o},children:[F.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[F.jsx("span",{style:{width:15,height:10,backgroundColor:s,marginRight:"5px"}}),l.onGoing]}),F.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[F.jsx("span",{style:{width:15,height:10,backgroundColor:e,marginRight:"5px"}}),l.real]}),F.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[F.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:"5px"}}),l.predictions]}),F.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[F.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:t,marginRight:"5px"}}),l.upperAnomaly]}),F.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[F.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:i,marginRight:"5px"}}),l.lowerAnomaly]})]}),Ih=({data:s,config:e,height:t=220,useOnGoing:i,draggable:a=!1,tooltipEnabled:r=!0,disableLegendFilter:n=!1,backgroundColor:o="#ffffff",lowerAnomalyColor:l="#D8B4FE",lowerAnomalyScatterColor:c="#C497FF",upperAnomalyColor:h="#A855F7",upperAnomalyScatterColor:d="#7C46C3",realColor:u="#D9D9D9",onGoingColor:g="#727688",predictionColor:p="#22D3EE",predictionBarColor:f="#22D3EE",textColor:x="#9CA3AF",fontSize:m="8px",fontWeight:v="400",lineColor:w="#F4F4F4",predictionWindow:y=0,legendTexts:b,tooltipTexts:A,yAxisWidth:k=20,tickCount:S=7,padding:P})=>{const L=ne.useRef(null),[I,E]=ne.useState(50);if(ne.useLayoutEffect(()=>{const O=()=>{if(L.current){const D=L.current.getBoundingClientRect().width,W=s.labels?.length||1,q=(D-k-30-W*2)/W;E(Math.max(q,14))}};return O(),window.addEventListener("resize",O),()=>window.removeEventListener("resize",O)},[s.labels,k]),e?.displayCondition&&!e.displayCondition(s))return F.jsx("div",{style:{padding:12},children:"Chart hidden by displayCondition"});const R=s.labels||[];if(!R.length)return F.jsx("div",{style:{padding:12},children:"Pas de labels fournis"});const X=s[e?.histogramKey??"histogram"],Y=R.map((O,D)=>{const W=s.main[D];let V=s.upper[D],H=s.lower[D];(V==null||H==null)&&(V=V??0,H=H??0);const ee=i&&typeof s.onGoingIndex=="number"&&D>s.onGoingIndex&&D<s.onGoingIndex+y,q=ee?W??null:X?.[D]??null,Z=V,Q=H;let ae;!ee&&q!=null&&V!=null&&H!=null&&(q>V?ae="Haute":q<H&&(ae="Basse"));let te=null,le=null;if(y>0&&i&&typeof s.onGoingIndex=="number"&&D===s.onGoingIndex)if(q==null&&W==null)te=null,le=null;else{const $=q??0,de=W??0;$<=de?(te=$,le=de-$):(te=de,le=$-de)}else te=q??null,le=null;return{time:O,reel:q,pred:W,realPart:te,predPart:le,range:[H,V],max:Z,min:Q,anomaly:ae,isPrediction:ee}});function _(O,D){return i&&s.onGoingIndex==D?g:i&&typeof s.onGoingIndex=="number"&&D>s.onGoingIndex&&D<s.onGoingIndex+y?f:O.anomaly?O.anomaly==="Haute"?h:l:u}const B=typeof t=="string",U=F.jsxs(Zr,{data:Y,margin:{top:20,right:30,left:0,bottom:0},barGap:0,children:[F.jsx(C.CartesianGrid,{strokeDasharray:"0",vertical:!1,stroke:w}),F.jsx(C.XAxis,{dataKey:"time",stroke:x,axisLine:!1,tickLine:!1,tick:{fontSize:m,fontWeight:v}}),F.jsx(C.YAxis,{stroke:x,axisLine:!1,tickLine:!1,tickCount:S,tick:{fontSize:m,fontWeight:v},width:k}),r&&F.jsx(C.Tooltip,{content:F.jsx(Ph,{realColor:u,predictionColor:p,upperAnomalyColor:d,lowerAnomalyColor:c,texts:A}),cursor:{fill:"transparent"}}),F.jsx(pa,{type:"monotone",dataKey:"range",fill:"rgba(0, 143, 187, 1)",stroke:"none",fillOpacity:"16%",zIndex:999}),F.jsx(C.Bar,{dataKey:"realPart",stackId:"a",barSize:I,radius:2,children:Y.map((O,D)=>{let W;if(y>0&&i&&typeof s.onGoingIndex=="number"&&D===s.onGoingIndex){const V=O.reel??0,H=O.pred??0;W=V<=H?g:f}else W=_(O,D);return F.jsx(C.Cell,{fill:W},`cell-${D}`)})}),F.jsx(C.Bar,{dataKey:"predPart",stackId:"a",barSize:I,radius:2,children:Y.map((O,D)=>{if(!(y>0&&D===s.onGoingIndex))return F.jsx(C.Cell,{fill:"none"},`cell-pred-${D}`);const W=O.reel??0,V=O.pred??0;let H=W<=V?f:g;return F.jsx(C.Cell,{fill:H},`cell-pred-${D}`)})}),F.jsx(Fr,{type:"monotone",dataKey:"pred",stroke:p,strokeDasharray:"5 5",strokeWidth:2,dot:!1}),F.jsx(qi,{dataKey:"reel",shape:O=>{const{cx:D,cy:W,payload:V}=O;if(D===void 0||W===void 0)return F.jsx("g",{});if(V?.reel==null)return F.jsx("g",{});if(i&&typeof s.onGoingIndex=="number"&&V&&s.labels.indexOf(V.time)===s.onGoingIndex)return F.jsx("g",{});const H=!!V?.anomaly,ee=V?.reel===V?.pred;return H||ee?F.jsx("circle",{cx:D-.5,cy:W,r:4,fill:p,stroke:"#fff",strokeWidth:"2"}):F.jsx("g",{})}}),F.jsx(qi,{dataKey:"reel",shape:O=>{const{cx:D,cy:W,payload:V}=O;if(i&&typeof s.onGoingIndex=="number"&&V&&s.labels.indexOf(V.time)===s.onGoingIndex)return F.jsx("g",{});if(!V?.anomaly||D===void 0||W===void 0)return F.jsx("g",{});if(V?.reel==null)return F.jsx("g",{});const H=V.anomaly==="Haute"?d:c;return F.jsx("svg",{x:D-5.5,y:W-5,width:10,height:10,viewBox:"0 0 100 100",children:F.jsx("path",{d:"M50 0 L100 50 L50 100 L0 50 Z",fill:H,stroke:"#fff",strokeWidth:"9"})})}})]});return F.jsxs("div",{ref:L,style:{width:"100%",padding:P,backgroundColor:o,borderRadius:"12px"},children:[B?F.jsx("div",{style:{height:t},children:F.jsx(C.ResponsiveContainer,{width:"100%",height:"100%",children:U})}):F.jsx(C.ResponsiveContainer,{width:"100%",height:t,children:U}),!n&&F.jsx(Lh,{onGoingColor:g,realColor:u,upperAnomalyColor:d,lowerAnomalyColor:c,predictionColor:p,textColor:x,fontSize:m,fontWeight:v,legendTexts:b})]})},Mh=s=>{const{x:e,y:t,payload:i,fontSize:a,fontWeight:r}=s,{value:n}=i;if(n&&n.includes(`
963
+ Valid keys: `+JSON.stringify(Object.keys(O),null," "));var $=le(Z,te,H,ee,q+"."+te,t);if($)return $}return null}return x(D)}function z(O){switch(typeof O){case"number":case"string":case"undefined":return!0;case"boolean":return!O;case"object":if(Array.isArray(O))return O.every(z);if(O===null||o(O))return!0;var D=d(O);if(D){var W=D.call(O),V;if(D!==O.entries){for(;!(V=W.next()).done;)if(!z(V.value))return!1}else for(;!(V=W.next()).done;){var H=V.value;if(H&&!z(H[1]))return!1}}else return!1;return!0;default:return!1}}function X(O,D){return O==="symbol"?!0:D?D["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&D instanceof Symbol:!1}function Y(O){var D=typeof O;return Array.isArray(O)?"array":O instanceof RegExp?"object":X(D,O)?"symbol":D}function _(O){if(typeof O>"u"||O===null)return""+O;var D=Y(O);if(D==="object"){if(O instanceof Date)return"date";if(O instanceof RegExp)return"regexp"}return D}function B(O){var D=_(O);switch(D){case"array":case"object":return"an "+D;case"boolean":case"date":case"regexp":return"a "+D;default:return D}}function U(O){return!O.constructor||!O.constructor.name?u:O.constructor.name}return g.checkPropTypes=a,g.resetWarningCache=a.resetWarningCache,g.PropTypes=g,g},Wi}var Bi,Ar;function vh(){if(Ar)return Bi;Ar=1;var s=Ea();function e(){}function t(){}return t.resetWarningCache=e,Bi=function(){function i(n,o,l,c,h,d){if(d!==s){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}i.isRequired=i;function a(){return i}var r={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:a,element:i,elementType:i,instanceOf:a,node:i,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:t,resetWarningCache:e};return r.PropTypes=r,r},Bi}var Sr;function bh(){if(Sr)return Gt.exports;if(Sr=1,process.env.NODE_ENV!=="production"){var s=Bs(),e=!0;Gt.exports=mh()(s.isElement,e)}else Gt.exports=vh()();return Gt.exports}var Cr;function yh(){return Cr||(Cr=1,function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=w;var e=o(ne),t=r(uh),i=r(bh()),a=["type","width","height","series","options","chartRef"];function r(y){return y&&y.__esModule?y:{default:y}}function n(y){var b,A;return typeof WeakMap!="function"?null:(b=new WeakMap,A=new WeakMap,(n=function(k){return k?A:b})(y))}function o(y,b){if(!b&&y&&y.__esModule)return y;if(y===null||d(y)!="object"&&typeof y!="function")return{default:y};if(b=n(b),b&&b.has(y))return b.get(y);var A,k,S={__proto__:null},P=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(A in y)A!=="default"&&{}.hasOwnProperty.call(y,A)&&((k=P?Object.getOwnPropertyDescriptor(y,A):null)&&(k.get||k.set)?Object.defineProperty(S,A,k):S[A]=y[A]);return S.default=y,b&&b.set(y,S),S}function l(){return(l=Object.assign?Object.assign.bind():function(y){for(var b=1;b<arguments.length;b++){var A,k=arguments[b];for(A in k)!{}.hasOwnProperty.call(k,A)||(y[A]=k[A])}return y}).apply(null,arguments)}function c(y,b){if(y==null)return{};var A,k=h(y,b);if(Object.getOwnPropertySymbols)for(var S=Object.getOwnPropertySymbols(y),P=0;P<S.length;P++)A=S[P],b.includes(A)||{}.propertyIsEnumerable.call(y,A)&&(k[A]=y[A]);return k}function h(y,b){if(y==null)return{};var A,k={};for(A in y)if({}.hasOwnProperty.call(y,A)){if(b.includes(A))continue;k[A]=y[A]}return k}function d(y){return(d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b})(y)}function u(y,b){var A,k=Object.keys(y);return Object.getOwnPropertySymbols&&(A=Object.getOwnPropertySymbols(y),b&&(A=A.filter(function(S){return Object.getOwnPropertyDescriptor(y,S).enumerable})),k.push.apply(k,A)),k}function g(y){for(var b=1;b<arguments.length;b++){var A=arguments[b]!=null?arguments[b]:{};b%2?u(Object(A),!0).forEach(function(k){p(y,k,A[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(A)):u(Object(A)).forEach(function(k){Object.defineProperty(y,k,Object.getOwnPropertyDescriptor(A,k))})}return y}function p(y,b,A){return(b=f(b))in y?Object.defineProperty(y,b,{value:A,enumerable:!0,configurable:!0,writable:!0}):y[b]=A,y}function f(y){return y=x(y,"string"),d(y)=="symbol"?y:y+""}function x(y,b){if(d(y)!="object"||!y)return y;var A=y[Symbol.toPrimitive];if(A===void 0)return(b==="string"?String:Number)(y);if(A=A.call(y,b),d(A)!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}function m(y,b){var A=g({},y);return b.forEach(function(k){delete A[k]}),A}function v(y,b){var A=2<arguments.length&&arguments[2]!==void 0?arguments[2]:new WeakSet;if(y!==b){if(d(y)!=="object"||y===null||d(b)!=="object"||b===null)return!1;if(!A.has(y)&&!A.has(b)){A.add(y),A.add(b);var k=Object.keys(y),S=Object.keys(b);if(k.length!==S.length)return!1;for(var P=0,L=k;P<L.length;P++){var I=L[P];if(!S.includes(I)||!v(y[I],b[I],A))return!1}}}return!0}function w(I){function b(B){return B&&d(B)==="object"&&!Array.isArray(B)}var _=I.type,A=_===void 0?"line":_,_=I.width,k=_===void 0?"100%":_,_=I.height,S=_===void 0?"auto":_,P=I.series,L=I.options,_=I.chartRef,I=c(I,a),E=(0,e.useRef)(null),R=_||(0,e.useRef)(null),z=(0,e.useRef)(),X=((0,e.useEffect)(function(){z.current=L;var B=E.current;return R.current=new t.default(B,X()),R.current.render(),function(){R.current&&typeof R.current.destroy=="function"&&R.current.destroy()}},[]),(0,e.useEffect)(function(){var B=!v(R.current.w.config.series,P),U=!v(z.current,L)||S!==R.current.opts.chart.height||k!==R.current.opts.chart.width;(B||U)&&(!B||U?R.current.updateOptions(X()):R.current.updateSeries(P)),z.current=L},[L,P,S,k]),function(){return Y(L,{chart:{type:A,height:S,width:k},series:P})}),Y=function(B,U){var O=g({},B);return b(B)&&b(U)&&Object.keys(U).forEach(function(D){b(U[D])&&D in B?O[D]=Y(B[D],U[D]):Object.assign(O,p({},D,U[D]))}),O},_=m(I,Object.keys(w.propTypes));return e.default.createElement("div",l({ref:E},_))}w.propTypes={type:i.default.string.isRequired,series:i.default.array.isRequired,options:i.default.object.isRequired,width:i.default.oneOfType([i.default.string,i.default.number]),height:i.default.oneOfType([i.default.string,i.default.number]),chartRef:i.default.shape({current:i.default.any})}}(bi)),bi}var wh=yh();const Oa=C.getDefaultExportFromCjs(wh),kh=["#e24b33","#e2b23a","#6feff0","#2f5be8"],Ah=({categories:s,series:e,height:t=350,title:i="Admissions",draggable:a=!1})=>{const r=Math.max(...s.map((c,h)=>e.reduce((d,u)=>d+(u.data[h]??0),0))),n=Math.max(100,Math.ceil(r/50)*50),o={chart:{foreColor:"var(--color-text)",type:"area",stacked:!0,stackType:"normal",toolbar:{show:!1},zoom:{enabled:!1},animations:{enabled:!0},fontFamily:"Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial"},title:{text:i,align:"center",style:{fontSize:"36px",fontWeight:700,color:"#555"}},colors:kh,dataLabels:{enabled:!1},stroke:{curve:"smooth",width:1.5},fill:{type:"solid",opacity:.95},markers:{size:0},legend:{show:!0,position:"top",horizontalAlign:"center",itemMargin:{horizontal:8,vertical:0}},xaxis:{categories:s,labels:{rotate:-45,rotateAlways:!0,style:{fontSize:"12px"}},tickPlacement:"on"},yaxis:{min:0,max:n,tickAmount:7,labels:{formatter:c=>String(Math.round(Number(c)))}},grid:{borderColor:"#e9e9e9",strokeDashArray:0},tooltip:{shared:!0,intersect:!1,y:{formatter:c=>String(c)}},responsive:[{breakpoint:768,options:{chart:{height:Math.max(240,Math.round(t*.7))},legend:{position:"top"},xaxis:{labels:{rotate:-45}}}}]},l=e.map(c=>({name:c.name,type:"area",data:c.data}));return F.jsxs("div",{style:{position:"relative",height:t,width:"100%",overflow:"hidden"},children:[F.jsx("div",{style:{opacity:a?0:1,transition:"opacity 0.2s ease-in-out"},children:F.jsx(Oa,{options:o,series:l,type:"area",height:t,width:"100%"})}),a&&F.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.6)",borderRadius:12,backdropFilter:"blur(3px)",pointerEvents:"none",transition:"opacity 0.2s ease-in-out"},children:F.jsx(C.Move,{size:38,strokeWidth:1.5,style:{opacity:.85}})})]})},Pr={color:"#4f9db5",sort:"desc",height:520,showGrid:!0,showLegend:!1},Sh=({data:s,config:e=Pr,draggable:t=!1})=>{const i={...Pr,...e},a=s.labels??[],r=s.values??[],n=Math.min(a.length,r.length),o=[];for(let u=0;u<n;u++)o.push({label:a[u],value:r[u]});i.sort==="desc"?o.sort((u,g)=>g.value-u.value):i.sort==="asc"&&o.sort((u,g)=>u.value-g.value);const l=o.map(u=>u.label),h=[{name:"Valeur",data:o.map(u=>u.value)}],d={chart:{foreColor:"var(--color-text)",type:"bar",toolbar:{show:!1},height:i.height},plotOptions:{bar:{horizontal:!0,barHeight:"60%",distributed:!1,borderRadius:6,borderRadiusApplication:"end"}},dataLabels:{enabled:!1,formatter:u=>String(u),style:{fontSize:"12px"},offsetX:0},yaxis:{labels:{style:{fontSize:"12px"}}},grid:{show:!!i.showGrid,borderColor:"#e6e6e6"},tooltip:{shared:!1,y:{formatter:u=>String(u)}},legend:{show:!!i.showLegend},colors:[i.color],xaxis:{min:0,tickAmount:5,categories:l,labels:{formatter:u=>String(u)}},responsive:[]};return F.jsxs("div",{style:{position:"relative",height:i.height,width:"100%",overflow:"hidden"},children:[F.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.15s ease-in-out"},children:F.jsx(Oa,{options:d,series:h,type:"bar",height:i.height,width:"100%"})}),t&&F.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.5)",borderRadius:12,backdropFilter:"blur(3px)",pointerEvents:"none",transition:"opacity 0.15s ease-in-out"},children:F.jsx(C.Move,{size:36,strokeWidth:1.5,style:{opacity:.85}})})]})},Lr={colorUpper:"#2db85bff",colorLower:"#b3761bff",showOutliers:!0,tooltipFormatter:s=>String(s),height:420,responsive:!0,fontSize:"12px",fontWeight:"400",columnWidth:"70%"},Ch=({data:s,config:e=Lr})=>{const t={...Lr,...e},a=[{name:"Distribution",data:(Array.isArray(s?.series)?s.series:[]).map(n=>({x:n.x,y:n.y}))}],r={chart:{foreColor:"var(--color-text)",type:"boxPlot",toolbar:{show:!1},height:t.height},yaxis:{tickAmount:10,labels:{formatter:function(n){return n.toFixed(0)}}},plotOptions:{boxPlot:{columnWidth:t.columnWidth,colors:{upper:t.colorUpper,lower:t.colorLower}}},xaxis:{labels:{rotate:-45,rotateAlways:!0,style:{fontSize:t.fontSize,fontWeight:t.fontWeight}}},stroke:{show:!0,width:1,colors:[t.colorStroke??"var(--color-secondary)"]},markers:{size:0},tooltip:{shared:!1,theme:"dark",custom:function({seriesIndex:n,dataPointIndex:o,w:l}){const c=l.globals.initialSeries[n].data[o].y;return!c||c.length!==5?"":['<div style="padding:10px 14px;font-family:sans-serif;font-size:13px;line-height:1.9;">',`<div>max : <b>${c[4]}</b></div>`,`<div>q1 : <b>${c[3]}</b></div>`,`<div>median : <b>${c[2]}</b></div>`,`<div>q3 : <b>${c[1]}</b></div>`,`<div>min : <b>${c[0]}</b></div>`,"</div>"].join("")}},grid:{borderColor:"#e6e6e6"},dataLabels:{enabled:!1},legend:{show:!1,fontSize:t.fontSize,fontWeight:t.fontWeight},responsive:t.responsive?[]:void 0};return F.jsx(Oa,{options:r,series:a,type:"boxPlot",height:t.height})},Ph=({active:s,payload:e,label:t,realColor:i="#D9D9D9",predictionColor:a="#22D3EE",lowerAnomalyColor:r="#C497FF80",upperAnomalyColor:n="#A27DD5",texts:o={max:"Max",min:"Min",predictions:"Prédictions",anomaly:"Anomalie",real:"Réel"}})=>{if(!s||!e||!e.length)return null;const l=e[0].payload;return l?F.jsxs("div",{style:{backgroundColor:"#0B1220",color:"#FFFFFF",padding:"10px 12px",borderRadius:8,fontSize:12,lineHeight:1.4,minWidth:150,boxShadow:"0 4px 12px rgba(0,0,0,0.4)"},children:[F.jsx("div",{style:{fontWeight:600,marginBottom:6},children:t}),l.max!=null&&F.jsxs("div",{children:[o.max," : ",l.max]}),l.min!=null&&F.jsxs("div",{children:[o.min," : ",l.min]}),l.pred!=null&&F.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:6},children:[F.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:6}}),F.jsxs("span",{children:[o.predictions," : ",l.pred]})]}),l.anomaly&&F.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[F.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:l.anomaly==="Haute"?n:r,marginRight:6}}),F.jsx("span",{children:o.anomaly})]}),l.reel!=null&&!l.isPrediction&&F.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[F.jsx("span",{style:{width:10,height:10,backgroundColor:i,marginRight:6}}),F.jsxs("span",{children:[o.real," : ",l.reel]})]})]}):null},Lh=({onGoingColor:s,realColor:e,upperAnomalyColor:t,lowerAnomalyColor:i,predictionColor:a,textColor:r="#9CA3AF",fontSize:n="12px",fontWeight:o="400",legendTexts:l={onGoing:"En cours",real:"Réel",predictions:"Prédictions Correctes",upperAnomaly:"Anomalie Haute",lowerAnomaly:"Anomalie Basse"}})=>F.jsxs("div",{style:{display:"flex",justifyContent:"center",flexWrap:"wrap",gap:"20px",marginBottom:"15px",color:r,fontSize:n,fontWeight:o},children:[F.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[F.jsx("span",{style:{width:15,height:10,backgroundColor:s,marginRight:"5px"}}),l.onGoing]}),F.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[F.jsx("span",{style:{width:15,height:10,backgroundColor:e,marginRight:"5px"}}),l.real]}),F.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[F.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:"5px"}}),l.predictions]}),F.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[F.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:t,marginRight:"5px"}}),l.upperAnomaly]}),F.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[F.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:i,marginRight:"5px"}}),l.lowerAnomaly]})]}),Ih=({data:s,config:e,height:t=220,useOnGoing:i,draggable:a=!1,tooltipEnabled:r=!0,disableLegendFilter:n=!1,backgroundColor:o="#ffffff",lowerAnomalyColor:l="#D8B4FE",lowerAnomalyScatterColor:c="#C497FF",upperAnomalyColor:h="#A855F7",upperAnomalyScatterColor:d="#7C46C3",realColor:u="#D9D9D9",onGoingColor:g="#727688",predictionColor:p="#22D3EE",predictionBarColor:f="#22D3EE",textColor:x="#9CA3AF",fontSize:m="8px",fontWeight:v="400",lineColor:w="#F4F4F4",predictionWindow:y=0,legendTexts:b,tooltipTexts:A,yAxisWidth:k=20,tickCount:S=7,padding:P})=>{const L=ne.useRef(null),[I,E]=ne.useState(50);if(ne.useLayoutEffect(()=>{const O=()=>{if(L.current){const D=L.current.getBoundingClientRect().width,W=s.labels?.length||1,q=(D-k-30-W*2)/W;E(Math.max(q,14))}};return O(),window.addEventListener("resize",O),()=>window.removeEventListener("resize",O)},[s.labels,k]),e?.displayCondition&&!e.displayCondition(s))return F.jsx("div",{style:{padding:12},children:"Chart hidden by displayCondition"});const R=s.labels||[];if(!R.length)return F.jsx("div",{style:{padding:12},children:"Pas de labels fournis"});const X=s[e?.histogramKey??"histogram"],Y=R.map((O,D)=>{const W=s.main[D];let V=s.upper[D],H=s.lower[D];(V==null&&H!=null||V!=null&&H==null)&&(V=V??0,H=H??0);const ee=i&&typeof s.onGoingIndex=="number"&&D>s.onGoingIndex&&D<s.onGoingIndex+y,q=ee?W??null:X?.[D]??null,Z=V,Q=H;let ae;!ee&&q!=null&&V!=null&&H!=null&&(q>V?ae="Haute":q<H&&(ae="Basse"));let te=null,le=null;if(y>0&&i&&typeof s.onGoingIndex=="number"&&D===s.onGoingIndex)if(q==null&&W==null)te=null,le=null;else{const $=q??0,de=W??0;$<=de?(te=$,le=de-$):(te=de,le=$-de)}else te=q??null,le=null;return{time:O,reel:q,pred:W,realPart:te,predPart:le,range:[H,V],max:Z,min:Q,anomaly:ae,isPrediction:ee}});function _(O,D){return i&&s.onGoingIndex==D?g:i&&typeof s.onGoingIndex=="number"&&D>s.onGoingIndex&&D<s.onGoingIndex+y?f:O.anomaly?O.anomaly==="Haute"?h:l:u}const B=typeof t=="string",U=F.jsxs(Zr,{data:Y,margin:{top:20,right:30,left:0,bottom:0},barGap:0,children:[F.jsx(C.CartesianGrid,{strokeDasharray:"0",vertical:!1,stroke:w}),F.jsx(C.XAxis,{dataKey:"time",stroke:x,axisLine:!1,tickLine:!1,tick:{fontSize:m,fontWeight:v}}),F.jsx(C.YAxis,{stroke:x,axisLine:!1,tickLine:!1,tickCount:S,tick:{fontSize:m,fontWeight:v},width:k}),r&&F.jsx(C.Tooltip,{content:F.jsx(Ph,{realColor:u,predictionColor:p,upperAnomalyColor:d,lowerAnomalyColor:c,texts:A}),cursor:{fill:"transparent"}}),F.jsx(pa,{type:"monotone",dataKey:"range",fill:"rgba(0, 143, 187, 1)",stroke:"none",fillOpacity:"16%",zIndex:999}),F.jsx(C.Bar,{dataKey:"realPart",stackId:"a",barSize:I,radius:2,children:Y.map((O,D)=>{let W;if(y>0&&i&&typeof s.onGoingIndex=="number"&&D===s.onGoingIndex){const V=O.reel??0,H=O.pred??0;W=V<=H?g:f}else W=_(O,D);return F.jsx(C.Cell,{fill:W},`cell-${D}`)})}),F.jsx(C.Bar,{dataKey:"predPart",stackId:"a",barSize:I,radius:2,children:Y.map((O,D)=>{if(!(y>0&&D===s.onGoingIndex))return F.jsx(C.Cell,{fill:"none"},`cell-pred-${D}`);const W=O.reel??0,V=O.pred??0;let H=W<=V?f:g;return F.jsx(C.Cell,{fill:H},`cell-pred-${D}`)})}),F.jsx(Fr,{type:"monotone",dataKey:"pred",stroke:p,strokeDasharray:"5 5",strokeWidth:2,dot:!1}),F.jsx(qi,{dataKey:"reel",shape:O=>{const{cx:D,cy:W,payload:V}=O;return D===void 0||W===void 0?F.jsx("g",{}):V?.reel==null?F.jsx("g",{}):i&&typeof s.onGoingIndex=="number"&&V&&s.labels.indexOf(V.time)===s.onGoingIndex?F.jsx("g",{}):V?.anomaly?F.jsx("circle",{cx:D-.5,cy:W,r:4,fill:p,stroke:"#fff",strokeWidth:"2"}):F.jsx("g",{})}}),F.jsx(qi,{dataKey:"reel",shape:O=>{const{cx:D,cy:W,payload:V}=O;if(i&&typeof s.onGoingIndex=="number"&&V&&s.labels.indexOf(V.time)===s.onGoingIndex)return F.jsx("g",{});if(!V?.anomaly||D===void 0||W===void 0)return F.jsx("g",{});if(V?.reel==null)return F.jsx("g",{});const H=V.anomaly==="Haute"?d:c;return F.jsx("svg",{x:D-5.5,y:W-5,width:10,height:10,viewBox:"0 0 100 100",children:F.jsx("path",{d:"M50 0 L100 50 L50 100 L0 50 Z",fill:H,stroke:"#fff",strokeWidth:"9"})})}})]});return F.jsxs("div",{ref:L,style:{width:"100%",padding:P,backgroundColor:o,borderRadius:"12px"},children:[B?F.jsx("div",{style:{height:t},children:F.jsx(C.ResponsiveContainer,{width:"100%",height:"100%",children:U})}):F.jsx(C.ResponsiveContainer,{width:"100%",height:t,children:U}),!n&&F.jsx(Lh,{onGoingColor:g,realColor:u,upperAnomalyColor:d,lowerAnomalyColor:c,predictionColor:p,textColor:x,fontSize:m,fontWeight:v,legendTexts:b})]})},Mh=s=>{const{x:e,y:t,payload:i,fontSize:a,fontWeight:r}=s,{value:n}=i;if(n&&n.includes(`
964
964
  `)){const o=n.split(`
965
965
  `);return F.jsx("g",{transform:`translate(${e},${t})`,children:F.jsxs("text",{x:0,y:0,dy:16,textAnchor:"middle",fill:"#6B7281",fontSize:a,fontWeight:r,children:[F.jsx("tspan",{x:0,dy:"0em",children:o[0]}),F.jsx("tspan",{x:0,dy:"1.2em",children:o[1]})]})})}return F.jsx("text",{x:e,y:t,dy:16,textAnchor:"middle",fill:"#6B7281",fontSize:a,fontWeight:r,children:n})},Eh=({data:s,height:e=320,tooltipEnabled:t=!0,legendEnabled:i=!0,backgroundColor:a="#ffffff",stacked:r=!0,fontSize:n="12px",fontWeight:o="400"})=>{const l=s.labels.map((u,g)=>{const p={label:u};return s.series.forEach(f=>{p[f.key]=f.data[g]??0}),p}),c=new Map(s.series.map((u,g)=>[u.key,g])),h=u=>{const g=(u.payload??[]).map(p=>({...p}));return g.sort((p,f)=>{const x=c.get(p.dataKey)??999,m=c.get(f.dataKey)??999;return x-m}),F.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:8,gap:16,flexWrap:"wrap"},children:g.map(p=>F.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[F.jsx("div",{style:{width:12,height:12,backgroundColor:p.color,borderRadius:2}}),F.jsx("span",{style:{fontSize:n,fontWeight:o,color:"#374151"},children:p.value})]},p.value))})},d=ne.useMemo(()=>{const u=s.labels.length;if(u<=0)return[];if(u<=12)return s.labels;const g=5,p=(u-1)/(g-1),f=[];for(let x=0;x<g;x++)f.push(s.labels[Math.round(x*p)]);return Array.from(new Set(f))},[s.labels]);return F.jsx("div",{style:{width:"100%",height:"100%",backgroundColor:a},children:F.jsx(C.ResponsiveContainer,{width:"100%",height:e,children:F.jsxs(Zr,{data:l,margin:{left:20,right:45,top:10,bottom:20},children:[F.jsx(C.CartesianGrid,{stroke:"#E5E7EB",vertical:!1}),F.jsx(C.XAxis,{fontSize:n,fontWeight:o,dataKey:"label",axisLine:!1,tickLine:!1,tickMargin:10,interval:0,ticks:d,scale:"point",height:45,tick:F.jsx(Mh,{fontSize:n,fontWeight:o})}),F.jsx(C.YAxis,{fontSize:n,fontWeight:o,axisLine:!1,tickLine:!1,width:30}),t&&F.jsx(C.Tooltip,{itemSorter:u=>c.get(u.dataKey)??999}),i&&F.jsx(oi,{content:h}),s.series.map(u=>F.jsx(pa,{type:"monotone",dataKey:u.key,stackId:r?"1":void 0,fill:u.color,stroke:"none",fillOpacity:1,name:u.label},u.key))]})})})},Oh=s=>{const{x:e,y:t,width:i,height:a,index:r,payload:n,fontSize:o,fontWeight:l}=s;if(isNaN(e)||isNaN(t))return null;const c=e<200,h=95;return F.jsxs(C.Layer,{children:[F.jsx(C.Rectangle,{x:e,y:t,width:i,height:a,fill:n.fill}),F.jsx("foreignObject",{x:c?e-h-8:e+i+8,y:t+a/2-25,width:h,height:50,style:{overflow:"visible"},children:F.jsx("div",{style:{fontSize:o||"11px",fontWeight:l||"400",color:"#94a3b8",lineHeight:"1.2",wordBreak:"break-word",display:"flex",alignItems:"center",justifyContent:c?"flex-end":"flex-start",textAlign:c?"right":"left",height:"100%",pointerEvents:"none"},children:n.name})})]},`node-${r}`)},Th=s=>{const{sourceX:e,sourceY:t,targetX:i,targetY:a,linkWidth:r,index:n,payload:o,uid:l}=s;if(e==null||t==null||i==null||a==null||r==null)return null;const c=`
966
966
  M${e},${t}
package/dist/chart.js CHANGED
@@ -15372,7 +15372,7 @@ const Er = /* @__PURE__ */ Ua(zu), Du = ["#e24b33", "#e2b23a", "#6feff0", "#2f5b
15372
15372
  const D = s[e?.histogramKey ?? "histogram"], X = T.map((E, z) => {
15373
15373
  const N = s.main[z];
15374
15374
  let G = s.upper[z], F = s.lower[z];
15375
- (G == null || F == null) && (G = G ?? 0, F = F ?? 0);
15375
+ (G == null && F != null || G != null && F == null) && (G = G ?? 0, F = F ?? 0);
15376
15376
  const Q = i && typeof s.onGoingIndex == "number" && z > s.onGoingIndex && z < s.onGoingIndex + y, U = Q ? N ?? null : D?.[z] ?? null, $ = G, J = F;
15377
15377
  let ie;
15378
15378
  !Q && U != null && G != null && F != null && (U > G ? ie = "Haute" : U < F && (ie = "Basse"));
@@ -15485,12 +15485,7 @@ const Er = /* @__PURE__ */ Ua(zu), Du = ["#e24b33", "#e2b23a", "#6feff0", "#2f5b
15485
15485
  dataKey: "reel",
15486
15486
  shape: (E) => {
15487
15487
  const { cx: z, cy: N, payload: G } = E;
15488
- if (z === void 0 || N === void 0) return /* @__PURE__ */ H("g", {});
15489
- if (G?.reel == null) return /* @__PURE__ */ H("g", {});
15490
- if (i && typeof s.onGoingIndex == "number" && G && s.labels.indexOf(G.time) === s.onGoingIndex)
15491
- return /* @__PURE__ */ H("g", {});
15492
- const F = !!G?.anomaly, Q = G?.reel === G?.pred;
15493
- return F || Q ? /* @__PURE__ */ H(
15488
+ return z === void 0 || N === void 0 ? /* @__PURE__ */ H("g", {}) : G?.reel == null ? /* @__PURE__ */ H("g", {}) : i && typeof s.onGoingIndex == "number" && G && s.labels.indexOf(G.time) === s.onGoingIndex ? /* @__PURE__ */ H("g", {}) : G?.anomaly ? /* @__PURE__ */ H(
15494
15489
  "circle",
15495
15490
  {
15496
15491
  cx: z - 0.5,