1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3613],{26322:function(e,s,r){"use strict";r.d(s,{F:function(){return t}});var o=r(39261),t=function(e,s){var r;return Boolean(null===(r=o.W3[s])||void 0===r?void 0:r.includes(e))}},90394:function(e,s,r){"use strict";r.r(s),r.d(s,{__N_SSP:function(){return x},default:function(){return j}});var o=r(67294),t=r(11163),l=r(17834),i=r(10267),n=r(51252),c=r(5517),u=r(15894),a=r(64592),d=r(67244),m=r(56487),h=r(74066),f=r(26322),p=r(2531),v=r(85893),x=!0;function j(e){var s=e.user,r=e.countries,x=e.colors,j=e.allSubCategories,b=e.productMaterials,g=e.leadTimes,y=e.productLimitCount,_=y.hasLeft,N=y.maximumAmountOfProducts,Z=e.manufacturers,w=(0,t.useRouter)(),C=(0,o.useState)(null),F=C[0],P=C[1],S=(0,h.G)(),T=S.galleryFiles,k=S.setGalleryFiles,A=S.setLocalGalleryFiles,E=S.removeFromLocalGalleryFiles,L=(0,m.U)({user:s,galleryFiles:T,onSuccess:function(e){var s;return U?setTimeout((function(){var s;return w.push("/product/edit/".concat(null===e||void 0===e||null===(s=e.product)||void 0===s?void 0:s.id))}),2e3):w.push("/product/edit/".concat(null===e||void 0===e||null===(s=e.product)||void 0===s?void 0:s.id))}}),G=L.handleSubmit,O=L.isLoading,U=L.errors,D=L.message;return(0,v.jsxs)("main",{id:"main",className:"mt-3 mx-3",children:[(0,v.jsx)(c.Z,{title:"Add Product",subtitle:"Create a new product. This information will be visible to all distributors."}),!_&&(0,v.jsxs)(l.Z,{color:"info",children:["You have reached the limit of"," ",(0,v.jsxs)("strong",{children:[N," products"]})," as part of your subscription plan. Please make room or"," ",(0,v.jsx)("a",{href:"mailto:[email protected]",children:"contact us"})," ","to discuss increasing your limit."]}),(0,v.jsx)(i.Z,{className:"my-3",children:(0,v.jsx)(u.Z,{model:F,onChange:P,countries:r,colors:x,allSubCategories:j,productMaterials:b,leadTimes:g,disabled:!_,manufacturers:Z,hasProductAddAccess:(0,f.F)(null===s||void 0===s?void 0:s.role,"product/add")})}),(0,v.jsx)(i.Z,{className:"my-3",children:(0,v.jsx)(d.X,{localFiles:T,title:"UPLOAD PRODUCT PICTURES",subtitle:"Upload the pictures of this product which would best showcase its look from every angle. Add up to 10 images",onDrop:A,deleteService:E})}),(null===T||void 0===T?void 0:T.length)>0&&(0,v.jsx)(i.Z,{className:"my-3",children:(0,v.jsx)(p.p,{gallery:T,setGalleryFiles:k,type:"product"})}),U&&(0,v.jsx)(i.Z,{children:(0,v.jsx)(n.Z,{className:"col-md-8 offset-md-2",children:(0,v.jsx)(l.Z,{color:"danger",children:U})})}),D&&(0,v.jsx)(i.Z,{children:(0,v.jsx)(n.Z,{className:"col-md-8 offset-md-2",children:(0,v.jsx)(l.Z,{color:"success",children:D})})}),_&&(0,v.jsx)(i.Z,{children:(0,v.jsxs)("div",{className:"col-sm-12 col-md-8 offset-md-4 center mb-5 mt-3",children:[(0,v.jsx)(a.f,{loading:O,onClick:function(){return G(F)},type:"button",children:"Save"}),(0,v.jsx)("br",{})]})})]})}},36965:function(e,s,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/product/add",function(){return r(90394)}])}},function(e){e.O(0,[4885,3714,3336,8544,9630,7115,8909,646,9638,5675,7446,3654,2004,7505,5401,4715,5886,5769,9774,2888,179],(function(){return s=36965,e(e.s=s);var s}));var s=e.O();_N_E=s}]);
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.