(window.webpackJsonp=window.webpackJsonp||[]).push([[56],{"5+ye":function(e,t,r){"use strict";r.r(t);var n=r("wx14"),a=r("q1tI"),l=r.n(a),i=r("yE/o"),o=r("gaPq"),s=r("h4VS"),u=r("Ff2n"),c=r("lTCR"),d=r.n(c),p=r("ikXu"),b=r("YFqc"),f=r.n(b),m=r("YRLc"),O=l.a.createElement;function w(){var e=Object(s.a)(["\n    query subscriptions($offset: Int, $limit: Int) {\n      subscriptions(offset: $offset, limit: $limit) {\n        _id\n        status\n        expires\n        subscriptionNumber\n        user {\n          _id\n          name\n        }\n        status\n      }\n    }\n  "]);return w=function(){return e},e}var h=Object(m.b)({queryName:"subscriptions",query:d()(w())})((function(e){e.isShowCarts,e.toggleShowCarts,e.loading,e.updateHasMore,e.setShowCarts;var t=Object(u.a)(e,["isShowCarts","toggleShowCarts","loading","updateHasMore","setShowCarts"]);return O(m.a,Object(n.a)({},t,{cols:5,createPath:null,rowRenderer:function(e){return O(p.a.Row,{key:e._id},O(p.a.Cell,null,O(f.a,{href:"/subscriptions/view?_id=".concat(e._id)},O("a",{href:"/subscriptions/view?_id=".concat(e._id)},e.subscriptionNumber?O(l.a.Fragment,null,O("b",null,e.subscriptionNumber),O("small",null,"\xa0(",e._id,")")):O(l.a.Fragment,null,O("b",null,"Subscription"),O("small",null,"\xa0(",e._id,")"))))),O(p.a.Cell,null,e.user&&(e.user.name||e.user._id)),O(p.a.Cell,null,e.expires&&new Date(e.expires).toLocaleDateString()),O(p.a.Cell,null,e.status))}}),O(p.a.Row,null,O(p.a.HeaderCell,null,"Subscription #"),O(p.a.HeaderCell,null,"User"),O(p.a.HeaderCell,null,"Expires"),O(p.a.HeaderCell,null,"Status")))})),g=r("PZVx"),j=l.a.createElement;t.default=Object(g.a)((function(e){var t=Object(n.a)({},e);return j(o.a,t,j(i.a,null,j("h2",null,"Subscriptions"),j(h,null)))}))},P7N4:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/subscriptions",function(){return r("5+ye")}])},YRLc:function(e,t,r){"use strict";r.d(t,"b",(function(){return y}));var n=r("KQm4"),a=r("rePB"),l=r("wx14"),i=r("Ff2n"),o=r("eHHv"),s=r("0dmp"),u=r("q1tI"),c=r.n(u),d=r("ikXu"),p=r("QetY"),b=r("D1pA"),f=r("RotF"),m=r.n(f),O=r("YFqc"),w=r.n(O),h=c.a.createElement;function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){Object(a.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.items,r=e.cols,n=void 0===r?4:r,a=e.rowRenderer,o=e.createPath,s=(e.data,e.children),u=e.loadMoreEntries,c=(e.loading,e.limit),f=Object(i.a)(e,["items","cols","rowRenderer","createPath","data","children","loadMoreEntries","loading","limit"]);return h(d.a,Object(l.a)({celled:!0},f),h(d.a.Header,null,h(d.a.Row,null,h(d.a.HeaderCell,{colSpan:n},o&&h(w.a,{href:o},h(p.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:o},h(b.a,{name:"plus"}),"Add")))),s),t&&h(m.a,{pageStart:0,element:"tbody",loadMore:u,hasMore:null===c||void 0===c||c},t.map(a)),h(d.a.Footer,{fullWidth:!0},h(d.a.Row,null,h(d.a.HeaderCell,{colSpan:n},o&&h(w.a,{href:o},h(p.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:o},h(b.a,{name:"plus"})," Add"))))))};var y=function(e){var t=e.query,r=e.queryName,l=e.itemsPerPage,u=void 0===l?5:l;return Object(o.a)(Object(s.a)(t,{options:function(e){var t=e.queryOptions,r=Object(i.a)(e,["queryOptions"]);return j({variables:j({offset:0,limit:u},r)},t)},props:function(e){var t=e.data,l=t.loading,o=t.fetchMore,s=t.stopPolling,u=Object(i.a)(t,["loading","fetchMore","stopPolling"]);return{loading:l,items:u[r],loadMoreEntries:function(){return s(),o({variables:{offset:u[r].length},updateQuery:function(e,t){var l=t.fetchMoreResult;return l?j(j({},e),{},Object(a.a)({},r,[].concat(Object(n.a)(e[r]),Object(n.a)(l[r])))):e}})}}}}))}}},[["P7N4",0,2,5,1,3,4,7]]]);