1"use strict";(self.webpackChunkadmin_web=self.webpackChunkadmin_web||[]).push([[2769],{62769:function(e,n,t){t.r(n),t.d(n,{default:function(){return ve}});var i=t(42982),r=t(74165),o=t(1413),s=t(15861),a=t(70885),l=t(72791),c=t(67571),d=t(78531),u=t(76163),p=t(66776),m=t(74649),f=t(30914),h=t(28304),x=t(74486),v=t(85316),g=t(80685),y=t(59930),b=t(66001),j=t(53913),_=t(66106),Z=t(28802),S=t(69228),T=t(11099),O=t(85483),C=t(37238),P=t(80205),w=t(36585),D="options_eventWrapperButton__LigPJ",I=t(80184),E=O.Titles.CardTitle,L=P.Tables.PersistentTable,k=P.Drawers.ResDrawer,N=P.Permissions.Permission,A=C.mk.methods.POST,B=C.mk.routes.MENU_ITEMS_LIST,M=function(e){var n,t=e.locationPathname,r=e.items,o=e.history,s=e.initialDefaultModifiers,a=e.save,l=e.saving,c=e.max,d=e.optionId,p=e.fetching,m=e.createItemFetch,h=(0,u.SE)(),x=!!c&&s.length>=c,v=s,g=function(e){e.preventDefault(),e.stopPropagation()},y=function(e){return v.includes(e)},b=function(e){return function(n){v=n?[].concat((0,i.Z)(v),[e]):v.filter((function(n){return n!==e})),a({defaultModifiers:v},{saveOptionGroup:!0})}};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(_.Z,{children:[(0,I.jsx)(f.Z,{span:12,children:(0,I.jsx)(E,{children:"Options"})}),(null===(n=h.rgConfiguration)||void 0===n?void 0:n.menuEntityCreate)&&(0,I.jsx)(N,{requiredPermissions:[{method:A,url:B}],yes:function(){return(0,I.jsx)(f.Z,{span:12,children:(0,I.jsx)(k,{title:"Create Item",placement:"right",width:"50vw",button:(0,I.jsx)(O.Button,{color:"blue",size:"medium",float:"right",children:"Create Item"}),children:function(e){return(0,I.jsx)(w.CreateItem,{loading:p,drawerProps:e,optionId:d,fetchResults:m})}})})}})]}),(0,I.jsxs)(L,{horizontalScrollSize:"large",persistKey:t,dataSource:r,history:o,path:"/item/",loading:p,children:[(0,I.jsx)(Z.Z.Column,{title:"Name",dataIndex:"name"}),(0,I.jsx)(Z.Z.Column,{title:"GUID",dataIndex:"externalId"}),(0,I.jsx)(Z.Z.Column,{title:"Availability",width:150,dataIndex:"isActive",render:function(e,n){return(0,I.jsx)(P.AvailabilityStatus,{available:n.isActive})}}),(0,I.jsx)(Z.Z.Column,{title:"Enabled By Default",render:function(e,n,t){var i=n.id;return(0,I.jsx)("button",{className:D,type:"button",onClick:g,children:(0,I.jsx)(O.ConditionalWrapper,{condition:x,wrapper:function(e){return(0,I.jsx)(S.Z,{overlayStyle:{width:150},trigger:"hover",placement:"top",content:"The number of selected default modifiers cannot exceed the max modifiers set for the option group.",children:e})},children:(0,I.jsx)(T.Z,{disabled:l||!y(i)&&x,onClick:b(i),checked:y(i)})})})}})]})]})},F=t(46009),z=void 0,R=j.OC.OptionSchema,q=j.P6.mapAxiosError,G=y.eK.Titles,Q=G.EditableTitle,J=G.SectionTitle,K=y.eK.T,U=y.eK.Button,V=y.eK.Row,H=y.nB.Tables.LocationToggleTable,W=y.nB.Permissions.Permission,Y=y.nB.EntityToggle,X=y.nB.Cards.BlueCard,$=y.nB.Condition.Condition,ee=y.nB.Drawers.ResDrawer,ne=y.QZ.OrderTypeAvailability,te=y.QZ.MediaSelection,ie=y.QZ.LocationSelector,re=y.lB.withPermissionField,oe=p.Z.Panel,se=j._G.permissions,ae=se.methods.PUT,le=se.routes.MENU_OPTIONS_ITEM,ce=[{method:ae,url:le}],de=re(U,[].concat(ce,[{method:ae,url:le,field:"disabledLocations"}]),!0),ue=function(e){return re(e,ce)},pe=ue(te),me=ue(y.Iv.Input),fe=ue(y.Iv.Checkbox),he=ue(ne),xe=ue(y.Iv.Select),ve=function(e){var n=e.auditButton,t=e.locationId,y=e.locations,j=e.setName,_=(0,c.UO)().optionId,Z=(0,c.k6)(),S=(0,c.TH)().pathname,T=(0,d.g)().MenuOptions,O=(0,u.SE)().rgConfiguration,C=l.useState(!0),P=(0,a.Z)(C,2),w=P[0],D=P[1],E=l.useState(!1),L=(0,a.Z)(E,2),k=L[0],N=L[1],A=l.useState({}),B=(0,a.Z)(A,2),G=B[0],ne=B[1],te=function(){var e=(0,s.Z)((0,r.Z)().mark((function e(n){var i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,T.readOne(n,{location:t});case 3:i=e.sent,ne((0,o.Z)({},i.data)),j(i.data.name),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),m.Z.error(q(e.t0));case 11:return e.prev=11,D(!1),e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[0,8,11,14]])}
1)));return function(n){return e.apply(this,arguments)}}(),re=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];ne((0,o.Z)((0,o.Z)({},G),{},{excludedLocations:(0,i.Z)(e)}))},se=function(){var e=(0,s.Z)((0,r.Z)().mark((function e(n,t){var i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return N(!0),null!==t&&void 0!==t&&t.saveOptionGroup&&(n.modifierType=G.modifierType),n.excludedLocations&&(n.excludedLocations=n.excludedLocations.map((function(e){return e.id||e}))),e.prev=3,e.next=6,T.update(_,n);case 6:i=e.sent,m.Z.success("Successfully saved"),ne(i.data),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(3),m.Z.error(q(e.t0));case 14:return e.prev=14,N(!1),null!==t&&void 0!==t&&t.setSubmitting&&t.setSubmitting(!1),e.finish(14);case 18:case"end":return e.stop()}}),e,null,[[3,11,14,18]])})));return function(n,t){return e.apply(this,arguments)}}();l.useEffect((function(){te(_)}),[_,t]);var ce=G.additionalDescriptions,ue=void 0===ce?[]:ce,ve=G.complimentaryQuantity,ge=void 0===ve?null:ve,ye=G.defaultModifiers,be=void 0===ye?[]:ye,je=G.disabledLocations,_e=void 0===je?[]:je,Ze=G.excludedLocations,Se=void 0===Ze?[]:Ze,Te=G.externalId,Oe=void 0===Te?"":Te,Ce=G.images,Pe=void 0===Ce?[]:Ce,we=G.items,De=void 0===we?[]:we,Ie=G.isActive,Ee=void 0!==Ie&&Ie,Le=G.isSingleSelectionOnly,ke=void 0!==Le&&Le,Ne=G.max,Ae=void 0===Ne?0:Ne,Be=G.min,Me=void 0===Be?0:Be,Fe=G.modifierType,ze=void 0===Fe?"":Fe,Re=G.name,qe=void 0===Re?"":Re,Ge=G.orderTypeAvailability,Qe=void 0===Ge?[]:Ge,Je=G.priority,Ke=void 0===Je?0:Je,Ue=G.visibility,Ve=void 0===Ue?"NONE":Ue,He=G.isDeleted,We=void 0!==He&&He;y.map((function(e){return{name:e.name,value:e.id}}));return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(X,{children:[(0,I.jsxs)(V,{spacing:20,className:F.Z.header,children:[(0,I.jsx)(f.Z,{xs:24,sm:12,md:14,children:(0,I.jsx)(Q,{placeholder:"Menu Option",name:qe,save:se})}),(0,I.jsx)(f.Z,{xs:24,sm:12,md:10,className:F.Z.entityToggle,children:(0,I.jsx)($,{is:!Me||0===Me,children:(0,I.jsx)(W,{requiredPermissions:{method:ae,url:le,field:"isActive"},yes:function(){return(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(Y,{checked:Ee,path:"/menu-options/".concat(_)})})}})})})]}),(0,I.jsx)(V,{spacing:20,children:(0,I.jsx)(b.J9,{enableReinitialize:!0,initialValues:{additionalDescriptions:ue[0],complimentaryQuantity:ge,disabledLocations:_e,images:Pe,isActive:Ee,isSingleSelectionOnly:ke,max:Ae,min:Me,modifierType:ze,name:qe,orderTypeAvailability:Qe,priority:null!==Ke&&void 0!==Ke?Ke:0,visibility:Ve,excludedLocations:Se},validationSchema:R,validateOnChange:!1,validateOnBlur:!1,onSubmit:function(e,n){var t;e.disabledLocations=e.disabledLocations.map((function(e){return e.id})),e.priority=e.priority?e.priority:null,e=(0,o.Z)((0,o.Z)({},e),{},{excludedLocations:null===(t=e.excludedLocations)||void 0===t?void 0:t.map((function(e){return e.id}))}),se(e,n)},render:function(e){var t=e.handleSubmit,r=e.values,s=e.setFieldValue,a=e.isSubmitting;return(0,I.jsxs)(h.Z,{onSubmit:t,children:[(0,I.jsx)(f.Z,{xs:24,md:12,children:(0,I.jsxs)("div",{className:F.Z.entityDetailsContainer,children:[(0,I.jsx)(J,{children:"Edit Details"}),(0,I.jsxs)(V,{spacing:40,children:[(0,I.jsxs)(V,{spacing:10,children:[(0,I.jsx)(K,{label:!0,inline:!0,children:"POS GUID:"}),(0,I.jsx)(K,{copyable:!0,inline:!0,children:Oe})]}),(0,I.jsxs)(V,{gutter:15,spacing:10,children:[(null===O||void 0===O?void 0:O.menuEntityEdit)&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(W,{requiredPermissions:[{method:ae,url:le,field:"min"}],yes:function(){return(0,I.jsx)(f.Z,{xs:24,sm:12,children:(0,I.jsx)(b.gN,{label:"Min",name:"min",size:"small",type:"number",disabled:w||a,component:me})})}}),(0,I.jsx)(W,{requiredPermissions:[{method:ae,url:le,field:"max"}],yes:function(){return(0,I.jsx)(f.Z,{xs:24,sm:12,children:(0,I.jsx)(b.gN,{label:"Max",name:"max",size:"small",type:"number",disabled:w||a,component:me})})}})]}),!(null!==O&&void 0!==O&&O.menuEntityEdit)&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(f.Z,{xs:24,sm:12,children:(0,I.jsxs)(K,{label:!0,children:["Min: ",(0,I.jsx)("strong",{children:Me})]})}),(0,I.jsx)(f.Z,{xs:24,sm:12,children:(0,I.jsxs)(K,{label:!0,children:["Max: ",(0,I.jsx)("strong",{children:Ae})]})})]})]}),(0,I.jsx)($,{is:Ae>1,children:(0,I.jsx)(V,{spacing:10,children:(0,I.jsx)(b.gN,{label:"Complimentary Quantity",name:"complimentaryQuantity",placeholder:"0",min:0,max:Ae,size:"small",type:"number",component:me})})}),(0,I.jsx)(V,{spacing:20,children:(0,I.jsx)(b.gN,{disabled:w,label:"This option can be selected once (per item)",checked:r.isSingleSelectionOnly,component:fe,onChange:function(e){s("isSingleSelectionOnly",e.target.checked)}})}),(0,I.jsx)(V,{spacing:12,children:(0,I.jsx)(b.gN,{label:"Priority",name:"priority",placeholder:"0",size:"small",type:"number",component:me})}),(null===O||void 0===O?void 0:O.menuEntityEdit)&&(0,I.jsx)(W,{requiredPermissions:[{method:ae,url:le,field:"excludedLocations"}],yes:function(){return(0,I.jsxs)(V,{spacing:40,children:[(0,I.jsx)(K,{children:"Excluded Locations"}),(0,I.jsx)(ee,{title:"Excluded Locations",placement:"right",width:"50vw",button:(0,I.jsxs)(U,{children:[r.excludedLocations.length,"\xa0 Locations"]}),children:function(e){return(0,I.jsx)(ie,{loading:w,locations:Se,setLocations:re,addLocations:function(e){return s("excludedLocations",e)},button:function(){return(0,I.jsx)(U,{onClick:function(){return e.close()},children:"Close"})}})}})]})}}),(0,I.jsx)(V,{spacing:30,children:(0,I.jsx)(b.gN,{name:"orderTypeAvailability",disabled:w,component:he})}),(0,I.jsx)(V,{spacing:12,children:(0,I.jsx)(b.gN,{label:"Modifier Type",name:"modifierType",width:"70%",options:[{name:"Default",value:""}
1,{name:"Inline",value:"inline"},{name:"Placement",value:"placement"},{name:"Option",value:"option"}],component:xe})})]}),(0,I.jsx)(W,{requiredPermissions:[{method:ae,url:le,field:"isDeleted"},{method:ae,url:le,field:"isActive"}],matchOne:!0,yes:function(){return(0,I.jsx)(V,{children:(0,I.jsx)(p.Z,{bordered:!1,children:(0,I.jsx)(oe,{header:"Advanced Settings",children:(0,I.jsx)(W,{requiredPermissions:{method:ae,url:le,field:"isDeleted"},yes:function(){return(0,I.jsxs)(V,{spacing:15,children:[(0,I.jsxs)(K,{children:["Delete",(0,I.jsx)(g.u,{placement:"top",popupLabel:"Soft deletes the option making it unable to be fetched or displayed. This can be reversed",children:(0,I.jsx)(x.Z,{type:"info-circle",style:{marginLeft:"5px",verticalAlign:"center"}})},"syncInfo")]}),(0,I.jsx)(Y,{checked:We,path:"/menu-options/".concat(_),checkedChildren:"Deleted",unCheckedChildren:"Not Deleted",field:"isDeleted"})]})}})})})})}}),(0,I.jsxs)(V,{spacing:20,children:[(0,I.jsx)(f.Z,{children:(0,I.jsx)(pe,{images:r.images,onSelect:function(e){s("images",[].concat((0,i.Z)(r.images),[e]))},onClickDelete:function(e){s("images",r.images.filter((function(n,t){return t!==e})))}})}),(0,I.jsx)(f.Z,{children:"Only images under 8mb can be uploaded"})]}),(0,I.jsx)(f.Z,{xs:12,className:F.Z.saveButton,children:(0,I.jsx)(de,{width:"90%",htmlType:"submit",size:"small",disabled:a,loading:a,color:"blue",children:"Save"})}),(0,I.jsx)(f.Z,{xs:12,className:F.Z.saveButton,children:(0,I.jsx)($,{is:n,children:n})})]})}),(0,I.jsx)(f.Z,{xs:24,md:12,children:(0,I.jsx)(V,{spacing:15,children:(0,I.jsx)(H,{height:350,loading:w,onSelection:function(e){return se((0,o.Z)((0,o.Z)({},r),e))},excludedLocations:Se,disabledLocations:r.disabledLocations,locations:y,enableToggle:!Me||0===Me,setFieldValue:s,autosave:!0})})})]})}})})]}),(0,I.jsx)(f.Z,{xs:24,lg:12,children:(0,I.jsx)(V,{spacing:40,children:(0,I.jsx)(v.Z,{loading:w,bordered:!1,children:(0,I.jsx)(M,{createItemFetch:function(){return z.fetch(_)},fetching:w,locationPathname:S,initialDefaultModifiers:be,items:De,history:Z,save:se,saving:k,max:Ae,optionId:_})})})})]})}},69228:function(e,n,t){t.d(n,{Z:function(){return x}});var i=t(72791),r=t(64469),o=t(23785),s=t(28782);function a(e){return a="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function l(){return l=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},l.apply(this,arguments)}function c(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function d(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function u(e,n){return u=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e},u(e,n)}function p(e){var n=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,i=f(e);if(n){var r=f(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return m(this,t)}}function m(e,n){return!n||"object"!==a(n)&&"function"!==typeof n?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):n}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}var h=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)n.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(t[i[r]]=e[i[r]])}return t},x=function(e){!function(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&u(e,n)}(f,e);var n,t,a,m=p(f);function f(){var e;return c(this,f),(e=m.apply(this,arguments)).saveTooltip=function(n){e.tooltip=n},e.renderPopover=function(n){var t=n.getPrefixCls,o=e.props,s=o.prefixCls,a=h(o,["prefixCls"]);delete a.title;var c=t("popover",s);return i.createElement(r.Z,l({},a,{prefixCls:c,ref:e.saveTooltip,overlay:e.getOverlay(c)}))},e}return n=f,(t=[{key:"getPopupDomNode",value:function(){return this.tooltip.getPopupDomNode()}},{key:"getOverlay",value:function(e){var n=this.props,t=n.title,r=n.content;return(0,s.Z)(!("overlay"in this.props),"Popover","`overlay` is removed, please use `content` instead, see: https://u.ant.design/popover-content"),i.createElement("div",null,t&&i.createElement("div",{className:"".concat(e,"-title")},t),i.createElement("div",{className:"".concat(e,"-inner-content")},r))}},{key:"render",value:function(){return i.createElement(o.C,null,this.renderPopover)}}])&&d(n.prototype,t),a&&d(n,a),f}(i.Component);x.defaultProps={placement:"top",transitionName:"zoom-big",trigger:"hover",mouseEnterDelay:.1,mouseLeaveDelay:.1,overlayStyle:{}}}
1,46009:function(e,n){n.Z={hidden:"pages_hidden__OD-Jt",extra:"pages_extra__vI1zT",rightAlign:"pages_rightAlign__t1h4g",marginTop:"pages_marginTop__+Fk0H",checkboxMarginLeft:"pages_checkboxMarginLeft__iXl9R",backgroundError:"pages_backgroundError__DqtA2",blue:"pages_blue__jB8CF",sectionItems:"pages_sectionItems__SCeKJ",fullColumn:"pages_fullColumn__yV+R2",drawerDivider:"pages_drawerDivider__GW+77",entityDetailsContainer:"pages_entityDetailsContainer__zA5Fa",entityPriorityTitle:"pages_entityPriorityTitle__uerJA",entitySaveButton:"pages_entitySaveButton__1c+CZ",entityToggle:"pages_entityToggle__JIVsh",drawerTitle:"pages_drawerTitle__yYPYn",notificationsSectionTitleHeader:"pages_notificationsSectionTitleHeader__xznFO",notificationsSectionTitle:"pages_notificationsSectionTitle__xGITf",header:"pages_header__wGYoS",toggleIcon:"pages_toggleIcon__eurLB"}}}]); 2//# sourceMappingURL=2769.338d263a.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.