1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1244],{3360:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/payment/package/[walletId]",function(){return r(2390)}])},6796:function(e,n,r){"use strict";var t=r(5893),a=function(e){var n=e.children,r=e.title,a=e.description;return(0,t.jsxs)("div",{className:"mx-4 sm:mx-auto my-24",style:{maxWidth:"500px"},children:[(0,t.jsxs)("div",{className:"text-center mb-12",children:[(0,t.jsx)("h1",{className:"font-bold text-3xl",children:r}),(0,t.jsx)("p",{className:"opacity-80 text-base mt-2",children:a})]}),n]})};n.Z=a},4381:function(e,n,r){"use strict";r.d(n,{II:function(){return c},Ph:function(){return f},gx:function(){return p},sb:function(){return l},xb:function(){return d},zx:function(){return s}});var t=r(5893),a=r(8955),o=r(1664),i=r.n(o),u=function(e){var n=e.children;return(0,t.jsx)("form",{className:"w-full",children:n})};n.ZP=u;var c=function(e){var n=e.label,r=e.name,a=e.type,o=e.value,i=e.onChange,u=e.multiple,c=e.disabled;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("label",{className:"block text-base mb-1",children:n}),(0,t.jsx)("input",{name:r,type:a,value:o,onChange:i,required:!0,multiple:u,disabled:c,className:"w-full border-1 border-dark rounded-md px-4 py-3 mb-6 outline-none bg-light transition duration-300 ease-in-out focus:border-primary",placeholder:"Enter ".concat(n)})]})},l=function(e){var n=e.label,r=e.value,o=e.onChange,i=r&&!(0,a.tm)(r);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("label",{className:"block text-base mb-1",children:n}),(0,t.jsx)(a.ZP,{placeholder:"e.g. 0801 234 5678",defaultCountry:"NG",countries:["NG"],countryCallingCodeEditable:!1,international:!1,countrySelectProps:{disabled:!0,"aria-label":"Nigeria"},maxLength:13,name:"phoneNumber",value:r,onChange:o,className:"w-full border-1 rounded-md px-4 py-3 mb-1 outline-none bg-light transition duration-300 ease-in-out focus:border-primary ".concat(i?"border-red-500":"border-dark")}),(0,t.jsx)("p",{className:"text-xs mb-6 ".concat(i?"text-red-500":"text-gray-500"),children:i?"That doesn't look like a valid Nigerian number":"Enter your 11-digit Nigerian mobile number"})]})},s=function(e){var n=e.children,r=e.disabled,a=e.onClick,o=e.type;return(0,t.jsx)("button",{type:o,disabled:r,onClick:a,className:"my-6 w-full text-xl no-underline block text-center py-3 px-8 font-medium rounded-full cursor-pointer relative whitespace-nowrap z-2 transition border-2 border-dark duration-300 ease-[cubic-bezier(0.42, 0, 0.58, 1)] hover:bg-primary hover:text-light hover:border-primary",children:n})},d=function(e){var n=e.href,r=e.children;return(0,t.jsx)(i(),{href:n,children:(0,t.jsx)("div",{className:"my-6 w-full text-xl no-underline block text-center py-3 px-8 font-medium rounded-full cursor-pointer relative whitespace-nowrap z-2 transition border-2 border-dark duration-300 ease-[cubic-bezier(0.42, 0, 0.58, 1)] hover:bg-primary hover:text-light hover:border-primary",children:r})})},f=function(e){var n=e.name,r=e.onChange,a=e.label,o=e.value,i=e.children;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("label",{className:"block text-base mb-1",children:a}),(0,t.jsx)("select",{name:n,value:o,onChange:r,required:!0,className:"w-full border-1 border-dark rounded-md px-4 py-3 mb-6 outline-none bg-light transition duration-300 ease-in-out focus:border-primary",children:i})]})},p=function(e){var n=e.label,r=e.onChange,a=e.value,o=e.name;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("label",{className:"block text-base mb-1",children:n}),(0,t.jsx)("textarea",{name:o,value:a,onChange:r,required:!0,className:"w-full h-[150px] resize-none border-1 border-dark rounded-md px-4 py-3 mb-6 outline-none bg-light transition duration-300 ease-in-out focus:border-primary",placeholder:"Enter ".concat(n)})]})}},2390:function(e,n,r){"use strict";r.r(n),r.d(n,{__N_SSP:function(){return m}});var t=r(7568),a=r(7582),o=r(5893),i=r(3299),u=r(6569),c=r(7294),l=r(1163),s=r(6796),d=r(4381),f=r(591),p=function(e){var n,r=e.wallet,p=e.user,m=(0,l.useRouter)().query,h=(0,l.useRouter)(),b=(0,c.useState)("Loading.."),y=b[0],v=b[1],x=(0,i.useSession)(),g=(0,c.useState)(!1),k=g[0],w=g[1],j=(0,f.NL)({reference:new Date().getTime().toString(),email:p.email,amount:100*r.amount,publicKey:"pk_live_6452068bed055d132ab62f825441bb52090d779d"});(0,c.useEffect)(function(){r.active&&(v("You have already paid for this package. Please return to your dashboard."),w(!0))},[]);var N,P,_=(n=(0,t.Z)(function(e){return(0,a.__generator)(this,function(n){switch(n.label){case 0:return[4,S(e)];case 1:return n.sent(),[2]}})}),function(e){return n.apply(this,arguments)}),C=function(){v("Payment failed")},E=(N=(0,t.Z)(function(){return(0,a.__generator)(this,function(e){return w(!0),j(_,C),[2]})}),function(){return N.apply(this,arguments)}),S=(P=(0,t.Z)(function(e){return(0,a.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),v("Please wait while we verify your payment..."),[4,u.Z.post("/payments",{id:r._id,transactionId:e.transaction,type:"package"},{headers:{Authorization:p.token}})];case 1:return n.sent(),m.id?setTimeout(function(){var e,n;fetch("https://backend.naijaspider.com/api/products/type/".concat(m.id),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:null==x?void 0:null===(e=x.data)||void 0===e?void 0:null===(n=e.user)||void 0===n?void 0:n.token},body:JSON.stringify({type:r.packageId,walletId:r._id,userId:x.data.user._id})}).then(function(e){return e.json()}).then(function(e){return console.log("Success:",e)},v("Payment successful. Your ad is upgraded successfully.")).then(h.push({pathname:"/my-ads"})).catch(function(e){console.error("Error:",e)})},1e3):(v("Payment successful. Please return to your dashboard."),setTimeout(function(){h.push("/post/".concat(r.packageId))},1e3)),[3,3];case 2:return n.sent(),v("Payment failed"),[3,3];case 3:return[2]}})}),function(e){return P.apply(this,arguments)});return(0,o.jsx)(s.Z,{title:"Package Payment",description:k?y:"",children:!k&&(0,o.jsx)(d.zx,{onClick:E,type:"button",children:"Pay"})})},m=!0;n.default=p},591:function(e,n,r){"use strict";r.d(n,{NL:function(){return i}});var t=r(7294),a=[],o=function(e){var n=window.PaystackPop&&window.PaystackPop.setup(e);n&&n.openIframe()};function i(e){var n,r,i,u,c=(n="https://js.paystack.co/v1/inline.js",i=(r=(0,t.useState)({loaded:!1,error:!1}))[0],u=r[1],(0,t.useEffect)(function(){if(a.includes(n))u({loaded:!0,error:!1});else{a.push(n);var e=document.createElement("script");e.src=n,e.async=!0;var r=function(){u({loaded:!0,error:!1})},t=function(){var r=a.indexOf(n);r>=0&&a.splice(r,1),e.remove(),u({loaded:!0,error:!0})};return e.addEventListener("load",r),e.addEventListener("complete",r),e.addEventListener("error",t),document.body.appendChild(e),function(){e.removeEventListener("load",r),e.removeEventListener("error",t)}}},[n]),[i.loaded,i.error]),l=c[0],s=c[1],d=e.publicKey,f=e.firstname,p=e.lastname,m=e.phone,h=e.email,b=e.amount,y=e.reference,v=e.metadata,x=void 0===v?{}:v,g=e.currency,k=void 0===g?"NGN":g,w=e.channels,j=e.label,N=void 0===j?"":j,P=e.plan,_=void 0===P?"":P,C=e.quantity,E=void 0===C?"":C,S=e.subaccount,O=void 0===S?""
1:S,z=e.transaction_charge,I=void 0===z?0:z,L=e.bearer,T=void 0===L?"account":L,Z=e.split,q=e.split_code;return(0,t.useEffect)(function(){if(s)throw Error("Unable to load paystack inline script")},[s]),function(n,r){if(s)throw Error("Unable to load paystack inline script");l&&o({callback:n||function(){return null},onClose:r||function(){return null},key:d,ref:y,email:h,firstname:f,lastname:p,phone:m,amount:b,currency:k,plan:_,quantity:E,"data-custom-button":e["data-custom-button"]||"",channels:w,subaccount:O,transaction_charge:I,bearer:T,label:N,metadata:x,split:Z,split_code:q})}}var u=function(){return(u=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var a in n=arguments[r])Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a]);return e}).apply(this,arguments)};function c(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&0>n.indexOf(t)&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,t=Object.getOwnPropertySymbols(e);a<t.length;a++)0>n.indexOf(t[a])&&Object.prototype.propertyIsEnumerable.call(e,t[a])&&(r[t[a]]=e[t[a]]);return r}var l=(0,t.createContext)({initializePayment:function(){return null},onSuccess:function(){return null},onClose:function(){return null}}),s=function(e){var n=e.children,r=e.onSuccess,a=e.onClose,o=c(e,["children","onSuccess","onClose"]),u=i(o);return t.createElement(l.Provider,{value:{initializePayment:u,onSuccess:r,onClose:a}},n)},d=function(e){var n=e.children,r=e.ref,a=(0,t.useContext)(l),o=a.initializePayment,i=a.onSuccess,u=a.onClose;return n({initializePayment:function(){return o(i,u)},ref:r})};(0,t.forwardRef)(function(e,n){var r=e.children,a=e.onSuccess,o=e.onClose,i=c(e,["children","onSuccess","onClose"]);return t.createElement(s,u({},i,{onSuccess:a||function(){return null},onClose:o||function(){return null}}),t.createElement(d,{ref:n},r))})}},function(e){e.O(0,[7861,9774,2888,179],function(){return e(e.s=3360)}),_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.