1import{j as n}from"./react-redux-toastr-CcoR1TjO.js";import{r as j}from"./react-dom-BDiJ65v_.js";import{u as Oe}from"./react-redux-DsLnkHos.js";import{u as Me}from"./@tanstack-Wj3fJpNN.js";import{g as Ne}from"./core-js-D7CYqyFz.js";import{s as _e,i as Re,_ as De,S as Te,w as ke,I as Fe,B as Ee,g as Ve,z as Be,p as Ge,X as He,W as he,O as qe,M as We,l as Qe,k as ze,r as Xe,a as $e}from"./nivo-pie.es-C-ymtXFT.js";import{B as Ye}from"./Button-BJbRdzII.js";import"./index.es-D55Z391_.js";import{f as Ke,r as Ue}from"./index-BT1-f1fa.js";import{b}from"./buildRequest-Dm__2AEG.js";import{e as Je}from"./react-router-dom-T0C7lv-A.js";import"./date-fns-C5WZdu3y.js";import"./date-fns-tz-DoiyT1kf.js";import"./@sentry-D0FjrTLk.js";import"./@sentry-internal-B4j4Cy2U.js";import"./chart.js-Dam0dajP.js";import"./react-select-98C87Ufo.js";import"./reactstrap-laAXQq5V.js";import"./@headlessui-DN_esfIR.js";import"./@codegouvfr-CX48mJX3.js";import"./apiv2-DSGh2CzU.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="309f8c71-5965-4988-879f-fc4c0314e5dd",e._sentryDebugIdIdentifier="sentry-dbid-309f8c71-5965-4988-879f-fc4c0314e5dd")}catch{}})();const g={green:"#7bc043",red:"#ee4035",red2:"#fc8c62",green2:"#66c2a5",red3:"rgb(246, 181, 174)",green3:"rgb(250, 218, 164)"},Ze=({xLabel:e,yLabel:r,min:t="auto",max:s="auto",width:a=900,height:o=500,selected:i,points:c=[]})=>n.jsx(_e,{width:a,height:o,margin:{top:24,right:24,bottom:80,left:80},nodeSize:10,data:[{id:e,data:c},{id:"selected",data:i?[{x:c.findIndex(l=>l.y===i),y:i}]:[]}],tooltip:({node:l})=>n.jsx("strong",{children:l.data.y}),yScale:{type:"linear",min:t,max:s},colors:["navy","red"],axisLeft:{legend:r,legendPosition:"middle",legendOffset:-60},axisBottom:{legend:e,legendPosition:"middle",legendOffset:60},animate:!1}),Q=({width:e=900,height:r=500,data:t=[],isPourcent:s})=>{const a=t.map(o=>({id:o.label,...o}));return n.jsx(Re,{width:e,height:r,margin:{top:24,right:24,bottom:80,left:80},activeOuterRadiusOffset:8,data:a,colors:a.map(({color:o})=>o),padAngle:2,valueFormat:o=>s?`${(o*100).toFixed(2)}%`:o==null?void 0:o.toString()})};function er(e){var r=0,t=e.children,s=t&&t.length;if(!s)r=1;else for(;--s>=0;)r+=t[s].value;e.value=r}function rr(){return this.eachAfter(er)}function tr(e){var r=this,t,s=[r],a,o,i;do for(t=s.reverse(),s=[];r=t.pop();)if(e(r),a=r.children,a)for(o=0,i=a.length;o<i;++o)s.push(a[o]);while(s.length);return this}function ar(e){for(var r=this,t=[r],s,a;r=t.pop();)if(e(r),s=r.children,s)for(a=s.length-1;a>=0;--a)t.push(s[a]);return this}function nr(e){for(var r=this,t=[r],s=[],a,o,i;r=t.pop();)if(s.push(r),a=r.children,a)for(o=0,i=a.length;o<i;++o)t.push(a[o]);for(;r=s.pop();)e(r);return this}function sr(e){return this.eachAfter(function(r){for(var t=+e(r.data)||0,s=r.children,a=s&&s.length;--a>=0;)t+=s[a].value;r.value=t})}function ir(e){return this.eachBefore(function(r){r.children&&r.children.sort(e)})}function or(e){for(var r=this,t=lr(r,e),s=[r];r!==t;)r=r.parent,s.push(r);for(var a=s.length;e!==t;)s.splice(a,0,e),e=e.parent;return s}function lr(e,r){if(e===r)return e;var t=e.ancestors(),s=r.ancestors(),a=null;for(e=t.pop(),r=s.pop();e===r;)a=e,e=t.pop(),r=s.pop();return a}function cr(){for(var e=this,r=[e];e=e.parent;)r.push(e);return r}function dr(){var e=[];return this.each(function(r){e.push(r)}),e}function ur(){var e=[];return this.eachBefore(function(r){r.children||e.push(r)}),e}function hr(){var e=this,r=[];return e.each(function(t){t!==e&&r.push({source:t.parent,target:t})}),r}function ae(e,r){var t=new z(e),s=+e.value&&(t.value=e.value),a,o=[t],i,c,l,u;for(r==null&&(r=mr);a=o.pop();)if(s&&(a.value=+a.data.value),(c=r(a.data))&&(u=c.length))for(a.children=new Array(u),l=u-1;l>=0;--l)o.push(i=a.children[l]=new z(c[l])),i.parent=a,i.depth=a.depth+1;return t.eachBefore(gr)}function pr(){return ae(this).eachBefore(fr)}function mr(e){return e.children}function fr(e){e.data=e.data.data}function gr(e){var r=0;do e.height=r;while((e=e.parent)&&e.height<++r)}function z(e){this.data=e,this.depth=this.height=0,this.parent=null}z.prototype=ae.prototype={constructor:z,count:rr,each:tr,eachAfter:nr,eachBefore:ar,
1sum:sr,sort:ir,path:or,ancestors:cr,descendants:dr,leaves:ur,links:hr,copy:pr};function xr(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function vr(e,r,t,s,a){for(var o=e.children,i,c=-1,l=o.length,u=e.value&&(s-r)/e.value;++c<l;)i=o[c],i.y0=t,i.y1=a,i.x0=r,i.x1=r+=i.value*u}function br(){var e=1,r=1,t=0,s=!1;function a(i){var c=i.height+1;return i.x0=i.y0=t,i.x1=e,i.y1=r/c,i.eachBefore(o(r,c)),s&&i.eachBefore(xr),i}function o(i,c){return function(l){l.children&&vr(l,l.x0,i*(l.depth+1)/c,l.x1,i*(l.depth+2)/c);var u=l.x0,h=l.y0,p=l.x1-t,f=l.y1-t;p<u&&(u=p=(u+p)/2),f<h&&(h=f=(h+f)/2),l.x0=u,l.y0=h,l.x1=p,l.y1=f}}return a.round=function(i){return arguments.length?(s=!!i,a):s},a.size=function(i){return arguments.length?(e=+i[0],r=+i[1],a):[e,r]},a.padding=function(i){return arguments.length?(t=+i,a):t},a}var jr=De,yr=1,Pr=4;function Cr(e){return jr(e,yr|Pr)}var Ar=Cr;const Ir=Ne(Ar);function te(){return te=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},te.apply(this,arguments)}var d={id:"id",value:"value",cornerRadius:0,layers:["arcs","arcLabels"],colors:{scheme:"nivo"},colorBy:"id",inheritColorFromParent:!0,childColor:{from:"color"},borderWidth:1,borderColor:"white",enableArcLabels:!1,arcLabel:"formattedValue",arcLabelsRadiusOffset:.5,arcLabelsSkipAngle:0,arcLabelsTextColor:{theme:"labels.text.fill"},animate:!0,motionConfig:"gentle",transitionMode:"innerRadius",isInteractive:!0,defs:[],fill:[],tooltip:function(e){var r=e.id,t=e.formattedValue,s=e.color;return n.jsx($e,{id:r,value:t,enableChip:!0,color:s})},role:"img"},Sr=function(e){var r=e.data,t=e.id,s=t===void 0?d.id:t,a=e.value,o=a===void 0?d.value:a,i=e.valueFormat,c=e.radius,l=e.cornerRadius,u=l===void 0?d.cornerRadius:l,h=e.colors,p=h===void 0?d.colors:h,f=e.colorBy,y=f===void 0?d.colorBy:f,P=e.inheritColorFromParent,C=P===void 0?d.inheritColorFromParent:P,S=e.childColor,L=S===void 0?d.childColor:S,N=Be(),I=Ge(p,y),x=He(L,N),m=he(s),D=he(o),T=qe(i),X=j.useMemo(function(){var k,F=Ir(r),E=ae(F).sum(D),V=br().size([2*Math.PI,c*c])(E).descendants().slice(1),$=(k=E.value)!=null?k:0;return We(V,"depth").reduce(function(_,v){var w,Y=m(v.data),O=v.value,B=100*O/$,K=v.ancestors().map(function(M){return m(M.data)}),G={startAngle:v.x0,endAngle:v.x1,innerRadius:Math.sqrt(v.y0),outerRadius:Math.sqrt(v.y1)};v.parent&&(w=_.find(function(M){return M.id===m(v.parent.data)}));var A={id:Y,path:K,value:O,percentage:B,formattedValue:i?T(O):B.toFixed(2)+"%",color:"",arc:G,data:v.data,depth:v.depth,height:v.height};return C&&w&&A.depth>1?A.color=x(w,A):A.color=I(A),[].concat(_,[A])},[])},[r,c,D,m,i,T,I,C,x]);return{arcGenerator:Qe({cornerRadius:u}),nodes:X}},Lr=function(e){var r=e.nodes,t=e.arcGenerator,s=e.centerX,a=e.centerY,o=e.radius;return j.useMemo(function(){return{nodes:r,arcGenerator:t,centerX:s,centerY:a,radius:o}},[r,t,s,a,o])},wr=function(e){var r=e.center,t=e.data,s=e.arcGenerator,a=e.borderWidth,o=e.borderColor,i=e.isInteractive,c=e.onClick,l=e.onMouseEnter,u=e.onMouseMove,h=e.onMouseLeave,p=e.tooltip,f=e.transitionMode,y=ze(),P=y.showTooltipFromEvent,C=y.hideTooltip,S=j.useMemo(function(){if(i)return function(x,m){c==null||c(x,m)}},[i,c]),L=j.useMemo(function(){if(i)return function(x,m){P(j.createElement(p,x),m),l==null||l(x,m)}},[i,P,p,l]),N=j.useMemo(function(){if(i)return function(x,m){P(j.createElement(p,x),m),u==null||u(x,m)}},[i,P,p,u]),I=j.useMemo(function(){if(i)return function(x,m){C(),h==null||h(x,m)}},[i,C,h]);return n.jsx(Xe,{center:r,data:t,arcGenerator:s,borderWidth:a,borderColor:o,transitionMode:f,onClick:S,onMouseEnter:L,onMouseMove:N,onMouseLeave:I})},Or=["isInteractive","animate","motionConfig","theme","renderWrapper"],Mr=function(e){var r=e.data,t=e.id,s=t===void 0?d.id:t,a=e.value,o=a===void 0?d.value:a,i=e.valueFormat,c=e.cornerRadius,l=c===void 0?d.cornerRadius:c,u=e.layers,h=u===void 0?d.layers:u,p=e.colors,f=p===void 0?d.colors:p,y=e.colorBy,P=y===void 0?d.colorBy:y,C=e.inheritColorFromParent,S=C===void 0?d.inheritColorFromParent:C,L=e.childColor,N=L===void 0?d.childColor:L,I=e.borderWidth,x=I===void 0?d.borderWidth:I,m=e.borderColor,D=m===void 0?d.borderColor:m,T=e.margin,X=e.width,k=e.height,F=e.enableArcLabels,E=F===void 0?d.enableArcLabels:F,V=e.arcLabel,$=V===void 0?d.arcLabel:V,_=e.arcLabelsRadiusOffset,v=_===void 0?d.arcLabelsRadiusOffset:_,w=e.arcLabelsSkipAngle,Y=w===void 0?d.arcLabelsSkipAngle:w,O=e.arcLabelsTextColor,B=O===void 0?d.arcLabelsTextColor:O,K=e.arcLabelsComponent,G=e.defs,A=G===void 0?d.defs:G,M=e.fill,fe=M===void 0?d.fill:M,ne=e.transitionMode,se=ne===void 0?d.transitionMode:ne,ie=e.isInteractive,ge=ie===void 0?d.isInteractive:ie,xe=e.onClick,ve=e.onMouseEnter,be=e.onMouseLeave,je=e.onMouseMove,oe=e.tooltip,ye=oe===void 0?d.tooltip:oe,le=e.role,Pe=le===void 0?d.role:le,R=ke(X,k,T),U=R.innerHeight,J=R.innerWidth,Ce=R.margin,Ae=R.outerHeight,Ie=R.outerWidth,Z=j.useMemo(function(){return{radius:Math.min(J,U)/2,centerX:J/2,centerY:U/2}},[U,J]),ee=Z.centerX,re=Z.centerY,ce=Z.radius,de=Sr({data:r,id:s,value:o,valueFormat:i,radius:ce,cornerRadius:l,colors:f,colorBy:P,inheritColorFromParent:S,childColor:N}),ue=de.arcGenerator,H=de.nodes,Se=Fe(A,H,fe,{dataKey:".",colorKey:"color",targetKey:"fill"}),q={arcs:null,arcLabels:null};h.includes("arcs")&&(q.arcs=n.jsx(wr,{center:[ee,re],data:H,arcGenerator:ue,borderWidth:x,borderColor:D,transitionMode:se,isInteractive:ge,tooltip:ye,onClick:xe,onMouseEnter:ve,onMouseLeave:be,onMouseMove:je},"arcs")),E&&h.includes("arcLabels")&&(q.arcLabels=n.jsx(Ee,{center:[ee,re],data:H,label:$,radiusOffset:v,skipAngle:Y,textColor:B,transitionMode:se,component:K},"arcLabels"));
1var Le=Lr({nodes:H,arcGenerator:ue,centerX:ee,centerY:re,radius:ce});return n.jsx(Ve,{width:Ie,height:Ae,defs:Se,margin:Ce,role:Pe,children:h.map(function(W,we){return q[W]!==void 0?q[W]:typeof W=="function"?n.jsx(j.Fragment,{children:j.createElement(W,Le)},we):null})})},Nr=function(e){var r=e.isInteractive,t=r===void 0?d.isInteractive:r,s=e.animate,a=s===void 0?d.animate:s,o=e.motionConfig,i=o===void 0?d.motionConfig:o,c=e.theme,l=e.renderWrapper,u=function(h,p){if(h==null)return{};var f,y,P={},C=Object.keys(h);for(y=0;y<C.length;y++)f=C[y],p.indexOf(f)>=0||(P[f]=h[f]);return P}(e,Or);return n.jsx(Te,{isInteractive:t,animate:a,motionConfig:i,theme:c,renderWrapper:l,children:n.jsx(Mr,te({isInteractive:t},u))})};const pe=["rgb(232, 193, 160)","rgb(244, 117, 96)","rgb(241, 225, 91)","rgb(232, 168, 56)","rgb(97, 205, 187)","rgb(151, 227, 213)","rgb(141, 211, 199)","rgb(255, 255, 179)","rgb(190, 186, 218)","rgb(251, 128, 114)","rgb(128, 177, 211)","rgb(253, 180, 98);","rgb(179, 222, 105)","rgb(252, 205, 229)","rgb(217, 217, 217)","rgb(188, 128, 189)","rgb(204, 235, 197)","rgb(255, 237, 111)"],_r=(e=0)=>pe[e%pe.length],me=({width:e=900,height:r=500,data:t})=>{var s;return n.jsx(Nr,{width:e,height:r,margin:{top:24,right:24,bottom:80,left:80},id:"name",value:"value",data:t,childColor:(a,o)=>o.data.color||_r(o.data.index),arcLabelsTextColor:a=>a.data.textColor||"black",tooltip:({id:a,value:o})=>n.jsxs("div",{className:"bg-white p-2 border border-gray-200 rounded",children:[a,": ",o]}),colors:(s=t.children)==null?void 0:s.map(({color:a})=>a),enableArcLabels:!0,arcLabel:a=>a.data.label||`${a.id} (${a.value})`,animate:!1})},Rr={getAffectation:async(e,r)=>await b({path:"/affectation/{sessionId}/{type}",method:"GET",params:{sessionId:e,type:r},target:"API_V2"})(),getSimulationAnalytics:async e=>await b({path:"/affectation/simulation/hts/{id}/analytics",method:"GET",params:{id:e},target:"API_V2"})(),postSimulationAffectationHTSMetropole:async(e,{niveauScolaires:r,departements:t,etranger:s,affecterPDR:a,sdrImportId:o})=>await b({path:"/affectation/{sessionId}/simulation/hts",method:"POST",params:{sessionId:e},payload:{niveauScolaires:r,departements:t,etranger:s,affecterPDR:a,sdrImportId:o},target:"API_V2"})(),postSimulationAffectationHTSDromCom:async(e,{niveauScolaires:r,departements:t,etranger:s})=>await b({path:"/affectation/{sessionId}/simulation/hts-dromcom",method:"POST",params:{sessionId:e},payload:{niveauScolaires:r,departements:t,etranger:s},target:"API_V2"})(),postSimulationAffectationCLEMetropole:async(e,{departements:r,etranger:t})=>await b({path:"/affectation/{sessionId}/simulation/cle",method:"POST",params:{sessionId:e},payload:{departements:r,etranger:t},target:"API_V2"})(),postSimulationAffectationCLEDromCom:async(e,{departements:r,etranger:t})=>await b({path:"/affectation/{sessionId}/simulation/cle-dromcom",method:"POST",params:{sessionId:e},payload:{departements:r,etranger:t},target:"API_V2"})(),postValiderAffectationHtsMetropole:async(e,r,{affecterPDR:t})=>await b({path:"/affectation/{sessionId}/simulation/{simulationId}/valider/hts",method:"POST",params:{sessionId:e,simulationId:r},payload:{affecterPDR:t},target:"API_V2"})(),postValiderAffectationCleMetropole:async(e,r)=>await b({path:"/affectation/{sessionId}/simulation/{simulationId}/valider/cle",method:"POST",params:{sessionId:e,simulationId:r},target:"API_V2"})(),postValiderAffectationCleDromCom:async(e,r)=>await b({path:"/affectation/{sessionId}/simulation/{simulationId}/valider/cle-dromcom",method:"POST",params:{sessionId:e,simulationId:r},target:"API_V2"})(),postValiderAffectationHtsDromCom:async(e,r)=>await b({path:"/affectation/{sessionId}/simulation/{simulationId}/valider/hts-dromcom",method:"POST",params:{sessionId:e,simulationId:r},target:"API_V2"})(),postSyncPlacesLigneDeBus:async e=>await b({path:"/affectation/{sessionId}/ligne-de-bus/sync-places",method:"POST",params:{sessionId:e},target:"API_V2"})(),postSyncPlacesCentres:async e=>await b({path:"/affectation/{sessionId}/centre/sync-places",method:"POST",params:{sessionId:e},target:"API_V2"})(),postSyncPlacesCentre:async(e,r)=>await b({path:"/affectation/{sessionId}/centre/{centreId}/sync-places",method:"POST",params:{sessionId:e,centreId:r},target:"API_V2"})()};function Dr(){return n.jsxs("section",{className:"break-after-page p-8",children:[n.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Lecture du rapport :"}),n.jsx("p",{className:"mb-2",children:"Le rapport est ordonné par région. Pour chaque région des statistiques sont afichées pour les centres concernés. Chaque page affiche les statistiques d'un centre ordonnées comme suit :"}),n.jsxs("ul",{children:[n.jsxs("li",{children:["Statistique sur le centre c
1oncernant (affichées en %) :",n.jsxs("ul",{className:"ml-4",children:[n.jsx("li",{children:"Taux de remplissage : Prises = places prises, Restantes = Places restantes."}),n.jsx("li",{children:"Genre : répartition des garçons et des filles. "}),n.jsx("li",{children:"QPV- : NE venant PAS d'un quartier prioritaire. QPV+ : venant d'un quartier prioritaire. "}),n.jsx("li",{children:"PSH- : PAS en situation de handicap. PSH+ : en situation de handicap."})]})]}),n.jsxs("li",{children:["Statistique liée aux lignes allant au centre (valeurs absolues) :",n.jsxs("ul",{className:"ml-4",children:[n.jsx("li",{children:"Cercle central : nombre de places prises (vert) et nombre de places restantes (rouge). "}),n.jsx("li",{children:"Couronne extérieure : Lignes (id) et nombre de places prises pour le centre."})]})]}),n.jsxs("li",{children:["Statistique liée aux remplissages des lignes (valeurs absolues) :",n.jsxs("ul",{className:"ml-4",children:[n.jsx("li",{children:"Cercle central : Foncé = places prises, Clair = places restantes. "}),n.jsx("li",{children:"Couronne : Pour le nombre de places restantes, affiche en rouge le nombre de jeunes disponibles pouvant théoriquement être affectés sur la ligne (même département)."})]})]})]})]})}function Tr({analytics:e}){const r=e.iterationCostList||[e.selectedCost];return n.jsxs("section",{className:"break-after-page p-8",children:[n.jsx("h1",{className:"text-3xl font-bold text-center mb-4",children:"Rapport d'affectations aléatoires"}),n.jsx("p",{className:"text-xl text-center mb-16",children:Ke(e==null?void 0:e.createdAt)}),n.jsx("div",{className:"mb-2",children:"Statuts des jeunes :"}),n.jsxs("ul",{className:"ml-4 mb-4",children:[n.jsxs("li",{children:["Affectés : ",e==null?void 0:e.jeunesNouvellementAffected]}),n.jsxs("li",{children:["En attente d'affectation : ",e==null?void 0:e.jeuneAttenteAffectation]})]}),n.jsx("p",{className:"mb-4",children:"Itérations : "}),n.jsx("div",{className:"flex justify-center",children:n.jsx(Ze,{xLabel:"Itérations",yLabel:"Erreur",selected:e.selectedCost,points:r.map((t,s)=>({x:s,y:t}))})})]})}function kr({centre:e}){return n.jsxs("div",{children:[n.jsxs("h2",{className:"text-xl font-bold mb-6",children:[e.nom," : ",e.departement," ",e.ville," ",e.codePostal]}),!e.placesTotal&&"Le centre n'a pas de places définies",n.jsx("div",{className:"flex flex-col items-center",children:!!e.placesTotal&&n.jsxs("div",{className:"flex",children:[!!e.placesTotal&&n.jsx(Q,{width:290,height:200,isPourcent:!0,data:[{color:e.placesOccupees===0?"red":g.red,label:"Restantes",value:(e.placesRestantes||0)/e.placesTotal},{color:g.green,label:"Prises",value:(e.placesOccupees||0)/e.placesTotal}]}),e.tauxGarcon!==null&&e.tauxFille!==null&&n.jsx(Q,{width:320,height:200,isPourcent:!0,data:[{color:e.placesOccupees===0?"red":g.green2,label:"Garçon",value:e.tauxGarcon},{color:e.placesOccupees===0?"red":g.red2,label:"Filles",value:e.tauxFille}]}),e.tauxQVP!==null&&n.jsx(Q,{width:290,height:200,isPourcent:!0,data:[{color:e.placesOccupees===0?"red":g.green2,label:"QVP+",value:e.tauxQVP},{color:e.placesOccupees===0?"red":g.red2,label:"QVP-",value:1-e.tauxQVP}]}),e.tauxPSH!==null&&n.jsx(Q,{width:290,height:200,isPourcent:!0,data:[{color:e.placesOccupees===0?"red":g.green2,label:"PSH+",value:e.tauxPSH},{color:e.placesOccupees===0?"red":g.red2,label:"PSH-",value:1-e.tauxPSH}]})]})}),!!e.placesTotal&&n.jsxs(n.Fragment,{children:[n.jsx("h3",{className:"text-lg mb-6",children:"Détail remplissage du centre : "}),n.jsxs("div",{className:"flex flex-col items-center",children:[n.jsx("div",{children:e.id}),n.jsx(me,{width:500,height:500,data:{name:e.id,children:[{name:"Restantes",value:e.placesRestantes||0,color:e.placesOccupees===0?"red":g.red},{name:"Prises",color:e.placesOccupees===0?"red":g.green,children:e.lignesDeBus.map((r,t)=>({name:r.numeroLigne,value:r.placesOccupees||0,index:t}))}]}})]})]})]})}function Fr({centre:e}){return e.lignesDeBus.length===0?"Le centre n'a pas de ligne de bus associée.":n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg mb-6",children:"Détail remplissage de(s) ligne(s) :"}),n.jsx("div",{className:"flex gap-2",children:e.lignesDeBus.map(r=>n.jsxs("div",{className:"flex flex-col items-center",children:[n.jsx("label",{children:r.numeroLigne}),n.jsx(me,{width:250,height:200,data:{name:r.numeroLigne,children:[{color:r.placesOccupees===0?"red":g.red,textColor:"white",label:String(r.placesRestances),name:"Restantes",children:[{label:String(r.nonAffectesMemeDepartement),name:String(r.nonAffectesMemeDepartement),value:r.placesRestances||0,color:r.nonAffectesMemeDepartement>0?g.red3:g.green3,textColor:r.nonAffectesMemeDepartement>0?g.red:"black"}]},{color:g.green,name:"Prises",label:String(r.placesOccupees),value:r.placesOccupees||0}]}})]},r.numeroLigne))})]})}function Er({analytics:e}){var r;return n.jsxs("section",{className:"break-after-page p-8",children:[n.jsx("h2",{className:"text-xl mb-8",children:"Informations concernant les non affectés :"}),n.jsxs("ul",{className:"mb-2",children:[n.jsxs("li",{children:[e.summary.find(t=>t.includes("jeunes probablement hors zones")),n.jsx("div",{className:"ml-4",children:e.summary.find(t=>t.includes("départements hors zones"))})]}),n.jsx("li",{children:e.summary.find(t=>t.includes("pas de ligne disponible"))}),n.jsx("li",{children:e.summary.find(t=>t.includes("pas de centre disponible"))}),n.jsx("li",{children:e.summary.find(t=>t.includes("problèmes de places"))})]}),(r=e.jeunesProblemeDePlaces)==null?void 0:r.map(t=>n.jsxs(j.Fragment,{children:[n.jsxs("div",{className:"ml-8",children:[t.id," - ",t.departement," :"]}),n.jsx("div",{className:"ml-12 mb-2",children:t.detail})]},t.id))]})}function it(){const{id:e}=Je(),r=Oe(o=>o.Cohorts),{isFetching:t,error:s,data:a}=Me({queryKey:["phase-simulations"],queryFn:async()=>Rr.getSimulationAnalytics(e),refetchOnWindowFocus:!1});return j.useEffect(()=>{var o,i,c,l;if(a!=null&&a.sessionId){const u=(i=(o=r.find(p=>p._id===a.sessionId))==null?void 0:o.name)==null?void 0:i.replaceAll(" ",""),h=(l=(c=a.createdAt)==null?void 0:c.replaceAll(":","-"))==null?void 0:l.replace(".","-");document.title=`rapport_${u}_${h}`}},[a==null?void 0:a.sessionId]),n.jsxs("div",{className:"p-12",children:[t&&n.jsx("div",{className:"flex items-center justify-center h-screen-1/4",children:n.jsx(Ue,{})}),s&&"Une erreur est survenue",!t&&!s&&a&&n.jsxs("div",{children:[n.jsx(Ye,{title:"Imprimer le rapport",onClick:()=>window.print(),className:"fixed top-4 right-4 print:hidden"}),n.jsx(Tr,{analytics:a}),n.jsx(Dr,{}),(a==null?void 0:a.regions)&&Object.keys(a.regions).map(o=>n.jsxs("section",{className:"break-after-page p-8",children:[n.jsx("h2",{className:"text-4xl font-bold mb-16 uppercase",children:o}),a.regions[o].map(i=>n.jsxs("section",{className:"break-after-page",children:[n.jsx(kr,{centre:i}),n.jsx(Fr,{centre:i})]},i.id))]},o)),n.jsx(Er,{analytics:a})]})]})}export{it as default}; 2//# sourceMappingURL=RapportPdfPage-BH4PTxER.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.