1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2547],{69462:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/my-account/subscriptions",function(){return r(82556)}])},9148:function(e,t,r){"use strict";r.d(t,{x:function(){return a}});var n=r(85893),s=r(25287),a=function(e){var t=e.back,r=e.children;return(0,n.jsxs)("button",{type:"button",onClick:function(){return t()},className:"bg-olm cursor-pointer items-center flex space-x-2 hover:bg-olh text-white whitespace-nowrap p-2 text-sm rounded",children:[(0,n.jsx)(s.Z,{className:"h-4 w-4"}),(0,n.jsx)("span",{children:r})]})}},67659:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(85893),s=r(67294);var a=s.forwardRef((function(e,t){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"}))}));var i=s.forwardRef((function(e,t){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))})),l=r(85129);function c(e){var t=e.totalPages,r=e.totalResults,s=e.currentPage,c=e.setCurrentPage,o=Array(Number(t)).fill("0").map((function(e,t){return t+1}));return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex items-center justify-center border-gray-200 bg-white px-4 py-3 sm:px-6",children:[(0,n.jsxs)("div",{className:"flex flex-1 justify-between sm:hidden",children:[s>1&&(0,n.jsx)("button",{onClick:function(){return c(Number(s)-1)},className:"relative inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50",children:"Previous"}),s<t&&(0,n.jsx)("button",{onClick:function(){return c(Number(s)+1)},className:"relative ml-3 inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50",children:"Next"})]}),(0,n.jsx)("div",{className:"hidden sm:flex sm:flex-1 sm:items-center sm:justify-center",children:(0,n.jsx)("div",{children:(0,n.jsxs)("nav",{className:"isolate inline-flex -space-x-px rounded-md shadow-sm","aria-label":"Pagination",children:[1!=s&&(0,n.jsxs)("button",{onClick:function(){return c(Number(s)-1)},className:"relative inline-flex items-center rounded-l-md border border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-500 hover:bg-gray-50 focus:z-20",children:[(0,n.jsx)("span",{className:"sr-only",children:"Previous"}),(0,n.jsx)(a,{className:"h-5 w-5","aria-hidden":"true"})]}),o.map((function(e,t){return(0,n.jsx)("button",{"aria-current":"page",onClick:function(){return c(e)},className:(0,l.AK)("relative inline-flex items-center border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-500 hover:bg-gray-50 focus:z-20",e===s?"z-10 bg-orange-50 border-olm text-olh":""),children:e},t)})),s!=t&&(0,n.jsxs)("button",{onClick:function(){return c(Number(s)+1)},className:"relative inline-flex items-center rounded-r-md border border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-500 hover:bg-gray-50 focus:z-20",children:[(0,n.jsx)("span",{className:"sr-only",children:"Next"}),(0,n.jsx)(i,{className:"h-5 w-5","aria-hidden":"true"})]})]})})})]}),(0,n.jsx)("div",{className:"justify-center flex",children:(0,n.jsxs)("p",{className:"text-sm text-gray-700",children:["Showing ",(0,n.jsx)("span",{className:"font-medium",children:s})," ","to ",(0,n.jsx)("span",{className:"font-medium",children:t})," of"," ",(0,n.jsx)("span",{className:"font-medium",children:r})," results"]})})]})}},30361:function(e,t,r){"use strict";var n=r(11163),s=r(67294);t.Z=function(e){var t=(0,n.useRouter)(),r=(0,s.useState)(e),a=r[0],i=r[1],l=(0,s.useState)(1),c=l[0],o=l[1],d=(0,s.useState)(10),u=d[0],m=d[1],x=(null===a||void 0===a?void 0:a["x-wp-totalpages"])||1,h=null===a||void 0===a?void 0:a["x-wp-total"];return(0,s.useEffect)((function(){t.query.page&&o(t.query.page),t.query.perPage&&m(t.query.perPage)}),[t]),[c,u,x,h,function(e){o(e),t.push({query:{page:e}},void 0,{shallow:!0})},i]}},82556:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return b}});var n=r(85893),s=r(67294),a=r(8100),i=r(66714),l=r(28952),c=r(85129),o=r(9148);function d(e){var t=e.order,r=e.back,s={discount_total:"Discount Total",total:"Total"},a={status:"Status",date_created:"Start Date",last_payment_date_gmt:"Last order date",next_payment_date_gmt:"Next payment date",payment_method_title:"Payment"};return(0,n.jsxs)("div",{className:"space-y-5",children:[(0,n.jsx)("h1",{className:"text-2xl font-extrabold tracking-tight text-olm-black sm:text-3xl",children:"Subscriptions details"}),(0,n.jsx)(o.x,{back:r,children:"Back to Subscription"}),(0,n.jsxs)("p",{children:["Subscription was placed on ",(0,c.mN)(t.date_created)," ","and is currently ",(0,n.jsx)("b",{children:t.status}),"."]}),(0,n.jsxs)("table",{className:"bg-white",children:[t.line_items.map((function(e){return(0,n.jsxs)("tr",{className:"bg-white",children:[(0,n.jsxs)("td",{className:"bg-white",children:[" ",e.name," ",(0,n.jsxs)("span",{className:"text-gray-500",children:["x ",e.quantity]})]}),(0,n.jsxs)("td",{className:"bg-white",children:[t.currency_symbol||"$",e.total,"/",t.billing_period]})]},e.id)})),(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"bg-white",children:(0,n.jsx)("strong",{children:"Payment Method"})}),(0,n.jsx)("td",{className:"bg-white",children:t.payment_method})]}),Object.keys(s).map((function(e){return(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"bg-white w-[60%]",children:(0,n.jsx)("strong",{children:s[e]})}),(0,n.jsxs)("td",{className:"bg-white",children:[t.currency_symbol||"$",t[e]]})]},e)}))]}),(0,n.jsx)("table",{className:"bg-white",children:Object.keys(a).map((function(e){return(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"bg-white w-[60%]",children:(0,n.jsx)("strong",{children:a[e]})}),(0,n.jsx)("td",{className:"bg-white",children:(0,c.mN)(t[e])})]},e)}))}),(0,n.jsx)("div",{className:"bg-gray-50 p-6",children:(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsxs)("div",{className:"w-1/2",children:[(0,n.jsx)("h4",{className:"font-medium pb-4",children:"Billing Address"}),Object.keys(t.billing).map((function(e){return(0,n.jsx)("p",{className:"text-sm text-gray-500",children:t.billing[e]},e)}))]}),(0,n.jsxs)("div",{className:"w-1/2",children:[(0,n.jsx)("h4",{className:"font-medium pb-4",children:"Shipping Address"}),Object.keys(t.billing).map((function(e){return(0,n.jsx)("p",{className:"text-sm text-gray-500",children:t.billing[e]},e)}))]})]})})]})}var u=function(e){return"on-hold"===e.status};
1function m(e){var t=e.orders,r=e.parentshowTitle,a=(0,s.useState)(!1),i=a[0],l=a[1],o=(0,s.useState)({}),m=o[0],x=o[1];return(0,n.jsxs)(n.Fragment,{children:[i&&(0,n.jsx)(d,{order:m,back:function(){l(!1),r(!0)}}),!i&&(0,n.jsx)("div",{className:"flex flex-col",children:(0,n.jsx)("div",{className:"-my-2 -mx-4 overflow-x-auto sm:-mx-6 lg:-mx-8",children:(0,n.jsx)("div",{className:"inline-block min-w-full py-2 align-middle md:px-6 lg:px-8",children:(0,n.jsx)("div",{className:"overflow-hidden md:rounded-lg",children:(0,n.jsxs)("table",{className:"min-w-full divide-y divide-white",children:[(0,n.jsx)("thead",{className:"",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{scope:"col",className:"py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-olm-black sm:pl-6",children:"Order"}),(0,n.jsx)("th",{scope:"col",className:"px-3 py-3.5 text-left text-sm font-semibold text-olm-black",children:"Date Created"}),(0,n.jsx)("th",{scope:"col",className:"px-3 py-3.5 text-left text-sm font-semibold text-olm-black",children:"Next Payment"}),(0,n.jsx)("th",{scope:"col",className:"px-3 py-3.5 text-left text-sm font-semibold text-olm-black",children:"Status"}),(0,n.jsx)("th",{scope:"col",className:"px-3 py-3.5 text-left text-sm font-semibold text-olm-black",children:"Total"}),(0,n.jsx)("th",{scope:"col",className:"relative py-3.5 pl-3 pr-4 sm:pr-6",children:(0,n.jsx)("span",{className:"sr-only",children:"Actions"})})]})}),(0,n.jsx)("tbody",{className:"bg-white",children:t.length>0&&t.map((function(e,t){return(0,n.jsxs)("tr",{className:t%2===0?void 0:"bg-white",children:[(0,n.jsxs)("td",{className:"whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-olm-black sm:pl-6",children:["#",e.id]}),(0,n.jsxs)("td",{className:"whitespace-nowrap px-3 py-4 text-sm text-gray-500",children:[" ",(0,c.mN)(e.date_created)]}),(0,n.jsxs)("td",{className:"whitespace-nowrap px-3 py-4 text-sm text-gray-500",children:[" ",(0,c.mN)(e.next_payment_date_gmt)]}),(0,n.jsx)("td",{className:"whitespace-nowrap px-3 py-4 text-sm text-gray-500",children:e.status}),(0,n.jsxs)("td",{className:"whitespace-nowrap px-3 py-4 text-sm text-gray-500",children:[e.currency_symbol,e.total]}),(0,n.jsxs)("td",{className:"relative whitespace-nowrap px-1 py-4 text-center space-x-3",children:[u(e)&&(0,n.jsx)("button",{type:"button",onClick:function(){return function(e){r(!1),x(e)}(e)},className:"bg-olm cursor-pointer hover:bg-olh text-white whitespace-nowrap py-2 px-4 rounded",children:"Pay"}),(0,n.jsx)("button",{type:"button",onClick:function(){return function(e){l(!0),x(e),r(!1)}(e)},className:"bg-olm cursor-pointer hover:bg-olh text-white whitespace-nowrap py-2 px-4 rounded",children:"View Details"})]})]},e.id)}))})]})})})})})]})}var x=r(30361),h=r(67659);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,s,a=[],i=!0,l=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(c){l=!0,s=c}finally{try{i||null==r.return||r.return()}finally{if(l)throw s}}return a}}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var b=function(){var e=(0,s.useState)(!0)[1],t=f((0,x.Z)({}),6),r=t[0],c=t[1],o=t[2],d=t[3],u=t[4],p=t[5],b=(0,a.ZP)("".concat(i.zz.getSubscriptionsByCustomer,"&page=").concat(r,"&perPage=").concat(c),i.G2),g=b.data,y=b.error;return(0,s.useEffect)((function(){p(null===g||void 0===g?void 0:g.headers)}),[g]),(0,n.jsx)(l.Z,{title:"My Subscriptions",error:y,description:"Check the status of recent orders, manage returns,\n and discover similar products.",children:y?"Failed to Load":g?g.data.length>0?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(m,{orders:g.data,parentshowTitle:function(t){e(t)}}),(0,n.jsx)(h.Z,{totalPages:o,totalResults:d,currentPage:Number(r),setCurrentPage:u})]}):(0,n.jsx)("p",{children:"No orders found"}):"Loading..."})}},25287:function(e,t,r){"use strict";var n=r(67294);const s=n.forwardRef((function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))}));t.Z=s}},function(e){e.O(0,[1583,8952,9774,2888,179],(function(){return t=69462,e(e.s=t);var t}));var t=e.O();_N_E=t}]); 2//# sourceMappingURL=subscriptions-3dddbe96b5a4d02b.js.map
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.