(window.webpackJsonp=window.webpackJsonp||[]).push([[63],{F0Rd:function(e,r,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/delivery-providers/new",function(){var e=n("XfjD");return{page:e.default||e}}])},XfjD:function(e,r,n){"use strict";n.r(r);var t=n("q1tI"),a=n.n(t),i=n("yE/o"),o=n("gaPq"),d=n("zrwo"),l=n("kOwS"),v=n("dfwq"),c=n("rt45"),u=n("qNsG"),p=n("eHHv"),y=n("lTCR"),s=n.n(y),f=n("nOHt"),P=n("4KRT"),b=n("hePV"),m=n.n(b),T=n("gmoh"),j=n.n(T),O=n("fjVX"),w=n.n(O),D=n("oB+O"),_=n.n(D),h=n("7zkD"),E=n("PaXs");function g(){var e=Object(c.a)(["\n      mutation create($deliveryProvider: CreateProviderInput!) {\n        createDeliveryProvider(deliveryProvider: $deliveryProvider) {\n          _id\n        }\n      }\n    "]);return g=function(){return e},e}function S(){var e=Object(c.a)(['\n    query getDeliveryProviderType($providerType: DeliveryProviderType!) {\n      deliveryProviderType: __type(name: "DeliveryProviderType") {\n        options: enumValues {\n          value: name\n          label: description\n        }\n      }\n      deliveryInterfaces(type: $providerType) {\n        _id\n        value: _id\n        label\n      }\n    }\n  ']);return S=function(){return e},e}var q=Object(p.a)(f.withRouter,Object(p.h)("providerType","updateProviderType","SHIPPING"),Object(P.c)(s()(S())),Object(P.c)(s()(g()),{name:"createDeliveryProvider",options:{refetchQueries:["deliveryProviders"]}}),Object(h.a)(function(e){var r=e.providerType,n=e.data,t=(n=void 0===n?{}:n).deliveryProviderType,a=void 0===t?{options:[]}:t,i=n.deliveryInterfaces,o=void 0===i?[]:i;return{type:{type:String,optional:!1,label:"Type",defaultValue:r,uniforms:{options:[{label:"Choose Type",value:null}].concat(Object(v.default)(a.options))}},adapterKey:{type:String,optional:!1,label:"Adapter",uniforms:{options:[{label:"Choose Adapter",value:null}].concat(Object(v.default)(o))}}}}),Object(p.f)({onSubmitSuccess:function(e){var r=e.router;return function(e){var n=e.data.createDeliveryProvider;r.replace({pathname:"/delivery-providers/edit",query:{_id:n._id}})}},onSubmit:function(e){var r=e.createDeliveryProvider,n=e.schema;return function(e){var t=Object(l.a)({},e);return r({variables:{deliveryProvider:n.clean(t)}})}}}),E.a,Object(p.d)(function(e){e.createDeliveryProvider;var r=Object(u.a)(e,["createDeliveryProvider"]);return Object(d.a)({},r)}))(function(e){var r=e.providerType,n=e.updateProviderType,t=Object(u.a)(e,["providerType","updateProviderType"]);return a.a.createElement(_.a,t,a.a.createElement(m.a,{name:"type",onChange:n}),r&&a.a.createElement(m.a,{name:"adapterKey"}),a.a.createElement(w.a,null),a.a.createElement(j.a,{value:"Add Delivery provider",className:"primary"}))}),I=n("PZVx");r.default=Object(I.a)(function(e){return a.a.createElement(o.a,e,a.a.createElement(i.a,null,a.a.createElement("p",null,"New Delivery"),a.a.createElement(q,null)))})}},[["F0Rd",1,0]]]);