(window.webpackJsonp=window.webpackJsonp||[]).push([[37],{B5hm:function(t,e,n){"use strict";n.r(e);var r=n("Ff2n"),a=n("q1tI"),o=n.n(a),c=n("nOHt"),i=n("eHHv"),u=n("yE/o"),s=n("gaPq"),l=n("rePB"),f=n("wx14"),p=n("KQm4"),b=n("h4VS"),O=n("lTCR"),m=n.n(O),y=n("0dmp"),j=n("hePV"),d=n.n(j),v=n("gmoh"),h=n.n(v),w=n("fjVX"),S=n.n(w),g=n("oB+O"),P=n.n(g),_=n("7zkD"),A=n("PaXs"),E=o.a.createElement;function T(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function D(){var t=Object(b.a)(["\n    mutation create($filter: CreateFilterInput!) {\n      createFilter(filter: $filter) {\n        _id\n      }\n    }\n  "]);return D=function(){return t},t}function k(){var t=Object(b.a)(['\n    query getFilterTypes {\n      uniforms: __type(name: "FilterType") {\n        options: enumValues {\n          value: name\n          label: description\n        }\n      }\n    }\n  ']);return k=function(){return t},t}var B=Object(i.a)(Object(y.a)(m()(k())),Object(y.a)(m()(D())),Object(_.a)((function(t){var e=t.data,n=(e=void 0===e?{}:e).uniforms,r=void 0===n?{options:[]}:n;return{title:{type:String,optional:!1,label:"Name"},key:{type:String,optional:!1,label:"Key"},type:{type:String,optional:!1,label:"Type",uniforms:{options:[{label:"Choose Type",value:null}].concat(Object(p.a)(r.options))}}}})),Object(i.f)({onSubmitSuccess:function(t){var e=t.onSuccess;return function(t){var n=t.data.createFilter;e(n._id)}},onSubmit:function(t){var e=t.mutate,n=t.schema;return function(t){var r=Object(f.a)({},t);return e({variables:{filter:n.clean(r)}})}}}),A.a,Object(i.d)((function(t){t.onSuccess,t.mutate;return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?T(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},Object(r.a)(t,["onSuccess","mutate"]))})),i.e)((function(t){return E(P.a,t,E(d.a,{name:"title"}),E(d.a,{name:"key"}),E(d.a,{name:"type"}),E(S.a,null),E(h.a,{value:"Add filter",className:"primary"}))})),F=n("PZVx"),I=o.a.createElement;e.default=Object(F.a)(Object(i.a)(c.withRouter,Object(i.f)({onSuccess:function(t){var e=t.router;return function(t){e.push({pathname:"/filters/edit",query:{_id:t}})}}}))((function(t){var e=t.onSuccess,n=Object(r.a)(t,["onSuccess"]);return I(s.a,n,I(u.a,null,I("p",null,"New filter"),I(B,{onSuccess:e})))})))},BsWD:function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n("a3WO");function a(t,e){if(t){if("string"===typeof t)return Object(r.a)(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(t,e):void 0}}},KQm4:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("a3WO");var a=n("BsWD");function o(t){return function(t){if(Array.isArray(t))return Object(r.a)(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||Object(a.a)(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},a3WO:function(t,e,n){"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}n.d(e,"a",(function(){return r}))},hUop:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/filters/new",function(){return n("B5hm")}])}},[["hUop",0,2,5,1,3,4,6]]]);