PageSourceSearch

https://facilearn.com/_next/static/chunks/app/%5Blocale%5D/panier/page-e8fdf1c56ce60fe3.js

js facilearn.com collected 2026-10-04 18:16:15 UTC 24,116 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7047],{7251:(e,t,n)=>{"use strict";n.d(t,{$k:()=>m,Ah:()=>v,Fy:()=>i,IE:()=>j,TY:()=>d,Tg:()=>y,VY:()=>u,_$:()=>k,bE:()=>l,dt:()=>c,fu:()=>h,n1:()=>s,pq:()=>p,qV:()=>g,vM:()=>x,vh:()=>b});var o=n(28410);let r=(0,n(9386).c)("https://api.facilearn.com/api/v1","http://localhost:4000/api/v1");async function a(e,t){let{method:n="GET",body:a,token:i,currency:l=(0,o.k3)()}=t,c=e.includes("?")?"&":"?";try{let t=await fetch("".concat(r).concat(e).concat(c,"currency=").concat(l),{method:n,credentials:"include",headers:{"Content-Type":"application/json",...i?{Authorization:"Bearer ".concat(i)}:{}},body:void 0===a?void 0:JSON.stringify(a)}),o=await t.json().catch(()=>({}));if(!t.ok){let e=Array.isArray(null==o?void 0:o.message)?o.message[0]:null==o?void 0:o.message;return{ok:!1,message:null!=e?e:"Une erreur est survenue."}}return{ok:!0,cart:o}}catch(e){return{ok:!1,message:"Le service est momentan\xe9ment injoignable."}}}let i=(e,t)=>a("/cart",{token:e,currency:t}),l=(e,t,n,o)=>a("/cart/items/".concat(encodeURIComponent(e)),{method:"POST",body:null!=o?o:{},token:t,currency:n}),c=(e,t,n)=>a("/cart/items/".concat(encodeURIComponent(e)),{method:"DELETE",token:t,currency:n}),s=(e,t,n,o)=>a("/cart/items/".concat(encodeURIComponent(e)),{method:"PATCH",body:{savedForLater:t},token:n,currency:o}),u=(e,t,n)=>a("/cart/coupon",{method:"POST",body:{code:e},token:t,currency:n}),d=(e,t)=>a("/cart/coupon",{method:"DELETE",token:e,currency:t});async function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{method:n="GET",body:o,token:a}=t;try{let t=await fetch("".concat(r).concat(e),{method:n,credentials:"include",headers:{"Content-Type":"application/json",...a?{Authorization:"Bearer ".concat(a)}:{}},body:void 0===o?void 0:JSON.stringify(o)}),i=await t.json().catch(()=>({}));if(!t.ok){let e=Array.isArray(null==i?void 0:i.message)?i.message[0]:null==i?void 0:i.message;return{ok:!1,message:null!=e?e:"Une erreur est survenue."}}return{ok:!0,data:i}}catch(e){return{ok:!1,message:"Le service est momentan\xe9ment injoignable."}}}let h=(e,t,n,o)=>f("/checkout?currency=".concat(t,"&country=").concat(encodeURIComponent(n),"&locale=").concat(o),{token:e}),m=e=>f("/checkout/code",{method:"POST",body:{email:e}}),p=(e,t)=>f("/checkout/code/verify",{method:"POST",body:{email:e,code:t}}),y=(e,t,n)=>f("/checkout/pay?currency=".concat(n),{method:"POST",body:e,token:t}),x=(e,t,n,o)=>f("/checkout/reglement-local?currency=".concat(t,"&pays=").concat(encodeURIComponent(n),"&operateur=").concat(encodeURIComponent(o)),{token:e}),g=(e,t,n)=>f("/checkout/intention?currency=".concat(n),{method:"POST",body:e,token:t}),v=(e,t)=>f("/checkout/confirmer",{method:"POST",body:{intentionId:e},token:t}),b=(e,t,n)=>f("/checkout/redirection?currency=".concat(n),{method:"POST",body:e,token:t}),j=(e,t)=>f("/checkout/retour",{method:"POST",body:{reference:e},token:t}),k=(e,t,n)=>f("/checkout/mobile-money?currency=".concat(n),{method:"POST",body:e,token:t})},16778:(e,t,n)=>{Promise.resolve().then(n.bind(n,29041))},28410:(e,t,n)=>{"use strict";n.d(t,{$u:()=>a,J4:()=>s,Uc:()=>l,k3:()=>c,nL:()=>r});let o="fl_currency",r=["EUR","USD","GBP","CHF"],a="USD",i=new Set("AT BE HR CY EE FI FR DE GR IE IT LV LT LU MT NL PT SK SI ES AD MC SM VA ME XK".split(" "));function l(e){if(!e)return a;let t=e.toUpperCase();return"GB"===t?"GBP":"CH"===t||"LI"===t?"CHF":i.has(t)?"EUR":a}function c(){var e;if("undefined"==typeof document)return a;let t=document.cookie.match(new RegExp("(?:^|; )".concat(o,"=([^;]*)")));return e=t?decodeURIComponent(t[1]):null,r.includes(e)?e:a}function s(e){"undefined"!=typeof document&&(document.cookie="".concat(o,"=").concat(e,"; path=/; max-age=").concat(31536e3,"; samesite=lax"))}},29041:(e,t,n)=>{"use strict";n.d(t,{CartView:()=>f});var o=n(11026),r=n(46938),a=n(29482),i=n(30093),l=n(38246),c=n(98679),s=n(32605),u=n(52966),d=n(35158);function f(){var e,t,n,a,f;let p=(0,i.c)("cart"),y=(0,l.Ym)(),{cart:x,loading:g,remove:v,saveForLater:b,applyCoupon:j,removeCoupon:k}=(0,s._)(),{user:S}=(0,u.A)(),[w,C]=(0,r.useState)(!1),[P,N]=(0,r.useState)(""),[T,I]=(0,r.useState)(null),[F,E]=(0,r.useState)(!1),O
1=null!=(e=null==x?void 0:x.currency)?e:"EUR",z=null!=(t=null==x?void 0:x.items)?t:[],D=null!=(n=null==x?void 0:x.savedForLater)?n:[],L=!g&&0===z.length,R=e=>(0,d.ej)(e,O,y);return(0,o.jsxs)("div",{style:{maxWidth:1200,margin:"0 auto",padding:"clamp(28px, 4vw, 44px) clamp(20px, 4vw, 32px) 64px",width:"100%",boxSizing:"border-box"},children:[(0,o.jsx)("h1",{style:{fontSize:"clamp(24px, 3vw, 32px)",margin:"0 0 24px"},children:p("title")}),(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:36,alignItems:"flex-start"},children:[(0,o.jsxs)("div",{style:{flex:3,minWidth:"min(100%, 340px)"},children:[(0,o.jsx)("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,borderBottom:"1px solid var(--color-divider)",paddingBottom:10,marginBottom:6},children:(0,o.jsx)("span",{style:{fontFamily:"var(--font-heading)",fontWeight:"var(--font-heading-weight)",fontSize:15},children:g?p("loading"):p("count",{count:z.length})})}),L?(0,o.jsxs)("div",{style:{border:"1px solid var(--color-divider)",borderRadius:"var(--radius-md)",background:"var(--color-card)",padding:"clamp(28px, 5vw, 48px)",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:14,marginTop:18},children:[(0,o.jsx)("h2",{style:{margin:0,fontSize:20},children:p("empty.title")}),(0,o.jsx)("p",{style:{margin:0,fontSize:14,color:"var(--color-neutral-700)",maxWidth:"52ch",lineHeight:1.6},children:p("empty.text")}),(0,o.jsx)(c.N_,{href:"/formations",className:"btn btn-primary",style:{textDecoration:"none",fontSize:14,padding:"11px 18px"},children:p("empty.cta")})]}):null,z.map(e=>(0,o.jsx)(m,{item:e,money:R,locale:y,busy:F,onRemove:async()=>{E(!0),await v(e.courseSlug),E(!1)},onSaveForLater:async()=>{E(!0),await b(e.courseSlug,!0),E(!1)}},e.courseSlug)),D.length>0?(0,o.jsxs)("div",{style:{marginTop:36},children:[(0,o.jsx)("h2",{style:{fontSize:20,margin:"0 0 12px"},children:p("saved.title")}),D.map(e=>(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:16,alignItems:"center",padding:"14px 0",borderBottom:"1px solid var(--color-neutral-300)"},children:[(0,o.jsx)(c.N_,{href:{pathname:"/cours/[slug]",params:{slug:e.courseSlug}},className:"fl-course-link",style:{flex:1,minWidth:"min(100%, 200px)",fontSize:14,fontFamily:"var(--font-heading)",fontWeight:"var(--font-heading-weight)",textDecoration:"none"},children:e.title}),(0,o.jsx)("span",{style:{flex:"none",fontSize:14,fontWeight:800,fontVariantNumeric:"tabular-nums"},children:R(e.price)}),(0,o.jsx)("button",{type:"button",disabled:F,onClick:async()=>{E(!0),await b(e.courseSlug,!1),E(!1)},style:h,children:p("saved.moveBack")}),(0,o.jsx)("button",{type:"button",disabled:F,onClick:async()=>{E(!0),await v(e.courseSlug),E(!1)},style:{...h,color:"var(--color-neutral-700)"},children:p("remove")})]},e.courseSlug))]}):null]}),(0,o.jsxs)("aside",{style:{flex:1,minWidth:250,maxWidth:300,position:"sticky",top:94,display:"flex",flexDirection:"column",gap:18},children:[(0,o.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[(0,o.jsx)("span",{style:{fontSize:14,color:"var(--color-neutral-700)"},children:p("total")}),(0,o.jsx)("span",{style:{fontFamily:"var(--font-heading)",fontWeight:"var(--font-heading-weight)",fontSize:40,fontVariantNumeric:"tabular-nums",lineHeight:1.05},children:R(null!=(a=null==x?void 0:x.total)?a:0)}),(null==x?void 0:x.coupon)?(0,o.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"baseline",fontSize:13,color:"var(--color-neutral-700)",flexWrap:"wrap"},children:[(0,o.jsx)("span",{style:{textDecoration:"line-through",fontVariantNumeric:"tabular-nums"},children:R(x.subtotal)}),(0,o.jsx)("span",{style:{color:"var(--color-accent-700)",fontWeight:700,fontVariantNumeric:"tabular-nums"},children:p("couponLine",{code:x.coupon.code,amount:R(x.discount)})})]}):null]}),(0,o.jsx)(c.N_,{href:S?"/checkout":{pathname:"/connexion",query:{redirect:"/panier"}},className:"btn btn-primary btn-block","aria-disabled":0===z.length,style:{textDecoration:"none",justifyContent:"center",fontSize:16,padding:"15px 16px",marginTop:0,opacity:0===z.length?.45:1,pointerEvents:0===z.length?"none":"auto"},children:p("checkout")}),(0,o.jsx)("span",{style:{fontSize:12,color:"var(--color-neutral-600)",marginTop:-8},children:0===z.length?p("checkoutEmptyNote"):p("checkoutNote")}),(0,o.jsx)("div",{style:{height:1,background:"var(--color-divider)"}}),(null==x?void 0:x.coupon)?(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,border:"1px solid var(--color-neutral-400)",borderRadius:"var(--radius-sm)",background:"var(--color-card)",padding:"10px 12px",fontSize:13},children:[(0,o.jsx)("span",{style:{fontFamily:"var(--font-heading)",fontWeight:"var(--font-heading-weight)",letterSpacing:".02em"},children:x.coupon.code}),(0,o.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,o.jsx)("span",{style:{color:"var(--color-accent-700)",fontSize:12.5},children:p("couponApplied",{label:x.coupon.label})}),(0,o.jsx)("button",{type:"button","aria-label":p("couponRemove"),disabled:F,onClick:async()=>{E(!0),await k(),E(!1)},style:{flex:"none",background:"none",border:"none",cursor:"pointer",padding:2,color:"var(--color-neutral-600)",display:"inline-flex"},children:(0,o.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"square",children:(0,o.jsx)("path",{d:"M5 5l14 14M19 5L5 19"})})})]})]}):w?(0,o.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),E(!0);let t=await j(P);I(t.ok?null:t.message),t.ok&&(N(""),C(!1)),E(!1)},style:{display:"flex",flexDirection:"column",gap:8},children:[(0,o.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,o.jsx)("input",{className:"input",value:P,onChange:e=>N(e.target.value),placeholder:p("couponPlaceholder"),"aria-label":p("couponPlaceholder"),style:{flex:1,minWidth:0,fontSize:13,padding:"10px 12px",background:"var(--color-card)"}}),(0,o.jsx)("button",{type:"submit",className:"btn btn-primary",disabled:F,style:{flex:"none",fontSize:13,padding:"10px 14px",justifyContent:"center"},children:p("couponSubmit")})]}),T?(0,o.jsx)("span",{role:"alert",style:{fontSize:12,color:"var(--color-accent-700)"},children:T}):null]}):(0,o.jsx)("button",{type:"button",className:"btn btn-secondary btn-block",onClick:()=>C(!0),style:{justifyContent:"center",fontSize:14,padding:"13px 16px",marginTop:0,borderColor:"var(--color-accent)",color:"var(--color-accent-700)"},children:p("couponOpen")}),(0,o.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:2,fontSize:12,color:"var(--color-neutral-700)",lineHeight:1.4},children:[(0,o.jsx)("span",{children:p("reassurance.payment")}),(0,o.jsx)("span",{children:p("reassurance.guarantee",{jours:null!=(f=null==x?void 0:x.garantieJours)?f:14})})]})]})]})]})}let h={flex:"none",background:"none",border:"none",padding:0,cursor:"pointer",fontFamily:"var(--font-body)",fontSize:12.5,fontWeight:600,color:"var(--color-accent-700)",textDecoration:"underline",textUnderlineOffset:3};function m(e){let{item:t,money:n,locale:r,busy:l,onRemove:s,onSaveForLater:u}=e,f=(0,i.c)("cart");return(0,o.jsxs)("div",{className:"fl-cart-row",style:{padding:"22px 0",borderBottom:"1px solid var(--color-divider)"},children:[(0,o.jsx)("span",{style:{position:"relative",width:124,maxWidth:"100%",height:70,overflow:"hidden",display:"block",background:"var(--color-surface)",borderRadius:"var(--radius-sm)",flex:"none"},children:t.thumbnailUrl?(0,o.jsx)(a.default,{src:t.thumbnailUrl,alt:"",fill:!0,sizes:"124px",style:{objectFit:"cover"}}):null}),(0,o.jsxs)("div",{style:{minWidth:0,display:"flex",flexDirection:"column",gap:8},children:[(0,o.jsx)(c.N_,{href:{pathname:"/cours/[slug]",params:{slug:t.courseSlug}},className:"fl-course-link",style:{textDecoration:"none",fontFamily:"var(--font-heading)",fontWeight:"var(--font-heading-weight)",fontSize:17,lineHeight:1.3},children:t.title}),(0,o.jsx)("span",{style:{fontSize:12.5,color:"var(--color-neutral-700)"},children:f("by",{name:t.instructorName})}),(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px 10px",fontSize:12},children:[t.badge?(0,o.jsx)("span",{className:"tag tag-accent",style:{fontWeight:700},children:t.badge}):null,(0,o.jsxs)("span",{style:{color:"var(--color-neutral-600)",fontVariantNumeric:"tabular-nums"},children:[(0,o.jsx)("strong",{style:{color:"var(--color-accent-700)"},children:(0,d.Xq)(t.rating,r)})," ",(0,o.jsx)("span",{style:{color:"var(--color-accent)",letterSpacing:1}
1,"aria-hidden":!0,children:"★★★★★"})," ",f("meta",{reviews:t.reviewCount,lessons:t.lessonCount,duration:(0,d.a3)(t.totalDurationMin,r)})]})]})]}),(0,o.jsxs)("div",{style:{minWidth:0,display:"flex",flexDirection:"column",alignItems:"flex-end",gap:8,textAlign:"right"},children:[(0,o.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontFamily:"var(--font-heading)",fontWeight:"var(--font-heading-weight)",fontSize:17,color:"var(--color-accent-700)",fontVariantNumeric:"tabular-nums"},children:n(t.price)}),t.fullPrice?(0,o.jsx)("span",{style:{fontSize:12.5,color:"var(--color-neutral-600)",textDecoration:"line-through",fontVariantNumeric:"tabular-nums"},children:n(t.fullPrice)}):null,(0,o.jsx)("button",{type:"button",disabled:l,onClick:s,style:{...h,fontSize:13,textDecoration:"none"},children:f("remove")}),(0,o.jsx)("button",{type:"button",disabled:l,onClick:u,style:{...h,fontSize:13,textDecoration:"none",textAlign:"right",maxWidth:120},children:f("saveForLater")})]})]})}},29482:(e,t,n)=>{"use strict";n.d(t,{default:()=>r.a});var o=n(89689),r=n.n(o)},30093:(e,t,n)=>{"use strict";n.d(t,{c:()=>a,k:()=>i});var o=n(38246);function r(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let a=r(0,o.c3),i=r(0,o.kc)},32605:(e,t,n)=>{"use strict";n.d(t,{CartProvider:()=>c,_:()=>s});var o=n(11026),r=n(46938),a=n(52966),i=n(7251);let l=(0,r.createContext)(null);function c(e){let{children:t}=e,{accessToken:n,loading:c}=(0,a.A)(),[s,u]=(0,r.useState)(null),[d,f]=(0,r.useState)(!0),h=(0,r.useRef)(n);h.current=n;let m=(0,r.useCallback)(async()=>{let e=await (0,i.Fy)(h.current);e.ok&&u(e.cart),f(!1)},[]);(0,r.useEffect)(()=>{c||m()},[c,n,m]);let p=(0,r.useCallback)(async e=>{let t=await e();return t.ok&&u(t.cart),t},[]),y=(0,r.useMemo)(()=>{var e;return{cart:s,count:null!=(e=null==s?void 0:s.count)?e:0,loading:d,contains:e=>!!(null==s?void 0:s.items.some(t=>t.courseSlug===e)),add:(e,t)=>p(()=>(0,i.bE)(e,h.current,void 0,t)),remove:e=>p(()=>(0,i.dt)(e,h.current)),saveForLater:(e,t)=>p(()=>(0,i.n1)(e,t,h.current)),applyCoupon:e=>p(()=>(0,i.VY)(e,h.current)),removeCoupon:()=>p(()=>(0,i.TY)(h.current)),refresh:m}},[s,d,p,m]);return(0,o.jsx)(l.Provider,{value:y,children:t})}function s(){let e=(0,r.useContext)(l);if(!e)throw Error("useCart doit \xeatre utilis\xe9 dans un CartProvider.");return e}},35158:(e,t,n)=>{"use strict";function o(e,t,n){return 0===e?"fr"===n?"Gratuit":"Free":new Intl.NumberFormat(n,{style:"currency",currency:t,maximumFractionDigits:2*(e%1!=0)}).format(e)}function r(e,t,n){return new Intl.NumberFormat(n,{style:"currency",currency:t,maximumFractionDigits:2*(e%1!=0)}).format(e)}function a(e,t,n){let o=Math.abs(e),{valeur:a,suffixe:i}=o>=1e6?{valeur:e/1e6,suffixe:"M"}:o>=1e3?{valeur:e/1e3,suffixe:"K"}:{valeur:e,suffixe:""};if(!i)return r(e,t,n);let l=new Intl.NumberFormat(n,{style:"currency",currency:t,minimumFractionDigits:0,maximumFractionDigits:1}).formatToParts(a),c=new Set(["integer","group","decimal","fraction"]),s=-1;return(l.forEach((e,t)=>{c.has(e.type)&&(s=t)}),s<0)?r(e,t,n):(l.splice(s+1,0,{type:"literal",value:i}),l.map(e=>e.value).join(""))}function i(e,t,n){try{return new Intl.NumberFormat(n,{style:"currency",currency:t}).format(e)}catch(o){return"".concat(new Intl.NumberFormat(n).format(e)," ").concat(t)}}function l(e,t){let n=Math.floor(e/60),o=e%60;return 0===n?new Intl.NumberFormat(t).format(o)+" min":0===o?new Intl.NumberFormat(t).format(n)+" h":"".concat(new Intl.NumberFormat(t).format(n)," h ").concat(String(o).padStart(2,"0"))}function c(e,t){return new Intl.NumberFormat(t,{minimumFractionDigits:1,maximumFractionDigits:1}).format(e)}n.d(t,{$g:()=>o,Ao:()=>i,Kw:()=>a,Xq:()=>c,a3:()=>l,ej:()=>r})},40163:(e,t,n)=>{"use strict";function o(e){return e}n.d(t,{A:()=>o})},52966:(e,t,n)=>{"use strict";n.d(t,{AuthProvider:()=>f,A:()=>h});var o=n(11026),r=n(46938),a=n(37323),i=n(30093),l=n(98679);function c(e){let{raison:t,onFermer:n}=e,r=(0,i.c)("session");return t&&"absente"!==t&&"panne"!==t?(0,o.jsxs)("div",{className:"fl-fin",role:"status","aria-live":"polite",children:[(0,o.jsx)("span",{className:"fl-fin-ico","aria-hidden":!0,
1children:(0,o.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,o.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,o.jsx)("path",{d:"M12 8v5"}),(0,o.jsx)("path",{d:"M12 16h.01"})]})}),(0,o.jsxs)("span",{className:"fl-fin-texte",children:[(0,o.jsx)("strong",{children:r("".concat(t,".title"))}),(0,o.jsx)("span",{children:r("".concat(t,".body"))})]}),(0,o.jsx)(l.N_,{href:"/connexion",className:"btn btn-primary fl-fin-action",onClick:n,children:r("signIn")}),(0,o.jsx)("button",{type:"button",className:"fl-fin-fermer",onClick:n,"aria-label":r("close"),children:(0,o.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round","aria-hidden":!0,children:(0,o.jsx)("path",{d:"M18 6 6 18 M6 6l12 12"})})})]}):null}var s=n(58275),u=n(28410);let d=(0,r.createContext)(null);function f(e){let{children:t}=e,n=(0,a.useRouter)(),[i,l]=(0,r.useState)(null),[f,h]=(0,r.useState)(null),[m,p]=(0,r.useState)(!0),[y,x]=(0,r.useState)(null),g=(0,r.useRef)(null),v=(0,r.useCallback)(e=>{l(e.user),h(e.accessToken)},[]),b=(0,r.useCallback)(e=>{"panne"!==e&&(l(t=>(t&&x(e),null)),h(null))},[]),j=(0,r.useCallback)(async()=>{let e=await (0,s.kY)();return e.ok?(v(e.session),e.session.accessToken):(b(e.raison),null)},[b,v]),k=(0,r.useCallback)(async()=>{await (0,s.ri)(),x(null),l(null),h(null)},[]);(0,r.useEffect)(()=>{let e=!1;return(0,s.kY)().then(t=>{e||(t.ok&&v(t.session),p(!1))}),g.current=setInterval(async()=>{await j()},78e4),()=>{e=!0,g.current&&clearInterval(g.current)}},[v,j]),(0,r.useEffect)(()=>{if(!(null==i?void 0:i.country))return;let e=(0,u.Uc)(i.country);(0,u.k3)()!==e&&((0,u.J4)(e),n.refresh())},[null==i?void 0:i.country,n]);let S=(0,r.useMemo)(()=>({user:i,accessToken:f,loading:m,setSession:v,signOut:k,renouveler:j}),[i,f,m,v,k,j]);return(0,o.jsxs)(d.Provider,{value:S,children:[t,(0,o.jsx)(c,{raison:y,onFermer:()=>x(null)})]})}function h(){let e=(0,r.useContext)(d);if(!e)throw Error("useAuth doit \xeatre utilis\xe9 dans AuthProvider.");return e}},58275:(e,t,n)=>{"use strict";n.d(t,{A$:()=>h,DT:()=>p,F8:()=>m,cE:()=>c,iD:()=>l,kY:()=>s,kz:()=>i,ri:()=>u,w2:()=>d,xw:()=>f});let o=(0,n(9386).c)("https://api.facilearn.com/api/v1","http://localhost:4000/api/v1");async function r(e,t){try{var n;let r=await fetch("".concat(o).concat(e),{...t,credentials:"include",headers:{"Content-Type":"application/json",...null!=(n=null==t?void 0:t.headers)?n:{}}}),a=await r.json().catch(()=>({}));if(!r.ok){let e=Array.isArray(null==a?void 0:a.message)?a.message[0]:null==a?void 0:a.message;return{ok:!1,message:null!=e?e:"Une erreur est survenue."}}return{ok:!0,data:a}}catch(e){return{ok:!1,message:"Le service d'authentification est injoignable."}}}function a(e){if(!e.ok)return{status:"error",message:e.message};if(e.data.twoFactorRequired){var t;return{status:"two-factor",...!1===e.data.expedie?{incident:null!=(t=e.data.incident)?t:null}:{}}}return{status:"ok",data:e.data}}async function i(e){return a(await r("/auth/register",{method:"POST",body:JSON.stringify(e)}))}async function l(e){return a(await r("/auth/login",{method:"POST",body:JSON.stringify(e)}))}async function c(e,t){return a(await r("/auth/oauth/verify",{method:"POST",body:JSON.stringify({etapeToken:e,code:t})}))}async function s(){let e=await r("/auth/refresh",{method:"POST"});if(e.ok)return{ok:!0,session:e.data};let t=e.message.toLowerCase();return t.includes("injoignable")?{ok:!1,raison:"panne"}:t.includes("r\xe9voqu")?{ok:!1,raison:"revoquee"}:t.includes("expir")?{ok:!1,raison:"expiree"}:{ok:!1,raison:"absente"}}async function u(){await r("/auth/logout",{method:"POST"})}async function d(e){return r("/auth/password/forgot",{method:"POST",body:JSON.stringify({email:e})})}async function f(e,t){return r("/auth/password/reset",{method:"POST",body:JSON.stringify({token:e,password:t})})}async function h(e){return r("/auth/email/verify",{method:"POST",body:JSON.stringify({token:e})})}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r="returnTo=".concat(encodeURIComponent(t));return"".concat(o,"/auth/oauth/").concat(e,"?").concat(r).concat(n?"&inscription=1":"")}async function p(e){let t=await r("/auth/oauth/inscription/profil?jeton=".concat(encodeURIComponent(e)));return t.ok?t.data:null}}
1,71283:(e,t,n)=>{"use strict";n.d(t,{A:()=>h});var o=n(37323),r=n(46938),a=n.t(r,2),i=n(38246),l=a["use".trim()],c=n(38596),s=n(75017),u=n(8589),d=n(11026),f=n(68711);function h(e){let{Link:t,config:n,getPathname:a,...h}=function(e,t){var n,a,i;let f={...n=t||{},localePrefix:"object"==typeof(i=n.localePrefix)?i:{mode:i||"always"},localeCookie:!!((a=n.localeCookie)??1)&&{name:"NEXT_LOCALE",sameSite:"lax",..."object"==typeof a&&a},localeDetection:n.localeDetection??!0,alternateLinks:n.alternateLinks??!0},h=f.pathnames,m=(0,r.forwardRef)(function({href:t,locale:n,...o},r){let a,i;"object"==typeof t?(a=t.pathname,i=t.params):a=t;let u=(0,c._x)(t),m=e(),y=(0,c.yL)(m)?l(m):m,x=u?p({locale:n||y,href:null==h?a:{pathname:a,params:i},forcePrefix:null!=n||void 0}):a;return(0,d.jsx)(s.default,{ref:r,href:"object"==typeof t?{...t,pathname:x}:x,locale:n,localeCookie:f.localeCookie,...o})});function p(e){let t,{forcePrefix:n,href:o,locale:r}=e;return null==h?"object"==typeof o?(t=o.pathname,o.query&&(t+=(0,u.Zn)(o.query))):t=o:t=(0,u.FP)({locale:r,...(0,u.TK)(o),pathnames:f.pathnames}),(0,u.x3)(t,r,f,n)}function y(e){return function(t,...n){return e(p(t),...n)}}return{config:f,Link:m,redirect:y(o.redirect),permanentRedirect:y(o.permanentRedirect),getPathname:p}}(i.Ym,e);return{...h,Link:t,usePathname:function(){let e=function(e){let t=(0,o.usePathname)(),n=(0,i.Ym)();return(0,r.useMemo)(()=>{if(!t)return t;let o=t,r=(0,c.XP)(n,e.localePrefix);if((0,c.wO)(r,t))o=(0,c.MY)(t,r);else if("never"!==e.localePrefix.mode&&e.localePrefix.prefixes){let e=(0,c.bL)(n);(0,c.wO)(e,t)&&(o=(0,c.MY)(t,e))}return o},[e.localePrefix,n,t])}(n),t=(0,i.Ym)();return(0,r.useMemo)(()=>e&&n.pathnames?(0,u.aM)(t,e,n.pathnames):e,[t,e])},useRouter:function(){let e=(0,o.useRouter)(),t=(0,i.Ym)(),l=(0,o.usePathname)();return(0,r.useMemo)(()=>{function o(e){return function(o,r){let{locale:i,...c}=r||{},s=[a({href:o,locale:i||t,forcePrefix:null!=i||void 0})];Object.keys(c).length>0&&s.push(c),(0,f.A)(n.localeCookie,l,t,i),e(...s)}}return{...e,push:o(e.push),replace:o(e.replace),prefetch:o(e.prefetch)}},[t,l,e])},getPathname:a}}},89689:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{default:function(){return c},getImageProps:function(){return l}});let o=n(12889),r=n(59695),a=n(76011),i=o._(n(85981));function l(e){let{props:t}=(0,r.getImgProps)(e,{defaultLoader:i.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,n]of Object.entries(t))void 0===n&&delete t[e];return{props:t}}let c=a.Image}},e=>{e.O(0,[5017,6011,42,655,1560,7358],()=>e(e.s=16778)),_N_E=e.O()}]);

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.