_N_E=(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[47],{m3tS:function(e,t,r){"use strict";r.r(t);var n=r("rePB"),c=r("nKUr"),i=(r("q1tI"),r("yE/o")),l=r("gaPq"),o=r("KQm4"),s=r("h4VS"),a=r("eHHv"),j=r("UYTu"),f=r("JznV"),b=r("ikXu"),d=r("QetY"),O=r("D1pA"),u=r("NrgV"),h=r("RotF"),p=r.n(h),x=r("YFqc"),y=r.n(x);function w(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 m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function g(){var e=Object(s.a)(["\n  query filters($offset: Int, $limit: Int) {\n    filters(offset: $offset, limit: $limit, includeInactive: true) {\n      _id\n      isActive\n      key\n      type\n      texts {\n        _id\n        title\n      }\n      options {\n        _id\n        value\n      }\n    }\n  }\n"]);return g=function(){return e},e}var v=Object(j.a)(g()),P=Object(a.a)(Object(a.c)({limit:20,offset:0}),Object(a.h)("hasMore","updateHasMore",!0),Object(f.a)(v,{options:function(){return{variables:{offset:0,limit:10}}},props:function(e){var t=e.data,r=t.loading,n=t.filters,c=t.fetchMore,i=e.ownProps.updateHasMore;return{loading:r,filters:n,loadMoreEntries:function(){return c({variables:{offset:n.length,limit:10},updateQuery:function(e,t){var r=t.fetchMoreResult;if(!r||0===r.filters.length)return i(!1),e;var n=r.filters[0]._id;return e.filters.reduce((function(e,t){return t._id===n||e}),!1)?(i(!1),e):m(m({},e),{},{filters:[].concat(Object(o.a)(e.filters),Object(o.a)(r.filters))})}})}}}}),a.e)((function(e){var t=e.filters,r=e.loadMoreEntries,n=e.hasMore;return Object(c.jsxs)(b.a,{celled:!0,children:[Object(c.jsxs)(b.a.Header,{children:[Object(c.jsx)(b.a.Row,{children:Object(c.jsx)(b.a.HeaderCell,{colSpan:"4",children:Object(c.jsx)(y.a,{href:"/filters/new",children:Object(c.jsxs)(d.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:"/filters/new",children:[Object(c.jsx)(O.a,{name:"plus"}),"Add"]})})})}),Object(c.jsxs)(b.a.Row,{children:[Object(c.jsx)(b.a.HeaderCell,{children:"Key (Name)"}),Object(c.jsx)(b.a.HeaderCell,{children:"Type"}),Object(c.jsx)(b.a.HeaderCell,{children:"Active?"}),Object(c.jsx)(b.a.HeaderCell,{children:"Options"})]})]}),t&&Object(c.jsx)(p.a,{element:"tbody",loadMore:r,hasMore:n,loader:Object(c.jsx)(b.a.Row,{children:Object(c.jsx)(b.a.Cell,{colSpan:"4",children:Object(c.jsx)(u.a,{active:!0,inline:"centered"})})},"filter-loader"),children:t.map((function(e){return Object(c.jsxs)(b.a.Row,{children:[Object(c.jsx)(b.a.Cell,{children:Object(c.jsx)(y.a,{href:"/filters/edit?_id=".concat(e._id),children:Object(c.jsxs)("a",{href:"/filters/edit?_id=".concat(e._id),children:[e.key,"\xa0",e.texts?"( ".concat(e.texts.title," )"):""]})})}),Object(c.jsx)(b.a.Cell,{children:e.type}),Object(c.jsx)(b.a.Cell,{children:e.isActive&&Object(c.jsx)(O.a,{color:"green",name:"checkmark",size:"large"})}),Object(c.jsx)(b.a.Cell,{children:e.options&&e.options.length})]},e._id)}))}),Object(c.jsx)(b.a.Footer,{fullWidth:!0,children:Object(c.jsx)(b.a.Row,{children:Object(c.jsx)(b.a.HeaderCell,{colSpan:"4",children:Object(c.jsx)(y.a,{href:"/filters/new",children:Object(c.jsxs)(d.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:"/filters/new",children:[Object(c.jsx)(O.a,{name:"plus"}),"Add"]})})})})})]})})),_=r("PZVx");function E(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 C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.default=Object(_.a)((function(e){return Object(c.jsx)(l.a,C(C({},e),{},{children:Object(c.jsxs)(i.a,{children:[Object(c.jsx)("h2",{children:"Filters"}),Object(c.jsx)(P,{})]})}))}))},rn2o:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/filters",function(){return r("m3tS")}])}},[["rn2o",0,2,3,1,4,5,16]]]);