1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8202],{76521:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/role/new",function(){return n(64016)}])},72128:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var c=n(45929),a=n(75271),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"},o=n(52095),s=a.forwardRef(function(e,t){return a.createElement(o.Z,(0,c.Z)({},e,{ref:t,icon:i}))})},86214:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var c=n(45929),a=n(75271),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},o=n(52095),s=a.forwardRef(function(e,t){return a.createElement(o.Z,(0,c.Z)({},e,{ref:t,icon:i}))})},18687:function(e,t,n){"use strict";n.d(t,{VM:function(){return u},cG:function(){return m},hd:function(){return d}});var c=n(84759),a=n(38841),i=n(83509);let o=e=>{let{componentCls:t}=e;return{[t]:{position:"relative",maxWidth:"100%",minHeight:1}}},s=(e,t)=>{let{prefixCls:n,componentCls:c,gridColumns:a}=e,i={};for(let e=a;e>=0;e--)0===e?(i["".concat(c).concat(t,"-").concat(e)]={display:"none"},i["".concat(c,"-push-").concat(e)]={insetInlineStart:"auto"},i["".concat(c,"-pull-").concat(e)]={insetInlineEnd:"auto"},i["".concat(c).concat(t,"-push-").concat(e)]={insetInlineStart:"auto"},i["".concat(c).concat(t,"-pull-").concat(e)]={insetInlineEnd:"auto"},i["".concat(c).concat(t,"-offset-").concat(e)]={marginInlineStart:0},i["".concat(c).concat(t,"-order-").concat(e)]={order:0}):(i["".concat(c).concat(t,"-").concat(e)]=[{"--ant-display":"block",display:"block"},{display:"var(--ant-display)",flex:"0 0 ".concat(e/a*100,"%"),maxWidth:"".concat(e/a*100,"%")}],i["".concat(c).concat(t,"-push-").concat(e)]={insetInlineStart:"".concat(e/a*100,"%")},i["".concat(c).concat(t,"-pull-").concat(e)]={insetInlineEnd:"".concat(e/a*100,"%")},i["".concat(c).concat(t,"-offset-").concat(e)]={marginInlineStart:"".concat(e/a*100,"%")},i["".concat(c).concat(t,"-order-").concat(e)]={order:e});return i["".concat(c).concat(t,"-flex")]={flex:"var(--".concat(n).concat(t,"-flex)")},i},r=(e,t)=>s(e,t),l=(e,t,n)=>({["@media (min-width: ".concat((0,c.unit)(t),")")]:Object.assign({},r(e,n))}),u=(0,a.I$)("Grid",e=>{let{componentCls:t}=e;return{[t]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},()=>({})),d=e=>({xs:e.screenXSMin,sm:e.screenSMMin,md:e.screenMDMin,lg:e.screenLGMin,xl:e.screenXLMin,xxl:e.screenXXLMin}),m=(0,a.I$)("Grid",e=>{let t=(0,i.mergeToken)(e,{gridColumns:24}),n=d(t);return delete n.xs,[o(t),r(t,""),r(t,"-xs"),Object.keys(n).map(e=>l(t,n[e],"-".concat(e))).reduce((e,t)=>Object.assign(Object.assign({},e),t),{})]},()=>({}))},11030:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var c=n(52676),a=n(73414),i=n(26134),o=n(85304),s=n(62581),r=n(15036),l=n(18060),u=n(78672),d=e=>{let{title:t,scope:n,actions:a}=e;return(0,c.jsxs)("div",{className:"mb-5",children:[(0,c.jsx)(r.Z,{orientation:"left",className:"text-xl font-bold",children:t}),(0,c.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6",children:a.map(e=>(0,c.jsx)(l.Z.Item,{name:[n,e.name],valuePropName:"checked",noStyle:!0,children:(0,c.jsx)(u.Z,{children:e.label})},e.name))})]})},m=n(21844),f=n(39649),p=n(78051);let x={CREATE:!1,READ:!1,UPDATE:!1,DELETE:!1};var E=e=>{let{form:t,id:n,onSubmit:r,loading:u,disabled:E}=e,R=(0,a.useRouter)(),{user:h}=(0,o.a)(),g=[{name:"CREATE",label:"Create"},{name:"READ",label:"Read"},{name:"UPDATE",label:"Update"},{name:"DELETE",label:"Delete"}];return(0,c.jsxs)(l.Z,{disabled:E,form:t,onFinish:r,layout:"vertical",initialValues:{active:!0,USER:x,ROLE:x,PRODUCT:x,BLOG:x,COUPON:x},children:[(0,c.jsx)(l.Z.Item,{name:"name",label:"Name",rules:[{required:!0}],children:(0,c.jsx)(m.default,{className:"w-full max-w-[300px]"})}),(0,c.jsx)(l.Z.Item,{name:"active",label:"Status",valuePropName:"checked",rules:[{required:!0}],children:(0,c.jsx)(f.Z,{})}),(0,c.jsx)(d,{title:"DASHBOARD",scope:"DASHBOARD",actions:[{name:"READ",label:"Read"}]}),(0,c.jsx)(d,{title:"USER",scope:"USER",actions:[...g]}),(0,c.jsx)(d,{title:"ROLE",scope:"ROLE",actions:[...g]}),(0,c.jsx)(d,{title:"SYSTEM CONFIG / Category",scope:"SYSTEM_CONFIG/CATEGORY",actions:[...g]}),(0,c.jsx)(d,{title:"SYSTEM CONFIG / Policy",scope:"SYSTEM_CONFIG/POLICY",actions:[...g]}),(0,c.jsx)(d,{title:"PRODUCT",scope:"PRODUCT",actions:[...g]}),(0,c.jsx)(d,{title:"BLOG",scope:"BLOG",actions:[...g]}),(0,c.jsx)(d,{title:"ORDER",scope:"ORDER",actions:[...g]}),(0,c.jsx)(d,{title:"WARRANTY",scope:"WARRANTY",actions:[...g]}),(0,c.jsx)(d,{title:"COUPON",scope:"COUPON",actions:[...g]}),(0,c.jsx)(d,{title:"OUR PARTNERS",scope:"OUR_PARTNERS",actions:[...g]}),(0,c.jsx)(d,{title:"REVIEW",scope:"REVIEW",actions:[...g]}),(0,c.jsx)(d,{title:"CONTENT MANAGEMENT",scope:"CONTENT_MANAGEMENT",actions:[...g]}),(0,c.jsxs)("div",{className:"flex gap-5",children:[(0,c.jsx)(p.ZP,{htmlType:"button",block:!0,onClick:()=>R.push(s.Z.ROLE),size:"large",loading:u,disabled:E,children:"Cancel"}),...(0,i.f)((null==h?void 0:h.role.accessRights.ROLE.CREATE)||!!n&&h.role.accessRights.ROLE.UPDATE,[(0,c.jsx)(p.ZP,{type:"primary",htmlType:"submit",block:!0,size:"large",loading:u,disabled:E,children:n?"Update":"Save"},"submit")])]})]})}},64016:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return f}});var c=n(52676),a=n(76517),i=n(73414),o=n(71030),s=n(18060),r=n(49810),l=n(83214),u=n(11030),d=n(73143),m=n(62581),f=!0;t.default=e=>{let{user:t}=e,n=(0,i.useRouter)(),[f]=s.Z.useForm(),p=(0,o.D)({mutationFn:e=>(0,d.fA)(e),onSuccess:()=>{n.push(m.Z.ROLE)}});return(0,c.jsx)(r.Z,{user:t,activeMenu:["role"],children:(0,c.jsx)(u.Z,{form:f,onSubmit:e=>{a.Am.promise(p.mutateAsync(e),{pending:"Creating role...",success:"Role created successfully",error:{render(e){let{data:t}=e;return"Error creating role: ".concat((0,l._g)(t))}}})},loading:p.isPending})})}},73143:function(e,t,n){"use strict";n.d(t,{JV:function(){return l},Rd:function(){return s},Rn:function(){return a},cq:function(){return r},fA:function(){return i},ul:function(){return o},xQ:function(){return u}});var c=n(5409);let a=()=>c.Z.get("/admin/role/options"),i=e=>c.Z.post("/admin/role",e),o=(e,t)=>c.Z.put("/admin/role/".concat(e),t),s=e=>c.Z.delete("/admin/role/".concat(e.id),{params:e}),r=e=>c.Z.put("/admin/role/".concat(e.id,"/status"),{active:e.active}),l=e=>c.Z.get("/admin/role",{params:e}),u=e=>c.Z.get("/admin/role/".concat(e.id))}},function(e){e.O(0,[5989,4237,7610,8174,8051,9513,4540,928,4298,4190,6631,6220,9575,150,1887,5934,8060,8672,9649,9810,2888,9774,179],function(){return e(e.s=76521)}),_N_E=e.O()}]);
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.