PageSourceSearch

https://www.empara.fr/_next/static/chunks/pages/pay/[slug]-e2a4326f27321c58.js

js empara.fr collected 2026-09-28 06:41:51 UTC 13,461 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3294,4873],{3810:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__N_SSP:()=>x,default:()=>f});var i=n(37876),l=n(14232),s=n(89099),o=n(77328),r=n.n(o),a=n(25220),c=n(79804),d=n(92035),u=n(55811),m=n(79261),p=n(35739),h=n(93784),x=!0;function f(e){var t,n,o,x,f,y,g;let{link:w,user:j,notFound:b,inactive:v,limitReached:C,unauthorized:k,linkedUserName:N,isAdminViewing:_}=e,O=(0,s.useRouter)(),[P,T]=(0,l.useState)(null),[A,E]=(0,l.useState)(!1),[L,S]=(0,l.useState)((null==w?void 0:w.modalConfig)||null),[M,F]=(0,l.useState)(!1);(0,l.useEffect)(()=>{F(!0)},[]),(0,l.useEffect)(()=>{w&&"stripe_link"===w.type&&w.stripeUrl&&(window.location.href=w.stripeUrl)},[w]);let I=(0,l.useCallback)(async()=>{if(w&&"stripe_link"!==w.type){E(!0),T(null);try{let e=w.item||w.planId||"passionne",t=w.rec||"sub",n={item:e,rec:t,returnUrl:"/pay/".concat(w.slug),label:w.slug};w.couponCode&&(n.couponCode=w.couponCode);let i=await fetch("/api/pay/initialize-cart",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),l=await i.json();if(l.success){let e={},t=w.allowedPaymentMethods||"both",n=!!w.priceId12x;"card_only"===t?(e.showOnceOption=!0,e.showFourTimesOption=!1,e.showTwelveTimesOption=!1):"alma_only"===t?(e.showOnceOption=!1,e.showFourTimesOption=!0,e.showTwelveTimesOption=n,e.defaultPaymentOption="four_times"):n||(e.showTwelveTimesOption=!1);let i={...w.modalConfig||{},...e,paymentLinkType:w.type},s={...l,paymentLinkConfig:{modalConfig:i,couponCode:w.couponCode||null,allowCoupons:!1!==w.allowCoupons}};S(i),T(s)}else{console.error("[PaymentLink] Erreur initialisation panier:",l.error||l.message,{slug:w.slug,item:w.item,rec:w.rec,priceId:w.priceId});let e=await fetch("/api/pay/initialize-cart",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),t=await e.json();if(t.success){let e={},n=w.allowedPaymentMethods||"both",i=!!w.priceId12x;"card_only"===n?(e.showOnceOption=!0,e.showFourTimesOption=!1,e.showTwelveTimesOption=!1):"alma_only"===n?(e.showOnceOption=!1,e.showFourTimesOption=!0,e.showTwelveTimesOption=i,e.defaultPaymentOption="four_times"):i||(e.showTwelveTimesOption=!1);let l={...w.modalConfig||{},...e,paymentLinkType:w.type};S(l),T({...t,paymentLinkConfig:{modalConfig:l,couponCode:w.couponCode||null,allowCoupons:!1!==w.allowCoupons}})}else console.error("[PaymentLink] Retry \xe9chou\xe9:",t.error)}}catch(e){console.error("[PaymentLink] Erreur critique initialisation panier:",e)}finally{E(!1)}}},[w]),z=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(w&&!b&&!v&&"stripe_link"!==w.type&&j){let e="".concat((null==j?void 0:j._id)||(null==j?void 0:j.id)||"anon",":").concat(w.slug||w._id||"");z.current!==e&&(z.current=e,I())}},[w,b,v,I,j]);let V=(0,l.useCallback)(()=>{(0,u.vW)(null,{reload:!0})},[]);if(b)return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r(),{children:(0,i.jsx)("meta",{name:"robots",content:"noindex, nofollow"})}),(0,i.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:(0,i.jsxs)("div",{className:"text-center",children:[(0,i.jsx)("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Lien introuvable"}),(0,i.jsx)("p",{className:"text-lg text-gray-600 mb-6",children:"Ce lien de paiement n'existe pas ou n'est plus disponible."}),(0,i.jsx)(d.A,{variant:"primary",onClick:()=>O.push("/abonnements"),className:"m-auto",children:"Voir nos offres"})]})})]});if(v)return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r(),{children:(0,i.jsx)("meta",{name:"robots",content:"noindex, nofollow"})}),(0,i.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:(0,i.jsxs)("div",{className:"text-center",children:[(0,i.jsx)("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Offre non disponible"}),(0,i.jsx)("p",{className:"text-lg text-gray-600 mb-6",children:"Cette offre n'est plus active pour le moment."}),(0,i.jsx)(d.A,{variant:"primary",onClick:()=>O.push("/abonnements"),className:"m-auto",children:"Voir nos offres actuelles"})]})})]});if(C)return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r(),{children:(0,i.jsx)("meta",{name:"robots",content:"noindex, nofollow"})}),(0,i.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:(0,i.jsxs)("div",{className:"text-center max-w-md mx-auto px-4",children:[(0,i.jsx)("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Offre non disponible"}),(0,i.jsx)("p",{className:"text-lg text-gray-600 mb-6",children:"Cette offre \xe9tait limit\xe9e et toutes les places ont \xe9t\xe9 attribu\xe9es. Le lien n'est donc plus disponible."}),(0,i.jsx)(d.A,{variant:"primary",onClick:()=>O.push("/abonnements"),className:"m-auto",children:"Voir nos offres actuelles"})]})})]});if(k)return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r(),{children:(0,i.jsx)("meta",{name:"robots",content:"noindex, nofollow"})}),(0,i.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:(0,i.jsxs)("div",{className:"text-center max-w-md mx-auto px-4",children:[(0,i.jsx)(m.A,{className:"h-16 w-16 text-red-500 mx-auto mb-4"}),(0,i.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-3",children:"Acc\xe8s non autoris\xe9"}),(0,i.jsx)("p",{className:"text-lg text-gray-600 mb-6",children:"Ce lien de paiement est r\xe9serv\xe9 \xe0 un autre utilisateur. Tu n'es pas autoris\xe9 \xe0 l'utiliser."}),(0,i.jsx)(d.A,{variant:"primary",onClick:()=>O.push("/abonnements"),className:"m-auto",children:"Voir nos offres"})]})})]});if(w&&"stripe_link"===w.type)return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r(),{children:(0,i.jsx)("meta",{name:"robots",content:"noindex, nofollow"})}),(0,i.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:(0,i.jsxs)("div",{className:"text-center",children:[(0,i.jsx)(p.A,{className:"h-12 w-12 animate-spin text-red-600 mx-auto mb-4"}),(0,i.jsx)("p",{className:"text-lg text-gray-600",children:"Redirection vers le paiement..."})]})})]});
1let R=(null==w||null==(t=w.modalConfig)?void 0:t.title)||(null==w?void 0:w.name)||"Paiement";return M?j?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r(),{children:[(0,i.jsx)("meta",{name:"robots",content:"noindex, nofollow"}),(0,i.jsxs)("title",{children:[R," | Empara"]})]}),_&&N&&(0,i.jsxs)("div",{className:"fixed top-0 left-0 right-0 z-[9999] bg-amber-50 border-b border-amber-300 px-4 py-3 flex items-center justify-center gap-2 text-sm text-amber-800 shadow-sm",children:[(0,i.jsx)(h.A,{className:"h-4 w-4 shrink-0 text-amber-600"}),(0,i.jsxs)("span",{children:[(0,i.jsx)("strong",{children:"Mode admin"})," — Vous visualisez cette page en tant qu'administrateur. Seul l'utilisateur ",(0,i.jsx)("strong",{children:N})," est autoris\xe9 \xe0 utiliser ce lien de paiement."]})]}),(0,i.jsx)("div",{className:"min-h-screen bg-black/80"}),(0,i.jsx)(a.default,{isOpen:!0,onClose:()=>{},cartData:P,user:j,isLoading:A,closable:!1,modalConfig:L})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r(),{children:[(0,i.jsx)("meta",{name:"robots",content:"noindex, nofollow"}),(0,i.jsxs)("title",{children:[R," | Empara"]})]}),(0,i.jsx)("div",{className:"min-h-screen bg-black/80"}),(0,i.jsx)(c.A,{isOpen:!0,onClose:()=>{},onSuccess:V,subscriptionInfo:{item:(null==w?void 0:w.item)||(null==w?void 0:w.planId)||"passionne",customTitle:(null==w||null==(o=w.modalConfig)||null==(n=o.authPopupConfig)?void 0:n.title)||(null==w||null==(x=w.modalConfig)?void 0:x.title)||null,customSubtitle:(null==w||null==(y=w.modalConfig)||null==(f=y.authPopupConfig)?void 0:f.subtitle)||null,productOverride:(null==w||null==(g=w.modalConfig)?void 0:g.authPopupConfig)?{name:w.modalConfig.authPopupConfig.productName,price:w.modalConfig.authPopupConfig.productPrice,description:w.modalConfig.authPopupConfig.productDescription,features:w.modalConfig.authPopupConfig.productFeatures,commitment:w.modalConfig.authPopupConfig.commitment,showProductCard:w.modalConfig.authPopupConfig.showProductCard}:null}})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r(),{children:[(0,i.jsx)("meta",{name:"robots",content:"noindex, nofollow"}),(0,i.jsxs)("title",{children:[R," | Empara"]})]}),(0,i.jsx)("div",{className:"min-h-screen bg-black/80"})]})}},11508:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});let i=(0,n(17963).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},28022:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(14232);let l=i.forwardRef(function(e,t){let{title:n,titleId:l,...s}=e;return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":l},s),n?i.createElement("title",{id:l},n):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))})},30860:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});let i=(0,n(17963).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},35739:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});let i=(0,n(17963).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},56732:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});let i=(0,n(17963).A)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])}
1,60862:(e,t,n)=>{"use strict";n.d(t,{BF:()=>o,SV:()=>a,_l:()=>c,fY:()=>s,kj:()=>d});var i=n(5824),l=n(65364);function s(e){return e&&void 0!==e._id&&null!==e._id&&""!==e._id?e._id+e.basicId:null}function o(){var e,t;if((0,i.O2)().isNativeApp)return!0;if("true"===l.env.NEXT_PUBLIC_ENABLE_CRISP_DEV||(null==(e=window.localStorage)?void 0:e.getItem("enable_crisp_dev"))==="true")return!1;let n=(null==(t=window.location)?void 0:t.hostname)||"";return"localhost"===n||"127.0.0.1"===n||n.includes("ngrok-free.app")}function r(){if(!0===window.__forceCrispUnavailable)return!1;try{var e;return"function"==typeof(null==(e=window.$crisp)?void 0:e.is)}catch(e){return!1}}function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4e3;return r()?Promise.resolve(!0):new Promise(t=>{let n=null,i=null,l=!1,s=e=>{l||(l=!0,null!==n&&window.clearInterval(n),null!==i&&window.clearTimeout(i),n=null,i=null,t(e))};n=window.setInterval(()=>{r()&&s(!0)},150),i=window.setTimeout(()=>s(!1),Math.max(0,e))})}function c(e){if(!r())return!1;try{return window.$crisp.push(["do","chat:open"]),"string"==typeof e&&e.trim()&&window.$crisp.push(["set","message:text",[e]]),!0}catch(e){return console.warn("[crisp] openCrispChat failed:",e),!1}}function d(){if(!r())return!1;try{return window.$crisp.push(["do","chat:close"]),!0}catch(e){return console.warn("[crisp] closeCrispChat failed:",e),!1}}},72028:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(37876);n(14232);let l=function(e){let{className:t,onClick:n,size:l,width:s,height:o,style:r,...a}=e,c=s||l||12,d=o||l||12,u={flexShrink:0,...l?{width:l,height:l}:null,...s?{width:s}:null,...o?{height:o}:null,...r};return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:c,height:d,style:u,className:t,onClick:n,viewBox:"0 0 329.269 329",...a,children:(0,i.jsx)("path",{d:"M194.8 164.77L323.013 36.555c8.343-8.34 8.343-21.825 0-30.164-8.34-8.34-21.825-8.34-30.164 0L164.633 134.605 36.422 6.391c-8.344-8.34-21.824-8.34-30.164 0-8.344 8.34-8.344 21.824 0 30.164l128.21 128.215L6.259 292.984c-8.344 8.34-8.344 21.825 0 30.164a21.266 21.266 0 0015.082 6.25c5.46 0 10.922-2.09 15.082-6.25l128.21-128.214 128.216 128.214a21.273 21.273 0 0015.082 6.25c5.46 0 10.922-2.09 15.082-6.25 8.343-8.34 8.343-21.824 0-30.164zm0 0"})})}},79261:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});let i=(0,n(17963).A)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]])},79920:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/pay/[slug]",function(){return n(3810)}])},89926:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});let i=(0,n(17963).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},93784:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});let i=(0,n(17963).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])}},e=>{e.O(0,[3560,706,5068,8864,5220,1959,1725,9804,636,6593,8792],()=>e(e.s=79920)),_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.