1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7293],{8186:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var s=r(37876);r(14232);let a=e=>(0,s.jsx)("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,s.jsx)("path",{d:"m18.75 5.25-13.5 13.5m13.5 0L5.25 5.25",stroke:e.color||"#fff",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})})},13133:e=>{e.exports={resource:"Resource_resource__RGqZU",categorySection:"Resource_categorySection__WvlAS",categoryContainer:"Resource_categoryContainer__qfJq5",categoryRow:"Resource_categoryRow__LuhPv",active:"Resource_active__WOBel",addNewCategoryBtn:"Resource_addNewCategoryBtn__OrMSM",resourceSection:"Resource_resourceSection__sGBBU",resourceTable:"Resource_resourceTable__678KJ",resourceTableHeader:"Resource_resourceTableHeader__qMrof",rowDivider:"Resource_rowDivider__8pQI_"}},35150:(e,t,r)=>{"use strict";r.d(t,{f:()=>n});var s=r(23920),a=r(8039);function n(e){let{data:t}=(0,s.I)(["joinrequests",e],()=>(0,a.HT1)({p:0,t:100,s1:0,sb1:"usr_fclt.confirmed",so1:"eq",s2:e,sb2:"usr_fclt.facilityId",so2:"eq",s3:0,sb3:"usr_fclt.admin",so3:"eq",s4:0,sb4:"usr_fclt.status",so4:"ne",ob:"usr_fclt.createdAt",o:"d"}),{enabled:void 0!=e,staleTime:0,cacheTime:0});return t?.data?.data?.filter(e=>0==e.confirmed)?.length??0}},36048:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/facility/members/credit",function(){return r(48821)}])},48821:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>S});var s=r(37876),a=r(14232),n=r(80013),l=r(92023),i=r(85461),c=r(15526),d=r(23920),o=r(77328),u=r.n(o),x=r(89099),m=r(39412),h=r(8039),f=r(42268),p=r(23960),b=r(43431),j=r(99362),N=r(94085),g=r(19189),v=r(30016),y=r(63853),w=r(13133),C=r.n(w),_=r(32059),A=r(58739),I=r(8186),F=r(11923),M=r(4134),R=r(46475);function k(){let{facility:e}=(0,a.useContext)(m.c),t=(0,i.jE)();(0,x.useRouter)();let[r,n]=(0,a.useState)(null),[o,w]=(0,a.useState)(""),[k,S]=(0,a.useState)(!1),[D,T]=(0,a.useState)(null),[q,L]=(0,a.useState)(!1),[B,E]=(0,a.useState)("add"),[$,O]=(0,a.useState)(""),[P,W]=(0,a.useState)(""),[z,G]=(0,a.useState)(0),[H,Q]=(0,a.useState)([]),{mutateAsync:U,isLoading:J}=(0,c.n)(t=>(0,h.HT1)({s:1,sb:"usr_fclt.confirmed",so:"eq",s3:1,sb3:"usr_fclt.status",so3:"eq",s4:t+"*",sb4:"CONCAT(usr.firstName, ' ', usr.lastName),usr.firstName,usr.lastName , usr.email , usr_fclt.memberId",so4:"l",s2:e?.id,sb2:"usr_fclt.facilityId",so2:"eq",ob:"usr_fclt.createdAt",o:"d"})),X=(0,y.YQ)(async e=>{let t=await U(e);t.status.toString().startsWith("2")&&T(t?.data)},600),{data:Y,refetch:Z}=(0,d.I)(["credit-balance",r?.userId,e?.id],()=>(0,h.AER)(r?.userId,e?.id).then(e=>e.data),{enabled:!!(r&&e?.id)}),{data:K,isLoading:V,isFetching:ee}=(0,d.I)(["credit-history",r?.userId,e?.id,z],()=>(0,h.G3d)({userId:r?.userId,facilityId:e?.id,p:z,t:15}).then(e=>e.data),{enabled:!!(r&&e?.id)});(0,a.useEffect)(()=>{0===z?Q(K?.data??[]):Q(e=>[...e,...K?.data??[]])},[K?.data]);let{data:et,refetch:er}=(0,d.I)(["member-cashout-requests",r?.userId,e?.id],()=>(0,h.ABW)({facilityId:e?.id,userId:r?.userId,p:0,t:20}).then(e=>e.data),{enabled:!!(r&&e?.id)}),es=et?.data??[],{mutateAsync:ea,isLoading:en}=(0,c.n)(e=>(0,h.tGt)(e)),{mutateAsync:el,isLoading:ei}=(0,c.n)(e=>(0,h.Qcz)(e)),{mutateAsync:ec,isLoading:ed}=(0,c.n)(e=>(0,h.PWZ)(e)),eo=e=>{E(e),O(""),W(""),L(!0)},eu=async()=>{if(!$||"cashout"!==B&&!P.trim())return;let s={userId:r?.userId,facilityId:e?.id,amount:parseFloat($),note:P.trim()||void 0};try{"add"===B?await ea({...s,note:P.trim()}):"deduct"===B?await el({...s,note:P.trim()}):await ec(s),(0,g.$U)({title:"",description:`Credit ${"add"===B?"added":"deduct"===B?"deducted":"cash-out request submitted"}.`,color:"success",variant:"flat"}),L(!1),await Z(),G(0),t.invalidateQueries(["credit-history",r?.userId,e?.id]),"cashout"===B&&await er()}catch(t){let e=t?.response?.data?.message||t?.response?.data?.description?.[0]||t?.message||"Unknown error";(0,g.$U)({title:"Error",description:e,color:"danger",variant:"flat"})}},ex=Y?.balance??0;return(0,s.jsxs)("div",{className:"custom_container",children:[(0,s.jsxs)(u(),{children:[(0,s.jsx)("title",{children:"Credit Management"}),(0,s.jsx)("meta",{name:"description",content:"Credit Management"})]}),(0,s.jsxs)("div",{style:{display:"flex",backgroundColor:"#fff"},className:"flex-col -mx-4",children:[(0,s.jsx)("div",{className:"px-4",children:(0,s.jsx)(l.A,{})}),(0,s.jsx)("section",{className:"flex flex-wrap items-center gap-2 px-4 py-3 border-b border-neutral95",children:r?(0,s.jsxs)("div",{className:"bg-[#F5F5FF] flex gap-2 items-center p-3 w-fit h-[40px]",children:[(0,s.jsx)(R.A,{userId:r?.userId,profileImage:r?.profileImage,name:(0,M.Mn)(r?.user),size:"sm",className:"!w-7 !h-7"}),(0,s.jsx)("span",{className:"text-sm text-neutral40",children:(0,M.Mn)(r?.user)}),(0,s.jsx)("div",{onClick:()=>{n(null),w(""),S(!1),T(null),Q([])},className:"cursor-pointer w-[20px] h-[20px] rounded-full bg-primary60 flex items-center justify-center",children:(0,s.jsx)(I.A,{width:14,height:14})})]}):(0,s.jsxs)("div",{className:"relative min-w-[280px] max-w-[400px]",children:[(0,s.jsx)(p.r,{startContent:(0,s.jsx)("img",{src:"/images/searchIcon.svg"}),variant:"flat",classNames:{inputWrapper:(0,v.cn)("rounded !bg-neutral95 data-[hover=true]:!bg-default-200 group-data-[focus=true]:!bg-default-100 text-neutral30 h-[48px]")},isClearable:!0,onClear:()=>{w(""),S(!1),T(null)},onChange:e=>{T(null),w(e.target.value),""!==e.target.value?(S(!0),X(e.target.value)):S(!1)},value:o,placeholder:"Search member by name or email"}),k&&(0,s.jsx)("div",{className:"absolute z-50 bg-white drop-shadow-md mt-2 max-h-[220px] overflow-auto rounded w-full",children:J?(0,s.jsx)("div",{className:"flex items-center justify-center h-[100px]",children:(0,s.jsx)(F.A,{color:"#736eff"})}):(0,s.jsx)("ul",{className:"p-0 m-0",children:0===(D?.data??[]).length?(0,s.jsx)("li",{className:"h-[48px] px-3 flex items-center text-sm text-neutral60",children:"No members found"}):(D?.data??[]).map(e=>{let t=(D?.config?.userInfo??[]).find(t=>
1t.id===e.userId);return(0,s.jsxs)("li",{onMouseDown:()=>{n(e),w(""),S(!1),T(null),G(0),Q([])},className:"h-[48px] px-3 flex items-center gap-2 hover:bg-[#F5F5FF] cursor-pointer bg-white",children:[(0,s.jsx)(R.A,{userId:t?.id??e.userId,profileImage:t?.profileImage,name:(0,M.Mn)(t?.firstName??e.user?.firstName,t?.lastName??e.user?.lastName),size:"md",className:"!w-9 !h-9"}),(0,s.jsx)("span",{className:"text-sm text-neutral40",children:(0,M.Mn)(t?.firstName??e.user?.firstName,t?.lastName??e.user?.lastName)})]},e.userId)})})})]})}),(0,s.jsx)("section",{className:"flex flex-wrap items-center gap-0 px-4 py-4 border-b border-neutral95",children:r?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex-1 min-w-[160px]",children:[(0,s.jsx)("div",{className:"text-xs text-neutral70 font-medium",children:"Member"}),(0,s.jsx)("div",{className:"text-2xl font-bold text-neutral mt-0.5",children:(0,M.Mn)(r?.user)})]}),(0,s.jsx)("div",{className:"w-px h-10 bg-neutral90 mx-4 hidden sm:block"}),(0,s.jsxs)("div",{className:"flex-1 min-w-[160px]",children:[(0,s.jsx)("div",{className:"text-xs text-neutral70 font-medium",children:"Credit Balance"}),(0,s.jsxs)("div",{className:"text-2xl font-bold text-[#25A486] mt-0.5",children:["$",ex.toFixed(2)]})]}),(0,s.jsxs)("div",{className:"ml-auto flex gap-2 flex-wrap",children:[(0,s.jsx)("button",{onClick:()=>eo("add"),className:"flex items-center gap-2 h-[40px] px-4 rounded bg-[#25A486] text-white text-sm font-medium hover:opacity-90 transition-opacity",children:"+ Add Credit"}),(0,s.jsx)("button",{onClick:()=>eo("deduct"),disabled:ex<=0,className:"flex items-center gap-2 h-[40px] px-4 rounded bg-error text-white text-sm font-medium hover:opacity-90 transition-opacity disabled:opacity-40 disabled:cursor-not-allowed",children:"â Deduct Credit"}),e?.allowClubCredit&&(0,s.jsx)("button",{onClick:()=>eo("cashout"),disabled:ex<=0,className:"flex items-center gap-2 h-[40px] px-4 rounded border border-neutral80 bg-white text-sm font-medium text-neutral30 hover:bg-neutral95 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Request Cash Out"})]})]}):(0,s.jsx)("div",{className:"text-sm text-neutral60 py-1",children:"Search and select a member to manage their credit."})}),e?.allowClubCredit&&r&&es.length>0&&(0,s.jsxs)("section",{className:"px-4 lg:px-8 py-4 border-b border-neutral95",children:[(0,s.jsx)("div",{className:"text-sm font-semibold text-neutral mb-3",children:"Cash-Out Requests"}),(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"border-b border-neutral90 text-neutral60 text-xs font-semibold uppercase",children:[(0,s.jsx)("th",{className:"text-left py-2 px-3",children:"Date"}),(0,s.jsx)("th",{className:"text-right py-2 px-3",children:"Amount"}),(0,s.jsx)("th",{className:"text-left py-2 px-3",children:"Status"}),(0,s.jsx)("th",{className:"text-left py-2 px-3",children:"Method"}),(0,s.jsx)("th",{className:"text-left py-2 px-3",children:"Note"})]})}),(0,s.jsx)("tbody",{children:es.map(e=>{let t,r;return(0,s.jsxs)("tr",{className:"border-b border-neutral95 hover:bg-neutral98",children:[(0,s.jsx)("td",{className:"py-2 px-3 text-neutral60",children:new Date(e.createdAt).toLocaleDateString()}),(0,s.jsxs)("td",{className:"py-2 px-3 text-right font-semibold",children:["$",Number(e.amount).toFixed(2)]}),(0,s.jsx)("td",{className:`py-2 px-3 font-semibold ${0===(t=e.status)?"text-[#B07700]":1===t?"text-[#25A486]":"text-error"}`,children:0===(r=e.status)?"Pending":1===r?"Paid":"Rejected"}),(0,s.jsx)("td",{className:"py-2 px-3 text-neutral60",children:e.paymentMethod??"â"}),(0,s.jsx)("td",{className:"py-2 px-3 text-neutral60",children:e.note??e.adminNote??"â"})]},e.id)})})]})]}),(0,s.jsx)("section",{className:`${C().resourceSection} !-mx-0 lg:!mx-4 lg:!mt-4 !mt-4`,children:r?V?(0,s.jsx)("div",{className:"flex justify-center py-16",children:(0,s.jsx)(b.o,{size:"lg"})}):0===H.length?(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center h-96",children:[(0,s.jsx)(A.A,{}),(0,s.jsx)("span",{className:"mt-4 font-bold text-neutral70 text-base",children:"No credit transactions yet"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("table",{className:`${C().resourceTable} !-m-0 lg:!m-0`,children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:C().resourceTableHeader,children:[(0,s.jsx)("th",{children:"Date"}),(0,s.jsx)("th",{children:"Type"}),(0,s.jsx)("th",{children:"Amount"}),(0,s.jsx)("th",{children:"Balance After"}),(0,s.jsx)("th",{children:"Note"})]})}),(0,s.jsx)("tbody",{children:H.map(e=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{className:"text-neutral60 text-sm whitespace-nowrap",children:new Date(e.createdAt).toLocaleDateString()}),(0,s.jsx)("td",{children:(0,s.jsx)("span",{className:`font-semibold text-sm ${1===e.type?"text-[#25A486]":"text-error"}`,children:1===e.type?"Added":"Deducted"})}),(0,s.jsxs)("td",{className:`font-semibold text-sm whitespace-nowrap ${1===e.type?"text-[#25A486]":"text-error"}`,children:[1===e.type?"+":"â","$",Number(e.amount).toFixed(2)]}),(0,s.jsxs)("td",{className:"text-neutral text-sm whitespace-nowrap",children:["$",Number(e.balanceAfter).toFixed(2)]}),(0,s.jsx)("td",{className:"text-neutral60 text-sm",children:e.note??"â"})]},e.id))})]}),K?.data?.length===15&&(0,s.jsx)("div",{className:"flex justify-center mt-4",children:(0,s.jsx)(f.T,{className:"rounded",color:"primary",variant:"bordered",isLoading:ee&&z>0,onClick:()=>G(e=>e+1),endContent:(0,s.jsx)(_.A,{}),children:"Show More"})})]}):(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center h-96",children:[(0,s.jsx)(A.A,{}),(0,s.jsx)("span",{className:"mt-4 font-bold text-neutral70 text-base",children:"Select a member to view history"})]})})]}),(0,s.jsxs)(j.A,{isOpen:q,onClose:()=>L(!1),size:N.Fr?"full":"2xl",title:(0,s.jsx)("span",{className:"text-lg font-bold text-neutral",children:"add"===B?"Add Credit":"deduct"===B?"Deduct Credit":"Request Cash Out"}),bodyClassName:"flex flex-col gap-4",footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(f.T,{variant:"flat",onClick:()=>L(!1),children:"Cancel"}),(0,s.jsx)(f.T,{className:`${"add"===B?"bg-[#25A486]":"deduct"===B?"bg-error":"bg-primary"} text-white font-bold`,isDisabled:!$||"cashout"!==B&&!P.trim()||("deduct"===B||"cashout"===B)&&parseFloat($)>ex,isLoading:en||ei||ed,onClick:eu,children:"add"===B?"Add Credit":"deduct"===B?"Deduct Credit":"Submit Request"})]}),children:[(0,s.jsxs)("div",{className:"text-sm text-neutral60",children:["Member: ",(0,s.jsx)("span",{className:"font-semibold text-neutral",children:(0,M.Mn)(r?.user)}),(0,s.jsx)("span",{className:"mx-2",children:"â¢"}),"Balance: ",(0,s.jsxs)("span",{className:"font-semibold text-neutral",children:["$",ex.toFixed(2)]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-sm font-semibold text-neutral60 mb
1-1 block",children:"Amount ($)"}),(0,s.jsx)("input",{type:"number",min:.01,step:.01,value:$,onChange:e=>O(e.target.value),className:"border border-neutral90 rounded px-3 py-2 text-sm w-full focus:outline-none focus:border-primary",placeholder:"0.00"}),("deduct"===B||"cashout"===B)&&parseFloat($)>ex&&(0,s.jsxs)("p",{className:"text-xs text-error mt-1",children:["Amount exceeds available balance ($",ex.toFixed(2),")"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"text-sm font-semibold text-neutral60 mb-1 block",children:["Note ","cashout"!==B&&(0,s.jsx)("span",{className:"text-error",children:"*"})]}),(0,s.jsx)("textarea",{value:P,onChange:e=>W(e.target.value),rows:3,maxLength:500,className:"border border-neutral90 rounded px-3 py-2 text-sm w-full resize-none focus:outline-none focus:border-primary",placeholder:"cashout"===B?"Optional: payout method or reason":"Reason for this adjustmentâ¦"})]})]})]})}k.propTypes={},k.getLayout=function(e){return(0,s.jsx)(n.A,{children:e})};let S=k},58739:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var s=r(37876);r(14232);let a=e=>(0,s.jsxs)("svg",{width:196,height:168,viewBox:"0 0 196 168",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,s.jsx)("path",{d:"M130.63 56.512c-13.347 0-26.933-.542-39.642-4.083-12.47-3.46-23.92-10.173-34.126-17.94-6.682-5.054-12.757-9.073-21.432-8.467a39.6 39.6 0 0 0-23.154 9.09C1.24 44.679 2.899 62.587 7.316 75.169c6.634 18.945 26.822 32.069 43.98 40.648 19.822 9.903 41.605 15.643 63.436 18.96 19.136 2.902 43.725 5.023 60.309-7.479 15.229-11.481 19.407-37.697 15.676-55.398a21.8 21.8 0 0 0-7.83-13.283c-10.7-7.814-26.662-2.6-38.686-2.328-4.465.095-9.01.207-13.571.223",fill:"#EEEDFF"}),(0,s.jsx)("path",{d:"M97.973 165.793c32.331 0 58.54-1.635 58.54-3.652 0-2.016-26.209-3.651-58.54-3.651-32.33 0-58.54 1.635-58.54 3.651s26.21 3.652 58.54 3.652",fill:"#F2F2F2"}),(0,s.jsx)("path",{d:"M140.309 8.197 50.156 40.76a5.98 5.98 0 0 0-3.593 7.656l19.02 52.658a5.98 5.98 0 0 0 7.656 3.593l90.154-32.564a5.98 5.98 0 0 0 3.592-7.656l-19.02-52.658a5.98 5.98 0 0 0-7.656-3.593",fill:"#E3E3E3"}),(0,s.jsx)("path",{d:"M71.23 132.8a1.563 1.563 0 1 0 0-3.126 1.563 1.563 0 0 0 0 3.126M112.723 4.462a1.563 1.563 0 1 0 0-3.126 1.563 1.563 0 0 0 0 3.126",fill:"#CFCFCF"}),(0,s.jsx)("path",{d:"M69.297 14.557v6.872M65.856 18h6.872m97.401 21.96v6.856m-3.445-3.428h6.873",stroke:"#BABABA",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M143.752 43.202 48.96 57.437a5.98 5.98 0 0 0-5.025 6.801l8.314 55.368a5.98 5.98 0 0 0 6.802 5.025l94.791-14.234a5.98 5.98 0 0 0 5.026-6.802l-8.314-55.367a5.98 5.98 0 0 0-6.802-5.026",fill:"#fff",stroke:"#BABABA",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"m138.123 51.99-7.98 1.199a2.44 2.44 0 0 0-2.05 2.775l1.198 7.98a2.44 2.44 0 0 0 2.775 2.05l7.98-1.199a2.44 2.44 0 0 0 2.05-2.775l-1.198-7.98a2.44 2.44 0 0 0-2.775-2.05M84.37 99.819l-23.323 3.502a1.34 1.34 0 0 0-1.125 1.524l.104.694a1.34 1.34 0 0 0 1.523 1.125l23.324-3.502a1.34 1.34 0 0 0 1.126-1.524l-.105-.693a1.34 1.34 0 0 0-1.523-1.126m15.772 4.473-37.737 5.667a1.69 1.69 0 1 0 .502 3.343l37.737-5.667a1.69 1.69 0 0 0-.502-3.343",fill:"#D2D2D2"})]})},63853:(e,t,r)=>{"use strict";r.d(t,{YQ:()=>a});var s=r(14232);function a(e,t,r){var a=this,n=(0,s.useRef)(null),l=(0,s.useRef)(0),i=(0,s.useRef)(null),c=(0,s.useRef)([]),d=(0,s.useRef)(),o=(0,s.useRef)(),u=(0,s.useRef)(e),x=(0,s.useRef)(!0);u.current=e;var m="u">typeof window,h=!t&&0!==t&&m;if("function"!=typeof e)throw TypeError("Expected a function");t=+t||0;var f=!!(r=r||{}).leading,p=!("trailing"in r)||!!r.trailing,b="maxWait"in r,j="debounceOnServer"in r&&!!r.debounceOnServer,N=b?Math.max(+r.maxWait||0,t):null;return(0,s.useEffect)(function(){return x.current=!0,function(){x.current=!1}},[]),(0,s.useMemo)(function(){var e=function(e){var t=c.current,r=d.current;return c.current=d.current=null,l.current=e,o.current=u.current.apply(r,t)},r=function(e,t){h&&cancelAnimationFrame(i.current),i.current=h?requestAnimationFrame(e):setTimeout(e,t)},s=function(e){if(!x.current)return!1;var r=e-n.current;return!n.current||r>=t||r<0||b&&e-l.current>=N},g=function(t){return i.current=null,p&&c.current?e(t):(c.current=d.current=null,o.current)},v=function e(){var a=Date.now();if(s(a))return g(a);if(x.current){var i=t-(a-n.current);r(e,b?Math.min(i,N-(a-l.current)):i)}},y=function(){if(m||j){var u=Date.now(),h=s(u);if(c.current=[].slice.call(arguments),d.current=a,n.current=u,h){if(!i.current&&x.current)return l.current=n.current,r(v,t),f?e(n.current):o.current;if(b)return r(v,t),e(n.current)}return i.current||r(v,t),o.current}};
1return y.cancel=function(){i.current&&(h?cancelAnimationFrame(i.current):clearTimeout(i.current)),l.current=0,c.current=n.current=d.current=i.current=null},y.isPending=function(){return!!i.current},y.flush=function(){return i.current?g(Date.now()):o.current},y},[f,b,t,N,p,h,m,j])}},77328:(e,t,r)=>{e.exports=r(88022)},80013:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var s=r(37876),a=r(14232),n=r(85851);function l({children:e}){let[t,r]=(0,a.useState)(0);return(0,s.jsx)(n.A.Provider,{value:{total:t,setTotal:r},children:e})}},85851:(e,t,r)=>{"use strict";r.d(t,{A:()=>l,F:()=>n});var s=r(14232);let a=(0,s.createContext)({total:0,setTotal:()=>{}}),n=()=>(0,s.useContext)(a),l=a},92023:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var s=r(37876),a=r(14232),n=r(89099),l=r(39412),i=r(85851),c=r(35150);function d(){let{facility:e}=(0,a.useContext)(l.c),t=(0,n.useRouter)(),{pathname:r}=t,{total:d}=(0,i.F)(),o=(0,c.f)(e?.id),u=(e?.paymentModelId===2||e?.paymentModelId===3)&&e?.allowClubCredit!==!1,x="/facility/members"===r||"/facility/members/"===r,m=x&&t.asPath.includes("view=guests"),h=x&&!m,f=r.includes("request"),p=r.includes("credit"),b=r.includes("duplicates"),j=e=>`pointer flex items-center justify-center h-[40px] px-4 font-semibold text-xs sm:text-base rounded-[5px] gap-1.5 whitespace-nowrap ${e?"bg-primary99 text-primary":"text-neutral70"}`;return(0,s.jsx)("div",{className:"mt-4 mb-4 overflow-x-auto scrollbar-hide",children:(0,s.jsxs)("div",{className:"flex bg-neutral95 rounded-[8px] p-1 gap-1 w-fit min-w-full sm:min-w-0",children:[(0,s.jsx)("div",{onClick:()=>t.replace("/facility/members/"),className:j(h),children:d>0?`Members (${d})`:"Members"}),(0,s.jsx)("div",{onClick:()=>t.replace("/facility/members?view=guests"),className:j(m),children:"Guests"}),(0,s.jsxs)("div",{onClick:()=>t.replace("/facility/members/request"),className:j(f),children:["Join Requests",o>0&&(0,s.jsx)("div",{className:"bg-[#D60035] text-white text-xs w-fit px-2 rounded",children:o})]}),u&&(0,s.jsx)("div",{onClick:()=>t.replace("/facility/members/credit"),className:j(p),children:"Credit Management"}),(0,s.jsx)("div",{onClick:()=>t.replace("/facility/members/duplicates"),className:j(b),children:"Duplicate Report"})]})})}}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=36048)),_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.