PageSourceSearch

https://tabgraf.com/_next/static/chunks/pages/admin/finance/subscriptions-304a1fc276691e48.js

js tabgraf.com collected 2026-09-24 09:52:37 UTC 12,054 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[17061,86125],{24539:(e,l,t)=>{"use strict";t.d(l,{A:()=>m});var a=t(37876),n=t(14232),s=t(18847),i=t.n(s),d=t(90739),c=t(87021);let r=i()(()=>t.e(49179).then(t.bind(t,4417)),{loadableGenerated:{webpack:()=>[null]}}),o=i()(()=>Promise.all([t.e(81647),t.e(62483),t.e(1492),t.e(44084)]).then(t.bind(t,91974)),{loadableGenerated:{webpack:()=>[null]}}),u=i()(()=>Promise.all([t.e(52939),t.e(70754),t.e(84270),t.e(76627),t.e(88052),t.e(41597),t.e(59541),t.e(19828)]).then(t.bind(t,15521)),{loadableGenerated:{webpack:()=>[null]}});function m(e){let{onProductSelect:l,width:t=250,multiple:s=!0,withDetails:i=!1,className:m="mr-10"}=e,[h,p]=(0,n.useState)(null);return(0,n.useEffect)(()=>{fetch("".concat(d.JR,"/api/admin/products/lookup"),{method:"GET",headers:{Authorization:"Bearer ".concat(localStorage.getItem("adminAuthToken"))}}).then(e=>e.json()).then(e=>{let{status:l}=e;l?p(e.data.lookups):c.Bt.dispatch("toaster",{show:!0,message:"Some internal error occured",severity:"error"})})},[]),(0,a.jsx)(o,{size:"small",multiple:s,className:m,options:null!=h?h:[],onChange:(e,t)=>
1s?l(i?t:null==t?void 0:t.map(e=>null==e?void 0:e.id)):l(i?t:null==t?void 0:t.id),getOptionLabel:e=>{var l;return null!=(l=null==e?void 0:e.title)?l:""},sx:{width:t,maxWidth:"100%"},slotProps:{popper:{sx:{zIndex:e=>e.zIndex.modal+1}}},renderInput:e=>(0,a.jsx)(u,{...e,label:"Products",InputProps:{...e.InputProps}}),renderOption:(e,l,t)=>(0,a.jsxs)(r,{component:"li",sx:{"& > img":{mr:2,flexShrink:0},whiteSpace:"normal",wordBreak:"break-word"},...e,children:[(null==l?void 0:l.icon)?(0,a.jsx)("img",{loading:"lazy",width:"20",src:"".concat(d.JR,"/").concat(l.icon),alt:l.title,onError:e=>{e.target.src="https://placehold.co/100x100/png?text=N/A"}}):(0,a.jsx)("img",{src:"https://placehold.co/100x100/png?text=N/A",width:20}),l.title]})})}},28928:(e,l,t)=>{"use strict";t.r(l),t.d(l,{default:()=>q});var a=t(37876),n=t(2927),s=t(93074),i=t(69677),d=t(21487),c=t(14232),r=t(18847),o=t.n(r),u=t(36439),m=t(1679),h=t(24539);let p=o()(()=>Promise.all([t.e(81647),t.e(62483),t.e(1492),t.e(44084)]).then(t.bind(t,91974)),{loadableGenerated:{webpack:()=>[null]}}),x=o()(()=>Promise.all([t.e(65962),t.e(75380)]).then(t.bind(t,17625)),{loadableGenerated:{webpack:()=>[null]}}),b=o()(()=>t.e(82623).then(t.bind(t,82623)),{loadableGenerated:{webpack:()=>[null]}}),v=o()(()=>Promise.all([t.e(52939),t.e(70754),t.e(84270),t.e(76627),t.e(88052),t.e(41597),t.e(59541),t.e(19828)]).then(t.bind(t,15521)),{loadableGenerated:{webpack:()=>[null]}});function g(e){var l,t,n,s,i;let{filterObj:d,setFilterObj:c}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{style:{display:"flex"},className:"w-100 mb-10",children:[(0,a.jsx)(m.A,{label:"Search subscription",onChange:e=>c(l=>({...l,searchQuery:e})),value:null!=(t=null==d?void 0:d.searchQuery)?t:""}),(0,a.jsx)(h.A,{selectedProduct:null!=(n=null==d?void 0:d.productId)?n:"",onProductSelect:e=>{c(l=>({...l,productId:e}))}}),(0,a.jsx)(u.A,{maxDate:new Date,dateFormat:"DD MMM, YYYY",dateRange:null==d?void 0:d.dateRange,onDateSelected:e=>{let l=null;e&&(l={startDate:e.startDate,endDate:e.endDate}),c(e=>({...e,dateRange:l}))}})]}),(0,a.jsxs)("div",{className:"flex mb-10",style:{alignItems:"center"},children:[(0,a.jsx)(p,{size:"small",multiple:!0,fullWidth:!0,value:null!=(s=null==d?void 0:d.statuses)?s:[],options:[{value:"initiated",label:"Initiated"},{value:"activated",label:"Activated"},{value:"cancelled",label:"Cancelled"},{value:"failed",label:"Failed"},{value:"cancel-initiated",label:"Cancel initiated"},{value:"overdued",label:"Overdued"}],limitTags:3,autoHighlight:!0,onChange:(e,l)=>{c(e=>({...e,statuses:l}))},className:"mr-10",sx:{width:540},getOptionLabel:e=>e.label,getOptionDisabled:e=>(null==d?void 0:d.statuses)&&(null==d?void 0:d.statuses.map(e=>e.value).includes(e.value)),renderInput:e=>(0,a.jsx)(v,{...e,label:"Subscription status"})}),(0,a.jsx)("div",{className:"nowrap",children:(0,a.jsx)(b,{label:"Include FREE",control:(0,a.jsx)(x,{checked:null!=(i=null==d||null==(l=d.plans)?void 0:l.includes("FREE"))&&i,name:"FREE",onChange:e=>((e,l)=>{let t=structuredClone(d);if(l)(null==t?void 0:t.plans)?t.plans.push(e):t.plans=[e];else{var a,n;let l=null==t||null==(a=t.plans)?void 0:a.findIndex(l=>l==e);null==t||null==(n=t.plans)||n.splice(l,1)}c(t)})("FREE",e.target.checked)})})})]})]})}var j=t(89099),w=t(48230),y=t.n(w),f=t(87021),N=t(90739);t(26515);var k=t(33073),A=t(49505),D=t(68927),Y=t(75334),S=t(12810);let G=o()(()=>t.e(55449).then(t.bind(t,77830)),{loadableGenerated:{webpack:()=>[null]}}),M=o()(()=>t.e(87125).then(t.bind(t,9506)),{loadableGenerated:{webpack:()=>[null]}}),E=o()(()=>t.e(63453).then(t.bind(t,85834)),{loadableGenerated:{webpack:()=>[null]}}),C=o()(()=>t.e(16612).then(t.bind(t,94231)),{loadableGenerated:{webpack:()=>[null]}}),I=o()(()=>t.e(4183).then(t.bind(t,26564)),{loadableGenerated:{webpack:()=>[null]}}),P=o()(()=>t.e(11541).then(t.bind(t,33922)),{loadableGenerated:{webpack:()=>[null]}}),O=o()(()=>t.e(71760).then(t.bind(t,71760)),{loadableGenerated:{webpack:()=>[null]}}),R=o()(()=>Promise.all([t.e(81647),t.e(46664)]).then(t.bind(t,46664)),{loadableGenerated:{webpack:()=>[null]}});function F(e){let{filterObj:l,setFilterObj:t}=e,[n,s]=(0,c.useState)(1),[i,d]=(0,c.useState)(null),[r,o]=(0,c.useState)(!0),[u,m]=(0,c.useState)(!1),[h,p]=(0,c.useState)(0),x=(0,j.useRouter)(),b=(e,l)=>{let t=null==e?void 0:e.productId,a=null==e?void 0:e.searchQuery,n=null==e?void 0:e.dateRange,s=null==e?void 0:e.statuses,i=null==e?void 0:e.plans;fetch("".concat(N.JR,"/api/admin/finance/subscriptions/list?page=").concat(l).concat(t?"&productId=".concat(t):"").concat(n?"&dateRange=".concat(JSON.stringify(n)):"").concat(a?"&searchQuery=".concat(a):"").concat(s?"&statuses=".concat(JSON.stringify(null==s?void 0:s.map(e=>e.value))):"").concat(i?"&plans=".concat(JSON.stringify(i)):""),{method:"GET",headers:{Authorization:"Bearer ".concat(localStorage.getItem("adminAuthToken"))}}).then(e=>e.json()).then(e=>{let{status:l}=e;l?(d(e.data.subscriptions),p(e.data.total),o(!1),setTimeout(()=>{m(!1)},50)):f.Bt.dispatch("toaster",{show:!0,message:"Some internal error occured",severity:"error"})})};(0,c.useEffect)(()=>{l&&(m(!0),1==n?b(l,1):s(1),x.push("/admin/finance/subscriptions?filters="+JSON.stringify(l)))},[l]),(0,c.useEffect)(()=>
1{if(x.isReady){var e;let l=null==(e=x.query)?void 0:e.filters;l?t(JSON.parse(l=decodeURIComponent(l))):t({statuses:[{value:"activated",label:"Activated"},{value:"cancelled",label:"Cancelled"}]})}},[x.isReady]),(0,c.useEffect)(()=>{r||(m(!0),b(l,n))},[n]);let v=(0,c.useMemo)(()=>(0,a.jsx)(S.A,{}),[r]);return(0,a.jsxs)(a.Fragment,{children:[r?v:(0,a.jsx)(A.A,{loading:u,className:"mt-10",children:0===i.length?(0,a.jsx)(D.A,{message:"No subscriptions found"}):(0,a.jsx)(C,{component:O,children:(0,a.jsxs)(G,{"aria-label":"subscriptions",children:[(0,a.jsx)(I,{children:(0,a.jsxs)(P,{children:[(0,a.jsx)(E,{className:"text-bold text-md",children:"Product"}),(0,a.jsx)(E,{className:"text-bold text-md",children:"Customer"}),(0,a.jsx)(E,{className:"text-bold text-md",children:"Amount"}),(0,a.jsx)(E,{className:"text-bold text-md",children:"Gateway"}),(0,a.jsx)(E,{className:"text-bold text-md",children:"Licenses"}),(0,a.jsx)(E,{className:"text-bold text-md",align:"center",children:"Status"}),(0,a.jsx)(E,{className:"text-bold text-md",children:"Started on"}),(0,a.jsx)(E,{className:"text-bold text-md",children:"Ends on"})]})}),(0,a.jsx)(M,{children:null==i?void 0:i.map((e,l)=>{var t,n,s,i,d,c,r,o,u,m,h,p,x,b,v,g,j,w;return(0,a.jsxs)(P,{sx:{"&:hover":{backgroundColor:"var(--secondary-grey1-admin) !important"}},children:[(0,a.jsx)(E,{className:"text-md",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(y(),{href:"".concat(N.JR,"/admin/finance/subscriptions/").concat(e.subscriptionId),title:"Subscription detail",children:e.productName}),(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:"Plan:"})," ",e.planName]})]})}),(0,a.jsxs)(E,{className:"text-md",children:[(null==e||null==(t=e.billingAddress)?void 0:t.name)?(0,a.jsx)("div",{children:null==(n=e.billingAddress)?void 0:n.name}):null,(0,a.jsx)("div",{children:e.email}),(0,a.jsx)("div",{children:(null==e||null==(s=e.billingAddress)?void 0:s.country)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("img",{src:(null==(i=e.billingAddress)?void 0:i.country)&&"object"==typeof(null==(d=e.billingAddress)?void 0:d.country)?"https://flagcdn.com/w20/".concat(null==(o=e.billingAddress)||null==(r=o.country)||null==(c=r.code)?void 0:c.toLowerCase(),".png"):"https://flagcdn.com/w20/".concat(null==(m=e.billingAddress)||null==(u=m.country)?void 0:u.toLowerCase(),".png"),alt:null==(h=e.billingAddress)?void 0:h.country,width:22})," ",null==(p=e.billingAddress)?void 0:p.city,","," ",null!=(g=null==(b=e.billingAddress)||null==(x=b.country)?void 0:x.label)?g:null==(v=e.billingAddress)?void 0:v.country]}):null})]}),(0,a.jsxs)(E,{className:"text-md",children:[(0,a.jsxs)("div",{children:[null!=(w=null!=(j=null===Y.qx||void 0===Y.qx?void 0:Y.qx[null==e?void 0:e.currency])?j:null==e?void 0:e.currency)?w:"$",e.totalAmount]}),(0,a.jsx)("div",{children:e.billingCycle})]}),(0,a.jsx)(E,{className:"text-md",align:"center",children:"paypal"==e.paymentGateway?(0,a.jsx)("img",{src:"/images/payment-gateways-logos/paypal.png",width:75}):"stripe"==e.paymentGateway?(0,a.jsx)("img",{src:"/images/payment-gateways-logos/stripe.png",width:59}):"phonepe"==e.paymentGateway?(0,a.jsx)("img",{src:"/images/checkout/phone-pe.svg",width:75}):"razorpay"==e.paymentGateway?(0,a.jsx)("img",{src:"/images/checkout/razorpay.svg",width:75}):"paddle"==e.paymentGateway?(0,a.jsx)("img",{src:"/images/checkout/paddle.svg",width:55}):"bank-transfer"==e.paymentGateway&&(0,a.jsx)("img",{src:"/images/checkout/bank-icici.svg",width:65})}),(0,a.jsx)(E,{className:"text-md",children:e.licenses}),(0,a.jsx)(E,{className:"text-md",align:"left",children:(0,a.jsx)(R,{sx:{backgroundColor:(null==e?void 0:e.status)=="cancelled"||(null==e?void 0:e.status)=="failed"?"var(--danger-color-site)":(null==e?void 0:e.status)=="cancel-initiated"||(null==e?void 0:e.status)=="overdued"?"var(--warning-color-site)":(null==e?void 0:e.status)=="activated"&&"var(--success-color-site)",color:(null==e?void 0:e.status)!="initiated"?"white":"black"},label:null==e?void 0:e.status,size:"small",className:"ml-10",title:(null==e?void 0:e.status)=="cancelled"?(0,f.Yq)(new Date(e.cancelledOn),"DD MMM, YYYY, HH:mm:ss A"):(0,f.Yq)(new Date(e.startDate),"DD MMM, YYYY, HH:mm:ss A")})}),(0,a.jsx)(E,{className:"text-md",children:(0,a.jsx)("span",{title:(0,f.Yq)(new Date(e.startDate),"DD MMM, YYYY, HH:mm:ss A"),children:(0,f.Yq)(new Date(e.startDate),"DD MMM, YYYY")})}),(0,a.jsx)(E,{className:"text-md",children:(null==e?void 0:e.endDate)?(0,a.jsx)("span",{title:(0,f.Yq)(new Date(e.endDate),"DD MMM, YYYY, HH:mm:ss A"),children:(0,f.Yq)(new Date(e.endDate),"DD MMM, YYYY")}):"—"})]},l)})})]})})}),(0,a.jsxs)("div",{className:"flex mt-10",style:{justifyContent:"space-between"},children:[h>0?(0,a.jsxs)("div",{className:"text-md flex mb-10",style:{justifyContent:"flex-end"},children:["Total matched: ",h]}):null,!r&&h>=N.lo||n>1?(0,a.jsx)(k.A,{nextDisabled:0==i.length||i.length<N.lo,currentPage:n,setPage:s}):(0,a.jsx)("div",{})]})]})}function _(){let[e,l]=(0,c.useState)(null);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h1",{className:"admin-section-title",children:"Subscriptions"}),(0,a.jsx)(g,{setFilterObj:l,filterObj:e}),(0,a.jsx)(F,{filterObj:e,setFilterObj:l})]})}function q(){return(0,a.jsxs)(i.A,{title:"Subscriptions | Launchpad - Tabgraf",children:[(0,a.jsx)(s.default,{}),(0,a.jsx)(d.default,{}),(0,a.jsx)(n.A,{component:"main",className:"main-content",sx:{flexGrow:1,p:1},children:(0,a.jsx)(_,{})})]})}},55965:(e,l,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/finance/subscriptions",function(){return t(28928)}])}},e=>{e.O(0,[54313,48230,57124,23909,31233,5714,25647,18e3,66522,79475,78130,50407,21487,93074,79460,46593,90636,38792],()=>e(e.s=55965)),_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.