1(window.webpackJsonp=window.webpackJsonp||[]).push([[115],{"NR+H":function(t,r,a){"use strict" 2a.r(r) 3var o=a("lSNA"),c=a.n(o),i=a("yXPU"),u=a.n(i),l=a("J4zp"),d=a.n(l),p=a("o0o1"),y=a.n(p),b=a("+TN3"),v=a("Lm/n"),m=a("q1tI"),h=a.n(m),w=a("kriW"),g=a("Ty5D"),P=a("LiED"),j=a("I3jj"),O=a("W+3L"),S=a("FwFz"),k=a("lQ2p"),E=a("/5RW"),T=a("p07M"),I=a("GPmg") 4function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"] 5if(!a){if(Array.isArray(t)||(a=function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r) 6var a={}.toString.call(t).slice(8,-1) 7return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}(t))||r&&t&&"number"==typeof t.length){a&&(t=a) 8var o=0,c=function F(){} 9return{s:c,n:function n(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function e(t){throw t},f:c}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,l=!1 10return{s:function s(){a=a.call(t)},n:function n(){var t=a.next() 11return u=t.done,t},e:function e(t){l=!0,i=t},f:function f(){try{u||null==a.return||a.return()}finally{if(l)throw i}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length) 12for(var a=0,o=Array(r);a<r;a++)o[a]=t[a] 13return o}function ownKeys(t,r){var a=Object.keys(t) 14if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t) 15r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),a.push.apply(a,o)}return a}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{} 16r%2?ownKeys(Object(a),!0).forEach((function(r){c()(t,r,a[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ownKeys(Object(a)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))}))}return t}var A=new(a("rUvP").a) 17r.default=function PayPalPPCPReturn(){var t,r=Object(S.b)(),a=d()(r,1)[0].cartId,o=Object(O.b)(),c=d()(o,1)[0].storeCode,i=Object(k.b)(),l=d()(i,2)[1].actions.setPaypalPpcpOrderConfirmationData,p=Object(I.a)(),x=d()(p,2)[1].addToast,_=Object(g.useHistory)(),C=4===c?"GBP":"EUR",L=A.getItem("signin_token"),N=Object(b.a)(j.d,{fetchPolicy:"cache-and-network"}).data,R=Object(b.a)(j.c,{fetchPolicy:"no-cache"}).data,D=null==N||null===(t=N.storeConfig)||void 0===t?void 0:t.ppcp_config,H=null==R?void 0:R.ppcpGetClientToken,U=null==D?void 0:D.finish_order_url,W=null==D?void 0:D.environment,q=Object(v.a)(E.a,{fetchPolicy:"no-cache"}),J=d()(q,1)[0],M=Object(m.useCallback)(function(){var t=u()(y.a.mark((function _callee(t){var r,o,c,i,u,d,p,b,v,m,h 18return y.a.wrap((function(y){for(;;)switch(y.prev=y.next){case 0:if(r=t.orderId,y.prev=1,U){y.next=2 19break}throw new Error("PayPal finish order URL not configured") 20case 2:return y.next=3,J({variables:{cartId:a}}) 21case 3:return o=y.sent,c=o.data,y.next=4,fetch(U,{method:"POST",headers:_objectSpread({"X-Requested-With":"XMLHttpRequest","Content-Type":"application/json"},L&&{Authorization:"Bearer ".concat(L)}),body:JSON.stringify({cartId:a,orderId:r,method:"ppcp_paypal"})}) 22case 4:if((i=y.sent).ok){y.next=6 23break}return y.next=5,i.text() 24case 5:throw u=y.sent,new Error("HTTP error ".concat(i.status,": ").concat(u)) 25case 6:return y.next=7,i.json() 26case 7:if(d=y.sent,null==(p=null==d?void 0:d.errors)||!p.length){y.next=8 27break}b=_createForOfIteratorHelper(p) 28try{for(b.s();!(v=b.n()).done;)m=v.value,x({type:"error",message:m.message})}catch(t){b.e(t)}finally{b.f()}return _.replace({search:""}),y.abrupt("return") 29case 8:if(h=null==d?void 0:d.order_increment_id){y.next=9 30break}throw new Error("Invalid capture response: no orderIncrementId found") 31case 9:l({orderId:h,data:c}),y.next=11 32break 33case 10:y.prev=10,y.catch(1),x({type:"error",message:"Error processing the PayPal payment"}),_.replace({search:""}) 34case 11:case"end":return y.stop()}}),_callee,null,[[1,10]])}))) 35return function(r){return t.apply(this,arguments)}}(),[U,a,L,J,l,x,_]),z=Object(m.useCallback)((function(t){x({type:"error",message:"PayPal error: ".concat((null==t?void 0:t.message)||"Unknown error")}),_.replace({search:""})}),[x,_]),G=Object(T.b)({clientToken:U?H:null,environment:W,currency:C,locale:"en-US",onApprove:M,onError:z}).error 36return Object(m.useEffect)((function(){}),[G]),h.a.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"50vh"}},h.a.createElement(P.a,{parentName:"PayPalPPCPReturn"},h.a.createElement(w.a,{id:"payPalPPCPReturn.processing",defaultMessage:"Traitement de votre paiement PayPal en cours..."})))}},OAjT:function(t,r,a){"use strict" 37a.d(r,"a",(function(){return loadCoreSdkScript})),"function"==typeof SuppressedError&&SuppressedError 38var o="pending",c="resolved",i="rejected" 39function loadCoreSdkScript(t){var r,a 40if(void 0===t&&(t={}),function validateArguments(t){if("object"!=typeof t||null===t)throw new Error("Expected an options object") 41var r=t,a=r.environment,o=r.dataNamespace,c=r.dataSdkIntegrationSource 42if(a&&"production"!==a&&"sandbox"!==a)throw new Error('The "environment" option must be either "production" or "sandbox"') 43if(void 0!==o&&""===o.trim())throw new Error('The "dataNamespace" option cannot be an empty string') 44if(void 0!==c&&""===c.trim())throw new Error('The "dataSdkIntegrationSource" option cannot be an empty string')}(t),function isServer(){return"undefined"==typeof window&&"undefined"==typeof document}())return Promise.resolve(null) 45var u=t.environment,l=t.debug,d=t.dataNamespace,p=t.dataSdkIntegrationSource,y=null!=d?d:"paypal",b=getPayPalWindowNamespace(y) 46if(null==b?void 0:b.version.startsWith("6"))return Promise.resolve(b) 47var v=new URL("/web-sdk/v6/core","production"===u?"https://www.paypal.com":"https://www.sandbox.paypal.com") 48l&&v.searchParams.append("debug","true") 49var m=null!==(a=document.querySelector('script[src*="'.concat(v.pathname,'"][').concat("data-loading-state",'="').concat(o,'"]')))&&void 0!==a?a:function createScriptElement(t){var r=t.url,a=t.attributes,o=document.createElement("script") 50o.src=r 51for(var c=0,i=Object.entries(a);c<i.length;c++){var u=i[c],l=u[0],d=u[1] 52void 0!==d&&o.setAttribute(l,d)}return document.head.appendChild(o),o}({url:v.toString(),attributes:(r={"data-namespace":d,"data-sdk-integration-source":p},r["data-loading-state"]=o,r)}) 53return new Promise((function(t,r){m.addEventListener("load",(function(){var a=getPayPalWindowNamespace(y) 54return a?(m.setAttribute("data-loading-state",c),t(a)):(m.setAttribute("data-loading-state",i),r("The window.".concat(y," global variable is not available")))}),{once:!0}),m.addEventListener("error",(function(){var t=new Error('The script "'.concat(v.toString(),'" failed to load. Check the HTTP status code and response body in DevTools to learn more.')) 55return m.setAttribute("data-loading-state",i),r(t)}),{once:!0})}))}function getPayPalWindowNamespace(t){return window[t]}}}])
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.