1"use strict";(self.webpackChunkadmin_web=self.webpackChunkadmin_web||[]).push([[5845],{5845:function(e,t,n){n.r(t);var a=n(1413),i=n(74165),r=n(15861),s=(n(72791),n(67571)),l=n(66001),o=n(74649),c=n(28304),u=n(59930),d=n(53913),p=n(27927),h=n(85483),m=n(44787),f=n(76163),g=n(78531),v=n(22746),b=n(80184),x=u.QZ.ListItems,I=u.nB.Tables.InteractiveTable,S=u.nB.Address.OneLineAddress,j=u.nB.AvailabilityStatus,k=u.nB.Drawers.ResDrawer,_=u.nB.Permissions.Permission,K=d._G.states,T=d._G.permissions,N=T.routes,w=T.methods,A=w.POST,L=w.GET,y=N.LOCATIONS_LIST,C=N.GHOST_KITCHEN_LIST,G={filters:{name:""},skip:0,limit:20},O=[{label:"Name",fieldName:"filters.name",placeholder:"Name",input:"Input"},{label:"State",fieldName:"filters.state",options:K,input:"Select"}],P=function(){var e=(0,r.Z)((0,i.Z)().mark((function e(t,n,a,r,s){var l,c,u,d,p,h,f;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=s.Marketplaces,d=s.GhostKitchens,p=t,e.next=4,u.readMany();case 4:return h=e.sent,f=null===h||void 0===h||null===(l=h.data)||void 0===l||null===(c=l.results)||void 0===c?void 0:c.find((function(e){return e.appId===r})),p.marketPlace=f.id,e.prev=7,e.next=10,d.create(p);case 10:o.Z.success("Kitchen Created"),a.close(),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(7),o.Z.error((0,m.pT)(e.t0));case 17:return e.prev=17,n.setSubmitting(!1),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[7,14,17,20]])})));return function(t,n,a,i,r){return e.apply(this,arguments)}}();t.default=function(e){var t=e.ghostLocationId,n=(0,s.k6)(),i=(0,g.g)(),r=i.Marketplaces,o=i.GhostKitchens,m=(0,f.SE)().client,K=(0,p.Wf)({path:"/ghost-kitchens/fetch-eligible-locations"}),T=K.resource,N=K.fetching,w=(0,p.Wf)({path:"/restaurant-groups",data:{filters:{name:""},limit:1e3}}).resource,Z=(0,p.gI)({requiredPermissions:[{method:L,url:y,field:"isKioskEnabled"}]}),E=(0,p.MC)(),B=w.results||[],W=[].concat(O);return E&&W.push({label:"Active Locations",fieldName:"filters.isActive",options:[{name:"Show Only Active",value:!0},{name:"Show All",value:""}],input:"Select"}),(0,b.jsx)(x,{locationId:t,history:n,name:"Ghost Kitchens",searchPath:"/ghost-kitchens/",defaultQuery:G,filters:W,filterHeaderButton:function(){return(0,b.jsx)(_,{requiredPermissions:{method:A,url:C},yes:function(){return(0,b.jsx)("div",{className:v.Z.createLocationWrapper,children:(0,b.jsx)(k,{title:"Create Kitchen",placement:"right",width:"35vw",button:(0,b.jsx)(h.Button,{size:"medium",children:"Create Kitchen"}),children:function(e){return(0,b.jsx)(l.J9,{initialValues:{appId:"",externalId:"",name:"",restaurantGroups:[],source:""},validationSchema:d.OC.GhostKitchenSchema.newGhostKitchen,onSubmit:function(t,n){return P(t,n,e,m,{Marketplaces:r,GhostKitchens:o})},children:function(e){var t=e.handleSubmit,n=e.isSubmitting;return(0,b.jsxs)(c.Z,{onSubmit:t,children:[(0,b.jsx)(l.gN,{label:"Name",name:"name",placeholder:"Name",component:u.Iv.Input}),(0,b.jsx)(l.gN,{label:"External ID",name:"externalId",placeholder:"External ID",component:u.Iv.Input}),(0,b.jsx)(l.gN,{label:"App Id",name:"appId",placeholder:"App Id",component:u.Iv.Input}),(0,b.jsx)(l.gN,{label:"Restaurant Groups",name:"restaurantGroups",placeholder:"Select Restaurant Groups",mode:"multiple",options:B.map((function(e){return{name:e.name,value:e.id}})),filterOption:function(e,t){return"string"===typeof t.props.children&&t.props.children.toLowerCase().indexOf(e.toLowerCase())>=0},component:u.Iv.Select}),(0,b.jsx)(l.gN,{label:"Source",name:"source",placholder:"Source",options:T.map((function(e){return{name:e.name,value:e.id}})),component:u.Iv.Select}),(0,b.jsx)(h.Button,{htmlType:"submit",size:"small",color:"blue",disabled:n||N,loading:n||N,children:"Create"})]})}})}})})}})},table:function(e){var t=e.paginationObj,i=e.results,r=e.onPageChange,s=e.total,l=e.query,o=e.fetching;return(0,b.jsx)(I,{horizontalScrollSize:"large",dataSource:i,pagination:t(l.skip,l.limit,s),onChange:r,loading:o,history:n,path:"/kitchen/",columns:[{title:"Location Name",dataIndex:"name"},{title:"Address",dataIndex:"address",render:function(e){return(0,b.jsx)(S,(0,a.Z)({},e))}},{title:"Location Status",dataIndex:"isOpen",render:function(e){return(0,b.jsx)(j,{available:e})}},{title:"Delivery Status",dataIndex:"isDeliveryEnabled",render:function(e){return(0,b.jsx)(j,{available:e})}},{title:"Pickup Status",dataIndex:"isPickupEnabled",render:function(e){return(0,b.jsx)(j,{available:e})}},{hidden:!Z,title:"Kiosk Status",dataIndex:"isKioskEnabled",render:function(e){return(0,b.jsx)(j,{available:e})}}]})}})}},22746:function(e,t){t.Z={rightAlign:"ghostKitchens_rightAlign__LhziW",operatingTimesTitle:"ghostKitchens_operatingTimesTitle__ljaRo",status:"ghostKitchens_status__R6X2o",isActiveToggle:"ghostKitchens_isActiveToggle__hmkW7",createLocationWrapper:"ghostKitchens_createLocationWrapper__y8Q1j"}}}]); 2//# sourceMappingURL=5845.d3b4cced.chunk.js.map
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.