1_N_E=(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[65],{FHgg:function(e,n,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile.invoices",function(){return i("oC8X")}])},LY0y:function(e,n){(function(n){e.exports=function(){var e={880:function(e){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}}},i={};function t(n){if(i[n])return i[n].exports;var a=i[n]={exports:{}},r=!0;try{e[n](a,a.exports,t),r=!1}finally{r&&delete i[n]}return a.exports}return t.ab=n+"/",t(880)}()}).call(this,"/")},lld9:function(e,n,i){"use strict";i.d(n,"a",(function(){return p}));var t=i("nKUr"),a=i("cpVT"),r=i("q1tI"),d=i("bgFo"),o=i("g0fa"),c=i("20a2"),s=i("kriW"),l=i("Nd01"),u=i("5HS9"),m=i("AJwQ");function v(e,n){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.push.apply(i,t)}return i}function k(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?v(Object(i),!0).forEach((function(n){Object(a.a)(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var p=function(e){var n=e.clientSecret,i=e.paymentMethod,a=e.token,v=e.type,p=e.publishableKey,b=e.stripeScriptTimeout,f=void 0===b?3e3:b,j=e.showSpinner,y=void 0===j||j,g=e.onError,O=e.onAsyncProcessCompleted,N=Object(r.useState)(!1),S=N[0],h=N[1],I=Object(r.useState)(!1),x=I[0],F=I[1],C=Object(c.useRouter)(),P=C.query,_=C.pathname,w=Object(u.a)({publishableKey:p,timeout:f}),D=w.stripe,T=w.error,V=w.loadStripeJs;return Object(m.a)({skip:!S,token:a,type:v,paymentState:"success",onAsyncProcessCompleted:O}),Object(r.useEffect)((function(){if(n&&i&&D)try{D.confirmCardPayment(n,{payment_method:i}).then((function(e){e.error?(g&&g(),F(!0),h(!1)):(F(!1),h(!0))})).catch((function(e){g&&g(),Object(o.c)(e,{query:P,pathname:_}),F(!0)}))}catch(e){g&&g()}}),[n,D,i,_,P]),Object(t.jsxs)(t.Fragment,{children:[V,x&&Object(t.jsx)(s.a,k({},l.b.genericError)),T,!x&&!T&&y&&Object(t.jsx)("div",{"aria-label":"Loading",children:Object(t.jsx)(d.ib,{size:48})})]})}},oC8X:function(e,n,i){"use strict";i.r(n);var t=i("vJKn"),a=i.n(t),r=i("rg98"),d=i("nKUr"),o=i("YquM"),c=i("xvhg"),s=i("z7pX"),l=i("cpVT"),u=i("dhJC"),m=i("7++0"),v=i("kriW"),k=i("QfuG"),p=i("sWYD"),b=i("4+6U"),f=i("bgFo"),j=i("LvDl"),y=i("nocy"),g=i("PR7B"),O=i("06b5"),N=i("3Gj7"),S=i("OUvG"),h=i("OUWn"),I=i("+TN3"),x=i("pZLH"),F=i("q1tI"),C=i("NFPu"),P=i("9OvQ"),_=i("lld9"),w=i("AJwQ");function D(e,n){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.push.apply(i,t)}return i}function T(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?D(Object(i),!0).forEach((function(n){Object(l.a)(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):D(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var V={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"invoicesQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"orderBy"}},type:{kind:"NamedType",name:{kind:"Name",value:"InvoiceSortField"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"orderDirection"}},type:{kind:"NamedType",name:{kind:"Name",value:"OrderDirection"}},directives:[]}
1,{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"IsoDateTime"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"before"}},type:{kind:"NamedType",name:{kind:"Name",value:"IsoDateTime"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"statuses"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"InvoiceStatus"}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"currentUser"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paymentMethod"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"paginatedInvoices"},arguments:[{kind:"Argument",name:{kind:"Name",value:"pagination"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"ObjectField",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}}]}},{kind:"Argument",name:{kind:"Name",value:"order"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"orderBy"},value:{kind:"Variable",name:{kind:"Name",value:"orderBy"}}},{kind:"ObjectField",name:{kind:"Name",value:"orderDirection"},value:{kind:"Variable",name:{kind:"Name",value:"orderDirection"}}}]}},{kind:"Argument",name:{kind:"Name",value:"filters"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"ObjectField",name:{kind:"Name",value:"before"},value:{kind:"Variable",name:{kind:"Name",value:"before"}}},{kind:"ObjectField",name:{kind:"Name",value:"statuses"},value:{kind:"Variable",name:{kind:"Name",value:"statuses"}}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PaginatedInvoices"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"paginationInfo"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"hasPreviousPage"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"totalRowCount"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"rows"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"token"},arguments:[],directives:[]},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"InvoiceTrip"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"systemId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paidAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"periodStart"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"periodEnd"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"payable"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"total"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"totalLimit"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"items"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"InvoiceItemTrip"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}}]}}]}}]}}]}}]}}]}}],loc:{start:0,end:1208,source:{body:"\n query invoicesQuery(\n $limit: Int\n $offset: Int\n $orderBy: InvoiceSortField\n $orderDirection: OrderDirection\n $after: IsoDateTime\n $before: IsoDateTime\n $statuses: [InvoiceStatus!]\n ) {\n currentUser {\n id\n paymentMethod {\n __typename\n }\n paginatedInvoices(\n pagination: { limit: $limit, offset: $offset }\n order: { orderBy: $orderBy, orderDirection: $orderDirection }\n filters: { after: $after, before: $before, statuses: $statuses }\n ) {\n ... on PaginatedInvoices {\n paginationInfo {\n hasNextPage\n hasPreviousPage\n totalRowCount\n }\n rows {\n __typename\n token\n ... on InvoiceTrip {\n id\n systemId\n status\n currency\n createdAt\n paidAt\n periodStart\n periodEnd\n payable\n total\n totalLimit\n items {\n __typename\n ... on InvoiceItemTrip {\n id\n }\n }\n }\n }\n }\n }\n }\n }\n",name:"GraphQL request",locationOffset:{line:1,column:1}}}},A={kind:"Document",definitions:function(e){var n={};return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var i=e.name.value;return!n[i]&&(n[i]=!0,!0)}))}([{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"payInvoice"}
1,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"invoiceId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"payInvoiceCharge"},arguments:[{kind:"Argument",name:{kind:"Name",value:"invoiceId"},value:{kind:"Variable",name:{kind:"Name",value:"invoiceId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ChargeCompletedSubscription"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"subscription"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"CurrentSubscription"},directives:[]}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ConfirmationSessionStripe"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clientSecret"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paymentMethodRef"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"publishableKey"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paymentDocument"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"InvoiceTrip"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"token"},arguments:[],directives:[]}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"InvoiceFine"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"token"},arguments:[],directives:[]}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Order"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"token"},arguments:[],directives:[]}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ChargeCompleted"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"paymentDocument"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"InvoiceTrip"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"token"},arguments:[],directives:[]}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ChargePending"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"paymentDocument"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"InvoiceTrip"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"token"},arguments:[],directives:[]}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"InvoiceFine"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"token"},arguments:[],directives:[]}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Order"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"token"},arguments:[],directives:[]}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PaymentIntentError"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"description"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"errorCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"message"},arguments:[],directives:[]}]}}]}}]}}].concat(P.a.definitions)),loc:{start:0,end:1049,source:{body:"\n \n\n mutation payInvoice($invoiceId: ID!) {\n payInvoiceCharge(invoiceId: $invoiceId) {\n __typename\n ... on ChargeCompletedSubscription {\n subscription {\n ...CurrentSubscription\n }\n }\n ... on ConfirmationSessionStripe {\n clientSecret\n paymentMethodRef\n publishableKey\n paymentDocument {\n ... on InvoiceTrip {\n token\n }\n ... on InvoiceFine {\n token\n }\n ... on Order {\n token\n }\n }\n }\n ... on ChargeCompleted {\n paymentDocument {\n ... on InvoiceTrip {\n token\n }\n }\n }\n ... on ChargePending {\n paymentDocument {\n ... on InvoiceTrip {\n token\n }\n ... on InvoiceFine {\n token\n }\n ... on Order {\n token\n }\n }\n }\n ... on PaymentIntentError {\n description\n errorCode\n message\n }\n }\n }\n",name:"GraphQL request",locationOffset:{line:1,column:1}}}},M=function(e){var n=e.status,i=Object(u.a)(e,["status"]);return[h.f.open,h.f.collection_failed].includes(n)?Object(d.jsx)(g.a,T({color:"state.warning"},i)):n===h.f.draft?Object(d.jsx)(O.a,T({color:"neutral.4"},i)):n===h.f.paid?Object(d.jsx)(N.a,T({color:"state.success"},i)):Object(d.jsx)(S.a,T({color:"neutral.4"},i))},E=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{statuses:[h.f.open,h.f.collection_failed,h.f.paid,h.f.draft],limit:25,offset:e,orderBy:h.e.createdAt,orderDirection:h.h.ASC}},$=function(e){var n=e.value;return n?Object(d.jsx)(f.mb,{small:!0,children:Object(d.jsx)(m.a,{year:"numeric",month:"short",day:"numeric",value:n})}):null},R=function(){var e,n,i,t,a,r,o,l,u,m,g,O,N=Object(I.f)(V,{ssr:!1,variables:E()}),S=N.data,P=N.loading,D=N.refetch,R=null;null!==S&&void 0!==S&&null!==(e=S.currentUser)&&void 0!==e&&e.paginatedInvoices&&
1(R=S.currentUser.paginatedInvoices);var B=Object(C.b)({perPage:25}),q=B.page,L=B.offset,U=B.openNextPage,K=B.openPrevPage,Q=Object(F.useRef)(null);Object(F.useEffect)((function(){var e;D(E(L)),null===(e=Q.current)||void 0===e||e.focus()}),[L]);var J=Boolean(null===S||void 0===S||null===(n=S.currentUser)||void 0===n?void 0:n.paymentMethod),G=!((null===(i=R)||void 0===i||null===(t=i.paginationInfo)||void 0===t?void 0:t.hasNextPage)||!1)||P,H=!((null===(a=R)||void 0===a||null===(r=a.paginationInfo)||void 0===r?void 0:r.hasPreviousPage)||!1)||P,X=(null===(o=R)||void 0===o||null===(l=o.paginationInfo)||void 0===l?void 0:l.totalRowCount)||0,W=X>0,Y=X>25,z=Object(F.useState)(null===(u=R)||void 0===u?void 0:u.rows),Z=z[0],ee=z[1];Object(F.useEffect)((function(){var e;ee(null===(e=R)||void 0===e?void 0:e.rows)}),[null===(m=R)||void 0===m?void 0:m.rows]);var ne=Object(F.useMemo)((function(){if(null===Z||void 0===Z||!Z.length)return[];var e=Object(j.groupBy)(Z,"status");return[].concat(Object(s.a)(e[h.f.collection_failed]||[]),Object(s.a)(e[h.f.open]||[]),Object(s.a)(e[h.f.draft]||[]),Object(s.a)(e[h.f.paid]||[]))}),[Z]),ie=Object(F.useCallback)((function(e,n){ee((function(i){if(!i)return i;var t=i.findIndex((function(n){return n.id===e}));if(-1===t)return i;var a=Object(s.a)(i);return a[t]=T(T({},a[t]),n),a}))}),[]),te=Object(F.useState)(!1),ae=te[0],re=te[1],de=Object(F.useState)(),oe=de[0],ce=de[1],se=Object(F.useState)(),le=se[0],ue=se[1],me=Object(F.useRef)(),ve=Object(x.a)(A,{onCompleted:function(e){switch(e.payInvoiceCharge.__typename){case"ConfirmationSessionStripe":ce(e.payInvoiceCharge);break;case"ChargeCompleted":me.current&&ie(me.current,{status:h.f.paid,paidAt:(new Date).toISOString(),payable:!1});break;case"ChargePending":ue(e.payInvoiceCharge.paymentDocument.token)}}}),ke=Object(c.a)(ve,2),pe=ke[0],be=ke[1],fe=Object(F.useCallback)((function(e){pe({variables:{invoiceId:e}}),me.current=e}),[pe]),je=Object(w.a)({token:le,type:h.l.invoice,paymentState:"success",skip:!le,onAsyncProcessCompleted:function(e){switch(e){case"success":me.current&&ie(me.current,{status:h.f.paid,paidAt:(new Date).toISOString(),payable:!1}),ue(void 0);break;case"error":case"cancelled":case"failed":ue(void 0)}}}),ye=Boolean(be.loading||oe||je.loading);return Object(d.jsxs)(d.Fragment,{children:[Object(d.jsx)(f.B,{textAlign:"center",children:Object(d.jsx)(v.a,{id:"invoices",defaultMessage:"Invoices"})}),P&&Object(d.jsx)(f.Y,{justifyContent:"center"}),!P&&Object(d.jsxs)(d.Fragment,{children:[oe&&Object(d.jsx)(_.a,{showSpinner:!1,clientSecret:oe.clientSecret,paymentMethod:oe.paymentMethodRef,token:oe.paymentDocument.token,type:h.l.invoice,publishableKey:oe.publishableKey,onError:function(){re(!0),ce(void 0)},onAsyncProcessCompleted:function(e){switch(e){case"success":me.current&&ie(me.current,{status:h.f.paid,paidAt:(new Date).toISOString(),payable:!1}),ce(void 0),re(!1);break;case"error":case"cancelled":case"failed":ce(void 0),re(!0)}}}),ae&&Object(d.jsx)(f.a,{variant:"error",children:Object(d.jsx)(v.a,{id:"StripeCheckout.confirmationSessionStripe.error",defaultMessage:"Could not confirm your payment card. Please try again or add a new payment card."})}),"PaymentIntentError"===(null===be||void 0===be||null===(g=be.data)||void 0===g?void 0:g.payInvoiceCharge.__typename)&&Object(d.jsx)(f.a,{variant:"error",mb:"sm",children:null===be||void 0===be||null===(O=be.data)||void 0===O?void 0:O.payInvoiceCharge.message}),!W&&Object(d.jsx)(f.a,{variant:"info",children:Object(d.jsx)(v.a,{id:"modules.Profile.Invoices.noInvoices",defaultMessage:"You have no invoices"})}),Object(d.jsx)("div",{ref:Q,tabIndex:0}),W&&Object(d.jsxs)(f.f,{children:[Object(d.jsx)(k.a,{children:Object(d.jsxs)(f.kb,{"data-testid":"Invoices__Table",variant:"simple",children:[Object(d.jsx)("thead",{children:Object(d.jsxs)(f.pb,{children:[Object(d.jsx)(f.nb,{style:{width:"44px"}}),Object(d.jsx)(f.nb,{children:Object(d.jsx)(v.a,{id:"description",defaultMessage:"Description"})}),Object(d.jsx)(f.nb,{textAlign:"center",children:Object(d.jsx)(v.a,{id:"period",defaultMessage:"Period"})}),Object(d.jsx)(f.nb,{children:Object(d.jsx)(v.a,{id:"total",defaultMessage:"Total"})}),Object(d.jsx)(f.nb,{}),Object(d.jsx)(f.nb,{})]})}),Object(d.jsx)("tbody",{children:ne.map((function(e){var n;if(!e)return null;var i=(null===e||void 0===e||null===(n=e.items)||void 0===n?void 0:n.length)||0,t=ye&&me.current===e.id;return Object(d.jsxs)(f.pb,{children:[Object(d.jsx)(f.lb,{style:{width:"44px",paddingRight:0,verticalAlign:"middle"},children:Object(d.jsx)(M,{status:e.status,"data-testid":"Invoices__Table__Row__".concat(e.id,"__Icon")})}),Object(d.jsxs)(f.lb,{width:290,children:["InvoiceTrip"===e.__typename&&Object(d.jsxs)(f.mb,{bold:!0,children:[Object(d.jsxs)("span",{children:[i," "]}),Object(d.jsx)(f.I,{values:{count:i}})]}),e.status===h.f.collection_failed&&Object(d.jsx)(f.mb,{small:!0,children:Object(d.jsx)(v.a,{id:"invoice.status.collection_failed",defaultMessage:"Payment failed"})}),e.status===h.f.open&&Object(d.jsx)(f.mb,{small:!0,children:Object(d.jsx)(v.a,{id:"awaiting_payment",defaultMessage:"Awaiting payment"})}
1),e.status===h.f.draft&&Object(d.jsx)(f.mb,{small:!0,children:Object(d.jsx)(v.a,{id:"modules.Profile.Invoices.scheduledCharge",defaultMessage:"Will be charged on {0} or when exceeds {1}",values:{0:Object(p.a)(Object(b.a)(e.periodEnd),"d MMM yyyy"),1:"".concat(e.totalLimit," ").concat(e.currency)}})}),e.paidAt&&Object(d.jsx)(f.mb,{small:!0,children:Object(d.jsx)(v.a,{id:"paid_on",defaultMessage:"Paid on {0}",values:{0:Object(p.a)(Object(b.a)(e.paidAt),"d MMM yyyy")}})})]}),Object(d.jsxs)(f.lb,{textAlign:"center",children:[Object(d.jsx)($,{value:e.periodStart}),"-",Object(d.jsx)($,{value:e.periodEnd})]}),Object(d.jsx)(f.lb,{verticalAlign:"middle",children:Object(d.jsx)(y.a,{value:e.total})}),Object(d.jsx)(f.lb,{textAlign:"center",verticalAlign:"middle",children:e.payable&&Object(d.jsxs)(f.g,{variant:"primary",onClick:function(){return fe(e.id)},size:"small",disabled:ye||!J,children:[t&&Object(d.jsx)(f.ib,{}),!t&&Object(d.jsxs)(f.mb,{fontSize:0,children:[e.status===h.f.draft&&Object(d.jsx)(v.a,{id:"pay_now",defaultMessage:"Pay now"}),e.status===h.f.collection_failed&&Object(d.jsx)(v.a,{id:"trip.retry",defaultMessage:"Retry"}),e.status===h.f.open&&Object(d.jsx)(v.a,{id:"pay",defaultMessage:"Pay"})]})]})}),Object(d.jsx)(f.lb,{verticalAlign:"middle",children:Object(d.jsx)(f.mb,{small:!0,children:Object(d.jsx)(f.V,{route:"invoices.plain",params:{token:e.token},passHref:!0,children:Object(d.jsx)(f.b,{"data-testid":"Invoices__Table__Row__".concat(e.id,"__Link"),children:Object(d.jsx)(v.a,{id:"modules.Profile.Invoices.table.viewInvoice",defaultMessage:"View invoice"})})})})})]},e.id)}))})]})}),Y&&Object(d.jsx)(C.a,{page:q,onNextClick:U,isNextDisabled:G,onPrevClick:K,isPrevDisabled:H,buttonGroupProps:{style:{marginTop:"1em"}}})]})]})]})},B=i("H8l1"),q=i("n8X0"),L=function(e){var n=e.url,i=e.statusCode;return Object(d.jsx)(o.a,{statusCode:i,url:n,children:function(){return Object(d.jsx)(R,{})}})};L.getInitialProps=function(){var e=Object(r.a)(a.a.mark((function e(n){var i,t,r;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.apolloClient.query({query:B.e});case 2:return t=e.sent,null!==(i=t.data)&&void 0!==i&&i.profilePage||(r=404,n.res&&(n.res.statusCode=r)),e.abrupt("return",{statusCode:r});case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();n.default=Object(q.a)(L)}},[["FHgg",1,2,3,33,0,4,5,6,7,8,10,15,28]]]); 2//# sourceMappingURL=profile.invoices-574c0af10fe6f73d0dc5.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.