1 line
17 KiB
JavaScript
1 line
17 KiB
JavaScript
(()=>{var e={};e.id=4504,e.ids=[4504],e.modules={2117:(e,s,r)=>{"use strict";r.d(s,{A:()=>t});let t=(0,r(62688).A)("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]])},3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},10926:(e,s,r)=>{Promise.resolve().then(r.bind(r,99169))},11723:e=>{"use strict";e.exports=require("querystring")},12412:e=>{"use strict";e.exports=require("assert")},14985:e=>{"use strict";e.exports=require("dns")},19121:e=>{"use strict";e.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:e=>{"use strict";e.exports=require("os")},24791:(e,s,r)=>{Promise.resolve().then(r.bind(r,80982))},27910:e=>{"use strict";e.exports=require("stream")},28354:e=>{"use strict";e.exports=require("util")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:e=>{"use strict";e.exports=require("path")},34631:e=>{"use strict";e.exports=require("tls")},41204:e=>{"use strict";e.exports=require("string_decoder")},41312:(e,s,r)=>{"use strict";r.d(s,{A:()=>t});let t=(0,r(62688).A)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},50246:(e,s,r)=>{Promise.resolve().then(r.bind(r,72995))},55511:e=>{"use strict";e.exports=require("crypto")},55591:e=>{"use strict";e.exports=require("https")},57209:(e,s,r)=>{"use strict";r.r(s),r.d(s,{GlobalError:()=>n.a,__next_app__:()=>m,pages:()=>c,routeModule:()=>u,tree:()=>o});var t=r(65239),i=r(48088),a=r(88170),n=r.n(a),l=r(30893),d={};for(let e in l)0>["default","tree","pages","GlobalError","__next_app__","routeModule"].indexOf(e)&&(d[e]=()=>l[e]);r.d(s,d);let o={children:["",{children:["missions",{children:["[missionId]",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(r.bind(r,72995)),"/Users/alma/Documents/NeahNew/app/missions/[missionId]/page.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(r.bind(r,69560)),"/Users/alma/Documents/NeahNew/app/missions/layout.tsx"]}]},{layout:[()=>Promise.resolve().then(r.bind(r,58014)),"/Users/alma/Documents/NeahNew/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(r.t.bind(r,57398,23)),"next/dist/client/components/not-found-error"],forbidden:[()=>Promise.resolve().then(r.t.bind(r,89999,23)),"next/dist/client/components/forbidden-error"],unauthorized:[()=>Promise.resolve().then(r.t.bind(r,65284,23)),"next/dist/client/components/unauthorized-error"]}]}.children,c=["/Users/alma/Documents/NeahNew/app/missions/[missionId]/page.tsx"],m={require:r,loadChunk:()=>Promise.resolve()},u=new t.AppPageRouteModule({definition:{kind:i.RouteKind.APP_PAGE,page:"/missions/[missionId]/page",pathname:"/missions/[missionId]",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:o}})},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64543:(e,s,r)=>{Promise.resolve().then(r.bind(r,69560))},69560:(e,s,r)=>{"use strict";r.r(s),r.d(s,{default:()=>t});let t=(0,r(12907).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/alma/Documents/NeahNew/app/missions/layout.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/alma/Documents/NeahNew/app/missions/layout.tsx","default")},70333:(e,s,r)=>{"use strict";r.d(s,{dj:()=>u,oR:()=>m});var t=r(43210);let i=0,a=new Map,n=e=>{if(a.has(e))return;let s=setTimeout(()=>{a.delete(e),c({type:"REMOVE_TOAST",toastId:e})},1e6);a.set(e,s)},l=(e,s)=>{switch(s.type){case"ADD_TOAST":return{...e,toasts:[s.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===s.toast.id?{...e,...s.toast}:e)};case"DISMISS_TOAST":{let{toastId:r}=s;return r?n(r):e.toasts.forEach(e=>{n(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===r||void 0===r?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===s.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==s.toastId)}}},d=[],o={toasts:[]};function c(e){o=l(o,e),d.forEach(e=>{e(o)})}function m({...e}){let s=(i=(i+1)%Number.MAX_SAFE_INTEGER).toString(),r=()=>c({type:"DISMISS_TOAST",toastId:s});return c({type:"ADD_TOAST",toast:{...e,id:s,open:!0,onOpenChange:e=>{e||r()}}}),{id:s,dismiss:r,update:e=>c({type:"UPDATE_TOAST",toast:{...e,id:s}})}}function u(){let[e,s]=t.useState(o);return t.useEffect(()=>(d.push(s),()=>{let e=d.indexOf(s);e>-1&&d.splice(e,1)}),[e]),{...e,toast:m,dismiss:e=>c({type:"DISMISS_TOAST",toastId:e})}}},72995:(e,s,r)=>{"use strict";r.r(s),r.d(s,{default:()=>t});let t=(0,r(12907).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/alma/Documents/NeahNew/app/missions/[missionId]/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/alma/Documents/NeahNew/app/missions/[missionId]/page.tsx","default")},74075:e=>{"use strict";e.exports=require("zlib")},78464:(e,s,r)=>{"use strict";r.d(s,{A:()=>t});let t=(0,r(62688).A)("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]])},79428:e=>{"use strict";e.exports=require("buffer")},79551:e=>{"use strict";e.exports=require("url")},80982:(e,s,r)=>{"use strict";r.r(s),r.d(s,{default:()=>l});var t=r(60687);r(43210);var i=r(85814),a=r.n(i),n=r(16189);function l({children:e}){let s=(0,n.usePathname)();return(0,t.jsx)("main",{className:"w-full h-screen bg-white",children:(0,t.jsxs)("div",{className:"w-full h-full px-4 pt-12 pb-4 flex",children:[(0,t.jsxs)("div",{className:"w-[234px] min-w-[234px] bg-pink-50 border-r border-gray-100 overflow-y-auto",children:[(0,t.jsxs)("div",{className:"bg-pink-50 py-4 px-6 border-b border-pink-100",children:[(0,t.jsx)("h2",{className:"text-lg font-medium text-gray-800",children:"CAP"}),(0,t.jsx)("p",{className:"text-xs text-gray-600",children:"Centre d'Administration et de Pilotage"})]}),(0,t.jsxs)("nav",{className:"mt-4",children:[(0,t.jsx)(a(),{href:"/missions",passHref:!0,children:(0,t.jsx)("div",{className:`px-6 py-[10px] ${"/missions"===s?"bg-white":""} hover:bg-white`,children:(0,t.jsx)("span",{className:"text-sm font-normal text-gray-700",children:"Mes Missions"})})}),(0,t.jsx)(a(),{href:"/missions/new",passHref:!0,children:(0,t.jsx)("div",{className:`px-6 py-[10px] ${"/missions/new"===s?"bg-white":""} hover:bg-white`,children:(0,t.jsx)("span",{className:"text-sm font-normal text-gray-700",children:"Nouvelle Mission"})})})]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto bg-white",children:e})]})})}},81630:e=>{"use strict";e.exports=require("http")},83997:e=>{"use strict";e.exports=require("tty")},88233:(e,s,r)=>{"use strict";r.d(s,{A:()=>t});let t=(0,r(62688).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},91645:e=>{"use strict";e.exports=require("net")},94735:e=>{"use strict";e.exports=require("events")},97499:(e,s,r)=>{"use strict";r.d(s,{A:()=>t});let t=(0,r(62688).A)("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]])},97992:(e,s,r)=>{"use strict";r.d(s,{A:()=>t});let t=(0,r(62688).A)("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]])},99169:(e,s,r)=>{"use strict";r.r(s),r.d(s,{default:()=>g});var t=r(60687),i=r(43210),a=r(24934),n=r(40228),l=r(97992),d=r(41312),o=r(48730),c=r(2117),m=r(97499),u=r(78464),p=r(88233),x=r(70333),h=r(16189);function g(){let[e,s]=(0,i.useState)(null),[r,g]=(0,i.useState)(!0),[f,b]=(0,i.useState)(!1),{toast:y}=(0,x.dj)(),v=(0,h.useParams)(),j=(0,h.useRouter)(),N=v.missionId,w=async()=>{if(confirm("\xcates-vous s\xfbr de vouloir supprimer cette mission ? Cette action est irr\xe9versible."))try{if(b(!0),!(await fetch(`/api/missions/${N}`,{method:"DELETE"})).ok)throw Error("Failed to delete mission");y({title:"Mission supprim\xe9e",description:"La mission a \xe9t\xe9 supprim\xe9e avec succ\xe8s"}),j.push("/missions")}catch(e){console.error("Error deleting mission:",e),y({title:"Erreur",description:"Impossible de supprimer la mission",variant:"destructive"})}finally{b(!1)}};if(r)return(0,t.jsx)("div",{className:"flex justify-center items-center min-h-screen bg-gray-50",children:(0,t.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-blue-600"})});if(!e)return(0,t.jsx)("div",{className:"flex justify-center items-center min-h-screen bg-gray-50 px-4",children:(0,t.jsxs)("div",{className:"text-center bg-white p-8 rounded-lg shadow-sm border border-gray-200 max-w-md",children:[(0,t.jsx)("h2",{className:"text-xl font-semibold text-gray-800 mb-2",children:"Mission non trouv\xe9e"}),(0,t.jsx)("p",{className:"text-gray-600 mb-6",children:"Cette mission n'existe pas ou a \xe9t\xe9 supprim\xe9e."}),(0,t.jsx)(a.$,{onClick:()=>window.history.back(),className:"bg-blue-600 hover:bg-blue-700 text-white",children:"Retour aux missions"})]})});let A=(e=>{let s=e&&e.length>0?e[0]:null,r=s?s.replace("odd-",""):null;return{number:r,label:r?`ODD ${r}`:"Non cat\xe9goris\xe9",iconPath:r?`/F SDG Icons 2019 WEB/F-WEB-Goal-${r.padStart(2,"0")}.png`:""}})(e.oddScope);return(0,t.jsxs)("div",{className:"bg-gray-50 min-h-screen p-6",children:[(0,t.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-gray-100 mb-6 p-6",children:(0,t.jsxs)("div",{className:"flex justify-between items-start",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:e.name}),(0,t.jsx)("div",{className:"flex items-center text-gray-500 text-sm gap-4",children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(n.A,{className:"h-4 w-4 mr-1"}),new Date(e.createdAt).toLocaleDateString("fr-FR",{day:"2-digit",month:"long",year:"numeric"})]})})]}),(0,t.jsx)("div",{className:"w-24 h-24 rounded-md overflow-hidden flex-shrink-0",children:e.logoUrl?(0,t.jsx)("img",{src:e.logoUrl,alt:e.name,className:"w-full h-full object-cover rounded-md",onError:s=>{console.log("Logo failed to load:",e.logoUrl),s.currentTarget.style.display="none";let r=s.currentTarget.parentElement;r&&(r.classList.add("bg-gray-100"),r.classList.add("flex"),r.classList.add("items-center"),r.classList.add("justify-center"),r.innerHTML=`<span class="text-2xl font-medium text-gray-400">${e.name.slice(0,2).toUpperCase()}</span>`)}}):(0,t.jsx)("div",{className:"w-full h-full bg-gray-100 flex items-center justify-center",children:(0,t.jsx)("span",{className:"text-2xl font-medium text-gray-400",children:e.name.slice(0,2).toUpperCase()})})})]})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-6",children:[(0,t.jsxs)("div",{className:"bg-white rounded-lg p-4 flex items-center shadow-sm border border-gray-100",children:[(0,t.jsx)("div",{className:"bg-amber-50 p-3 rounded-full mr-3",children:(0,t.jsx)(l.A,{className:"h-5 w-5 text-amber-600"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm text-gray-500 font-medium",children:"Type de mission"}),(0,t.jsx)("p",{className:"text-gray-800 font-medium",children:(e=>{switch(e){case"remote":return"\xc0 distance";case"onsite":return"Sur site";case"hybrid":return"Hybride";default:return e}})(e.missionType)})]})]}),(0,t.jsxs)("div",{className:"bg-white rounded-lg p-4 flex items-center shadow-sm border border-gray-100",children:[(0,t.jsx)("div",{className:"bg-blue-50 p-3 rounded-full mr-3",children:(0,t.jsx)(d.A,{className:"h-5 w-5 text-blue-600"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm text-gray-500 font-medium",children:"Donneur d'ordre"}),(0,t.jsx)("p",{className:"text-gray-800 font-medium",children:e.donneurDOrdre||"Non sp\xe9cifi\xe9"})]})]}),(0,t.jsxs)("div",{className:"bg-white rounded-lg p-4 flex items-center shadow-sm border border-gray-100",children:[(0,t.jsx)("div",{className:"bg-green-50 p-3 rounded-full mr-3",children:(0,t.jsx)(o.A,{className:"h-5 w-5 text-green-600"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm text-gray-500 font-medium",children:"Dur\xe9e"}),(0,t.jsx)("p",{className:"text-gray-800 font-medium",children:(e=>{switch(e){case"short":return"< 1 mois";case"medium":return"1-3 mois";case"long":return"> 3 mois";default:return e}})(e.projection)})]})]}),(0,t.jsxs)("div",{className:"bg-white rounded-lg p-4 flex items-center shadow-sm border border-gray-100",children:[(0,t.jsx)("div",{className:"bg-purple-50 p-3 rounded-full mr-3",children:(0,t.jsx)(c.A,{className:"h-5 w-5 text-purple-600"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm text-gray-500 font-medium",children:"Niveau"}),(0,t.jsx)("p",{className:"text-gray-800 font-medium",children:(e=>{switch(e){case"a":return"Apprentissage";case"b":return"Basique";case"c":return"Complexe";case"s":return"Sp\xe9cial";default:return e}})(e.niveau)})]})]}),(0,t.jsxs)("div",{className:"bg-white rounded-lg p-4 flex items-center shadow-sm border border-gray-100",children:[(0,t.jsx)("div",{className:"bg-indigo-50 p-3 rounded-full mr-3",children:(0,t.jsx)(m.A,{className:"h-5 w-5 text-indigo-600"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm text-gray-500 font-medium",children:"Participation"}),(0,t.jsx)("p",{className:"text-gray-800 font-medium",children:e.participation||"Non sp\xe9cifi\xe9"})]})]}),A.number&&(0,t.jsxs)("div",{className:"bg-white rounded-lg p-4 flex items-center shadow-sm border border-gray-100",children:[(0,t.jsx)("div",{className:"bg-red-50 p-3 rounded-full mr-3 flex items-center justify-center",children:(0,t.jsx)("img",{src:A.iconPath,alt:A.label,className:"h-8 w-8"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm text-gray-500 font-medium",children:"Objectif"}),(0,t.jsx)("p",{className:"text-gray-800 font-medium",children:"D\xe9veloppement durable"})]})]})]}),(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow-sm border border-gray-100 mb-6 p-6",children:[(0,t.jsx)("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:"Description de la mission"}),(0,t.jsx)("div",{className:"text-gray-700 whitespace-pre-wrap",children:e.intention||"Aucune description disponible pour cette mission."})]}),e.attachments&&e.attachments.length>0&&(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow-sm border border-gray-100 mb-6 p-6",children:[(0,t.jsx)("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:"Documents"}),(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:e.attachments.map(e=>(0,t.jsxs)("a",{href:e.publicUrl,target:"_blank",rel:"noopener noreferrer",className:"bg-green-50 p-4 rounded-lg flex flex-col hover:bg-green-100 transition-colors",children:[(0,t.jsx)("div",{className:"text-green-700 mb-2",children:(0,t.jsx)(u.A,{className:"h-10 w-10"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium text-gray-800 mb-1 truncate",children:e.filename}),(0,t.jsx)("p",{className:"text-sm text-gray-500",children:e.fileType.split("/")[1]?.toUpperCase()||"Fichier"})]})]},e.id))})]}),e.profils&&e.profils.length>0&&(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow-sm border border-gray-100 mb-6 p-6",children:[(0,t.jsx)("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:"Profils recherch\xe9s"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.profils.map((e,s)=>(0,t.jsx)("span",{className:"bg-red-50 text-red-800 px-3 py-2 rounded-full text-sm",children:e},s))})]}),e.services&&e.services.length>0&&(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow-sm border border-gray-100 mb-6 p-6",children:[(0,t.jsx)("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:"Services"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.services.map((e,s)=>(0,t.jsx)("span",{className:"bg-blue-50 text-blue-800 px-3 py-2 rounded-full text-sm",children:e},s))})]}),(0,t.jsx)("div",{className:"flex justify-end gap-4 mb-8",children:(0,t.jsxs)(a.$,{variant:"outline",className:"flex items-center gap-2 border-red-600 text-red-600 hover:bg-red-50 bg-white",onClick:w,disabled:f,children:[f?(0,t.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-t-2 border-b-2 border-red-600"}):(0,t.jsx)(p.A,{className:"h-4 w-4"}),"Supprimer"]})})]})}}};var s=require("../../../webpack-runtime.js");s.C(e);var r=e=>s(s.s=e),t=s.X(0,[4243,5419,8794,1642,6724,748,6781,5500],()=>r(57209));module.exports=t})(); |