PageSourceSearch

https://samugiken.com/_next/static/chunks/pages/admin/coupon-5e07125cfa604588.js

js samugiken.com collected 2026-10-07 01:50:39 UTC 31,999 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7865,7927,9810],{69411:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/coupon",function(){return n(1249)}])},4180:function(e,t){"use strict";t.Z={src:"/_next/static/media/samu-giken.1bf2ec60.webp",height:549,width:1920,blurDataURL:"data:image/webp;base64,UklGRmQAAABXRUJQVlA4WAoAAAAQAAAABwAAAQAAQUxQSBEAAAAAGjk6MjtENBAZNi4qQzcvCgBWUDggLAAAAJABAJ0BKggAAgACQDgloAJ0ugADmAD+6ez/dAAp+z/+0s/+pZ/9Sz/NAAAA",blurWidth:8,blurHeight:2}},57722:function(e,t,n){"use strict";n.d(t,{Z:function(){return Z}});var r=n(75271),l=n(82187),o=n.n(l),i=n(18051),a=n(49955),c=n(43596),s=n(95959),u=n(71192),d=n(88859),h=n(84759),p=n(84432),f=n(42446),m=n(83509),g=n(38841);let x=e=>{let{paddingXXS:t,lineWidth:n,tagPaddingHorizontal:r,componentCls:l,calc:o}=e,i=o(r).sub(n).equal(),a=o(t).sub(n).equal();return{[l]:Object.assign(Object.assign({},(0,f.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:i,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:"".concat((0,h.unit)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadiusSM,opacity:1,transition:"all ".concat(e.motionDurationMid),textAlign:"start",position:"relative",["&".concat(l,"-rtl")]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},["".concat(l,"-close-icon")]:{marginInlineStart:a,fontSize:e.tagIconSize,color:e.colorIcon,cursor:"pointer",transition:"all ".concat(e.motionDurationMid),"&:hover":{color:e.colorTextHeading}},["&".concat(l,"-has-color")]:{borderColor:"transparent",["&, a, a:hover, ".concat(e.iconCls,"-close, ").concat(e.iconCls,"-close:hover")]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",["&:not(".concat(l,"-checkable-checked):hover")]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},"&-hidden":{display:"none"},["> ".concat(e.iconCls," + span, > span + ").concat(e.iconCls)]:{marginInlineStart:i}}),["".concat(l,"-borderless")]:{borderColor:"transparent",background:e.tagBorderlessBg}}},v=e=>{let{lineWidth:t,fontSizeIcon:n,calc:r}=e,l=e.fontSizeSM;return(0,m.mergeToken)(e,{tagFontSize:l,tagLineHeight:(0,h.unit)(r(e.lineHeightSM).mul(l).equal()),tagIconSize:r(n).sub(r(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},y=e=>({defaultBg:new p.FastColor(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText});var b=(0,g.I$)("Tag",e=>x(v(e)),y),C=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,r=Object.getOwnPropertySymbols(e);l<r.length;l++)0>t.indexOf(r[l])&&Object.prototype.propertyIsEnumerable.call(e,r[l])&&(n[r[l]]=e[r[l]]);return n};let j=r.forwardRef((e,t)=>{let{prefixCls:n,style:l,className:i,checked:a,children:c,icon:s,onChange:u,onClick:h}=e,p=C(e,["prefixCls","style","className","checked","children","icon","onChange","onClick"]),{getPrefixCls:f,tag:m}=r.useContext(d.E_),g=f("tag",n),[x,v,y]=b(g),j=o()(g,"".concat(g,"-checkable"),{["".concat(g,"-checkable-checked")]:a},null==m?void 0:m.className,i,v,y);return x(r.createElement("span",Object.assign({},p,{ref:t,style:Object.assign(Object.assign({},l),null==m?void 0:m.style),className:j,onClick:e=>{null==u||u(!a),null==h||h(e)}}),s,r.createElement("span",null,c)))});var O=n(36980);let k=e=>(0,O.Z)(e,(t,n)=>{let{textColor:r,lightBorderColor:l,lightColor:o,darkColor:i}=n;return{["".concat(e.componentCls).concat(e.componentCls,"-").concat(t)]:{color:r,background:o,borderColor:l,"&-inverse":{color:e.colorTextLightSolid,background:i,borderColor:i},["&".concat(e.componentCls,"-borderless")]:{borderColor:"transparent"}}}});var A=(0,g.bk)(["Tag","preset"],e=>k(v(e)),y);let N=(e,t,n)=>{let r="string"!=typeof n?n:n.charAt(0).toUpperCase()+n.slice(1);return{["".concat(e.componentCls).concat(e.componentCls,"-").concat(t)]:{color:e["color".concat(n)],background:e["color".concat(r,"Bg")],borderColor:e["color".concat(r,"Border")],["&".concat(e.componentCls,"-borderless")]:{borderColor:"transparent"}}}};var w=(0,g.bk)(["Tag","status"],e=>{let t=v(e);return[N(t,"success","Success"),N(t,"processing","Info"),N(t,"error","Error"),N(t,"warning","Warning")]},y),E=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,r=Object.getOwnPropertySymbols(e);l<r.length;l++)0>t.indexOf(r[l])&&Object.prototype.propertyIsEnumerable.call(e,r[l])&&(n[r[l]]=e[r[l]]);return n};let S=r.forwardRef((e,t)=>
1{let{prefixCls:n,className:l,rootClassName:h,style:p,children:f,icon:m,color:g,onClose:x,bordered:v=!0,visible:y}=e,C=E(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","bordered","visible"]),{getPrefixCls:j,direction:O,tag:k}=r.useContext(d.E_),[N,S]=r.useState(!0),Z=(0,i.Z)(C,["closeIcon","closable"]);r.useEffect(()=>{void 0!==y&&S(y)},[y]);let R=(0,a.o2)(g),I=(0,a.yT)(g),D=R||I,T=Object.assign(Object.assign({backgroundColor:g&&!D?g:void 0},null==k?void 0:k.style),p),P=j("tag",n),[_,M,z]=b(P),U=o()(P,null==k?void 0:k.className,{["".concat(P,"-").concat(g)]:D,["".concat(P,"-has-color")]:g&&!D,["".concat(P,"-hidden")]:!N,["".concat(P,"-rtl")]:"rtl"===O,["".concat(P,"-borderless")]:!v},l,h,M,z),B=e=>{e.stopPropagation(),null==x||x(e),e.defaultPrevented||S(!1)},[,F]=(0,c.b)((0,c.w)(e),(0,c.w)(k),{closable:!1,closeIconRender:e=>{let t=r.createElement("span",{className:"".concat(P,"-close-icon"),onClick:B},e);return(0,s.wm)(e,t,e=>({onClick:t=>{var n;null===(n=null==e?void 0:e.onClick)||void 0===n||n.call(e,t),B(t)},className:o()(null==e?void 0:e.className,"".concat(P,"-close-icon"))}))}}),V="function"==typeof C.onClick||f&&"a"===f.type,L=m||null,W=L?r.createElement(r.Fragment,null,L,f&&r.createElement("span",null,f)):f,H=r.createElement("span",Object.assign({},Z,{ref:t,className:U,style:T}),W,F,R&&r.createElement(A,{key:"preset",prefixCls:P}),I&&r.createElement(w,{key:"status",prefixCls:P}));return _(V?r.createElement(u.Z,{component:"Tag"},H):H)});S.CheckableTag=j;var Z=S},92966:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(35082).Z)("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]])},2194:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(35082).Z)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},98774:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(35082).Z)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},34769:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(35082).Z)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},1705:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(35082).Z)("trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]])},39577:function(e,t,n){"use strict";var r=n(52676),l=n(98807),o=n(78051),i=n(92966),a=n(63309);t.Z=e=>{let{children:t,className:n,...c}=e;return(0,r.jsx)(l.Z,{trigger:["click"],rootClassName:(0,a.cn)("!min-w-[100px]",n),...c,children:t||(0,r.jsx)(o.ZP,{className:"!px-2",children:(0,r.jsx)(i.Z,{})})})}},98131:function(e,t,n){"use strict";var r=n(52676),l=n(79406),o=n(78051);t.Z=e=>{let{visible:t,onOk:n,onCancel:i,title:a,content:c,danger:s=!1,okButtonText:u,cancelButtonText:d,loading:h,disabled:p}=e;return(0,r.jsxs)(l.Z,{open:t,title:a,footer:null,closeIcon:null,centered:!0,onCancel:()=>{p||null==i||i()},children:[c,(0,r.jsxs)("div",{className:"flex gap-5 mt-5",children:[(0,r.jsx)(o.ZP,{size:"large",onClick:i,block:!0,disabled:p,children:d||"Cancel"}),(0,r.jsx)(o.ZP,{size:"large",type:"primary",danger:s,onClick:n,block:!0,loading:h,disabled:p,children:u||"Ok"})]})]})}},49810:function(e,t,n){"use strict";n.d(t,{Z:function(){return U}});var r=n(52676),l=n(75271),o=n(46035),i=n(33022),a=n(40150),c=n(28994),s=n(85304),u=n(4180),d=n(16624),h=n(27026),p=n.n(h),f=n(78051),m=n(98807),g=n(15036),x=n(32623),v=n.n(x);let y=e=>{let{isMobile:t,isDrawerOpen:n,setIsDrawerOpen:l,collapsed:o,setCollapsed:i,fullName:a}=e,{logout:c}=(0,s.a)();return(0,r.jsxs)("div",{style:{borderBottom:"1px solid #e8e8e8",position:"fixed",width:"100%",zIndex:100},className:"flex items-center justify-between h-16 px-6 bg-white",children:[(0,r.jsxs)("div",{className:"flex items-center h-full gap-2",children:[(0,r.jsx)(f.ZP,{onClick:()=>{t?l(!n):i(!o)},"aria-controls":"sidebar",className:"flex items-center justify-center w-8 px-1 py-0",icon:(0,r.jsx)("svg",{className:"w-5 h-5 text-gray-500",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h6a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z",clipRule:"evenodd"})})}),!t&&(0,r.jsx)(p(),{href:"/",className:"h-full",children:(0,r.jsx)(v(),{src:u.Z,alt:"Samugiken",className:"w-[100%] h-[60px]"})})]}),(0,r.jsx)("div",{className:"flex items-center justify-center",children:(0,r.jsx)("div",{className:"flex items-center justify-center col-row",children:(0,r.jsx)(m.Z,{arrow:!0,placement:"bottomRight",overlayClassName:"shadow-[rgba(0,0,0,0.35)_0_5px_15px] rounded-xl top-10",trigger:["click"],dropdownRender:()=>(0,r.jsxs)("div",{className:"flex flex-col p-3 bg-white rounded-md shadow-md gap-y-1",children:[(0,r.jsx)(p(),{href:"/my-profile",className:"font-medium leading-[normal] text-primary hover:text-primary",children:(0,r.jsx)("div",{className:"cursor-pointer rounded-[4px]  p-3 duration-100 hover:bg-primary/10",children:"My Profile"})}),(0,r.jsx)(g.Z,{className:"!my-2"}),(0,r.jsx)(f.ZP,{type:"primary",danger:!0,onClick:c,children:"Logout"})]}),children:(0,r.jsxs)("div",{className:"flex items-center cursor-pointer gap-x-3",children:[(0,r.jsx)("div",{className:"flex items-center gap-2 ml-2",children:(0,r.jsx)("span",{className:"font-semibold",children:a})}
1),(0,r.jsx)(d.ZP,{name:a,round:!0,maxInitials:1,size:"35",textSizeRatio:2,fgColor:"white",color:"black"})]})})})})]})};var b=n(73640),C=n(62581),j=n(26134),O=n(1952),k=n(7144),A=n(42439),N=n(88483),w=n(42720),E=n(43146),S=n(57221),Z=n(84176),R=n(54216),I=n(12285),D=n(20188),T=n(19254);let P=e=>{var t,n,o,i,a,c,u,d,h,f,m;let{activeMenu:g,activeDropdown:x}=e,[v,y]=(0,l.useState)(g),{user:P}=(0,s.a)(),_=null==P?void 0:P.role.accessRights,M=e=>{y([e])},z=[{key:"dashboard",label:(0,r.jsx)(p(),{href:C.Z.ADMIN_DASHBOARD,children:"Dashboard"}),icon:(0,r.jsx)(O.Z,{width:16,height:16}),onClick:()=>M("dashboard")},...(0,j.f)(null==_?void 0:null===(t=_.PRODUCT)||void 0===t?void 0:t.READ,[{key:"product",label:(0,r.jsx)(p(),{href:C.Z.PRODUCT,children:"Product"}),icon:(0,r.jsx)(k.Z,{width:16,height:16}),onClick:()=>M("product")}]),...(0,j.f)(null==_?void 0:null===(n=_.REVIEW)||void 0===n?void 0:n.READ,[{key:"review",label:(0,r.jsx)(p(),{href:C.Z.REVIEW,children:"Reviews"}),icon:(0,r.jsx)(A.Z,{width:16,height:16}),onClick:()=>M("review")}]),...(0,j.f)(null==_?void 0:null===(o=_.WARRANTY)||void 0===o?void 0:o.READ,[{key:"warranty",label:"Warranty",icon:(0,r.jsx)(T.Z,{width:16,height:16}),children:[{key:"warranty-register",label:(0,r.jsx)(p(),{href:C.Z.WARRANTY_REGISTER,children:"Warranty Register"}),onClick:()=>M("warranty-register")},{key:"warranty-claim",label:(0,r.jsx)(p(),{href:C.Z.WARRANTY_CLAIM,children:"Warranty Claim"}),onClick:()=>M("warranty-claim")}]}]),...(0,j.f)(null==_?void 0:null===(i=_.COUPON)||void 0===i?void 0:i.READ,[{key:"coupon",label:(0,r.jsx)(p(),{href:C.Z.COUPON,children:"Coupon"}),icon:(0,r.jsx)(N.Z,{width:16,height:16}),onClick:()=>M("coupon")}]),...(0,j.f)(null==_?void 0:null===(a=_.ORDER)||void 0===a?void 0:a.READ,[{key:"order",label:(0,r.jsx)(p(),{href:C.Z.ORDER,children:"Orders"}),icon:(0,r.jsx)(T.Z,{width:16,height:16}),onClick:()=>M("order")},{key:"abandonment",label:(0,r.jsx)(p(),{href:C.Z.ABANDONMENT,children:"Abandonment"}),icon:(0,r.jsx)(w.Z,{width:16,height:16}),onClick:()=>M("abandonment")}]),...(0,j.f)(null==_?void 0:null===(c=_.BLOG)||void 0===c?void 0:c.READ,[{key:"blog",label:(0,r.jsx)(p(),{href:C.Z.BLOG,children:"Blog"}),icon:(0,r.jsx)(E.Z,{width:16,height:16}),onClick:()=>M("blog")}]),...(0,j.f)(null==_?void 0:null===(u=_.OUR_PARTNERS)||void 0===u?void 0:u.READ,[{key:"our-partners",label:(0,r.jsx)(p(),{href:C.Z.OUR_PARTNERS,children:"Our Partners"}),icon:(0,r.jsx)(S.Z,{width:16,height:16}),onClick:()=>M("our-partners")}]),...(0,j.f)(null==_?void 0:null===(d=_.CONTENT_MANAGEMENT)||void 0===d?void 0:d.READ,[{key:"content",label:"Content Management",icon:(0,r.jsx)(Z.Z,{width:16,height:16}),children:[{key:"content-banners",label:(0,r.jsx)(p(),{href:C.Z.CONTENT_BANNER,children:"Banners"}),onClick:()=>M("content-banners")},{key:"content-reviews",label:(0,r.jsx)(p(),{href:C.Z.CONTENT_REVIEW,children:"Customer Reviews"}),onClick:()=>M("content-reviews")},{key:"content-videos",label:(0,r.jsx)(p(),{href:C.Z.CONTENT_VIDEO,children:"Product Videos"}),onClick:()=>M("content-videos")},{key:"content-popups",label:(0,r.jsx)(p(),{href:C.Z.CONTENT_POPUP,children:"Popups"}),onClick:()=>M("content-popups")}]}]),...(0,j.f)(null==_?void 0:null===(h=_.USER)||void 0===h?void 0:h.READ,[{key:"user",label:(0,r.jsx)(p(),{href:C.Z.USER,children:"User"}),icon:(0,r.jsx)(R.Z,{width:16,height:16}),onClick:()=>M("user")}]),...(0,j.f)(null==_?void 0:null===(f=_.ROLE)||void 0===f?void 0:f.READ,[{key:"role",label:(0,r.jsx)(p(),{href:C.Z.ROLE,
1children:"Role"}),icon:(0,r.jsx)(I.Z,{width:16,height:16}),onClick:()=>M("role")}]),...(0,j.f)(null==_?void 0:null===(m=_["SYSTEM_CONFIG/CATEGORY"])||void 0===m?void 0:m.READ,[{key:"system-config",label:(0,r.jsx)(p(),{href:C.Z.SYSTEM_CONFIG,children:"System Config"}),icon:(0,r.jsx)(D.Z,{width:16,height:16}),onClick:()=>M("category")}])];return(0,r.jsx)(b.Z,{theme:"light",mode:"inline",defaultOpenKeys:x||[],defaultSelectedKeys:v,items:z,className:"h-full font-medium"})};var _=n(63309);let{Sider:M,Content:z}=i.default;var U=e=>{let{children:t,user:n,activeMenu:d=[],activeDropdown:h=[],seoConfig:p,withPadding:f=!0,card:m=!0,contentClassName:g}=e,x=(0,c.ac)("(max-width: 768px)"),[b,C]=(0,l.useState)(!1),[j,O]=(0,l.useState)(!1);return(0,r.jsx)(s.H,{user:n,children:(0,r.jsxs)(i.default,{className:"!min-h-screen",children:[(0,r.jsx)(o.PB,{...p}),(0,r.jsx)(y,{isMobile:x,isDrawerOpen:j,setIsDrawerOpen:O,collapsed:b,setCollapsed:C,fullName:(null==n?void 0:n.firstName)+" "+(null==n?void 0:n.lastName)||""}),(0,r.jsx)("div",{className:"mt-[64px]"}),(0,r.jsxs)(i.default,{hasSider:!0,style:{minHeight:"100%"},children:[x?(0,r.jsx)(a.Z,{placement:"left",open:j,onClose:()=>O(!1),width:"250px",styles:{body:{padding:0}},closable:!1,children:(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("div",{className:"py-2",children:(0,r.jsx)(v(),{src:u.Z,alt:"Samugiken",className:"w-[100%] h-[70px]"})}),(0,r.jsx)(P,{activeMenu:d,activeDropdown:h})]})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:b?"duration-200 ml-[80px]":"duration-200 ml-[250px]"}),(0,r.jsx)(M,{trigger:null,collapsible:!0,collapsed:b,theme:"light",width:250,className:"hide-scrollbar",style:{overflow:"scroll",position:"fixed",marginTop:"64px",left:0,top:0,bottom:0,zIndex:100},children:(0,r.jsx)(P,{activeMenu:d,activeDropdown:h})})]}),(0,r.jsx)(z,{className:(0,_.cn)("min-h-full",f&&"px-3 py-5 md:p-9"),children:(0,r.jsx)("div",{className:(0,_.cn)(m&&"rounded-lg bg-white p-8 shadow-sm",g),children:t})})]})]})})}},5409:function(e,t,n){"use strict";n.d(t,{J:function(){return a}});var r=n(15989),l=n(39771),o=n(91340);let i=r.Z.create({baseURL:l.T5+"/api",headers:{"Content-Type":"application/json"},withCredentials:!0});i.interceptors.request.use(e=>{if((0,o.rD)()){let t=(0,o.Zd)();t&&(e.headers=e.headers||{},e.headers["x-session-id"]=t)}else e.headers&&e.headers["x-session-id"]&&delete e.headers["x-session-id"];return e});let a=r.Z.create({baseURL:l.T5+"/api",headers:{"Content-Type":"multipart/form-data"},maxContentLength:1/0,maxBodyLength:1/0,withCredentials:!0});t.Z=i},95809:function(e,t,n){"use strict";var r=n(75271);t.Z=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],[t,n]=(0,r.useState)(e);return{visible:t,open:()=>{n(!0)},close:()=>{n(!1)},toggle:()=>{n(e=>!e)}}}},56346:function(e,t,n){"use strict";var r=n(75271),l=n(94170);t.Z=e=>{let[t,n]=(0,r.useState)({page:1,pageSize:10,total:0,sortOrder:l.As.DESC,sortField:"createdAt",...e});return[t,n,(e,t,r)=>{n(t=>{var n;return{...t,page:e.current||1,pageSize:e.pageSize||10,sortField:null!==(n=null==r?void 0:r.field)&&void 0!==n?n:null==t?void 0:t.sortField,sortOrder:"ascend"==r.order?l.As.ASC:r.order?l.As.DESC:t.sortOrder}})}]}},85304:function(e,t,n){"use strict";n.d(t,{H:function(){return p},a:function(){return f}});var r=n(52676),l=n(75271),o=n(76517),i=n(73414),a=n(71030),c=n(83214),s=n(62581),u=n(69504),d=n(91340);let h=(0,l.createContext)(null),p=e=>{let{children:t,user:n}=e,p=(0,i.useRouter)(),{mutate:f}=(0,a.D)({mutationFn:u.kS,onError:e=>o.Am.error((0,c._g)(e)),onSuccess:()=>{p.push(s.Z.LOGIN)}});return(0,l.useEffect)(()=>{n?(0,d.hv)():(0,d.wN)()},[n]),(0,r.jsx)(h.Provider,{value:{user:n,logout:f},children:t})},f=()=>{let e=(0,l.useContext)(h);if(!e)throw Error("useAuth must be used within a AuthProvider");return e}},1249:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return T},default:function(){return P}});var r=n(52676),l=n(21844),o=n(78051),i=n(98774),a=n(49810),c=n(95809),s=n(87927),u=n(75271),d=n(27026),h=n.n(d),p=n(33561),f=n(69834),m=n(4475),g=n(71030),x=n(57722),v=n(77894),y=n(2194),b=n(34769),C=n(1705),j=n(76517),O=n(9482),k=n(56346),A=n(39577),N=n(98131),w=n(83214),E=n(26134),S=n(85304),Z=e=>{let{search:t}=e,n=(0,p.useRouter)(),{user:l}=(0,S.a)(),[o,i,a]=(0,k.Z)(),[s,d]=(0,u.useState)(null),Z=(0,c.Z)(),R=(0,c.Z)(),I=(0,f.a)({queryKey:["coupon","pagination",o,t],queryFn:async()=>{let e=await (0,O.KV)({page:o.page,pageSize:o.pageSize,sortField:o.sortField,sortOrder:o.sortOrder,search:t});return i(t=>({...t,page:e.data.page,total:e.data.total})),e},placeholderData:m.Wk,select:e=>e.data.rows}),D=(0,g.D)({mutationFn:e=>(0,O.$T)(e.id,{active:e.active}),onSuccess:()=>{Z.close(),I.refetch()}}),T=(0,g.D)({mutationFn:e=>(0,O.VW)(e),onSuccess:()=>{R.close(),I.refetch()}}),P=e=>{j.Am.promise(D.mutateAsync({id:e.refId,active:!e.active}),{pending:e.active?"Deactivating coupon...":"Activating coupon...",success:"Coupon status updated successfully",error:{render(e){let{data:t}=e;return(0,w._g)(t)}}})},_=e=>{j.Am.promise(T.mutateAsync(e),{pending:"Deleting coupon...",success:"Coupon deleted successfully",error:{render(e){let{data:t}=e;return(0,w._g)(t)}}})};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(v.Z,{columns:[{title:"Title",dataIndex:"title",render:(e,t)=>(0,r.jsx)(h(),{href:"/admin/coupon/".concat(t.refId),className:"font-semibold",children:e||"Untitled coupon"})},{title:"Status",dataIndex:"active",render:e=>(0,r.jsx)(x.Z,{color:e?"green":"red",children:e?"Active":"Inactive"})},{title:"Public",dataIndex:"isPublic",render:e=>(0,r.jsx)(x.Z,{color:e?"blue":"default",children:e?"Public":"Private"})},{title:"Created at",dataIndex:"createdAt",render:e=>(0,w.i$)(e,"-")},{dataIndex:"refId",width:50,render:(e,t)=>(0,r.jsx)(A.Z,{menu:{items:[{key:"view",label:"View",icon:(0,r.jsx)(y.Z,{}),onClick:()=>n.push("/admin/coupon/".concat(t.refId))},...(0,E.f)(l.role.accessRights.COUPON.UPDATE,[{key:"toggle-status",label:t.active?"Deactivate":"Activate",icon:(0,r.jsx)(b.Z,{}),onClick:()=>{d(t),Z.open()}}]),{type:"divider"},...(0,E.f)(l.role.accessRights.COUPON.DELETE,[{key:"delete",label:"Delete",danger:!0,icon:(0,r.jsx)(C.Z,{}),onClick:()=>{d(t),R.open()}}])]}})}],dataSource:I.data,loading:I.isFetching,onChange:a,rowKey:e=>e.refId,pagination:{current:o.page,pageSize:o.pageSize,showSizeChanger:!0,pageSizeOptions:[10,25,50,100],total:o.total,showTotal:(e,t)=>"Pagination: ".concat(t[0],"-").concat(t[1]," of ").concat(e," items")}}),(0,r.jsx)(N.Z,{visible:Z.visible,title:(null==s?void 0:s.title)||"Coupon",content:"Are you sure you want to ".concat((null==s?void 0:s.active)?"deactivate":"activate"," this coupon?"),okButtonText:"Confirm",onCancel:()=>{Z.close(),d(null)},onOk:()=>{s&&P(s)},loading:D.isPending,disabled:D.isPending}),(0,r.jsx)(N.Z,{visible:R.visible,title:(null==s?void 0:s.title)||"Coupon",content:"Are you sure you want to delete this coupon?",okButtonText:"Delete",danger:!0,onCancel:()=>{R.close(),d(null)},onOk:()=>{s&&_(s.refId)},loading:T.isPending,disabled:T.isPending})]})},R=n(18060),I=n(79406),D=e=>{let{open:t,onClose:n}=e,i=(0,p.useRouter)(),[a]=R.Z.useForm(),c=(0,g.D)({mutationFn:e=>(0,O.lk)(e),onSuccess:e=>{a.resetFields(),n(),i.push("/admin/coupon/".concat(e.data.refId))}});return(0,r.jsx)(I.Z,{open:t,onCancel:()=>{a.resetFields(),n()}
1,title:"Create Coupon",footer:null,destroyOnClose:!0,centered:!0,children:(0,r.jsxs)(R.Z,{form:a,layout:"vertical",onFinish:e=>{j.Am.promise(c.mutateAsync(e),{pending:"Creating coupon...",success:"Coupon created",error:{render(e){let{data:t}=e;return(0,w._g)(t)}}})},children:[(0,r.jsx)(R.Z.Item,{name:"title",label:"Title",rules:[{required:!0}],children:(0,r.jsx)(l.default,{placeholder:"e.g., Raya Mega Sale"})}),(0,r.jsx)("div",{className:"flex justify-end",children:(0,r.jsx)(o.ZP,{type:"primary",htmlType:"submit",loading:c.isPending,children:"Create"})})]})})},T=!0,P=e=>{let{user:t}=e,[n,u]=(0,s.v1)("search",s.Oi.withDefault("")),d=(0,c.Z)();return(0,r.jsxs)(a.Z,{user:t,activeMenu:["coupon"],children:[(0,r.jsxs)("div",{className:"flex flex-col gap-4 mb-5 md:flex-row md:items-center md:justify-between",children:[(0,r.jsx)(l.default.Search,{className:"max-w-[400px]",allowClear:!0,placeholder:"Search coupon title or code",value:n,onChange:e=>u(e.target.value),onSearch:e=>u(e)}),(0,r.jsx)(o.ZP,{type:"primary",icon:(0,r.jsx)(i.Z,{size:16}),onClick:d.open,children:"New Coupon"})]}),(0,r.jsx)(Z,{search:n}),(0,r.jsx)(D,{open:d.visible,onClose:d.close})]})}},69504:function(e,t,n){"use strict";n.d(t,{A9:function(){return s},IU:function(){return o},c0:function(){return c},kS:function(){return i},o9:function(){return a},x4:function(){return l}});var r=n(5409);let l=async e=>r.Z.post("/auth/login",e),o=async e=>r.Z.post("/auth/signup",e),i=async()=>r.Z.post("/auth/logout"),a=async e=>r.Z.post("/auth/forget-password",e),c=async e=>r.Z.post("/auth/password-reset/confirm",e),s=async e=>r.Z.post("/auth/verify-user",e)},9482:function(e,t,n){"use strict";n.d(t,{$T:function(){return s},CG:function(){return a},DE:function(){return o},KV:function(){return l},S8:function(){return u},VW:function(){return c},lk:function(){return i}});var r=n(5409);let l=e=>r.Z.get("/admin/coupon",{params:e}),o=e=>r.Z.get("/admin/coupon/".concat(e)),i=e=>r.Z.post("/admin/coupon",e),a=(e,t)=>r.Z.put("/admin/coupon/".concat(e),t),c=e=>r.Z.delete("/admin/coupon/".concat(e)),s=(e,t)=>r.Z.put("/admin/coupon/".concat(e,"/status"),t),u=e=>r.Z.get("/admin/coupon/redemptions",{params:e})},62581:function(e,t,n){"use strict";var r,l;n.d(t,{Z:function(){return r}}),(l=r||(r={})).LOGIN="/login",l.ADMIN_DASHBOARD="/admin/dashboard",l.HOME="/",l.USER="/admin/user",l.ROLE="/admin/role",l.NEW_ROLE="/admin/role/new",l.SYSTEM_CONFIG="/admin/system-config",l.PRODUCT="/admin/product",l.BLOG="/admin/blog",l.ORDER="/admin/order",l.ABANDONMENT="/admin/abandonment",l.WARRANTY_REGISTER="/admin/warranty-register",l.WARRANTY_CLAIM="/admin/warranty-claim",l.COUPON="/admin/coupon",l.OUR_PARTNERS="/admin/our-partners",l.REVIEW="/admin/review",l.CONTENT_BANNER="/admin/content/banners",l.CONTENT_REVIEW="/admin/content/reviews",l.CONTENT_VIDEO="/admin/content/videos",l.CONTENT_POPUP="/admin/content/popups"},94170:function(e,t,n){"use strict";var r,l,o,i,a,c,s,u,d,h;n.d(t,{As:function(){return o},fH:function(){return i},hY:function(){return l}}),(c=r||(r={})).EN="en",c.ZH_HK="zh-HK",(s=l||(l={})).LOGIN="login",s.FORGET_PASSWORD="forget_password",s.SIGNUP="signup",(u=o||(o={})).ASC="asc",u.DESC="desc",(d=i||(i={})).VERIFIED="VERIFIED",d.PENDING_FOR_VERIFICATION="PENDING_FOR_VERIFICATION",d.VERIFICATION_EXPIRED="VERIFICATION_EXPIRED",(h=a||(a={})).ADMIN="Admin",h.CUSTOMER="Customer"},26134:function(e,t,n){"use strict";n.d(t,{f:function(){return r}});let r=(e,t,n)=>void 0===t?void 0!==n?n:Array.isArray(t)?[]:{}:e?t:void 0!==n?n:Array.isArray(t)?[]:{}},83214:function(e,t,n){"use strict";n.d(t,{_g:function(){return o},i$:function(){return i}});var r=n(52043),l=n.n(r);let o=e=>{if("response"in e){var t,n;return null===(n=e.response)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.message}return e.message},i=(e,t)=>{let n=l()(e);return e&&n.isValid()?l()(e).format("DD MMM YYYY, hh:mm a"):t||null}},91340:function(e,t,n){"use strict";n.d(t,{Zd:function(){return o}
1,hv:function(){return a},rD:function(){return c},wN:function(){return i}});let r="session_id",l="session_header_enabled";function o(){try{let e=localStorage.getItem(r);if(e&&e.length>0)return e;let t="undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():s();return localStorage.setItem(r,t),t}catch(e){return s()}}function i(){try{localStorage.setItem(l,"1")}catch(e){}}function a(){try{localStorage.setItem(l,"0"),localStorage.removeItem(r)}catch(e){}}function c(){try{return"1"===localStorage.getItem(l)}catch(e){return!1}}function s(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}},87927:function(e,t,n){"use strict";n.d(t,{Oi:function(){return s},v1:function(){return g}});var r=n(99843),l=n(43486),o=n(44065),i=n(75271);function a(e,t,n){try{return e(t)}catch(e){return n?(0,l.i)(25,t,e,n):(0,l.i)(24,t,e),null}}function c(e){function t(t){if(void 0===t)return null;let n="";if(Array.isArray(t)){if(void 0===t[0])return null;n=t[0]}return"string"==typeof t&&(n=t),a(e.parse,n)}return{type:"single",eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide:n=>t(n)??e}},withOptions(e){return{...this,...e}}}}let s=c({parse:e=>e,serialize:String});function u(e,t){return e.valueOf()===t.valueOf()}c({parse:e=>{let t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)}),c({parse:e=>{let t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)}),c({parse:e=>{let t=parseInt(e,16);return t==t?t:null},serialize:e=>{let t=Math.round(e).toString(16);return t<"0"||!(1&t.length)?t:"0"+t}}),c({parse:e=>{let t=parseFloat(e);return t==t?t:null},serialize:String}),c({parse:e=>"true"===e.toLowerCase(),serialize:String}),c({parse:e=>{let t=new Date(parseInt(e));return t.valueOf()==t.valueOf()?t:null},serialize:e=>""+e.valueOf(),eq:u}),c({parse:e=>{let t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:u}),c({parse:e=>{let t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:u});let d=(0,o.o)("sync-emitter",()=>(0,r.i)()),h={},p=(e,t)=>"defaultValue"===e?void 0:t;function f(e,t,n,l,o,i){let c=!1,s=Object.entries(e).reduce((e,[s,u])=>{var d;let h=t?.[s]??s,p=l[h],f="multi"===u.type?[]:null,m=void 0===p?("multi"===u.type?n.getAll(h):n.get(h))??f:p;return o&&i&&((d=o[h]??f)===m||null!==d&&null!==m&&"string"!=typeof d&&"string"!=typeof m&&d.length===m.length&&d.every((e,t)=>e===m[t]))?e[s]=i[s]??null:(c=!0,e[s]=((0,r.o)(m)?null:a(u.parse,m,h))??null,o&&(o[h]=m)),e},{});if(!c){let t=Object.keys(e),n=Object.keys(i??{});c=t.length!==n.length||t.some(e=>!n.includes(e))}return{state:s,hasChanged:c}}function m(e,t){return Object.fromEntries(Object.keys(e).map(n=>[n,e[n]??t[n]?.defaultValue??null]))}function g(e,t={}){let{parse:n,type:a,serialize:c,eq:s,defaultValue:u,...g}=t,[{[e]:x},v]=function(e,t={}){let n=(0,i.useId)(),a=(0,o.i)(),c=(0,o.a)(),{history:s=a?.history??"replace",scroll:u=a?.scroll??!1,shallow:g=a?.shallow??!0,throttleMs:x=r.l.timeMs,limitUrlUpdates:v=a?.limitUrlUpdates,clearOnDefault:y=a?.clearOnDefault??!0,startTransition:b,urlKeys:C=h}=t,j=Object.keys(e).join(","),O=(0,i.useRef)(e),k=O.current,A=JSON.stringify(Object.entries(k),p)===JSON.stringify(Object.entries(e),p)&&Object.entries(e).every(([e,t])=>{let n=k[e]?.defaultValue,r=t.defaultValue;return!!Object.is(n,r)||void 0!==n&&void 0!==r&&t.eq?.(n,r)===!0})?k:e;O.current=A;let N=(0,i.useMemo)(()=>Object.fromEntries(Object.keys(e).map(e=>[e,C[e]??e])),[j,JSON.stringify(C)]),w=(0,o.r)(Object.values(N)),E=w.searchParams,S=(0,i.useRef)({}),Z=(0,i.useRef)(null),R=(0,i.useRef)(null),I=(0,r.n)(Object.values(N)),[D,T]=(0,i.useState)(()=>f(e,C,E,I).state),P=(0,i.useRef)(D),_=Object.values(N).map(e=>`${e}=${E.getAll(e)}`).join("&")+JSON.stringify(I),M=()=>{let{state:t,hasChanged:r}=f(e,C,E,I,S.current,P.current);return r&&((0,l.t)(1,n,j,t),P.current=t,T(t)),r},z=Object.keys(S.current).join("&")!==Object.values(N).join("&"),U=null===R.current||R.current===(w.pathname??location.pathname),B=!1;(z||U&&Z.current!==_)&&(Z.current=_,B=M(),z&&(S.current=Object.fromEntries(Object.entries(N).map(([t,n])=>[n,e[t]?.type==="multi"?E.getAll(n):E.get(n)??null])))),z||B||!U||D===P.current||T(P.current),(0,i.useEffect)(()=>{R.current=w.pathname??location.pathname,M()},[_,w.pathname]),(0,i.useEffect)(()=>{let t=Object.keys(e).reduce((t,r)=>(t[r]=({state:t,query:o})=>{T(i=>{let a=N[r];return Object.is(i[r]??null,t)?((0,l.t)(2,n,j,a,t,e[r]?.defaultValue,P.current),i):(P.current={...P.current,[r]:t},S.current[a]=o,(0,l.t)(3,n,j,a,t,e[r]?.defaultValue,P.current),P.current)})},t),{});for(let r of Object.keys(e)){let e=N[r];(0,l.t)(4,n,e,j),d.on(e,t[r])}return()=>{for(let r of Object.keys(e)){let e=N[r];(0,l.t)(5,n,e,j),d.off(e,t[r])}}},[j,N]);let F=(0,i.useCallback)((e,t={})=>{let o;let i=Object.fromEntries(Object.keys(A).map(e=>[e,null])),a="function"==typeof e?e(m(P.current,A))??i:e??i;(0,l.t)(6,n,j,a);let h=0,p=!1,f=[];for(let[e,n]of Object.entries(a)){let l=A[e],i=N[e];if(!l||void 0===i||void 0===n)continue;(t.clearOnDefault??l.clearOnDefault??y)&&null!==n&&void 0!==l.defaultValue&&(l.eq??((e,t)=>e===t))(n,l.defaultValue)&&(n=null);let a=null===n?null:(l.serialize??String)(n);d.emit(i,{state:n,query:a});let m={key:i,query:a,options:{history:t.history??l.history??s,shallow:t.shallow??l.shallow??g,scroll:t.scroll??l.scroll??u,
1startTransition:t.startTransition??l.startTransition??b}},C=t.limitUrlUpdates??l.limitUrlUpdates??v;if(C?.method==="debounce"){let e=C.timeMs??r.l.timeMs,t=r.t.push(m,e,w,c);h<e&&(o=t,h=e)}else{let e=C?.timeMs??t.throttleMs??l.throttleMs??x;f.push(r.t.abort(i)),r.r.push(m,e),p=!0}}let C=f.reduce((e,t)=>t(e),p?r.r.flush(w,c):r.r.getPendingPromise(w));return o??C},[j,s,g,u,x,v?.method,v?.timeMs,b,y,A,N,w.updateUrl,w.getSearchParamsSnapshot,w.rateLimitFactor,c]);return[(0,i.useMemo)(()=>m(D,A),[D,A]),F]}({[e]:{parse:n??(e=>e),type:a,serialize:c,eq:s,defaultValue:u}},g);return[x,(0,i.useCallback)((t,n={})=>v(n=>({[e]:"function"==typeof t?t(n[e]):t}),n),[e,v])]}}},function(e){e.O(0,[5989,4237,7610,8174,9834,8051,9513,4540,928,4298,4190,6631,6220,9575,7444,9406,150,1887,5934,8060,9059,8672,1795,8374,7894,2888,9774,179],function(){return e(e.s=69411)}),_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.