PageSourceSearch

https://www.hops.org.au/static/js/8009.b0f36155.chunk.js

js hops.org.au collected 2026-10-05 20:41:53 UTC 34,480 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkhopsa=self.webpackChunkhopsa||[]).push([[8009,2529],{21429:function(e,t,r){r.d(t,{d:function(){return c}});var s="Pagination_root__df9cf",a="Pagination_active__Ugmq0",i=r(33392),n=r(17220),l=r(66527),o=r(65043),d=r(70579);const c=e=>{let{page:t,count:r,limit:c,onChange:h,disabled:u}=e;if(!r)return null;const m=Math.ceil(r/c),p=[];let b=0,g=0;m>8?(b=t-3,g=t+3):(b=1,g=m),b=Math.max(1,Math.min(b,m)),g=Math.max(1,Math.min(g,m));for(let s=b;s<=g;s++)p.push(s);const x=e=>(0,d.jsx)("li",{children:(0,d.jsx)(i.$,{className:t===e?a:null,variant:null,onClick:()=>h(e),disabled:u,children:e})});return(0,d.jsx)("nav",{className:s,children:(0,d.jsxs)("ul",{children:[(0,d.jsx)("li",{children:(0,d.jsx)(i.$,{variant:null,onClick:()=>h(t-1),disabled:u||1===t,children:(0,d.jsx)(n.A,{})})}),b>1&&(0,d.jsxs)(d.Fragment,{children:[x(1),(0,d.jsx)("li",{style:{alignSelf:"end"},children:"..."})]}),p.map((e=>(0,d.jsx)(o.Fragment,{children:x(e)},e))),g<m&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("li",{style:{alignSelf:"end"},children:"..."}),x(m)]}),(0,d.jsx)("li",{children:(0,d.jsx)(i.$,{variant:null,onClick:()=>h(t+1),disabled:u||t===m,children:(0,d.jsx)(l.A,{})})})]})})}},17143:function(e,t,r){r.d(t,{e:function(){return n}});var s=r(62147),a="PageHeaderButtons_pageHeaderButtons__xeb5r",i=r(70579);const n=e=>{let{className:t,children:r,...n}=e;const l=[a,"hideOnPrint"];return t&&l.push(t),(0,i.jsx)(s.n,{columnar:!0,wrap:!0,className:l.join(" "),...n,children:r})}},92551:function(e,t,r){r.d(t,{f:function(){return i}});var s=r(31233),a=r(70579);const i=e=>{let{errors:t=[],className:r,...i}=e;return(0,a.jsx)("ul",{className:r,...i,children:t.map(((e,t)=>(0,a.jsx)("li",{children:(0,a.jsx)(s.o,{color:"error",children:e})},t)))})}},93684:function(e,t,r){r.d(t,{xK:function(){return b},e:function(){return j},ft:function(){return S}});var s=r(65043),a=r(1659),i=r(62147),n=r(53168),l=r(79884),o=r(33392),d="SearchSort_searchContainer__vCVDq",c="SearchSort_search_group__kzk2u",h="SearchSort_search_inputs__3ghQR",u=r(4137),m=r(31233),p=r(70579);const b=e=>{let{searchPlaceholder:t,headers:r,searchQuery:c,sort:h,sortAsc:b}=e;const j=r.filter((e=>e.sortable)),S=t&&t.length>0,A=j&&j.length>0;A&&!h&&(h=j[0].id),A&&void 0===b&&(b=1);const v=(0,a.b)(),[y,w]=(0,s.useState)(c),[T,P]=(0,s.useState)(h),[E,R]=(0,s.useState)(b);if((0,s.useEffect)((()=>{w(c),P(h),R(b)}),[c,h,b]),!S&&!A)return null;const M=j.map((e=>{let t="";return e.sortLabel?t=e.sortLabel:e.content&&(t=e.content),"string"!==typeof t&&(t=""),{label:t,value:e.id}}));return(0,p.jsx)(u.l,{onSubmit:()=>{_(S?y:void 0,A?T:void 0,A?E:void 0,v)},children:(0,p.jsxs)(i.n,{columnar:!0,wrap:!0,gap:2,className:`${d} noPrint`,children:[S&&(0,p.jsxs)(g,{children:[(0,p.jsx)(x,{children:(0,p.jsx)(l.A,{name:"search",type:"search",onChange:e=>w(e),value:y,placeholder:t})}),(0,p.jsx)(o.$,{type:"submit",label:"Search",size:"small"})]}),A&&(0,p.jsxs)(g,{children:[S&&(0,p.jsx)(m.o,{style:{alignSelf:"flex-end"},children:"Sort:"}),(0,p.jsxs)(x,{children:[(0,p.jsx)(n.l,{name:"sort",onChange:e=>P(e),options:M,value:T}),(0,p.jsx)(n.l,{name:"sort_asc",onChange:e=>R(e),options:f,value:E})]}),(0,p.jsx)(o.$,{type:"submit",label:"Sort",size:"small"})]})]})})},g=e=>{let{children:t}=e;return(0,p.jsx)(i.n,{columnar:!0,wrap:!0,gap:.5,className:c,children:t})},x=e=>{let{children:t}=e;return(0,p.jsx)(i.n,{columnar:!0,wrap:!0,gap:.5,className:h,children:t})},f=[{label:"Ascending",value:1},{label:"Descending",value:0}],_=(e,t,r,s)=>{const a=Object.fromEntries(s.getSearchParams());delete a.page;const i=new Map;void 0!==e&&i.set("search",e||""),void 0!==t&&i.set("sort",t),void 0!==r&&i.set("sort_asc",r);const n=Object.fromEntries(i);s.updateSearchParams({...a,...n},!0)},j=e=>{const t=e.find((e=>e.hasOwnProperty("defaultSortOrder")));return t?t.id:void 0},S=e=>{const t=e.find((e=>e.hasOwnProperty("defaultSortAsc")));return t?t.defaultSortAsc?1:0:void 0}},1659:function(e,t,r){r.d(t,{b:function(){return d}});var s=r(16001),a=r(32364),i=r(7679),n=r(69993),l=r(97376),o=r(32620);const d=()=>{const e=e=>{let{currentUri:t=s.A.getCurrentUri(),uri:r,scrollToTop:d=!0,reloadSameUri:c=!0,pushHistory:h=!0}=e;(0,i.A)(!0),(0,l.A)();const u=r===t;c&&u&&(0,n.A)(),u||(h&&a.A.push(r),o.A.report(`Navigated to "${r}".`)),d&&window.scrollTo({top:0})},t=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];
1const r=new URLSearchParams(window.location.search),s=Object.fromEntries(r.entries());t||(e={...s,...e});for(const[a,i]of Object.entries(e))void 0===i&&delete e[a];return new URLSearchParams(e)},r=(e,r)=>`${window.location.pathname}?${t(e,r)}`,d=e=>new URLSearchParams(window.location.search).get(e);return{navigateCustom:e,updateSearchParams:(e,t)=>{s.A.navigate(r(e,t))},updateSearchParamsNoReload:(t,s)=>{e({uri:r(t,s),reloadSameUri:!1,scrollToTop:!1})},getSearchParam:d,getSearchParams:t,getPathnameWithSearchParams:r,getPathnameWithoutSearchParams:e=>{const t=new URLSearchParams(window.location.search);for(const r of e)t.delete(r);return`${window.location.pathname}${t.size?`?${t}`:""}`},getUrlParam:(e,t)=>d(e)||t}}},42529:function(e,t,r){r.r(t),r.d(t,{default:function(){return P}});var s=r(65043),a=r(22768),i=r(73769),n=r(77805),l=r(62147),o=r(15276);var d=class{static resolveApiUri(e){return`${a.A.base}${e}`}},c=r(33392),h=r(50302),u=r(31233),m=r(16001),p=r(70579);const b=()=>(0,p.jsxs)(h.E,{children:[(0,p.jsx)(u.o,{variant:"h2",children:"Error loading page"}),(0,p.jsx)(u.o,{color:"textSecondary",children:"Oops! Something went wrong."}),(0,p.jsx)(u.o,{color:"textSecondary",children:"We apologise for the inconvenience."}),(0,p.jsx)(c.$,{onClick:()=>m.A.reload(),label:"Reload Page",variant:"outline-primary",style:{width:"fit-content"}})]}),g=()=>(0,p.jsxs)(l.n,{style:{position:"absolute"},children:[(0,p.jsx)(u.o,{variant:"h2",children:"File download"}),(0,p.jsx)(u.o,{color:"textSecondary",children:'Please use your browser\'s "Downloads" screen to view your download.'})]});var x=r(32620),f=r(26536),_=r(7679),j={iframeWrapper:"LegacyView_iframeWrapper__FuBtk",iframeInjector:"LegacyView_iframeInjector__5zfKI",iframe:"LegacyView_iframe__5nmn5"},S=r(81855),A=r(85080),v=r(9370),y=r(91688),w=r(90314);class T extends i.A{constructor(e){super(e),this.state={fileDownload:!1,realPDFDownload:!1,height:null,iframeScrolling:!1,loading:!1,error:!1},this.container=s.createRef(),this.printRequestTime=s.createRef(),this.iframeWrapperSavedHeight=s.createRef(),this.iframeWrapper=s.createRef(),this.iframeInjector=s.createRef(),this.iframe=s.createRef(),this.errorTimer=null,this.loadTimer=null,this.hasReceivedBridgeAcknowledgement=!1,this.iframeUri=null,this.handleIframeLoad=this.handleIframeLoad.bind(this),this.handleMessage=this.handleMessage.bind(this),this.handleBeforePrint=this.handleBeforePrint.bind(this),this.handleAfterPrint=this.handleAfterPrint.bind(this),this.setErrorState=this.setErrorState.bind(this)}componentDidMount(){super.componentDidMount(),window.addEventListener("message",this.handleMessage),window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint),(0,f.A)(),this.updateIframeSrc()}componentWillUnmount(){this.clearTimers(),super.componentWillUnmount(),window.removeEventListener("message",this.handleMessage),window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint)}componentDidUpdate(e){var t,r,s,a,i,n,l,o,d,c;let h=!1,u=!1;const m=this.props.location.search,p=this.props.location.pathname,b=m!==e.location.search,g=p!==e.location.pathname,x=`${p}${m}`;this.props.authed!==e.authed&&(h=!0),(null===(t=this.props.auth)||void 0===t?void 0:t.token)!==(null===(r=e.auth)||void 0===r?void 0:r.token)&&(u=!0),(null===(s=this.props.authAdmin)||void 0===s?void 0:s.token)!==(null===(a=e.authAdmin)||void 0===a?void 0:a.token)&&(u=!0),(null===(i=this.props.adminAuth)||void 0===i||null===(n=i.account)||void 0===n?void 0:n.Id)!==(null===(l=e.adminAuth)||void 0===l||null===(o=l.account)||void 0===o?void 0:o.Id)&&(h=!0),(null===(d=this.props.org)||void 0===d?void 0:d.Id)!==(null===(c=e.org)||void 0===c?void 0:c.Id)&&(h=!0),(b||g)&&x!==this.nextHref||h?this.updateIframeSrc():u&&((0,f.A)(),this.messageBridgeCookies())}clearTimers(){this.errorTimer&&clearTimeout(this.errorTimer),this.loadTimer&&clearTimeout(this.loadTimer)}handleIframeLoad(){this.messageBridge({msg:"hops.bridgeEnabled",data:!0}),this.messageBridge({msg:"hops.setMsgTarget",target:window.location.origin}),this.messageBridgeCookies(),this.loadTimer=setTimeout((()=>{this.hasReceivedBridgeAcknowledgement||this.setErrorState()}),1e3)}handleLoadCompleted(){this.setState({loading:!1}),this.clearTimers()}handleBeforePrint(e){const t=this.state.height;if(null===t)return;this.iframeWrapperSavedHeight.current=t;const r=this.iframe.current;if(this.constructor.isIframeAccessible(r)){const t=Date.now();e.preventDefault(),this.messageBridge({msg:this.constructor.HOPS_PRINT,target:window.location.origin,time:this.printRequestTime.current=t})}}handleAfterPrint(){const e=this.iframeInjector.current;e&&(e.innerHTML="")}handleMessage(e){if(e.origin===a.A.base){if("hops.a"===e.data.msg&&e.data.href&&(this.isFileUri(e.data.href)?window.open(d.resolveApiUri(e.data.href),"_blank"):e.data.href.startsWith("/")?this.handleNavigate(e.data.href,e.data.ctrl):window.open(e.data.href,"_blank")),"hops.load"===e.data.msg){this.hasReceivedBridgeAcknowledgement=!0;const t=e.data.pathname,r=this.constructor.resolveRealHref(t),s=`${r}${e.data.search}`,a=this.constructor.prepareUri(s),i=r!==this.props.location.pathname,n=e.data.search!==this.props.location.search;if(e.data.accessDenied){const t=v.parse(e.data.search);(0,_.A)(!1,{pid:t.p,pvar:t.v,org:t.r,uri:t.target||this.iframeUri})}this.nextHref=a,!i&&!n||e.data.accessDenied||(x.A.report(`LegacyView::Load "${a}"`),this.props.history.push(a)),e.data.title&&!e.data.accessDenied&&(this.props.disableTitleSetting||(0,o.D6)(e.data.title,!1));let l=!1;this.constructor.fullHeightUris.includes(e.data.pathname)?(l=!0,this.updateHeightViewport()):this.updateHeight(e.data.height||null),l!==this.state.iframeScrolling&&this.setState({iframeScrolling:l}),this.handleLoadCompleted()}e.data.msg===this.constructor.HOPS_PRINT&&e.data.time===this.printRequestTime.current&&this.injectIframeHTML(e.data.html),"hops.resize"===e.data.msg&&this.updateHeight(e.data.height),"hops.scrollToTop"===e.data.msg&&window.scrollTo({top:0})}}handleNavigate(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=this.constructor.resolveRealHref(e);t?window.open(r,"_blank"):this.props.history.push(this.constructor.prepareUri(r)),document.body.click()}isFileUri(e){return!!this.constructor.fileUris.find((t=>null===e||void 0===e?void 0:e.startsWith(t)))}static isRealPDFUri(e){return!(null===e||void 0===e||!e.includes("real_pdf=true"))}messageBridge(e){this.iframe.current&&this.iframe.current.contentWindow&&this.iframe.current.contentWindow.postMessage&&this.iframe.current.contentWindow.postMessage(e,a.A.base)}messageBridgeCookies(){this.messageBridge({msg:"hops.cookiesUpdated",cookies:n.A.getAllExpectedComplete()})}setErrorState(){this.setState({error:!0,loading:!1,height:null})}injectIframeHTML(e){if(!this.iframe.current)return;const t=this.iframeInjector.current;if(t){t.innerHTML=e;const r=t.getElementsByClassName("print_header_row");if(r&&r.length>0){const e=r[0];e.style.height="unset",e.style.display="flex",e.style.justifyContent="space-between"}}window.print()}updateHeight(e){const t=`${e}${!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?"px":""}`;this.setState({height:t});const r=this.iframeWrapper.current;r&&(r.style.height=t);const s=this.iframe.current;s&&(s.style.height=t)}updateHeightViewport(){this.updateHeight(this.viewportCalcString,!1)}updateIframeSrc(){const{pathname:e,search:t}=this.props.location,r=`${e}${t}`;(0,f.A)(),this.clearTimers(),this.hasReceivedBridgeAcknowledgement=!1,this.isFileUri(r)&&this.props.authed?(this.setState({fileDownload:!0,realPDFDownload:!1,loading:!1,error:!1}),window.open(d.resolveApiUri(r))):this.constructor.isRealPDFUri(r)&&this.props.authed?this.setState({fileDownload:!1,realPDFDownload:!0,loading:!1,error:!1}):(this.errorTimer=setTimeout(this.setErrorState,6e4),this.setState({fileDownload:!1,realPDFDownload:!1,loading:!0,error:!1}));const s=this.iframe.current;if(s){const e=this.uri,t=s.parentNode;s.remove(),s.src=e,t&&t.appendChild(s),this.iframeUri=e}}render(){return(0,p.jsx)(l.n,{className:j.container,innerRef:this.container,children:(0,p.jsxs)("div",{ref:this.iframeWrapper,className:j.iframeWrapper,children:[this.state.error&&(0,p.jsx)(b,{}),!this.state.error&&!this.state.fileDownload&&this.renderIframe(),(this.state.fileDownload||this.state.realPDFDownload)&&(0,p.jsx)(g,{}),this.state.loading?(0,p.jsx)(w.a,{}):null]})})}get styles(){return{height:this.state.height||"auto"}}renderIframe(){return(0,p.jsxs)("div",{children:[(0,p.jsx)("div",{ref:this.iframeInjector,className:j.iframeInjector}),(0,p.jsx)("iframe",{className:j.iframe,onLoad:this.handleIframeLoad,ref:this.iframe,scrolling:this.state.iframeScrolling?"yes":"no",style:this.constructor.iframeStyles,title:"HOPS"})]})}get uri(){const e=this.props.location.pathname,t=this.props.location.search||"";let r=this.constructor.prepareUri(e||"");return["","/","/index.php"].includes(r)&&this.props.raildays&&(r="/index_visitor_app.php"),d.resolveApiUri(`${r}${t}`)}static prepareUri(e){return e.startsWith("/")||(e=`/${e}`),e.endsWith("/")&&(e=e.substring(0,e.length-1)),e}static resolveRealHref(e){return["/index.php","/index_visitor_app.php"].includes(e)&&(e=""),e}}T.HOPS_PRINT="hops.print",T.isIframeAccessible=e=>{if(!e)return!1;try{return Boolean(e.contentWindow)}catch(t){return!1}},T.viewportCalcString="calc(100vh - 6rem - 3rem)",T.fileUris=["/calendar_department_download.php","/file_download.php","/timetable_download.php","/workshop_file_download.php"],T.fullHeightUris=["/order_card.php"],T.iframeStyles={position:"absolute",width:"100vw"};var P=(0,S.A)((0,A.A)((0,y.withRouter)(T)))},21557:function(e,t,r){var s=r(22768);t.A=class{static getById(e){return s.A.call({url:`/api/memberships/${e}`}).then((e=>{let{data:t}=e;return t}))}static getOrg(){return s.A.call({url:"/api/memberships/org"}).then((e=>{let{data:t}=e;return t}))}static getMembers(e){let{Query:t,Search:r,SortOrder:a,SortAsc:i,Limit:n,Page:l}=e;return s.A.call({url:"/api/memberships/members",params:{Query:t,Search:r,SortOrder:a,SortAsc:i,Limit:n,Page:l}}).then((e=>{let{data:t}=e;return t}))}static getMembersUsers(){let{search:e,limit:t,includedUserIds:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s.A.call({url:"/api/memberships/users",params:{Search:e,Limit:t,IncludedUserIds:r}}).then((e=>{let{data:t}=e;return t}))}static createMembership(e){return s.A.call({url:"/api/memberships",method:"POST",data:e}).then((e=>{let{data:t}=e;return t}))}static updateMembership(e,t){return s.A.call({url:`/api/memberships/${e}`,method:"PUT",data:t}).then((e=>{let{data:t}=e;return t}))}static renewMembership(e,t){return s.A.call({url:`/api/memberships/${e}/renew`,method:"POST",data:t}).then((e=>{let{data:t}=e;return t}))}static deleteMembership(e){return s.A.call({url:`/api/memberships/${e}`,method:"DELETE"})}static getTypeQuestions(){return s.A.call({url:"/api/memberships/types/questions"}).then((e=>{let{data:t}=e;return t}))}static getTypes(){return s.A.call({url:"/api/memberships/types"}).then((e=>{let{data:t}=e;return t}))}static getType(e){return s.A.call({url:`/api/memberships/types/${e}`}).then((e=>{let{data:t}=e;return t}))}static createType(e){return s.A.call({url:"/api/memberships/types",method:"POST",data:e})}static updateType(e,t){return s.A.call({url:`/api/memberships/types/${e}`,method:"PUT",data:t})}static createPlan(e){return s.A.call({url:"/api/memberships/plans",method:"POST",data:e})}static updatePlan(e,t){return s.A.call({url:`/api/memberships/plans/${t}`,method:"PUT",data:e})}static issueMembershipCard(e,t){return s.A.call({url:`/api/memberships/${e}/cards/issueMembershipCard`,method:"POST",data:{memberId:t}})}static getSettings(){return s.A.call({url:"/api/local/settings/memberships "}).then((e=>{let{data:t}=e;return t}))}static editSettings(e){return s.A.call({url:"/api/local/settings/memberships",method:"PUT",data:e})}static getOrders(e){let{OrderableType:t,Source:r,Search:a,Statuses:i,SortAsc:n,Limit:l,Page:o,Filter:d}=e;return s.A.call({url:"/api/orders",params:{OrderableType:t,Source:r,Search:a,Statuses:i,SortAsc:n,Limit:l,Page:o,Filter:d}}).then((e=>{let{data:t}=e;return t}))}static applyUserActions(e,t){return s.A.call({url:"/api/memberships/applyUserActions",method:"POST",data:{Users:e,Actions:t}}).then((e=>{let{data:t}=e;return t}))}}},8009:function(e,t,r){r.r(t),r.d(t,{default:function(){return Je}});
1var s=r(54996),a=r(90066),i=r(71686),n=r(42529),l=r(31233),o=r(21557),d=r(35880),c="MembershipTable_table_status__MSlQf",h="MembershipTable_table_memberAvatar__LyXnH",u="MembershipTable_table_avatar__vh+WM",m="MembershipTable_table_jointAccount__rgWjr",p="MembershipTable_table_status__partiallyPaid__h5UDI",b="MembershipTable_table_status__notPaid__S61Pj",g="MembershipTable_table_status__current__BGdiz",x="MembershipTable_table_status__gracePeriod__rkJGs",f="MembershipTable_table_status__expired__CoudP",_="MembershipTable_table_status__notStarted__XEape",j="MembershipTable_table_status__none__GNVxD",S="MembershipTable_table_avatar__current__Bv0Zp",A="MembershipTable_table_avatar__gracePeriod__IAPA-",v="MembershipTable_table_avatar__expired__xaZhQ",y="MembershipTable_table_avatar__none__emnps",w="MembershipTable_noSelect__w8UMZ",T="MembershipTable_table_functions__Yo9yD",P=r(64839),E=r(43171),R=r(92766),M="OrderStatusBlob_blob__-0Clv",D="OrderStatusBlob_blob__complete__3OFFl",N="OrderStatusBlob_blob__rejected__Jg+vs",I="OrderStatusBlob_blob__provisional__LHGBA",C="OrderStatusBlob_blob__cancelled__7nhhr",U="OrderStatusBlob_blob__default__iEmTH",$=r(5974),O=r(70579);const L=e=>{let{status:t}=e,r=null,s="";switch(t){case $.Th.Complete:r=D,s="Definite";break;case $.Th.Rejected:case null:r=N,s="Rejected";break;case $.Th.Provisional:r=I,s="Provisional";break;case $.Th.Cancelled:r=C,s="Cancelled";break;default:r=U}return(0,O.jsx)(R.A,{className:`${M} ${r}`,title:s})};var k=r(62147),F=r(93684),H=r(29550),B=r(21429),W=r(16001),z=r(54934),V=r(35323),G=r(20804);const q=[{id:"order",content:"Order",style:{textAlign:"left"}},{id:"date",content:"Date",sortable:!0,defaultSortOrder:!0,defaultSortAsc:!1,style:{width:"12rem"}},{id:"user_fname",content:"First name"},{id:"user_sname",content:"Surname"},{id:"items",content:"Items",style:{textAlign:"right"}},{id:"tax",content:"Tax",style:{textAlign:"right"}},{id:"paid",content:"Paid",style:{textAlign:"right"}},{id:"ga_able",content:"GA-able",style:{textAlign:"right"}}],Q=(e,t)=>{let r=0,s=0,a=0;for(let n=0;n<e.length;n++)r+=e[n].PriceExVat,s+=e[n].PriceVat,a+=e[n].GiftAidProportion;let i=0;for(let n=0;n<t.length;n++)8===t[n].Status&&(i+=t[n].PaidAmount);return{itemsValue:r,taxValue:s,paidValue:i,gaValue:a}},X=e=>(0,O.jsx)("span",{style:{float:"right"},children:(e/100).toFixed(2)}),K=(e,t,r)=>(0,O.jsxs)(k.n,{columnar:!0,gap:.25,alignItems:"center",style:{float:"left"},children:[(0,O.jsx)(L,{status:t}),(0,O.jsx)(E.A,{uri:`/retail_sales_order.php?s=${e}`,children:r})]}),J=e=>e.Fname,Z=e=>e.Sname,Y=e=>X(e),ee=e=>X(e),te=(e,t,r)=>{let s="";const a=t+r;return a>0&&0===e?s=`${c} ${b}`:a-e>0&&(s=`${c} ${p}`),(0,O.jsx)("span",{style:{float:"right"},className:s,children:X(e)})},re=e=>X(e);var se=()=>{const{parseOrgDate:e}=(0,d.c)(),{search:t}=(0,V.zy)(),r=new URLSearchParams(t),s=r.has("search")?r.get("search"):"",a=r.has("page_limit")?Number(r.get("page_limit")):25,i=r.has("page")?Number(r.get("page")):1,n=r.has("sort")?r.get("sort"):(0,F.e)(q)||"",c=r.has("sort_asc")?Number(r.get("sort_asc")):(0,F.ft)(q)||0,{data:h,error:u,fetch:m,loading:p}=(0,z.s)({fn:()=>o.A.getOrders({OrderableType:1,Source:1,Search:s,SortAsc:c,Statuses:[$.Th.Provisional,$.Th.Complete],Limit:a,Page:i,Filter:"incomplete"}),dep:[t]});let b=null;if(p)b=(0,O.jsx)(l.o,{children:"Loading..."});else if(u)b=(0,O.jsx)(H.l,{error:u,subject:"New Memberships",onRetry:m});else{const t=e=>W.A.updateQueryString({page:e});b=(0,O.jsxs)(k.n,{children:[h.objects.length?(0,O.jsxs)(G.X,{children:[(0,O.jsx)("thead",{children:(0,O.jsx)("tr",{children:q.map((e=>(0,O.jsx)("th",{style:e.style,children:e.content},e.id)))})}),(0,O.jsx)("tbody",{children:h.objects.map((t=>{const r=t.Items,s=t.Payments,a=t.BillingContact,i=t.Timestamp,{itemsValue:n,taxValue:l,paidValue:o,gaValue:d}=Q(r,s);return(0,O.jsxs)("tr",{children:[(0,O.jsx)("td",{children:K(t.Id,t.Status,t.Number)}),(0,O.jsx)("td",{children:e(i,P.o.SHORT_DATETIME)}),(0,O.jsx)("td",{children:J(a)}),(0,O.jsx)("td",{children:Z(a)}),(0,O.jsx)("td",{children:Y(n)}),(0,O.jsx)("td",{children:ee(l)}),(0,O.jsx)("td",{children:te(o,n,l)}),(0,O.jsx)("td",{children:re(d)})]},t.Id)}))})]}):(0,O.jsx)(l.o,{children:"(None)"}),(0,O.jsx)(B.d,{count:h.count,disabled:p,onChange:t,limit:a,page:i})]})}return(0,O.jsxs)(k.n,{children:[(0,O.jsx)(F.xK,{searchPlaceholder:"Search",headers:q,searchQuery:s,sort:n,sortAsc:c}),b]})};var ae=()=>(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(l.o,{children:["New memberships that have not been dealt with.",(0,O.jsx)("br",{}),"We recommend you deal with these as soon as possible to maximise member engagement."]}),(0,O.jsx)(se,{})]}),ie=r(33392),ne=r(11138),le=r(65043),oe=r(59434),de=r(42401),ce=r(42016),he=r(15276),ue=r(53746),me=r(92551),pe=r(46644),be=r(20463),ge=r(89808),xe=r(26732),fe=r.n(xe);const _e={id:"UPGRADE_TO_LIVE_USER",label:"Upgrade to Live User"},je=e=>{let{data:t,selectedRows:r,open:s,onClose:a,onClearSelectedRows:i,fetch:n}=e;const{snack:l}=(0,ue.w)(),[d,c]=(0,le.useState)(!1),[h,u]=(0,le.useState)([]),[m,p]=(0,le.useState)(!1),[b,g]=(0,le.useState)(null),x=()=>{p(!1),g(null)},f=new Set,_=[];for(const o of t){const e=o.Member;!f.has(e.Id)&&r.has(Ae(o))&&(f.add(e.Id),_.push(e))}return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(oe.l,{onClose:a,okLabel:"Close",open:s&&!m,title:"Membership actions",children:(0,O.jsx)(k.n,{children:(0,O.jsx)(ve,{formsubmitting:d,onApply:e=>{u([e]),p(!0)}})})}),m&&(0,O.jsx)(Se,{selectedMembers:_,open:m,onClose:x,onApply:()=>{g(null),c(!0),o.A.applyUserActions([...f],h.map((e=>({id:e.id})))).then((()=>{c(!1),x(),u([]),a(),i(),n(),l("Actions successfully applied.","success")})).catch((e=>{var t;c(!1);const r=null===e||void 0===e||null===(t=e.response)||void 0===t?void 0:t.data;"object"===typeof r&&g(r||[]),l(`Failed to apply actions.${(0,he.JT)(e)}`,"error")}))},actions:h,formsubmitting:d,submissionErrors:b})]})},Se=e=>{let{selectedMembers:t,open:r,onClose:s,onApply:a,actions:i,formsubmitting:n,submissionErrors:o}=e,d=null;if(o&&o.length){const e=[];
1for(const t of o)e.push(`U${t.user} - ${t.action} - ${t.error}`);d=(0,O.jsxs)("div",{children:[(0,O.jsx)("b",{children:"Error applying actions to members:"}),(0,O.jsx)(me.f,{errors:e})]})}return(0,O.jsx)(oe.l,{onClose:s,onOk:()=>a(),okLabel:"Apply",closeLabel:"Return",open:r,loading:n,title:"Apply actions",children:(0,O.jsxs)(k.n,{children:[(0,O.jsxs)(l.o,{children:["Apply ",i.length>1?"these":"this"," ",fe()("action",i.length),":"]}),(0,O.jsx)(k.n,{gap:0,children:i.map((e=>(0,O.jsx)(l.o,{children:(0,O.jsx)("b",{children:e.label})})))}),(0,O.jsxs)(l.o,{children:["To the following ",fe()("user",t.length),"?"]}),(0,O.jsx)(k.n,{gap:0,children:t.sort(((e,t)=>(0,he.hA)(e.Account.Fname,e.Account.Sname).localeCompare((0,he.hA)(t.Account.Fname,t.Account.Sname)))).map(((e,t)=>(0,O.jsx)(l.o,{children:`${(0,he.hA)(e.Account.Fname,e.Account.Sname)} (U${e.Id})`},t)))}),d?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(pe.c,{}),d]}):null]})})},Ae=e=>`${e.Member.Id}-${e.Membership.Id}`,ve=e=>{let{formSubmitting:t,onApply:r}=e;return(0,O.jsxs)(de.R,{onSubmit:()=>r(_e),children:[(0,O.jsxs)("fieldset",{children:[(0,O.jsx)("legend",{children:"Upgrade to Live user"}),(0,O.jsx)(l.o,{children:"This will upgrade the users to Live users."})]}),(0,O.jsx)("fieldset",{className:"submit_buttons",children:(0,O.jsx)(ce.C,{saveLabel:"Upgrade",disabled:t,size:"small"})})]})},ye={user_fname:"UserFname",user_sname:"UserSname",membership_type_name:"MembershipTypeName",membership_no:"MembershipNo",attained_date:"AttainedDate",expiry_date:"ExpiryDate",grace_period:"GracePeriod"},we=[{id:"photo",content:"User"},{id:"user_fname",content:"First name",sortable:!0},{id:"user_sname",content:"Surname",sortable:!0,defaultSortOrder:!0,defaultSortAsc:!0},{id:"membership_type_name",content:"Type",sortable:!0},{id:"membership_no",content:"Membership No.",sortable:!0,style:{textAlign:"right"}},{id:"attained_date",content:"Attained",sortable:!0},{id:"expiry_date",content:"Expires",sortable:!0},{id:"grace_period",content:"Grace period",sortable:!0},{id:"status",content:"Status"},{id:"functions",content:"Membership Functions",style:{width:"18rem"}}],Te=e=>e.Account.Fname,Pe=e=>e.Account.Sname,Ee=Object.freeze({CURRENT:Symbol("CURRENT"),GRACE_PERIOD:Symbol("GRACE_PERIOD"),EXPIRED:Symbol("EXPIRED"),NOT_STARTED:Symbol("NOT_STARTED"),NONE:Symbol("NONE")}),Re=(e,t)=>{let r;switch(t){case Ee.CURRENT:r=S;break;case Ee.GRACE_PERIOD:r=A;break;case Ee.EXPIRED:r=v;break;default:r=y}return(0,O.jsx)(ge.H,{user:e,className:`${u} ${r}`})},Me=e=>{switch(e){case Ee.CURRENT:return g;case Ee.GRACE_PERIOD:return x;case Ee.EXPIRED:return f;case Ee.NOT_STARTED:return _;default:return j}},De=(e,t)=>e.Id!==t.User.Id,Ne=(e,t,r)=>(0,O.jsx)(ne.S,{checked:t,value:!t,onChange:e,disabled:r}),Ie=(e,t,r,s)=>(0,O.jsxs)("div",{className:h,children:[(0,O.jsx)(E.A,{uri:`/user_admin_view.php?u=${e.Id}&t=b`,children:Re(e,r)}),De(e,t)&&(0,O.jsx)("span",{title:"Joint account",className:`${m} ${s} ${w}`,children:"J"})]}),Ce=e=>(0,O.jsx)("span",{style:{float:"right"},children:e.No}),Ue=(e,t)=>{let r;switch(e){case Ee.CURRENT:r="Current";break;case Ee.GRACE_PERIOD:r="Grace";break;case Ee.EXPIRED:r="Expired";break;case Ee.NOT_STARTED:r="Not started";break;default:r="None"}return(0,O.jsx)("span",{className:`${c} ${t}`,children:r})},$e=(e,t,r)=>{const s=De(e,t);return(0,O.jsxs)("ul",{className:T,children:[(0,O.jsx)("li",{children:(0,O.jsxs)(E.A,{uri:`/mem/details/${t.Id}`,children:["Details",s?" (Joint Main)":""]})}),(0,O.jsx)("li",{children:(0,O.jsx)(E.A,{uri:`/user_admin_view.php?u=${e.Id}&t=b`,children:"History"})}),!s&&r(194,0)&&[(0,O.jsx)("li",{children:(0,O.jsx)(E.A,{uri:`/memberships/${t.Id}/edit`,children:"Edit"})},"edit"),(0,O.jsx)("li",{children:(0,O.jsx)(E.A,{uri:`/memberships/${t.Id}/renew`,children:"Renew"})},"renew")]]})};var Oe=e=>{let{query:t,customHeaders:r}=e;const{breakpointMedium:s}=(0,be.d)(),{hasPermission:a}=(0,i.A)(),n=a(415,0),c=(0,V.zy)(),[h,u]=(0,le.useState)(new Set),[m,p]=(0,le.useState)(!1),b=s,g=null!==r&&void 0!==r?r:we,{getOrgDate:x,parseOrgDate:f}=(0,d.c)(),{search:_}=(0,V.zy)(),j=new URLSearchParams(_),S=j.has("search")?j.get("search"):"",A=j.has("page_limit")?Number(j.get("page_limit")):25,v=j.has("page")?Number(j.get("page")):1,y=j.has("sort")?j.get("sort"):(0,F.e)(g)||"",w=j.has("sort_asc")?Number(j.get("sort_asc")):(0,F.ft)(g)||0,{data:T,error:E,fetch:R,loading:M}=(0,z.s)({fn:()=>o.A.getMembers({Query:t,Search:S,SortOrder:ye[y],SortAsc:w,Limit:A,Page:v}),dep:[_]});(0,le.useEffect)((()=>{N()}),[c]);let D=null;if(M)D=(0,O.jsx)(l.o,{children:"Loading..."});else if(E)D=(0,O.jsx)(H.l,{error:E,subject:"Memberships",onRetry:R});else{const e=e=>W.A.updateQueryString({page:e}),t=x(),r=T.objects.length,s=h.size>=r&&r>0,i=()=>{s?u(new Set):T&&T.objects&&T.objects.length>0&&u(new Set(T.objects.map((e=>Ae(e)))))},o=[...we];n&&o.unshift({id:"checkbox",content:Ne(i,s,0===r),style:{width:"5rem",minWidth:"5rem"}});const d=(e,t)=>{const r=new Set(h);e?r.add(t):r.delete(t),u(r)};D=(0,O.jsxs)(k.n,{children:[T.objects.length?(0,O.jsxs)(G.X,{children:[(0,O.jsx)("thead",{children:(0,O.jsx)("tr",{children:o.map((e=>(0,O.jsx)("th",{style:e.style,children:e.content},e.id)))})}),(0,O.jsx)("tbody",{children:T.objects.map((e=>{const r=e.Member,s=e.Membership,i=e=>{if(e.DoesNotExpire||!e.ExpiryDate)return null;return f(e.ExpiryDate).add(e.Type.ServiceBreaksYears,"year").add(e.Type.ServiceBreaksMonths,"month").add(e.Type.ServiceBreaksDays,"day")},l=(e=>{const r=f(e.ExpiryDate),s=(e=>f(e.AttainedDate)<x())(e),a=i(e);return e.DoesNotExpire||s&&t<r?Ee.CURRENT:s?t>r&&t<a?Ee.GRACE_PERIOD:t>a?Ee.EXPIRED:Ee.NONE:Ee.NOT_STARTED})(s),o=Me(l),c=Ae(e);return(0,O.jsxs)("tr",{children:[n&&(0,O.jsx)("td",{children:Ne((e=>d(e,c)),h.has(c))}),(0,O.jsx)("td",{children:Ie(r,s,l,o)}),(0,O.jsx)("td",{children:Te(r)}),(0,O.jsx)("td",{children:Pe(r)}),(0,O.jsx)("td",{children:s.Type.Name}),(0,O.jsx)("td",{children:Ce(s)}),(0,O.jsx)("td",{children:f(s.AttainedDate,P.o.SHORT_DATE)}),(0,O.jsx)("td",{children:(e=>e.DoesNotExpire?"No expiry":f(e.ExpiryDate,P.o.SHORT_DATE))(s)}),(0,O.jsx)("td",{children:(e=>e.DoesNotExpire?"No expiry":f(i(e),P.o.SHORT_DATE))(s)}),(0,O.jsx)("td",{children:Ue(l,o)}),(0,O.jsx)("td",{children:$e(r,s,a)})]},c)}))})]}):(0,O.jsx)(l.o,{children:"(None)"}),(0,O.jsx)(B.d,{count:T.count,disabled:M,onChange:e,limit:A,page:v})]})}const N=()=>{u(new Set)};return(0,O.jsxs)(k.n,{children:[m&&(0,O.jsx)(je,{data:T.objects,selectedRows:h,open:m,onClose:()=>{p(!1)},onClearSelectedRows:N,fetch:R}),(0,O.jsxs)(k.n,{columnar:!b,wrap:!0,justifyContent:"space-between",children:[(0,O.jsx)(F.xK,{searchPlaceholder:"Search",headers:g,searchQuery:S,sort:y,sortAsc:w}),n&&(0,O.jsx)(ie.$,{label:`With selected${h.size?` (${h.size})`:""}...`,disabled:!h.size,onClick:()=>{p(!0)},style:{height:"fit-content"}})]}),D]})};var Le=()=>(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(l.o,{children:"Memberships with an expiry date in the future, including those not yet started."}),(0,O.jsx)(Oe,{query:1})]});const ke=e=>{let{headers:t,headerId:r,defaultSortAsc:s}=e;return t.map((e=>((e={...e}).id===r?(e.defaultSortOrder=!0,e.defaultSortAsc=s):(delete e.defaultSortOrder,delete e.defaultSortAsc),e)))};var Fe=()=>{const e=ke({headers:we,headerId:"expiry_date",defaultSortAsc:!1});return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(l.o,{children:"Memberships with an expiry date in the next month and not beyond the grace peri
1od and no new membership record."}),(0,O.jsx)(Oe,{query:2,customHeaders:e})]})};var He=()=>{const e=ke({headers:we,headerId:"grace_period",defaultSortAsc:!1});return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(l.o,{children:"Memberships with an expiry date in the past but still in the grace period and no new membership record."}),(0,O.jsx)(Oe,{query:3,customHeaders:e})]})};var Be=()=>{const e=ke({headers:we,headerId:"grace_period",defaultSortAsc:!1});return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(l.o,{children:"Memberships with an expiry date in the past and beyond the grace period and no new membership record."}),(0,O.jsx)(Oe,{query:4,customHeaders:e})]})};var We=()=>(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(l.o,{children:"All memberships."}),(0,O.jsx)(Oe,{query:null})]}),ze=r(65713),Ve=r(17143),Ge=r(67756),qe=r(86989);var Qe=()=>(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(l.o,{children:"Memberships with an expiry and attained date in the future, including those not yet started."}),(0,O.jsx)(Oe,{query:5})]});const Xe=()=>(0,O.jsx)(n.default,{disableTitleSetting:!0}),Ke=[{label:"New",uri:"/mem",render:()=>(0,O.jsx)(ae,{}),permission:[229,0]},{label:"Current",uri:"/mem/current",render:()=>(0,O.jsx)(Le,{}),permission:[193,0]},{label:"Future",uri:"/mem/future",render:()=>(0,O.jsx)(Qe,{}),permission:[193,0]},{label:"Expiring",uri:"/mem/expiring",render:()=>(0,O.jsx)(Fe,{}),permission:[193,0]},{label:"Expired",uri:"/mem/expired",render:()=>(0,O.jsx)(He,{}),permission:[193,0]},{label:"Ex-Members",uri:"/mem/exmembers",render:()=>(0,O.jsx)(Be,{}),permission:[193,0]},{label:"All",uri:"/mem/all",render:()=>(0,O.jsx)(We,{}),permission:[193,0]},{label:"Memb Cards",uri:"/membership_cards.php",render:Xe,permission:[193,0]},{label:"Statistics",uri:"/members_statistics.php",render:Xe,permission:[193,0]},{label:"Sales",uri:"/members_sales.php",render:Xe,permission:[229,0]}];var Je=()=>{const{hasPermission:e}=(0,i.A)();return(0,O.jsxs)(k.n,{children:[(0,O.jsxs)(ze.z,{children:[(0,O.jsx)(Ge.s,{children:"Memberships"}),(0,O.jsxs)(Ve.e,{children:[e(194,0)&&(0,O.jsx)(ie.$,{label:"New membership",startIcon:(0,O.jsx)(s.A,{}),uri:"/memberships/record"}),e(244,0)&&(0,O.jsx)(ie.$,{label:"Membership settings",startIcon:(0,O.jsx)(a.A,{}),uri:"/membership_settings.php",variant:"outline-primary"})]})]}),(0,O.jsx)(qe.K,{tabs:Ke,firstVisibleWhenNoAccess:!0})]})}},54996:function(e,t,r){var s=r(24994),a=r(6305);t.A=void 0;var i=a(r(65043)),n=(0,s(r(59846)).default)(i.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"}),"AddCircle");t.A=n},92766:function(e,t,r){var s=r(24994),a=r(6305);t.A=void 0;var i=a(r(65043)),n=(0,s(r(59846)).default)(i.createElement("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord");t.A=n},17220:function(e,t,r){var s=r(24994),a=r(6305);t.A=void 0;var i=a(r(65043)),n=(0,s(r(59846)).default)(i.createElement("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"KeyboardArrowLeft");t.A=n},66527:function(e,t,r){var s=r(24994),a=r(6305);t.A=void 0;var i=a(r(65043)),n=(0,s(r(59846)).default)(i.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"KeyboardArrowRight");t.A=n},90066:function(e,t,r){var s=r(24994),a=r(6305);t.A=void 0;var i=a(r(65043)),n=(0,s(r(59846)).default)(i.createElement("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}),"Settings");t.A=n}}]);
2//# sourceMappingURL=8009.b0f36155.chunk.js.map

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.