1_N_E=(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[51],{S0tk:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/invoices.plain",function(){return n("qh5l")}])},oIFK:function(e,t,n){"use strict";function i(e){return Array.isArray(e)?e[0]:e}function a(e){if(e.req)return e.req.locale;var t=i(e.query.locale);return t||(t="en"),t}function r(e){if(e){var t={"at-b-free":"/atb/campaign","at-b-gratis":"/atb/kampanje","obos-365-day-pass":"/obos/campaign","obos-365-dagerspass":"/obos/kampanje","obos-season-pass-2024":"/obos/campaign","obos-sesongpass-2024":"/obos/kampanje","obos-30-day-subscription":"/obos/campaign","obos-30-dagers-abonnement":"/obos/kampanje"};for(var n in t)if(e.includes(n)){history.replaceState({},n,t[n]);break}}}n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return r}))},qh5l:function(e,t,n){"use strict";n.r(t);var i=n("vJKn"),a=n.n(i),r=n("rg98"),d=n("nKUr"),s=n("bgFo"),c=n("cpVT"),o=n("7++0"),l=n("dDsW"),u=n("kriW"),m=n("hG6G"),j=n("q1tI"),b=n("SY7M"),p=n("auP5"),v=n("OUWn"),k=n("nocy");function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){Object(c.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object(o.e)({"react-intl-formatted-duration.daysUnit":{id:"react-intl-formatted-duration.daysUnit",defaultMessage:"{value, plural, one {day} other {days}}"},"react-intl-formatted-duration.hoursUnit":{id:"react-intl-formatted-duration.hoursUnit",defaultMessage:"{value, plural, one {hour} other {hours}}"},"react-intl-formatted-duration.minutesUnit":{id:"react-intl-formatted-duration.minutesUnit",defaultMessage:"{value, plural, one {min} other {min}}"},"react-intl-formatted-duration.secondsUnit":{id:"react-intl-formatted-duration.secondsUnit",defaultMessage:"{value, plural, one {second} other {seconds}}"}});var f=Object(o.e)({totalAmount:{id:"total",defaultMessage:"Total"},invoiceAdjustment:{id:"invoice.adjustment",defaultMessage:"Adjustment"},vat:{id:"modules.Receipt.orderTypes.vat",defaultMessage:"VAT"},fromStation:{id:"modules.Receipt.orderTypes.fromStation",defaultMessage:"From {station} ({date})"},toStation:{id:"modules.Receipt.orderTypes.toStation",defaultMessage:"To {station} ({date})"},totalTime:{id:"modules.Receipt.orderTypes.totalTime",defaultMessage:"Total time: {totalTime}"}}),x={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric"};var h={InvoiceTrip:function(e){var t,n=e.invoice,i=n,a=i.totalVat||0,r=i.vatRate||0;return Object(d.jsx)(d.Fragment,{children:Object(d.jsxs)(p.P,{children:[Object(d.jsxs)("tbody",{children:[null===(t=n.items)||void 0===t?void 0:t.map((function(e){var t;return Object(d.jsx)(d.Fragment,{children:"InvoiceItemTrip"===e.__typename?Object(d.jsxs)(j.Fragment,{children:[Object(d.jsx)(p.T,{children:Object(d.jsx)(p.Q,{textAlign:"left",colSpan:2,children:Object(d.jsx)(u.a,g(g({},f.fromStation),{},{values:{station:e.trip.startDock&&((null===(t=e.trip)||void 0===t?void 0:t.startDock.dockGroup.title)||e.trip.startDock.dockGroup.name||e.trip.startDock.dockGroup.id),date:e.trip.startedAt&&Object(d.jsx)(o.a,g({value:e.trip.startedAt},x))}}))})}),Object(d.jsx)(p.T,{children:Object(d.jsx)(p.Q,{textAlign:"left",colSpan:2,children:Object(d.jsx)(u.a,g(g({},f.toStation),{},{values:{station:e.trip.endDock&&(e.trip.endDock.dockGroup.title||e.trip.endDock.dockGroup.name||e.trip.endDock.dockGroup.id),date:e.trip.endedAt&&Object(d.jsx)(o.a,g({value:e.trip.endedAt},x))}}))})}),Object(d.jsxs)(p.T,{children:["number"===typeof e.trip.duration&&Object(d.jsx)(p.Q,{textAlign:"left",colSpan:1,children:Object(d.jsx)(u.a,g(g({},f.totalTime),{},{values:{totalTime:Object(d.jsx)(b.a,{format:"{days} {hours} {minutes} {seconds}",seconds:e.trip.duration})}}))}),e.amount&&Object(d.jsx)(p.Q,{textAlign:"right",colSpan:1,children:Object(d.jsx)(k.a,{value:e.amount,precision:2})})]})]},e.id):Object(d.jsxs)(j.Fragment,{children:[" ",Object(d.jsxs)(p.T,{children:[Object(d.jsx)(p.Q,{colSpan:1,children:Object(d.jsx)(p.R,{children:Object(d.jsx)(u.a,g({},f.invoiceAdjustment))})}),Object(d.jsx)(p.Q,{textAlign:"right",children:e.amount&&Object(d.jsx)(k.a,{value:e.amount,precision:2})})]})]},e.id)})})),i.status===v.f.draft&&i.periodEnd&&Object(d.jsx)(p.T,{children:Object(d.jsx)(p.Q,{textAlign:"left",colSpan:2,children:"\xa0"})}),Object(d.jsxs)(p.T,{children:[Object(d.jsx)(p.Q,{colSpan:1,children:Object(d.jsx)(p.R,{fontWeight:"bold",children:Object(d.jsx)(u.a,g({},f.totalAmount))})}),Object(d.jsx)(p.Q,{textAlign:"right",children:n.total&&Object(d.jsx)(k.a,{value:n.total,precision:2})})]})]}),Object(d.jsx)("tfoot",{children:Object(d.jsxs)(p.T,{children:[Object(d.jsx)(p.Q,{children:Object(d.jsx)(p.R,{mute:!0,small:!0,children:Object(d.jsx)(u.a,g({},f.vat))})}),Object(d.jsxs)(p.Q,{textAlign:"right",children:[Object(d.jsx)(p.R,{mute:!0,small:!0,children:Object(d.jsx)(k.a,{value:a,precision:2})}),Object(d.jsxs)(p.R,{mute:!0,small:!0,children:[Object(d.jsx)(o.b,{value:r,maximumFractionDigits:2,minimumFractionDigits:2}),"%"]})]})]})})]})})}},y=n("sYXu"),N=n("g4pe"),S=n.n(N),F=n("qrrX"),A=n("dRa/"),T=n("sWYD"),M=n("4+6U");function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?w(Object(n),!0).forEach((function(t){Object(c.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function D(e){var t=new Error(e);return t.code="ENOENT",t}var P=Object(o.e)({header:{id:"invoice",defaultMessage:"Invoice"},status:{id:"modules.Profile.YourData.table.label.status",defaultMessage:"Status"},scheduledCharge:{id:"modules.Profile.Invoices.dueDate",defaultMessage:"Due date: {0} ( or when exceeds {1})"},void:{id:"invoice.status.void",defaultMessage:"Void"},uncollectible:{id:"invoice.status.uncollectible",defaultMessage:"Not collectible"},paid:{id:"invoice.status.paid",defaultMessage:"Paid"},open:{id:"invoice.status.open",defaultMessage:"Open"},draft:{id:"invoice.status.draft",defaultMessage:"Draft"},collection_failed:{id:"invoice.status.collection_failed",defaultMessage:"Payment failed"}});var E=function(e){var t,n,i,a=e.invoice,r=e.showHeader,c=void 0===r||r,j=Object(l.a)(),b=Object(m.b)(),p=Object(A.c)();if(b.loading)return null;if(!a)throw D("Invoice not found");if(!b.data||!b.data.settings)throw D("Settings not found");var k=b.data.settings,O=k&&k.footer,g=null===(t=a.completedPaymentTransaction)||void 0===t?void 0:t.transactionNumber,f="InvoiceTrip"===a.__typename&&a.status===v.f.draft&&a.periodEnd&&a.totalLimit&&Object(d.jsx)(s.mb,{as:"p",mute:!0,textAlign:"right",mb:4,children:Object(d.jsx)(u.a,_(_({},P.scheduledCharge),{},{values:{0:Object(T.a)(Object(M.a)(a.periodEnd),"d MMM yyyy"),1:"".concat(a.totalLimit," ").concat(a.currency)}}))}),x=h[a.__typename];if(!x)throw new Error("Renderer for ".concat(a.__typename," not found"));return Object(d.jsxs)(d.Fragment,{children:[Object(d.jsx)(S.a,{children:Object(d.jsx)("title",{children:j.formatMessage(P.header)})}),c&&Object(d.jsx)(y.a,{sanitySettings:k,companyName:null}),Object(d.jsxs)(s.t,{justifyContent:"space-between",mb:2,children:[Object(d.jsxs)(s.t,{flexDirection:"column",justifyContent:"space-between",flexWrap:"nowrap",children:[Object(d.jsx)(s.y,{fontSize:4,mb:1,children:Object(d.jsx)(u.a,_({},P.header))}),Object(d.jsx)(s.mb,{as:"p",mute:!0,mb:1,children:Object(T.a)(Object(M.a)(a.createdAt),"d MMM yyyy")})]}),Object(d.jsxs)(s.t,{flexDirection:"column",justifyContent:"space-between",flexWrap:"nowrap",children:[Object(d.jsxs)(s.mb,{as:"p",textAlign:"right",mb:1,mt:4,children:[Object(d.jsx)(u.a,_({},P.status)),": ",Object(d.jsx)(s.mb,{as:"span",bold:!0,children:Object(d.jsx)(u.a,_({},P[a.status]))})]}),Object(d.jsx)(s.mb,{as:"p",textAlign:"right",mb:1,children:Object(d.jsx)(u.a,{id:"modules.Receipt.invoiceNumber",defaultMessage:"Invoice #{id}",values:{id:a.id}})})]})]}),f,Object(d.jsx)(s.e,{mb:2,children:Object(d.jsx)(x,{invoice:a})}),Object(d.jsx)(s.e,{mb:4,children:Object(d.jsxs)(s.W,{children:[Object(d.jsxs)(s.U,{children:[!g&&(null===a||void 0===a?void 0:a.status)===v.f.paid&&Object(d.jsx)(u.a,{id:"could_not_load_payment_transaction",defaultMessage:"Could not load payment transaction"}),g&&Object(d.jsx)(u.a,{id:"transaction_number_str",defaultMessage:"Transaction number: {transactionNumber}",values:{transactionNumber:g}})]},"transactionNumber"),a.paidAt&&Object(d.jsx)(s.U,{children:Object(d.jsx)(u.a,{id:"date_completed_at",defaultMessage:"Date: {completedAt}",values:{completedAt:Object(d.jsx)(o.a,{value:a.paidAt,year:"numeric",month:"long",day:"2-digit",hour:"numeric",minute:"numeric"})}})},a.paidAt),"Card"===(null===a||void 0===a||null===(n=a.completedPaymentTransaction)||void 0===n||null===(i=n.paymentMethod)||void 0===i?void 0:i.__typename)&&a.completedPaymentTransaction.paymentMethod.last4&&Object(d.jsx)(s.U,{"data-testid":"Receipt__creditCardMasked",children:Object(d.jsx)(u.a,{id:"card_creditCardMasked",defaultMessage:"Card: {creditCardMasked}",values:{creditCardMasked:a.completedPaymentTransaction.paymentMethod.last4}})},a.completedPaymentTransaction.paymentMethod.last4)]})}),p.contactEmail&&Object(d.jsx)(s.mb,{textAlign:"center",as:"p",mb:4,children:Object(d.jsx)(u.a,{id:"modules.Receipt.contact",defaultMessage:"For customer service or other inquiries please send us an email to {contactEmail}",values:{contactEmail:Object(d.jsx)(s.b,{color:"text",href:"mailto:".concat(p.contactEmail),children:p.contactEmail})}})}),O&&O.aboutOperator&&Object(d.jsx)(s.mb,{textAlign:"center",small:!0,mute:!0,children:Object(d.jsx)(F.a,{blocks:O.aboutOperator})})]})},I=n("oIFK"),C=n("n8X0"),R=n("+TN3"),U={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"invoiceQuery"}
1,variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"token"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"invoice"},arguments:[{kind:"Argument",name:{kind:"Name",value:"token"},value:{kind:"Variable",name:{kind:"Name",value:"token"}}}],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:"updatedAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"vatRate"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"description"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"items"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amount"},arguments:[],directives:[]},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"InvoiceItemTrip"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"trip"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"startedAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"endedAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"duration"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"startDock"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"dockGroup"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"endDock"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"dockGroup"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},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:"totalVat"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"total"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paidAt"},arguments:[],directives:[]},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"InvoiceTrip"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalLimit"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"completedPaymentTransaction"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"transactionNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"paymentMethod"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Card"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"expMonth"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"expYear"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"last4"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"brand"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"expiresAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"expired"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"displayBrand"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:1105,source:{body:"\n query invoiceQuery($token: String!) {\n invoice(token: $token) {\n id\n systemId\n status\n currency\n createdAt\n updatedAt\n vatRate\n description\n items {\n id\n amount\n ... on InvoiceItemTrip {\n trip {\n id\n startedAt\n endedAt\n duration\n startDock {\n dockGroup {\n id\n name\n title\n }\n }\n endDock {\n dockGroup {\n id\n name\n title\n }\n }\n }\n }\n }\n periodStart\n periodEnd\n totalVat\n total\n paidAt\n ... on InvoiceTrip {\n totalLimit\n }\n completedPaymentTransaction {\n transactionNumber\n paymentMethod {\n ... on Card {\n expMonth\n expYear\n last4\n brand\n expiresAt\n expired\n displayBrand\n }\n }\n }\n __typename\n }\n }\n",name:"GraphQL request",locationOffset:{line:1,column:1}}}},q=function(e){var t=e.token,n=Object(R.f)(U,{variables:{token:t}}).data;return Object(d.jsx)(s.e,{maxWidth:800,width:1,p:"sm",mx:"auto",children:(null===n||void 0===n?void 0:n.invoice)&&Object(d.jsx)(E,{invoice:n.invoice})})};q.getInitialProps=function(){var e=Object(r.a)(a.a.mark((function e(t){var n,i,r,d,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=Object(I.b)(t.query.token)){e.next=5;break}throw(r=new Error("Page not found")).code="ENOENT",r;case 5:return e.next=7,t.apolloClient.query({query:U,variables:{token:i}});case 7:return d=e.sent,null!==(n=d.data)&&void 0!==n&&n.invoice||(s=404,t.res&&(t.res.statusCode=s)),e.abrupt("return",{statusCode:s,token:i});case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();t.default=Object(C.a)(q)},sYXu:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return u}));var i=n("nKUr"),a=n("bgFo"),r=n("DPir"),d=n("hK0Q"),s=n("qrrX"),c=n("YyUk"),o=n("dRa/"),l=function(e){var t,n=e.sanitySett
1ings,s=e.companyName,l=Object(d.d)(),u=Object(o.c)(),m=Object(r.e)(l,u);m&&(t=c.e+"/v1/favicons/public-web/".concat(m,"/android-chrome-256x256.png"));var j,b=n.title;b&&(j=!0);return Object(i.jsxs)(a.e,{textAlign:"center",children:[t&&Object(i.jsx)(a.e,{mb:"xxs",color:"primaryText",width:100,mx:"auto",children:Object(i.jsx)(a.P,{width:100,src:t})}),j&&Object(i.jsxs)(a.mb,{as:"p",color:"primaryText",typoStyle:"xs",children:[b," ",s&&"| ".concat(s)]})]})},u=function(e){var t=e.children,n=e.textAlign,r=e.companyName,d=e.sanitySettings;return Object(i.jsxs)(a.e,{textAlign:n,m:"sm",children:[Object(i.jsx)(l,{companyName:r,sanitySettings:d}),t,d.footer&&d.footer.aboutOperator&&Object(i.jsx)(a.mb,{fontWeight:"normal",textAlign:"center",small:!0,mute:!0,children:Object(i.jsx)(s.a,{blocks:d.footer.aboutOperator})})]})}}},[["S0tk",1,2,3,0,4,5,15]]]); 2//# sourceMappingURL=invoices.plain-8cc7673a61f649f97fee.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.