@tsiky/components-r19 1.6.161 → 1.6.163
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 +1 -1
- package/dist/chart.js +2 -1
- package/dist/components-r19.css +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.js +29 -25
- package/dist/src/components/ChartV2/ChartV2.d.ts.map +1 -1
- package/dist/src/components/DataFourBoards/DataFourBoards.d.ts +2 -1
- package/dist/src/components/DataFourBoards/DataFourBoards.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/chart.cjs.js
CHANGED
|
@@ -960,7 +960,7 @@ object-assign
|
|
|
960
960
|
(c) Sindre Sorhus
|
|
961
961
|
@license MIT
|
|
962
962
|
*/var _i,br;function xh(){if(br)return _i;br=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 _i=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},_i}var Ni,yr;function Oa(){if(yr)return Ni;yr=1;var s="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ni=s,Ni}var Hi,wr;function Gs(){return wr||(wr=1,Hi=Function.call.bind(Object.prototype.hasOwnProperty)),Hi}var Wi,kr;function mh(){if(kr)return Wi;kr=1;var s=function(){};if(process.env.NODE_ENV!=="production"){var e=Oa(),t={},i=Gs();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={})},Wi=a,Wi}var Bi,Ar;function vh(){if(Ar)return Bi;Ar=1;var s=js(),e=xh(),t=Oa(),i=Gs(),a=mh(),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 Bi=function(o,l){var c=typeof Symbol=="function"&&Symbol.iterator,h="@@iterator";function d(z){var F=z&&(c&&z[c]||z[h]);if(typeof F=="function")return F}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:O};function p(z,F){return z===F?z!==0||1/z===1/F:z!==z&&F!==F}function f(z,F){this.message=z,this.data=F&&typeof F=="object"?F:{},this.stack=""}f.prototype=Error.prototype;function x(z){if(process.env.NODE_ENV!=="production")var F={},Z=0;function U($,W,G,ee,te,ae,he){if(ee=ee||u,ae=ae||G,he!==t){if(l){var K=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 K.name="Invariant Violation",K}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var de=ee+":"+G;!F[de]&&Z<3&&(r("You are manually calling a React.PropTypes validation function for the `"+ae+"` prop on `"+ee+"`. 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."),F[de]=!0,Z++)}}return W[G]==null?$?W[G]===null?new f("The "+te+" `"+ae+"` is marked as required "+("in `"+ee+"`, but its value is `null`.")):new f("The "+te+" `"+ae+"` is marked as required in "+("`"+ee+"`, but its value is `undefined`.")):null:z(W,G,ee,te,ae)}var N=U.bind(null,!1);return N.isRequired=U.bind(null,!0),N}function m(z){function F(Z,U,N,$,W,G){var ee=Z[U],te=Y(ee);if(te!==z){var ae=_(ee);return new f("Invalid "+$+" `"+W+"` of type "+("`"+ae+"` supplied to `"+N+"`, expected ")+("`"+z+"`."),{expectedType:z})}return null}return x(F)}function v(){return x(n)}function w(z){function F(Z,U,N,$,W){if(typeof z!="function")return new f("Property `"+W+"` of component `"+N+"` has invalid PropType notation inside arrayOf.");var G=Z[U];if(!Array.isArray(G)){var ee=Y(G);return new f("Invalid "+$+" `"+W+"` of type "+("`"+ee+"` supplied to `"+N+"`, expected an array."))}for(var te=0;te<G.length;te++){var ae=z(G,te,N,$,W+"["+te+"]",t);if(ae instanceof Error)return ae}return null}return x(F)}function y(){function z(F,Z,U,N,$){var W=F[Z];if(!o(W)){var G=Y(W);return new f("Invalid "+N+" `"+$+"` of type "+("`"+G+"` supplied to `"+U+"`, expected a single ReactElement."))}return null}return x(z)}function b(){function z(F,Z,U,N,$){var W=F[Z];if(!s.isValidElementType(W)){var G=Y(W);return new f("Invalid "+N+" `"+$+"` of type "+("`"+G+"` supplied to `"+U+"`, expected a single ReactElement type."))}return null}return x(z)}function A(z){function F(Z,U,N,$,W){if(!(Z[U]instanceof z)){var G=z.name||u,ee=q(Z[U]);return new f("Invalid "+$+" `"+W+"` of type "+("`"+ee+"` supplied to `"+N+"`, expected ")+("instance of `"+G+"`."))}return null}return x(F)}function k(z){if(!Array.isArray(z))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 F(Z,U,N,$,W){for(var G=Z[U],ee=0;ee<z.length;ee++)if(p(G,z[ee]))return null;var te=JSON.stringify(z,function(he,K){var de=_(K);return de==="symbol"?String(K):K});return new f("Invalid "+$+" `"+W+"` of value `"+String(G)+"` "+("supplied to `"+N+"`, expected one of "+te+"."))}return x(F)}function S(z){function F(Z,U,N,$,W){if(typeof z!="function")return new f("Property `"+W+"` of component `"+N+"` has invalid PropType notation inside objectOf.");var G=Z[U],ee=Y(G);if(ee!=="object")return new f("Invalid "+$+" `"+W+"` of type "+("`"+ee+"` supplied to `"+N+"`, expected an object."));for(var te in G)if(i(G,te)){var ae=z(G,te,N,$,W+"."+te,t);if(ae instanceof Error)return ae}return null}return x(F)}function P(z){if(!Array.isArray(z))return process.env.NODE_ENV!=="production"&&r("Invalid argument supplied to oneOfType, expected an instance of array."),n;for(var F=0;F<z.length;F++){var Z=z[F];if(typeof Z!="function")return r("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+B(Z)+" at index "+F+"."),n}function U(N,$,W,G,ee){for(var te=[],ae=0;ae<z.length;ae++){var he=z[ae],K=he(N,$,W,G,ee,t);if(K==null)return null;K.data&&i(K.data,"expectedType")&&te.push(K.data.expectedType)}var de=te.length>0?", expected one of type ["+te.join(", ")+"]":"";return new f("Invalid "+G+" `"+ee+"` supplied to "+("`"+W+"`"+de+"."))}return x(U)}function L(){function z(F,Z,U,N,$){return R(F[Z])?null:new f("Invalid "+N+" `"+$+"` supplied to "+("`"+U+"`, expected a ReactNode."))}return x(z)}function I(z,F,Z,U,N){return new f((z||"React class")+": "+F+" type `"+Z+"."+U+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+N+"`.")}function E(z){function F(Z,U,N,$,W){var G=Z[U],ee=Y(G);if(ee!=="object")return new f("Invalid "+$+" `"+W+"` of type `"+ee+"` "+("supplied to `"+N+"`, expected `object`."));for(var te in z){var ae=z[te];if(typeof ae!="function")return I(N,$,W,te,_(ae));var he=ae(G,te,N,$,W+"."+te,t);if(he)return he}return null}return x(F)}function O(z){function F(Z,U,N,$,W){var G=Z[U],ee=Y(G);if(ee!=="object")return new f("Invalid "+$+" `"+W+"` of type `"+ee+"` "+("supplied to `"+N+"`, expected `object`."));var te=e({},Z[U],z);for(var ae in te){var he=z[ae];if(i(z,ae)&&typeof he!="function")return I(N,$,W,ae,_(he));if(!he)return new f("Invalid "+$+" `"+W+"` key `"+ae+"` supplied to `"+N+"`.\nBad object: "+JSON.stringify(Z[U],null," ")+`
|
|
963
|
-
Valid keys: `+JSON.stringify(Object.keys(z),null," "));var K=he(G,ae,N,$,W+"."+ae,t);if(K)return K}return null}return x(F)}function R(z){switch(typeof z){case"number":case"string":case"undefined":return!0;case"boolean":return!z;case"object":if(Array.isArray(z))return z.every(R);if(z===null||o(z))return!0;var F=d(z);if(F){var Z=F.call(z),U;if(F!==z.entries){for(;!(U=Z.next()).done;)if(!R(U.value))return!1}else for(;!(U=Z.next()).done;){var N=U.value;if(N&&!R(N[1]))return!1}}else return!1;return!0;default:return!1}}function D(z,F){return z==="symbol"?!0:F?F["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&F instanceof Symbol:!1}function Y(z){var F=typeof z;return Array.isArray(z)?"array":z instanceof RegExp?"object":D(F,z)?"symbol":F}function _(z){if(typeof z>"u"||z===null)return""+z;var F=Y(z);if(F==="object"){if(z instanceof Date)return"date";if(z instanceof RegExp)return"regexp"}return F}function B(z){var F=_(z);switch(F){case"array":case"object":return"an "+F;case"boolean":case"date":case"regexp":return"a "+F;default:return F}}function q(z){return!z.constructor||!z.constructor.name?u:z.constructor.name}return g.checkPropTypes=a,g.resetWarningCache=a.resetWarningCache,g.PropTypes=g,g},Bi}var ji,Sr;function bh(){if(Sr)return ji;Sr=1;var s=Oa();function e(){}function t(){}return t.resetWarningCache=e,ji=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},ji}var Cr;function yh(){if(Cr)return Vt.exports;if(Cr=1,process.env.NODE_ENV!=="production"){var s=js(),e=!0;Vt.exports=vh()(s.isElement,e)}else Vt.exports=bh()();return Vt.exports}var Pr;function wh(){return Pr||(Pr=1,function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=w;var e=o(se),t=r(gh),i=r(yh()),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),O=_||(0,e.useRef)(null),R=(0,e.useRef)(),D=((0,e.useEffect)(function(){R.current=L;var B=E.current;return O.current=new t.default(B,D()),O.current.render(),function(){O.current&&typeof O.current.destroy=="function"&&O.current.destroy()}},[]),(0,e.useEffect)(function(){var B=!v(O.current.w.config.series,P),q=!v(R.current,L)||S!==O.current.opts.chart.height||k!==O.current.opts.chart.width;(B||q)&&(!B||q?O.current.updateOptions(D()):O.current.updateSeries(P)),R.current=L},[L,P,S,k]),function(){return Y(L,{chart:{type:A,height:S,width:k},series:P})}),Y=function(B,q){var z=g({},B);return b(B)&&b(q)&&Object.keys(q).forEach(function(F){b(q[F])&&F in B?z[F]=Y(B[F],q[F]):Object.assign(z,p({},F,q[F]))}),z},_=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})}}(yi)),yi}var kh=wh();const Ta=C.getDefaultExportFromCjs(kh),Ah=["#e24b33","#e2b23a","#6feff0","#2f5be8"],Sh=({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:Ah,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 X.jsxs("div",{style:{position:"relative",height:t,width:"100%",overflow:"hidden"},children:[X.jsx("div",{style:{opacity:a?0:1,transition:"opacity 0.2s ease-in-out"},children:X.jsx(Ta,{options:o,series:l,type:"area",height:t,width:"100%"})}),a&&X.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:X.jsx(C.Move,{size:38,strokeWidth:1.5,style:{opacity:.85}})})]})},Lr={color:"#4f9db5",sort:"desc",height:520,showGrid:!0,showLegend:!1},Ch=({data:s,config:e=Lr,draggable:t=!1})=>{const i={...Lr,...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 X.jsxs("div",{style:{position:"relative",height:i.height,width:"100%",overflow:"hidden"},children:[X.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.15s ease-in-out"},children:X.jsx(Ta,{options:d,series:h,type:"bar",height:i.height,width:"100%"})}),t&&X.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:X.jsx(C.Move,{size:36,strokeWidth:1.5,style:{opacity:.85}})})]})},Ir={colorUpper:"#2db85bff",colorLower:"#b3761bff",showOutliers:!0,tooltipFormatter:s=>String(s),height:420,responsive:!0,fontSize:"12px",fontWeight:"400",columnWidth:"70%"},Ph=({data:s,config:e=Ir})=>{const t={...Ir,...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 X.jsx(Ta,{options:r,series:a,type:"boxPlot",height:t.height})},Lh=({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?X.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:[X.jsx("div",{style:{fontWeight:600,marginBottom:6},children:t}),l.max!=null&&X.jsxs("div",{children:[o.max," : ",l.max]}),l.min!=null&&X.jsxs("div",{children:[o.min," : ",l.min]}),l.pred!=null&&X.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:6},children:[X.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:6}}),X.jsxs("span",{children:[o.predictions," : ",l.pred]})]}),l.anomaly&&X.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[X.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:l.anomaly==="Haute"?n:r,marginRight:6}}),X.jsx("span",{children:o.anomaly})]}),l.reel!=null&&!l.isPrediction&&X.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[X.jsx("span",{style:{width:10,height:10,backgroundColor:i,marginRight:6}}),X.jsxs("span",{children:[o.real," : ",l.reel]})]})]}):null},Ih=({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"},disabledSeries:c,onToggle:h})=>{const d=u=>({display:"flex",alignItems:"center",cursor:"pointer",opacity:c.includes(u)?.3:1,transition:"opacity 0.2s"});return X.jsxs("div",{style:{display:"flex",justifyContent:"center",flexWrap:"wrap",gap:"20px",marginBottom:"15px",color:r,fontSize:n,fontWeight:o},children:[X.jsxs("div",{style:d("onGoing"),onClick:()=>h("onGoing"),children:[X.jsx("span",{style:{width:15,height:10,backgroundColor:s,marginRight:"5px"}}),l.onGoing]}),X.jsxs("div",{style:d("real"),onClick:()=>h("real"),children:[X.jsx("span",{style:{width:15,height:10,backgroundColor:e,marginRight:"5px"}}),l.real]}),X.jsxs("div",{style:d("predictions"),onClick:()=>h("predictions"),children:[X.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:"5px"}}),l.predictions]}),X.jsxs("div",{style:d("upperAnomaly"),onClick:()=>h("upperAnomaly"),children:[X.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:t,marginRight:"5px"}}),l.upperAnomaly]}),X.jsxs("div",{style:d("lowerAnomaly"),onClick:()=>h("lowerAnomaly"),children:[X.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:i,marginRight:"5px"}}),l.lowerAnomaly]})]})},Mh=({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=se.useRef(null),[I,E]=se.useState(50),[O,R]=se.useState([]),D=U=>{n||R(N=>N.includes(U)?N.filter($=>$!==U):[...N,U])};if(se.useLayoutEffect(()=>{const U=()=>{if(L.current){const N=L.current.getBoundingClientRect().width,$=s.labels?.length||1,te=(N-k-30-$*2)/$;E(Math.max(te,14))}};return U(),window.addEventListener("resize",U),()=>window.removeEventListener("resize",U)},[s.labels,k]),e?.displayCondition&&!e.displayCondition(s))return X.jsx("div",{style:{padding:12},children:"Chart hidden by displayCondition"});const Y=s.labels||[];if(!Y.length)return X.jsx("div",{style:{padding:12},children:"Pas de labels fournis"});const B=s[e?.histogramKey??"histogram"],q=Y.map((U,N)=>{const $=s.main[N];let W=s.upper[N],G=s.lower[N];(W==null&&G!=null||W!=null&&G==null)&&(W=W??0,G=G??0);const ee=i&&typeof s.onGoingIndex=="number"&&N>s.onGoingIndex&&N<s.onGoingIndex+y,te=ee?$??null:B?.[N]??null,ae=W,he=G;let K;!ee&&te!=null&&W!=null&&G!=null&&(te>W?K="Haute":te<G&&(K="Basse"));let de=null,ke=null;if(y>0&&i&&typeof s.onGoingIndex=="number"&&N===s.onGoingIndex)if(te==null&&$==null)de=null,ke=null;else{const je=te??0,Bt=$??0;je<=Bt?(de=je,ke=Bt-je):(de=Bt,ke=je-Bt)}else de=te??null,ke=null;return{time:U,reel:te,pred:$,realPart:de,predPart:ke,range:[G,W],max:ae,min:he,anomaly:K,isPrediction:ee}});function z(U,N){return i&&s.onGoingIndex===N?O.includes("onGoing")?"transparent":g:i&&typeof s.onGoingIndex=="number"&&N>s.onGoingIndex&&N<s.onGoingIndex+y?O.includes("predictions")?"transparent":f:U.anomaly?U.anomaly==="Haute"&&O.includes("upperAnomaly")||U.anomaly==="Basse"&&O.includes("lowerAnomaly")?"transparent":U.anomaly==="Haute"?h:l:O.includes("real")?"transparent":u}const F=typeof t=="string",Z=X.jsxs(Kr,{data:q,margin:{top:20,right:30,left:0,bottom:0},barGap:0,children:[X.jsx(C.CartesianGrid,{strokeDasharray:"0",vertical:!1,stroke:w}),X.jsx(C.XAxis,{dataKey:"time",stroke:x,axisLine:!1,tickLine:!1,tick:{fontSize:m,fontWeight:v}}),X.jsx(C.YAxis,{stroke:x,axisLine:!1,tickLine:!1,tickCount:S,tick:{fontSize:m,fontWeight:v},width:k}),r&&X.jsx(C.Tooltip,{content:X.jsx(Lh,{realColor:u,predictionColor:p,upperAnomalyColor:d,lowerAnomalyColor:c,texts:A}),cursor:{fill:"transparent"}}),X.jsx(xa,{type:"monotone",dataKey:"range",fill:"rgba(0, 143, 187, 1)",stroke:"none",fillOpacity:"16%",zIndex:999,hide:O.includes("predictions")}),X.jsx(C.Bar,{dataKey:"realPart",stackId:"a",barSize:I,radius:2,children:q.map((U,N)=>{let $;if(y>0&&i&&typeof s.onGoingIndex=="number"&&N===s.onGoingIndex){const W=U.reel??0,G=U.pred??0;W<=G?$=O.includes("onGoing")?"transparent":g:$=O.includes("predictions")?"transparent":f}else $=z(U,N);return X.jsx(C.Cell,{fill:$},`cell-${N}`)})}),X.jsx(C.Bar,{dataKey:"predPart",stackId:"a",barSize:I,radius:2,children:q.map((U,N)=>{if(!(y>0&&N===s.onGoingIndex))return X.jsx(C.Cell,{fill:"none"},`cell-pred-${N}`);const $=U.reel??0,W=U.pred??0;let G;return $<=W?G=O.includes("predictions")?"transparent":f:G=O.includes("onGoing")?"transparent":g,X.jsx(C.Cell,{fill:G},`cell-pred-${N}`)})}),X.jsx(Yr,{type:"monotone",dataKey:"pred",stroke:p,strokeDasharray:"5 5",strokeWidth:2,dot:!1,hide:O.includes("predictions")}),X.jsx($i,{dataKey:"reel",shape:U=>{const{cx:N,cy:$,payload:W}=U;if(N===void 0||$===void 0)return X.jsx("g",{});if(W?.reel==null)return X.jsx("g",{});if(i&&typeof s.onGoingIndex=="number"&&W&&s.labels.indexOf(W.time)===s.onGoingIndex)return X.jsx("g",{});const G=!!W?.anomaly,ee=!W?.min||!W?.max?!1:W.reel<=W?.max&&W.reel>=W?.min;let te=!1;return ee&&!O.includes("predictions")?te=!0:G&&(W.anomaly==="Haute"&&!O.includes("upperAnomaly")&&(te=!0),W.anomaly==="Basse"&&!O.includes("lowerAnomaly")&&(te=!0)),te?X.jsx("circle",{cx:N-.5,cy:$,r:4,fill:p,stroke:"#fff",strokeWidth:"2"}):X.jsx("g",{})}}),X.jsx($i,{dataKey:"reel",shape:U=>{const{cx:N,cy:$,payload:W}=U;if(i&&typeof s.onGoingIndex=="number"&&W&&s.labels.indexOf(W.time)===s.onGoingIndex)return X.jsx("g",{});if(!W?.anomaly||N===void 0||$===void 0)return X.jsx("g",{});if(W?.reel==null)return X.jsx("g",{});if(W.anomaly==="Haute"&&O.includes("upperAnomaly"))return X.jsx("g",{});if(W.anomaly==="Basse"&&O.includes("lowerAnomaly"))return X.jsx("g",{});const G=W.anomaly==="Haute"?d:c;return X.jsx("svg",{x:N-5.5,y:$-5,width:10,height:10,viewBox:"0 0 100 100",children:X.jsx("path",{d:"M50 0 L100 50 L50 100 L0 50 Z",fill:G,stroke:"#fff",strokeWidth:"9"})})}})]});return X.jsxs("div",{ref:L,style:{width:"100%",padding:P,backgroundColor:o,borderRadius:"12px"},children:[F?X.jsx("div",{style:{height:t},children:X.jsx(C.ResponsiveContainer,{width:"100%",height:"100%",children:Z})}):X.jsx(C.ResponsiveContainer,{width:"100%",height:t,children:Z}),!n&&X.jsx(Ih,{onGoingColor:g,realColor:u,upperAnomalyColor:d,lowerAnomalyColor:c,predictionColor:p,textColor:x,fontSize:m,fontWeight:v,legendTexts:b,disabledSeries:O,onToggle:D})]})},Eh=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(z),null," "));var K=he(G,ae,N,$,W+"."+ae,t);if(K)return K}return null}return x(F)}function R(z){switch(typeof z){case"number":case"string":case"undefined":return!0;case"boolean":return!z;case"object":if(Array.isArray(z))return z.every(R);if(z===null||o(z))return!0;var F=d(z);if(F){var Z=F.call(z),U;if(F!==z.entries){for(;!(U=Z.next()).done;)if(!R(U.value))return!1}else for(;!(U=Z.next()).done;){var N=U.value;if(N&&!R(N[1]))return!1}}else return!1;return!0;default:return!1}}function D(z,F){return z==="symbol"?!0:F?F["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&F instanceof Symbol:!1}function Y(z){var F=typeof z;return Array.isArray(z)?"array":z instanceof RegExp?"object":D(F,z)?"symbol":F}function _(z){if(typeof z>"u"||z===null)return""+z;var F=Y(z);if(F==="object"){if(z instanceof Date)return"date";if(z instanceof RegExp)return"regexp"}return F}function B(z){var F=_(z);switch(F){case"array":case"object":return"an "+F;case"boolean":case"date":case"regexp":return"a "+F;default:return F}}function q(z){return!z.constructor||!z.constructor.name?u:z.constructor.name}return g.checkPropTypes=a,g.resetWarningCache=a.resetWarningCache,g.PropTypes=g,g},Bi}var ji,Sr;function bh(){if(Sr)return ji;Sr=1;var s=Oa();function e(){}function t(){}return t.resetWarningCache=e,ji=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},ji}var Cr;function yh(){if(Cr)return Vt.exports;if(Cr=1,process.env.NODE_ENV!=="production"){var s=js(),e=!0;Vt.exports=vh()(s.isElement,e)}else Vt.exports=bh()();return Vt.exports}var Pr;function wh(){return Pr||(Pr=1,function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=w;var e=o(se),t=r(gh),i=r(yh()),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),O=_||(0,e.useRef)(null),R=(0,e.useRef)(),D=((0,e.useEffect)(function(){R.current=L;var B=E.current;return O.current=new t.default(B,D()),O.current.render(),function(){O.current&&typeof O.current.destroy=="function"&&O.current.destroy()}},[]),(0,e.useEffect)(function(){var B=!v(O.current.w.config.series,P),q=!v(R.current,L)||S!==O.current.opts.chart.height||k!==O.current.opts.chart.width;(B||q)&&(!B||q?O.current.updateOptions(D()):O.current.updateSeries(P)),R.current=L},[L,P,S,k]),function(){return Y(L,{chart:{type:A,height:S,width:k},series:P})}),Y=function(B,q){var z=g({},B);return b(B)&&b(q)&&Object.keys(q).forEach(function(F){b(q[F])&&F in B?z[F]=Y(B[F],q[F]):Object.assign(z,p({},F,q[F]))}),z},_=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})}}(yi)),yi}var kh=wh();const Ta=C.getDefaultExportFromCjs(kh),Ah=["#e24b33","#e2b23a","#6feff0","#2f5be8"],Sh=({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:Ah,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 X.jsxs("div",{style:{position:"relative",height:t,width:"100%",overflow:"hidden"},children:[X.jsx("div",{style:{opacity:a?0:1,transition:"opacity 0.2s ease-in-out"},children:X.jsx(Ta,{options:o,series:l,type:"area",height:t,width:"100%"})}),a&&X.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:X.jsx(C.Move,{size:38,strokeWidth:1.5,style:{opacity:.85}})})]})},Lr={color:"#4f9db5",sort:"desc",height:520,showGrid:!0,showLegend:!1},Ch=({data:s,config:e=Lr,draggable:t=!1})=>{const i={...Lr,...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 X.jsxs("div",{style:{position:"relative",height:i.height,width:"100%",overflow:"hidden"},children:[X.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.15s ease-in-out"},children:X.jsx(Ta,{options:d,series:h,type:"bar",height:i.height,width:"100%"})}),t&&X.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:X.jsx(C.Move,{size:36,strokeWidth:1.5,style:{opacity:.85}})})]})},Ir={colorUpper:"#2db85bff",colorLower:"#b3761bff",showOutliers:!0,tooltipFormatter:s=>String(s),height:420,responsive:!0,fontSize:"12px",fontWeight:"400",columnWidth:"70%"},Ph=({data:s,config:e=Ir})=>{const t={...Ir,...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 X.jsx(Ta,{options:r,series:a,type:"boxPlot",height:t.height})},Lh=({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?X.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:[X.jsx("div",{style:{fontWeight:600,marginBottom:6},children:t}),l.max!=null&&X.jsxs("div",{children:[o.max," : ",l.max]}),l.min!=null&&X.jsxs("div",{children:[o.min," : ",l.min]}),l.pred!=null&&X.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:6},children:[X.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:6}}),X.jsxs("span",{children:[o.predictions," : ",l.pred]})]}),l.anomaly&&X.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[X.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:l.anomaly==="Haute"?n:r,marginRight:6}}),X.jsx("span",{children:o.anomaly})]}),l.reel!=null&&!l.isPrediction&&X.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:4},children:[X.jsx("span",{style:{width:10,height:10,backgroundColor:i,marginRight:6}}),X.jsxs("span",{children:[o.real," : ",l.reel]})]})]}):null},Ih=({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"},disabledSeries:c,onToggle:h})=>{const d=u=>({display:"flex",alignItems:"center",cursor:"pointer",opacity:c.includes(u)?.3:1,transition:"opacity 0.2s"});return X.jsxs("div",{style:{display:"flex",justifyContent:"center",flexWrap:"wrap",gap:"20px",marginBottom:"15px",color:r,fontSize:n,fontWeight:o},children:[X.jsxs("div",{style:d("onGoing"),onClick:()=>h("onGoing"),children:[X.jsx("span",{style:{width:15,height:10,backgroundColor:s,marginRight:"5px"}}),l.onGoing]}),X.jsxs("div",{style:d("real"),onClick:()=>h("real"),children:[X.jsx("span",{style:{width:15,height:10,backgroundColor:e,marginRight:"5px"}}),l.real]}),X.jsxs("div",{style:d("predictions"),onClick:()=>h("predictions"),children:[X.jsx("span",{style:{width:10,height:10,borderRadius:"50%",backgroundColor:a,marginRight:"5px"}}),l.predictions]}),X.jsxs("div",{style:d("upperAnomaly"),onClick:()=>h("upperAnomaly"),children:[X.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:t,marginRight:"5px"}}),l.upperAnomaly]}),X.jsxs("div",{style:d("lowerAnomaly"),onClick:()=>h("lowerAnomaly"),children:[X.jsx("span",{style:{width:10,height:10,transform:"rotate(45deg)",backgroundColor:i,marginRight:"5px"}}),l.lowerAnomaly]})]})},Mh=({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=se.useRef(null),[I,E]=se.useState(50),[O,R]=se.useState([]),D=U=>{n||R(N=>N.includes(U)?N.filter($=>$!==U):[...N,U])};if(se.useLayoutEffect(()=>{const U=()=>{if(L.current){const N=L.current.getBoundingClientRect().width,$=s.labels?.length||1,te=(N-k-30-$*2)/$;E(Math.max(te,14))}};return U(),window.addEventListener("resize",U),()=>window.removeEventListener("resize",U)},[s.labels,k]),e?.displayCondition&&!e.displayCondition(s))return X.jsx("div",{style:{padding:12},children:"Chart hidden by displayCondition"});const Y=s.labels||[];if(!Y.length)return X.jsx("div",{style:{padding:12},children:"Pas de labels fournis"});const B=s[e?.histogramKey??"histogram"],q=Y.map((U,N)=>{const $=s.main[N];let W=s.upper[N],G=s.lower[N];(W==null&&G!=null||W!=null&&G==null)&&(W=W??0,G=G??0);const ee=i&&typeof s.onGoingIndex=="number"&&N>s.onGoingIndex&&N<s.onGoingIndex+y,te=ee?$??null:B?.[N]??null,ae=W,he=G;let K;!ee&&te!=null&&W!=null&&G!=null&&(te>W?K="Haute":te<G&&(K="Basse"));let de=null,ke=null;if(y>0&&i&&typeof s.onGoingIndex=="number"&&N===s.onGoingIndex)if(te==null&&$==null)de=null,ke=null;else{const je=te??0,Bt=$??0;je<=Bt?(de=je,ke=Bt-je):(de=Bt,ke=je-Bt)}else de=te??null,ke=null;return{time:U,reel:te,pred:$,realPart:de,predPart:ke,range:[G,W],max:ae,min:he,anomaly:K,isPrediction:ee}});function z(U,N){return i&&s.onGoingIndex===N?O.includes("onGoing")?"transparent":g:i&&typeof s.onGoingIndex=="number"&&N>s.onGoingIndex&&N<s.onGoingIndex+y?O.includes("predictions")?"transparent":f:U.anomaly?U.anomaly==="Haute"&&O.includes("upperAnomaly")||U.anomaly==="Basse"&&O.includes("lowerAnomaly")?"transparent":U.anomaly==="Haute"?h:l:O.includes("real")?"transparent":u}const F=typeof t=="string",Z=X.jsxs(Kr,{data:q,margin:{top:20,right:30,left:0,bottom:0},barGap:0,children:[X.jsx(C.CartesianGrid,{strokeDasharray:"0",vertical:!1,stroke:w}),X.jsx(C.XAxis,{dataKey:"time",stroke:x,axisLine:!1,tickLine:!1,tick:{fontSize:m,fontWeight:v}}),X.jsx(C.YAxis,{stroke:x,axisLine:!1,tickLine:!1,tickCount:S,tick:{fontSize:m,fontWeight:v},width:k,allowDecimals:!1}),r&&X.jsx(C.Tooltip,{content:X.jsx(Lh,{realColor:u,predictionColor:p,upperAnomalyColor:d,lowerAnomalyColor:c,texts:A}),cursor:{fill:"transparent"}}),X.jsx(xa,{type:"monotone",dataKey:"range",fill:"rgba(0, 143, 187, 1)",stroke:"none",fillOpacity:"16%",zIndex:999,hide:O.includes("predictions")}),X.jsx(C.Bar,{dataKey:"realPart",stackId:"a",barSize:I,radius:2,children:q.map((U,N)=>{let $;if(y>0&&i&&typeof s.onGoingIndex=="number"&&N===s.onGoingIndex){const W=U.reel??0,G=U.pred??0;W<=G?$=O.includes("onGoing")?"transparent":g:$=O.includes("predictions")?"transparent":f}else $=z(U,N);return X.jsx(C.Cell,{fill:$},`cell-${N}`)})}),X.jsx(C.Bar,{dataKey:"predPart",stackId:"a",barSize:I,radius:2,children:q.map((U,N)=>{if(!(y>0&&N===s.onGoingIndex))return X.jsx(C.Cell,{fill:"none"},`cell-pred-${N}`);const $=U.reel??0,W=U.pred??0;let G;return $<=W?G=O.includes("predictions")?"transparent":f:G=O.includes("onGoing")?"transparent":g,X.jsx(C.Cell,{fill:G},`cell-pred-${N}`)})}),X.jsx(Yr,{type:"monotone",dataKey:"pred",stroke:p,strokeDasharray:"5 5",strokeWidth:2,dot:!1,hide:O.includes("predictions")}),X.jsx($i,{dataKey:"reel",shape:U=>{const{cx:N,cy:$,payload:W}=U;if(N===void 0||$===void 0)return X.jsx("g",{});if(W?.reel==null)return X.jsx("g",{});if(i&&typeof s.onGoingIndex=="number"&&W&&s.labels.indexOf(W.time)===s.onGoingIndex)return X.jsx("g",{});const G=!!W?.anomaly,ee=!W?.min||!W?.max?!1:W.reel<=W?.max&&W.reel>=W?.min;let te=!1;return ee&&!O.includes("predictions")?te=!0:G&&(W.anomaly==="Haute"&&!O.includes("upperAnomaly")&&(te=!0),W.anomaly==="Basse"&&!O.includes("lowerAnomaly")&&(te=!0)),te?X.jsx("circle",{cx:N-.5,cy:$,r:4,fill:p,stroke:"#fff",strokeWidth:"2"}):X.jsx("g",{})}}),X.jsx($i,{dataKey:"reel",shape:U=>{const{cx:N,cy:$,payload:W}=U;if(i&&typeof s.onGoingIndex=="number"&&W&&s.labels.indexOf(W.time)===s.onGoingIndex)return X.jsx("g",{});if(!W?.anomaly||N===void 0||$===void 0)return X.jsx("g",{});if(W?.reel==null)return X.jsx("g",{});if(W.anomaly==="Haute"&&O.includes("upperAnomaly"))return X.jsx("g",{});if(W.anomaly==="Basse"&&O.includes("lowerAnomaly"))return X.jsx("g",{});const G=W.anomaly==="Haute"?d:c;return X.jsx("svg",{x:N-5.5,y:$-5,width:10,height:10,viewBox:"0 0 100 100",children:X.jsx("path",{d:"M50 0 L100 50 L50 100 L0 50 Z",fill:G,stroke:"#fff",strokeWidth:"9"})})}})]});return X.jsxs("div",{ref:L,style:{width:"100%",padding:P,backgroundColor:o,borderRadius:"12px"},children:[F?X.jsx("div",{style:{height:t},children:X.jsx(C.ResponsiveContainer,{width:"100%",height:"100%",children:Z})}):X.jsx(C.ResponsiveContainer,{width:"100%",height:t,children:Z}),!n&&X.jsx(Ih,{onGoingColor:g,realColor:u,upperAnomalyColor:d,lowerAnomalyColor:c,predictionColor:p,textColor:x,fontSize:m,fontWeight:v,legendTexts:b,disabledSeries:O,onToggle:D})]})},Eh=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 X.jsx("g",{transform:`translate(${e},${t})`,children:X.jsxs("text",{x:0,y:0,dy:16,textAnchor:"middle",fill:"#6B7281",fontSize:a,fontWeight:r,children:[X.jsx("tspan",{x:0,dy:"0em",children:o[0]}),X.jsx("tspan",{x:0,dy:"1.2em",children:o[1]})]})})}return X.jsx("text",{x:e,y:t,dy:16,textAnchor:"middle",fill:"#6B7281",fontSize:a,fontWeight:r,children:n})},Oh=({data:s,height:e=320,tooltipEnabled:t=!0,legendEnabled:i=!0,backgroundColor:a="#ffffff",stacked:r=!0,fontSize:n="12px",fontWeight:o="400",yDomain:l})=>{const c=s.labels.map((g,p)=>{const f={label:g};return s.series.forEach(x=>{f[x.key]=x.data[p]??0}),f}),h=new Map(s.series.map((g,p)=>[g.key,p])),d=g=>{const p=(g.payload??[]).map(f=>({...f}));return p.sort((f,x)=>{const m=h.get(f.dataKey)??999,v=h.get(x.dataKey)??999;return m-v}),X.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:8,gap:16,flexWrap:"wrap"},children:p.map(f=>X.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[X.jsx("div",{style:{width:12,height:12,backgroundColor:f.color,borderRadius:2}}),X.jsx("span",{style:{fontSize:n,fontWeight:o,color:"#374151"},children:f.value})]},f.value))})},u=se.useMemo(()=>{const g=s.labels.length;if(g<=0)return[];if(g<=12)return s.labels;const p=5,f=(g-1)/(p-1),x=[];for(let m=0;m<p;m++)x.push(s.labels[Math.round(m*f)]);return Array.from(new Set(x))},[s.labels]);return X.jsx("div",{style:{width:"100%",height:"100%",backgroundColor:a},children:X.jsx(C.ResponsiveContainer,{width:"100%",height:e,children:X.jsxs(Kr,{data:c,margin:{left:20,right:45,top:10,bottom:20},children:[X.jsx(C.CartesianGrid,{stroke:"#E5E7EB",vertical:!1}),X.jsx(C.XAxis,{fontSize:n,fontWeight:o,dataKey:"label",axisLine:!1,tickLine:!1,tickMargin:10,interval:0,ticks:u,scale:"point",height:45,tick:X.jsx(Eh,{fontSize:n,fontWeight:o})}),X.jsx(C.YAxis,{fontSize:n,fontWeight:o,axisLine:!1,tickLine:!1,width:30,domain:l}),t&&X.jsx(C.Tooltip,{itemSorter:g=>h.get(g.dataKey)??999}),i&&X.jsx(li,{content:d}),s.series.map(g=>X.jsx(xa,{type:"monotone",dataKey:g.key,stackId:r?"1":void 0,fill:g.color,stroke:"none",fillOpacity:1,name:g.label},g.key))]})})})},Th=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 X.jsxs(C.Layer,{children:[X.jsx(C.Rectangle,{x:e,y:t,width:i,height:a,fill:n.fill}),X.jsx("foreignObject",{x:c?e-h-8:e+i+8,y:t+a/2-25,width:h,height:50,style:{overflow:"visible"},children:X.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}`)},Rh=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
|
@@ -15435,7 +15435,8 @@ const Or = /* @__PURE__ */ qa(Du), Xu = ["#e24b33", "#e2b23a", "#6feff0", "#2f5b
|
|
|
15435
15435
|
tickLine: !1,
|
|
15436
15436
|
tickCount: S,
|
|
15437
15437
|
tick: { fontSize: m, fontWeight: v },
|
|
15438
|
-
width: k
|
|
15438
|
+
width: k,
|
|
15439
|
+
allowDecimals: !1
|
|
15439
15440
|
}
|
|
15440
15441
|
),
|
|
15441
15442
|
r && /* @__PURE__ */ N(
|