PageSourceSearch

https://treesthatcount.co.nz/_next/static/chunks/pages/admin/funding/[purchaseId]/matched-6e6478b528f4988f.js

js treesthatcount.co.nz collected 2026-10-02 10:15:04 UTC 4,729 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6237],{28801:function(e){e.exports=function(e){return void 0===e}},47795:function(e,l,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/funding/[purchaseId]/matched",function(){return a(941)}])},22439:function(e,l,a){"use strict";a.d(l,{m:function(){return r}});var i=a(85893),n=a(50788),t=a(30488);const r=e=>{let{ariaLabel:l="delete",color:a="primary",onDelete:r,size:c="large",...o}=e;return(0,i.jsx)(t.h,{icon:n.FU5,ariaLabel:l,color:a,onClick:r,size:c,...o})}},14031:function(e,l,a){"use strict";a.d(l,{g:function(){return n}});var i=a(85893);const n=e=>{let{className:l="",...a}=e;return(0,i.jsx)("div",{className:"flex flex-col ".concat(l),...a})}},941:function(e,l,a){"use strict";a.r(l),a.d(l,{default:function(){return A}});var i=a(85893),n=a(27060),t=a(28801),r=a.n(t),c=a(11163),o=a(67294),s=a(48673),d=a(82999),u=a(44156),v=a(24276),h=a(23065),m=a(7515),p=a(22439),x=a(75850),f=a(30552),g=a(50787),j=a(14031),N=a(89827),w=a(27518),b=a(80037),V=a(33712),I=a(73967);var A=(0,V.Wb)((()=>{const{confirm:e}=(0,s.N)(),{query:l}=(0,c.useRouter)(),{purchaseId:a}=l,{called:t,data:V,loading:A}=(0,N.yKR)({variables:{purchaseId:a}}),[M,{loading:_}]=(0,N.RIs)({refetchQueries:[N.CN7.Query.getInstructionViewWithMatches]}),{InstructionView:y}=V||{InstructionView:[]},P=y[0],C=(null===P||void 0===P?void 0:P.Matches)||[],D=(0,o.useMemo)((()=>C.map((e=>e.Id))||[]),[null===V||void 0===V?void 0:V.InstructionView]),k=(0,o.useCallback)((async()=>{await e({title:"Delete matches",description:"Are you sure you want to delete all matches?"})&&M({variables:{input:{MatchIds:D}}})}),[e,M,D]),T=(0,o.useCallback)((async l=>{await e({title:"Delete match",description:"Are you sure you want to delete this match?"})&&M({variables:{input:{MatchIds:[l]}}})}),[e,M]),E=(0,o.useMemo)((()=>{const e=(0,n.Cl)();return[e.accessor("Application",{header:"Ref",cell:e=>{var l;return null===(l=e.getValue())||void 0===l?void 0:l.Reference}}),e.accessor("Application",{header:"Season",cell:e=>{var l,a;return null===(a=e.getValue())||void 0===a||null===(l=a.Season)||void 0===l?void 0:l.Name}}),e.accessor("Application",{header:"Planter",cell:e=>{var l,a,n,t,r,c,o,s;return(0,i.jsx)(u.h$,{href:(0,w.oz)({routeParams:{accountId:null===(n=e.getValue())||void 0===n||null===(a=n.Planter)||void 0===a||null===(l=a.Account)||void 0===l?void 0:l.Id}}),children:(0,i.jsxs)("div",{children:[(null===(r=e.getValue())||void 0===r||null===(t=r.Planter)||void 0===t?void 0:t.Name)||"-",(0,i.jsx)("br",{}),(0,i.jsx)("i",{children:(null===(s=e.getValue())||void 0===s||null===(o=s.Planter)||void 0===o||null===(c=o.Account)||void 0===c?void 0:c.Email)||"-"})]})})}}),e.accessor("Application",{header:"Application",cell:e=>{var l,a;return(0,i.jsx)(u.h$,{href:(0,w.jB)({routeParams:{applicationId:null===(l=e.getValue())||void 0===l?void 0:l.Id}}),children:null===(a=e.getValue())||void 0===a?void 0:a.Name})}}),e.accessor("Application",{header:"Location",cell:e=>{var l,a,i,n;return[null===(a=e.getValue())||void 0===a||null===(l=a.Region)||void 0===l?void 0:l.Name,null===(n=e.getValue())||void 0===n||null===(i=n.District)||void 0===i?void 0:i.Name].filter((e=>!r()(e))).join(", ")||"-"}}),e.accessor("Quantity",{header:"Matched",cell:e=>e.getValue()}),e.accessor("Application",{header:"Created on",cell:e=>{var l;return(0,I.p6)({date:null===(l=e.getValue())||void 0===l?void 0:l.CreatedOn,format:"DD/MM/YYYY",isUtc:!0})}}),e.accessor("Id",{header:"Actions",cell:e=>(0,i.jsx)(p.m,{ariaLabel:"Delete match",onDelete:()=>T(e.getValue())})})]}),[T]);return!t||A||P?(0,i.jsx)(m.T3,{title:"Funding Matches | Admin",children:(0,i.jsx)(j.g,{className:"w-full",children:(0,i.jsx)(v.T,{isLoading:A||_,children:(0,i.jsx)(g.G,{activeTab:g.i.Matched,purchase:null===P||void 0===P?void 0:P.AdminPurchaseView,children:(0,i.jsxs)("div",{className:"xl:flex xl:space-x-6",children:[(0,i.jsxs)("div",{className:"xl:flex-none xl:w-4/5 xl:border-r-2 pr-4",children:[(0,i.jsx)(x.i,{className:"mb-4",columns:E,data:C}),(0,i.jsx)(d.B,{variant:"lime","aria-label":"Delete all matches",disabled:!D.length,onClick:k,children:"Unmatch all"})]}),(0,i.jsxs)("div",{className:"xl:w-1/5",children:[(0,i.jsx)("div",{className:"mb-3",children:(0,i.jsx)(h.XJ,{children:"Purchase"})}),(0,i.jsx)(f.g,{matched:null===P||void 0===P?void 0:P.Matched,purchase:null===P||void 0===P?void 0:P.AdminPurchaseView,trees:null===P||void 0===P?void 0:P.Trees,unmatched:null===P||void 0===P?void 0:P.Unmatched})]})]})})})})}):(0,i.jsx)(b.T,{})}))}},function(e){e.O(0,[5970,509,1255,5666,9759,9336,1317,5850,9806,9143,2888,9774,179],(function(){return l=47795,e(e.s=l);var l}));var l=e.O();_N_E=l}]);
2//# sourceMappingURL=matched-6e6478b528f4988f.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.