PageSourceSearch

https://jat-partnerportal.com/_next/static/chunks/pages/promotions/[category]/[id]-46f39b9a240299fb.js

js jat-partnerportal.com collected 2026-09-29 02:05:32 UTC 23,051 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3876],{14456:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/promotions/[category]/[id]",function(){return s(72677)}])},83085:function(e,t){"use strict";t.Z={src:"/_next/static/media/arrow-left.5ee228a6.svg",height:10,width:6,blurWidth:0,blurHeight:0}},41341:function(e,t){"use strict";t.Z={src:"/_next/static/media/arrow-right.3ec198e3.svg",height:10,width:6,blurWidth:0,blurHeight:0}},69283:function(e,t,s){"use strict";var i=s(85893);s(67294),t.Z=function(e){let{color:t="white",width:s=14,height:a=15}=e;return(0,i.jsx)("svg",{width:s,height:a,viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.48483 1.30133C7.48483 1.04214 7.2759 0.832031 7.01817 0.832031C6.76044 0.832031 6.5515 1.04214 6.5515 1.30133V10.0373L4.68037 8.15572C4.49812 7.97245 4.20264 7.97245 4.0204 8.15573C3.83816 8.339 3.83817 8.63614 4.02041 8.81941L6.68819 11.5021C6.87043 11.6854 7.1659 11.6854 7.34815 11.5021L10.0159 8.81941C10.1982 8.63614 10.1982 8.339 10.0159 8.15573C9.83369 7.97245 9.53822 7.97245 9.35597 8.15572L7.48483 10.0373V1.30133ZM0.933333 7.24538C0.933333 6.25473 1.73191 5.45166 2.717 5.45166H3.84222C4.09996 5.45166 4.30889 5.24155 4.30889 4.98236C4.30889 4.72318 4.09996 4.51307 3.84222 4.51307H2.717C1.21644 4.51307 0 5.73637 0 7.24538V12.0997C0 13.6087 1.21644 14.832 2.717 14.832H11.283C12.7836 14.832 14 13.6087 14 12.0997V7.24537C14 5.73636 12.7836 4.51307 11.283 4.51307H10.1578C9.90005 4.51307 9.69111 4.72318 9.69111 4.98236C9.69111 5.24155 9.90005 5.45166 10.1578 5.45166H11.283C12.2681 5.45166 13.0667 6.25473 13.0667 7.24537V12.0997C13.0667 13.0904 12.2681 13.8934 11.283 13.8934H2.717C1.73191 13.8934 0.933333 13.0904 0.933333 12.0997V7.24538Z",fill:t})})}},23494:function(e,t,s){"use strict";var i=s(85893),a=s(67294);t.Z=function(e){let{color:t="#219E9E",hoverColor:s="#088383",width:l=26,height:o=25,fillOpacity:n=1}=e,[r,d]=(0,a.useState)(!1);return(0,i.jsxs)("svg",{width:l,height:o,viewBox:"0 0 26 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:[(0,i.jsx)("mask",{id:"mask0_1379_13016",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"26",height:"25",children:(0,i.jsx)("rect",{x:"0.46875",y:"0.5",width:"25.2824",height:"24",fill:r?s:t})}),(0,i.jsxs)("g",{mask:"url(#mask0_1379_13016)",children:[(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.2504 8.65194C10.8445 8.65194 8.90503 10.6052 8.90503 13.0011C8.90503 15.3971 10.8445 17.3503 13.2504 17.3503C15.6563 17.3503 17.5958 15.3971 17.5958 13.0011C17.5958 10.6052 15.6563 8.65194 13.2504 8.65194ZM10.6443 13.0011C10.6443 11.5256 11.8317 10.3665 13.2504 10.3665C14.6691 10.3665 15.8565 11.5256 15.8565 13.0011C15.8565 14.4767 14.6691 15.6358 13.2504 15.6358C11.8317 15.6358 10.6443 14.4767 10.6443 13.0011Z",fill:r?s:t,fillOpacity:n}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.25 5C5.81026 5 2.21463 10.0993 1.33881 12.733L1.25 13L1.33881 13.267C2.21463 15.9007 5.81026 21 13.25 21C20.6897 21 24.2854 15.9007 25.1612 13.267L25.25 13L25.1612 12.733C24.2854 10.0993 20.6897 5 13.25 5ZM13.25 19.2854C7.01746 19.2854 3.95217 15.2127 3.08833 13C3.95217 10.7873 7.01746 6.71455 13.25 6.71455C19.4825 6.71455 22.5478 10.7873 23.4117 13C22.5478 15.2127 19.4825 19.2854 13.25 19.2854Z",fill:r?s:t,fillOpacity:n})]})]})}},15539:function(e,t,s){"use strict";s.d(t,{Z:function(){return c}});var i=s(85893),a=s(52388),l=s(32860),o=s(58223),n=s(96598);let r={[l.iF.PLACED]:"#69C0FF",[l.iF.RECEIVED]:"#69C0FF",[l.iF.STARTED]:"#A3E452",[n.JA.UPCOMING]:"#A3E452",[l.iF.PREPARING]:"#A3E452",[a.N3.PUBLISHED]:"#A3E452",[o.M.NEW_REQUEST]:"#A3E452",[l.iF.EN_ROUTE]:"#FFAA1D",[o.M.IN_PROGRESS]:"#FFAA1D",[o.M.PENDING_PAYMENT]:"#FFAA1D",[o.M.ON_DELIVERY]:"#FFAA1D",[o.M.PENDING_RETURN]:"#E7661D",[n.JA.EXPIRED]:"#E7661D",[l.iF.ERROR]:"#E7661D",[l.iF.READY]:"#1BB7B7",[l.iF.DELIVERED]:"#1BB7B7",[n.JA.INACTIVE]:"#DDDDDD",[l.iF.CANCELLED]:"#DDDDDD",[a.N3.DRAFT]:"#DDDDDD",[o.M.REJ
1ECTED]:"#DDDDDD",[o.M.RETURNED]:"#219E9E",[o.M.CREDIT_ISSUES]:"#219E9E",["equipment_".concat(o.M.COMPLETED)]:"#219E9E",["order_".concat(l.iF.COMPLETED)]:"#FF640C"},d=e=>{var t;return e===l.iF.COMPLETED?"#FF640C":e===o.M.COMPLETED?"#219E9E":null!==(t=r[e])&&void 0!==t?t:"#1BB7B7"};var c=function(e){let{orderStatus:t}=e,s=d(t);return(0,i.jsx)("svg",{width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("circle",{cx:"5",cy:"5.5",r:"5",fill:s})})}},28685:function(e,t,s){"use strict";var i=s(85893),a=s(25675),l=s.n(a),o=s(89774),n=s(67294),r=s(83085),d=s(41341),c=s(65482),p=s(35913);let m=e=>{let{thisPage:t,setPage:s,currentPage:a}=e;return(0,i.jsx)(c.z,{className:"h-[30px] w-[30px] rounded-lg !p-0 ".concat(a!==t&&"border border-white"),variant:t&&a===t?"orange":"gray",onClick:()=>s(t),disabled:!t,children:t||"..."})},x=e=>{let{currentPage:t,totalPageCount:s,setPage:a}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(m,{thisPage:1,setPage:a,currentPage:t}),t<=5?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(m,{thisPage:2,setPage:a,currentPage:t}),(0,i.jsx)(m,{thisPage:3,setPage:a,currentPage:t}),(0,i.jsx)(m,{thisPage:4,setPage:a,currentPage:t}),(0,i.jsx)(m,{thisPage:5,setPage:a,currentPage:t}),(0,i.jsx)(m,{})]}):t>=s-4?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(m,{}),(0,i.jsx)(m,{thisPage:s-4,setPage:a,currentPage:t}),(0,i.jsx)(m,{thisPage:s-3,setPage:a,currentPage:t}),(0,i.jsx)(m,{thisPage:s-2,setPage:a,currentPage:t}),(0,i.jsx)(m,{thisPage:s-1,setPage:a,currentPage:t})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(m,{}),(0,i.jsx)(m,{thisPage:t-1,setPage:a,currentPage:t}),(0,i.jsx)(m,{thisPage:t,setPage:a,currentPage:t}),(0,i.jsx)(m,{thisPage:t+1,setPage:a,currentPage:t}),(0,i.jsx)(m,{})]}),(0,i.jsx)(m,{thisPage:s,setPage:a,currentPage:t})]})};t.Z=e=>{let{wrapperClassName:t,table:s}=e,{t:a}=(0,o.$G)(),m=(0,n.useRef)(null),[u,g]=(0,n.useState)(1),h=s.getPageCount(),v=s.getState().pagination.pageIndex+1;(0,n.useEffect)(()=>{g(v)},[v]);let j=e=>{s.setPageIndex(e-1)};return(0,i.jsxs)("div",{className:(0,p.cn)("flex items-center justify-between gap-2 text-sm",t),children:[(0,i.jsxs)("div",{className:"flex items-center gap-1",children:[a("common.labels.page"),(0,i.jsx)("input",{ref:m,value:u,className:"mx-2 h-[30px] w-[30px] justify-center rounded-lg border border-white p-2 hover:bg-white/40 focus:bg-transparent focus:outline-none",type:"number",onChange:e=>{let t=Number(e.target.value);t<1?g(1):t>h?g(h):g(t)},onBlur:e=>{e.target.value&&j(Number(e.target.value))},onKeyDown:e=>{if("Enter"===e.key&&e.currentTarget.value){var t;null===(t=m.current)||void 0===t||t.blur()}}}),a("common.of").toLowerCase(),(0,i.jsx)("span",{className:"font-bold",children:h})," "]}),(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)(c.z,{variant:"gray",className:"h-[30px] w-[30px] rounded-lg !bg-black !p-0",onClick:()=>s.previousPage(),disabled:!s.getCanPreviousPage(),children:(0,i.jsx)(l(),{src:r.Z,alt:"arrowLeft"})}),h>7?(0,i.jsx)(x,{currentPage:v,totalPageCount:h,setPage:j}):(0,i.jsx)(i.Fragment,{children:Array.from({length:h}).map((e,t)=>(0,i.jsx)(c.z,{className:"h-[30px] w-[30px] rounded-lg !p-0 ".concat(s.getState().pagination.pageIndex!==t&&"border border-white"),variant:s.getState().pagination.pageIndex===t?"orange":"gray",onClick:()=>s.setPageIndex(t),children:t+1},t))}),(0,i.jsx)(c.z,{variant:"gray",className:"h-[30px] w-[30px] rounded-lg !bg-black !p-0",onClick:()=>s.nextPage(),disabled:!s.getCanNextPage(),children:(0,i.jsx)(l(),{src:d.Z,alt:"arrowRight"})})]})]})}},7906:function(e,t,s){"use strict";s.d(t,{D:function(){return i}});let i=function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{minimumFractionDigits:2,maximumFractionDigits:2},i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],{minimumFractionDigits:a,maximumFractionDigits:l}=s;if(i){let s;let i=Math.abs(e);return s=i>=1e9?(e/1e9).toLocaleString(void 0,{minimumFractionDigits:1,maximumFractionDigits:1})+"B":i>=1e6?(e/1e6).toLocaleString(void 0,{minimumFractionDigits:1,maximumFractionDigits:1})+"M":i>
1=1e5?(e/1e3).toLocaleString(void 0,{minimumFractionDigits:1,maximumFractionDigits:1})+"K":e.toLocaleString(void 0,{minimumFractionDigits:a,maximumFractionDigits:l}),t?"".concat(t," ").concat(s):s}let o=e.toLocaleString(void 0,{minimumFractionDigits:a,maximumFractionDigits:l});return t?"".concat(t," ").concat(o):o}},72677:function(e,t,s){"use strict";s.r(t),s.d(t,{__N_SSP:function(){return K},default:function(){return X}});var i=s(85893),a=s(89774),l=s(67294),o=s(94285),n=s(74140),r=s(54418),d=s(27484),c=s.n(d),p=s(87536),m=s(65482),x=s(5871),u=s(16057),g=s(54908),h=s(99971),v=s(2090),j=s(42698),f=s(2819),E=s(33235),b=s(96598),N=s(79013),C=e=>{let{promotionData:t}=e,s=(0,f.TL)(),{t:o}=(0,a.$G)(),{id:n,stopEditing:r}=(0,j.Z)(),{register:d,handleSubmit:C,clearErrors:D,control:w,setValue:P,getValues:y,setError:_,watch:R,formState:{errors:I},trigger:T}=(0,p.cI)({mode:"onChange"}),A=R("scope"),{eventList:F,loading:S}=(0,h.Z)({scope:A}),{loading:L,updatePromotion:M}=(0,g.Z)(),{validateEventAndTicket:U}=(0,v.L)(),Z=(0,l.useCallback)(()=>{if(!t)return;let{events:e,selectedPromoTicketsIds:i}=t;if(null==e?void 0:e.length){let t=new Map(F.map(e=>[e.id,e])),i=e.filter(e=>e.id&&t.has(e.id)).map(e=>t.get(e.id)||null);i.length&&s((0,E.CL)({eventSlot:i}))}(null==i?void 0:i.length)&&s((0,E.Dv)({ticketSlot:i}))},[s,F,t]),k=(0,l.useCallback)(()=>{if(!t)return;let{code:e,title:s,description:i,startDate:a,expiryDate:l,scope:o,promoPercentageValue:n,promoValue:r,promoBuyQuantity:d,promoFreeQuantity:p,promotionType:m,status:x,isLimited:u,quantity:g,maximumOrderAmount:h,platform:v}=t||{};P("code",e.toUpperCase()),P("title",s),P("description",i),P("startDate",c().unix(a.seconds).toDate()),P("expiryDate",c().unix(l.seconds).toDate()),P("promoPercentageValue",n),P("promoValue",r),P("promoBuyQuantity",d),P("promoFreeQuantity",p),P("promotionType",m),P("status",x),P("scope",o),P("maximumOrderAmount",h||null),P("platform",v||b._R.ALL),u?(P("isLimited",u),P("quantity",g)):(P("isLimited",!1),P("quantity",null)),Z()},[t,Z,P]);return(0,l.useEffect)(()=>{k()},[k]),(0,i.jsx)(x.Z,{children:(0,i.jsxs)("form",{onSubmit:e=>{e.preventDefault(),C(async e=>{U(e)&&M(e,n)})()},children:[(0,i.jsxs)(u.Z,{children:[(0,i.jsxs)("div",{className:"text-xl font-semibold capitalize",children:[o("pages.promotions.labels.view-promotions")," ",(0,i.jsx)("span",{className:"text-green-primary",children:">"})," ",o("pages.promotions.labels.edit-promotion")]}),(0,i.jsxs)("div",{className:"flex items-center gap-[15px]",children:[(0,i.jsx)(m.z,{variant:"white",onClick:()=>{r(),k()},children:o("common.buttons.cancel")}),(0,i.jsx)(m.z,{variant:"orange",type:"submit",loading:L,children:o("common.buttons.save")})]})]}),(0,i.jsx)(N.Z,{formProps:{register:d,control:w,errors:I,setError:_,clearErrors:D,setValue:P,getValues:y,watch:R,trigger:T},eventList:F,fetchingEventList:S})]})})},D=s(80462),w=s(69283),P=s(15539),y=s(59167),_=s(10850),R=s(84105);let I=e=>{let t=e.map(e=>{let{userName:t,usedFor:s,dateUsed:i}=e;return{Email:t,"Used for":s,"Date Used":i}}),s=R.P6.json_to_sheet(t),i=R.P6.book_new();R.P6.book_append_sheet(i,s,"Promo Code Usage"),(0,R.NC)(i,"promo-code-usage.xlsx")};var T=s(7906),A=s(10777),F=s(81927),S=s(71217),L=s(10807);let M=async e=>{let t=S.I8.currentUser;if(!t)throw Error("User not authenticated");let s=await t.getIdToken(),i=F.lh===L.e.PRODUCTION?"".concat(F.T5,"/getPromoCodeUsage"):"".concat(F.T5,"/getPromoCodeUsageDev"),a=await fetch("".concat(i,"?promoCode=").concat(e),{method:"GET",headers:{Authorization:"Bearer ".concat(s),"Content-Type":"application/json"}});if(!a.ok)throw Error("Failed to fetch used promotions.");return(await a.json()).map(e=>({userName:e.userId,usedFor:e.eventName||"N/A",dateUsed:c()(1e3*e.usedAt._seconds).format("DD/MM/YYYY")}))};var U=e=>{let{promoCode:t}=e,{data:s=[],isPending:i}=(0,A.a)({queryKey:["usedPromotions",t],queryFn:()=>M(t),enabled:!!t});return{usedPromotionList:s,loading:i}},Z=s(28266),k=s(27060),O=s(74094),V=s(23494),G=s(28685);let z=(0,k.Cl)(),B=e=>{let{children:t}=e;return(0,i.jsx)("span",{className:"text-[15px] font-semibold",children:t})};var Y=e=>{let{usedPromotionList:t}=e,{t:s}=(0,a.$G)(),o=(0,l.useMemo)(()=>
1[z.display({id:"id",header:()=>(0,i.jsx)(B,{children:s("pages.promotions.labels.no")}),cell:e=>(0,i.jsx)("span",{children:e.row.index+1}),size:50}),z.accessor("userName",{id:"userName",header:()=>(0,i.jsx)(B,{children:"Email"}),cell:e=>(0,i.jsx)("div",{className:"line-clamp-1 break-all","data-tooltip-id":"tooltip","data-tooltip-content":e.getValue(),"data-tooltip-place":"top",children:e.getValue()})}),z.accessor("usedFor",{id:"usedFor",header:()=>(0,i.jsx)(B,{children:"Used for"}),cell:e=>(0,i.jsx)("div",{className:"line-clamp-1 break-all","data-tooltip-id":"tooltip","data-tooltip-content":e.getValue(),"data-tooltip-place":"top",children:e.getValue()})}),z.accessor("dateUsed",{id:"dateUsed",header:()=>(0,i.jsx)(B,{children:"Date Used"}),cell:e=>(0,i.jsx)("div",{children:e.getValue()})}),z.display({id:"edit",header:()=>(0,i.jsx)(B,{children:s("pages.promotions.labels.edit")}),cell:e=>(0,i.jsx)(V.Z,{}),size:64})],[]),n=(0,O.b7)({data:t,columns:o,getCoreRowModel:(0,k.sC)(),getPaginationRowModel:(0,k.G_)(),initialState:{pagination:{pageIndex:0,pageSize:6}},autoResetPageIndex:!1});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"overflow-y-auto rounded-2xl",children:(0,i.jsxs)("table",{className:"w-full bg-white",children:[(0,i.jsx)("thead",{className:"h-[50px] bg-black text-white",children:n.getHeaderGroups().map(e=>(0,i.jsx)("tr",{children:e.headers.map(e=>(0,i.jsx)("th",{style:{width:e.getSize()},children:e.isPlaceholder?null:(0,O.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,i.jsx)("tbody",{children:n.getRowModel().rows.map(e=>(0,i.jsx)("tr",{className:"hover:bg-gray-250",children:e.getVisibleCells().map(e=>(0,i.jsx)("td",{className:"border-b-2 border-r-2 border-gray-100 px-5 pb-4 pt-5 text-center text-sm",children:(0,O.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id))})]})}),(0,i.jsx)(G.Z,{table:n,wrapperClassName:"mt-5"})]})};let J=e=>{let{title:t,value:s,valueClassName:a,children:l,showTooltip:o=!1}=e;return(0,i.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,i.jsx)("div",{className:"text-xs text-gray-400",children:t}),(0,i.jsx)("div",{className:"line-clamp-1 text-sm ".concat(a),"data-tooltip-id":"tooltip","data-tooltip-content":o?s:"","data-tooltip-place":"right",children:s||l})]})},q=e=>{var t;let{scope:s,eventIndex:l,event:o,selectedPromoTicketsIds:n}=e,{t:r}=(0,a.$G)(),{name:d,id:c,ticketClasses:p}=o,m=(null==n?void 0:null===(t=n[l])||void 0===t?void 0:t[c])||[],x=null==p?void 0:p.filter(e=>m.includes(e.id));return(0,i.jsxs)("div",{className:"flex flex-col gap-[18px] rounded-lg bg-gray-100 p-4",children:[(0,i.jsxs)("div",{className:"flex gap-5",children:[(0,i.jsx)(D.Z,{width:31.5,height:34.5,color:"#E7661D"}),(0,i.jsx)("div",{className:"flex grow flex-col gap-1",children:(0,i.jsx)(J,{title:"".concat(r("pages.promotions.labels.event")," ").concat(l+1),value:d})})]}),s===b.RZ.TICKETS&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"h-[2px] bg-white"}),(0,i.jsx)("div",{className:"grid grid-cols-2 gap-1",children:null==x?void 0:x.map((e,t)=>(0,i.jsx)(J,{title:"".concat(r("pages.promotions.labels.ticket")," ").concat(t+1),value:e.name,showTooltip:!0},e.id))})]})]})};var H=e=>{let{promotionData:t,fetchingPromotionData:s}=e,{t:l}=(0,a.$G)(),{router:n,category:r,startEditing:d}=(0,j.Z)(),{code:p,title:g,description:h,startDate:v,expiryDate:f,scope:E,currencyCode:N,events:C,promoPercentageValue:D,promoValue:R,promoBuyQuantity:A,promoFreeQuantity:F,promotionType:S,selectedPromoTicketsIds:L,status:M,isLimited:k,quantity:O,usedCount:V,maximumOrderAmount:G,platform:z}=t||{},B=c().unix(null==v?void 0:v.seconds).format("DD/MM/YYYY"),H=c().unix(null==f?void 0:f.seconds).format("DD/MM/YYYY"),{usedPromotionList:Q,loading:$}=U({promoCode:p}),W=e=>{if(!e)return b.JA.INACTIVE;if(e===b.JA.INACTIVE)return e;if(e===b.JA.ACTIVE){var s,i;let e=c()(),a=c().unix(null==t?void 0:null===(s=t.startDate)||void 0===s?void 0:s.seconds),l=c().unix(null==t?void 0:null===(i=t.expiryDate)||void 0===i?void 0:i.seconds),o=e.isAfter(a),n=e.isAfter(l);return V&&O&&V>=O||n?b.JA.EXPIRED:o?b.JA.ACTIVE:b.JA.UPCOMING}};return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(x.Z,{children:[(0,i.jsxs)(u.Z,{children:[(0,i.jsxs)("div",{className:"text-xl font-semibold capitalize",children:[l("pages.promotions.labels.view-promotions")," ",(0,i.jsx)("span",{className:"text-green-primary",children:">"}
1)," ",l("pages.promotions.labels.promo-details")]}),(0,i.jsxs)("div",{className:"flex items-center gap-[15px]",children:[(0,i.jsx)(m.z,{variant:"white",onClick:()=>n.push("".concat(Z.C.PROMOTIONS,"/").concat(r)),children:l("common.buttons.back")}),(0,i.jsx)(m.z,{variant:"orange",onClick:d,children:l("pages.promotions.labels.edit-promo")})]})]}),s?(0,i.jsx)(y.Z,{}):(0,i.jsxs)("div",{className:"mt-[30px] flex w-full flex-col gap-[30px] 1xl:flex-row",children:[(0,i.jsxs)("div",{className:"flex h-fit w-full shrink-0 flex-col gap-[25px] rounded-2xl bg-white p-[30px] 1xl:w-1/2 2xl:w-[60%]",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)("div",{className:"text-lg font-semibold",children:l("pages.promotions.labels.promotion-details")}),p&&(0,i.jsx)(_.Z,{title:l("pages.promotions.messages.share"),label:l("pages.promotions.labels.share-promo"),href:p.toUpperCase(),iconHeight:20,iconWidth:20})]}),(0,i.jsx)("div",{className:"h-[2px] bg-gray-100"}),(0,i.jsxs)("div",{className:"grid grid-cols-2 gap-y-3",children:[(0,i.jsx)(J,{title:l("pages.promotions.labels.promotion-code"),value:null==p?void 0:p.toUpperCase()}),(0,i.jsx)(J,{title:l("pages.promotions.labels.title"),value:g}),(0,i.jsx)(J,{title:l("pages.promotions.labels.promo-start-date"),value:B}),(0,i.jsx)(J,{title:l("pages.promotions.labels.promo-end-date"),value:H}),(0,i.jsx)(J,{title:l("pages.promotions.labels.description"),value:h||"N/A"}),(0,i.jsx)(J,{title:l("pages.promotions.labels.promo-scope"),value:null==E?void 0:E.split("_").join(" "),valueClassName:"capitalize"}),(0,i.jsx)(J,{title:l("pages.promotions.labels.promotion-usage-limit"),value:l(k?"pages.promotions.labels.limited":"pages.promotions.labels.unlimited")}),k&&(0,i.jsx)(J,{title:l("pages.promotions.labels.quantity"),value:O.toString()}),(0,i.jsx)(J,{title:l("pages.promotions.labels.promotion-usage"),children:(0,i.jsx)("span",{className:"capitalize",children:z||b._R.ALL})})]}),(0,i.jsx)("div",{className:"h-[2px] bg-gray-100"}),(0,i.jsx)("div",{className:"text-lg font-semibold",children:l("pages.promotions.labels.assigned-events")}),(0,i.jsx)("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2 1xl:grid-cols-1 2xl:grid-cols-2",children:null==C?void 0:C.map((e,t)=>(0,i.jsx)(q,{eventIndex:t,scope:E,event:e,selectedPromoTicketsIds:L},e.id))})]}),(0,i.jsxs)("div",{className:"flex h-fit flex-1 flex-col gap-[30px]",children:[(0,i.jsxs)("div",{className:"flex flex-col gap-[25px] rounded-2xl bg-white p-[30px]",children:[(0,i.jsx)("div",{className:"text-lg font-semibold",children:l("pages.promotions.labels.promotion-value")}),(0,i.jsx)("div",{className:"h-[2px] bg-gray-100"}),(0,i.jsxs)("div",{className:"grid grid-cols-2 gap-y-3",children:[(0,i.jsx)(J,{title:l("pages.promotions.labels.promotion-type"),value:l(S===b.O0.VALUE?"pages.promotions.method.value-based":S===b.O0.PERCENTAGE?"pages.promotions.method.percentage-based":"pages.promotions.method.buy-x-get-y-free")}),S===b.O0.VALUE||S===b.O0.PERCENTAGE?(0,i.jsx)(J,{title:l("pages.promotions.labels.promotion-value"),value:S===b.O0.VALUE?(0,T.D)(R||0,N):"".concat(D,"%")}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(J,{title:l("pages.promotions.labels.promotion-buy-quantity"),value:null==A?void 0:A.toString()}),(0,i.jsx)(J,{title:l("pages.promotions.labels.promotion-free-quantity"),value:null==F?void 0:F.toString()})]}),(0,i.jsx)(J,{title:l("pages.promotions.labels.status"),children:(0,i.jsxs)("div",{className:"flex items-center gap-[10px] capitalize",children:[(0,i.jsx)(P.Z,{orderStatus:W(M)})," ",W(M)]})}),G&&(0,i.jsx)(J,{title:l("pages.promotions.labels.max-tickets-per-order"),value:G.toString()})]})]}),(0,i.jsxs)("div",{className:"max-w-full",children:[(0,i.jsxs)("div",{className:"mb-5 flex items-center justify-between",children:[(0,i.jsx)("div",{className:"text-xl font-semibold leading-[1.2]",children:"Promo code usage"}),Q.length>0&&!$&&(0,i.jsxs)(m.z,{className:"flex gap-2",variant:"orange",onClick:()=>I(Q),children:[(0,i.jsx)(w.Z,{}
1),l("pages.promotion.buttons.download-list")]})]}),$?(0,i.jsx)(y.Z,{}):(0,i.jsx)(i.Fragment,{children:Q.length>0?(0,i.jsx)(Y,{usedPromotionList:Q}):(0,i.jsx)("div",{children:(0,i.jsxs)("div",{className:"flex h-[150px] flex-col items-center justify-center gap-2",children:[(0,i.jsx)(o.Z,{width:31.8,height:28.7,color:"#7C8288"}),(0,i.jsx)("div",{className:"text-sm text-gray-400",children:l("pages.promotions.messages.no-usage")})]})})})]})]})]})]})})},Q=s(90109),$=s(81808),W=()=>{let e=(0,f.TL)(),{id:t}=(0,j.Z)(),{vendorId:s}=(0,f.CG)(e=>e.user.vendorData)||{},[i,a]=(0,l.useState)(),[o,n]=(0,l.useState)(!1),r=(0,l.useCallback)(async()=>{if(s){n(!0);try{let e=(0,Q.JU)(S.RZ,"environments",F.lh,"vendors",s,"promotions",t),i=(await (0,Q.QT)(e)).data();a(i)}catch(t){console.error("Error fetching promotion:",t),e((0,$.fz)({show:!0,message:"Error fetching promotion",variant:"error"}))}finally{n(!1)}}},[e,t,s]);return(0,l.useEffect)(()=>{r()},[r]),{promotionData:i,loading:o}},K=!0,X=()=>{let{t:e}=(0,a.$G)(),{isEditing:t}=(0,j.Z)(),{promotionData:s,loading:l}=W();return(0,i.jsxs)(n.Z,{title:e("pages.promotions.title"),containerClassnames:["overflow-auto"],children:[(0,i.jsxs)(r.Z,{children:[(0,i.jsx)(o.Z,{width:26.8,height:23.7,color:"#219E9E"}),e("pages.promotions.title")]}),t?(0,i.jsx)(C,{promotionData:s}):(0,i.jsx)(H,{promotionData:s,fetchingPromotionData:l})]})}},10807:function(e,t,s){"use strict";var i,a;s.d(t,{e:function(){return i}}),(a=i||(i={})).PRODUCTION="production",a.TEST="test"},58223:function(e,t,s){"use strict";var i,a,l,o;s.d(t,{I:function(){return i},M:function(){return a}}),(l=i||(i={})).BUSINESS_DETAILS="business_details",l.BUSINESS_INFORMATION="business_information",l.EQUIPMENT_REQUEST="equipment_request",(o=a||(a={})).NEW_REQUEST="new_request",o.REJECTED="rejected",o.IN_PROGRESS="in_progress",o.PENDING_PAYMENT="pending_payment",o.PAID="paid",o.ON_DELIVERY="on_delivery",o.DELIVERED="delivered",o.PENDING_RETURN="pending_return",o.RETURNED="returned",o.CREDIT_ISSUES="credit_issues",o.COMPLETED="completed"},20067:function(){},72061:function(){}},function(e){e.O(0,[6342,2251,8159,1664,2040,7988,5409,246,9198,8736,8258,4259,4140,9981,5014,4272,3588,2888,9774,179],function(){return e(e.s=14456)}),_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.